Example #1
0
    /// <summary>
    /// Loads media library data
    /// </summary>
    public void LoadLibraryData()
    {
        if (mLibraryDataLoaded)
        {
            return;
        }

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

            // Pre-select library
            PreselectLibrary();

            RaiseOnLibraryChanged();
        }

        mLibraryDataLoaded = true;
    }
Example #2
0
    public override bool LoadData(ActivityInfo ai)
    {
        if ((ai == null) || !ModuleEntry.IsModuleLoaded(ModuleEntry.COMMUNITY))
        {
            return(false);
        }

        switch (ai.ActivityType)
        {
        case PredefinedActivityType.JOIN_GROUP:
        case PredefinedActivityType.LEAVE_GROUP:
            break;

        default:
            return(false);
        }

        if (ai.ActivityItemID > 0)
        {
            BaseInfo binfo = ModuleCommands.CommunityGetGroupInfo(ai.ActivityItemID);
            if (binfo != null)
            {
                string groupDisplayName = binfo.GetStringValue("GroupDisplayName", GetString("general.na"));
                ucDetails.AddRow("om.activitydetails.groupname", groupDisplayName);
            }
        }

        return(true);
    }
    public override bool LoadData(ActivityInfo ai)
    {
        if ((ai == null) || !ModuleEntry.IsModuleLoaded(ModuleEntry.ECOMMERCE))
        {
            return(false);

            ;
        }

        switch (ai.ActivityType)
        {
        case PredefinedActivityType.PRODUCT_ADDED_TO_WISHLIST:
        case PredefinedActivityType.PRODUCT_ADDED_TO_SHOPPINGCART:
        case PredefinedActivityType.PRODUCT_REMOVED_FROM_SHOPPINGCART:
            break;

        default:
            return(false);
        }

        GeneralizedInfo iinfo = ModuleCommands.ECommerceGetSKUInfo(ai.ActivityItemID);

        if (iinfo != null)
        {
            string productName = ValidationHelper.GetString(iinfo.GetValue("SKUName"), null);
            ucDetails.AddRow("om.activitydetails.product", productName);

            if (ai.ActivityType != PredefinedActivityType.PRODUCT_ADDED_TO_WISHLIST)
            {
                ucDetails.AddRow("om.activitydetails.productunits", ai.ActivityValue);
            }
        }

        return(ucDetails.IsDataLoaded);
    }
Example #4
0
    public override bool LoadData(ActivityInfo ai)
    {
        if ((ai == null) || !ModuleEntry.IsModuleLoaded(ModuleEntry.FORUMS))
        {
            return(false);
        }

        switch (ai.ActivityType)
        {
        case PredefinedActivityType.FORUM_POST:
        case PredefinedActivityType.SUBSCRIPTION_FORUM_POST:
            break;

        default:
            return(false);
        }

        int nodeId = ai.ActivityNodeID;

        lblDocIDVal.Text = GetLinkForDocument(nodeId, ai.ActivityCulture);

        if (ai.ActivityType == PredefinedActivityType.FORUM_POST)
        {
            GeneralizedInfo iinfo = ModuleCommands.ForumsGetForumPostInfo(ai.ActivityItemDetailID);
            if (iinfo != null)
            {
                plcComment.Visible     = true;
                lblPostSubjectVal.Text = HTMLHelper.HTMLEncode(ValidationHelper.GetString(iinfo.GetValue("PostSubject"), null));
                txtPost.Text           = ValidationHelper.GetString(iinfo.GetValue("PostText"), null);
            }
        }

        return(true);
    }
