Beispiel #1
0
 public UC_Setting_Item(Object parent, SettingItem item)
 {
     InitializeComponent();
     this.ownParent = parent;
     settingItem = item;
     InitIconAndText();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="OneFileModule"/> class. 
        ///   Creates 3 fields in the settings system:
        ///   "Settings string", "XML settings file" and "Debug Mode"
        /// </summary>
        public OneFileModule()
        {
            var setting = new SettingItem<string, TextBox>
                {
                    Required = false,
                    Order = 1,
                    Value = string.Empty,
                    EnglishName = "Settings string",
                    Description = "Settings are in pairs like: FirstName=Elvis;LastName=Presly;"
                };
            this.BaseSettings.Add("Settings string", setting);

            var xmlFile = new SettingItem<string, TextBox>(new PortalUrlDataType())
                {
                    Required = false,
                    Order = 2,
                    EnglishName = "XML settings file",
                    Description =
                        "Name of file in folder Appleseed\\_Portalfolder (typically _Appleseed). Do not add a path!"
                };
            this.BaseSettings.Add("XML settings file", xmlFile);

            var debugMode = new SettingItem<bool, CheckBox>
                {
                    Order = 3,
                    Value = true,
                    EnglishName = "Debug Mode",
                    Description = "Primarily for the developer. Controls property DebugMode"
                };
            this.BaseSettings.Add("Debug Mode", debugMode);
        }
        /// <summary>
        /// Public constructor. Sets base settings for module.
        /// </summary>
        public DatabaseTool()
        {
            var trustedConnection = new SettingItem<bool, CheckBox> { Order = 1, Value = true };
            //Trusted_Connection.Required = true;   // hmmm... problem here! Dont set to true!"
            this.BaseSettings.Add("Trusted Connection", trustedConnection);

            var serverName = new SettingItem<string, TextBox> { Order = 2, Required = true, Value = "localhost" };
            this.BaseSettings.Add("ServerName", serverName);

            var databaseName = new SettingItem<string, TextBox> { Order = 3, Required = true, Value = "Appleseed" };
            this.BaseSettings.Add("DatabaseName", databaseName);

            var userId = new SettingItem<string, TextBox> { Order = 4, Required = false, Value = string.Empty };
            this.BaseSettings.Add("UserID", userId);

            var password = new SettingItem<string, TextBox> { Order = 5, Required = false, Value = string.Empty };
            this.BaseSettings.Add("Password", password);

            var infoFields = new SettingItem<string, TextBox> { Order = 6, Required = true, Value = "name,id,xtype,uid" };
            this.BaseSettings.Add("InfoFields", infoFields);

            var infoExtendedFields = new SettingItem<string, TextBox> { Order = 7, Required = true, Value = "*" };
            this.BaseSettings.Add("InfoExtendedFields", infoExtendedFields);

            var showQueryBox = new SettingItem<bool, CheckBox> { Order = 8, Value = true };
            //ShowQueryBox.Required = true;   // hmmm... problem here! Dont set to true!"
            this.BaseSettings.Add("Show Query Box", showQueryBox);

            var queryBoxHeight = new SettingItem<int, TextBox> { Order = 9, Required = true, Value = 150, MinValue = 10, MaxValue = 2000 };
            this.BaseSettings.Add("Query Box Height", queryBoxHeight);
        }
        /// <summary>
        /// Constructor - Load Module Settings
        /// </summary>
        public FileManager()
        {
            // Modified by Hongwei Shen
            SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            int groupBase = (int) group;

            var directory = new SettingItem<string, TextBox>();
            directory.EnglishName = "Directory Path";
            directory.Required = false;
            directory.Group = group;
            directory.Order = groupBase + 20; //1;
            if (this.PortalSettings != null)
                directory.Value = this.PortalSettings.PortalPath;
            else
                directory.Value = string.Empty;
            this.BaseSettings.Add("FM_DIRECTORY", directory);

            var DownloadableExt = new SettingItem<string, TextBox>();
            DownloadableExt.EnglishName = "Downloadable extentions";
            DownloadableExt.Group = group;
            DownloadableExt.Order = groupBase + 25; //2;
            DownloadableExt.Value = "";
            DownloadableExt.Description =
                "Provide a comma-delimited list of file extentions that you can download On Click";
            this.BaseSettings.Add("FM_DOWNLOADABLEEXT", DownloadableExt);
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref = "XmlModule" /> class.
        /// </summary>
        public XmlModule()
        {
            var xmlSrc = new SettingItem<string, TextBox>(new PortalUrlDataType()) { Required = true, Order = 1 };
            this.BaseSettings.Add("XMLsrc", xmlSrc);

            var xslSrc = new SettingItem<string, TextBox>(new PortalUrlDataType()) { Required = true, Order = 2 };
            this.BaseSettings.Add("XSLsrc", xslSrc);
        }
Beispiel #6
0
 public UC_Setting_Item(Object parent, HostType type) // for host config
 {
     InitializeComponent();
     this.ownParent = parent;
     hostType = type;
     settingItem = SettingItem.Host;
     InitIconAndText();
 }
        /// <summary>
        /// Constructor set module settings
        /// </summary>
        public FileDirectoryTree()
        {
            // modified by Hongwei Shen
            SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            int groupBase = (int) group;

            var directory = new SettingItem<string, TextBox>()
                {
                    EnglishName = "Directory Path",
                    Required = true,
                    Order = groupBase + 20,
                    Group = group,
                    Value = Path.ApplicationRoot + "/portals"
                };

            // Changed to virutal root from physical

            //directory.Value = Path.ApplicationPhysicalPath;
            this.BaseSettings.Add("Directory", directory);

            var LinkType = new SettingItem<string, ListControl>(new ListDataType<string, ListControl>("Downloadable Link;Network Share"));
            LinkType.EnglishName = "Link Type";
            LinkType.Group = group;
            LinkType.Order = groupBase + 25; //2;
            LinkType.Value = "Downloadable Link";
            this.BaseSettings.Add("LinkType", LinkType);

            var Target = new SettingItem<string, ListControl>(new ListDataType<string, ListControl>("blank;parent;self;top"));
            Target.EnglishName = "Target Window";
            Target.Required = false;
            Target.Group = group;
            Target.Order = groupBase + 30; //3;
            Target.Value = "blank";
            this.BaseSettings.Add("Target", Target);

            var Collapsed = new SettingItem<bool, CheckBox>();
            Collapsed.EnglishName = "Collapsed View";
            Collapsed.Group = group;
            Collapsed.Order = groupBase + 35; //4;
            Collapsed.Value = true;
            this.BaseSettings.Add("Collapsed", Collapsed);

            var Style = new SettingItem<string, TextBox>();
            Style.EnglishName = "Style";
            Style.Required = false;
            Style.Group = group;
            Style.Order = groupBase + 40; //5;
            Style.Value = string.Empty;
            this.BaseSettings.Add("Style", Style);

            var Indent = new SettingItem<string, TextBox>();
            Indent.EnglishName = "SubDirectory Indent (px)";
            Indent.Required = false;
            Indent.Group = group;
            Indent.Order = groupBase + 45; //6;
            Indent.Value = "20px";
            this.BaseSettings.Add("Indent", Indent);
        }
        /// <summary>
        /// Public constructor.	Sets base settings for module.
        /// </summary>
        public Events()
        {
            // Set Editor Settings [email protected] 2004/07/30 (added by Jakob Hansen)
            // Modified by Hongwei Shen 2005/09/24
            SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            int groupBase = (int) group;
            HtmlEditorDataType.HtmlEditorSettings(this.BaseSettings, group);

            //Indah	Fuldner
            var RepeatDirection = new SettingItem<string, ListControl>(new ListDataType<string,ListControl>("Vertical;Horizontal"));
            RepeatDirection.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            RepeatDirection.Required = true;
            RepeatDirection.Value = "Vertical";
            RepeatDirection.Order = groupBase + 20; //10;
            this.BaseSettings.Add("RepeatDirectionSetting", RepeatDirection);

            var RepeatColumn = new SettingItem<int, TextBox>();
            RepeatColumn.Group = group; // SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            RepeatColumn.Required = true;
            RepeatColumn.Value = 1;
            RepeatColumn.MinValue = 1;
            RepeatColumn.MaxValue = 10;
            RepeatColumn.Order = groupBase + 25; // 20;
            this.BaseSettings.Add("RepeatColumns", RepeatColumn);

            var showItemBorder = new SettingItem<bool, CheckBox>();
            showItemBorder.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            showItemBorder.Order = groupBase + 30;
            showItemBorder.Value = false;
            this.BaseSettings.Add("ShowBorder", showItemBorder);
            //End Indah	Fuldner

            var DelayExpire = new SettingItem<int, TextBox>();
            DelayExpire.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            DelayExpire.Order = groupBase + 35; // 40;
            DelayExpire.Value = 365; // 1	year
            DelayExpire.MinValue = 0;
            DelayExpire.MaxValue = 3650; //10 years
            this.BaseSettings.Add("DelayExpire", DelayExpire);

            // devsolution 2003/6/17: Added items for calendar control
            // Show Calendar -	Show a visual calendar with
            //					Default is false for backward compatibility
            //					Must edit collection properties and set to true
            //					to show calendar
            var ShowCalendar = new SettingItem<bool, CheckBox>();
            ShowCalendar.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            ShowCalendar.Order = groupBase + 40; // 50;
            ShowCalendar.Value = false;
            this.BaseSettings.Add("ShowCalendar", ShowCalendar);
            // devsolution 2003/6/17: Finished - Added items for calendar control

            // Change by [email protected]
            // Date: 27/2/2003
            SupportsWorkflow = true;
            // End Change [email protected]
        }
Beispiel #9
0
	/// <summary>
	/// 添加一个 SleepTimeout 控制器,其值为默认值 (优先级为 0,值为系统默认)
	/// </summary>
	/// <returns>控制器的id,可以用于 set 和 remove 函数</returns>
	public Int32 addController()
	{
		SettingItem item = new SettingItem();
		item.priority = 0;
		item.sleepTimeoutType = SleepTimeout.SystemSetting;
		Int32 id = GenUniqueId();
		m_settingMap[id] = item;
		return id;
	}
 public SignInBoth()
 {
     var hideAutomatically = new SettingItem<bool, CheckBox>() {
         Value = true,
         EnglishName = "Hide automatically",
         Order = 20
     };
     this.BaseSettings.Add("SIGNIN_AUTOMATICALLYHIDE", hideAutomatically);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ContentManager"/> class.
 /// </summary>
 public ContentManager()
 {
     // setting item for show portals
     var showPortals = new SettingItem<bool, CheckBox>()
         {
             Value = false,
             Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS,
             Description = "Enable or Disable Multi-Portal Support"
         };
     this.BaseSettings.Add("MultiPortalSupport", showPortals);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ShortcutAll"/> class.
        /// </summary>
        /// <remarks></remarks>
        public ShortcutAll()
        {
            // Get a list of modules of all portals
            var linkedModule =
                new SettingItem<string, ListControl>(
                    new CustomListDataType(new ModulesDB().GetModulesAllPortals(), "ModuleTitle", "ModuleID"))
                    {
                        Required = true, Order = 0, Value = "0"
                    };

            // Overrides the base setting
            this.BaseSettings["LinkedModule"] = linkedModule;
        }
        /// <summary>
        /// Initial Revision by Paul Yarrow, [email protected], 2003-07-13
        /// </summary>
        public Monitoring()
        {
            // modified by Hongwei Shen
            SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            int groupBase = (int) group;

            var setSortField =
                new SettingItem<string, ListControl>(
                    new ListDataType<string, ListControl>("ActivityTime;ActivityType;Name;PortalName;TabName;UserHostAddress;UserAgent"))
                    { Required = true, Value = "ActivityTime", Group = group, Order = groupBase + 20 };

            // 1;
            this.BaseSettings.Add("SortField", setSortField);
        }
Beispiel #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Pages"/> class. 
 ///   This is where you add module settings. These settings
 ///   are used to control the behavior of the module
 /// </summary>
 /// <remarks>
 /// </remarks>
 public Pages()
 {
     // EHN: Add new version control for tabs module.
     // Mike Stone - 19/12/2004
     var pageVersion = new SettingItem<bool, CheckBox>
         {
             Value = true,
             EnglishName = "Use Old Version?",
             Description =
                 "If Checked the module acts has it always did. If not it uses the new short form which allows security to be set so the new tab will not be seen by all users.",
             Order = 10
         };
     this.BaseSettings.Add("TAB_VERSION", pageVersion);
 }
 /// <summary>
 /// Initial Revision by Paul Yarrow, [email protected], 2003-07-29
 /// </summary>
 public WhosLoggedOn()
 {
     var cacheTime = new SettingItem<int, TextBox>();
     cacheTime.Required = true;
     cacheTime.Order = 0;
     cacheTime.Value = 1;
     cacheTime.MinValue = 0;
     cacheTime.MaxValue = 60000;
     cacheTime.Description =
         General.GetString("WHOSLOGGEDONCACHETIMEOUT",
                           "Specify an amount of time the who's logged on module will wait before checking again (0 - 60000)",
                           this);
     this.BaseSettings.Add("CacheTimeout", cacheTime);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DatabaseTableEdit"/> class.
        /// </summary>
        public DatabaseTableEdit()
        {
            var Trusted_Connection = new SettingItem<bool, CheckBox>();
            Trusted_Connection.Order = 1;
            //Trusted_Connection.Required = true;   // hmmm... problem here! Dont set to true!"
            Trusted_Connection.Value = true;
            this.BaseSettings.Add("Trusted Connection", Trusted_Connection);

            var ServerName = new SettingItem<string, TextBox>();
            ServerName.Order = 2;
            ServerName.Required = true;
            ServerName.Value = "localhost";
            this.BaseSettings.Add("ServerName", ServerName);

            var DatabaseName = new SettingItem<string, TextBox>();
            DatabaseName.Order = 3;
            DatabaseName.Required = true;
            DatabaseName.Value = "Appleseed";
            this.BaseSettings.Add("DatabaseName", DatabaseName);

            var UserID = new SettingItem<string, TextBox>();
            UserID.Order = 4;
            UserID.Required = false;
            UserID.Value = "sa";
            this.BaseSettings.Add("UserID", UserID);

            var Password = new SettingItem<string, TextBox>();
            Password.Order = 5;
            Password.Required = false;
            Password.Value = string.Empty;
            this.BaseSettings.Add("Password", Password);

            var MaxStringLength = new SettingItem<int, TextBox>();
            MaxStringLength.Order = 6;
            MaxStringLength.Required = true;
            MaxStringLength.Value = 100;
            this.BaseSettings.Add("MaxStringLength", MaxStringLength);

            var AllowPaging = new SettingItem<bool, CheckBox>();
            AllowPaging.Order = 7;
            //AllowPaging.Required = true;   // hmmm... problem here! Dont set to true!"
            AllowPaging.Value = true;
            this.BaseSettings.Add("AllowPaging", AllowPaging);

            var PageSize = new SettingItem<int, TextBox>();
            PageSize.Order = 8;
            PageSize.Required = true;
            PageSize.Value = 10;
            this.BaseSettings.Add("PageSize", PageSize);
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref = "XmlFeed" /> class.
        /// </summary>
        public XmlFeed()
        {
            const SettingItemGroup Group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            const int GroupOrderBase = (int)SettingItemGroup.MODULE_SPECIAL_SETTINGS;

            var xmlSrcType = new SettingItem<string, ListControl>(new ListDataType<string, ListControl>("URL;File"))
                {
                   Required = true, Value = "URL", Group = Group, Order = GroupOrderBase + 1
                };
            this.BaseSettings.Add("XML Type", xmlSrcType);

            var xmlSrcUrl = new SettingItem<Uri, TextBox>(new UrlDataType())
                {
                   Required = false, Group = Group, Order = GroupOrderBase + 2
                };
            this.BaseSettings.Add("XML URL", xmlSrcUrl);

            var xmlSrcFile = new SettingItem<string, TextBox>(new PortalUrlDataType())
                {
                   Required = false, Group = Group, Order = GroupOrderBase + 3
                };
            this.BaseSettings.Add("XML File", xmlSrcFile);

            var xslSrcType = new SettingItem<string, ListControl>(new ListDataType<string, ListControl>("Predefined;File"))
                {
                   Required = true, Value = "Predefined", Order = GroupOrderBase + 4, Group = Group
                };
            this.BaseSettings.Add("XSL Type", xslSrcType);

            var xsltFileList = new ListDataType<string, ListControl>(this.GetXSLListForFeedTransformations());
            var xslSrcPredefined = new SettingItem<string, ListControl>(xsltFileList)
                {
                   Required = true, Value = "RSS91", Group = Group, Order = GroupOrderBase + 5
                };
            this.BaseSettings.Add("XSL Predefined", xslSrcPredefined);

            var xslSrcFile = new SettingItem<string, TextBox>(new PortalUrlDataType())
                {
                   Required = false, Group = Group, Order = GroupOrderBase + 6
                };
            this.BaseSettings.Add("XSL File", xslSrcFile);

            var timeout = new SettingItem<int, TextBox>()
                {
                   Required = true, Group = Group, Order = GroupOrderBase + 7, Value = 15
                };
            this.BaseSettings.Add("Timeout", timeout);
        }
        /// <summary>
        /// Public constructor. Sets base settings for module.
        /// </summary>
        public Blacklist()
        {
            var setSortField =
                new SettingItem<string, ListControl>(new ListDataType<string, ListControl>("Name;Email;SendNewsletter;Reason;Date"));
            setSortField.Required = true;
            setSortField.Value = "Name";
            setSortField.Order = 1;
            this.BaseSettings.Add("BLACKLIST_SORTFIELD", setSortField);

            var showColumnName = new SettingItem<bool, CheckBox>();
            showColumnName.Order = 2;
            showColumnName.Value = true;
            this.BaseSettings.Add("BLACKLIST_SHOWCOLUMNNAME", showColumnName);

            var showColumnEmail = new SettingItem<bool, CheckBox>();
            showColumnEmail.Order = 3;
            showColumnEmail.Value = true;
            this.BaseSettings.Add("BLACKLIST_SHOWCOLUMNEMAIL", showColumnEmail);

            var showColumnSendNewsletter = new SettingItem<bool, CheckBox>();
            showColumnSendNewsletter.Order = 4;
            showColumnSendNewsletter.Value = false;
            this.BaseSettings.Add("BLACKLIST_SHOWCOLUMNSENDNEWSLETTER", showColumnSendNewsletter);

            var showColumnReason = new SettingItem<bool, CheckBox>();
            showColumnReason.Order = 5;
            showColumnReason.Value = true;
            this.BaseSettings.Add("BLACKLIST_SHOWCOLUMNREASON", showColumnReason);

            var showColumnDate = new SettingItem<bool, CheckBox>();
            showColumnDate.Order = 6;
            showColumnDate.Value = true;
            this.BaseSettings.Add("BLACKLIST_SHOWCOLUMNDATE", showColumnDate);

            var showAllUsers = new SettingItem<bool, CheckBox>();
            showAllUsers.Order = 8;
            showAllUsers.Value = false;
            this.BaseSettings.Add("BLACKLIST_SHOWALLUSERS", showAllUsers);

            var showSubscribersOnly = new SettingItem<bool, CheckBox>();
            showSubscribersOnly.Order = 9;
            showSubscribersOnly.Value = false;
            this.BaseSettings.Add("BLACKLIST_SHOWSUBSCRIBERSONLY", showSubscribersOnly);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SigninCool"/> class.
        /// </summary>
        public SigninCool()
        {
            var coolText = new SettingItem<string, TextBox> { Order = 10 };
            this.BaseSettings.Add("CoolText", coolText);

            var hideAutomatically = new SettingItem<bool, CheckBox>
                {
                    Value = true, EnglishName = "Hide automatically", Order = 20
                };
            this.BaseSettings.Add("SIGNIN_AUTOMATICALLYHIDE", hideAutomatically);

            //1.2.8.1743b - 09/10/2003
            //New setting on Signin fo disable IE autocomplete by Mike Stone
            //If you uncheck this setting IE will not remember user name and passwords.
            //Note that users who have memorized passwords will not be effected until their computer
            //is reset, only new users and/or computers will honor this.
            var autoComplete = new SettingItem<bool, CheckBox>
                {
                    Value = true,
                    EnglishName = "Allow IE Autocomplete",
                    Description = "If Checked IE Will try to remember logins",
                    Order = 30
                };
            this.BaseSettings.Add("SIGNIN_ALLOW_AUTOCOMPLETE", autoComplete);

            var rememberLogin = new SettingItem<bool, CheckBox>
                {
                    Value = true,
                    EnglishName = "Allow Remember Login",
                    Description = "If Checked allows to remember logins",
                    Order = 40
                };
            this.BaseSettings.Add("SIGNIN_ALLOW_REMEMBER_LOGIN", rememberLogin);

            var sendPassword = new SettingItem<bool, CheckBox>
                {
                    Value = true,
                    EnglishName = "Allow Send Password",
                    Description = "If Checked allows user to ask to get password by email if he forgotten",
                    Order = 50
                };
            this.BaseSettings.Add("SIGNIN_ALLOW_SEND_PASSWORD", sendPassword);
        }
        /// <summary>
        /// Public constructor. Sets base settings for module.
        /// </summary>
        public EventLogs()
        {
            // Modified by Hongwei Shen([email protected]) to group the settings
            // 13/9/2005
            SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            int groupBase = (int) group;
            // end of modification

            var setMachineName = new SettingItem<string, TextBox>();
            setMachineName.Required = true;
            setMachineName.Value = ".";
            // Modified by Hongwei Shen
            // setMachineName.Order = 1;
            setMachineName.Group = group;
            setMachineName.Order = groupBase + 20;
            setMachineName.EnglishName = "Machine Name";
            // end of modification
            this.BaseSettings.Add("MachineName", setMachineName);

            var setSortField =
                new SettingItem<string, ListControl>(new ListDataType<string, ListControl>("EntryType;TimeGenerated;Source;EventID;Message"));
            setSortField.Required = true;
            setSortField.Value = "TimeGenerated";
            // Modified by Hongwei Shen
            // setSortField.Order = 2;
            setSortField.Group = group;
            setSortField.Order = groupBase + 25;
            setSortField.EnglishName = "Sort Field";
            // end of modification
            this.BaseSettings.Add("SortField", setSortField);

            var setSortDirection = new SettingItem<string, ListControl>(new ListDataType<string, ListControl>("ASC;DESC"));
            setSortDirection.Required = true;
            setSortDirection.Value = "DESC";
            // Modified by Hongwei Shen
            // setSortDirection.Order = 3;
            setSortDirection.Group = group;
            setSortDirection.Order = groupBase + 30;
            setSortDirection.EnglishName = "Sort Direction";
            // end of modification
            this.BaseSettings.Add("SortDirection", setSortDirection);
        }
        // end of addition
        // /// <summary>
        // /// PlaceHolder for the HTML
        // /// </summary>
        // protected PlaceHolder HtmlHolder;
        #region Constructors and Destructors

        /// <summary>
        ///   Initializes a new instance of the <see cref = "HtmlModule" /> class.
        ///   Set the Module Settings
        ///   <list type = "">
        ///     <item>
        ///       ShowMobile
        ///     </item>
        ///   </list>
        /// </summary>
        /// <remarks>
        /// </remarks>
        public HtmlModule()
        {
            var group          = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            var groupOrderBase = (int)SettingItemGroup.MODULE_SPECIAL_SETTINGS;

            HtmlEditorDataType.HtmlEditorSettings(this.BaseSettings, group);

            // If false the input box for mobile content will be hidden
            var showMobileText = new SettingItem <bool, CheckBox>
            {
                Value = true, Order = groupOrderBase + 10, Group = group
            };

            this.BaseSettings.Add("ShowMobile", showMobileText);

            #region Button Display Settings for this module

            // added by Hongwei Shen([email protected]) 10/9/2005
            group          = SettingItemGroup.BUTTON_DISPLAY_SETTINGS;
            groupOrderBase = (int)SettingItemGroup.BUTTON_DISPLAY_SETTINGS;

            // If false the compare button will be hidden
            var showCompareButton = new SettingItem <bool, CheckBox>
            {
                Value       = true,
                Order       = groupOrderBase + 60,
                Group       = group,
                EnglishName = "Show Compare Button?",
                Description = "Compare the working version with the live one"
            };
            this.BaseSettings.Add(StringsCompareButton, showCompareButton);

            // end of addition
            #endregion

            this.SupportsWorkflow = true;

            // No need for view state on view. - jminond
            // Need view state to toggle the compare button Hongwei Shen 10/9/2005
            this.EnableViewState = true; // false;
        }
        public void WriteSettings(SettingsNames name, string value)
        {
            var val = _context.SettingItems.SingleOrDefault(z => z.Name == name.ToString());

            if (val == null)
            {
                val = new SettingItem
                {
                    Name        = name.ToString(),
                    Value       = value,
                    LastChanged = DateTime.UtcNow
                };
                _context.SettingItems.Add(val);
            }
            else
            {
                val.Value       = value;
                val.LastChanged = DateTime.UtcNow;
            }
            _context.SaveChanges();
        }
Beispiel #23
0
        public static void RegisterHotKey(SettingItem hotKeyItem, EventHandler <HotkeyEventArgs> handler)
        {
            try
            {
                if (hotKeyItem.Value.Trim().Length == 0)
                {
                    Trace.TraceInformation("skip register hotkey {0}, empty hotkey value", hotKeyItem.Key);
                }
                else
                {
                    HotkeyManager.Current.RegisterHotKey(hotKeyItem.Key, hotKeyItem.Value, handler);
                }

                //HotkeyManager.Current.RegisterHotKey("open main window", HotKeyModifiers.Control | HotKeyModifiers.Alt, KeyInterop.VirtualKeyFromKey(Key.Q), OnOpenWindowHotKey);
            }
            catch (Exception e)
            {
                Trace.TraceError(e.Message);
                ToastNotificationUtil.SendNotification("Failed to register HotKey", e.Message);
            }
        }
Beispiel #24
0
        SettingItem ISettingsServiceInternal.GetSetting(string identifier, string name)
        {
            try
            {
                Assertions.AssertNotEmpty(identifier, "identifier");
                Assertions.AssertNotEmpty(name, "name");

                SettingItem item = _settings.GetSetting(identifier, name);

                lock (SyncRoot)
                {
                    ApplySettingValue(identifier, name, item);
                }

                return(item);
            }
            catch (Exception ex)
            {
                throw AlarmWorkflowFaultDetails.CreateFault(ex);
            }
        }
        /// <summary>
        /// Returns a new field set with legend for a new settings group
        /// </summary>
        /// <param name="currentItem">The settings item</param>
        /// <returns>Fieldset control</returns>
        private HtmlGenericControl createNewFieldSet(SettingItem currentItem)
        {
            // start a new fieldset
            HtmlGenericControl fieldset = new HtmlGenericControl("fieldset");

            fieldset.Attributes.Add("class",
                                    string.Concat("SettingsTableGroup ", currentItem.Group.ToString().ToLower()));

            // create group legend
            HtmlGenericControl legend = new HtmlGenericControl("legend");

            legend.Attributes.Add("class", "SubSubHead");
            Localize legendText = new Localize();

            legendText.TextKey = currentItem.Group.ToString();
            legendText.Text    = currentItem.GroupDescription;
            legend.Controls.Add(legendText);
            fieldset.Controls.Add(legend);

            return(fieldset);
        }
        static public TimerConfig GetConfig(string sectionName)
        {
            TimerConfig tc = new TimerConfig();

            try
            {
                SettingItem timerSetting = AppSettingHelper.GetSpecifySection(sectionName);

                tc.LastTime1 = timerSetting.ReadDatetime("LastTime1");
                tc.LastTime1 = timerSetting.ReadDatetime("LastTime2");
                tc.LastTime1 = timerSetting.ReadDatetime("LastTime3");
                tc.LastTime1 = timerSetting.ReadDatetime("LastTime4");
                tc.LastTime5 = timerSetting.ReadDatetime("LastTime5");
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex);
            }

            return(tc);
        }
Beispiel #27
0
        /// <summary>
        /// Creates 3 fields in the settings system:
        /// "Settings string", "XML settings file" and "Debug Mode"
        /// </summary>
        public OneFileModule()
        {
            SettingItem setting = new SettingItem(new StringDataType());

            setting.Required = false;
            setting.Order    = 1;
            setting.Value    = string.Empty;
            this._baseSettings.Add("Settings string", setting);

            SettingItem xmlFile = new SettingItem(new PortalUrlDataType());

            xmlFile.Required = false;
            xmlFile.Order    = 2;
            this._baseSettings.Add("XML settings file", xmlFile);

            SettingItem debugMode = new SettingItem(new BooleanDataType());

            debugMode.Order = 3;
            debugMode.Value = "True";
            this._baseSettings.Add("Debug Mode", debugMode);
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref = "HtmlModule" /> class. 
        ///   Set the Module Settings
        ///   <list type = "">
        ///     <item>
        ///       ShowMobile
        ///     </item>
        ///   </list>
        /// </summary>
        /// <remarks>
        /// </remarks>
        public HtmlModule()
        {
            var group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            var groupOrderBase = (int)SettingItemGroup.MODULE_SPECIAL_SETTINGS;

            HtmlEditorDataType.HtmlEditorSettings(this.BaseSettings, group);

            // If false the input box for mobile content will be hidden
            var showMobileText = new SettingItem<bool, CheckBox>
                {
                    Value = true, Order = groupOrderBase + 10, Group = group
                };
            this.BaseSettings.Add("ShowMobile", showMobileText);

            #region Button Display Settings for this module

            // added by Hongwei Shen([email protected]) 10/9/2005
            group = SettingItemGroup.BUTTON_DISPLAY_SETTINGS;
            groupOrderBase = (int)SettingItemGroup.BUTTON_DISPLAY_SETTINGS;

            // If false the compare button will be hidden
            var showCompareButton = new SettingItem<bool, CheckBox>
                {
                    Value = true,
                    Order = groupOrderBase + 60,
                    Group = group,
                    EnglishName = "Show Compare Button?",
                    Description = "Compare the working version with the live one"
                };
            this.BaseSettings.Add(StringsCompareButton, showCompareButton);

            // end of addition
            #endregion

            this.SupportsWorkflow = true;

            // No need for view state on view. - jminond
            // Need view state to toggle the compare button Hongwei Shen 10/9/2005
            this.EnableViewState = true; // false;
        }
Beispiel #29
0
        /// <summary>
        /// Set Module specific settings on initialization
        /// </summary>
        public Evolutility_ModuleRenderer()
        {
            try
            {
                var group = SettingItemGroup.BUTTON_DISPLAY_SETTINGS;

                var dataSqlConnections = new SettingItem <string, TextBox>()
                {
                    Order       = (int)group + 1,
                    Group       = group,
                    EnglishName = "Data Connection",
                    Description = "Add data Connectionstring"
                };

                this.BaseSettings.Add("DataConnection", dataSqlConnections);


                var discoSqlConnections = new SettingItem <string, TextBox>()
                {
                    Order       = (int)group + 2,
                    Group       = group,
                    EnglishName = "Evol.Disco Connection",
                    Description = "Add Disco Connection string"
                };

                this.BaseSettings.Add("Evol.Disco.Connection", discoSqlConnections);

                var modules = new SettingItem <string, TextBox>()
                {
                    Order       = (int)group + 3,
                    Group       = group,
                    EnglishName = "Modules",
                    Description = "Enter Module Name"
                };

                this.BaseSettings.Add("Modules", modules);
            }
            catch { }
        }
Beispiel #30
0
        private void SaveChangesCommand_Execute(object parameter)
        {
            // Remember settings that failed to save
            int iFailedSettings = 0;

            // First apply the setting values from the editors back to their setting items.
            foreach (SectionViewModel svm in _sections.Values)
            {
                foreach (CategoryViewModel cvm in svm.CategoryItems)
                {
                    foreach (SettingItemViewModel sivm in cvm.SettingItems)
                    {
                        // Find setting
                        SettingItem item = _manager.GetSetting(sivm.SettingDescriptor.Identifier, sivm.SettingDescriptor.SettingItem.Name);
                        // Try to apply the value
                        object value = null;
                        try
                        {
                            value = sivm.TypeEditor.Value;
                            // If that succeeded, apply the value
                            item.SetValue(value);
                        }
                        catch (Exception ex)
                        {
                            string message = string.Format(Properties.Resources.SettingSaveError + "\n\n{1}", item.Name, ex.Message);
                            MessageBox.Show(message, "Fehler beim Speichern einer Einstellung", MessageBoxButton.OK, MessageBoxImage.Error);
                            iFailedSettings++;
                        }
                    }
                }
            }

            // Second, save the settings.
            _manager.SaveSettings();

            string message2 = (iFailedSettings == 0) ? Properties.Resources.SavingSettingsSuccess : Properties.Resources.SavingSettingsWithErrors;

            MessageBox.Show(message2, "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
        }
Beispiel #31
0
        void ISettingsServiceInternal.SetSetting(string identifier, string name, SettingItem value)
        {
            Assertions.AssertNotEmpty(identifier, "identifier");
            Assertions.AssertNotEmpty(name, "name");

            IEnumerable <SettingKey> savedSettings = null;

            lock (SyncRoot)
            {
                SettingKey key = SettingKey.Create(identifier, name);

                List <KeyValuePair <SettingKey, SettingItem> > settings = new List <KeyValuePair <SettingKey, SettingItem> >();
                settings.Add(new KeyValuePair <SettingKey, SettingItem>(key, value));

                savedSettings = SaveSettings(settings);
            }

            if (savedSettings != null && savedSettings.Any())
            {
                OnSettingChanged(new SettingChangedEventArgs(savedSettings));
            }
        }
Beispiel #32
0
        /// <summary>
        /// Constructor
        /// </summary>
        public IframeModule()
        {
            // modified by Hongwei Shen
            SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            int groupBase          = (int)group;

            //MH:canged to support relativ url
            //SettingItem url = new SettingItem(new UrlDataType());
            SettingItem url = new SettingItem(new StringDataType());

            url.Required = true;
            url.Group    = group;
            url.Order    = groupBase + 20; //1;
            url.Value    = "http://www.rainbowportal.net";
            _baseSettings.Add("URL", url);

            //MH: added to support width values
            SettingItem width = new SettingItem(new StringDataType());

            width.Required = true;
            width.Group    = group;
            width.Order    = groupBase + 25; //2;
            width.Value    = "250";
            //width.MinValue = 1;
            //width.MaxValue = 2000;
            _baseSettings.Add("Width", width);

            //MH: changed to StringDataType to support  percent or pixel values
            //SettingItem width = new SettingItem(new IntegerDataType());
            SettingItem height = new SettingItem(new StringDataType());

            height.Required = true;
            height.Group    = group;
            height.Order    = groupBase + 30; //3;
            height.Value    = "250";
            //height.MinValue = 1;
            //height.MaxValue = 2000;
            _baseSettings.Add("Height", height);
        }
Beispiel #33
0
        public ActionResult Edit(SettingItem item)
        {
            if (ModelState.IsValid)
            {
                var data = Mapper.Map <SettingDto>(item);

                data.ModifiedDate = DateTime.Now;
                data.ModifiedBy   = CurrentUser.USERNAME;;

                try
                {
                    _settingBLL.Save(data, CurrentUser);
                    AddMessageInfo(Constans.SubmitMessage.Saved, Enums.MessageInfoType.Success);
                }
                catch (Exception exception)
                {
                    AddMessageInfo(exception.Message, Enums.MessageInfoType.Error);
                    return(View(item));
                }
            }
            return(RedirectToAction("Index", "MstSetting"));
        }
        static public void SetConfig(TimerConfig tc, string sectionName)
        {
            SettingItem timerSetting = AppSettingHelper.GetSpecifySection(sectionName);

            timerSetting.BatchBegin();
            try
            {
                timerSetting.WriteDateTime("LastTime1", tc.LastTime1);
                timerSetting.WriteDateTime("LastTime2", tc.LastTime2);
                timerSetting.WriteDateTime("LastTime3", tc.LastTime3);
                timerSetting.WriteDateTime("LastTime4", tc.LastTime4);
                timerSetting.WriteDateTime("LastTime5", tc.LastTime5);

                timerSetting.BatchCommit();
            }
            catch (Exception ex)
            {
                timerSetting.BatchCancel();

                MsgBox.ShowException(ex);
            }
        }
Beispiel #35
0
        public Signin()
        {
            SettingItem HideAutomatically = new SettingItem(new Rainbow.UI.DataTypes.BooleanDataType());

            HideAutomatically.Value       = "True";
            HideAutomatically.EnglishName = "Hide automatically";
            HideAutomatically.Order       = 20;
            this._baseSettings.Add("SIGNIN_AUTOMATICALLYHIDE", HideAutomatically);

            //1.2.8.1743b - 09/10/2003
            //New setting on Signin fo disable IE autocomplete by Mike Stone
            //If you uncheck this setting IE will not remember user name and passwords.
            //Note that users who have memorized passwords will not be effected until their computer
            //is reset, only new users and/or computers will honor this.
            SettingItem AutoComplete = new SettingItem(new Rainbow.UI.DataTypes.BooleanDataType());

            AutoComplete.Value       = "True";
            AutoComplete.EnglishName = "Allow IE Autocomplete";
            AutoComplete.Description = "If Checked IE Will try to remember logins";
            AutoComplete.Order       = 30;
            this._baseSettings.Add("SIGNIN_ALLOW_AUTOCOMPLETE", AutoComplete);

            SettingItem RememberLogin = new SettingItem(new Rainbow.UI.DataTypes.BooleanDataType());

            RememberLogin.Value       = "True";
            RememberLogin.EnglishName = "Allow Remember Login";
            RememberLogin.Description = "If Checked allows to remember logins";
            RememberLogin.Order       = 40;
            this._baseSettings.Add("SIGNIN_ALLOW_REMEMBER_LOGIN", RememberLogin);

            SettingItem SendPassword = new SettingItem(new Rainbow.UI.DataTypes.BooleanDataType());

            SendPassword.Value       = "True";
            SendPassword.EnglishName = "Allow Send Password";
            SendPassword.Description = "If Checked allows user to ask to get password by email if he forgotten";
            SendPassword.Order       = 50;
            this._baseSettings.Add("SIGNIN_ALLOW_SEND_PASSWORD", SendPassword);
        }
        private static SettingsConfigurationFile ParseCore(XElement rootE)
        {
            string identifier = rootE.Attribute("Identifier").Value;

            List <SettingItem> settings = new List <SettingItem>();

            foreach (XElement settingE in rootE.Elements("Setting"))
            {
                string name     = settingE.Attribute("Name").Value;
                string typeName = settingE.Attribute("Type").Value;
                bool   isNull   = settingE.TryGetAttributeValue("IsNull", false);

                // Read the setting value. If it contains a CDATA, then we need to process that first.
                string valueString = null;
                XNode  valueNode   = settingE.DescendantNodes().FirstOrDefault();
                if (valueNode != null)
                {
                    switch (valueNode.NodeType)
                    {
                    case System.Xml.XmlNodeType.CDATA:
                    case System.Xml.XmlNodeType.Text:
                        valueString = ((XText)valueNode).Value;
                        break;

                    default:
                        Logger.Instance.LogFormat(LogType.Warning, typeof(SettingsConfigurationFile), Properties.Resources.SettingsConfigurationEmbResInvalidValueContent, valueNode.NodeType, name);
                        break;
                    }
                }

                Type type = Type.GetType(typeName);

                SettingItem settingItem = new SettingItem(identifier, name, valueString, type);
                settings.Add(settingItem);
            }

            return(new SettingsConfigurationFile(identifier, settings));
        }
Beispiel #37
0
        /// <summary>
        /// Public constructor. Sets base settings for module.
        /// </summary>
        public EventLogs()
        {
            SettingItem setMachineName = new SettingItem(new StringDataType());

            setMachineName.Required = true;
            setMachineName.Value    = ".";
            setMachineName.Order    = 1;
            this._baseSettings.Add("MachineName", setMachineName);

            SettingItem setSortField = new SettingItem(new ListDataType("EntryType;TimeGenerated;Source;EventID;Message"));

            setSortField.Required = true;
            setSortField.Value    = "TimeGenerated";
            setSortField.Order    = 2;
            this._baseSettings.Add("SortField", setSortField);

            SettingItem setSortDirection = new SettingItem(new ListDataType("ASC;DESC"));

            setSortDirection.Required = true;
            setSortDirection.Value    = "DESC";
            setSortDirection.Order    = 3;
            this._baseSettings.Add("SortDirection", setSortDirection);
        }
        /// <summary>
        /// FlashModule
        /// </summary>
        public FlashModule()
        {
            SettingItem src = new SettingItem(new StringDataType());

            src.Required = true;
            src.Order    = 1;
            this._baseSettings.Add("src", src);

            SettingItem width = new SettingItem(new StringDataType());

            //	width.MinValue = 1;
            //	width.MaxValue = 400;
            width.Order = 2;
            this._baseSettings.Add("width", width);

            SettingItem height = new SettingItem(new StringDataType());

            //	height.MinValue = 1;
            //	height.MaxValue = 200;
            height.Order = 3;
            this._baseSettings.Add("height", height);

            SettingItem backColor = new SettingItem(new StringDataType());

            backColor.Required = false;
            backColor.Value    = "#FFFFFF";
            backColor.Order    = 4;
            this._baseSettings.Add("backcolor", backColor);

            SettingItem FlashPath = new SettingItem(new PortalUrlDataType());

            FlashPath.Required = true;
            FlashPath.Value    = "FlashGallery";
            FlashPath.Order    = 5;
            this._baseSettings.Add("FlashPath", FlashPath);
        }
        private List<SettingItem> ReadSettingItems()
        {
            List<SettingItem> list = new List<SettingItem>();

            using (XmlReader reader = XmlReader.Create(SettingsFilePath))
            {
                reader.ReadStartElement("appSettings");

                while (reader.IsStartElement("add"))
                {
                    SettingItem item = new SettingItem();
                    item.Name = reader.GetAttribute("key");
                    item.Value = reader.GetAttribute("value");

                    list.Add(item);

                    reader.Read();
                }

                reader.ReadEndElement();
            }

            return list;
        }
Beispiel #40
0
        public ActionResult Edit(int?MstSettingid)
        {
            if (!MstSettingid.HasValue)
            {
                return(HttpNotFound());
            }

            var data  = _settingBLL.GetByID(MstSettingid.Value);
            var model = new SettingItem();

            model              = Mapper.Map <SettingItem>(data);
            model.MainMenu     = _mainMenu;
            model.CurrentLogin = CurrentUser;
            model.ChangesLogs  = GetChangesHistory((int)Enums.MenuList.MasterSetting, MstSettingid.Value);

            var EntityState = new SelectList(Enum.GetValues(typeof(Enums.SettingGroup)).Cast <Enums.SettingGroup>().Select(v => new SelectListItem
            {
                Text  = EnumHelper.GetDescription(v),
                Value = EnumHelper.GetDescription(v)
            }).ToList(), "Value", "Text");

            model.SettingGroupList = new SelectList(EntityState, "Value", "Text");
            return(View(model));
        }
        public HtmlModule()
        {
            int _groupOrderBase;
            SettingItemGroup _Group;

            #region Module Special Settings
            _Group          = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            _groupOrderBase = (int)SettingItemGroup.MODULE_SPECIAL_SETTINGS;

            HtmlEditorDataType.HtmlEditorSettings(this._baseSettings, _Group);

            //If false the input box for mobile content will be hidden
            SettingItem ShowMobileText = new SettingItem(new BooleanDataType());
            ShowMobileText.Value = "true";
            ShowMobileText.Order = _groupOrderBase + 10;
            ShowMobileText.Group = _Group;
            this._baseSettings.Add("ShowMobile", ShowMobileText);
            #endregion

            this.SupportsWorkflow = true;

            // No need for view state on view. - jminond
            this.EnableViewState = false;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Shortcut"/> class. 
        /// </summary>
        /// <remarks>
        /// </remarks>
        public Shortcut()
        {
            // Obtain PortalSettings from Current Context
            if (HttpContext.Current == null || HttpContext.Current.Items["PortalSettings"] == null)
            {
                return;
            }

            // Do not remove these checks!! It fails installing modules on startup
            var PortalSettings1 = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

            var p = PortalSettings1.PortalID;

            // Get a list of modules of the current running portal
            var linkedModule =
                new SettingItem<string, ListControl>(
                    new CustomListDataType(new ModulesDB().GetModulesSinglePortal(p), "ModuleTitle", "ModuleID"))
                    {
                        Required = true,
                        Order = 0,
                        Value = "0"
                    };
            this.BaseSettings.Add("LinkedModule", linkedModule);
        }
Beispiel #43
0
        public Articles()
        {
            // Set Editor Settings [email protected] 2004/07/30
            HtmlEditorDataType.HtmlEditorSettings(this._baseSettings, SettingItemGroup.MODULE_SPECIAL_SETTINGS);

            //Switches date display on/off
            SettingItem ShowDate = new SettingItem(new BooleanDataType());

            ShowDate.Value       = "True";
            ShowDate.EnglishName = "Show Date";
            ShowDate.Group       = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            ShowDate.Order       = 10;
            this._baseSettings.Add("ShowDate", ShowDate);

            //Added by Rob Siera
            SettingItem DefaultVisibleDays = new SettingItem(new IntegerDataType());

            DefaultVisibleDays.Value       = "90";
            DefaultVisibleDays.EnglishName = "Default Days Visible";
            DefaultVisibleDays.Group       = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            DefaultVisibleDays.Order       = 20;
            this._baseSettings.Add("DefaultVisibleDays", DefaultVisibleDays);
            //
        }
        private static SettingsConfigurationFile ParseCore(XElement rootE)
        {
            string identifier = rootE.Attribute("Identifier").Value;

            List<SettingItem> settings = new List<SettingItem>();
            foreach (XElement settingE in rootE.Elements("Setting"))
            {
                string name = settingE.Attribute("Name").Value;
                string typeName = settingE.Attribute("Type").Value;
                bool isNull = settingE.TryGetAttributeValue("IsNull", false);

                // Read the setting value. If it contains a CDATA, then we need to process that first.
                string valueString = null;
                XNode valueNode = settingE.DescendantNodes().FirstOrDefault();
                if (valueNode != null)
                {
                    switch (valueNode.NodeType)
                    {
                        case System.Xml.XmlNodeType.CDATA:
                        case System.Xml.XmlNodeType.Text:
                            valueString = ((XText)valueNode).Value;
                            break;
                        default:
                            Logger.Instance.LogFormat(LogType.Warning, typeof(SettingsConfigurationFile), Properties.Resources.SettingsConfigurationEmbResInvalidValueContent, valueNode.NodeType, name);
                            break;
                    }
                }

                Type type = Type.GetType(typeName);

                SettingItem settingItem = new SettingItem(identifier, name, valueString, type);
                settings.Add(settingItem);
            }

            return new SettingsConfigurationFile(identifier, settings);
        }
Beispiel #45
0
        protected int showTabID;          //Controls which tab is displayed. When 0 the current tab is displyed.

        public Sitemap()
        {
            //Bind to Tab setting
            SettingItem BindToTab = new SettingItem(new BooleanDataType());

            BindToTab.Value = "false";
            this._baseSettings.Add("BindToTab", BindToTab);

            SettingItem showTabID = new SettingItem(new IntegerDataType());

            showTabID.Required = true;
            showTabID.Value    = "0";
            showTabID.MinValue = 0;
            showTabID.MaxValue = int.MaxValue;
            this._baseSettings.Add("ShowTabID", showTabID);

            // no viewstate needed
            this.EnableViewState = false;

            //init member variables
            list      = new SitemapItems();
            _autoBind = true;
            _bind     = BindOption.BindOptionNone;
        }
        /// <summary>
        /// Public constructor.	Sets base settings for module.
        /// </summary>
        public Events()
        {
            // Set Editor Settings [email protected] 2004/07/30 (added by Jakob Hansen)
            // Modified by Hongwei Shen 2005/09/24
            SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            int groupBase          = (int)group;

            HtmlEditorDataType.HtmlEditorSettings(_baseSettings, group);

            //Indah	Fuldner
            SettingItem RepeatDirection = new SettingItem(new ListDataType("Vertical;Horizontal"));

            RepeatDirection.Group    = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            RepeatDirection.Required = true;
            RepeatDirection.Value    = "Vertical";
            RepeatDirection.Order    = groupBase + 20; //10;
            _baseSettings.Add("RepeatDirectionSetting", RepeatDirection);

            SettingItem RepeatColumn = new SettingItem(new IntegerDataType());

            RepeatColumn.Group    = group; // SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            RepeatColumn.Required = true;
            RepeatColumn.Value    = "1";
            RepeatColumn.MinValue = 1;
            RepeatColumn.MaxValue = 10;
            RepeatColumn.Order    = groupBase + 25; // 20;
            _baseSettings.Add("RepeatColumns", RepeatColumn);

            SettingItem showItemBorder = new SettingItem(new BooleanDataType());

            showItemBorder.Group = group; //SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            showItemBorder.Order = groupBase + 30;
            showItemBorder.Value = "false";
            _baseSettings.Add("ShowBorder", showItemBorder);
            //End Indah	Fuldner

            SettingItem DelayExpire = new SettingItem(new IntegerDataType());

            DelayExpire.Group    = group;          //SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            DelayExpire.Order    = groupBase + 35; // 40;
            DelayExpire.Value    = "365";          // 1	year
            DelayExpire.MinValue = 0;
            DelayExpire.MaxValue = 3650;           //10 years
            _baseSettings.Add("DelayExpire", DelayExpire);

            // devsolution 2003/6/17: Added items for calendar control
            // Show Calendar -	Show a visual calendar with
            //					Default is false for backward compatibility
            //					Must edit collection properties and set to true
            //					to show calendar
            SettingItem ShowCalendar = new SettingItem(new BooleanDataType());

            ShowCalendar.Group = group;          //SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            ShowCalendar.Order = groupBase + 40; // 50;
            ShowCalendar.Value = "false";
            _baseSettings.Add("ShowCalendar", ShowCalendar);
            // devsolution 2003/6/17: Finished - Added items for calendar control

            // Change by [email protected]
            // Date: 27/2/2003
            SupportsWorkflow = true;
            // End Change [email protected]
        }
Beispiel #47
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LanguageSwitcher"/> class.
        /// </summary>
        /// <remarks>
        /// </remarks>
        public LanguageSwitcher()
        {
            // Language Switcher Module - Type
            var languageSwitcherTypesOptions = new List <SettingOption>
            {
                new SettingOption(
                    (int)LanguageSwitcherType.DropDownList,
                    General.GetString("LANGSWITCHTYPE_DROPDOWNLIST", "DropDownList", null)),
                new SettingOption(
                    (int)LanguageSwitcherType.VerticalLinksList,
                    General.GetString("LANGSWITCHTYPE_LINKS", "Links", null)),
                new SettingOption(
                    (int)LanguageSwitcherType.HorizontalLinksList,
                    General.GetString("LANGSWITCHTYPE_LINKSHORIZONTAL", "Links Horizontal", null))
            };

            var languageSwitchType =
                new SettingItem <string, ListControl>(
                    new CustomListDataType(languageSwitcherTypesOptions, "Name", "Val"))
            {
                EnglishName = "Language Switcher Type",
                Description = "Select here how your language switcher should look like.",
                Value       = ((int)LanguageSwitcherType.VerticalLinksList).ToString(),
                Order       = (int)SettingItemGroup.THEME_LAYOUT_SETTINGS + 910,
                Group       = SettingItemGroup.THEME_LAYOUT_SETTINGS
            };

            this.BaseSettings.Add("LANGUAGESWITCHER_TYPES", languageSwitchType);

            // Language Switcher Module - DisplayOptions
            var languageSwitcherDisplayOptions = new List <SettingOption>
            {
                new SettingOption(
                    (int)LanguageSwitcherDisplay.DisplayCultureList,
                    General.GetString("LANGSWITCHTDISPLAY_CULTURELIST", "Using Culture Name", null)),
                new SettingOption(
                    (int)LanguageSwitcherDisplay.DisplayUICultureList,
                    General.GetString("LANGSWITCHTDISPLAY_UICULTURELIST", "Using UI Culture Name", null)),
                new SettingOption(
                    (int)LanguageSwitcherDisplay.DisplayNone,
                    General.GetString("LANGSWITCHTDISPLAY_NONE", "None", null))
            };

            // Flags
            var languageSwitchFlags =
                new SettingItem <string, ListControl>(
                    new CustomListDataType(languageSwitcherDisplayOptions, "Name", "Val"))
            {
                EnglishName = "Show Flags as",
                Description = "Select here how flags should look like.",
                Value       = ((int)LanguageSwitcherDisplay.DisplayCultureList).ToString(),
                Order       = (int)SettingItemGroup.THEME_LAYOUT_SETTINGS + 920,
                Group       = SettingItemGroup.THEME_LAYOUT_SETTINGS
            };

            this.BaseSettings.Add("LANGUAGESWITCHER_FLAGS", languageSwitchFlags);

            // Labels
            var languageSwitchLabels =
                new SettingItem <string, ListControl>(
                    new CustomListDataType(languageSwitcherDisplayOptions, "Name", "Val"))
            {
                EnglishName = "Show Labels as",
                Description = "Select here how Labels should look like.",
                Value       = ((int)LanguageSwitcherDisplay.DisplayCultureList).ToString(),
                Order       = (int)SettingItemGroup.THEME_LAYOUT_SETTINGS + 930,
                Group       = SettingItemGroup.THEME_LAYOUT_SETTINGS
            };

            this.BaseSettings.Add("LANGUAGESWITCHER_LABELS", languageSwitchLabels);

            // Language Switcher Module - NamesOptions
            var languageSwitcherNamesOptions = new List <SettingOption>
            {
                new SettingOption(
                    (int)LanguageSwitcherName.NativeName,
                    General.GetString("LANGSWITCHTNAMES_NATIVENAME", "Native Name", null)),
                new SettingOption(
                    (int)LanguageSwitcherName.EnglishName,
                    General.GetString("LANGSWITCHTNAMES_ENGLISHNAME", "English Name", null)),
                new SettingOption(
                    (int)LanguageSwitcherName.DisplayName,
                    General.GetString("LANGSWITCHTNAMES_DISPLAYNAME", "Display Name", null))
            };

            // Names
            var languageSwitcherName =
                new SettingItem <string, ListControl>(new CustomListDataType(languageSwitcherNamesOptions, "Name", "Val"))
            {
                EnglishName = "Show names as",
                Description = "Select here how names should look like.",
                Value       = ((int)LanguageSwitcherName.NativeName).ToString(),
                Order       = (int)SettingItemGroup.THEME_LAYOUT_SETTINGS + 940,
                Group       = SettingItemGroup.THEME_LAYOUT_SETTINGS
            };

            this.BaseSettings.Add("LANGUAGESWITCHER_NAMES", languageSwitcherName);

            // Use flag images from portal's images folder?
            var customFlags = new SettingItem <bool, CheckBox>
            {
                Order       = (int)SettingItemGroup.THEME_LAYOUT_SETTINGS + 950,
                Group       = SettingItemGroup.THEME_LAYOUT_SETTINGS,
                EnglishName = "Use custom flags?",
                Description =
                    "Check this if you want to use custom flags from portal's images folder. Custom flags are located in portal folder. /images/flags/",
                Value = false
            };

            this.BaseSettings.Add("LANGUAGESWITCHER_CUSTOMFLAGS", customFlags);

            SupportsWorkflow = false;
        }
Beispiel #48
0
        public Pictures()
        {
            // Add support for workflow
            this.SupportsWorkflow = true;

            // Album Path Setting
            var albumPath = new SettingItem <string, TextBox>(new PortalUrlDataType())
            {
                Required = true, Value = "Album", Order = 3
            };

            this.BaseSettings.Add("AlbumPath", albumPath);

            // Thumbnail Resize Options
            var thumbnailResizeOptions = new List <Option>
            {
                new Option(
                    (int)ResizeOption.FixedWidthHeight,
                    General.GetString("PICTURES_FIXED_WIDTH_AND_HEIGHT", "Fixed width and height", this)),
                new Option(
                    (int)ResizeOption.MaintainAspectWidth,
                    General.GetString("PICTURES_MAINTAIN_ASPECT_FIXED_WIDTH", "Maintain aspect fixed width", this)),
                new Option(
                    (int)ResizeOption.MaintainAspectHeight,
                    General.GetString("PICTURES_MAINTAIN_ASPECT_FIXED_HEIGHT", "Maintain aspect fixed height", this))
            };

            // Thumbnail Resize Settings
            var thumbnailResize = new SettingItem <string, ListControl>(new CustomListDataType(thumbnailResizeOptions, "Name", "Val"))
            {
                Required = true, Value = ((int)ResizeOption.FixedWidthHeight).ToString(), Order = 4
            };

            this.BaseSettings.Add("ThumbnailResize", thumbnailResize);

            // Thumbnail Width Setting
            var thumbnailWidth = new SettingItem <int, TextBox>()
            {
                Required = true, Value = 100, Order = 5, MinValue = 2, MaxValue = 9999
            };

            this.BaseSettings.Add("ThumbnailWidth", thumbnailWidth);

            // Thumbnail Height Setting
            var thumbnailHeight = new SettingItem <int, TextBox>()
            {
                Required = true, Value = 75, Order = 6, MinValue = 2, MaxValue = 9999
            };

            this.BaseSettings.Add("ThumbnailHeight", thumbnailHeight);

            // Original Resize Options
            var originalResizeOptions = new List <Option>
            {
                new Option(
                    (int)ResizeOption.NoResize, General.GetString("PICTURES_DONT_RESIZE", "Don't Resize", this)),
                new Option(
                    (int)ResizeOption.FixedWidthHeight,
                    General.GetString("PICTURES_FIXED_WIDTH_AND_HEIGHT", "Fixed width and height", this)),
                new Option(
                    (int)ResizeOption.MaintainAspectWidth,
                    General.GetString("PICTURES_MAINTAIN_ASPECT_FIXED_WIDTH", "Maintain aspect fixed width", this)),
                new Option(
                    (int)ResizeOption.MaintainAspectHeight,
                    General.GetString("PICTURES_MAINTAIN_ASPECT_FIXED_HEIGHT", "Maintain aspect fixed height", this))
            };

            // Original Resize Settings
            var originalResize = new SettingItem <string, ListControl>(new CustomListDataType(originalResizeOptions, "Name", "Val"))
            {
                Required = true, Value = ((int)ResizeOption.MaintainAspectWidth).ToString(), Order = 7
            };

            this.BaseSettings.Add("OriginalResize", originalResize);

            // Original Width Settings
            var originalWidth = new SettingItem <int, TextBox>()
            {
                Required = true, Value = 800, Order = 8, MinValue = 2, MaxValue = 9999
            };

            this.BaseSettings.Add("OriginalWidth", originalWidth);

            // Original Width Settings
            var originalHeight = new SettingItem <int, TextBox>()
            {
                Required = true, Value = 600, Order = 9, MinValue = 2, MaxValue = 9999
            };

            this.BaseSettings.Add("OriginalHeight", originalHeight);

            // Repeat Direction Options
            var repeatDirectionOptions = new List <Option>
            {
                new Option(
                    (int)RepeatDirection.Horizontal, General.GetString("PICTURES_HORIZONTAL", "Horizontal", this)),
                new Option((int)RepeatDirection.Vertical, General.GetString("PICTURES_VERTICAL", "Vertical", this))
            };

            // Repeat Direction Setting
            var repeatDirectionSetting = new SettingItem <string, ListControl>(new CustomListDataType(repeatDirectionOptions, "Name", "Val"))
            {
                Required = true, Value = ((int)RepeatDirection.Horizontal).ToString(), Order = 10
            };

            this.BaseSettings.Add("RepeatDirection", repeatDirectionSetting);

            // Repeat Columns Setting
            var repeatColumns = new SettingItem <int, TextBox>()
            {
                Required = true, Value = 6, Order = 11, MinValue = 1, MaxValue = 200
            };

            this.BaseSettings.Add("RepeatColumns", repeatColumns);

            // Layouts
            var layouts = new Hashtable();

            foreach (var layoutControl in
                     Directory.GetFiles(
                         HttpContext.Current.Server.MapPath(Path.ApplicationRoot + "/Design/PictureLayouts"), "*.ascx"))
            {
                var layoutControlDisplayName = layoutControl.Substring(
                    layoutControl.LastIndexOf("\\") + 1,
                    layoutControl.LastIndexOf(".") - layoutControl.LastIndexOf("\\") - 1);
                var layoutControlName = layoutControl.Substring(layoutControl.LastIndexOf("\\") + 1);
                layouts.Add(layoutControlDisplayName, layoutControlName);
            }

            // Thumbnail Layout Setting
            var thumbnailLayoutSetting = new SettingItem <string, ListControl>(new CustomListDataType(layouts, "Key", "Value"))
            {
                Required = true, Value = "DefaultThumbnailView.ascx", Order = 12
            };

            this.BaseSettings.Add("ThumbnailLayout", thumbnailLayoutSetting);

            // Thumbnail Layout Setting
            var imageLayoutSetting = new SettingItem <string, ListControl>(new CustomListDataType(layouts, "Key", "Value"))
            {
                Required = true, Value = "DefaultImageView.ascx", Order = 13
            };

            this.BaseSettings.Add("ImageLayout", imageLayoutSetting);

            // PicturesPerPage
            var picturesPerPage = new SettingItem <int, TextBox>()
            {
                Required = true, Value = 9999, Order = 14, MinValue = 1, MaxValue = 9999
            };

            this.BaseSettings.Add("PicturesPerPage", picturesPerPage);

            // If false the input box for bulk loads will be hidden
            var allowBulkLoad = new SettingItem <bool, CheckBox>()
            {
                Value = false, Order = 15
            };

            this.BaseSettings.Add("AllowBulkLoad", allowBulkLoad);
        }
 /// <summary>
 /// Gets the settings.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <returns>SettingItem.</returns>
 public SettingItem GetSettings(SettingItem request)
 {
     return MediaAgentFactory
         .CreateSettingAgent()
         .GetSettings(request);
 }
 /// <summary>
 /// Saves the settings.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <returns>SettingItem.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public SettingItem SaveSettings(SettingItem item)
 {
     return MediaAgentFactory
         .CreateSettingAgent()
         .SaveSettings(item);
 }
        private static SettingsConfigurationFile ParseVersion1(XElement rootE)
        {
            string identifier = rootE.TryGetAttributeValue("Identifier", null);

            if (string.IsNullOrWhiteSpace(identifier))
            {
                return null;
            }

            int iSetting = 0;

            List<SettingItem> settings = new List<SettingItem>();
            foreach (XElement settingE in rootE.Elements("Setting"))
            {
                // Dissect the element and retrieve all attributes
                string name = settingE.TryGetAttributeValue("Name", null);
                if (string.IsNullOrWhiteSpace(name))
                {
                    Logger.Instance.LogFormat(LogType.Warning, typeof(SettingsConfigurationFileParser), Properties.Resources.SettingItemInvalidName, iSetting + 1);
                    continue;
                }

                string typeName = settingE.TryGetAttributeValue("Type", null);
                if (string.IsNullOrWhiteSpace(typeName))
                {
                    Logger.Instance.LogFormat(LogType.Warning, typeof(SettingsConfigurationFileParser), Properties.Resources.SettingItemEmptyType, name);
                    continue;
                }
                if (!SupportedSettingTypes.Contains(typeName))
                {
                    Logger.Instance.LogFormat(LogType.Warning, typeof(SettingsConfigurationFileParser), Properties.Resources.SettingItemInvalidType, typeName, string.Join(",", SupportedSettingTypes));
                    continue;
                }

                bool isNull = settingE.TryGetAttributeValue("IsNull", false);

                // Read the setting value. If it contains a CDATA, then we need to process that first.
                string valueString = null;
                XNode valueNode = settingE.DescendantNodes().FirstOrDefault();
                if (valueNode != null)
                {
                    switch (valueNode.NodeType)
                    {
                        case System.Xml.XmlNodeType.CDATA:
                        case System.Xml.XmlNodeType.Text:
                            valueString = ((XText)valueNode).Value;
                            break;
                        default:
                            Logger.Instance.LogFormat(LogType.Warning, typeof(SettingsConfigurationFile), Properties.Resources.SettingsConfigurationEmbResInvalidValueContent, valueNode.NodeType, name);
                            break;
                    }
                }

                // TODO: This will work only with primitive types (String, Boolean etc.). This could be made extensible to allow storing other types as well.
                Type type = Type.GetType(typeName);
                object defaultValue = Convert.ChangeType(valueString, type, CultureInfo.InvariantCulture);

                SettingItem settingItem = new SettingItem(name, defaultValue, defaultValue, type);
                settings.Add(settingItem);

                iSetting++;
            }

            return new SettingsConfigurationFile(identifier, settings);
        }
Beispiel #52
0
        private void BuildSectionsTree(ISettingsService settings)
        {
            Dictionary <string, SectionViewModel> sectionsTemp   = new Dictionary <string, SectionViewModel>();
            Dictionary <string, string>           sectionParents = new Dictionary <string, string>();

            foreach (IdentifierInfo identifier in _displayConfiguration.Identifiers)
            {
                SectionViewModel svm = null;
                if (!sectionsTemp.TryGetValue(identifier.Name, out svm))
                {
                    sectionParents[identifier.Name] = identifier.Parent;

                    svm = new SectionViewModel(identifier);
                    sectionsTemp.Add(svm.Identifier, svm);
                }

                foreach (SettingInfo info in identifier.Settings)
                {
                    SettingItem setting = settings.GetSetting(info.CreateSettingKey());
                    svm.Add(info, setting);
                }
            }

            _sections = new List <GroupedSectionViewModel>();
            // Create hierarchy, starting with the sections that don't have parents
            foreach (var kvp in sectionParents.OrderBy(k => k.Value))
            {
                SectionViewModel section    = sectionsTemp.FirstOrDefault(s => s.Key == kvp.Key).Value;
                string           parentName = kvp.Value;
                bool             hasParent  = (parentName != null);

                // Create group for this item
                GroupedSectionViewModel group = new GroupedSectionViewModel(section);

                if (hasParent)
                {
                    // Find parent group
                    // TODO: If there is no parent group, create a dummy group
                    GroupedSectionViewModel parentGroup = GetAllSections().FirstOrDefault(s => s.Identifier == parentName);
                    if (parentGroup == null)
                    {
                        // Create a dummy group
                        parentGroup            = new GroupedSectionViewModel(null);
                        parentGroup.Identifier = parentName;
                        parentGroup.Header     = parentName;
                        _sections.Add(parentGroup);
                    }

                    parentGroup.Children.Add(group);
                }
                else
                {
                    _sections.Add(group);
                }
            }

            // Always select the "Shared" section
            _sections.First(s => s.Identifier == SectionNameShared).IsSelected = true;

            ICollectionView view = CollectionViewSource.GetDefaultView(_sections);

            view.SortDescriptions.Add(new SortDescription("Header", ListSortDirection.Ascending));
            view.SortDescriptions.Add(new SortDescription("Order", ListSortDirection.Ascending));
        }
Beispiel #53
0
 public void Remove(string sectionName, SettingItem item)
 {
     _settings.Remove(sectionName, item);
 }
Beispiel #54
0
 public void AddOrUpdate(string sectionName, SettingItem item)
 {
     _settings.AddOrUpdate(sectionName, item);
 }
Beispiel #55
0
        /// <summary>
        /// Constructor set module settings
        /// </summary>
        public FileDirectoryTree()
        {
            // modified by Hongwei Shen
            SettingItemGroup group = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            int groupBase          = (int)group;

            var directory = new SettingItem <string, TextBox>()
            {
                EnglishName = "Directory Path",
                Required    = true,
                Order       = groupBase + 20,
                Group       = group,
                Value       = Path.ApplicationRoot + "/portals"
            };

            // Changed to virutal root from physical

            //directory.Value = Path.ApplicationPhysicalPath;
            this.BaseSettings.Add("Directory", directory);

            var LinkType = new SettingItem <string, ListControl>(new ListDataType <string, ListControl>("Downloadable Link;Network Share"));

            LinkType.EnglishName = "Link Type";
            LinkType.Group       = group;
            LinkType.Order       = groupBase + 25; //2;
            LinkType.Value       = "Downloadable Link";
            this.BaseSettings.Add("LinkType", LinkType);

            var Target = new SettingItem <string, ListControl>(new ListDataType <string, ListControl>("blank;parent;self;top"));

            Target.EnglishName = "Target Window";
            Target.Required    = false;
            Target.Group       = group;
            Target.Order       = groupBase + 30; //3;
            Target.Value       = "blank";
            this.BaseSettings.Add("Target", Target);

            var Collapsed = new SettingItem <bool, CheckBox>();

            Collapsed.EnglishName = "Collapsed View";
            Collapsed.Group       = group;
            Collapsed.Order       = groupBase + 35; //4;
            Collapsed.Value       = true;
            this.BaseSettings.Add("Collapsed", Collapsed);

            var Style = new SettingItem <string, TextBox>();

            Style.EnglishName = "Style";
            Style.Required    = false;
            Style.Group       = group;
            Style.Order       = groupBase + 40; //5;
            Style.Value       = string.Empty;
            this.BaseSettings.Add("Style", Style);

            var Indent = new SettingItem <string, TextBox>();

            Indent.EnglishName = "SubDirectory Indent (px)";
            Indent.Required    = false;
            Indent.Group       = group;
            Indent.Order       = groupBase + 45; //6;
            Indent.Value       = "20px";
            this.BaseSettings.Add("Indent", Indent);
        }
Beispiel #56
0
        /// <summary>
        /// Changed by [email protected]
        ///   Page are different for custom page layout an theme, this cannot be static
        ///   Added by [email protected]
        ///   Cache by Manu
        ///   non static function, Thierry : this is necessary for page custom layout and themes
        /// </summary>
        /// <returns>
        /// A System.Collections.Hashtable value...
        /// </returns>
        private Dictionary <string, ISettingItem> GetPageBaseSettings()
        {
            // Define base settings
            var baseSettings = new Dictionary <string, ISettingItem>();

            // 2_aug_2004 Cory Isakson
            var groupOrderBase = (int)SettingItemGroup.NAVIGATION_SETTINGS;
            var group          = SettingItemGroup.NAVIGATION_SETTINGS;

            var tabPlaceholder = new SettingItem <bool, CheckBox>(new BaseDataType <bool, CheckBox>())
            {
                Group       = group,
                Order       = groupOrderBase,
                Value       = false,
                EnglishName = "Act as a Placeholder?",
                Description = "Allows this tab to act as a navigation placeholder only."
            };

            baseSettings.Add("TabPlaceholder", tabPlaceholder);

            var tabLink = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                Value       = string.Empty,
                Order       = groupOrderBase + 1,
                EnglishName = "Static Link URL",
                Description = "Allows this tab to act as a navigation link to any URL."
            };

            baseSettings.Add("TabLink", tabLink);

            var tabUrlKeyword = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                Order       = groupOrderBase + 2,
                EnglishName = "URL Keyword",
                Description = "Allows you to specify a keyword that would appear in your URL."
            };

            baseSettings.Add("TabUrlKeyword", tabUrlKeyword);

            var urlPageName = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                Order       = groupOrderBase + 3,
                EnglishName = "URL Page Name",
                Description =
                    "This setting allows you to specify a name for this tab that will show up in the URL instead of default.aspx"
            };

            baseSettings.Add("UrlPageName", urlPageName);

            var PageList       = new ArrayList(new PagesDB().GetPagesFlat(this.PortalSettings.PortalID));
            var noSelectedPage = new PageItem {
                Name = General.GetString("NONE"), ID = -1
            };

            PageList.Insert(0, noSelectedPage);


            var FB_LikeGate_Page = new SettingItem <string, ListControl>(new CustomListDataType(PageList, "Name", "ID"))
            {
                Group       = group,
                Order       = groupOrderBase + 4,
                EnglishName = "FB Like Gate Page",
                Description =
                    "This setting allows you to specify an url to redirect if the user doesn't like your page"
            };

            baseSettings.Add("FB_LikeGate_Page", FB_LikeGate_Page);

            // groupOrderBase = (int)SettingItemGroup.META_SETTINGS;
            group = SettingItemGroup.META_SETTINGS;
            var tabTitle = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                EnglishName = "Tab / Page Title",
                Description =
                    "Allows you to enter a title (Shows at the top of your browser) for this specific Tab / Page. Enter something here to override the default portal wide setting."
            };

            baseSettings.Add("TabTitle", tabTitle);

            var tabMetaKeyWords = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                EnglishName = "Tab / Page Keywords",
                Description =
                    "This setting is to help with search engine optimization. Enter 1-15 Default Keywords that represent what this Tab / Page is about.Enter something here to override the default portal wide setting."
            };

            baseSettings.Add("TabMetaKeyWords", tabMetaKeyWords);
            var tabMetaDescription = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                EnglishName = "Tab / Page Description",
                Description =
                    "This setting is to help with search engine optimization. Enter a description (Not too long though. 1 paragraph is enough) that describes this particular Tab / Page. Enter something here to override the default portal wide setting."
            };

            baseSettings.Add("TabMetaDescription", tabMetaDescription);
            var tabMetaEncoding = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                EnglishName = "Tab / Page Encoding",
                Description =
                    "Every time your browser returns a page it looks to see what format it is retrieving. This allows you to specify the content type for this particular Tab / Page. Enter something here to override the default portal wide setting."
            };

            baseSettings.Add("TabMetaEncoding", tabMetaEncoding);
            var tabMetaOther = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                EnglishName = "Additional Meta Tag Entries",
                Description =
                    "This setting allows you to enter new tags into this Tab / Page's HEAD Tag. Enter something here to override the default portal wide setting."
            };

            baseSettings.Add("TabMetaOther", tabMetaOther);
            var tabKeyPhrase = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Group       = group,
                EnglishName = "Tab / Page Keyphrase",
                Description =
                    "This setting can be used by a module or by a control. It allows you to define a message/phrase for this particular Tab / Page This can be used for search engine optimisation. Enter something here to override the default portal wide setting."
            };

            baseSettings.Add("TabKeyPhrase", tabKeyPhrase);

            // changed Thierry (Tiptopweb) : have a dropdown menu to select layout and themes
            groupOrderBase = (int)SettingItemGroup.THEME_LAYOUT_SETTINGS;
            group          = SettingItemGroup.THEME_LAYOUT_SETTINGS;

            // get the list of available layouts
            // changed: Jes1111 - 2004-08-06
            var layoutsList = new ArrayList(new LayoutManager(this.PortalSettings.PortalPath).GetLayouts());


            var noCustomLayout = new LayoutItem {
                Name = General.GetString("PAGESETTINGS_SITEDEFAULT", "(Site Default)")
            };

            layoutsList.Insert(0, noCustomLayout);

            // get the list of available themes
            // changed: Jes1111 - 2004-08-06
            var themesList    = new ArrayList(new ThemeManager(this.PortalSettings.PortalPath).GetThemes());
            var noCustomTheme = new ThemeItem {
                Name = General.GetString("PAGESETTINGS_SITEDEFAULT", "(Site Default)")
            };

            themesList.Insert(0, noCustomTheme);

            // changed: Jes1111 - 2004-08-06
            var customLayout = new SettingItem <string, ListControl>(new CustomListDataType(layoutsList, "Name", "Name"))
            {
                Group       = group,
                Order       = groupOrderBase + 11,
                EnglishName = "Custom Layout",
                Description = "Set a custom layout for this tab only"
            };

            baseSettings.Add("CustomLayout", customLayout);

            // SettingItem CustomTheme = new SettingItem<string, TextBox>(new BaseDataType<string, TextBox>());
            // changed: Jes1111 - 2004-08-06
            var customTheme = new SettingItem <string, ListControl>(new CustomListDataType(themesList, "Name", "Name"))
            {
                Group       = group,
                Order       = groupOrderBase + 12,
                EnglishName = "Custom Theme",
                Description = "Set a custom theme for the modules in this tab only"
            };

            baseSettings.Add("CustomTheme", customTheme);

            // SettingItem CustomThemeAlt = new SettingItem<string, TextBox>(new BaseDataType<string, TextBox>());
            // changed: Jes1111 - 2004-08-06
            var customThemeAlt = new SettingItem <string, ListControl>(
                new CustomListDataType(themesList, "Name", "Name"))
            {
                Group       = group,
                Order       = groupOrderBase + 13,
                EnglishName = "Custom Alt Theme",
                Description = "Set a custom alternate theme for the modules in this tab only"
            };

            baseSettings.Add("CustomThemeAlt", customThemeAlt);

            var customMenuImage =
                new SettingItem <string, ListControl>(new CustomListDataType(this.GetImageMenu(), "Key", "Value"))
            {
                Group       = group,
                Order       = groupOrderBase + 14,
                EnglishName = "Custom Image Menu",
                Description = "Set a custom menu image for this tab"
            };

            baseSettings.Add("CustomMenuImage", customMenuImage);

            groupOrderBase = (int)SettingItemGroup.CULTURE_SETTINGS;
            group          = SettingItemGroup.CULTURE_SETTINGS;
            var cultureList = LanguageSwitcher.GetLanguageList(true);

            // Localized tab title
            var counter = groupOrderBase + 11;

            // Ignore invariant
            foreach (
                var c in cultureList.Where(c => c != CultureInfo.InvariantCulture && !baseSettings.ContainsKey(c.Name)))
            {
                var localizedTabKeyPhrase = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
                {
                    Order       = counter,
                    Group       = group,
                    EnglishName = string.Format("Tab Key Phrase ({0})", c.Name),
                    Description = string.Format("Key Phrase this Tab/Page for {0} culture.", c.EnglishName)
                };
                baseSettings.Add(string.Format("TabKeyPhrase_{0}", c.Name), localizedTabKeyPhrase);
                var localizedTitle = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
                {
                    Order       = counter,
                    Group       = group,
                    EnglishName = string.Format("Title ({0})", c.Name),
                    Description = string.Format("Set title for {0} culture.", c.EnglishName)
                };
                baseSettings.Add(c.Name, localizedTitle);
                counter++;
            }

            return(baseSettings);
        }
        public LeavesArticleListingModule()
        {
            var group          = SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            var groupOrderBase = (int)SettingItemGroup.MODULE_SPECIAL_SETTINGS;
            var tags           = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Order       = (int)groupOrderBase + 1,
                Group       = group,
                EnglishName = "Tags",
                Description = "A string of tags by comma : IE \"Sitecore, Datastax\" or \"Datastax\" tags=sitecore,datastax"
            };

            this.BaseSettings.Add("LEAVES_ARTICLE_LISTING_TAGS", tags);

            var Order = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Order       = (int)groupOrderBase + 2,
                Group       = group,
                EnglishName = "Order",
                Description = "asc or dsc (simply the string entered order=string)"
            };

            this.BaseSettings.Add("LEAVES_ARTICLE_LISTING_ORDER", Order);

            var Sort = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Order       = (int)groupOrderBase + 3,
                Group       = group,
                EnglishName = "Sort",
                Description = "created ( simply the string sort=string)"
            };

            this.BaseSettings.Add("LEAVES_ARTICLE_LISTING_SORT", Sort);

            var Limit = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Order       = (int)groupOrderBase + 4,
                Group       = group,
                EnglishName = "Limit ",
                Description = "5 ( simply a number as a string field. default to 5 limit = 5)"
            };

            this.BaseSettings.Add("LEAVES_ARTICLE_LISTING_LIMIT", Limit);

            var Leaves_base_url = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Order       = (int)groupOrderBase + 5,
                Group       = group,
                EnglishName = "Leaves Base Url ",
                Description = "The base url to leaves : IE http://leaves.anant.us:82/api"
            };

            this.BaseSettings.Add("LEAVES_ARTICLE_LISTING_LEAVES_BASE_URL", Leaves_base_url);

            var Leaves_entries_url = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Order       = (int)groupOrderBase + 6,
                Group       = group,
                EnglishName = "Leaves Entries Url",
                Description = "The base url to leaves : IE http://leaves.anant.us:82/api/entries?"
            };

            this.BaseSettings.Add("LEAVES_ARTICLE_LISTING_LEAVES_ENTRIES_URL", Leaves_entries_url);

            var Leaves_access_key = new SettingItem <string, TextBox>(new BaseDataType <string, TextBox>())
            {
                Order       = (int)groupOrderBase + 7,
                Group       = group,
                EnglishName = "The Access Key To Use",
                Description = "API key"
            };

            this.BaseSettings.Add("LEAVES_ARTICLE_LISTING_LEAVES_ACCESS_KEY", Leaves_access_key);
        }
        private void SaveData()
        {
            List<SettingItem> items = ReadSettingItems();
            SettingItem chapelOnline = items.Find(i => i.Name == "LinkNames.ChapelOnline");

            if (chapelOnline == null)
            {
                chapelOnline = new SettingItem() { Name = "LinkNames.ChapelOnline" };
                items.Add(chapelOnline);
            }

            chapelOnline.Value = ChapelOnline.Text;

            WriteSettingItems(items);

            Response.Redirect("~/Pages/admin/default.aspx");
        }
        /// <summary>
        /// Gets the portal base settings.
        /// </summary>
        /// <param name="portalPath">
        /// The portal path.
        /// </param>
        /// <returns>
        /// </returns>
        /// <remarks>
        /// </remarks>
        public static Dictionary<string, ISettingItem> GetPortalBaseSettings(string portalPath)
        {
            Dictionary<string, ISettingItem> baseSettings;

            if (!CurrentCache.Exists(Key.PortalBaseSettings()))
            {
                // fix: Jes1111 - 27-02-2005 - for proper operation of caching
                var layoutManager = new LayoutManager(portalPath);
                var layoutList = layoutManager.GetLayouts();
                var themeManager = new ThemeManager(portalPath);
                var themeList = themeManager.GetThemes();

                // Define base settings
                baseSettings = new Dictionary<string, ISettingItem>();

                var group = SettingItemGroup.THEME_LAYOUT_SETTINGS;
                var groupOrderBase = (int)SettingItemGroup.THEME_LAYOUT_SETTINGS;

                // StringDataType
                var image =
                    new SettingItem<string, TextBox>(
                        new UploadedFileDataType(Path.WebPathCombine(Path.ApplicationRoot, portalPath)))
                        {
                            Order = groupOrderBase + 5,
                            Group = group,
                            EnglishName = "Logo",
                            Description =
                                "Enter the name of logo file here. The logo will be searched in your portal dir. For the default portal is (~/_Appleseed)."
                        };

                baseSettings.Add("SITESETTINGS_LOGO", image);

                // ArrayList layoutList = new LayoutManager(PortalPath).GetLayouts();
                var tabLayoutSetting =
                    new SettingItem<string, ListControl>(new CustomListDataType(layoutList, StringsName, StringsName))
                        {
                            Value = "Default",
                            Order = groupOrderBase + 10,
                            Group = group,
                            EnglishName = "Page layout",
                            Description = "Specify the site level page layout here."
                        };
                baseSettings.Add("SITESETTINGS_PAGE_LAYOUT", tabLayoutSetting);

                // ArrayList themeList = new ThemeManager(PortalPath).GetThemes();
                var theme =
                    new SettingItem<string, ListControl>(new CustomListDataType(themeList, StringsName, StringsName))
                        {
                            Required = true,
                            Order = groupOrderBase + 15,
                            Group = group,
                            EnglishName = "Theme",
                            Description = "Specify the site level theme here."
                        };
                baseSettings.Add("SITESETTINGS_THEME", theme);

                // SettingItem ThemeAlt = new SettingItem(new CustomListDataType(new ThemeManager(PortalPath).GetThemes(), strName, strName));
                var themeAlt =
                    new SettingItem<string, ListControl>(new CustomListDataType(themeList, StringsName, StringsName))
                        {
                            Required = true,
                            Order = groupOrderBase + 20,
                            Group = group,
                            EnglishName = "Alternate theme",
                            Description = "Specify the site level alternate theme here."
                        };
                baseSettings.Add("SITESETTINGS_ALT_THEME", themeAlt);

                // Jes1111 - 2004-08-06 - Zen support
                var allowModuleCustomThemes = new SettingItem<bool, CheckBox>
                    {
                        Order = groupOrderBase + 25,
                        Group = group,
                        Value = true,
                        EnglishName = "Allow Module Custom Themes?",
                        Description = "Select to allow Custom Theme to be set on Modules."
                    };
                baseSettings.Add("SITESETTINGS_ALLOW_MODULE_CUSTOM_THEMES", allowModuleCustomThemes);

                groupOrderBase = (int)SettingItemGroup.SECURITY_USER_SETTINGS;
                group = SettingItemGroup.SECURITY_USER_SETTINGS;

                // Show input for Portal Administrators when using Windows Authentication and Multi-portal
                // [email protected] 28.April.2003
                // This setting is removed in Global.asa for non-Windows authentication sites.
                var portalAdmins = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 5,
                        Group = group,
                        Value = Config.ADAdministratorGroup,
                        Required = false,
                        Description =
                            "Show input for Portal Administrators when using Windows Authentication and Multi-portal"
                    };

                // jes1111 - PortalAdmins.Value = ConfigurationSettings.AppSettings["ADAdministratorGroup"];
                baseSettings.Add("WindowsAdmins", portalAdmins);

                // Allow new registrations?
                var allowNewRegistrations = new SettingItem<bool, CheckBox>
                    {
                        Order = groupOrderBase + 10,
                        Group = group,
                        Value = true,
                        EnglishName = "Allow New Registrations?",
                        Description =
                            "Check this to allow users register themselves. Leave blank for register through User Manager only."
                    };
                baseSettings.Add("SITESETTINGS_ALLOW_NEW_REGISTRATION", allowNewRegistrations);

                // MH: added dynamic load of register types depending on the  content in the DesktopModules/Register/ folder
                // Register
                var regPages = new Hashtable();

                foreach (var registerPage in
                    Directory.GetFiles(
                        HttpContext.Current.Server.MapPath(
                            Path.ApplicationRoot + "/DesktopModules/CoreModules/Register/"),
                        "register*.ascx",
                        SearchOption.AllDirectories))
                {
                    var registerPageDisplayName = registerPage.Substring(
                        registerPage.LastIndexOf("\\") + 1,
                        registerPage.LastIndexOf(".") - registerPage.LastIndexOf("\\") - 1);

                    // string registerPageName = registerPage.Substring(registerPage.LastIndexOf("\\") + 1);
                    var registerPageName = registerPage.Replace(Path.ApplicationPhysicalPath, "~/").Replace("\\", "/");
                    regPages.Add(registerPageDisplayName, registerPageName.ToLower());
                }

                // Register Layout Setting
                var regType = new SettingItem<string, ListControl>(new CustomListDataType(regPages, "Key", "Value"))
                    {
                        Required = true,
                        Value = "RegisterFull.ascx",
                        EnglishName = "Register Type",
                        Description = "Choose here how Register Page should look like.",
                        Order = groupOrderBase + 15,
                        Group = group
                    };
                baseSettings.Add("SITESETTINGS_REGISTER_TYPE", regType);

                // MH:end
                // Register Layout Setting module id reference by manu
                var regModuleId = new SettingItem<int, TextBox>
                    {
                        Value = 0,
                        Required = true,
                        Order = groupOrderBase + 16,
                        Group = group,
                        EnglishName = "Register Module ID",
                        Description =
                            "Some custom registration may require additional settings, type here the ID of the module from where we should load settings (0= not used). Usually this module is added in an hidden area."
                    };
                baseSettings.Add("SITESETTINGS_REGISTER_MODULEID", regModuleId);

                // Send mail on new registration to
                var onRegisterSendTo = new SettingItem<string, TextBox>
                    {
                        Value = string.Empty,
                        Required = false,
                        Order = groupOrderBase + 17,
                        Group = group,
                        EnglishName = "Send Mail To",
                        Description = "On new registration a mail will be send to the email address you provide here."
                    };
                baseSettings.Add("SITESETTINGS_ON_REGISTER_SEND_TO", onRegisterSendTo);

                // Send mail on new registration to User from
                var onRegisterSendFrom = new SettingItem<string, TextBox>
                    {
                        Value = string.Empty,
                        Required = false,
                        Order = groupOrderBase + 18,
                        Group = group,
                        EnglishName = "Send Mail From",
                        Description =
                            "On new registration a mail will be send to the new user from the email address you provide here."
                    };
                baseSettings.Add("SITESETTINGS_ON_REGISTER_SEND_FROM", onRegisterSendFrom);

                // Terms of service
                var termsOfService = new SettingItem<string, TextBox>(new PortalUrlDataType())
                    {
                        Order = groupOrderBase + 20,
                        Group = group,
                        EnglishName = "Terms file name",
                        Description =
                            "Type here a file name used for showing terms and condition in each register page. Provide localized version adding _<culturename>. E.g. Terms.txt, will search for Terms.txt and for Terms_en-US.txt"
                    };
                baseSettings.Add("SITESETTINGS_TERMS_OF_SERVICE", termsOfService);

                var loginPages = new Hashtable();

                var baseDir = HttpContext.Current.Server.MapPath(Path.ApplicationRoot + "/DesktopModules/");

                foreach (var loginPage in Directory.GetFiles(baseDir, "signin*.ascx", SearchOption.AllDirectories))
                {
                    var loginPageDisplayName =
                        loginPage.Substring(loginPage.LastIndexOf("DesktopModules") + 1).Replace(".ascx", string.Empty);
                    var loginPageName = loginPage.Replace(Path.ApplicationPhysicalPath, "~/").Replace("\\", "/");
                    loginPages.Add(loginPageDisplayName, loginPageName.ToLower());
                }

                var logonType = new SettingItem<string, ListControl>(new CustomListDataType(loginPages, "Key", "Value"))
                    {
                        Required = false,
                        Value = "Signin.ascx",
                        EnglishName = "Login Type",
                        Description = "Choose here how login Page should look like.",
                        Order = groupOrderBase + 21,
                        Group = group
                    };
                baseSettings.Add("SITESETTINGS_LOGIN_TYPE", logonType);

                // ReCaptcha public and private key
                var recaptchaPrivateKey = new SettingItem<string, TextBox>()
                {
                    Required = false,
                    Value = "6LeQmsASAAAAADS-WeMyg9mKo5l3ERKcB4LSQieI",
                    EnglishName = "ReCaptcha private key",
                    Description = "Insert here google's ReCaptcha private key for your portal's captchas.",
                    Order = groupOrderBase + 22,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_RECAPTCHA_PRIVATE_KEY", recaptchaPrivateKey);

                var recaptchaPublicKey = new SettingItem<string, TextBox>()
                {
                    Required = false,
                    Value = "6LeQmsASAAAAAIx9ZoRJXA44sajtJjPl2L_MFrTS",
                    EnglishName = "ReCaptcha public key",
                    Description = "Insert here google's ReCaptcha public key for your portal's captchas.",
                    Order = groupOrderBase + 23,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_RECAPTCHA_PUBLIC_KEY", recaptchaPublicKey);

                // Facebook keys
                var facebookAppId = new SettingItem<string, TextBox>()
                {
                    Required = false,
                    Value = "",
                    EnglishName = "Facebook Application ID",
                    Description = "Insert here facebook's Application ID for your portal.",
                    Order = groupOrderBase + 24,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_FACEBOOK_APP_ID", facebookAppId);

                var facebookAppSecret = new SettingItem<string, TextBox>()
                {
                    Required = false,
                    Value = "",
                    EnglishName = "Facebook Application Secret",
                    Description = "Insert here facebook's Application Secret for your portal.",
                    Order = groupOrderBase + 25,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_FACEBOOK_APP_SECRET", facebookAppSecret);

                // Twitter keys
                var twitterAppId = new SettingItem<string, TextBox>() {
                    Required = false,
                    Value = "",
                    EnglishName = "Twitter Application ID",
                    Description = "Insert here twitter's Application ID for your portal.",
                    Order = groupOrderBase + 26,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_TWITTER_APP_ID", twitterAppId);

                var twitterAppSecret = new SettingItem<string, TextBox>() {
                    Required = false,
                    Value = "",
                    EnglishName = "Twitter Application Secret",
                    Description = "Insert here twitter's Application Secret for your portal.",
                    Order = groupOrderBase + 27,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_TWITTER_APP_SECRET", twitterAppSecret);

                var googleLogin = new SettingItem<bool, CheckBox>() {
                    Required = false,
                    Value = false,

                    EnglishName = "Google Login",
                    Description = "Check if you want to see the google login",
                    Order = groupOrderBase + 28,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_GOOGLE_LOGIN", googleLogin);

                // LinkedIn keys
                var linkedInAppId = new SettingItem<string, TextBox>()
                {
                    Required = false,
                    Value = "",
                    EnglishName = "LinkedIn Application ID",
                    Description = "Insert here linkedIn's Application ID for your portal.",
                    Order = groupOrderBase + 29,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_LINKEDIN_APP_ID", linkedInAppId);

                var linkedInAppSecret = new SettingItem<string, TextBox>()
                {
                    Required = false,
                    Value = "",
                    EnglishName = "LinkedIn Application Secret",
                    Description = "Insert here linkedIn's Application Secret for your portal.",
                    Order = groupOrderBase + 30,
                    Group = group
                };
                baseSettings.Add("SITESETTINGS_LINKEDIN_APP_SECRET", linkedInAppSecret);

                groupOrderBase = (int)SettingItemGroup.META_SETTINGS;
                group = SettingItemGroup.META_SETTINGS;

                // added: Jes1111 - page DOCTYPE setting
                var docType = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 5,
                        Group = group,
                        EnglishName = "DOCTYPE string",
                        Description =
                            "Allows you to enter a DOCTYPE string which will be inserted as the first line of the HTML output page (i.e. above the <html> element). Use this to force Quirks or Standards mode, particularly in IE. See <a href=\"http://gutfeldt.ch/matthias/articles/doctypeswitch/table.html\" target=\"_blank\">here</a> for details. NOTE: Appleseed.Zen requires a setting that guarantees Standards mode on all browsers.",
                        Value = string.Empty
                    };

                baseSettings.Add("SITESETTINGS_DOCTYPE", docType);

                // by John Mandia <*****@*****.**>
                var tabTitle = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 10,
                        Group = group,
                        EnglishName = "Page title",
                        Description = "Allows you to enter a default tab / page title (Shows at the top of your browser)."
                    };
                baseSettings.Add("SITESETTINGS_PAGE_TITLE", tabTitle);

                /*
                 * John Mandia: Removed This Setting. Now You can define specific Url Keywords via Tab Settings only. This is to speed up url building.
                 *
                SettingItem TabUrlKeyword = new SettingItem<string, TextBox>;
                TabUrlKeyword.Order = _groupOrderBase + 15;
                TabUrlKeyword.Group = _Group;
                TabUrlKeyword.Value = "Portal";
                TabUrlKeyword.EnglishName = "Keyword to Identify all pages";
                TabUrlKeyword.Description = "This setting is not fully implemented yet. It was to help with search engine optimisation by allowing you to specify a default keyword that would appear in your url.";
                BaseSettings.Add("SITESETTINGS_PAGE_URL_KEYWORD", TabUrlKeyword);
                */
                var tabMetaKeyWords = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 15,
                        Group = group,
                        EnglishName = "Page keywords",
                        Description =
                            "This setting is to help with search engine optimisation. Enter 1-15 Default Keywords that represent what your site is about."
                    };

                // [email protected]: No Default Value In Case People Don't want Meta Keywords; http://sourceforge.net/tracker/index.php?func=detail&aid=915614&group_id=66837&atid=515929
                baseSettings.Add("SITESETTINGS_PAGE_META_KEYWORDS", tabMetaKeyWords);
                var tabMetaDescription = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 20,
                        Group = group,
                        EnglishName = "Page description",
                        Description =
                            "This setting is to help with search engine optimisation. Enter a default description (Not too long though. 1 paragraph is enough) that describes your portal."
                    };

                // [email protected]: No Default Value In Case People Don't want a defautl descripton
                baseSettings.Add("SITESETTINGS_PAGE_META_DESCRIPTION", tabMetaDescription);
                var tabMetaEncoding = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 25,
                        Group = group,
                        EnglishName = "Page encoding",
                        Description =
                            "Every time your browser returns a page it looks to see what format it is retrieving. This allows you to specify the default content type.",
                        Value = "<META http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\" />"
                    };
                baseSettings.Add("SITESETTINGS_PAGE_META_ENCODING", tabMetaEncoding);
                var tabMetaOther = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 30,
                        Group = group,
                        EnglishName = "Default Additional Meta Tag Entries",
                        Description =
                            "This setting allows you to enter new tags into the Tab / Page's HEAD Tag. As an example we have added a portal tag to identify the version, but you could have a meta refresh tag or something else like a css reference instead.",
                        Value = string.Empty
                    };
                baseSettings.Add("SITESETTINGS_PAGE_META_OTHERS", tabMetaOther);
                var tabKeyPhrase = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 35,
                        Group = group,
                        EnglishName = "Default Page Keyphrase",
                        Description =
                            "This setting can be used by a module or by a control. It allows you to define a common message for the entire portal e.g. Welcome to x portal! This can be used for search engine optimisation. It allows you to define a keyword rich phrase to be used throughout your portal.",
                        Value = "Enter your default keyword rich Tab / Page phrase here. "
                    };
                baseSettings.Add("SITESETTINGS_PAGE_KEY_PHRASE", tabKeyPhrase);

                // added: Jes1111 - <body> element attributes setting
                var bodyAttributes = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 45,
                        Group = group,
                        EnglishName = "&lt;body&gt; attributes",
                        Description =
                            "Allows you to enter a string which will be inserted within the <body> element, e.g. leftmargin=\"0\" bottommargin=\"0\", etc. NOTE: not advisable to use this to inject onload() function calls as there is a programmatic function for that. NOTE also that is your CSS is well sorted you should not need anything here.",
                        Required = false
                    };
                baseSettings.Add("SITESETTINGS_BODYATTS", bodyAttributes);

                // end by John Mandia <*****@*****.**>
                var glAnalytics = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 50,
                        Group = group,
                        EnglishName = "Google-Analytics Code",
                        Description = "Allows you get the tracker, with this can view the statistics of your site.",
                        Value = string.Empty
                    };
                baseSettings.Add("SITESETTINGS_GOOGLEANALYTICS", glAnalytics);

                var glAnalyticsCustomVars = new SettingItem<bool, CheckBox>
                    {
                        Order = groupOrderBase + 52,
                        Group = group,
                        EnglishName = "Use Google-Analytics Custom Vars?",
                        Description =
                            "Allows you to use custom vars to track members, authenticated users and their domain names.",
                        Value = false
                    };
                baseSettings.Add("SITESETTINGS_GOOGLEANALYTICS_CUSTOMVARS", glAnalyticsCustomVars);

                var alternativeUrl = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 55,
                        Group = group,
                        EnglishName = "Alternative site url",
                        Description = "Indicate the site url for an alternative way.",
                        Value = string.Empty
                    };
                baseSettings.Add("SITESETTINGS_ALTERNATIVE_URL", alternativeUrl);

                var SnapEngage = new SettingItem<string, TextBox> {
                    Order = groupOrderBase + 57,
                    Group = group,
                    EnglishName = "SnapEngage code",
                    Description = "Allows you create a chat. Need an acount on SnapEngage.",
                    Value = string.Empty
                };
                baseSettings.Add("SITESETTINGS_SNAPENGAGE", SnapEngage);

                var addThisUsername = new SettingItem<string, TextBox>
                    {
                        Order = groupOrderBase + 56,
                        Group = group,
                        EnglishName = "AddThis Username",
                        Description = "Username for AddThis sharing and tracking.",
                        Value = "appleseedapp"
                    };
                baseSettings.Add("SITESETTINGS_ADDTHIS_USERNAME", addThisUsername);

                groupOrderBase = (int)SettingItemGroup.CULTURE_SETTINGS;
                group = SettingItemGroup.CULTURE_SETTINGS;

                var langList =
                    new SettingItem<string, ListControl>(
                        new MultiSelectListDataType(AppleseedCultures, "DisplayName", "Name"))
                        {
                            Group = group,
                            Order = groupOrderBase + 10,
                            EnglishName = "Language list",
                            Value = Config.DefaultLanguage,
                            Required = false,
                            Description =
                                "This is a list of the languages that the site will support. You can select multiples languages by pressing shift in your keyboard"
                        };

                // jes1111 - LangList.Value = ConfigurationSettings.AppSettings["DefaultLanguage"];
                baseSettings.Add("SITESETTINGS_LANGLIST", langList);

                var langDefault =
                    new SettingItem<string, DropDownList>(
                        new ListDataType<string, DropDownList>(AppleseedCultures, "DisplayName", "Name"))
                        {
                            Group = group,
                            Order = groupOrderBase + 20,
                            EnglishName = "Default Language",
                            Value = Config.DefaultLanguage,
                            Required = false,
                            Description = "This is the default language for the site."
                        };

                // jes1111 - LangList.Value = ConfigurationSettings.AppSettings["DefaultLanguage"];
                baseSettings.Add("SITESETTINGS_DEFAULTLANG", langDefault);

                #region Miscellaneous Settings

                groupOrderBase = (int)SettingItemGroup.MISC_SETTINGS;
                group = SettingItemGroup.MISC_SETTINGS;

                // Show modified by summary on/off
                var showModifiedBy = new SettingItem<bool, CheckBox>
                    {
                        Order = groupOrderBase + 10,
                        Group = group,
                        Value = false,
                        EnglishName = "Show modified by",
                        Description = "Check to show by whom the module is last modified."
                    };
                baseSettings.Add("SITESETTINGS_SHOW_MODIFIED_BY", showModifiedBy);

                // Default Editor Configuration used for new modules and workflow modules. [email protected] 13/07/2004
                var defaultEditor = new SettingItem<string, DropDownList>(new HtmlEditorDataType())
                    {
                        Order = groupOrderBase + 20,
                        Group = group,
                        Value = "FCKeditor",
                        EnglishName = "Default Editor",
                        Description = "This Editor is used by workflow and is the default for new modules."
                    };
                baseSettings.Add("SITESETTINGS_DEFAULT_EDITOR", defaultEditor);

                // Default Editor Width. [email protected] 13/07/2004
                var defaultWidth = new SettingItem<int, TextBox>
                    {
                        Order = groupOrderBase + 25,
                        Group = group,
                        Value = 700,
                        EnglishName = "Editor Width",
                        Description = "Default Editor Width"
                    };
                baseSettings.Add("SITESETTINGS_EDITOR_WIDTH", defaultWidth);

                // Default Editor Height. [email protected] 13/07/2004
                var defaultHeight = new SettingItem<int, TextBox>
                    {
                        Order = groupOrderBase + 30,
                        Group = group,
                        Value = 400,
                        EnglishName = "Editor Height",
                        Description = "Default Editor Height"
                    };
                baseSettings.Add("SITESETTINGS_EDITOR_HEIGHT", defaultHeight);

                // Show Upload (Active up editor only). [email protected] 13/07/2004
                var showUpload = new SettingItem<bool, CheckBox>
                    {
                        Value = true,
                        Order = groupOrderBase + 35,
                        Group = group,
                        EnglishName = "Upload?",
                        Description = "Only used if Editor is ActiveUp HtmlTextBox"
                    };
                baseSettings.Add("SITESETTINGS_SHOWUPLOAD", showUpload);

                // Default Image Folder. [email protected] 29/07/2004
                var defaultImageFolder =
                    new SettingItem<string, Panel>(
                        new FolderDataType(
                            HttpContext.Current.Server.MapPath(
                                string.Format("{0}/{1}/images", Path.ApplicationRoot, portalPath)),
                            "default"))
                        {
                            Order = groupOrderBase + 40,
                            Group = group,
                            Value = "default",
                            EnglishName = "Default Image Folder",
                            Description = "Set the default image folder used by Current Editor"
                        };
                baseSettings.Add("SITESETTINGS_DEFAULT_IMAGE_FOLDER", defaultImageFolder);
                groupOrderBase = (int)SettingItemGroup.MISC_SETTINGS;
                group = SettingItemGroup.MISC_SETTINGS;

                // Show module arrows to an administrator
                var showModuleArrows = new SettingItem<bool, CheckBox>
                    {
                        Order = groupOrderBase + 50,
                        Group = group,
                        Value = false,
                        EnglishName = "Show module arrows",
                        Description = "Check to show the arrows in the module title to move modules."
                    };
                baseSettings.Add("SITESETTINGS_SHOW_MODULE_ARROWS", showModuleArrows);

                // BOWEN 11 June 2005
                // Use Recycler Module for deleted modules
                var useRecycler = new SettingItem<bool, CheckBox>
                    {
                        Order = groupOrderBase + 55,
                        Group = group,
                        Value = true,
                        EnglishName = "Use Recycle Bin for Deleted Modules",
                        Description =
                            "Check to make deleted modules go to the recycler instead of permanently deleting them."
                    };
                baseSettings.Add("SITESETTINGS_USE_RECYCLER", useRecycler);

                var detailErrorMessage = new SettingItem<bool, CheckBox> {
                    Order = groupOrderBase + 56,
                    Group = group,
                    Value = false,
                    EnglishName = "Show Detail Error Message",
                    Description =
                        "Check to show Full detail Error Message when showing error."
                };
                baseSettings.Add("DETAIL_ERROR_MESSAGE", detailErrorMessage);

                // BOWEN 11 June 2005
                #endregion

                // Fix: Jes1111 - 27-02-2005 - incorrect setting for cache dependency
                // CacheDependency settingDependancies = new CacheDependency(null, new string[]{Appleseed.Framework.Settings.Cache.Key.ThemeList(ThemeManager.Path)});
                // set up a cache dependency object which monitors the four folders we are interested in
                var settingDependencies =
                    new CacheDependency(
                        new[]
                            {
                                LayoutManager.Path, layoutManager.PortalLayoutPath, ThemeManager.Path,
                                themeManager.PortalThemePath
                            });

                using (settingDependencies)
                {
                    CurrentCache.Insert(Key.PortalBaseSettings(), baseSettings, settingDependencies);
                }
            }
            else
            {
                baseSettings = (Dictionary<string, ISettingItem>)CurrentCache.Get(Key.PortalBaseSettings());
            }

            return baseSettings;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SettingItemViewModel"/> class.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="setting"></param>
        public SettingItemViewModel(SettingInfo info, SettingItem setting)
        {
            Assertions.AssertNotNull(info, "info");
            Assertions.AssertNotNull(setting, "setting");

            Info = info;
            Setting = setting;

            // Find out editor
            string editorName = Editor;
            if (string.IsNullOrWhiteSpace(editorName))
            {
                editorName = Setting.SettingType.FullName;
            }

            this.TypeEditor = TypeEditors.TypeEditorCache.CreateTypeEditor(editorName);
            this.TypeEditor.Initialize(this.EditorParameter);
            try
            {
                this.TypeEditor.Value = Setting.Value;
            }
            catch (Exception ex)
            {
                Logger.Instance.LogFormat(LogType.Warning, this, Properties.Resources.SettingItemViewModelSetSettingError, Info.Name, Info.Identifier);
                Logger.Instance.LogException(this, ex);

                Setting.ResetValue();
                this.TypeEditor.Value = Setting.Value;
            }
        }