private void RegisterPersonaPieChart()
 {
     if (ModuleEntryManager.IsModuleLoaded(ModuleName.PERSONAS))
     {
         RegisterChart("CMS.ContactManagement/Demographics/personaChart", personaChartDiv.ClientID);
     }
 }
Example #2
0
    private void InitBindSkuAction()
    {
        if (RequiresDialog)
        {
            return;
        }

        if ((DocumentManager.NodeID > 0) && (DocumentManager.Node != null) && (Action != "newculture"))
        {
            var dataClass = DataClassInfoProvider.GetDataClassInfo(DocumentManager.Node.ClassName);
            if ((dataClass != null) && ModuleEntryManager.IsModuleLoaded(ModuleName.ECOMMERCE))
            {
                plcSkuBinding.Visible = dataClass.ClassIsProduct;

                btnBindSku.Click += (sender, args) =>
                {
                    string url = "~/CMSModules/Ecommerce/Pages/Content/Product/Product_Edit_General.aspx";
                    url = URLHelper.AddParameterToUrl(url, "nodeid", DocumentManager.NodeID.ToString());
                    url = URLHelper.AddParameterToUrl(url, "action", "bindsku");
                    if (RequiresDialog)
                    {
                        url = URLHelper.AddParameterToUrl(url, "dialog", "1");
                    }
                    Response.Redirect(url);
                };
            }
        }
    }
