Esempio n. 1
0
    protected string[] Tabs_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        if (element.ElementName.ToLower() == "contentproduct.customfields")
        {
            // Check if SKU has any custom fields
            FormInfo formInfo = FormHelper.GetFormInfo("ecommerce.sku", false);
            if (formInfo.GetFormElements(true, false, true).Count <= 0)
            {
                return(null);
            }
        }

        return(parameters);
    }
    protected string[] tabElem_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        String script       = "SetTabsContext('');";
        String defaultParam = parameters[1];

        switch (element.ElementName.ToLower())
        {
        case "webpartproperties.code":
            if (!showCodeTab || isNew || isNewVariant)
            {
                return(null);
            }
            break;

        case "webpartproperties.variant":
            script = "SetTabsContext('variants');";
            String varName = (variantMode == VariantModeEnum.MVT) ? "mvtvariant_edit" : "cpvariant_edit";
            defaultParam = "if (window.SetHelpTopic) { window.SetHelpTopic('helpTopic', '" + varName + "')}";
            if ((variantId <= 0) || isNew || isNewVariant)
            {
                return(null);
            }
            break;

        case "webpartzoneproperties.variant":
            if ((zoneVariantId <= 0) || isNew)
            {
                return(null);
            }
            break;

        case "webpartproperties.bindings":
            if (!showBindingTab || isNew || isNewVariant)
            {
                return(null);
            }
            break;

        case "webpartproperties.layout":
            if (isNew || isNewVariant)
            {
                return(null);
            }
            break;
        }

        parameters[1] = script + defaultParam;

        return(parameters);
    }
    protected string[] Tabs_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        // Global objects tab will be displayed only to global admin
        if (!currentUser.IsGlobalAdministrator && (element.ElementName.ToLower() == "configuration.settings.globalobjects"))
        {
            return(null);
        }

        // Add SiteId parameter to each tab
        if (parameters.Length > 2)
        {
            parameters[2] = URLHelper.AddParameterToUrl(parameters[2], "siteId", this.SiteID.ToString());
        }

        return(parameters);
    }
Esempio n. 4
0
    private static string[] tabElem_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex)
    {
        switch (element.ElementName.ToLower())
        {
        case "myprofile.notifications":
            if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.Notifications, ModuleEntry.NOTIFICATIONS) ||
                !ResourceSiteInfoProvider.IsResourceOnSite(ModuleEntry.NOTIFICATIONS, CMSContext.CurrentSiteName))
            {
                return(null);
            }
            break;

        case "myprofile.categories":
            if (!ResourceSiteInfoProvider.IsResourceOnSite("CMS.Categories", CMSContext.CurrentSiteName))
            {
                return(null);
            }
            break;
        }

        return(parameters);
    }