//Obtains the directory in which the files will be saved
        public static string get_fileDirectory(SettingsData settings)
        {
            string fileDirectory;
            if (!settings.UseParisStyleFileTimestamps)
            {
                if (settings.SavePath.EndsWith("/") || settings.SavePath.EndsWith(@"\"))
                    fileDirectory = settings.SavePath.Remove(settings.SavePath.Length - 1);
                else if (settings.SavePath != "")
                    fileDirectory = settings.SavePath;
                else
                    fileDirectory = AppDomain.CurrentDomain.BaseDirectory;
            }
            else
            {
                DateTime today = DateTime.Today;
                string the_year = today.Year.ToString();
                CultureInfo the_current_culture = CultureInfo.CurrentCulture;
                Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false);
                string the_month = String.Format("{0:MMM}", today).ToString();
                Thread.CurrentThread.CurrentCulture = the_current_culture;
                the_month = the_month.Substring(0, 1).ToUpper() + the_month.Substring(1);
                string the_day = number_to_string(today.Day, 2);

                if (settings.SavePath.EndsWith("/") || settings.SavePath.EndsWith(@"\"))
                    fileDirectory = settings.SavePath.Remove(settings.SavePath.Length - 1) + @"\" + the_year + @"\" + the_month + the_year + @"\" + the_day + the_month + the_year;
                else if (settings.SavePath != "")
                    fileDirectory = settings.SavePath + @"\" + the_year + @"\" + the_month + the_year + @"\" + the_day + the_month + the_year;
                else
                    fileDirectory = AppDomain.CurrentDomain.BaseDirectory + the_year + @"\" + the_month + the_year + @"\" + the_day + the_month + the_year;
            }
            return fileDirectory;
        }
예제 #2
0
파일: Settings.cs 프로젝트: redtower/MdNote
        public Settings()
        {
            AppSettings = new SettingsData();
            FilePath = System.AppDomain.CurrentDomain.BaseDirectory
              + SETTINGS_FILENAME;

            read();
        }
예제 #3
0
 // Load settings from a JSON file
 private static void LoadSettings()
 {
     if (File.Exists(settingsFilePath))
     {
         var settingsText = File.ReadAllText(settingsFilePath);
         Settings = JsonUtility.FromJson<SettingsData>(settingsText);
     }
 }
예제 #4
0
    public SettingsData()
    {
        // Start Overloaded constructor.

        if( Instance != null )
            Instance = this;
        else
            Debug.Log ("ERROR, REINITALIZING SETTINGS!");
    }
예제 #5
0
    public void Display_View()
    {
        SiteAPI m_refSiteApi = new SiteAPI();
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
        int m_intTotalItems = 0;
        m_aInvitations = m_refFriendsApi.GetSentFriendInvitations(this.m_refContentApi.UserId, m_intCurrentPage, System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0), ref m_intTotalPages, ref m_intTotalItems);

        Populate_ViewFriendsGrid(m_aInvitations);
    }
예제 #6
0
    public void Display_View()
    {
        SiteAPI m_refSiteApi = new SiteAPI();
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

        m_aUsers = m_refFriendsApi.GetMyFriends(m_intCurrentPage, System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0), ref m_intTotalPages);
        m_aSelectedFriends = m_refFriendsApi.GetSelectedFriendsForUser(this.m_refContentApi.UserId);

        Populate_ViewFriendsGrid(m_aUsers);
    }
예제 #7
0
 public void SaveSettings()
 {
     BinaryFormatter bf = new BinaryFormatter();
     FileStream file = File.Create(Application.persistentDataPath + "/settingsInfo.dat");
     SettingsData dados = new SettingsData();
     dados.ValorTransparencia = ValorTransparencia;
     dados.ValorMusica = ValorMusica;
     bf.Serialize(file, dados);
     file.Close();
 }
예제 #8
0
        //-------------------------------------------------------------------------------
        #region Constructor
        //-------------------------------------------------------------------------------
        //
        public FrmMain()
        {
            InitializeComponent();

            tsslText.Text = tsslSynthesisNumber.Text = "";
            _settings = SettingsData.Restore(SETTINGS_FILENAME) ?? new SettingsData();

            numSynFee2.Value = _settings.Synthesis_2weapons;
            numSynFee3.Value = _settings.Synthesis_3weapons;
        }
예제 #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.login_view);
            Cheeseknife.Bind(this);

            string token = SettingsData.GetAndroidStringFromPreferences(SettingsData.APP_TOKEN);

            loginPresenter = new LoginPresenter();
            loginPresenter.Initialize(this, token);

            loginButton.Click += OnLoginClick;
        }
예제 #10
0
        public T Get <T>(string key, T defaultValue = default(T))
        {
            var actKey = key;             // GetTaggedKey(key);

            if (SettingsData.ContainsKey(actKey))
            {
                return((T)settingsData_[actKey]);
            }
            else
            {
                return(defaultValue);
            }
        }
예제 #11
0
    public void Save()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/playerInfo.dat");
        SettingsData    data = new SettingsData();

        data.speed  = senSlider.value;
        data.volume = audSlider.value;
        data.vibra  = vibToggle.isOn;

        bf.Serialize(file, data);
        file.Close();
    }
예제 #12
0
        public void PathIsURI_IsValid_ReturnsTrue()
        {
            var _input1 = "battlenet://SC2/";
            var _input2 = "battlenet://Pro/";
            var _input3 = "battlenet://WoW/";

            var result1 = SettingsData.ValidateURI(_input1);
            var result2 = SettingsData.ValidateURI(_input2);
            var result3 = SettingsData.ValidateURI(_input3);
            var result  = result1 && result2 && result3;

            Assert.IsTrue(result);
        }
예제 #13
0
    void Awake()
    {
        settings     = GetComponentsInChildren <Setting>();
        settingsData = gameObject.AddComponent <SettingsData>();

        // Settings Header
        titleText      = transform.Find("TitleText").GetComponent <Text>();
        settingsHeader = transform.Find("SettingsHeader");
        tooltipText    = settingsHeader.Find("Tooltip").GetComponent <Text>();
        Button[] settingsHeaderButtons = settingsHeader.GetComponentsInChildren <Button>();
        glossaryButton  = settingsHeaderButtons[0];
        gameplayButton  = settingsHeaderButtons[1];
        interfaceButton = settingsHeaderButtons[2];
        graphicsButton  = settingsHeaderButtons[3];
        allomancyButton = settingsHeaderButtons[4];
        worldButton     = settingsHeaderButtons[5];
        // Glossary
        glossaryHeader = transform.Find("GlossaryHeader");
        // Gameplay Header
        gameplayHeader = transform.Find("GameplayHeader");
        // Interface Header
        interfaceHeader = transform.Find("InterfaceHeader");
        // Graphics Header
        graphicsHeader = transform.Find("GraphicsHeader");
        // Allomancy Header
        allomancyHeader = transform.Find("AllomancyHeader");
        // World Header
        worldHeader = transform.Find("WorldHeader");
        // Close Button
        closeButton = transform.Find("CloseButton").GetComponent <Button>();

        closeText             = closeButton.GetComponentInChildren <Text>();
        discardButton         = transform.Find("Discardbutton").GetComponent <Button>();
        resetToDefaultsButton = transform.Find("ResetToDefaultsButton").GetComponent <Button>();
        resetToDefaultsText   = resetToDefaultsButton.GetComponentInChildren <Text>();

        // Command listeners assignment
        glossaryButton.onClick.AddListener(OpenGlossary);
        gameplayButton.onClick.AddListener(OpenGameplay);
        interfaceButton.onClick.AddListener(OpenInterface);
        graphicsButton.onClick.AddListener(OpenGraphics);
        allomancyButton.onClick.AddListener(OpenAllomancy);
        worldButton.onClick.AddListener(OpenWorld);
        closeButton.onClick.AddListener(OnClickClose);
        discardButton.onClick.AddListener(OnClickDiscard);
        resetToDefaultsButton.onClick.AddListener(OnClickResetToDefaults);
        // Initial field assignments
        titleText.text           = s_settings;
        closeText.text           = s_back;
        resetToDefaultsText.text = s_reset;
    }
예제 #14
0
    public void SaveSettings()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/gewoonboefsettings.man");

        SettingsData settingsData = new SettingsData();

        //Put all saveable data here,saveData.value = someScript.value
        settingsData.MasterVolume = GameSettingsData.MasterVolume;
        settingsData.MusicVolume  = GameSettingsData.MusicVolume;
        settingsData.SFXVolume    = GameSettingsData.SFXVolume;
        bf.Serialize(file, settingsData);
        file.Close();
    }
예제 #15
0
 public static SettingsData LoadSettings()
 {
     if (File.Exists(settingsPath))
     {
         stream = new FileStream(settingsPath, FileMode.Open);
         SettingsData data = formatter.Deserialize(stream) as SettingsData;
         stream.Close();
         return(data);
     }
     else
     {
         return(null);
     }
 }
예제 #16
0
        /// <summary>Handles the settings changed event.</summary>
        /// <param name="data">The data.</param>
        private void HandleSettingsChanged(SettingsData data)
        {
            if (!this.isAccentColorSet)
            {
                var systemAccentColor  = (Color)Application.Current.Resources["SystemAccentColor"];
                var spotifyAccentColor = (Color)Application.Current.Resources["SpotifyAccentColor"];

                var accentColor = data.UseSystemAccentColor ? systemAccentColor : spotifyAccentColor;
                Application.Current.Resources["SystemAccentColor"] = accentColor;
                Application.Current.Resources["LowerBarColor"]     = this.GetLowerBarColorFromAccentColor(0.5, accentColor);

                this.isAccentColorSet = true;
            }
        }
예제 #17
0
    public static void SaveSettings(SettingsUiHelper settings)
    {
        Debug.Log(settingsPath);

        BinaryFormatter formatter = new BinaryFormatter();
        FileStream      stream    = new FileStream(settingsPath, FileMode.Create);

        SettingsData data = new SettingsData(settings);

        formatter.Serialize(stream, data);
        stream.Close();

        Debug.Log("Settings file saved at: " + mapPath);
    }
        private void Init()
        {
            settingsData = new SettingsData();
            settingsData.AddTabData(CreateTabData("A", "icon-settings"));
            settingsData.AddTabData(CreateTabData("B", "icon-play"));
            settingsData.AddTabData(CreateTabData("C", "icon-music"));

            var bg = RootMain.CreateChild<UguiSprite>("bg", -1);
            {
                bg.Anchor = AnchorType.Fill;
                bg.Offset = Offset.Zero;
                bg.Alpha = 0.25f;
            }
        }
예제 #19
0
    void OnDisable()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/settings.dat");

        SettingsData data = new SettingsData();

        data.alwaysNorth = alwaysNorth;
        data.soundOn     = soundOn;
        data.volume      = volume;

        bf.Serialize(file, data);
        file.Close();
    }
예제 #20
0
 /// <summary>
 /// Gets the Settings for Supplied User.
 /// </summary>
 /// <param name="user">User for which Settings are required.</param>
 /// <returns>Settings: The Settings for User</returns>
 public Task <Settings> GetUserSettingsAsync(User user)
 {
     return(Task.Factory.StartNew(() =>
     {
         if (ValidationService.Instance().User(user))
         {
             return SettingsData.Instance().GetUserSettings(user);
         }
         else
         {
             return null;
         }
     }));
 }
예제 #21
0
        public static BaseDataReader <BaseData> GetReader(int someType)
        {
            BaseDataReader <BaseData> ret = null;

            if (someType == (int)DataReader.postprocesorsData)
            {
                ret = new PostprocesorsData();
            }
            else if (someType == (int)DataReader.settingsData)
            {
                ret = new SettingsData();
            }
            return(ret);
        }
예제 #22
0
    public void SettingsAutoSave()
    {
        BinaryFormatter bf       = new BinaryFormatter();
        SettingsData    settings = new SettingsData();

        settings.isButtonOn = btnButtonOn.IsActive();
        settings.isMusicOn  = btnMusicOn.IsActive();
        settings.volume     = setVolume.musicValue;
        settings.lng        = Locale.CurrentLanguage;
        FileStream file = File.Create(Application.persistentDataPath + "/settings.qr");

        //bf.Serialize(file, settings);
        file.Close();
    }
    /// <summary>
    /// Load the setting file
    /// </summary>
    public void LoadSettingsFile()
    {
        SettingsData data = AssetDatabase.LoadAssetAtPath <SettingsData>($"{BehaviorTreeGraphWindow.c_DataPath}/settings.asset");

        if (data == null)
        {
            DataFile = ScriptableObject.CreateInstance("SettingsData") as SettingsData;
            CreateSettingsFile();
        }
        else
        {
            DataFile = data;
        }
    }