Example #3
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        string parentCulture    = QueryHelper.GetString("parentculture", LocalizationContext.PreferredCultureCode);
        bool   isCultureAllowed = CheckPreferredCulture(parentCulture);

        if (!isCultureAllowed)
        {
            ShowWarning(GetString("licensevalidation.newdocumentcultureversion"));
            plc.Visible = false;
            return;
        }

        EnsureChildControls();

        ctrl.SelectionUrl = URLHelper.AppendQuery(ResolveUrl(CONTENT_CMSDESK_FOLDER + "Edit/Edit.aspx"), RequestContext.CurrentQueryString);

        // Create new document by default
        if (string.IsNullOrEmpty(QueryHelper.GetString("action", null)))
        {
            ctrl.SelectionUrl = URLHelper.AddParameterToUrl(ctrl.SelectionUrl, "action", "new");
        }

        if (ModuleEntryManager.IsModuleLoaded(ModuleName.ECOMMERCE))
        {
            string url = "~/CMSModules/Ecommerce/Pages/Tools/Products/Product_New.aspx";
            url = URLHelper.AddParameterToUrl(url, "content", "1");
            ctrl.ProductSelectionUrl = URLHelper.AppendQuery(ResolveUrl(url), RequestContext.CurrentQueryString);
        }

        // Current Node ID
        ctrl.ParentNodeID  = QueryHelper.GetInteger("parentnodeid", 0);
        ctrl.ParentCulture = parentCulture;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ModuleEntryManager.IsModuleLoaded(ModuleName.COMMUNITY))
        {
            // Load the group selector
            ctrl    = LoadUserControl(controlPath) as FormEngineUserControl;
            ctrl.ID = "groupSelector";

            plcGroupSelector.Controls.Add(ctrl);

            UniSelector usGroups = ctrl.GetValue("CurrentSelector") as UniSelector;
            if (usGroups != null)
            {
                usGroups.ReturnColumnName = "GroupID";
            }

            usGroups.UseUniSelectorAutocomplete = false;

            mSiteId  = QueryHelper.GetInteger("siteid", 0);
            mNodeId  = QueryHelper.GetInteger("nodeid", 0);
            mGroupId = QueryHelper.GetInteger("groupid", 0);

            if (!RequestHelper.IsPostBack())
            {
                ctrl.Value = mGroupId;
            }

            ctrl.IsLiveSite = false;
            ctrl.SetValue("DisplayCurrentGroup", false);
            ctrl.SetValue("DisplayNoneValue", true);
            ctrl.SetValue("SiteID", mSiteId);
            ctrl.SetValue("CurrentSelector", usGroups);
        }
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check if parent object exists
        if ((PollId > 0) && !IsLiveSite)
        {
            UIContext.EditedObject = PollInfoProvider.GetPollInfo(PollId);
        }

        ScriptHelper.RegisterDialogScript(Page);

        uniGrid.IsLiveSite            = IsLiveSite;
        uniGrid.OnAction             += uniGrid_OnAction;
        uniGrid.GridView.AllowSorting = false;
        uniGrid.WhereCondition        = "AnswerPollID=" + PollId;
        uniGrid.ZeroRowsText          = GetString("general.nodatafound");
        uniGrid.OnExternalDataBound  += UniGrid_OnExternalDataBound;
        uniGrid.OnBeforeDataReload   += UniGrid_OnBeforeDataReload;

        if (!AllowEdit)
        {
            uniGrid.ShowObjectMenu = false;
        }

        bizFormsAvailable = ModuleEntryManager.IsModuleLoaded(ModuleName.BIZFORM) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleName.BIZFORM, SiteContext.CurrentSiteName);
    }
    /// <summary>
    /// Creates editing url based on object type (document, product, product section).
    /// </summary>
    /// <param name="currentNode">Edited node.</param>
    private string GetEditUrl(TreeNode currentNode)
    {
        string url;

        if (currentNode.HasSKU && ModuleEntryManager.IsModuleLoaded(ModuleName.ECOMMERCE))
        {
            url = "~/CMSModules/Ecommerce/Pages/Content/Product/Product_Edit_General.aspx";
        }
        else
        {
            url = "~/CMSModules/Content/CMSDesk/Edit/Edit.aspx";
        }

        url = URLHelper.AddParameterToUrl(url, "nodeid", NodeID.ToString());
        url = URLHelper.AddParameterToUrl(url, "action", "newculture");
        url = URLHelper.AddParameterToUrl(url, "mode", Mode);
        url = URLHelper.AddParameterToUrl(url, "parentculture", RequiredCulture);
        url = URLHelper.AddParameterToUrl(url, "culture", RequiredCulture);
        url = URLHelper.AddParameterToUrl(url, "parentnodeid", currentNode.NodeParentID.ToString());

        if (IsInCompare)
        {
            url = URLHelper.AddParameterToUrl(url, "compare", "1");
        }

        if (RequiresDialog)
        {
            url = URLHelper.AddParameterToUrl(url, "dialog", "1");
        }

        return(url);
    }
    /// <summary>
    /// Loads media library data
    /// </summary>
    public void LoadLibraryData()
    {
        if (mLibraryDataLoaded)
        {
            return;
        }

        // Display group selector only when group module is present
        if (ModuleEntryManager.IsModuleLoaded(ModuleName.COMMUNITY) && (groupsSelector != null))
        {
            HandleGroupsSelection();
        }
        else
        {
            // Reload libraries
            LoadLibrarySelection();

            // Pre-select library
            PreselectLibrary();

            // OnLibraryChanged will be fired only when control wasn't loaded before
            if (!IsSelectorLoaded)
            {
                IsSelectorLoaded = true;
                RaiseOnLibraryChanged();
            }
        }

        mLibraryDataLoaded = true;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Required field validator error messages initialization
        rfvAnswerText.ErrorMessage = GetString("Polls_Answer_Edit.AnswerTextError");

        // Set if it is live site
        txtAnswerText.IsLiveSite = IsLiveSite;

        // Set edited object
        EditedObject = PollAnswer;

        // Load BizForm selector if BizForms module is available
        if (ModuleEntryManager.IsModuleLoaded(ModuleName.BIZFORM) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleName.BIZFORM, SiteContext.CurrentSiteName))
        {
            bizFormElem         = (FormEngineUserControl)Page.LoadUserControl("~/CMSModules/BizForms/FormControls/SelectBizForm.ascx");
            bizFormElem.ShortID = "bizFormElem";
            bizFormElem.SetValue("ShowSiteFilter", false);
            plcBizFormSelector.Controls.Add(bizFormElem);
            bizFormElem.Visible = true;

            UniSelector uniSelector = bizFormElem.GetValue("UniSelector") as UniSelector;
            if (uniSelector != null)
            {
                uniSelector.OnSelectionChanged += BizFormSelector_OnSelectionChanged;
            }
        }

        if (!RequestHelper.IsPostBack() && !IsLiveSite)
        {
            LoadData();
        }
    }
 /// <summary>
 /// Disables groups drop-down list when empty.
 /// </summary>
 private void HandleGroupEmpty()
 {
     if (disableGroupSelector && ModuleEntryManager.IsModuleLoaded(ModuleName.COMMUNITY) && (groupsSelector != null))
     {
         groupsSelector.Enabled = false;
     }
 }
