Beispiel #1
0
    protected override void OnInit(EventArgs e)
    {
        // Register script for closing product section editing UI
        string script = "function CancelSectionEdit() { if(GetSelectedMode() == 'sectionedit'){ SetMode('edit',true);}}";

        ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "beforenodeselection", ScriptHelper.GetScript(script));

        UIContext[UIContextDataItemName.SELECTEDCULTURE] = Culture;

        // Pass the parameters
        menu.Values.Add(new UILayoutValue("ShowModeMenu", false));

        tree.Values.AddRange(new[] {
            new UILayoutValue("NodeID", NodeID),
            new UILayoutValue("ExpandNodeID", ExpandNodeID),
            new UILayoutValue("Culture", Culture),
            new UILayoutValue("StartingAliasPath", Page.ProductsStartingPath),
            new UILayoutValue("AllowGlobalObjects", Page.AllowGlobalObjects),
            new UILayoutValue("AllowProductsWithoutDocuments", ECommerceSettings.AllowProductsWithoutDocuments(SiteContext.CurrentSiteName)),
            new UILayoutValue("DisplayProductsInSectionsTree", ECommerceSettings.DisplayProductsInSectionsTree(SiteContext.CurrentSiteName)),
            new UILayoutValue("IsProductTree", true),
            new UILayoutValue("BeforeSelectNodeScript", "CancelSectionEdit();")
        });

        // Show pane only for multilingual site
        language.Visible = SiteContext.CurrentSite.HasMultipleCultures;
    }