This repository has been archived by the owner on Aug 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
66 changed files
with
1,263 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 138 additions & 0 deletions
138
...erce.Manager/Apps/Customization/ColumnTemplates/ColumnsActions.GridEntity.CustomPage.ascx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<%@ Control Language="C#" AutoEventWireup="true" Inherits="Mediachase.BusinessFoundation.CustomColumnBaseEntityType" ClassName="Mediachase.Commerce.Manager.Apps.Customization.ColumnTemplates.ColumnsActions_GridEntity_CustomPage" %> | ||
<%@ Import Namespace="System.Collections.Generic" %> | ||
<%@ Import Namespace="System.Globalization" %> | ||
<%@ Import Namespace="System.IO" %> | ||
<%@ Import Namespace="System.Web.Hosting" %> | ||
<%@ Import Namespace="System.Xml.XPath" %> | ||
|
||
<%@ Import Namespace="Mediachase.BusinessFoundation" %> | ||
<%@ Import Namespace="Mediachase.BusinessFoundation.Data.Business" %> | ||
<%@ Import Namespace="Mediachase.BusinessFoundation.Data.Meta.Management" %> | ||
<%@ Import Namespace="Mediachase.Commerce.Customization" %> | ||
<%@ Import Namespace="Mediachase.Commerce.Customization.Plugins" %> | ||
|
||
<script language="c#" runat="server"> | ||
protected string GetValue(EntityObject DataItem) | ||
{ | ||
string retVal = ""; | ||
if (DataItem != null && DataItem.PrimaryKeyId.HasValue) | ||
retVal = BindAction(DataItem); | ||
else if (DataItem != null) | ||
RegisterCommands(DataItem); | ||
return retVal; | ||
} | ||
void RegisterCommands(EntityObject DataItem) | ||
{ | ||
string ownClassName = DataItem.MetaClassName; | ||
MetaClass ownClass = MetaDataWrapper.GetMetaClassByName(DataItem.MetaClassName); | ||
if (ownClass.CardOwner != null) | ||
ownClassName = ownClass.CardOwner.Name; | ||
IXPathNavigable navigable = Mediachase.BusinessFoundation.XmlBuilder.GetXml(StructureType.ListViewUI, new Selector(ownClassName, this.ViewName, this.Place)); | ||
XPathNavigator actions = navigable.CreateNavigator().SelectSingleNode("ListViewUI/Grid/CustomColumns"); | ||
foreach (XPathNavigator gridItem in actions.SelectChildren("Column", string.Empty)) | ||
{ | ||
string type = gridItem.GetAttribute("type", string.Empty); | ||
string id = gridItem.GetAttribute("id", string.Empty); | ||
if (type == "ColumnsActions" && id == this.ColumnId) | ||
{ | ||
foreach (XPathNavigator actionItem in gridItem.SelectChildren("Item", string.Empty)) | ||
{ | ||
string commandName = actionItem.GetAttribute("commandName", string.Empty); | ||
CommandManager.GetCurrent(this.Page).AddCommand(ownClassName, this.ViewName, this.Place, commandName); | ||
} | ||
} | ||
} | ||
} | ||
#region BindAction | ||
/// <summary> | ||
/// Binds the action. | ||
/// </summary> | ||
string BindAction(EntityObject DataItem) | ||
{ | ||
string retVal = string.Empty; | ||
string ownClassName = DataItem.MetaClassName; | ||
MetaClass ownClass = MetaDataWrapper.GetMetaClassByName(DataItem.MetaClassName); | ||
if (ownClass.CardOwner != null) | ||
ownClassName = ownClass.CardOwner.Name; | ||
IXPathNavigable navigable = Mediachase.BusinessFoundation.XmlBuilder.GetXml(StructureType.ListViewUI, new Selector(ownClassName, this.ViewName, this.Place)); | ||
XPathNavigator actions = navigable.CreateNavigator().SelectSingleNode("ListViewUI/Grid/CustomColumns"); | ||
foreach (XPathNavigator gridItem in actions.SelectChildren("Column", string.Empty)) | ||
{ | ||
string type = gridItem.GetAttribute("type", string.Empty); | ||
string id = gridItem.GetAttribute("id", string.Empty); | ||
if (type == "ColumnsActions" && id == this.ColumnId) | ||
{ | ||
foreach (XPathNavigator actionItem in gridItem.SelectChildren("Item", string.Empty)) | ||
{ | ||
string imageUrl = actionItem.GetAttribute("imageUrl", string.Empty); | ||
string commandName = actionItem.GetAttribute("commandName", string.Empty); | ||
string paddingLeft = actionItem.GetAttribute("paddingLeft", string.Empty); | ||
string paddingRight = actionItem.GetAttribute("paddingRight", string.Empty); | ||
string tooltip = actionItem.GetAttribute("tooltip", string.Empty); | ||
Dictionary<string, string> dic = new Dictionary<string, string>(); | ||
if (this.DataItem == null) | ||
dic.Add("primaryKeyId", ""); | ||
else if (!DataItem.PrimaryKeyId.HasValue) | ||
dic.Add("primaryKeyId", ""); | ||
else | ||
dic.Add("primaryKeyId", DataItem.PrimaryKeyId.ToString()); | ||
if (DataItem.Properties.Contains(CustomPageNormalizationPlugin.FieldNameCreatedLevel)) | ||
dic.Add(CustomPageNormalizationPlugin.FieldNameCreatedLevel, ((int)(CustomPageLevel)DataItem.Properties[CustomPageNormalizationPlugin.FieldNameCreatedLevel].Value).ToString()); | ||
if (DataItem.Properties.Contains(CustomPageNormalizationPlugin.FieldNameModifiedLevel)) | ||
dic.Add(CustomPageNormalizationPlugin.FieldNameModifiedLevel, ((int)(CustomPageLevel)DataItem.Properties[CustomPageNormalizationPlugin.FieldNameModifiedLevel].Value).ToString()); | ||
if (DataItem.Properties.Contains(CustomPageEntity.FieldUid)) | ||
dic.Add(CustomPageEntity.FieldUid, DataItem.Properties[CustomPageEntity.FieldUid].Value.ToString()); | ||
dic.Add("className", DataItem.MetaClassName); | ||
CommandParameters cp = new CommandParameters(commandName, dic); | ||
bool isEnable = true; | ||
string clientScript = CommandManager.GetCurrent(this.Page).AddCommand(ownClassName, this.ViewName, this.Place, cp, out isEnable); | ||
imageUrl = this.ResolveClientUrl(imageUrl); | ||
//create ImageButton control | ||
ImageButton img = new ImageButton(); | ||
img.ImageUrl = imageUrl; | ||
if (tooltip != string.Empty) | ||
{ | ||
tooltip = Mediachase.Ibn.Web.UI.CHelper.GetResFileString(tooltip); | ||
img.ToolTip = tooltip; | ||
} | ||
img.OnClientClick = string.Format("{0}; return false;", clientScript); | ||
if (paddingRight != string.Empty) | ||
img.Style.Add(HtmlTextWriterStyle.PaddingRight, paddingRight + "px"); | ||
if (paddingLeft != string.Empty) | ||
img.Style.Add(HtmlTextWriterStyle.PaddingLeft, paddingLeft + "px"); | ||
//ImageButton control -> toString() | ||
StringBuilder sb = new StringBuilder(); | ||
StringWriter tw = new StringWriter(sb); | ||
HtmlTextWriter hw = new HtmlTextWriter(tw); | ||
img.RenderControl(hw); | ||
//add image button | ||
if (isEnable) | ||
retVal += sb.ToString(); | ||
} | ||
} | ||
} | ||
return retVal; | ||
} | ||
#endregion | ||
</script> | ||
<%# GetValue(DataItem) %> |
18 changes: 18 additions & 0 deletions
18
....Reference.Commerce.Manager/Apps/Customization/Config/ListViewProfiles/CustomPage.@[email protected]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ListViewProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||
<Id>{FDFA05F5-D146-4b6d-9434-BA1B9DE2230B}</Id> | ||
<Name>CustomPage</Name> | ||
<IsSystem>true</IsSystem> | ||
<IsPublic>true</IsPublic> | ||
<FieldSetName>CustomPage</FieldSetName> | ||
<FieldSet> | ||
<string>Title</string> | ||
<string>Description</string> | ||
</FieldSet> | ||
<Filters> | ||
</Filters> | ||
<ColumnsUI> | ||
<Column field="Title" width="200px" title="{Global:_mc_Title}" /> | ||
<Column field="Description" width="400px" title="{Global:_mc_Description}" /> | ||
</ColumnsUI> | ||
</ListViewProfile> |
56 changes: 56 additions & 0 deletions
56
...Reference.Commerce.Manager/Apps/Customization/Config/ListViewUI/[email protected]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ListViewUI> | ||
<Toolbar> | ||
<clear/> | ||
<add> | ||
<Button id="NewItemButton" text="{Common:NewCustomPage}" imageUrl="~/Apps/MetaDatabase/images/newitem.gif" commandName="MC_WE_NewPage" itemSplitter="Right"></Button> | ||
</add> | ||
</Toolbar> | ||
<Grid> | ||
<add> | ||
<CustomColumns id="CustomPages_Columns"> | ||
<Column id="460743ED-0CB4-41C5-8BA1-5C479D694F2C" type="ColumnsActions" templateUrl="~/Apps/Customization/ColumnTemplates/ColumnsActions.GridEntity.CustomPage.ascx"> | ||
<Item imageUrl="~/Apps/MetaDatabase/images/Publish.png" commandName="MC_WE_PublishPage" paddingRight="5" tooltip="{GlobalMetaInfo:Publish}" /> | ||
<Item imageUrl="~/Apps/MetaDatabase/images/edit.gif" commandName="MC_WE_EditPage" paddingRight="5" tooltip="{Common:Edit}" /> | ||
<Item imageUrl="~/Apps/MetaDatabase/images/undo.png" commandName="MC_WE_PageUndo" paddingRight="5" tooltip="{Common:Undo}" /> | ||
<Item imageUrl="~/Apps/MetaDatabase/images/delete.gif" commandName="MC_WE_PageDelete" paddingRight="5" tooltip="{Common:Delete}" /> | ||
</Column> | ||
</CustomColumns> | ||
</add> | ||
</Grid> | ||
<Commands> | ||
<clear/> | ||
<add> | ||
<Command id="MC_WE_NewPage"> | ||
<CommandType>Navigate</CommandType> | ||
<Url>~/Apps/Customization/Pages/CustomPageEdit.aspx</Url> | ||
</Command> | ||
<Command id="MC_WE_EditPage"> | ||
<CommandType>Navigate</CommandType> | ||
<Url>~/Apps/Customization/Pages/CustomPageEdit.aspx?Id=[ClientParam:primaryKeyId]</Url> | ||
</Command> | ||
<Command id="MC_WE_PageUndo"> | ||
<CommandType>ServerAction</CommandType> | ||
<Handler type="Mediachase.Commerce.Manager.Apps.Customization.CommandHandlers.UndoPageHandler, Mediachase.ConsoleManager" /> | ||
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Customization.CommandHandlers.UndoPageEnableHandler, Mediachase.ConsoleManager" /> | ||
<ConfirmationText>{Common:UndoChanges}</ConfirmationText> | ||
</Command> | ||
<Command id="MC_WE_PageDelete"> | ||
<CommandType>ServerAction</CommandType> | ||
<Handler type="Mediachase.Commerce.Manager.Apps.Customization.CommandHandlers.DeletePageHandler, Mediachase.ConsoleManager" /> | ||
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Customization.CommandHandlers.DeletePageEnableHandler, Mediachase.ConsoleManager" /> | ||
<ConfirmationText>{Common:DeleteItemConfirmation}</ConfirmationText> | ||
</Command> | ||
<Command id="MC_WE_PublishPage"> | ||
<CommandType>OpenFrameModalPopup</CommandType> | ||
<PopupTitle>{GlobalMetaInfo:Publication}</PopupTitle> | ||
<Url>~/Apps/Customization/Pages/CustomPagePublish.aspx?Uid=[ClientParam:Uid]</Url> | ||
<Width>750</Width> | ||
<Height>485</Height> | ||
<Top>55</Top> | ||
<Left>55</Left> | ||
<Drag>True</Drag> | ||
</Command> | ||
</add> | ||
</Commands> | ||
</ListViewUI> |
45 changes: 45 additions & 0 deletions
45
...Commerce.Manager/Apps/Customization/Config/MetaView/@.Customization.LeftMenuItem-List.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<MetaView> | ||
<Toolbar> | ||
<add> | ||
<Button id="AddLeftMenuItemButton" text="{Global:_mc_Add}" imageUrl="~/Apps/Shell/styles/Images/new.png" commandName="cmdCustomizationNewLeftMenuItem" permission="customization:admin:menu:new"/> | ||
</add> | ||
</Toolbar> | ||
|
||
<Commands> | ||
<add> | ||
<Command id="cmdCustomizationNewLeftMenuItem"> | ||
<CommandType>OpenFrameModalPopup</CommandType> | ||
<PopupTitle>{Common:Adding}</PopupTitle> | ||
<Url>~/Apps/Customization/Pages/LeftMenuItemAdd.aspx</Url> | ||
<Width>800</Width> | ||
<Height>485</Height> | ||
<Top>55</Top> | ||
<Left>50</Left> | ||
<Drag>True</Drag> | ||
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Core.CommandHandlers.Common.CommandHandlerBase, Mediachase.ConsoleManager" /> | ||
</Command> | ||
|
||
<!-- Grid commands --> | ||
<Command id="cmdCustomizationGridLeftMenuItemEdit"> | ||
<CommandType>OpenFrameModalPopup</CommandType> | ||
<PopupTitle>{Common:Editing}</PopupTitle> | ||
<Url>~/Apps/Customization/Pages/LeftMenuItemEdit.aspx?FullId=[ClientParam:primaryKeyId]&added=[ClientParam:added]</Url> | ||
<Width>500</Width> | ||
<Height>280</Height> | ||
<Top>55</Top> | ||
<Left>100</Left> | ||
<Drag>True</Drag> | ||
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Core.CommandHandlers.Common.CommandHandlerBase, Mediachase.ConsoleManager" /> | ||
</Command> | ||
|
||
<Command id="cmdCustomizationGridLeftMenuItemDelete"> | ||
<CommandType>ServerAction</CommandType> | ||
<Handler type="Mediachase.Commerce.Manager.Apps.Customization.CommandHandlers.LeftMenuItemDeleteHandler, Mediachase.ConsoleManager" /> | ||
<UpdatePanelIds>panelMainListView</UpdatePanelIds> | ||
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Customization.CommandHandlers.LeftMenuItemDeleteEnableHandler, Mediachase.ConsoleManager" /> | ||
<ConfirmationText>{Common:DeleteItemConfirmation}</ConfirmationText> | ||
</Command> | ||
</add> | ||
</Commands> | ||
</MetaView> |
12 changes: 12 additions & 0 deletions
12
...ger/Apps/Customization/Config/MetaView/Portal.PortalCustomization.PortalCustomization.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<MetaView> | ||
<Toolbar> | ||
<add> | ||
<Text text="{Common:PortalCustomization}" cssClass="ibn-WPTitle"></Text> | ||
</add> | ||
</Toolbar> | ||
<Grid> | ||
</Grid> | ||
<Commands> | ||
</Commands> | ||
</MetaView> |
64 changes: 64 additions & 0 deletions
64
...EPiServer.Reference.Commerce.Manager/Apps/Customization/Config/View/LeftMenuItem-List.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<View xmlns="http://schemas.mediachase.com/ecf/view"> | ||
<ListViewUI> | ||
<Grid> | ||
<add> | ||
<Columns> | ||
<Column width="50" allowSorting="false" dataField="FullId" headingText="" columnType="CustomTemplate"> | ||
<Template id="ItemActionsTemplate" controlUrl="GridTemplates/LeftMenuItemActionsTemplate.ascx" /> | ||
</Column> | ||
<!--<Column visible="true" width="100" dataField="Added" headingText="Added" /> | ||
<Column visible="true" width="100" dataField="FullId" headingText="FullId" />--> | ||
<Column width="400" allowSorting="true" dataField="Title" headingText="{Common:Title}" /> | ||
<Column width="100" allowSorting="true" dataField="Order" headingText="{Common:Order}" /> | ||
</Columns> | ||
</add> | ||
</Grid> | ||
<Toolbar> | ||
<add> | ||
<Button id="AddLeftMenuItemButton" text="{Global:_mc_Add}" imageUrl="~/Apps/Shell/styles/Images/new.png" commandName="cmdCustomizationNewLeftMenuItem" permissions="core:mng:leftmenu"/> | ||
</add> | ||
</Toolbar> | ||
|
||
<Commands> | ||
<add> | ||
<Command id="cmdCustomizationNewLeftMenuItem"> | ||
<CommandType>OpenFrameModalPopup</CommandType> | ||
<PopupTitle>{Common:Adding}</PopupTitle> | ||
<Url>~/Apps/Customization/Pages/LeftMenuItemAdd.aspx</Url> | ||
<Width>800</Width> | ||
<Height>485</Height> | ||
<Top>55</Top> | ||
<Left>50</Left> | ||
<Drag>True</Drag> | ||
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Core.CommandHandlers.Common.CommandHandlerBase, Mediachase.ConsoleManager" /> | ||
</Command> | ||
|
||
<!-- Grid commands --> | ||
<Command id="cmdCustomizationGridLeftMenuItemEdit"> | ||
<CommandType>OpenFrameModalPopup</CommandType> | ||
<PopupTitle>{Common:Editing}</PopupTitle> | ||
<Url>~/Apps/Customization/Pages/LeftMenuItemEdit.aspx?FullId=[ClientParam:primaryKeyId]&added=[ClientParam:added]</Url> | ||
<Width>500</Width> | ||
<Height>280</Height> | ||
<Top>55</Top> | ||
<Left>100</Left> | ||
<Drag>True</Drag> | ||
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Core.CommandHandlers.Common.CommandHandlerBase, Mediachase.ConsoleManager" /> | ||
</Command> | ||
|
||
<Command id="cmdCustomizationGridLeftMenuItemDelete"> | ||
<CommandType>ServerAction</CommandType> | ||
<Handler type="Mediachase.Commerce.Manager.Apps.Customization.CommandHandlers.LeftMenuItemDeleteHandler, Mediachase.ConsoleManager" /> | ||
<UpdatePanelIds>panelMainListView</UpdatePanelIds> | ||
<EnableHandler type="Mediachase.Commerce.Manager.Apps.Customization.CommandHandlers.LeftMenuItemDeleteEnableHandler, Mediachase.ConsoleManager" /> | ||
<ConfirmationText>{Common:DeleteItemConfirmation}</ConfirmationText> | ||
</Command> | ||
</add> | ||
</Commands> | ||
|
||
</ListViewUI> | ||
<ViewConfig> | ||
<setAttributes id="LeftMenuItem-List" controlUrl="Customization/Modules/LeftMenuItems.ascx" /> | ||
</ViewConfig> | ||
</View> |
Oops, something went wrong.