Example #10
0
    /// <summary>
    /// Runs code to upgrade SM module using reflection because it uses strongly typed API and it's a separable module, therefore this method cannot be called directly using a reference.
    /// </summary>
    private static void UpgradeSocialMarketing()
    {
        try
        {
            if (ModuleEntryManager.IsModuleLoaded(ModuleName.SOCIALMARKETING))
            {
                Type t = null;
                if (SystemContext.IsWebApplicationProject)
                {
                    var asm = Assembly.Load("CMSAppAppCode");
                    if (asm != null)
                    {
                        t = asm.GetType("SocialMarketingUpgradeProcedure");
                    }
                }
                else
                {
                    t = Assembly.GetExecutingAssembly().GetType("SocialMarketingUpgradeProcedure");
                }

                if (t != null)
                {
                    var method = t.GetMethod("UpgradeV7ToV8");
                    if (method != null)
                    {
                        method.Invoke(null, null);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            EventLogProvider.LogException("Upgrade - Social marketing", "Upgrade", ex);
        }
    }
Example #11
0
    private void RegisterAngularModule()
    {
        var moduleId             = "CMS.WebAnalytics/Campaign/build";
        var localizationProvider = Service.Resolve <IClientLocalizationProvider>();
        var resources            = localizationProvider.GetClientLocalization(moduleId);

        var campaign = new CampaignEditViewModel(GetCampaignInfo(), DateTime.Now);

        ScriptHelper.RegisterAngularModule(moduleId, new {
            Resources                = resources,
            campaign                 = campaign,
            assets                   = GetAssets(campaign.CampaignID),
            conversions              = GetConversions(campaign.CampaignID),
            objective                = GetObjective(campaign.CampaignID),
            activityTypes            = GetActivityTypes(),
            Breadcrumbs              = GetBreadcrumbsData(),
            EmailRegexp              = ValidationHelper.EmailRegExp.ToString(),
            IsNewsletterModuleLoaded = ModuleEntryManager.IsModuleLoaded(ModuleName.NEWSLETTER),
            SiteIsContentOnly        = SiteContext.CurrentSite.SiteIsContentOnly,
            UrlAssetTargetRegex      = PrepareUrlAssetTargetRegex(),
            SmartTips                = PrepareSmartTips(),
            CreatePageDialogUrl      = GetCreateNewPageDialogUrl(),
            SelectEmailDialogUrl     = GetModalDialogUrl("newsletter.issue", "campaignAssetEmail")
        });
    }
Example #12
0
    /// <summary>
    /// Ensures that modules from the App code assembly are registered.
    /// </summary>
    private static void EnsureDynamicModules(object sender, EventArgs e)
    {
        // Ensures CMSModuleLoader module, which has IsDiscoverable set to false
        ModuleEntryManager.EnsureModule <CMSModuleLoader>();

        // Ensures other possible modules within app code assembly
        ModuleEntryManager.EnsureAppCodeModules(typeof(CMSModuleLoader).Assembly);
    }
    /// <summary>
    /// Ensures that modules from the App code (for web site) and CMSApp (for web application) assembly are registered.
    /// </summary>
    private static void EnsureDynamicModules(object sender, EventArgs e)
    {
        // Global.asax.cs is hosted in AppCode/CMSApp assembly
        var appCodeAssembly = Assembly.GetExecutingAssembly();

        // Ensures that registered modules are registered from AppCode/CMSApp assembly
        ModuleEntryManager.EnsureAppCodeModules(appCodeAssembly);
    }
 private void HandlePersonaModuleAvailability()
 {
     if (!ModuleEntryManager.IsModuleLoaded(ModuleName.PERSONAS))
     {
         lblPersonaAndGender.ResourceString = "om.contact.demographics.graphicalrepresentation.gender";
         personaChartDiv.Visible            = false;
     }
 }
Example #15
0
    private void CheckEcommerceLicenseLimitations()
    {
        if (ModuleEntryManager.IsModuleLoaded(ModuleName.ECOMMERCE))
        {
            bool licenseOK = LicenseHelper.CheckLicenseLimitations(FeatureEnum.Ecommerce, out int skuCount, out int maxSKUCount);

            ltlLicenseLimitations.Text    = String.Format(GetString("header.ecommercefeatureexceeded"), skuCount, maxSKUCount);
            pnlLicenseLimitations.Visible = !licenseOK;
        }
    }
    private bool OnButtonFiltered(object sender, UniMenuArgs eventArgs)
    {
        // Hide reports button when reporting module is not loaded
        if (eventArgs.UIElement.ElementName.CompareToCSafe("ecreports", true) == 0)
        {
            return(ModuleEntryManager.IsModuleLoaded(ModuleName.REPORTING));
        }

        return(true);
    }
    protected override void CreateChildControls()
    {
        base.CreateChildControls();

        lnkAdvacedFieldSettings.Click += lnkAdvacedFieldSettings_Click;

        mediaLoaded = ModuleEntryManager.IsModuleLoaded(ModuleName.MEDIALIBRARY);

        LoadSites();
        LoadSiteLibraries(null);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        var currentUser = MembershipContext.AuthenticatedUser;

        // Setup unigrid
        gridClasses.GridView.ShowHeader  = false;
        gridClasses.GridView.BorderWidth = 0;
        gridClasses.OnExternalDataBound += gridClasses_OnExternalDataBound;
        gridClasses.OnBeforeDataReload  += gridClasses_OnBeforeDataReload;
        gridClasses.OnAfterRetrieveData += gridClasses_OnAfterRetrieveData;

        if (ConvertDocumentID > 0)
        {
            // Hide extra options
            plcNewABTestVariant.Visible = false;
            plcNewLink.Visible          = false;
        }
        else
        {
            if (Scope != null)
            {
                // Initialize control by scope settings
                AllowNewABTest &= Scope.ScopeAllowABVariant;
                AllowNewLink   &= Scope.ScopeAllowLinks;
            }

            lblNewLink.Text        = GetString("content.ui.linkexistingdoc");
            lnkNewLink.NavigateUrl = "javascript:modalDialog('" + GetLinkDialogUrl(ParentNodeID) + "', 'contentselectnode', '90%', '85%')";

            plcNewABTestVariant.Visible = false;

            if (ParentNode != null)
            {
                // AB test variant settings
                if (SettingsKeyInfoProvider.GetBoolValue(SiteContext.CurrentSiteName + ".CMSABTestingEnabled") &&
                    AllowNewABTest &&
                    !IsInDialog &&
                    currentUser.IsAuthorizedPerResource("cms.ABTest", "Read") &&
                    ModuleEntryManager.IsModuleLoaded(ModuleName.ONLINEMARKETING) &&
                    ResourceSiteInfoProvider.IsResourceOnSite("CMS.ABTest", SiteContext.CurrentSiteName) &&
                    LicenseHelper.CheckFeature(RequestContext.CurrentDomain, FeatureEnum.ABTesting) &&
                    (ParentNode.NodeAliasPath != "/") &&
                    (ParentNode.NodeClassName != "CMS.Folder"))
                {
                    string url = URLHelper.AddParameterToUrl(NewVariantUrl, "parentnodeid", ParentNodeID.ToString());
                    url = URLHelper.AddParameterToUrl(url, "parentculture", ParentCulture);

                    plcNewABTestVariant.Visible = true;
                    lblNewVariant.Text          = GetString("abtesting.abtestvariant");
                    lnkNewVariant.NavigateUrl   = URLHelper.GetAbsoluteUrl(url);
                }
            }
        }
    }
    /// <summary>
    /// Checks permissions for Reporting module.
    /// </summary>
    private void CheckReportingAvailability()
    {
        if (!ModuleEntryManager.IsModuleLoaded(ModuleName.REPORTING))
        {
            RedirectToUINotAvailable();
        }

        if (!ResourceSiteInfoProvider.IsResourceOnSite("CMS.Reporting", SiteContext.CurrentSiteName))
        {
            RedirectToResourceNotAvailableOnSite("CMS.Reporting");
        }
    }
Example #20
0
    /// <summary>
    /// Ensures that modules from the App code assembly are registered.
    /// </summary>
    private static void EnsureDynamicModules(object sender, EventArgs e)
    {
        ModuleEntryManager.EnsureModule <CMSModuleLoader>();

        var discovery = new ModuleDiscovery();
        var assembly  = typeof(CMSModuleLoader).Assembly;

        foreach (var module in discovery.GetModules(assembly))
        {
            ModuleEntryManager.EnsureModule(module);
        }
    }
Example #21
0
 /// <summary>
 /// Ensures that support chat control is inserted correctly into the header if the chat is module is available.
 /// </summary>
 private void EnsureSupportChat()
 {
     if ((ModuleEntryManager.IsModuleLoaded(ModuleName.CHAT)) && (SiteContext.CurrentSiteID > 0))
     {
         CMSUserControl supportChatControl = Page.LoadUserControl("~/CMSModules/Chat/Controls/SupportChatHeader.ascx") as CMSUserControl;
         if (supportChatControl != null)
         {
             plcSupportChat.Controls.Add(supportChatControl);
             plcSupportChat.Visible = true;
         }
     }
 }
Example #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        siteSelector.UniSelector.OnSelectionChanged   += UniSelector_OnSelectionChanged;
        siteSelector.DropDownSingleSelect.AutoPostBack = true;
        if (!URLHelper.IsPostback())
        {
            siteSelector.SiteID = SiteContext.CurrentSiteID;
        }

        var user = MembershipContext.AuthenticatedUser;

        // Check e-commerce permission
        if (!user.IsAuthorizedPerResource("CMS.Ecommerce", "ReadCustomers") && !user.IsAuthorizedPerResource("CMS.Ecommerce", "EcommerceRead"))
        {
            RedirectToAccessDenied("CMS.Ecommerce", "ReadCustomers OR EcommerceRead");
        }

        // Skip loading customer data when ecommerce module is not present
        if (ModuleEntryManager.IsModuleLoaded(ModuleName.ECOMMERCE))
        {
            // Load customer data
            var customer = BaseAbstractInfoProvider.GetInfoById(PredefinedObjectType.CUSTOMER, QueryHelper.GetInteger("customerId", 0));
            if (customer != null)
            {
                // Check if customer is assigned to current site
                if (!user.CheckPrivilegeLevel(UserPrivilegeLevelEnum.GlobalAdmin) && !CustomerIsOnCurrentSite(customer))
                {
                    EditedObject = null;
                }

                email          = customer.GetStringValue("CustomerEmail", string.Empty);
                firstName      = customer.GetStringValue("CustomerFirstName", string.Empty);
                lastName       = customer.GetStringValue("CustomerLastName", string.Empty);
                customerUserId = customer.GetIntegerValue("CustomerUserID", -1);
                customerSiteId = customer.GetIntegerValue("CustomerSiteID", SiteContext.CurrentSiteID);
            }
        }

        if ((email == null) || (email.Trim() == string.Empty) || (!ValidationHelper.IsEmail(email)))
        {
            headTitle.Visible = false;
            ShowError(GetString("ecommerce.customer.invalidemail"));
            usNewsletters.Visible = false;
        }

        usNewsletters.OnSelectionChanged += usNewsletters_OnSelectionChanged;

        SetWhereCondition();

        LoadSelection(false);
    }
Example #23
0
    private void CheckEcommerceLicenseLimitations()
    {
        if (ModuleEntryManager.IsModuleLoaded(ModuleName.ECOMMERCE))
        {
            int  skuCount;
            int  maxSKUCount;
            bool licenseOK = LicenseHelper.CheckLicenseLimitations(FeatureEnum.Ecommerce, out skuCount, out maxSKUCount);

            var kenticoUrl = KENTICO_LICENSE_URL + (LicenseHelper.CurrentEdition < ProductEditionEnum.UltimateV7 ? KENTICO_ULTIMATE_QUERY : KENTICO_EMS_QUERY);

            ltlLicenseLimitations.Text    = String.Format(GetString("header.ecommercefeatureexceeded"), skuCount, maxSKUCount, kenticoUrl);
            pnlLicenseLimitations.Visible = !licenseOK;
        }
    }
    /// <summary>
    /// Deletes the files for separable modules which are not install and therefore not needed.
    /// </summary>
    private static void DeleteWebPartsOfUninstalledModules()
    {
        var webPartsPath = mWebsitePath + "CMSWebParts\\";
        var files        = new List <string>();

        var separableModules = new List <string>
        {
            ModuleName.BIZFORM,
            ModuleName.BLOGS,
            ModuleName.COMMUNITY,
            ModuleName.ECOMMERCE,
            ModuleName.EVENTMANAGER,
            ModuleName.FORUMS,
            ModuleName.MEDIALIBRARY,
            ModuleName.MESSAGEBOARD,
            ModuleName.MESSAGING,
            ModuleName.NEWSLETTER,
            ModuleName.NOTIFICATIONS,
            ModuleName.ONLINEMARKETING,
            ModuleName.POLLS,
            ModuleName.PROJECTMANAGEMENT,
            ModuleName.REPORTING,
            ModuleName.STRANDSRECOMMENDER,
            ModuleName.CHAT,
        };

        foreach (var separableModule in separableModules)
        {
            // Add files from this folder to the list of files to delete if the module is not installed
            if (!ModuleEntryManager.IsModuleLoaded(separableModule))
            {
                var folderName = GetWebPartFolderName(separableModule);
                files.AddRange(GetAllFiles(webPartsPath + folderName));
            }
        }

        // Remove web parts for separated modules
        foreach (String file in files)
        {
            try
            {
                File.Delete(file);
            }
            catch (Exception ex)
            {
                EventLogProvider.LogException(EventLogSource, "DELETEWEBPARTS", ex, 0, "File: " + file);
            }
        }
    }
Example #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UpdateBreadcrumbs();

        string moduleId = "CMS.ContactManagement/ContactProfile/build";
        var    angularLocalizationProvider = Service.Entry <IAngularLocalizationProvider>();

        ScriptHelper.RegisterAngularModule(moduleId, new
        {
            Resources = angularLocalizationProvider.GetAngularLocalization(moduleId),
            PersonaModuleAvailable    = ModuleEntryManager.IsModuleLoaded(ModuleName.PERSONAS),
            FormModuleAvailable       = ModuleEntryManager.IsModuleLoaded(ModuleName.BIZFORM),
            NewsletterModuleAvailable = ModuleEntryManager.IsModuleLoaded(ModuleName.NEWSLETTER)
        });
    }
Example #26
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        string parentCulture    = QueryHelper.GetString("parentculture", LocalizationContext.PreferredCultureCode);
        bool   isCultureAllowed = CheckPreferredCulture(parentCulture);

        if (!isCultureAllowed)
        {
            ShowWarning(GetString("licensevalidation.newdocumentcultureversion"));
            plc.Visible = false;
            return;
        }

        EnsureChildControls();

        ctrl.SelectionUrl = URLHelper.AppendQuery(ResolveUrl("~/CMSModules/Content/CMSDesk/Edit/Edit.aspx"), RequestContext.CurrentQueryString);

        // Create new document by default
        if (string.IsNullOrEmpty(QueryHelper.GetString("action", null)))
        {
            ctrl.SelectionUrl = URLHelper.AddParameterToUrl(ctrl.SelectionUrl, "action", "new");
        }

        if (ModuleEntryManager.IsModuleLoaded(ModuleName.ECOMMERCE))
        {
            string url = "~/CMSModules/Ecommerce/Pages/Tools/Products/Product_New.aspx";
            url = URLHelper.AddParameterToUrl(url, "content", "1");
            ctrl.ProductSelectionUrl = URLHelper.AppendQuery(ResolveUrl(url), RequestContext.CurrentQueryString);
        }
        ctrl.NewVariantUrl = URLHelper.AppendQuery(ResolveUrl("~/CMSModules/OnlineMarketing/Pages/Content/ABTesting/ABVariant/NewPage.aspx"), RequestContext.CurrentQueryString);

        // Current Node ID
        ctrl.ParentNodeID  = QueryHelper.GetInteger("parentnodeid", 0);
        ctrl.ParentCulture = parentCulture;

        // Handle conversion
        int convertDocumentId = QueryHelper.GetInteger("convertdocumentid", 0);

        if (convertDocumentId > 0)
        {
            ctrl.ConvertDocumentID = convertDocumentId;

            SetTitle(GetString("Content.ConvertTitle"));
            ShowInformation(GetString("Convert.ConvertInfo"));
        }
    }