예제 #24
0
    public void Load()
    {
        if (File.Exists(Application.persistentDataPath + "/playerInfo.dat"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/playerInfo.dat", FileMode.Open);
            SettingsData    data = (SettingsData)bf.Deserialize(file);
            file.Close();

            senSlider.value = data.speed;
            audSlider.value = data.volume;
            vibToggle.isOn  = data.vibra;
        }
    }
    void LoadSettings()
    {
        SettingsData data = SaveManager.LoadSettings();

        if (data != null)
        {
            CurrentVolume           = data.volume;
            CurrentFullScreenStatus = data.FullScreen;
            CurrentQuality          = data.GraphicsQuality;
            CurrentResolution       = data.Resolution;

            resolutions = Screen.resolutions;

            ResolutionDropDown.ClearOptions();
            List <string> options = new List <string>();
            for (int i = 0; i < resolutions.Length; i++)
            {
                string option = resolutions[i].width + "x" + resolutions[i].height;
                options.Add(option);
            }
            ResolutionDropDown.AddOptions(options);
            ResolutionDropDown.value = CurrentResolution;
            ResolutionDropDown.RefreshShownValue();
        }
        else
        {
            CurrentVolume           = 20f;
            CurrentFullScreenStatus = true;
            CurrentQuality          = QualitySettings.GetQualityLevel();

            resolutions = Screen.resolutions;

            ResolutionDropDown.ClearOptions();
            List <string> options = new List <string>();

            for (int i = 0; i < resolutions.Length; i++)
            {
                string option = resolutions[i].width + "x" + resolutions[i].height;
                options.Add(option);

                if (resolutions[i].width == Screen.currentResolution.width && resolutions[i].height == Screen.currentResolution.height)
                {
                    CurrentResolution = i;
                }
            }
            ResolutionDropDown.AddOptions(options);
            ResolutionDropDown.value = CurrentResolution;
            ResolutionDropDown.RefreshShownValue();
        }
    }
예제 #26
0
        public Form1()
        {
            InitializeComponent();

            data = SettingsData.Restore("Settings.dat");
            twitter = new Twitter10();
            if (data.UserInfoList.Count > 0) {
                twitter.AccessToken = data.UserInfoList[0].AccessToken;
                twitter.AccessTokenSecret = data.UserInfoList[0].AccessTokenSecret;
            }
            else {
                this.Close();
            }
        }
예제 #27
0
    private void _on_Default_button_down()
    {
        SettingsData.Default();
        Dictionary audio = SettingsData.Settings["audio"] as Dictionary;

        _opMenu.Visible = false;
        _masterVolume   = (float)audio["master"];
        _musicVolume    = (float)audio["music"];
        _monsterVolume  = (float)audio["monster"];

        UpdateScrollButton();

        UpdateVolume();
    }
예제 #28
0
    private void _on_Apply_button_down()
    {
        var audio = SettingsData.Settings["audio"] as Dictionary;

        _opMenu.Visible  = false;
        audio["master"]  = _masterVolume;
        audio["music"]   = _musicVolume;
        audio["monster"] = _monsterVolume;
        SettingsData.Settings["audio"] = audio.Duplicate();

        UpdateVolume();

        SettingsData.Save();
    }
예제 #29
0
        public void value_CPS_style_with_multiple_source_with_no_match()
        {
            var core1 = new SettingsData().With("key1", "val1");
            var core2 = new SettingsData().With("key2", "val2");
            var core3 = new SettingsData().With("key3", "val3");

            var request = SettingsRequestData.For(core1, core2, core3);

            var action = MockRepository.GenerateMock <Action <object> >();

            request.Value("missing key", action).ShouldBeFalse();

            action.AssertWasNotCalled(x => x.Invoke(null), x => x.IgnoreArguments());
        }
예제 #30
0
        public ActionResult Put([FromBody] SettingsData settingsData)
        {
            using (ConnectionPool.ConnectionUsable usable = new ConnectionPool.ConnectionUsable())
            {
                using (NpgsqlCommand command = usable.Connection.CreateCommand())
                {
                    command.Transaction = usable.Connection.BeginTransaction();
                    command.CommandText = "select 1 from t_settings;";
                    NpgsqlDataReader reader = command.ExecuteReader();
                    if (reader.Read() == false)
                    {
                        reader.Dispose();
                        command.CommandText = $@"
INSERT INTO t_settings (id, enabled, location, location_friendly_name, override_value, weather_enabled)
VALUES (DEFAULT, false, '', '', 100, false);";
                        command.ExecuteNonQuery();
                    }
                    else
                    {
                        reader.Dispose();
                    }

                    // select where id == 1 if none, then insert

                    command.CommandText = $@"
UPDATE t_settings
SET enabled					= {settingsData.Enabled},
	location				= '{settingsData.Location}',
	location_friendly_name	= '{settingsData.LocationFriendlyName}',
	override_value			= {settingsData.OverrideValue},
	weather_enabled			= {settingsData.WeatherEnabled}
WHERE id = 1;";
                    command.ExecuteNonQuery();

                    command.CommandText = @"
TRUNCATE TABLE ONLY t_humidity_sensor;";
                    command.ExecuteNonQuery();

                    command.CommandText = "INSERT INTO t_humidity_sensor (settings_id, friendly_name, real_name) VALUES (1, @friendlyName, @realName);";
                    foreach ((string realSensorName, string friendlySensorName) in settingsData.HumiditySensors)
                    {
                        command.Parameters.AddWithValue("@friendlyName", NpgsqlDbType.Text, friendlySensorName);
                        command.Parameters.AddWithValue("@realName", NpgsqlDbType.Text, realSensorName);
                        command.ExecuteNonQuery();
                    }
                    command.Transaction.Commit();
                }
            }
            return(NoContent());
        }
예제 #31
0
        public void value_CPS_style_with_multiple_sources_with_a_match()
        {
            var core1 = new SettingsData().With("key1", "val1");
            var core2 = new SettingsData().With("key2", "val2");
            var core3 = new SettingsData().With("key3", "val3");

            var request = SettingsRequestData.For(core1, core2, core3);

            var action = MockRepository.GenerateMock <Action <object> >();

            request.Value("key2", action).ShouldBeTrue();

            action.AssertWasCalled(x => x.Invoke("val2"));
        }
예제 #32
0
        private static void SaveSettings()
        {
            SettingsData data = Settings.getSettings();
            string       json = JsonSerializer.Serialize(data,
                                                         new JsonSerializerOptions
            {
                WriteIndented    = true,
                IgnoreNullValues = false
            });
            StreamWriter sr = new StreamWriter(File.Create(@"Titles\system\settings.json"));

            sr.Write(json);
            sr.Close();
        }
예제 #33
0
 public void ResetSettings()
 {
     settingsData = new SettingsData();
     GC.Collect();
     if (File.Exists(Application.persistentDataPath + "/" + filenameSettings))
     {
         File.Delete(Application.persistentDataPath + "/" + filenameSettings);
         Debug.Log("Settings Data deleted");
     }
     else
     {
         Debug.Log("Settings file not found in " + Application.persistentDataPath + "/" + filenameSettings);
     }
 }
예제 #34
0
        public void Update(SettingsData newSettings)
        {
            SettingsData settingsData = DeSerialize();

            settingsData.NumberOfTeams       = newSettings.NumberOfTeams;
            settingsData.MaximumRating       = newSettings.MaximumRating;
            settingsData.BalanceTeams        = newSettings.BalanceTeams;
            settingsData.OrderBy             = newSettings.OrderBy;
            settingsData.TrafficLightRatings = newSettings.TrafficLightRatings;
            settingsData.HighAccuracy        = newSettings.HighAccuracy;
            settingsData.DisplayNotes        = newSettings.DisplayNotes;

            Serialize(settingsData);
        }
예제 #35
0
    void Start()
    {
        myAudioSource   = GetComponent <AudioSource>();
        myRigidbody2D   = GetComponent <Rigidbody2D>();
        myAnimator      = GetComponent <Animator>();
        myHealth        = GetComponent <PlayerHealth>();
        myAttackManager = GetComponent <PlayerAttackManager>();
        movementGamepad = joystick.GetComponent <MovementGamepad>();
        SettingsData settingsData = SaveSystem.LoadSettings();

        movementGamepad.SetNewAlphaChannel(settingsData.alphaChannelParam);
        movementGamepad.SetNewPos(settingsData.posXParam, settingsData.posYParam);
        movementGamepad.SetNewScale(settingsData.scaleParam);
    }
예제 #36
0
        private void SaveSettings()
        {
            SetStartup();
            var settings = new SettingsData
            {
                ApiUrl  = UrlRegex.IsMatch(tb_serverURL.Text) ? tb_serverURL.Text : $"http://{tb_serverURL.Text}",
                ApiKey  = tb_apikey.Text,
                WowPath = tb_wowpath.Text
            };

            _DataService.SaveSettings(settings);
            _DataService.UpdateSettings();
            LoadSettings();
        }
예제 #37
0
    public static void SaveSettingsData()
    {
        float musicVol  = 1;
        float effectVol = 1;

        musicMixer.GetFloat("musicVolume", out musicVol);
        effectMixer.GetFloat("fxVolume", out effectVol);


        SettingsData settingObject = new SettingsData(false, langManager.dialogSpeed, musicVol, effectVol, langManager.language, Screen.fullScreen, new Vector2(Screen.currentResolution.width, Screen.currentResolution.height), menuSettings.isBlackAndWhite);
        string       json          = JsonUtility.ToJson(settingObject);

        File.WriteAllText(SAVE_FOLDER + "/settingsSave.tgt", json);
    }
예제 #38
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ClipboardFIFO.MainForm"/> class.
        /// </summary>
        public MainForm()
        {
            // The InitializeComponent() call is required for Windows Forms designer support.
            this.InitializeComponent();

            // Set current process id
            this.currentProcessId = Process.GetCurrentProcess().Id;

            /* Set icons */

            // Set associated icon from exe file
            this.associatedIcon = Icon.ExtractAssociatedIcon(typeof(MainForm).GetTypeInfo().Assembly.Location);

            // Set daily releases icon
            this.dailyReleasesPublicDomainDailycomToolStripMenuItem.Image = this.associatedIcon.ToBitmap();

            /* Process settings */

            // Check for settings data file
            if (!File.Exists("SettingsData.txt"))
            {
                // Not present, assume first run and create it
                this.SaveSettingsData();
            }

            // Populate settings data
            this.settingsData = this.LoadSettingsData();

            /* Clipboard */

            // Add clipboard listener
            AddClipboardFormatListener(this.Handle);

            /* Initial option processing */

            // Always on top
            if (this.settingsData.AlwaysOnTop)
            {
                // Click it
                this.alwaysOnTopToolStripMenuItem.PerformClick();
            }

            /*// Hide close button
             * if (this.settingsData.HideCloseButton)
             * {
             *  // Click it
             *  this.hideCloseButtonToolStripMenuItem.PerformClick();
             * }*/
        }
예제 #39
0
    // Method called by the Apply button
    public void SetNewKeyBindings()
    {
        Dictionary <string, KeyCode> keyBindings = new Dictionary <string, KeyCode>();

        keyBindings.Add("ForwardKey", (KeyCode)System.Enum.Parse(typeof(KeyCode), forwardKey.text));
        keyBindings.Add("BackwardKey", (KeyCode)System.Enum.Parse(typeof(KeyCode), backwardKey.text));
        keyBindings.Add("AttackKey", (KeyCode)System.Enum.Parse(typeof(KeyCode), attackKey.text));
        keyBindings.Add("ChargedAttackKey", (KeyCode)System.Enum.Parse(typeof(KeyCode), chargedAttackKey.text));
        keyBindings.Add("PauseKey", (KeyCode)System.Enum.Parse(typeof(KeyCode), pauseKey.text));
        keyBindings.Add("ZoomInKey", (KeyCode)System.Enum.Parse(typeof(KeyCode), zoomInKey.text));
        keyBindings.Add("ZoomOutKey", (KeyCode)System.Enum.Parse(typeof(KeyCode), zoomOutKey.text));
        keyBindings.Add("ScoreboardKey", (KeyCode)System.Enum.Parse(typeof(KeyCode), showScoreboardKey.text));

        SettingsData.SaveKeyBindings(keyBindings);
    }
예제 #40
0
	public void Save()
	{
		BinaryFormatter bf = new BinaryFormatter();
		FileStream file = File.Create(Application.persistentDataPath + "/Settings.dat");

		SettingsData data = new SettingsData();

		data.language = language;
		data.SFX = SFX;
		data.Music = Music;

		bf.Serialize(file,data);
		file.Close();

	}
 //Obtains the name of the shot, containing bound variables, the name and the description of the sequence
 public static string get_fileStamp(SequenceData sequence, SettingsData settings, DateTime runTime)
 {
     string fileStamp;
     if (!settings.UseParisStyleFileTimestamps)
     {
         fileStamp = "RunLog-" + CiceroUtilityFunctions.getTimeStampString(runTime);
     }
     else
     {
         fileStamp = number_to_string(runTime.Hour, 2) + number_to_string(runTime.Minute, 2) + number_to_string(runTime.Second, 2);
         if (sequence.SequenceName != "")
             fileStamp = fileStamp + "_" + ProcessName(sequence.SequenceName,sequence);
         if (sequence.SequenceDescription != "")
             fileStamp = fileStamp + "_" + ProcessName(sequence.SequenceDescription,sequence);
         if (listBoundVariables(sequence) != "")
             fileStamp = fileStamp + "_" + listBoundVariables(sequence);
     }
     return fileStamp;
 }
예제 #42
0
        public void setData(SettingsData data)
        {
            Data = data;

            colorButtonGrid.DataBindings.Clear();
            colorButtonPoint.DataBindings.Clear();
            colorButtonCursor.DataBindings.Clear();
            textBoxDistance.DataBindings.Clear();
            textBoxStart.DataBindings.Clear();
            comboBoxDir.DataBindings.Clear();

            colorButtonGrid.DataBindings.Add("CurrentColor", Data, "GridColor", false, DataSourceUpdateMode.OnPropertyChanged);
            colorButtonPoint.DataBindings.Add("CurrentColor", Data, "PointColor", false, DataSourceUpdateMode.OnPropertyChanged);
            colorButtonCursor.DataBindings.Add("CurrentColor", Data, "CursorColor", false, DataSourceUpdateMode.OnPropertyChanged);
            textBoxDistance.DataBindings.Add("Text", Data, "DefaultDistance", false, DataSourceUpdateMode.OnPropertyChanged);
            textBoxStart.DataBindings.Add("Text", Data, "DefaultStart", false, DataSourceUpdateMode.OnPropertyChanged);
            comboBoxDir.DataSource = Enum.GetValues(typeof(GridOrientation));
            comboBoxDir.DataBindings.Add("SelectedItem", Data, "DefaultDir", false, DataSourceUpdateMode.OnPropertyChanged);
        }
예제 #43
0
파일: Settings.cs 프로젝트: jameshy/else
        /// <summary>
        /// Load the user json file, or use defaults
        /// </summary>
        public void Setup()
        {
            _path = _paths.GetUserPath("Settings.json");
            _logger.Debug($"Using settings file {_path}");

            // try and load the json file
            if (File.Exists(_path)) {
                User = JsonConvert.DeserializeObject<SettingsData>(File.ReadAllText(_path), new JsonSerializerSettings
                {
                    Error = HandleDeserializationError
                });
            }
            else {
                // no existing settings, use defaults.
                User = new SettingsData();
            }

            if (User.EnabledPlugins == null) {
                User.EnabledPlugins = new HashSet<Guid>();
            }
        }
예제 #44
0
 public void AddUserGroup()
 {
     TD_label.Visible = false;
     PageAction = "addusergroup";
     search = Request.QueryString["search"];
     setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
     if ((!(Page.IsPostBack)) || (Page.IsPostBack && ((search == "1") || (search == "2")) && setting_data.ADIntegration == true && Request.Form["domainname"] != null))
     {
         if ((!(LDAPMembers())) || (setting_data.ADIntegration == false))
         {
             TR_AddGroup.Visible = false;
             Display_AddUserGroup();
         }
         else
         {
             domain_list = m_refUserApi.GetDomains(0, 0);
             TR_AddGroupDetail.Visible = false;
             if ((search == "1") || (search == "2"))
             {
                 Display_AddUserGroup_Search();
             }
             else
             {
                 Display_AddUserGroup_None();
             }
         }
     }
     else
     {
         if ((setting_data.ADIntegration) && (search == "1" || search == "2"))
         {
             Process_AddADUserGroup();
         }
         else
         {
             Process_AddUserGroup();
         }
     }
 }
예제 #45
0
    void Start()
    {
        // Checking for any aditional GameData Classes and destroying as needed:
        if ( FindObjectsOfType( typeof( SettingsRoot )).Length > 1 )
        {
            Debug.Log( "Only one instance of GameData is allowed, Distroying thsi instance." );
            DestroyImmediate(gameObject);
        }
        else if( Instance == null )
        {
            Instance = this;
            DontDestroyOnLoad( transform.gameObject );
            DontDestroyOnLoad( Instance );

        }
        //else
        //{
            //Debug.Log( "Error only one instance of this script can exsist at any one time" );
            //throw new ArgumentNullException();
        //}

        settingsData = SettingsData.getInstance();
    }
예제 #46
0
    private void Populate_EditPermissionsAdvancedGrid(UserPermissionData[] userpermission_data)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
        string strMsg = "";

        if (_Base == "group")
        {
            strMsg = "<span class=\"cmsGroup\">" + _MessageHelper.GetMessage("generic User Group Name") + "</span>";
        }
        else
        {
            strMsg = "<span class=\"cmsUser\">" + _MessageHelper.GetMessage("generic cms user label") + "</span>";
        }

        colBound.DataField = "TITLE";
        colBound.HeaderText = strMsg;
        colBound.HeaderStyle.CssClass = "title-header left";
        colBound.ItemStyle.CssClass = "left";
        PermissionsAdvancedGrid.Columns.Add(colBound);

        if (!(_IsBoard))
        {
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "COLLECTIONS";
            colBound.HeaderText = _MessageHelper.GetMessage("generic collection title");
            colBound.HeaderStyle.CssClass = "title-header";
            colBound.ItemStyle.CssClass = "center";
            PermissionsAdvancedGrid.Columns.Add(colBound);
        }

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "ADDFLD";
        if (_IsBoard)
        {
            colBound.HeaderText = "Add Forum";
            colBound.ItemStyle.CssClass = "center";
        }
        else
        {
            colBound.HeaderText = _MessageHelper.GetMessage("generic add folders title");
            colBound.ItemStyle.CssClass = "center";
        }
        colBound.HeaderStyle.CssClass = "title-header";
        PermissionsAdvancedGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "EDITFLD";
        if (_IsBoard)
        {
            colBound.HeaderText = "Edit Forum";
            colBound.ItemStyle.CssClass = "center";
        }
        else
        {
            colBound.HeaderText = _MessageHelper.GetMessage("generic edit folders title");
            colBound.ItemStyle.CssClass = "center";
        }
        colBound.HeaderStyle.CssClass = "title-header";
        colBound.ItemStyle.CssClass = "center";
        PermissionsAdvancedGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "DELETEFLD";
        if (_IsBoard)
        {
            colBound.HeaderText = "Delete Forum";
            colBound.ItemStyle.CssClass = "center";
        }
        else
        {
            colBound.HeaderText = _MessageHelper.GetMessage("generic delete folders title");
            colBound.ItemStyle.CssClass = "center";
        }
        colBound.HeaderStyle.CssClass = "title-header";
        PermissionsAdvancedGrid.Columns.Add(colBound);

        if (!(_IsBoard))
        {
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TRAVERSE";
            colBound.HeaderText = _MessageHelper.GetMessage("generic traverse folder title");
            colBound.ItemStyle.CssClass = "center";
            colBound.HeaderStyle.CssClass = "title-header";
            PermissionsAdvancedGrid.Columns.Add(colBound);
        }

        SiteAPI m_refSiteApi = new SiteAPI();
        SettingsData setting_data = new SettingsData();
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
        if (setting_data.EnablePreApproval)
        {
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "ModifyPreapproval";
            colBound.HeaderText = "Modify Preapproval";
            colBound.ItemStyle.CssClass = "center";
            colBound.HeaderStyle.CssClass = "title-header";
            PermissionsAdvancedGrid.Columns.Add(colBound);
        }

        DataTable dt = new DataTable();
        DataRow dr;

        dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
        dt.Columns.Add(new DataColumn("COLLECTIONS", typeof(string)));
        dt.Columns.Add(new DataColumn("ADDFLD", typeof(string)));
        dt.Columns.Add(new DataColumn("EDITFLD", typeof(string)));
        dt.Columns.Add(new DataColumn("DELETEFLD", typeof(string)));
        dt.Columns.Add(new DataColumn("TRAVERSE", typeof(string)));
        if (setting_data.EnablePreApproval)
        {
            dt.Columns.Add(new DataColumn("ModifyPreapproval", typeof(string)));
        }

        bool bInherited = false;
        if (_ItemType == "folder")
        {
            bInherited = _FolderData.Inherited;
        }
        else
        {
            bInherited = _ContentData.IsInherited;
        }

        int i = 0;

        if (!(userpermission_data == null))
        {
            dr = dt.NewRow();

            if (Request.QueryString["base"] == "group")
            {
                dr[0] = userpermission_data[0].DisplayGroupName;
            }
            else
            {
                dr[0] = userpermission_data[0].DisplayUserName;
            }

            frm_navigation.Value = Convert.ToString(userpermission_data[0].IsCollections);
            dr[1] = "<input type=\"checkbox\" name=\"frm_navigation\" ";
            if (userpermission_data[0].IsCollections)
            {
                dr[1] += " checked=\"checked\" ";
            }
            if (_IsMembership)
            {
                dr[1] += " disabled=\"disabled\" ";
            }
            dr[1] += " onclick=\"return CheckPermissionSettings(\'frm_navigation\');\" />";

            frm_add_folders.Value = Convert.ToString(userpermission_data[i].CanAddFolders);
            dr[2] = "<input type=\"checkbox\" name=\"frm_add_folders\" ";
            if (userpermission_data[i].CanAddFolders)
            {
                dr[2] += " checked=\"checked\" ";
            }
            if (_IsMembership)
            {
                dr[2] += " disabled=\"disabled\" ";
            }
            dr[2] += "onclick=\"return CheckPermissionSettings(\'frm_add_folders\');\" />";

            frm_edit_folders.Value = Convert.ToString(userpermission_data[i].CanEditFolders);
            dr[3] = "<input type=\"checkbox\" name=\"frm_edit_folders\" ";
            if (userpermission_data[i].CanEditFolders)
            {
                dr[3] += " checked=\"checked\" ";
            }
            if (_IsMembership)
            {
                dr[3] += " disabled=\"disabled\" ";
            }
            dr[3] += "onclick=\"return CheckPermissionSettings(\'frm_edit_folders\');\" />";

            frm_delete_folders.Value = Convert.ToString(userpermission_data[i].CanDeleteFolders);
            dr[4] = "<input type=\"checkbox\" name=\"frm_delete_folders\" ";
            if (userpermission_data[i].CanDeleteFolders)
            {
                dr[4] += " checked=\"checked\" ";
            }
            if (_IsMembership)
            {
                dr[4] += " disabled=\"disabled\" ";
            }
            dr[4] += " onclick=\"return CheckPermissionSettings(\'frm_delete_folders\');\" />";

            frm_transverse_folder.Value = Convert.ToString(userpermission_data[i].CanTraverseFolders);
            dr[5] = "<input type=\"checkbox\" name=\"frm_transverse_folder\" ";
            if (userpermission_data[i].CanTraverseFolders)
            {
                dr[5] += " checked=\"checked\" ";
            }
            if (_IsMembership)
            {
                dr[5] += " disabled=\"disabled\" ";
            }
            dr[5] += "onclick=\"return CheckPermissionSettings(\'frm_transverse_folder\');\" />";

            if (setting_data.EnablePreApproval)
            {
                frm_edit_preapproval.Value = Convert.ToString(userpermission_data[i].CanEditApprovals);
                dr[6] = "<input type=\"checkbox\" name=\"frm_edit_preapproval\" ";
                if (userpermission_data[i].CanEditApprovals)
                {
                    dr[6] += " checked=\"checked\" ";
                }
                if (_IsMembership)
                {
                    dr[6] += " disabled=\"disabled\" ";
                }
                dr[6] += "onclick=\"return CheckPermissionSettings(\'frm_edit_preapproval\');\" />";
            }
            dt.Rows.Add(dr);
        }
        DataView dv = new DataView(dt);
        PermissionsAdvancedGrid.DataSource = dv;
        PermissionsAdvancedGrid.DataBind();
    }