Example #5
0
        public Address RegisterEntry(ModuleEntry entry, Address addr)
        {
            switch (entry)
            {
            case GlobalDefinition global:
                var glob = RegisterGlobal(global);
                program.GlobalFields.Fields.Add((int)addr.ToLinear(), glob.DataType, glob.Name);
                return(addr + 1);

            case FunctionDefinition fn:
                var proc = RegisterFunction(fn, addr);
                program.Procedures.Add(addr, proc);
                this.Globals[fn.FunctionName] = new Core.Expressions.ProcedureConstant(
                    new Pointer(proc.Signature, program.Platform.PointerType.BitSize),
                    proc);
                return(addr + 1);

            case TypeDefinition tydec:
                RegisterTypeDefinition(tydec);
                return(addr);

            case Declaration decl:
                RegisterDeclaration(decl);
                return(addr);
            }
            throw new NotImplementedException(entry.GetType().Name);
        }
Example #6
0
        public static List <ModuleEntry> LoadModules(string modulePath, Type[] sharedTypes)
        {
            var moduleEntries = new List <ModuleEntry>();

            foreach (var moduleDir in Directory.GetDirectories(modulePath))
            {
                var dirName    = Path.GetFileName(moduleDir);
                var moduleFile = Path.Combine(moduleDir, "bin", "Debug", "netcoreapp3.0", dirName + ".dll");

                if (File.Exists(moduleFile))
                {
                    var moduleEntry = new ModuleEntry();
                    moduleEntry.Loader = CreateFromAssemblyFile(moduleFile, true, sharedTypes, (cfg) => { cfg.PreferSharedTypes = true; cfg.IsUnloadable = true; });
                    var moduleAssembly = moduleEntry.Loader.LoadDefaultAssembly();
                    moduleEntry.Assembly   = moduleAssembly;
                    moduleEntry.Path       = moduleFile;
                    moduleEntry.PluginName = dirName;

                    var type = moduleAssembly.GetTypes().Where(t => typeof(IPlugin).IsAssignableFrom(t) && !t.IsAbstract).FirstOrDefault();
                    if (type != null)
                    {
                        Debug.WriteLine("Found Module " + type.FullName);
                        moduleEntry.Plugin = (IPlugin)Activator.CreateInstance(type);
                        moduleEntries.Add(moduleEntry);
                    }
                }
            }
            return(moduleEntries);
        }
