Exemplo n.º 1
0
        public static string getCategoryDisplayTitle(BaseCmsAdminTool.CmsAdminToolCategory cat)
        {
            string title = "";

            switch (cat)
            {
            case BaseCmsAdminTool.CmsAdminToolCategory.Report_Image: title = "Image Reports"; break;

            case BaseCmsAdminTool.CmsAdminToolCategory.Report_Page: title = "Page Reports"; break;

            case BaseCmsAdminTool.CmsAdminToolCategory.Report_Feedback: title = "Feedback Reports"; break;

            case BaseCmsAdminTool.CmsAdminToolCategory.Report_Projects: title = "Registered Project Reports"; break;

            case BaseCmsAdminTool.CmsAdminToolCategory.Report_Other: title = "Other Reports"; break;

            case BaseCmsAdminTool.CmsAdminToolCategory.Tool_Search: title = "Search Tools"; break;

            case BaseCmsAdminTool.CmsAdminToolCategory.Tool_Utility: title = "Utilities"; break;

            case BaseCmsAdminTool.CmsAdminToolCategory.Tool_Security: title = "Security Zones"; break;

            default:
                throw new ArgumentException("Error: invalid/unknown CmsAdminToolCategory in getCategoryDisplayTitle()");
            }
            return(title);
        }
Exemplo n.º 2
0
        } // constructor

        public CmsAdminToolInfo(BaseCmsAdminTool.CmsAdminToolCategory category, BaseCmsAdminTool.AdminMenuTab menuTab, string menuDisplayTextForAllLanguages)
        {
            Category        = category;
            MenuTab         = menuTab;
            MenuDisplayText = new Dictionary <CmsLanguage, string>();
            foreach (CmsLanguage lang in CmsConfig.Languages)
            {
                MenuDisplayText.Add(lang, menuDisplayTextForAllLanguages);
            }
        } // constructor
Exemplo n.º 3
0
        private Dictionary <BaseCmsAdminTool.CmsAdminToolCategory, List <BaseCmsAdminTool> > getToolsForTab(AdminMenuTab tab, BaseCmsAdminTool[] haystack)
        {
            Dictionary <BaseCmsAdminTool.CmsAdminToolCategory, List <BaseCmsAdminTool> > ret = new Dictionary <CmsAdminToolCategory, List <BaseCmsAdminTool> >();

            foreach (BaseCmsAdminTool tool in haystack)
            {
                BaseCmsAdminTool.CmsAdminToolCategory toolCat = tool.getToolInfo().Category;
                string toolCatName = toolCat.ToString();
                switch (tab)
                {
                case AdminMenuTab._AdminMenu:
                    // -- nothing to add for the admin menu
                    break;

                case AdminMenuTab.Reports:
                    if (toolCatName.StartsWith("Report", StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (!ret.ContainsKey(toolCat))
                        {
                            ret[toolCat] = new List <BaseCmsAdminTool>();
                        }

                        ret[toolCat].Add(tool);
                    }
                    break;

                case AdminMenuTab.Tools:
                    if (toolCatName.StartsWith("Tool", StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (!ret.ContainsKey(toolCat))
                        {
                            ret[toolCat] = new List <BaseCmsAdminTool>();
                        }

                        ret[toolCat].Add(tool);
                    }
                    break;

                default:
                    throw new Exception("Error: invalid AdminMenuTab");
                }
            } // foreach
            return(ret);
        }
Exemplo n.º 4
0
 public CmsAdminToolInfo(BaseCmsAdminTool.CmsAdminToolCategory category, BaseCmsAdminTool.AdminMenuTab menuTab, Dictionary <CmsLanguage, string> menuDisplayText)
 {
     Category        = category;
     MenuTab         = menuTab;
     MenuDisplayText = menuDisplayText;
 } // constructor