예제 #47
0
    void OnGUI()
    {
        if (Settings == null)
        {
            Settings = new SettingsData();
            LoadSettings();
        }
        string tempPath;

        //Kinect Server Destination Section
        EditorGUILayout.BeginHorizontal();
        tempPath = EditorGUILayout.TextField("Kinect Server Path: ", Settings.KinectServerPath);
        if (GUILayout.Button("Browse", GUILayout.Width(buttonWidth)))
        {
            tempPath = EditorUtility.OpenFilePanel("Select Kinect Server", "", "exe");
        }
        if (File.Exists(tempPath))
        {
            Settings.KinectServerPath = tempPath;
        }
        EditorGUILayout.EndHorizontal();

        //Projector Server Destination Section
        EditorGUILayout.BeginHorizontal();
        tempPath = EditorGUILayout.TextField("Projector Server Path: ", Settings.ProjectorServerPath);
        if (GUILayout.Button("Browse", GUILayout.Width(buttonWidth)))
        {
            tempPath = EditorUtility.OpenFilePanel("Select Projector Server", "", "exe");
        }
        if (File.Exists(tempPath))
        {
            Settings.ProjectorServerPath = tempPath;
        }
        EditorGUILayout.EndHorizontal();

        //Projector Server Destination Section
        EditorGUILayout.BeginHorizontal();
        tempPath = EditorGUILayout.TextField("Console Application Path: ", Settings.ConsoleApplicationPath);
        if (GUILayout.Button("Browse", GUILayout.Width(buttonWidth)))
        {
            tempPath = EditorUtility.OpenFilePanel("Select Console Application", "", "exe");
        }
        if (File.Exists(tempPath))
        {
            Settings.ConsoleApplicationPath = tempPath;
        }
        EditorGUILayout.EndHorizontal();

        //Whether to use head tracking Section
        EditorGUILayout.BeginHorizontal();
        Settings.IsTrackingHead = EditorGUILayout.Toggle("Use head tracking:", Settings.IsTrackingHead);
        EditorGUILayout.EndHorizontal();

        //Show verbose messages?
        EditorGUILayout.BeginHorizontal();
        Settings.IsVerbose = EditorGUILayout.Toggle("Verbose console output:", Settings.IsVerbose);
        EditorGUILayout.EndHorizontal();

        //Show Debug messages?
        EditorGUILayout.BeginHorizontal();
        Settings.IsDebug = EditorGUILayout.Toggle("Enable debug messages:", Settings.IsDebug);
        EditorGUILayout.EndHorizontal();

        //Saving settings to XML Button
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Save Settings", GUILayout.Width(buttonWidth)))
        {
            SaveSettings();
        }

        //Loading settings from file
        if (GUILayout.Button("Load Settings", GUILayout.Width(buttonWidth)))
        {
            LoadSettings();
        }
        EditorGUILayout.EndHorizontal();
    }
예제 #48
0
    private void Display_MapCMSUserGroupToAD()
    {
        AppImgPath = m_refSiteApi.AppImgPath;
        rp = Request.QueryString["rp"];
        e1 = Request.QueryString["e1"];
        e2 = Request.QueryString["e2"];
        f = Request.QueryString["f"];
        if (rp == "")
        {
            rp = Request.Form["rp"];
        }

        if (e1 == "")
        {
            e1 = Request.Form["e1"];
        }

        if (e2 == "")
        {
            e2 = Request.Form["e2"];
        }

        if (f == "")
        {
            f = Request.Form["f"];
        }
        language_data = m_refSiteApi.GetAllActiveLanguages();
        user_data = m_refUserApi.GetUserGroupById(m_intGroupId);

        if ((m_intGroupId == 1) && (Convert.ToInt32(rp) == 3))
        {
            domain_data = m_refUserApi.GetDomains(1, 0);
        }
        else
        {
            domain_data = m_refUserApi.GetDomains(0, 0);
        }

        security_data = m_refContentApi.LoadPermissions(0, "content", 0);
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

        if ((search == "1") || (search == "2"))
        {

            if (search == "1")
            {
                strFilter = Request.Form["groupname"];
                Domain = Request.Form["domainname"];
            }
            else
            {
                strFilter = Request.QueryString["groupname"];
                Domain = Request.QueryString["domainname"];
            }
            if (Domain == "All Domains")
            {
                Domain = "";
            }
            GroupData[] adgroup_data;
            adgroup_data = m_refUserApi.GetAvailableADGroups(strFilter, Domain);
            //TOOLBAR
            System.Text.StringBuilder result = new System.Text.StringBuilder();
            txtTitleBar.InnerHtml = m_refStyle.GetTitleBar((string)(m_refMsg.GetMessage("search ad for cms group") + " \"" + user_data.GroupDisplayName + "\""));
            result.Append("<table><tr>");

            //if (Request.ServerVariables["HTTP_USER_AGENT"].ToString().IndexOf("MSIE") > -1) //defect 16045
            //{
            //    result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/back.png", "javascript:window.location.reload(false);", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
            //}
            //else
            //{
            //}
            result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/back.png", "javascript:history.back(1);", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));

            if (rp != "1")
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/cancel.png", "#", m_refMsg.GetMessage("generic Cancel"), m_refMsg.GetMessage("close title"), "onclick=\"top.close();\"", StyleHelper.SaveButtonCssClass, true));
            }

            if (!(adgroup_data == null))
            {
                if (rp == "1")
                {
                    result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/save.png", "#", m_refMsg.GetMessage("alt update button text (associate group)"), m_refMsg.GetMessage("btn update"), "onclick=\"return SubmitForm(\'aduserinfo\', \'CheckRadio(1);\');\"", StyleHelper.SaveButtonCssClass, true));
                }
                else
                {
                    result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/save.png", "#", m_refMsg.GetMessage("alt update button text (associate group)"), m_refMsg.GetMessage("btn update"), "onclick=\"return SubmitForm(\'aduserinfo\', \'CheckReturn(1);\');\"", StyleHelper.SaveButtonCssClass, true));
                }
            }
            result.Append(StyleHelper.ActionBarDivider);
            result.Append("<td>");
            result.Append(m_refStyle.GetHelpButton("Display_MapCMSUserGroupToAD", ""));
            result.Append("</td>");
            result.Append("</tr></table>");
            htmToolBar.InnerHtml = result.ToString();
            //Dim i As Integer = 0
            //If (Not (IsNothing(domain_data))) Then
            //    domainname.Items.Add(New ListItem(m_refMsg.GetMessage("all domain select caption"), ""))
            //    domainname.Items(0).Selected = True
            //    For i = 0 To domain_data.Length - 1
            //        domainname.Items.Add(New ListItem(domain_data(i).Name, domain_data(i).Name))
            //    Next
            //End If
            Populate_MapCMSGroupToADGrid(adgroup_data);
        }
        else
        {

            PostBackPage.Text = Utilities.SetPostBackPage((string)("users.aspx?Action=MapCMSUserGroupToAD&Search=1&LangType=" + ContentLanguage + "&rp=" + rp + "&e1=" + e1 + "&e2=" + e2 + "&f=" + f + "&grouptype=" + m_intGroupType + "&groupid=" + m_intGroupId));
            txtTitleBar.InnerHtml = m_refStyle.GetTitleBar((string)(m_refMsg.GetMessage("search ad for cms group") + " \"" + user_data.DisplayUserName + "\""));
            System.Text.StringBuilder result = new System.Text.StringBuilder();
            result.Append("<table><tr>");
            if (rp != "1")
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "../UI/Icons/cancel.png", "#", m_refMsg.GetMessage("generic Cancel"), m_refMsg.GetMessage("btn cancel"), "onclick=\"top.close();\""));
            }
            else
            {
                result.Append(m_refStyle.GetButtonEventsWCaption(AppImgPath + "images/UI/Icons/back.png", "javascript:history.back(1);", m_refMsg.GetMessage("alt back button text"), m_refMsg.GetMessage("btn back"), "", StyleHelper.BackButtonCssClass, true));
            }
            result.Append("<td>");
            result.Append(m_refStyle.GetHelpButton("Display_MapCMSUserGroupToAD", ""));
            result.Append("</td>");
            result.Append("</tr></table>");
            htmToolBar.InnerHtml = result.ToString();
            Populate_MapCMSUserGroupToADGrid_Search(domain_data);
        }
    }