Example #7
0
    private void InitBindSkuAction()
    {
        if (RequiresDialog)
        {
            return;
        }

        if ((DocumentManager.NodeID > 0) && (DocumentManager.Node != null) && (Action != "newculture"))
        {
            var dataClass = DataClassInfoProvider.GetDataClass(DocumentManager.Node.ClassName);
            if ((dataClass != null) && ModuleEntry.IsModuleLoaded(ModuleEntry.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);
                };
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check if parent object exists
        if ((PollId > 0) && !IsLiveSite)
        {
            CMSPage.EditedObject = PollInfoProvider.GetPollInfo(PollId);
        }

        ScriptHelper.RegisterDialogScript(Page);

        uniGrid.IsLiveSite            = IsLiveSite;
        uniGrid.OnAction             += new OnActionEventHandler(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 = ModuleEntry.IsModuleLoaded(ModuleEntry.BIZFORM) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleEntry.BIZFORM, CMSContext.CurrentSiteName);
    }
    /// <summary>
    /// Resets all boxes.
    /// </summary>
    public void ResetControls()
    {
        txtCodeName.Text    = null;
        txtDisplayName.Text = null;

        //Fill drop down list
        DataHelper.FillWithEnum <AnalyzerTypeEnum>(drpAnalyzer, "srch.index.", SearchIndexInfoProvider.AnalyzerEnumToString, true);

        drpAnalyzer.SelectedValue        = SearchIndexInfoProvider.AnalyzerEnumToString(AnalyzerTypeEnum.StandardAnalyzer);
        chkAddIndexToCurrentSite.Checked = true;

        // Create sorted list for drop down values
        SortedList sortedList = new SortedList();

        sortedList.Add(GetString("srch.index.doctype"), PredefinedObjectType.DOCUMENT);
        // Allow forum only if module is available
        if ((ModuleEntry.IsModuleRegistered(ModuleEntry.FORUMS) && ModuleEntry.IsModuleLoaded(ModuleEntry.FORUMS)))
        {
            sortedList.Add(GetString("srch.index.forumtype"), PredefinedObjectType.FORUM);
        }
        sortedList.Add(GetString("srch.index.usertype"), PredefinedObjectType.USER);
        sortedList.Add(GetString("srch.index.customtabletype"), SettingsObjectType.CUSTOMTABLE);
        sortedList.Add(GetString("srch.index.customsearch"), SearchHelper.CUSTOM_SEARCH_INDEX);
        sortedList.Add(GetString("srch.index.doctypecrawler"), SearchHelper.DOCUMENTS_CRAWLER_INDEX);
        sortedList.Add(GetString("srch.index.general"), SearchHelper.GENERALINDEX);

        drpType.DataValueField = "value";
        drpType.DataTextField  = "key";
        drpType.DataSource     = sortedList;
        drpType.DataBind();

        // Pre-select documents index
        drpType.SelectedValue = PredefinedObjectType.DOCUMENT;
    }
Example #10
0
 /// <summary>
 /// Disables groups drop-down list when empty.
 /// </summary>
 private void HandleGroupEmpty()
 {
     if (disableGroupSelector && ModuleEntry.IsModuleRegistered(ModuleEntry.COMMUNITY) && ModuleEntry.IsModuleLoaded(ModuleEntry.COMMUNITY) && (groupsSelector != null))
     {
         groupsSelector.Enabled = false;
     }
 }
        public ActionResult RecipesPOST(string moduleId, string name)
        {
            if (!Services.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to manage modules")))
            {
                return(new HttpUnauthorizedResult());
            }

            ModuleEntry module = _extensionManager.AvailableExtensions()
                                 .Where(extensionDescriptor => extensionDescriptor.Id == moduleId)
                                 .Select(extensionDescriptor => new ModuleEntry {
                Descriptor = extensionDescriptor
            }).FirstOrDefault();

            if (module == null)
            {
                return(HttpNotFound());
            }



            //try {
            //    _recipeManager.Execute(recipe);
            //}
            //catch(Exception e) {
            //    Logger.Error(e, "Error while executing recipe {0} in {1}", moduleId, name);
            //    Services.Notifier.Error(T("Recipes contains {0} unsupported module installation steps.", recipe.Name));
            //}

            //Services.Notifier.Information(T("The recipe {0} was executed successfully.", recipe.Name));

            return(RedirectToAction("Recipes"));
        }
Example #12
0
    /// <summary>
    /// Initializes group selector.
    /// </summary>
    private void HandleGroupsSelection()
    {
        // Display group selector only when group module is present
        if (ModuleEntry.IsModuleRegistered(ModuleEntry.COMMUNITY) && ModuleEntry.IsModuleLoaded(ModuleEntry.COMMUNITY) && (groupsSelector != null))
        {
            // Global libraries item into group selector
            if (GlobalLibraries != AvailableLibrariesEnum.None)
            {
                // Add special item
                groupsSelector.SetValue("UseDisplayNames", true);
                groupsSelector.SetValue("DisplayGlobalValue", true);
                groupsSelector.SetValue("SiteID", SiteID);
                groupsSelector.SetValue("GlobalValueText", GetString("dialogs.media.globallibraries"));
                groupsSelector.IsLiveSite = IsLiveSite;
            }
            else
            {
                groupsSelector.SetValue("DisplayGlobalValue", false);
            }

            // If all groups should be displayed
            switch (Groups)
            {
            case AvailableGroupsEnum.All:
                // Set condition to load only groups realted to the current site
                groupsSelector.SetValue("WhereCondition", String.Format("(GroupSiteID={0})", SiteID));
                break;

            case AvailableGroupsEnum.OnlyCurrentGroup:
                // Load only current group and disable control
                int groupId = ModuleCommands.CommunityGetCurrentGroupID();
                groupsSelector.SetValue("WhereCondition", String.Format("(GroupID={0})", groupId));
                break;

            case AvailableGroupsEnum.OnlySingleGroup:
                if (!string.IsNullOrEmpty(GroupName))
                {
                    groupsSelector.SetValue("WhereCondition", String.Format("(GroupName = N'{0}' AND GroupSiteID={1})", SqlHelperClass.GetSafeQueryString(GroupName, false), SiteID));
                }
                break;

            case AvailableGroupsEnum.None:
                // Just '(none)' displayed in the selection
                if (GlobalLibraries == AvailableLibrariesEnum.None)
                {
                    groupsSelector.SetValue("DisplayNoneWhenEmpty", true);
                    groupsSelector.SetValue("EnabledGroups", false);
                }
                groupsSelector.SetValue("WhereCondition", String.Format("({0})", SqlHelperClass.NO_DATA_WHERE));
                break;
            }

            // Reload group selector based on recently passed settings
            ((IDataUserControl)groupsSelector).ReloadData(true);
        }
        else
        {
            plcGroupSelector.Visible = false;
        }
    }
Example #13
0
    public override bool LoadData(ActivityInfo ai)
    {
        if ((ai == null) || !ModuleEntry.IsModuleLoaded(ModuleEntry.POLLS) || (ai.ActivityType != PredefinedActivityType.POLL_VOTING))
        {
            return(false);
        }

        GeneralizedInfo ipollinfo = ModuleCommands.PollsGetPollInfo(ai.ActivityItemID);

        if (ipollinfo != null)
        {
            string pollQuestion = ValidationHelper.GetString(ipollinfo.GetValue("PollQuestion"), null);
            ucDetails.AddRow("om.activitydetails.pollquestion", pollQuestion);
        }

        if (ai.ActivityValue != null)
        {
            string[]      answerIDs = ai.ActivityValue.Split(new char[] { ActivityLogProvider.POLL_ANSWER_SEPARATOR }, StringSplitOptions.RemoveEmptyEntries);
            StringBuilder answers   = new StringBuilder();
            foreach (string id in answerIDs)
            {
                GeneralizedInfo iansinfo = ModuleCommands.PollsGetPollAnswerInfo(ValidationHelper.GetInteger(id, 0));
                if (iansinfo != null)
                {
                    answers.Append(HTMLHelper.HTMLEncode(ValidationHelper.GetString(iansinfo.GetValue("AnswerText"), null)));
                    answers.Append("<br />");
                }
            }
            ucDetails.AddRow("om.activitydetails.pollanswer", answers.ToString());
        }

        return(ucDetails.IsDataLoaded);
    }
Example #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Required field validator error messages initialization
        rfvAnswerText.ErrorMessage = GetString("Polls_Answer_Edit.AnswerTextError");

        // Controls initializations
        lblAnswerText.Text = GetString("Polls_Answer_Edit.AnswerTextLabel");
        lblVotes.Text      = GetString("Polls_Answer_Edit.Votes");

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

        // Load BizForm selector if BizForms module is available
        if (ModuleEntry.IsModuleLoaded(ModuleEntry.BIZFORM) && ResourceSiteInfoProvider.IsResourceOnSite(ModuleEntry.BIZFORM, CMSContext.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 += new EventHandler(BizFormSelector_OnSelectionChanged);
            }
        }

        if (!RequestHelper.IsPostBack() && !IsLiveSite)
        {
            LoadData();
        }
    }
    public override bool LoadData(ActivityInfo ai)
    {
        if ((ai == null) || !ModuleEntry.IsModuleLoaded(ModuleEntry.MESSAGEBOARD))
        {
            return(false);
        }

        switch (ai.ActivityType)
        {
        case PredefinedActivityType.MESSAGE_BOARD_COMMENT:
        case PredefinedActivityType.SUBSCRIPTION_MESSAGE_BOARD:
            break;

        default:
            return(false);
        }

        int nodeId = ai.ActivityNodeID;

        lblDocIDVal.Text = GetLinkForDocument(nodeId, ai.ActivityCulture);

        if (ai.ActivityType == PredefinedActivityType.MESSAGE_BOARD_COMMENT)
        {
            plcComment.Visible = true;
            GeneralizedInfo iinfo = ModuleCommands.MessageBoardGetBoardMessageInfo(ai.ActivityItemDetailID);
            if (iinfo != null)
            {
                txtComment.Text = ValidationHelper.GetString(iinfo.GetValue("MessageText"), null);
            }
        }

        return(true);
    }
    public override bool LoadData(ActivityInfo ai)
    {
        if ((ai == null) || !ModuleEntry.IsModuleLoaded(ModuleEntry.NEWSLETTER) || (ai.ActivityType != PredefinedActivityType.NEWSLETTER_CLICKTHROUGH))
        {
            return(false);
        }

        // Get newsletter name
        int             nesletterId = ai.ActivityItemID;
        GeneralizedInfo iinfo       = ModuleCommands.NewsletterGetNewsletterInfo(nesletterId);

        if (iinfo != null)
        {
            string subject = ValidationHelper.GetString(iinfo.GetValue("NewsletterDisplayName"), null);
            ucDetails.AddRow("om.activitydetails.newsletter", subject);
        }

        // Get issue subject
        int issueId = ai.ActivityItemDetailID;

        iinfo = ModuleCommands.NewsletterGetNewsletterIssueInfo(issueId);
        if (iinfo != null)
        {
            string subject = ValidationHelper.GetString(iinfo.GetValue("IssueSubject"), null);
            ucDetails.AddRow("om.activitydetails.newsletterissue", MacroResolver.RemoveSecurityParameters(subject, true, null));
        }

        string targetLink = ai.ActivityURL;

        ucDetails.AddRow("om.activitydetails.newstargetlink", GetLink(targetLink, targetLink), false);

        return(ucDetails.IsDataLoaded);
    }
Example #17
0
        /// <summary>
        /// Override of the ToString method. Provides a data associated with the module.
        /// </summary>
        /// <returns>A string containing relevant data.</returns>
        public override string ToString()
        {
            string ret = "";

            ret += "Module Name        = " + ModuleName + Environment.NewLine;
            ret += "Module Path        = " + ModulePath + Environment.NewLine;
            ret += "Module Version     = " + ModuleVersion + Environment.NewLine;
            ret += "Module Produce     = " + ModuleProduct + Environment.NewLine;
            if (ModuleMachineType == MachineType.x64)
            {
                ret += "Module Handle      = " + "0x" + ModuleBase.ToString("x16") + Environment.NewLine;
                ret += "Module Entrypoint  = " + "0x" + ModuleEntry.ToString("x16") + Environment.NewLine;
                ret += "Module Image Base  = " + "0x" + ModuleImageBase.ToString("x16") + Environment.NewLine;
            }
            else
            {
                ret += "Module Handle      = " + "0x" + ModuleBase.ToString("x8") + Environment.NewLine;
                ret += "Module Entrypoint  = " + "0x" + ModuleEntry.ToString("x8") + Environment.NewLine;
                ret += "Module Image Base  = " + "0x" + ModuleImageBase.ToString("x8") + Environment.NewLine;
            }
            ret += "Module Size        = " + ModuleSize + Environment.NewLine;
            ret += "Module ASLR        = " + ModuleASLR + Environment.NewLine;
            ret += "Module SafeSEH     = " + ModuleSafeSEH + Environment.NewLine;
            ret += "Module Rebase      = " + ModuleRebase + Environment.NewLine;
            ret += "Module NXCompat    = " + ModuleNXCompat + Environment.NewLine;
            ret += "Module OS DLL      = " + ModuleOsDll + Environment.NewLine;
            return(ret);
        }
Example #18
0
    private string GetEditUrl(TreeNode node)
    {
        string url = null;

        if (node.HasSKU && ModuleEntry.IsModuleLoaded(ModuleEntry.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);

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

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

        return(url);
    }
        public NightmareModule(string path)
        {
            this.path = path;
            StreamReader sr = new StreamReader(path);
            string[] lines = StringManipulation.getLines(sr.ReadToEnd());
            sr.Close();

            moduleVersion =         StringManipulation.GenericNumericConverter(lines[0]);
            moduleDescription =                                                lines[1];
            rootOffset =            StringManipulation.GenericNumericConverter(lines[2]);
            numberOfTableEntries =  StringManipulation.GenericNumericConverter(lines[3]);
            lenghtOfEntries =       StringManipulation.GenericNumericConverter(lines[4]);

            if (lines[5] != "NULL")
                entrySelectorFile = File.ReadAllLines(Path.GetDirectoryName(path) + "\\" + lines[5]);

            if (lines[6] != "NULL")
                tableFile = new Text.table(Path.GetDirectoryName(path) + "\\" + lines[6]);

            moduleEntries = new ModuleEntry[(lines.Length - 7) / 5];
            int i = 0;

            while (i < moduleEntries.Length)
            {
                int offset = StringManipulation.GenericNumericConverter(lines[i * 5 + 8]);
                int numberOfBytes = StringManipulation.GenericNumericConverter(lines[i * 5 + 9]);

                string parameterFile = lines[i * 5 + 11];
                if (parameterFile != "NULL")
                    parameterFile = Path.GetDirectoryName(path) + "\\" + lines[i * 5 + 11];

                moduleEntries[i] = new ModuleEntry(lines[i * 5 + 7], offset, numberOfBytes, lines[i * 5 + 10], parameterFile);
                i++;
            }
        }
Example #20
0
    protected TabItem CMSDesk_Default_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex)
    {
        // Ensure additional permissions to 'Content' tab
        if (element.ElementName.ToLowerCSafe() == "content")
        {
            if (!IsUserAuthorizedPerContent())
            {
                exploreTreePermissionMissing = true;
                return(null);
            }
        }
        else if (element.ElementName.ToLowerCSafe() == "ecommerce")
        {
            if (!LicenseHelper.IsFeatureAvailableInUI(FeatureEnum.Ecommerce, ModuleEntry.ECOMMERCE))
            {
                return(null);
            }
        }
        else if (element.ElementName.ToLowerCSafe() == "onlinemarketing")
        {
            if (!ModuleEntry.IsModuleLoaded(ModuleEntry.ONLINEMARKETING))
            {
                return(null);
            }
        }

        return(tab);
    }
Example #21
0
    public override bool LoadData(ActivityInfo ai)
    {
        if ((ai == null) || !ModuleEntry.IsModuleLoaded(ModuleEntry.NEWSLETTER) || (ai.ActivityType != PredefinedActivityType.NEWSLETTER_OPEN))
        {
            return(false);
        }

        // Get newsletter name
        int             nesletterId = ai.ActivityItemID;
        GeneralizedInfo iinfo       = ModuleCommands.NewsletterGetNewsletterInfo(nesletterId);

        if (iinfo != null)
        {
            string subject = ValidationHelper.GetString(iinfo.GetValue("NewsletterDisplayName"), null);
            ucDetails.AddRow("om.activitydetails.newsletter", subject);
        }

        // Get issue subject
        int issueId = ai.ActivityItemDetailID;

        iinfo = ModuleCommands.NewsletterGetNewsletterIssueInfo(issueId);
        if (iinfo != null)
        {
            string subject = ValidationHelper.GetString(iinfo.GetValue("IssueSubject"), null);
            ucDetails.AddRow("om.activitydetails.newsletterissue", subject);
        }

        return(ucDetails.IsDataLoaded);
    }
Example #22
0
    /// <summary>
    /// Initializes DocumentType edit menu.
    /// </summary>
    /// <param name="docTypeId">DocumentTypeID</param>
    protected void InitializeMenu(DataClassInfo classObj)
    {
        int i = 0;

        InitTabs(11, "content");
        SetTab(i++, GetString("general.general"), "DocumentType_Edit_General.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'general_tab18');");

        // If document type is conatiner
        if (classObj.ClassIsCoupledClass)
        {
            SetTab(i++, GetString("general.fields"), "DocumentType_Edit_Fields.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'fields_tab2');");
        }

        SetTab(i++, GetString("general.form"), "DocumentType_Edit_Form.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'form_tab3');");
        SetTab(i++, GetString("DocumentType_Edit_Header.Transformations"), "DocumentType_Edit_Transformation_List.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'transformations_tab');");
        SetTab(i++, GetString("DocumentType_Edit_Header.Queries"), "DocumentType_Edit_Query_List.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'queries_tab');");
        SetTab(i++, GetString("DocumentType_Edit_Header.ChildTypes"), "DocumentType_Edit_ChildTypes.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'child_types_tab');");
        SetTab(i++, GetString("general.sites"), "DocumentType_Edit_Sites.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'sites_tab7');");

        if (classObj.ClassIsProduct && ModuleEntry.IsModuleLoaded(ModuleEntry.ECOMMERCE))
        {
            SetTab(i++, GetString("DocumentType_Edit_Header.Ecommerce"), ResolveUrl("~/CMSModules/Ecommerce/Pages/Development/DocumentTypes/DocumentType_Edit_Ecommerce.aspx") + "?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'e_commerce_tab');");
        }

        SetTab(i++, GetString("doc.header.altforms"), ResolveUrl("~/CMSModules/DocumentTypes/Pages/AlternativeForms/AlternativeForms_List.aspx?classid=" + classObj.ClassID), "SetHelpTopic('helpTopic', 'alternative_forms');");

        // If document type is conatiner
        if (classObj.ClassIsCoupledClass)
        {
            SetTab(i++, GetString("srch.fields"), "DocumentType_Edit_SearchFields.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'search_fields');");
        }

        SetTab(i++, GetString("general.documents"), "DocumentType_Edit_Documents.aspx?documenttypeid=" + classObj.ClassID, "SetHelpTopic('helpTopic', 'doctype_documents');");
    }
Example #23
0
    protected TabItem Tabs_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex)
    {
        switch (element.ElementName.ToLowerCSafe())
        {
        case "customers.customfields":

            // Check if customer has any custom fields
            FormInfo formInfo = FormHelper.GetFormInfo("ecommerce.customer", false);
            if (!formInfo.GetFormElements(true, false, true).Any())
            {
                return(null);
            }
            break;

        case "customers.newsletters":
            if (!ModuleEntry.IsModuleLoaded(ModuleEntry.NEWSLETTER))
            {
                return(null);
            }
            break;

        case "customers.credit":
            // Hide Credit tab for anonymous customer
            if ((customerInfoObj == null) || !customerInfoObj.CustomerIsRegistered)
            {
                return(null);
            }
            break;
        }

        return(tab);
    }
        private static PropertyDeclarationSyntax CreatePropertyDeclaration_Module(ModuleEntry module)
        {
            var type       = module.Type;
            var identifier = module.Identifier;
            var comment    = SyntaxFactoryUtils.Comment("// Module: {0}", module.Name);

            return(SyntaxFactoryUtils.PropertyDeclaration(type, identifier, SyntaxFactoryUtils.ObjectCreationExpression(type)).WithTrailingTrivia(comment));
        }