Example #27
0
    /// <summary>
    /// Checks permissions for Reporting module.
    /// </summary>
    private void CheckReportingAvailability()
    {
        if (!ModuleEntryManager.IsModuleLoaded(ModuleName.REPORTING))
        {
            RedirectToUINotAvailable();
        }

        if (!ResourceSiteInfoProvider.IsResourceOnSite("CMS.Reporting", SiteContext.CurrentSiteName))
        {
            RedirectToResourceNotAvailableOnSite("CMS.Reporting");
        }

        // Check additional read permission to Reporting module
        if (!MembershipContext.AuthenticatedUser.IsAuthorizedPerResource("CMS.Reporting", "Read"))
        {
            RedirectToAccessDenied("CMS.Reporting", "Read");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ContactInfo contact = (ContactInfo)EditedObject;

        UpdateBreadcrumbs(contact);

        string moduleId             = "CMS.ContactManagement/ContactProfile/build";
        var    localizationProvider = Service.Resolve <IClientLocalizationProvider>();

        ScriptHelper.RegisterAngularModule(moduleId, new
        {
            Resources = localizationProvider.GetClientLocalization(moduleId),
            PersonaModuleAvailable    = ModuleEntryManager.IsModuleLoaded(ModuleName.PERSONAS),
            FormModuleAvailable       = ModuleEntryManager.IsModuleLoaded(ModuleName.BIZFORM),
            NewsletterModuleAvailable = ModuleEntryManager.IsModuleLoaded(ModuleName.NEWSLETTER),
            ActivitiesExist           = DoActivitiesExistForContact(contact)
        });
    }
    protected void Header_OnTabCreated(object sender, TabCreatedEventArgs e)
    {
        if (e.Tab == null)
        {
            return;
        }

        switch (e.TabIndex)
        {
        case 1:
            if ((!ModuleEntryManager.IsModuleLoaded(ModuleName.ONLINEMARKETING) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleName.ONLINEMARKETING, SiteContext.CurrentSiteName)))
            {
                // Hide tab if module is not loaded
                e.Tab = null;
            }
            break;
        }
    }
Example #30
0
    protected override void CreateChildControls()
    {
        base.CreateChildControls();

        lnkAdvacedFieldSettings.Click += lnkAdvacedFieldSettings_Click;

        communityLoaded = ModuleEntryManager.IsModuleLoaded(ModuleName.COMMUNITY);
        mediaLoaded     = ModuleEntryManager.IsModuleLoaded(ModuleName.MEDIALIBRARY);

        if (communityLoaded)
        {
            drpGroups.OnSelectionChanged += drpGroups_SelectedIndexChanged;
        }

        LoadSites();
        LoadSiteLibraries(null);
        LoadSiteGroups(null);
        LoadGroupLibraries(null, null);
    }