예제 #49
0
    private string GetClientScript()
    {
        System.Text.StringBuilder result;
        string TreeRequested = "content";
        PermissionData security_data;
        Ektron.Cms.Common.EkMessageHelper objMessage;
        Ektron.Cms.Content.EkContent objContentRef;
        Ektron.Cms.UrlAliasing.UrlAliasSettingsApi m_urlAliasSettings = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();
        result = new System.Text.StringBuilder();

        try
        {
            objMessage = m_refAPI.EkMsgRef;
            security_data = m_refAPI.LoadPermissions(0, "folder", 0);
            if (!(security_data.IsLoggedIn))
            {
                ShowLoginError();
                //break;
                return string.Empty;
            }
            if (!(security_data == null))
            {
                IsAdmin = security_data.IsAdmin;
                PerReadOnly = security_data.IsReadOnly;
                PerReadOnlyLib = security_data.IsReadOnlyLib;
            }
            IsSystemAccount = System.Convert.ToBoolean(m_refAPI.UserId == Ektron.Cms.Common.EkConstants.BuiltIn);
            if (!(Request.QueryString["tree"] == null))
            {
                TreeRequested = Request.QueryString["tree"].ToLower().Trim();
            }
            TreeRequested = Strings.LCase(Request.QueryString["tree"]);
            objContentRef = m_refAPI.EkContentRef;
            result.AppendLine("<script type=\"text/javascript\">");
            result.AppendLine("<!--");

            if ((TreeRequested) == ("content"))
            {
                if (PerReadOnly)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"content.aspx?action=ViewContentByCategory&id=0\", \"ek_main\");" + "\r\n");
                    result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic content title") + "\", urlInfoArray);" + "\r\n");
                }
                else
                {
                    result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic content title") + "\", \"\");" + "\r\n");
                }
                m_hashAllFolders = objContentRef.GetFolderTreeForUserID(0);
                result.Append(OutputFolders(0, 0, Ektron.Cms.Common.EkEnumeration.FolderTreeType.Content) + "\r\n");
            }
            else if ((TreeRequested) == ("library"))
            {
                if (PerReadOnlyLib)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"library.aspx?action=ViewLibraryByCategory&id=0\", \"ek_main\");");
                    result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic Library title") + "\", urlInfoArray);");
                }
                else
                {
                    result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic Library title") + "\", \"\");");
                }

                m_hashAllFolders = objContentRef.GetFolderTreeForUserID(0);
                result.Append(OutputFolders(0, 0, Ektron.Cms.Common.EkEnumeration.FolderTreeType.Library) + "\r\n");

                // commerce
            }
            else if ((TreeRequested) == ("admin"))
            {
                //Merging Module and Settings under Settings tab for Version 8.0.
                result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("administrate button text") + "\", \"\");");
                if (!IsSystemAccount)
                {

                    //Commerce
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eCommerce) && (IsAdmin || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin)))
                    {

                        result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl commerce") + "\", \"\"));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl commerce catalog") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/producttypes.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl product types") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/Coupons/List/List.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl coupons") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl commerce config") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/locale/country.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa countries") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/currency.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa currency") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/creditcardtypes.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl cc wa") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionmessages.aspx?mode=commerce\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl messages") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/paymentgateway.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl payment options") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/locale/region.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa regions") + "\", urlInfoArray));");
                        //result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/pricebook.aspx\", \"ek_main\");");
                        //result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa pricebooks") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl fulfillment") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/fulfillment.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl orders") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/fulfillment/workflow.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl order workflow") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("generic reports title") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/CustomerReports.aspx?page=normal\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl customer reports") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/inventory.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl inventory reports") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/KeyPerformanceIndicators.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl key performance indicators") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/PaymentReports.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl payment reports") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/SalesTrend.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl sales trend") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/TopProducts.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl top products") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl wa shipping") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/shipping/shippingmethods.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa shipping methods") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/shipping/shippingsource.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa warehouses") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/shipping/packagesize.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa packagesize") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl wa tax") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/tax/taxclass.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa tax classes") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/tax/postaltaxtables.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa postal tax tables") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/tax/taxtables.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa tax tables") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/tax/countrytaxtables.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl wa country tax tables") + "\", urlInfoArray));");

                        // commerce folder links
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/audit/audit.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl audit") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/customers.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl customers") + "\", urlInfoArray));");
                    }
                    //Commerce Ends

                    //Community Management
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl community management") + "\", \"\"));");

                    // flagging
                    result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl flagging") + "\", \"\"));");
                    if (IsAdmin)
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"contentflagging/flagsets.aspx?communityonly=true\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("wa tree community flag def") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ContentFlags\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl flagged content") + "\", urlInfoArray));");
                    if (IsAdmin)
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"contentflagging/flagsets.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("wa tree flag def") + "\", urlInfoArray));");
                    }

                    // memberships
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.MembershipUsers))
                    {
                        if (IsAdmin || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminUsers) || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommunityAdmin))
                        {
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl memberships") + "\", \"\"));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?backaction=viewallusers&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&action=viewallusers&grouptype=1&groupid=888888\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Users") + "\", urlInfoArray));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=viewallgroups&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&grouptype=1\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic User Groups") + "\", urlInfoArray));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?backaction=viewallusers&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&action=viewallusers&grouptype=1&groupid=888888&ty=nonverify\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Users not verified") + "\", urlInfoArray));");
                        }
                    }
                }

                if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                {
                    if ((IsAdmin || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommunityAdmin)) && !IsSystemAccount)
                    {
                        //Notifications
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl notifications") + "\", \"\"));");
                        result.Append("level3 = InsertFolder(level2, CreateFolderInstance(\"" + objMessage.GetMessage("lbl default preferences") + "\", \"\"));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/DefaultNotificationPreferences.aspx?mode=colleagues\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl friends") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/DefaultNotificationPreferences.aspx?mode=groups\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl groups") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/DefaultNotificationPreferences.aspx?mode=privacy\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl privacy") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/ActivityTypes.aspx?mode=viewgrid\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl activity types") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/agents.aspx?mode=viewgrid\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl agent") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/notificationmessages.aspx?mode=viewnotificationmsggrid\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl messages") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"notifications/settings.aspx?mode=view\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("administrate button text") + "\", urlInfoArray));");
                    }
                }

                if (!IsSystemAccount)
                {

                    // tags
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Community/personaltags.aspx\", \"ek_main\");");
                    result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl tags") + "\", \"\"));");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("view all tags") + "\", urlInfoArray));");
                    if (IsAdmin)
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\",\"Community/personaltags.aspx?action=viewdefaulttags&objectType=" + System.Convert.ToInt32(EkEnumeration.CMSObjectTypes.Content) + "\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl default content tags") + "\", urlInfoArray));");
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"Community/personaltags.aspx?action=viewdefaulttags&objectType=" + System.Convert.ToInt32(EkEnumeration.CMSObjectTypes.CommunityGroup) + "\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl default group tags") + "\", urlInfoArray));");
                        }

                        result.Append("var urlInfoArray = new Array(\"frame\",\"Community/personaltags.aspx?action=viewdefaulttags&objectType=" + System.Convert.ToInt32(EkEnumeration.CMSObjectTypes.Library) + "\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl default library tags") + "\", urlInfoArray));");
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\",\"Community/personaltags.aspx?action=viewdefaulttags&objectType=" + System.Convert.ToInt32(EkEnumeration.CMSObjectTypes.User) + "\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl default user tags") + "\", urlInfoArray));");
                        }
                    }

                    // community groups
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Community/groups.aspx?action=viewallgroups\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl groups") + "\", urlInfoArray));");
                    }

                    if (IsAdmin)
                    {
                        // messages
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionmessages.aspx?mode=userprop\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl messages") + "\", urlInfoArray));");
                    }
                    if (IsAdmin || objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.MessageBoardAdmin), currentUserID, false))
                    {
                        // message board
                        result.Append("var urlInfoArray = new Array(\"frame\", \"Community/messageboard.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl msg board") + "\", urlInfoArray));");
                    }

                    // reviews
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ContentReviews\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl reviews") + "\", urlInfoArray));");

                    // templates
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                    {
                        if (IsAdmin)
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\",\"Community/communitytemplates.aspx?action=view\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl templates") + "\", urlInfoArray));");
                        }
                    }
                    //Community Management Ends
                }

                //Configuration
                if (IsAdmin)
                {
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("config page html title") + "\", \"\"));");
                    SiteAPI m_refSiteApi = new SiteAPI();
                    SettingsData settings_data;
                    settings_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
                    if (!(settings_data == null))
                    {
                        if (settings_data.IsAdInstalled)
                        {
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("generic Active Directory") + "\", \"\"));");
                            if (m_refSiteApi.RequestInformationRef.ADAdvancedConfig == true)
                            {
                                result.Append("var urlInfoArray = new Array(\"frame\", \"AD/ADDomains.aspx\", \"ek_main\");");
                                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic ad domains") + "\", urlInfoArray));");
                            }
                            result.Append("var urlInfoArray = new Array(\"frame\", \"adconfigure.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Setup") + "\", urlInfoArray));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"adreports.aspx?action=ViewAllReportTypes\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Status") + "\", urlInfoArray));");
                        }
                    }
                    if (!IsSystemAccount)
                    {
                        if (System.Configuration.ConfigurationSettings.AppSettings["ek_Dictionary"] != null && Convert.ToBoolean(System.Configuration.ConfigurationSettings.AppSettings["ek_Dictionary"]))
                        {
                            // Dictionary
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"Dictionary\", \"\"));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"dictionary/addnew.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"Add new dictionary\", urlInfoArray));");

                            ICmsDictionary dictionaryManager = ObjectFactory.GetCmsDictionary();
                            Criteria<CmsDictionaryProperty> dictionaryCriteria = new Criteria<CmsDictionaryProperty>();
                            dictionaryCriteria.OrderByDirection = EkEnumeration.OrderByDirection.Ascending;
                            dictionaryCriteria.OrderByField = CmsDictionaryProperty.Name;
                            List<CmsDictionaryData> dictionaryList = dictionaryManager.GetList(dictionaryCriteria);
                            for (int i = 0; i < dictionaryList.Count; i++)
                            {
                                result.Append("var urlInfoArray = new Array(\"frame\", \"dictionary/editvalues.aspx?id=" + dictionaryList[i].Id + "\", \"ek_main\");");
                                result.Append("InsertFile(level2, CreateLink(\"" + dictionaryList[i].Name + "\", urlInfoArray));");
                            }
                            // Dictionary
                        }

                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl web alert properties") + "\", \"\"));");
                        // email from list
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionemailfromlist.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl subscription emailfrom properties") + "\", urlInfoArray));");
                        // messages
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionmessages.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl subscription message properties") + "\", urlInfoArray));");
                        // subscriptions
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptions.aspx?action=ViewAllSubscriptions\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl subscription properties") + "\", urlInfoArray));");

                        //search properties
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("generic search") + "\", \"\"));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/suggestedresults.aspx?action=ViewSuggestedResults\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl suggested results") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/status.aspx?action=ViewSearchStatus\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl search status") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/synonyms.aspx?action=ViewSynonyms\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl synonyms") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/mappings.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl integrated search mappings") + "\", urlInfoArray));");

                        //forum properties
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl disc boards") + "\", \"\"));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"threadeddisc/replacewords.aspx?isemoticon=1\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl emoticons") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"subscriptionmessages.aspx?mode=forum\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl subscription message properties") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"threadeddisc/replacewords.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl replace words") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"threadeddisc/restrictIP.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl restricted ips") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"threadeddisc/userranks.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl user ranks") + "\", urlInfoArray));");

                        //Url Aliasing 7.6
                        //Licensing For 7.6
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
                        {

                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl navtree urlaliasing") + "\", \"\"));");
                            // automatic
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx?mode=auto\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url automatic aliasing") + "\", urlInfoArray));");
                            //community
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx?mode=community\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("community text") + "\", urlInfoArray));");
                            // manual
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url manual aliasing") + "\", urlInfoArray));");
                            // regex
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlRegExAliaslistMaint.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url regex aliasing") + "\", urlInfoArray));");
                            // settings
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlaliassettings.aspx?action=view\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("administrate button text") + "\", urlInfoArray));");
                            //End If
                        }

                            //personalization
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl personalizations") + "\", \"\"));");
                            if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.Personalization, false))
                            {
                                result.Append("var urlInfoArray = new Array(\"frame\", \"widgetsettings.aspx?action=widgetspace\", \"ek_main\");");
                                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl widgets space") + "\", urlInfoArray));");
                            }
                            result.Append("var urlInfoArray = new Array(\"frame\", \"widgetsettings.aspx?action=widgetsync\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl widgets") + "\", urlInfoArray));");

                            result.Append("var urlInfoArray = new Array(\"frame\", \"TargetedContent/targetcontentlist.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl targeted content") + "\", urlInfoArray));");

                        //replication
                        if (m_refAPI.EnableReplication)
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"DynReplication.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl navtree quickdeploy") + "\", urlInfoArray));");
                        }
                    }

                    // asset server setup
                    result.Append("var urlInfoArray = new Array(\"frame\", \"assetconfig.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl asset server type") + "\", urlInfoArray));");
                    // custom properties
                    result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=ViewCustomProp\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("custom properties") + "\", urlInfoArray));");
                    if (!IsSystemAccount)
                    {
                         // Devices
                        result.Append("var urlInfoArray = new Array(\"frame\", \"settings.aspx?action=viewalldeviceconfigurations\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("device configuration") + "\", urlInfoArray));");
                    }

                    if ((Convert.ToInt64(EkEnumeration.UserGroups.BuiltIn) != currentUserID) && (IsSystemAccount || IsAdmin))
                    {
                       if( System.IO.File.Exists(Server.MapPath(m_refAPI.AppPath + "sync/SyncDiag.aspx")))
                       {
                         result.Append("var urlInfoArray = new Array(\"frame\", \"sync/SyncDiag.aspx\", \"ek_main\");");
                         result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl Diagnostics") + "\", urlInfoArray));");
                       }
                    }

                    if(!IsSystemAccount)
                    {
                        // fonts
                        result.Append("var urlInfoArray = new Array(\"frame\", \"font.aspx?action=ViewFontsByGroup\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("generic Fonts") + "\", urlInfoArray));");

                        //integrated search folder (Hidden until this is supported in Search 4.0 - CB 1/4/11)
                        //result.Append("var urlInfoArray = new Array(\"frame\", \"IntegratedSearch.aspx?action=ViewAllIntegratedFolders\", \"ek_main\");");
                        //result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl Integrated Search Folder") + "\", urlInfoArray));");

                                        //load balancing
                        if (m_refContentApi.GetAssetMgtConfigInfo()[System.Convert.ToInt32(AsetConfigType.LoadBalanced)].Value == "1")
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"loadbalancing.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl load balancing") + "\", urlInfoArray));");
                        }

                        // metadata definition
                        result.Append("var urlInfoArray = new Array(\"frame\", \"meta_data50.aspx?action=ViewAllMetaDefinitions\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("meta_data page html title") + "\", urlInfoArray));");
                    }

                    // setup
                    result.Append("var urlInfoArray = new Array(\"frame\", \"configure.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("generic Setup") + "\", urlInfoArray));");
                    if (!IsSystemAccount)
                    {
                        //smart form configurations
                        result.Append("var urlInfoArray = new Array(\"frame\", \"xml_config.aspx?action=ViewAllXmlConfigurations\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("generic XML Configurations") + "\", urlInfoArray));");
                        // synchronization
                        if (LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eSync))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"sync/Sync.aspx?action=viewallsync\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl sync") + "\", urlInfoArray));");
                        }
                        // task types
                        result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTaskType\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl task types") + "\", urlInfoArray));");
                        // template configuration
                        result.Append("var urlInfoArray = new Array(\"frame\", \"template_config.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + "" + objMessage.GetMessage("lbl Template Configuration") + "" + "\", urlInfoArray));");
                        //user property

                    }
                }
                else
                {
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("config page html title") + "\", \"\"));");

                    // User is not part of administrator group, but has taxonomy administrator role, display Custom Property link with only Taxonomy Custom Property screen and hide the User option in the drop down list.

                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TaxonomyAdministrator), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"customproperties.aspx?action=viewall&type=1&objtype=0\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("custom properties") + "\", urlInfoArray));");
                    }

                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminPersonalize), currentUserID, false))
                    {
                         //personalization
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl personalizations") + "\", \"\"));");
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.Personalization, false))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"widgetsettings.aspx?action=widgetspace\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl widgets space") + "\", urlInfoArray));");
                        }
                        result.Append("var urlInfoArray = new Array(\"frame\", \"widgetsettings.aspx?action=widgetsync\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl widgets") + "\", urlInfoArray));");

                        result.Append("var urlInfoArray = new Array(\"frame\", \"TargetedContent/targetcontentlist.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl targeted content") + "\", urlInfoArray));");
                    }

                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.UrlAliasingAdmin), currentUserID, false))
                    {
                        if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.UrlAliasing, false))
                        {
                            result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl navtree urlaliasing") + "\", \"\"));");
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlaliassettings.aspx?action=view\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("administrate button text") + "\", urlInfoArray));");
                            //If (m_urlAliasSettings.IsManualAliasEnabled) Then
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url manual aliasing") + "\", urlInfoArray));");

                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx?mode=auto\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url automatic aliasing") + "\", urlInfoArray));");

                            //community
                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlmanualaliaslistmaint.aspx?mode=community\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("community text") + "\", urlInfoArray));");

                            result.Append("var urlInfoArray = new Array(\"frame\", \"urlRegExAliaslistMaint.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl tree url regex aliasing") + "\", urlInfoArray));");
                            //End If
                        }
                    }
                    //Search Admin to set Synonyms and Suggested Results
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SearchAdmin), currentUserID, false))
                    {
                        result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("generic search") + "\", \"\"));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/suggestedresults.aspx?action=ViewSuggestedResults\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl suggested results") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/status.aspx?action=ViewSearchStatus\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl search status") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/synonyms.aspx?action=ViewSynonyms\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl synonyms") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"search/mappings.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl integrated search mappings") + "\", urlInfoArray));");
                    }
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminMetadata), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"meta_data50.aspx?action=ViewAllMetaDefinitions\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("meta_data page html title") + "\", urlInfoArray));");
                    }
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncAdmin), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"loadbalancing.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl load balancing") + "\", urlInfoArray));");
                    }
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminXmlConfig), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"xml_config.aspx?action=ViewAllXmlConfigurations\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("generic XML Configurations") + "\", urlInfoArray));");
                    }

                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.TemplateConfigurations), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"template_config.aspx\", \"ek_main\");");
                        result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl Template Configuration") + "\", urlInfoArray));");
                    }
                    if (LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eSync))
                    {
                        if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncAdmin), currentUserID, false) || objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.SyncUser), currentUserID, false))
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"sync/Sync.aspx?action=viewallsync\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl sync") + "\", urlInfoArray));");
                        }
                    }
                }
                //Configuration Ends.

                //Localization
                if (!IsSystemAccount)
                {
                    bool xliffEnabled = System.Convert.ToBoolean(m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminXliff) && Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.Xliff));
                    if (xliffEnabled || IsAdmin)
                    {
                        result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl localization") + "\", \"\"));");
                        // Import XLIFF Files
                        if (xliffEnabled)
                        {
                            // dashboard
                            result.Append("var urlInfoArray = new Array(\"frame\", \"localization/Dashboard/CreateReport.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("sam dashboard") + "\", urlInfoArray));");
                            // export translation files
                            result.Append("var urlInfoArray = new Array(\"frame\", \"localization/exportjobs.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl export for translation") + "\", urlInfoArray));");
                            // import translation files
                            result.Append("var urlInfoArray = new Array(\"frame\", \"localization/localization.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl import translated files") + "\", urlInfoArray));");
                        }
                        // Languages and Regions
                        if (IsAdmin)
                        {
                            result.Append("var urlInfoArray = new Array(\"frame\", \"localization/languages.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl language settings") + "\", urlInfoArray));");
                        }
                        if (xliffEnabled)
                        {
                            // Locale Taxonomy
                            result.Append("var urlInfoArray = new Array(\"frame\", \"Localization/localeTaxonomy.aspx\", \"ek_main\");");
                            result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl translation packages") + "\", urlInfoArray));");}
                        }
                }
                //Roles
                if (IsAdmin && !IsSystemAccount)
                {
                    // Add roles:
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl Roles") + "\", \"\"));");
                    result.Append("level2 = InsertFolder(level1, CreateFolderInstance(\"" + objMessage.GetMessage("lbl Built-In") + "\", \"\"));");
                    result.Append("level3 = InsertFolder(level2, CreateFolderInstance(\"" + objMessage.GetMessage("lbl System-Wide") + "\", \"\"));");
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.UrlAliasing))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=aliasedit&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Alias-Edit") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=aliasadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Alias-Admin") + "\", urlInfoArray));");
                    }
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.WebSiteAnalytics))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=analyticsviewer&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role analytics-viewer") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=ruleedit&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Business Rule Editor") + "\", urlInfoArray));");
                    bool EnableClassicCalendar;
                    bool.TryParse(ConfigurationManager.AppSettings["ek_enableClassicCalendar"], out EnableClassicCalendar);
                    if (EnableClassicCalendar)
                    {
                        //Calendar
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=calendaradmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Calendar-Admin") + "\", urlInfoArray));");
                        //Calendar Ends
                    }

                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=collectionmenuadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Collection and Menu Admin") + "\", urlInfoArray));");

                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=collectionadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl collection admin") + "\", urlInfoArray));");

                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=collectionapprovers&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Collection Approver") + "\", urlInfoArray));");
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eCommerce))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=commerceadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role commerce-admin") + "\", urlInfoArray));");
                    }
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=communityadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role community-admin") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=communitygroupadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role communitygroup-admin") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=communitygroupcreate&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role communitygroup-create") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=masterlayoutcreate&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl masterlayout-create") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=menuadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl menu admin") + "\", urlInfoArray));");
                    if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.SocialNetworking))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=messageboardadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Messageboard-Admin") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=metadataadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Metadata-Admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=multivariatetester&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("alt multivariate tester") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=searchadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl role search-admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=xmlconfigadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Smart Forms Admin") + "\", urlInfoArray));");
                    if (LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eSync))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=syncadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl sync admin") + "\", urlInfoArray));");
                        result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=syncuser&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                        result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl sync user") + "\", urlInfoArray));");
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=taskcreate&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Task-Create") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=taskdelete&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Task-Delete") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=taskredirect&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Task-Redirect") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=taxonomyadministrator&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Taxonomy Administrator") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=templateconfig&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Template Configuration") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=useradmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl User Admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=translationstateadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl translation state admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=xliffadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl XLIFF admin") + "\", urlInfoArray));");
                    //Personalization
                    //result.Append("level4 = InsertFolder(level3, CreateFolderInstance(\"" + objMessage.GetMessage("lbl personalizations") + "\", \"\"));");
                    //result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=personalizationadmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    //result.Append("InsertFile(level4, CreateLink(\"" + objMessage.GetMessage("lbl Admins") + "\", urlInfoArray));");
                    //result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=personalizationaddonly&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    //result.Append("InsertFile(level4, CreateLink(\"" + objMessage.GetMessage("alt add web parts") + "\", urlInfoArray));");
                    //result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=personalizationeditonly&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    //result.Append("InsertFile(level4, CreateLink(\"" + objMessage.GetMessage("alt edit web parts properties") + "\", urlInfoArray));");
                    //result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=personalizationmoveonly&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    //result.Append("InsertFile(level4, CreateLink(\"" + objMessage.GetMessage("alt move web parts") + "\", urlInfoArray));");
                    result.Append("level3 = InsertFolder(level2, CreateFolderInstance(\"" + objMessage.GetMessage("lbl folder specific") + "\", \"\"));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=folderuseradmin&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl Folder User Admin") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=moveorcopy&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level3, CreateLink(\"" + objMessage.GetMessage("lbl move or copy") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"roles.aspx?action=managecustompermissions&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("lbl custom permissions") + "\", urlInfoArray));");

                }
                //Roles Ends
                if (!IsSystemAccount)
                {
                    //Business Rules
                    result.Append("var urlInfoArray = new Array(\"frame\", \"businessrules/ruleset.aspx\", \"ek_main\");");
                    result.Append("InsertFile(TopTreeLevel, CreateLink(\"" + objMessage.GetMessage("lbl Business Rules") + "\", urlInfoArray));");
                    //Business Rules Ends

                    bool EnableClassicCalendar = false;
                    bool.TryParse(ConfigurationManager.AppSettings["ek_enableClassicCalendar"], out EnableClassicCalendar);
                    if (EnableClassicCalendar)
                    {
                        //Calendar
                        result.Append("var urlInfoArray = new Array(\"frame\", \"cmscalendar.aspx?action=ViewAllCalendars\", \"ek_main\");");
                        result.Append("InsertFile(TopTreeLevel, CreateLink(\"" + objMessage.GetMessage("calendar lbl") + "\", urlInfoArray));");
                        //Calendar Ends
                    }

                }

                //User Groups
                if (IsAdmin)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=viewallgroups&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&grouptype=0\", \"ek_main\");");
                    result.Append("InsertFile(TopTreeLevel, CreateLink(\"" + objMessage.GetMessage("generic User Groups") + "\", urlInfoArray));");
                }
                else
                {
                    if (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminUsers), currentUserID, false))
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=viewallgroups&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&grouptype=0\", \"ek_main\");");
                        result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("generic User Groups") + "\", urlInfoArray));");
                    }
                }
                //User Groups Ends

                //Users
                if (IsAdmin || (objContentRef.IsARoleMember(Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.AdminUsers), currentUserID, false)))
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?backaction=viewallusers&action=viewallusers&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&grouptype=0&groupid=2&id=2&FromUsers=1\", \"ek_main\");");
                    result.Append("InsertFile(TopTreeLevel, CreateLink(\"" + objMessage.GetMessage("generic Users") + "\", urlInfoArray));");
                }
                else
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"users.aspx?action=View&grouptype=0&LangType=" + m_refAPI.RequestInformationRef.ContentLanguage + "&groupid=2&id=" + currentUserID + "\", \"ek_main\");");
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("generic User Profile") + "\", urlInfoArray));");
                }

            }
            else if ((TreeRequested) == ("report"))
            {
                result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                result.Append("TopTreeLevel = CreateFolderInstance(\"" + objMessage.GetMessage("generic reports title") + "\", urlInfoArray);");

                //Commerce
                if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.eCommerce) && (IsAdmin || m_refAPI.IsARoleMember(Ektron.Cms.Common.EkEnumeration.CmsRoleIds.CommerceAdmin)))
                {

                    result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                    result.Append("level2 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl commerce") + "\", \"\"));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/CustomerReports.aspx?page=normal\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl customer reports") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/inventory.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl inventory reports") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/KeyPerformanceIndicators.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl key performance indicators") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/PaymentReports.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl payment reports") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/SalesTrend.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl sales trend") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Commerce/reporting/TopProducts.aspx\", \"ek_main\");");
                    result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl top products") + "\", urlInfoArray));");

                }

                //Add a New folder for Content reports
                result.Append("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                result.Append("level2 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl web alert contents") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"approval.aspx?action=viewApprovalList&location=workarea\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("generic Approvals") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewCheckedIn\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports checked in title") + "\", urlInfoArray));");
                if (IsAdmin)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewCheckedOut\", \"ek_main\");");
                }
                else
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewCheckedOut&interval=&filtertype=USER&filterId=" + m_refContentApi.RequestInformationRef.UserId + "&orderby=\", \"ek_main\");");
                }
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports checked out title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewNewContent\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports new title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewSubmitted\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports submitted title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewPending\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports pending title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewRefreshReport\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports refresh title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewExpired\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("content reports expired title") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewToExpire&interval=10\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl expire all smrtdesk") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=SiteUpdateActivity\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Site Update Activity Content Report") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewAsynchLogFile\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Asynchronous Log File Report") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewSearchPhraseReport\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Search Phrase Report") + "\", urlInfoArray));");

                if (PerReadOnly)
                {
                    SiteAPI m_refSiteApi = new SiteAPI();
                    SettingsData setting_data = new SettingsData();
                    setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
                    if (setting_data.EnablePreApproval)
                    {
                        result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewPreapproval\", \"ek_main\");");
                        result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Preapproval Groups") + "\", urlInfoArray));");
                    }
                }

                result.Append("var urlInfoArray = new Array(\"frame\", \"BadLinkCheck.aspx\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Bad Link Report") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ContentFlags\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl flag report") + "\", urlInfoArray));");

                result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ContentReviews\", \"ek_main\");");
                result.Append("InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl review report") + "\", urlInfoArray));");

                //Site Analytics
                Ektron.Cms.Analytics.IAnalytics dataManager = ObjectFactory.GetAnalytics();
                if (Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refAPI.RequestInformationRef, Feature.WebSiteAnalytics) && dataManager.IsAnalyticsViewer())
                {
                    result.AppendLine("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                    result.AppendLine("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + m_refAPI.EkMsgRef.GetMessage("lbl site analytics") + "\", urlInfoArray));");
                    System.Collections.Generic.List<string> analyticsProviders = new System.Collections.Generic.List<string>();
                    analyticsProviders = dataManager.GetProviderList();
                    if (analyticsProviders.Count() > 0)
                    {
                        foreach (string providerName in analyticsProviders)
                        {
                            string folderName = providerName;
                            if (providerName == "Google")
                                folderName = objMessage.GetMessage("generic google");
                            else if (providerName == "WebTrends")
                                folderName = objMessage.GetMessage("Generic WebTrends");
                            else if(providerName =="SiteCatalyst" )
                                folderName = objMessage.GetMessage("Generic SiteCatalyst");
                            result.AppendLine("var urlInfoArray = new Array(\"frame\", \"\", \"ek_main\");");
                            result.AppendLine("level2 = InsertFolder(level1, CreateFolderInstance(\"" + folderName + "\", urlInfoArray));"); //
                            string providerType = dataManager.GetProviderType(providerName);
                            if ((string)(providerType) == "Ektron.Cms.Analytics.Providers.GoogleAnalyticsProvider")
                            {
                                AppendTreeItems(result, (System.Web.UI.HtmlControls.HtmlGenericControl)GoogleAnalyticsContainer.TreeContainer, 2, providerName, true);
                            }
                            else if ((string)(providerType) == "Ektron.Cms.Analytics.Providers.WebTrendsProvider")
                            {
                                AppendTreeItems(result, (System.Web.UI.HtmlControls.HtmlGenericControl)WebTrendsContainer.GetTreeContainer(providerName), 2, providerName, false);
                            }
                            else if ((string)(providerType) == "Ektron.Cms.Analytics.Providers.SiteCatalystProvider")
                            {
                                AppendTreeItems(result, (System.Web.UI.HtmlControls.HtmlGenericControl)SiteCatalystContainer.TreeContainer, 2, providerName, true);
                            }
                            else
                            {
                            }
                        }
                    }
                    result.Append("var urlInfoArray = new Array(\"frame\", \"Analytics/reporting/reports.aspx?report=CmsSearchTerms\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + objMessage.GetMessage("analytics searches") + "\", urlInfoArray));");
                }
                //Site Analytics Ends

                //Pre Version 8 Analytics
                bool EnableClassicAnalytics;
                bool.TryParse(ConfigurationManager.AppSettings["ek_enableClassicAnalytics"], out EnableClassicAnalytics);
                if (EnableClassicAnalytics)
                {
                    result.Append("var urlInfoArray = new Array(\"frame\", \"ContentAnalytics.aspx\", \"ek_main\");");
                    result.Append("level1 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + m_refAPI.EkMsgRef.GetMessage("lbl pre8 site analytics") + "\", urlInfoArray));");

                    result.Append("var urlInfoArray = new Array(\"frame\", \"ContentAnalytics.aspx?type=content\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + m_refAPI.EkMsgRef.GetMessage("top content") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"ContentAnalytics.aspx?type=page\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + m_refAPI.EkMsgRef.GetMessage("lbl top templates") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"ContentAnalytics.aspx?type=referring\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + m_refAPI.EkMsgRef.GetMessage("top referrers") + "\", urlInfoArray));");
                    result.Append("var urlInfoArray = new Array(\"frame\", \"reports.aspx?action=ViewSearchPhraseReport\", \"ek_main\");");
                    result.Append("InsertFile(level1, CreateLink(\"" + m_refAPI.EkMsgRef.GetMessage("lbl Search Phrase Report") + "\", urlInfoArray));");
                }
                //Pre Version 8 Analytics Ends

                //new tasks folder
                result.Append("level2 = InsertFolder(TopTreeLevel, CreateFolderInstance(\"" + objMessage.GetMessage("lbl Tasks") + "\", \"\"));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=all\", \"ek_main\");");
                if (IsAdmin)
                {
                    result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl All Open Tasks") + "\", urlInfoArray));");
                }
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=both\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("assigned by and to me") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=to\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Assigned to me") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=by\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Assigned by me") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=created\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Created by me") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=touser\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Assigned to User") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=notstarted\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Not Started") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=active\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("Active label") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=awaitingdata\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Awaiting Data") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=onhold\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl On hold") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=pending\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Pending") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=reopened\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Reopened") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=completed\", \"ek_main\");");
                result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Completed") + "\", urlInfoArray));");
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=archived\", \"ek_main\");");
                if (IsAdmin)
                {
                    result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Archived") + "\", urlInfoArray));");
                }
                result.Append("var urlInfoArray = new Array(\"frame\", \"tasks.aspx?action=ViewTasks&ty=deleted\", \"ek_main\");");
                if (IsAdmin)
                {
                    result.Append("level3 = InsertFile(level2, CreateLink(\"" + objMessage.GetMessage("lbl Deleted") + "\", urlInfoArray));");
                }

            }
            if (TreeRequested != "smartdesktop" && TreeRequested != "help")
            {
                result.Append("if (IsValid())" + "\r\n");
                result.Append("InitializeFolderControl();" + "\r\n");
            }
            //result.AppendLine("}); // Ektron.ready")
            result.AppendLine("//-->");
            result.AppendLine("</script>");
            result.Append("<script type=\"text/javascript\">" + "\r\n");
            result.Append("<!--" + "\r\n");
            result.Append("function OpenWorkareaFolder() {" + "\r\n");
            if (Request.QueryString["autonav"] != "")
            {
                result.Append("OpenFolder(\"" + Strings.Replace(EkFunctions.HtmlEncode(Request.QueryString["autonav"]), "\\", "\\\\", 1, -1, 0) + "\", false);" + "\r\n");
            }
            result.Append("}" + "\r\n");
            result.Append("OpenWorkareaFolder();" + "\r\n");
            result.Append("//--></script>" + "\r\n");
        }
        catch (Exception ex)
        {
            result.Length = 0;
            result.Append(ex.ToString());
        }
        finally
        {
        }
        return (result.ToString());
    }