Example #25
0
    private bool uiToolbarElem_OnButtonFiltered(object sender, UniMenuArgs eventArgs)
    {
        // Hide reports button when reporting module is not loaded
        if (eventArgs.UIElement.ElementName.CompareToCSafe("ecreports", true) == 0)
        {
            return(ModuleEntry.IsModuleLoaded(ModuleEntry.REPORTING));
        }

        return(true);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        CurrentUserInfo currentUser = CMSContext.CurrentUser;

        // 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
        {
            imgNewLink.ImageUrl    = GetImageUrl("CMSModules/CMS_Content/Menu/Link.png");
            lblNewLink.Text        = GetString("ContentNew.NewLink");
            lnkNewLink.NavigateUrl = "javascript:modalDialog('" + GetLinkDialogUrl(ParentNodeID) + "', 'contentselectnode', '90%', '85%')";

            plcNewABTestVariant.Visible = false;

            if (ParentNode != null)
            {
                // AB test variant settings
                if (SettingsKeyProvider.GetBoolValue(CMSContext.CurrentSiteName + ".CMSABTestingEnabled") &&
                    AllowNewABTest &&
                    !IsInDialog &&
                    currentUser.IsAuthorizedPerResource("cms.ABTest", "Read") &&
                    ModuleEntry.IsModuleLoaded("cms.onlinemarketing") &&
                    ResourceSiteInfoProvider.IsResourceOnSite("CMS.ABTest", CMSContext.CurrentSiteName) &&
                    LicenseHelper.CheckFeature(URLHelper.GetCurrentDomain(), FeatureEnum.ABTesting) &&
                    (ParentNode.NodeAliasPath != "/"))
                {
                    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);

                    if (pnlFooter.Visible == false)
                    {
                        pnlABVariant.CssClass += "PageSeparator";
                    }
                }
            }

            imgNewVariant.ImageUrl = GetImageUrl("Objects/CMS_Variant/object_small.png");
        }
    }