예제 #50
0
    public void Display_Add()
    {
        m_cGroup = this.m_refCommunityGroupApi.GetCommunityGroupByID(this.m_iID);

        Packages.EktronCoreJS.Register(this);
        JavaScript.Create(this.m_refContentApi.ApplicationPath + "java/plugins/inputLabel/ektron.inputLabel.js").Register(this);

        ltr_search.Text = "<br/>&#160;" + GetMessage("lbl select users") + ":<br/>";
        ltr_search.Text += "&#160;" + "<input type=text size=25 id=\"txtSearch\" name=\"txtSearch\" value=\"" + m_strKeyWords + "\" onkeydown=\"CheckForReturn(event)\">";
        ltr_search.Text += "&#160;";
        ltr_search.Text += "<select id=\"searchlist\" name=\"searchlist\">";
        ltr_search.Text += "<option value=\"-1\" " + IsSelected("-1") + ">" + GetMessage("display name label") + "</option>";
        ltr_search.Text += "<option value=\"last_name\"" + IsSelected("last_name") + ">" + GetMessage("lbl last name") + "</option>";
        ltr_search.Text += "<option value=\"first_name\"" + IsSelected("first_name") + ">" + GetMessage("lbl first name") + "</option>";
        ltr_search.Text += "<option value=\"user_name\"" + IsSelected("user_name") + ">" + GetMessage("generic username") + "</option>";
        // ltr_search.Text &= "<option value=""all"" " & IsSelected("all") & ">" & GetMessage("generic all") & "</option>"
        ltr_search.Text += "</select>";
        ltr_search.Text += "&#160;";
        ltr_search.Text += "<input type=button value=\"Search\" id=\"btnSearch\" name=\"btnSearch\" onclick=\"searchuser();\" title=\"Search Users\">";

        if (Page.IsPostBack)
        {
            SiteAPI m_refSiteApi = new SiteAPI();
            setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

            CommunityGroupObjectRequest request = new CommunityGroupObjectRequest();
            request.CurrentPage = m_intCurrentPage;
            request.PageSize = System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0);
            request.GroupId = this.m_iID;
            request.SearchText = m_strKeyWords;
            switch (m_strSelectedItem)
            {
                case "last_name":
                    request.SearchField = "last_name";
                    break;
                case "first_name":
                    request.SearchField = "first_name";
                    break;
                case "user_name":
                    request.SearchField = "user_name";
                    break;
                default: // "-1"
                    request.SearchField = "display_name";
                    break;
            }
            request.ObjectId = this.m_refContentApi.UserId;
            request.ObjectType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.User;
            request.ObjectStatus = Ektron.Cms.Common.EkEnumeration.DirectoryItemStatus.All;
            m_aUsers = this.m_refCommunityGroupApi.GetAllUnassignedCommunityGroupUsers(ref request);
            if ((m_aUsers != null) && m_aUsers.Length > 0)
            {
                m_bAllowAdd = true;
            }
            m_intTotalPages = request.TotalPages;
            Populate_ViewCommunityMembersGrid(m_aUsers);
        }
        else
        {
            PageSettings(); // to suppress the paging stuff
        }
    }
예제 #51
0
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        base.Page_Load(sender, e);
        if (Request.Form["txtSearch"] != "")
        {
            m_strKeyWords = Request.Form["txtSearch"];
        }
        this.groupID.Value = m_iID.ToString();
        m_PageSize = this.m_refContentApi.RequestInformationRef.PagingSize;
        try
        {
            if (CheckAccess() == false)
            {
                throw (new Exception(this.GetMessage("err communitymembers no access")));
            }
            switch (this.m_sPageAction)
            {
                case "adduser":
                    if (Page.IsPostBack)
                    {
                        CollectSearchText();
                        if (Request.Form["isDeleted"] != "")
                        {
                            Process_Add();
                        }
                        else if (Request.Form["isSearchPostData"] != "")
                        {
                            this.isSearchPostData.Value = "";
                            Display_Add();
                        }
                    }
                    else
                    {
                        Display_Add();
                    }
                    break;
                case "pending":
                    if (Page.IsPostBack && Request.Form["isDeleted"] != "")
                    {
                        Process_Pending();
                        Display_PendingView();
                        this.isDeleted.Value = "";
                    }
                    else if (Page.IsPostBack && Request.Form["isSearchPostData"] != "")
                    {
                        CollectSearchText();
                        Display_PendingView();
                    }
                    else if (!Page.IsPostBack)
                    {
                        Display_PendingView();
                    }
                    break;
                default: // "viewall"
                    if (Page.IsPostBack && Request.Form["isDeleted"] != "")
                    {
                        Process_Remove();
                        Display_View();
                        this.isDeleted.Value = "";
                    }
                    else if (Page.IsPostBack && Request.Form["isSearchPostData"] != "")
                    {
                        CollectSearchText();
                        CurrentPage.Text = "1";
                        Display_View();
                        this.isSearchPostData.Value = "";
                    }
                    else if (!Page.IsPostBack)
                    {
                        Display_View();
                    }
                    break;
            }
            BuildJS();

            if (Page.IsPostBack)
            {
                SiteAPI m_refSiteApi = new SiteAPI();
                setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

                CommunityGroupObjectRequest request = new CommunityGroupObjectRequest();
                request.CurrentPage = m_intCurrentPage;
                request.PageSize = System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0);
                request.GroupId = this.m_iID;
                request.SearchText = m_strKeyWords == null ? "" : m_strKeyWords;
                switch (m_strSelectedItem)
                {
                    case "last_name":
                        request.SearchField = "last_name";
                        break;
                    case "first_name":
                        request.SearchField = "first_name";
                        break;
                    case "user_name":
                        request.SearchField = "user_name";
                        break;
                    default: // "-1"
                        request.SearchField = "display_name";
                        break;
                }
                request.ObjectId = this.m_refContentApi.UserId;
                request.ObjectType = Ektron.Cms.Common.EkEnumeration.TaxonomyItemType.User;
                request.ObjectStatus = Ektron.Cms.Common.EkEnumeration.DirectoryItemStatus.All;
                m_aUsers = this.m_refCommunityGroupApi.GetAllUnassignedCommunityGroupUsers(ref request);
                if ((m_aUsers != null) && m_aUsers.Length > 0)
                {
                    m_bAllowAdd = true;
                }
            }
            SetLabels();
            RegisterResources();
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message + ex.StackTrace);
        }
    }
예제 #52
0
    public void Display_View()
    {
        SiteAPI m_refSiteApi = new SiteAPI();
        int totalUsers = 0;
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

        m_cGroup = this.m_refCommunityGroupApi.GetCommunityGroupByID(this.m_iID);
        int totalPending = 0;
        if (Page.IsPostBack && Request.Form["isSearchPostData"] != "")
        {
            m_aUsers = this.m_refCommunityGroupApi.GetCommunityGroupUsers(this.m_iID, this.m_strKeyWords, "display_name", m_intCurrentPage, System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0), ref m_intTotalPages, ref totalUsers, ref totalPending);
        }
        else
        {
            m_aUsers = this.m_refCommunityGroupApi.GetCommunityGroupUsers(this.m_iID, m_intCurrentPage, System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0), ref m_intTotalPages, ref totalUsers, ref totalPending);
        }
        Populate_ViewCommunityMembersGrid(m_aUsers);
    }
예제 #53
0
    public void Display_PendingView()
    {
        SiteAPI m_refSiteApi = new SiteAPI();
        int totalUsers = 0;
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);

        m_cGroup = this.m_refCommunityGroupApi.GetCommunityGroupByID(this.m_iID);
        if (Page.IsPostBack)
        {
            m_aUsers = this.m_refCommunityGroupApi.GetPendingCommunityGroupUsers(this.m_iID, m_intCurrentPage, System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0), ref m_intTotalPages, ref totalUsers);
        }
        else
        {
            m_aUsers = this.m_refCommunityGroupApi.GetPendingCommunityGroupUsers(this.m_iID, m_intCurrentPage, System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0), ref m_intTotalPages, ref totalUsers);
        }
        Populate_ViewCommunityMembersGrid(m_aUsers);
    }
예제 #54
0
    protected override void Page_Load(object sender, System.EventArgs e)
    {
        base.Page_Load(sender, e);
        try
        {
            if (!(Request.QueryString["grouptype"] == null) && Request.QueryString["grouptype"] != "")
            {
                m_intGroupType = Convert.ToInt32(Request.QueryString["grouptype"]);
            }
            if (!(Request.QueryString["groupid"] == null) && Request.QueryString["groupid"] != "")
            {
                m_intGroupId = Convert.ToInt64(Request.QueryString["groupid"]);
            }

            RegisterResources();

            setting_data = m_refSiteApi.GetSiteVariables(-1);
            ldapSettings = setting_data.LDAPSettings;
            if ((!Page.IsPostBack) && paths.Items.Count == 0)
            {
                paths.Items.Add(new ListItem("All Paths", ""));
                foreach (string path in ldapSettings.Paths)
                    paths.Items.Add(new ListItem(path, path));
                paths.Items.Add(new ListItem(ldapSettings.Base + " (Root)", "/"));
            }
            else
            {
                if (Request.Form["rp"] != "")
                {
                    AddLDAPUsersToSystem();
                    Response.Redirect("../users.aspx?action=viewallusers&grouptype=" + m_intGroupType.ToString() + "&groupid=" + m_intGroupId.ToString() + "&id=" + m_intGroupId.ToString() + "&OrderBy=user_name", false);
                    return;
                }
                if (!(Page.Session["user_list"] == null))
                {
                    user_list = (UserData[])Page.Session["user_list"];
                }
            }
            if (user_list.Length > 0)
            {
                SetLabels("results");
            }
            else
            {
                SetLabels("");
            }
            if (LDAPMembers() && (setting_data.ADAuthentication == 1))
            {
                if (!(Page.IsPostBack))
                {
                    //Display_AddLDAPUserToSystem()
                }
                else
                {
                    //AddLDAPUsersToSystem()
                }
            }
        }
        catch (Exception ex)
        {
            string sErr = "";
            sErr = ex.Message;
            if (sErr.IndexOf("[") > -1)
            {
                sErr = sErr.Substring(0, sErr.IndexOf("["));
            }
            Utilities.ShowError(sErr);
        }
    }
예제 #55
0
 private void Page_Load(System.Object sender, System.EventArgs e)
 {
     _MessageHelper = _ContentApi.EkMsgRef;
     _SettingsData = _SiteApi.GetSiteVariables(_SiteApi.UserId);
     ltrAliases.Text = _MessageHelper.GetMessage("lbl forcemanualaliasing");
 }
예제 #56
0
파일: users.aspx.cs 프로젝트: jaytem/minGit
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        jsStyleSheet.Text = (new StyleHelper()).GetClientScript();
        m_refMsg = (new CommonApi()).EkMsgRef;
        if ((m_refContentApi.EkContentRef).IsAllowed(0, 0, "users", "IsLoggedIn", m_refContentApi.UserId) == false)
        {
            Response.Redirect("login.aspx?fromLnkPg=1", false);
            return;
        }
        if (m_refContentApi.RequestInformationRef.IsMembershipUser > 0 || m_refContentApi.RequestInformationRef.UserId == 0)
        {
            Response.Redirect("reterror.aspx?info=Please login as cms user", false);
            return;
        }
        if (!(Request.QueryString["LangType"] == null))
        {
            if (Request.QueryString["LangType"] != "")
            {
                ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                m_refApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            }
            else
            {
                if (m_refApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = Convert.ToInt32(m_refApi.GetCookieValue("LastValidLanguageID"));
                }
            }
        }
        else
        {
            if (m_refApi.GetCookieValue("LastValidLanguageID") != "")
            {
                ContentLanguage = Convert.ToInt32(m_refApi.GetCookieValue("LastValidLanguageID"));
            }
        }

        lib_setting_data = m_refContentApi.GetLibrarySettings(0); //Used in the scripting layer

        SetServerJSVariables();
        RegisterResources();

        Ektron.Cms.Commerce.IPasswordValidation pv = ObjectFactory.GetPasswordValidation();
        string validationString = (string)(pv.GetRegexForMember().Replace("\"", "\\\"").Replace("\\t", "\\\\t"));

        passwordValidationString.Text = validationString;

        MakeEmailArea.Text = (new EmailHelper()).MakeEmailArea();
        if (!String.IsNullOrEmpty(Request.QueryString["reloadtrees"]))
        {
            CloseScriptJS.Text = ClientCloseScriptJS();
        }
        jsADIntegration.Text = "false";
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
        if (setting_data.ADIntegration)
        {
            jsADIntegration.Text = "true";
        }
        SitePath = m_refSiteApi.SitePath;
        jsSitePath.Text = SitePath;
        if (m_strPageAction == "viewallusers")
        {
            m_viewusers = (viewusers)(LoadControl("controls/user/viewusers.ascx"));
            m_viewusers.ID = "user";
            jsUniqueId.Text = "user_";
            DataHolder.Controls.Add(m_viewusers);
        }
        else if (m_strPageAction == "addusertogroup")
        {
            m_editgroups = (editgroups)(LoadControl("controls/user/editgroups.ascx"));
            m_editgroups.ID = "user";
            jsUniqueId.Text = "user_";
            DataHolder.Controls.Add(m_editgroups);
        }
        else if (m_strPageAction == "viewallgroups")
        {
            m_viewgroups = (viewgroups)(LoadControl("controls/user/viewgroups.ascx"));
            m_viewgroups.ID = "user";
            jsUniqueId.Text = "user_";
            DataHolder.Controls.Add(m_viewgroups);
        }
    }