Example #27
0
        private static ModuleEntry GetPolyModuleEntryInternal(Type moduleType)
        {
            var entry = new ModuleEntry
            {
                Name     = "_",
                Module   = moduleType,
                Polyfill = true
            };

            return(entry);
        }
Example #28
0
            protected override string exec(MessageEventArgs Msg, string param)
            {
                string Response = "";

                foreach (BaseModule ModuleEntry in modulehandler.GetAllModules())
                {
                    Response += ModuleEntry.GetType().Name.ToString() + " ";
                }

                return(Response);
            }
Example #29
0
        public ContentResult Index()
        {
            var moduleVersion = new Plugin().Version.ToString();
            var sl            = SupportedLanguages.En;
            var me            = new ModuleEntry();

            return(new ContentResult()
            {
                Content = $" Hello from Index. CMS Version:{CmsInfo.Version.ToString()}  Module Version:  " + moduleVersion, ContentType = "text/html; charset=utf-8", StatusCode = 200
            });
        }
Example #30
0
        public void ExtractEntry(ModuleEntry entry, string path, string sectionName)
        {
            if (!_module.ContainsEntry(entry))
            {
                throw new ScriptRuntimeException("Entry is not contained inside the module");
            }
            path = FileSandbox.ResolvePath(path);
            var section = TranslateSection(sectionName);

            using (var stream = _file.OpenRead())
                _module.ExtractEntry(stream, entry, section, path);
        }
Example #31
0
        public Address RegisterEntry(ModuleEntry entry, Address addr)
        {
            switch (entry)
            {
            case GlobalDefinition global:
                var glob = RegisterGlobal(global);
                program.GlobalFields.Fields.Add((int)addr.ToLinear(), glob.DataType, glob.Name);
                return(addr + 1);

            case FunctionDefinition fn:
                var proc = RegisterFunction(fn, addr);
                program.Procedures.Add(addr, proc);
                this.Globals[fn.FunctionName !] = new Core.Expressions.ProcedureConstant(
 public TestApplication(ModuleEntry[] testModule)
 {
     HttpModuleCollection modules = this.Modules;
     if (testModule != null)
     {
         ModuleEntry moduleEntry = null;
         for (int i = 0; i < testModule.Length; i++)
         {
             moduleEntry = testModule[i];
             miAddModule.Invoke(modules, new object[] { moduleEntry.Name, moduleEntry.Module });
         }
     }
 }