예제 #57
0
    public bool Display_ViewConfiguration()
    {
        m_refUserApi = new UserAPI();
            m_refSiteApi = new SiteAPI();
            AppImgPath = m_refUserApi.AppImgPath;
            AppName = m_refUserApi.AppName;
            RegisterResources();
            setting_data = m_refSiteApi.GetSiteVariables(m_refUserApi.UserId);
            mapping_data = m_refUserApi.GetADMapping(m_refUserApi.UserId, "userprop", 1, 0, 1);
            group_data = m_refUserApi.GetUserGroupById(1);
            sync_data = m_refUserApi.GetADStatus();
            //domain_data = m_refUserApi.GetDomains(1, 0)
            AdValid = setting_data.AdValid; //CBool(siteVars("AdValid"))
            ViewToolBar();
            //VERSION
            versionNumber.InnerHtml = m_refMsg.GetMessage("version") + "&nbsp;" + m_refSiteApi.Version + "&nbsp;" + m_refSiteApi.ServicePack;
            //BUILD NUMBER
            buildNumber.InnerHtml = "<i>(" + m_refMsg.GetMessage("build") + m_refSiteApi.BuildNumber + ")</i>";

            licenseMessageContainer.Visible = false;
            if (!(AdValid))
            {
                TR_domaindetail.Visible = false;
                licenseMessageContainer.Visible = true;
                licenseMessage.InnerHtml = m_refMsg.GetMessage("entrprise license with AD required msg");
            }
            else
            {
                if ((sync_data.SyncUsers) || (sync_data.SyncGroups) || (sync_data.SyncRelationships) || (sync_data.DeSyncUsers) || (sync_data.DeSyncGroups))
                {
                    if (setting_data.ADAuthentication == 1)
                    {
                        ltr_status.Text = "<a href=\"adreports.aspx?action=ViewAllReportTypes\">" + m_refMsg.GetMessage("ad enabled not configured") + "</a>";
                    }
                    else
                    {
                        ltr_status.Text = "<a href=\"adreports.aspx?action=ViewAllReportTypes\">" + m_refMsg.GetMessage("ad disabled not configured") + "</a>";
                    }
                }
                else
                {sync.Visible  =false;

                }
                if (setting_data.IsAdInstalled)
                {
                    installed.InnerHtml = m_refMsg.GetMessage("active directory installed") + "&nbsp;";
                }
                else
                {
                    installed.InnerHtml = m_refMsg.GetMessage("active directory not installed") + "&nbsp;";
                }
                TD_flag.InnerHtml = m_refMsg.GetMessage("active directory authentication flag");
                if (setting_data.ADAuthentication == 1)
                {
                    TD_flagenabled.InnerHtml = m_refMsg.GetMessage("AD enabled");
                }
                else if (setting_data.ADAuthentication == 2)
                {
                    TD_flagenabled.InnerHtml = m_refMsg.GetMessage("LDAP enabled");
                }
                else
                {
                    TD_flagenabled.InnerHtml = m_refMsg.GetMessage("disabled");
                }
                TD_dirflag.InnerHtml = m_refMsg.GetMessage("active directory flag");
                if (setting_data.ADIntegration)
                {
                    TD_intflag.InnerHtml = m_refMsg.GetMessage("enabled");
                }
                else
                {
                    TD_intflag.InnerHtml = m_refMsg.GetMessage("disabled");
                }
                TD_autouser.InnerHtml = m_refMsg.GetMessage("auto add user flag");
                if (setting_data.ADAutoUserAdd)
                {
                    TD_autouserflag.InnerHtml = m_refMsg.GetMessage("enabled");
                }
                else
                {
                    TD_autouserflag.InnerHtml = m_refMsg.GetMessage("disabled");
                }

                lgd_autoAddType.InnerHtml = m_refMsg.GetMessage("lbl auto add header");
                autoAddTypeProperty.InnerHtml = m_refMsg.GetMessage("lbl auto add user type");
                if (setting_data.ADAutoUserAddType == Ektron.Cms.Common.EkEnumeration.AutoAddUserTypes.Member)
                {
                    autoAddTypeValue.InnerHtml = m_refMsg.GetMessage("lbl member");
                }
                else
                {
                    autoAddTypeValue.InnerHtml = m_refMsg.GetMessage("lbl author");
                }

                TD_autogroup.InnerHtml = m_refMsg.GetMessage("auto add user to group flag");

                if (setting_data.ADAutoUserToGroup)
                {
                    TD_autogroupflag.InnerHtml = m_refMsg.GetMessage("enabled");
                }
                else
                {
                    TD_autogroupflag.InnerHtml = m_refMsg.GetMessage("disabled");
                }
                userProperty.InnerHtml = m_refMsg.GetMessage("user property mapping title");
                TD_cmstitle.InnerHtml = m_refMsg.GetMessage("cms property title");
                TD_dirproptitle.InnerHtml = m_refMsg.GetMessage("active directory property title");
                int i = 0;
                if (!(mapping_data == null))
                {
                    System.Text.StringBuilder result = new System.Text.StringBuilder();
                    for (i = 0; i <= mapping_data.Length - 1; i++)
                    {
                        result.Append("<tr>");
                        result.Append("<td class=\"label\">" + GetResourseText(mapping_data[i].CmsName) + ":</td>");
                        result.Append("<td class=\"readOnlyValue\">" + mapping_data[i].AdName + "</td>");
                        result.Append("<tr>");
                    }
                    mapping_list.Text = result.ToString();
                }
                adminGroupMap.InnerHtml = m_refMsg.GetMessage("cms admin group map");
                TD_grpnameval.InnerHtml = group_data.GroupName;
                TD_grpDomainVal.InnerHtml = group_data.GroupDomain;
                domain.InnerHtml = m_refMsg.GetMessage("domain title") + ":";
                //If (domain_data.Length = 0) Then
                //domainValue.InnerHtml += "<font color=""red""><strong>" & m_refMsg.GetMessage("generic no domains found") & " " & m_refMsg.GetMessage("generic check ad config msg") & "</strong></font>"
                //Else
                if (setting_data.ADDomainName == "")
                {
                    domainValue.InnerHtml += m_refMsg.GetMessage("all domain select caption");
                }
                else if (setting_data.ADAuthentication == 2)
                {
                    domainValue.InnerHtml += m_refMsg.GetMessage("all domain select caption");
                }
                else
                {
                    domainValue.InnerHtml += setting_data.ADDomainName;
                }
                //End If
            }
            return false;
    }
예제 #58
0
    private void Populate_AddPermissionsAdvancedGridForUsersAndGroup(System.Collections.Generic.List<UserGroupData> groupData, System.Collections.Generic.List<UserData> userData)
    {
        System.Web.UI.WebControls.BoundColumn colBound = new System.Web.UI.WebControls.BoundColumn();
        string strMsg = "";

        colBound.DataField = "TITLE";
        colBound.HeaderText = strMsg;
        colBound.HeaderStyle.CssClass = "title-header left";
        colBound.ItemStyle.CssClass = "left";
        PermissionsAdvancedGrid.Columns.Add(colBound);

        if (!(_IsBoard))
        {
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "COLLECTIONS";
            colBound.HeaderText = _MessageHelper.GetMessage("generic collection title");
            colBound.HeaderStyle.CssClass = "title-header center";
            colBound.ItemStyle.CssClass = "center";
            PermissionsAdvancedGrid.Columns.Add(colBound);
        }
        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "ADDFLD";
        if (_IsBoard)
        {
            colBound.HeaderText = "Add Forum";
        }
        else
        {
            colBound.HeaderText = _MessageHelper.GetMessage("generic add folders title");
        }
        colBound.HeaderStyle.CssClass = "title-header center";
        colBound.ItemStyle.CssClass = "center";
        PermissionsAdvancedGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "EDITFLD";
        if (_IsBoard)
        {
            colBound.HeaderText = "Edit Forum";
        }
        else
        {
            colBound.HeaderText = _MessageHelper.GetMessage("generic edit folders title");
        }
        colBound.HeaderStyle.CssClass = "title-header center";
        colBound.ItemStyle.CssClass = "center";
        PermissionsAdvancedGrid.Columns.Add(colBound);

        colBound = new System.Web.UI.WebControls.BoundColumn();
        colBound.DataField = "DELETEFLD";
        if (_IsBoard)
        {
            colBound.HeaderText = "Delete Forum";
        }
        else
        {
            colBound.HeaderText = _MessageHelper.GetMessage("generic delete folders title");
        }
        colBound.HeaderStyle.CssClass = "title-header center";
        colBound.ItemStyle.CssClass = "center";
        PermissionsAdvancedGrid.Columns.Add(colBound);

        if (!(_IsBoard))
        {
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "TRAVERSE";
            colBound.HeaderText = _MessageHelper.GetMessage("generic traverse folder title");
            colBound.HeaderStyle.CssClass = "title-header center";
            colBound.ItemStyle.CssClass = "center";
            PermissionsAdvancedGrid.Columns.Add(colBound);
        }

        SiteAPI m_refSiteApi = new SiteAPI();
        SettingsData setting_data = new SettingsData();
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
        if (setting_data.EnablePreApproval)
        {
            colBound = new System.Web.UI.WebControls.BoundColumn();
            colBound.DataField = "ModifyPreapproval";
            colBound.HeaderText = "Modify Preapproval";
            colBound.HeaderStyle.CssClass = "title-header center";
            colBound.ItemStyle.CssClass = "center";
            PermissionsAdvancedGrid.Columns.Add(colBound);
        }

        DataTable dt = new DataTable();
        DataRow dr;

        dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
        dt.Columns.Add(new DataColumn("COLLECTIONS", typeof(string)));
        dt.Columns.Add(new DataColumn("ADDFLD", typeof(string)));
        dt.Columns.Add(new DataColumn("EDITFLD", typeof(string)));
        dt.Columns.Add(new DataColumn("DELETEFLD", typeof(string)));
        dt.Columns.Add(new DataColumn("TRAVERSE", typeof(string)));
        if (setting_data.EnablePreApproval)
        {
            dt.Columns.Add(new DataColumn("ModifyPreapproval", typeof(string)));
        }
        bool bInherited = false;
        if (_ItemType == "folder")
        {
            bInherited = _FolderData.Inherited;
        }
        else
        {
            bInherited = _ContentData.IsInherited;
        }

        int i = 0;
        int j = 0;

        if (groupData.Count > 0)
        {
            for (i = 0; i <= groupData.Count - 1; i++)
            {

                dr = dt.NewRow();
                if (groupData[i].IsMemberShipGroup)
                {
                    dr[0] = "<span class=\"membershipGroup\">" + groupData[i].GroupDisplayName + "</span>";
                }
                else
                {
                    dr[0] = "<span class=\"cmsGroup\">" + groupData[i].GroupDisplayName + "</span>";
                }

                dr[1] = "<input type=\"checkbox\"  id=\"frm_navigation\" name=\"frm_navigation\" ";
                dr[1] += "onclick=\"return CheckPermissionSettings(\'frm_navigation\');\" />";

                dr[2] = "<input type=\"checkbox\" id=\"frm_add_folders\"  name=\"frm_add_folders\" ";
                dr[2] += "onclick=\"return CheckPermissionSettings(\'frm_add_folders\');\" />";

                dr[3] = "<input type=\"checkbox\" id=\"frm_edit_folders\" name=\"frm_edit_folders\" ";
                dr[3] += "onclick=\"return CheckPermissionSettings(\'frm_edit_folders\');\" />";

                dr[4] = "<input type=\"checkbox\" id=\"frm_delete_folders\" name=\"frm_delete_folders\" ";
                dr[4] += "onclick=\"return CheckPermissionSettings(\'frm_delete_folders\');\" />";

                dr[5] = "<input type=\"checkbox\" id=\"frm_transverse_folder\" name=\"frm_transverse_folder\" checked=\"" + traverseFolder + "\"  ";
                dr[5] += "onclick=\"return CheckPermissionSettings(\'frm_transverse_folder\');\" />";

                if (setting_data.EnablePreApproval)
                {
                    dr[6] = "<input type=\"checkbox\" id=\"frm_edit_preapproval\" name=\"frm_edit_preapproval\" ";
                    dr[6] += "onclick=\"return CheckPermissionSettings(\'frm_edit_preapproval\');\" />";
                }
                dt.Rows.Add(dr);
            }
        }
        if (userData.Count > 0)
        {
            for (j = 0; j <= userData.Count - 1; j++)
            {
                dr = dt.NewRow();
                if (userData[j].IsMemberShip)
                {
                    dr[0] = "<span class=\"membershipUser\">" + userData[j].Username + "</span>";
                }
                else
                {
                    dr[0] = "<span class=\"cmsUser\">" + userData[j].Username + "</span>";
                }

                dr[1] = "<input type=\"checkbox\"  id=\"frm_navigation\" name=\"frm_navigation\" ";
                dr[1] += "onclick=\"return CheckPermissionSettings(\'frm_navigation\');\">";

                dr[2] = "<input type=\"checkbox\" id=\"frm_add_folders\"  name=\"frm_add_folders\" ";
                dr[2] += "onclick=\"return CheckPermissionSettings(\'frm_add_folders\');\" />";

                dr[3] = "<input type=\"checkbox\" id=\"frm_edit_folders\" name=\"frm_edit_folders\" ";
                dr[3] += "onclick=\"return CheckPermissionSettings(\'frm_edit_folders\');\" />";

                dr[4] = "<input type=\"checkbox\" id=\"frm_delete_folders\" name=\"frm_delete_folders\" ";
                dr[4] += "onclick=\"return CheckPermissionSettings(\'frm_delete_folders\');\" />";

                dr[5] = "<input type=\"checkbox\" id=\"frm_transverse_folder\" name=\"frm_transverse_folder\" checked=\"" + traverseFolder + "\"  ";
                dr[5] += "onclick=\"return CheckPermissionSettings(\'frm_transverse_folder\');\" />";

                if (setting_data.EnablePreApproval)
                {
                    dr[6] = "<input type=\"checkbox\" id=\"frm_edit_preapproval\" name=\"frm_edit_preapproval\" ";
                    dr[6] += "onclick=\"return CheckPermissionSettings(\'frm_edit_preapproval\');\" />";
                }
                dt.Rows.Add(dr);
            }
        }
        DataView dv = new DataView(dt);
        PermissionsAdvancedGrid.DataSource = dv;
        PermissionsAdvancedGrid.DataBind();
    }
예제 #59
0
    private bool Display_EditConfiguration()
    {
        string[] arrOrg;
            string[] arrItem;
            long arrCount;
            string[] arrDomain;
            long arrCount2;
            string[] arrOrg2;
            bool isUnit = false;
            string[] arrServer;
            string[] arrLDAPDomain;
            string strLDAPDomain = "";
            string[] arrLDAPDomainElement;
            bool first = true;
            string adselectedstate = "";

            m_refUserApi = new UserAPI();
            m_refSiteApi = new SiteAPI();
            AppImgPath = m_refUserApi.AppImgPath;
            AppName = m_refUserApi.AppName;
            setting_data = m_refSiteApi.GetSiteVariables(-1);
            mapping_data = m_refUserApi.GetADMapping(m_refUserApi.UserId, "userprop", 1, 0, 1);
            cGroup = m_refUserApi.GetUserGroupById(1);
            sync_data = m_refUserApi.GetADStatus();

            try
            {
                domain_data = m_refUserApi.GetDomains(1, 0);
            }
            catch
            {
                domain_data = null;
            }

            EditToolBar(); //POPULATE TOOL BAR
            //VERSION
            versionNumber.InnerHtml = m_refMsg.GetMessage("version") + "&nbsp;" + m_refSiteApi.Version + "&nbsp;" + m_refSiteApi.ServicePack;
            //BUILD NUMBER
            buildNumber.InnerHtml = "<i>(" + m_refMsg.GetMessage("build") + m_refSiteApi.BuildNumber + ")</i>";

            if ((sync_data.SyncUsers) || (sync_data.SyncGroups) || (sync_data.SyncRelationships) || (sync_data.DeSyncUsers) || (sync_data.DeSyncGroups))
            {
                if (setting_data.ADAuthentication == 1)
                {
                    ltr_status.Text = "<a href=\"adreports.aspx?action=ViewAllReportTypes\">" + m_refMsg.GetMessage("ad enabled not configured") + "</a>";
                }
                else
                {
                    ltr_status.Text = "<a href=\"adreports.aspx?action=ViewAllReportTypes\">" + m_refMsg.GetMessage("ad disabled not configured") + "</a>";
                }
            }
            //Ektron.Cms.Sync doesn't have "visible"
            //else
            //{
            //    Ektron.Cms.Sync.visible = false;
            //}

            if (setting_data.IsAdInstalled)
            {
                installed.InnerHtml = m_refMsg.GetMessage("active directory installed");
            }
            else
            {
                installed.InnerHtml = m_refMsg.GetMessage("active directory not installed");
            }

            if (setting_data.ADAuthentication == 1)
            {
                EnableADAuth.Checked = true;
                adselectedstate = "";
                //OrgUnitText.Disabled = True
                OrgText.Disabled = true;
                ServerText.Disabled = true;
                drp_LDAPtype.Enabled = false;
                PortText.Disabled = true;
                LDAPDomainText.Disabled = true;
                txtLDAPAttribute.Enabled = false;
                LDAP_SSL.Disabled = true;
                admingroupdomain.Disabled = false;
                admingroupname.Disabled = false;
                drpAutoAddType.Enabled = true;
            }
            else if (setting_data.ADAuthentication == 0)
            {
                DisableAD.Checked = true;
                adselectedstate = "disabled";
                //OrgUnitText.Disabled = True
                OrgText.Disabled = true;
                ServerText.Disabled = true;
                drp_LDAPtype.Enabled = false;
                PortText.Disabled = true;
                LDAPDomainText.Disabled = true;
                txtLDAPAttribute.Enabled = false;
                LDAP_SSL.Disabled = true;
                admingroupdomain.Disabled = true;
                admingroupname.Disabled = true;
            }
            else
            {
                EnableLDAP.Checked = true;
                adselectedstate = "disabled";
                //OrgUnitText.Disabled = False
                OrgText.Disabled = false;
                ServerText.Disabled = false;
                drp_LDAPtype.Enabled = true;
                PortText.Disabled = false;
                LDAPDomainText.Disabled = false;
                txtLDAPAttribute.Enabled = true;
                LDAP_SSL.Disabled = false;
                admingroupdomain.Disabled = true;
                admingroupname.Disabled = true;
            }

            lgd_autoAddType.InnerHtml = m_refMsg.GetMessage("lbl auto add header");
            autoAddTypeProperty.InnerHtml = m_refMsg.GetMessage("lbl auto add user type");
            drpAutoAddType.Items.Add(new ListItem(m_refMsg.GetMessage("lbl author"), "0"));
            drpAutoAddType.Items.Add(new ListItem(m_refMsg.GetMessage("lbl member"), "1"));
            drpAutoAddType.SelectedIndex = setting_data.ADAutoUserAddType.GetHashCode();

            if (setting_data.ADIntegration)
            {
                EnableADInt.Checked = true;
            }
            if (!(setting_data.ADAuthentication == 1))
            {
                EnableADInt.Disabled = true;
            }
            if (setting_data.ADAutoUserAdd)
            {
                EnableAutoUser.Checked = true;
            }
            if (!(setting_data.ADAuthentication == 1))
            {
                EnableAutoUser.Disabled = true;
            }
            //EnableAutoUserToGroup
            if (setting_data.ADAutoUserToGroup)
            {
                EnableAutoUserToGroup.Checked = true;
            }
            if (!(setting_data.ADAuthentication == 1))
            {
                EnableAutoUserToGroup.Disabled = true;
            }

            userProperty.InnerHtml = m_refMsg.GetMessage("user property mapping");
            cmsProperty.InnerHtml = m_refMsg.GetMessage("cms property value");
            activeDirectoryProperty.InnerHtml = m_refMsg.GetMessage("active directory property value");
            userpropcount.Value = mapping_data.Length.ToString();

            int i;
            System.Text.StringBuilder result = new System.Text.StringBuilder();
            if (!(mapping_data == null))
            {
                for (i = 0; i <= mapping_data.Length - 1; i++)
                {
                    result.Append("<tr>");
                    result.Append("<td class=\"label\">" + GetResourseText(mapping_data[i].CmsName) + ":</td>");
                    result.Append("<td>");
                    result.Append("<input type=\"hidden\" maxlength=\"50\" size=\"50\" name=\"userpropname" + (i + 1) + "\"  id=\"userpropname" + (i + 1) + "\" value=\"" + mapping_data[i].CmsName + "\">");
                    result.Append("<input type=\"text\" maxlength=\"50\" size=\"25\" " + adselectedstate + " name=\"userpropvalue" + (i + 1) + "\" id=\"userpropvalue" + (i + 1) + "\" value=\"" + mapping_data[i].AdName + "\">");
                    result.Append("</td>");
                    result.Append("</tr>");
                }
                mapping_list.Text = result.ToString();
                result = null;
            }
            adminGroupMap.InnerHtml = m_refMsg.GetMessage("cms admin group map");
            adGroupName.InnerHtml = m_refMsg.GetMessage("AD Group Name");
            adDomain.InnerHtml = m_refMsg.GetMessage("AD Domain");
            admingroupname.Value = cGroup.GroupName;
            admingroupdomain.Value = cGroup.GroupDomain;
            drp_LDAPtype.Items.Add(new ListItem(m_refMsg.GetMessage("LDAP AD"), "AD"));
            drp_LDAPtype.Items.Add(new ListItem(m_refMsg.GetMessage("LDAP NO"), "NO"));
            drp_LDAPtype.Items.Add(new ListItem(m_refMsg.GetMessage("LDAP SU"), "SU"));
            drp_LDAPtype.Items.Add(new ListItem(m_refMsg.GetMessage("LDAP OT"), "OT"));
            drp_LDAPtype.Attributes.Add("onchange", "javascript:CheckLDAP(\'\', true);");
            if (setting_data.ADAuthentication == 2)
            {
                if (setting_data.ADDomainName.IndexOf("&lt;/p&gt;") + 1 > 0) //defect 17813 - SMK
                {
                    setting_data.ADDomainName = setting_data.ADDomainName.Replace("&lt;", "<");
                    setting_data.ADDomainName = setting_data.ADDomainName.Replace("&gt;", ">");
                    setting_data.ADDomainName = setting_data.ADDomainName.Replace("&quot;", "\"");
                    setting_data.ADDomainName = setting_data.ADDomainName.Replace("&#39;", "\'");
                }
                LDAPSettingsData ldapsettings;
                ldapsettings = Ektron.Cms.Common.EkFunctions.GetLDAPSettings(setting_data.ADDomainName);

                /* From VB source
                arrDomain = Split(setting_data.ADDomainName, "</server>")
                arrServer = Split(arrDomain(0), "</p>")
                */

                string tempDomainName = setting_data.ADDomainName;
                tempDomainName = tempDomainName.Replace("</server>", "|").Replace("</p>", "^");
                arrDomain = tempDomainName.Split("|".ToCharArray());
                arrServer = arrDomain[0].ToString().Split("^".ToCharArray());

                ServerText.Value = ldapsettings.Server;
                PortText.Value = ldapsettings.Port.ToString();
                LDAPjs.Text += "<script language=\"javascript\" type=\"text/javascript\">" + Environment.NewLine;

                drp_LDAPtype.SelectedIndex = ldapsettings.ServerType.GetHashCode();
                LDAPjs.Text += "     CheckLDAP(\'" + drp_LDAPtype.Items[drp_LDAPtype.SelectedIndex].Value + "\', false);" + Environment.NewLine;
                LDAP_SSL.Checked = ldapsettings.EncryptionType == Ektron.Cms.Common.EkEnumeration.LDAPEncryptionType.SSL;
                txtLDAPAttribute.Text = ldapsettings.Attribute;
                if ((arrServer.Length - 1) > 1)
                {
                    // arrLDAPDomain = Split(arrServer(2), ",") VB Source
                    arrLDAPDomain = arrServer[2].Split(',');
                    for (arrCount = 0; arrCount <= (arrLDAPDomain.Length - 1); arrCount++)
                    {
                        arrLDAPDomainElement = arrLDAPDomain.GetValue(arrCount).ToString().Split('=');
                        if (arrLDAPDomainElement[0] == "dc")
                        {
                            if (!(strLDAPDomain == ""))
                            {
                                strLDAPDomain += ".";
                            }
                            strLDAPDomain += arrLDAPDomainElement[1];
                        }
                    }
                    LDAPDomainText.Value = strLDAPDomain;
                }

                arrOrg2 = arrDomain[1].Split(new string[] {"</>"}, StringSplitOptions.None);
                for (arrCount2 = 0; arrCount2 <= (arrOrg2.Length - 1); arrCount2++)
                {
                    //Response.Write(arrOrg2(arrCount2) & "<br/>")
                    if (!(arrOrg2.GetValue(arrCount2).ToString() == ""))
                    {
                        arrOrg = arrOrg2.GetValue(arrCount2).ToString().Split(',');
                        for (arrCount = 0; arrCount <= (arrOrg.Length - 1); arrCount++)
                        {
                            if (!(arrOrg.GetValue(arrCount).ToString() == ""))
                            {
                                //arrItem = Strings.Split(arrOrg(arrCount), "=", -1, 0);
                                arrItem = arrOrg.GetValue(arrCount).ToString().Split('=');
                                if ((arrItem[0].Trim() == "o") && arrCount2 == (arrOrg2.Length - 1))
                                {
                                    OrgText.Value = arrItem.GetValue(1).ToString();
                                    //ElseIf (arrItem(0) = "ou" Or arrItem(0) = " ou") Then
                                    //    If (Not first) Then
                                    //        OrgUnitText.Value &= ","
                                    //    End If
                                    //    OrgUnitText.Value &= "ou=" & arrItem(1)
                                    //    isUnit = True
                                    //    first = False
                                }
                                else
                                {
                                    if (! first)
                                    {
                                        OrgUnitText.Value += ",";
                                    }
                                    OrgUnitText.Value += arrOrg.GetValue(arrCount);
                                    isUnit = true;
                                    first = false;
                                }
                            }
                        }
                        if (isUnit)
                        {
                            OrgUnitText.Value += "</>";
                            isUnit = false;
                            first = true;
                        }
                    }
                }
            }
            if (domain_data == null)
            {
                searchLink.InnerHtml = "<a href=\"#\" OnClick=\"javascript:alert(\'" + m_refMsg.GetMessage("javascript: alert cannot search no domains") + "\\n" + m_refMsg.GetMessage("generic check ad config msg") + "\'); return false;\">" + m_refMsg.GetMessage("generic Search") + "</a>";
            }
            else if (domain_data.Length == 0)
            {
                searchLink.InnerHtml = "<a href=\"#\" OnClick=\"javascript:alert(\'" + m_refMsg.GetMessage("javascript: alert cannot search no domains") + "\\n" + m_refMsg.GetMessage("generic check ad config msg") + "\'); return false;\">" + m_refMsg.GetMessage("generic Search") + "</a>";
            }
            else
            {
                searchLink.InnerHtml = "<a href=\"#\" OnClick=\"javascript:DoSearch();\">" + m_refMsg.GetMessage("generic Search") + "</a>";
            }
            domain.InnerHtml = m_refMsg.GetMessage("domain title") + ":";
            result = new System.Text.StringBuilder();
            result.Append("&nbsp;");

            if (domain_data == null && !m_refUserApi.RequestInformationRef.ADAdvancedConfig)
            {
                string selected = "";
                result.Append("<select " + adselectedstate + " name=\"domainname\" id=\"domainname\">");
                if (setting_data.ADDomainName == "")
                {
                    selected = " selected";
                }
                // Keep the "All Domains" drop down for continuity
                result.Append("<option value=\"\" " + selected + ">" + m_refMsg.GetMessage("all domain select caption") + "</option>");
                result.Append("</select>");
            }
            else if ((domain_data == null &&  m_refUserApi.RequestInformationRef.ADAdvancedConfig)
                    || domain_data.Length == 0)
            {
                result.Append("<font color=\"red\"><strong>" + m_refMsg.GetMessage("generic no domains found") + " " + m_refMsg.GetMessage("generic check ad config msg") + "</strong></font>");
            }
            else
            {
                if (m_refUserApi.RequestInformationRef.ADAdvancedConfig)
                {
                    for (i = 0; i <= domain_data.Length - 1; i++)
                    {
                        if (i > 0)
                            result.Append("&nbsp;");
                        result.Append(domain_data[i].Name).Append("<br/>");
                    }
                }
                else
                {
                    string selected = "";
                    result.Append("<select " + adselectedstate + " name=\"domainname\" id=\"domainname\">");
                    if (setting_data.ADDomainName == "")
                    {
                        selected = " selected";
                    }

                    result.Append("<option value=\"\" " + selected + ">" + m_refMsg.GetMessage("all domain select caption") + "</option>");
                    for (i = 0; i <= domain_data.Length - 1; i++)
                    {
                        if (domain_data[i].Name == setting_data.ADDomainName)
                        {
                            selected = " selected";
                        }
                        else
                        {
                            selected = "";
                        }
                        result.Append("<option value=\"" + domain_data[i].Name + "\"" + selected + ">" + domain_data[i].Name + "</option>");
                    }
                    result.Append("</select>");
                }
            }
            domainDropdown.InnerHtml = result.ToString();
            return false;
    }
예제 #60
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        _MessageHelper = _ContentApi.EkMsgRef;
        RegisterResources();
        if (frm_transverse_folder.Value == "1")
            traverseFolder = true;
        else
            traverseFolder = false;
        if (!(Request.QueryString["type"] == null))
        {
            _ItemType = Convert.ToString(Request.QueryString["type"]).Trim().ToLower();
        }
        if (!(Request.QueryString["id"] == null))
        {
            _Id = Convert.ToInt64(Request.QueryString["id"]);
        }
        if (!(Request.QueryString["action"] == null))
        {
            _PageAction = Convert.ToString(Request.QueryString["action"]).ToLower().Trim();
        }
        if (!(Request.QueryString["orderby"] == null))
        {
            _OrderBy = Convert.ToString(Request.QueryString["orderby"]);
        }
        if (!(Request.QueryString["LangType"] == null))
        {
            if (Request.QueryString["LangType"] != "")
            {
                _ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                _ContentApi.SetCookieValue("LastValidLanguageID", _ContentLanguage.ToString());
            }
            else
            {
                if (_ContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    _ContentLanguage = Convert.ToInt32(_ContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }
        }
        else
        {
            if (_ContentApi.GetCookieValue("LastValidLanguageID") != "")
            {
                _ContentLanguage = Convert.ToInt32(_ContentApi.GetCookieValue("LastValidLanguageID"));
            }
        }
        if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
        {
            _ContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
        }
        else
        {
            _ContentApi.ContentLanguage = _ContentLanguage;
        }

        _IsMembership = false;
        bool.TryParse(Request.QueryString["membership"], out _IsMembership);

        if (!(Request.QueryString["base"] == null))
        {
            _Base = Request.QueryString["base"].Trim().ToLower();
        }
        _CurrentUserId = _ContentApi.UserId;
        _AppImgPath = _ContentApi.AppImgPath;
        _SitePath = _ContentApi.SitePath;
        _EnableMultilingual = _ContentApi.EnableMultilingual;

        SiteAPI m_refSiteApi = new SiteAPI();
        SettingsData setting_data = new SettingsData();
        setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId);
        if (setting_data.EnablePreApproval)
        {
            _EnablePreaproval = true;
        }
        if (ddlUserType.Items.Count == 0)
        {
            AddUserTypes();
        }
    }