Token used to add security, via adding a key to the session state, for uploading documents using CKEditor through this system
        /// <summary> Add the file input and the necessary script section, with
        /// all the options specfiedi here, directly to the streamwriter </summary>
        /// <param name="Output"> Writer to write to the stream </param>
        /// <param name="Include_Script_Reference"> Flag indicates if the CKEditor script reference should be
        /// added to the output stream here </param>
        public void Add_To_Stream(TextWriter Output, bool Include_Script_Reference)
        {
            if (HttpContext.Current == null)
            {
                Output.WriteLine("<!-- Unable to add CKEditor due to HTTPContext.Current being null -->");
                return;
            }

            if (Include_Script_Reference)
            {
                if (!String.IsNullOrEmpty(BaseUrl))
                {
                    Output.WriteLine("  <script type=\"text/javascript\" src=\"" + BaseUrl + "default/ckeditor/4.4.7/ckeditor.js\"></script>");
                }
                else
                {
                    Output.WriteLine("  <script type=\"text/javascript\" src=\"" + UI_ApplicationCache_Gateway.Settings.Servers.Application_Server_URL + "default/ckeditor/4.4.7/ckeditor.js\"></script>");
                }
            }

            Output.WriteLine("  <script type=\"text/javascript\">");

            Output.WriteLine("    $(document).ready(function () { ");

            if (Start_In_Source_Mode)
            {
                Output.WriteLine("          CKEDITOR.config.startupMode = 'source';");
            }
            Output.WriteLine("          CKEDITOR.config.resize_dir = 'vertical';");
            Output.WriteLine("          CKEDITOR.config.height = 500;");
            Output.WriteLine("          CKEDITOR.config.codemirror = { theme: 'default', lineNumbers: true, lineWrapping: true  };");

            Output.WriteLine("          CKEDITOR.replace( '" + TextAreaID + "', {");
            Output.WriteLine("               extraPlugins: 'divarea',");
            Output.WriteLine("               extraPlugins: 'autogrow',");
            Output.WriteLine("               extraPlugins: 'tableresize',");


            // Is there an endpoint defined for looking at uploaded files?
            if (!String.IsNullOrEmpty(ImageBrowser_ListUrl))
            {
                Output.WriteLine("               extraPlugins : 'imagebrowser',");
                Output.WriteLine("               imageBrowser_listUrl: '" + ImageBrowser_ListUrl + "',");
            }

            // Can we upload files
            if ((!String.IsNullOrEmpty(UploadPath)) && (!String.IsNullOrEmpty(UploadURL)) && (!String.IsNullOrEmpty(FileBrowser_ImageUploadUrl)))
            {
                // Create a new security token, save in session, and set token GUID in the form data
                CKEditor_Security_Token newToken = new CKEditor_Security_Token(UploadPath, UploadURL);
                string token = newToken.ThisGuid.ToString();
                HttpContext.Current.Session["#CKEDITOR::" + token] = newToken;

                Output.WriteLine("               filebrowserImageUploadUrl: '" + FileBrowser_ImageUploadUrl + "?token=" + token + "',");
            }

            if (Language == Web_Language_Enum.English)
            {
                Output.WriteLine("               language: 'en',");
            }
            if (Language == Web_Language_Enum.Spanish)
            {
                Output.WriteLine("               language: 'es',");
            }
            if (Language == Web_Language_Enum.French)
            {
                Output.WriteLine("               language: 'fr',");
            }
            if (Language == Web_Language_Enum.German)
            {
                Output.WriteLine("               language: 'de',");
            }
            if (Language == Web_Language_Enum.Dutch)
            {
                Output.WriteLine("               language: 'nl',");
            }



            Output.WriteLine("               autoGrow_maxHeight: 800,");
            Output.WriteLine("               removePlugins: 'resize',");
            Output.WriteLine("               magicline_color: 'blue'");
            Output.WriteLine("			});");
            Output.WriteLine("    });");
            Output.WriteLine("  </script>");
        }
        /// <summary> Add the file input and the necessary script section, with
        /// all the options specfiedi here, directly to the streamwriter </summary>
        /// <param name="Output"> Writer to write to the stream </param>
        /// <param name="Include_Script_Reference"> Flag indicates if the CKEditor script reference should be
        /// added to the output stream here </param>
        public void Add_To_Stream(TextWriter Output, bool Include_Script_Reference )
        {
            if (HttpContext.Current == null)
            {
                Output.WriteLine("<!-- Unable to add CKEditor due to HTTPContext.Current being null -->");
                return;
            }

            if ( Include_Script_Reference )
                Output.WriteLine("  <script type=\"text/javascript\" src=\"" + UI_ApplicationCache_Gateway.Settings.Servers.Application_Server_URL + "default/ckeditor/4.4.7/ckeditor.js\"></script>");

            Output.WriteLine("  <script type=\"text/javascript\">");

            Output.WriteLine("    $(document).ready(function () { ");

            if (Start_In_Source_Mode)
            {
                Output.WriteLine("          CKEDITOR.config.startupMode = 'source';");
            }
            Output.WriteLine("          CKEDITOR.config.resize_dir = 'vertical';");
            Output.WriteLine("          CKEDITOR.config.height = 500;");
            Output.WriteLine("          CKEDITOR.config.codemirror = { theme: 'default', lineNumbers: true, lineWrapping: true  };");

            Output.WriteLine("          CKEDITOR.replace( '" + TextAreaID + "', {");
            Output.WriteLine("               extraPlugins: 'divarea',");
            Output.WriteLine("               extraPlugins: 'autogrow',");
            Output.WriteLine("               extraPlugins: 'tableresize',");

            // Is there an endpoint defined for looking at uploaded files?
            if (!String.IsNullOrEmpty(ImageBrowser_ListUrl))
            {
                Output.WriteLine("               extraPlugins : 'imagebrowser',");
                Output.WriteLine("               imageBrowser_listUrl: '" + ImageBrowser_ListUrl + "',");
            }

            // Can we upload files
            if ((!String.IsNullOrEmpty(UploadPath)) && (!String.IsNullOrEmpty(UploadURL)) && (!String.IsNullOrEmpty(FileBrowser_ImageUploadUrl)))
            {
                // Create a new security token, save in session, and set token GUID in the form data
                CKEditor_Security_Token newToken = new CKEditor_Security_Token(UploadPath, UploadURL);
                string token = newToken.ThisGuid.ToString();
                HttpContext.Current.Session["#CKEDITOR::" + token] = newToken;

                Output.WriteLine("               filebrowserImageUploadUrl: '" + FileBrowser_ImageUploadUrl + "?token=" + token + "',");
            }

            if (Language == Web_Language_Enum.English)
                Output.WriteLine("               language: 'en',");
            if (Language == Web_Language_Enum.Spanish)
                Output.WriteLine("               language: 'es',");
            if (Language == Web_Language_Enum.French)
                Output.WriteLine("               language: 'fr',");
            if (Language == Web_Language_Enum.German)
                Output.WriteLine("               language: 'de',");
            if (Language == Web_Language_Enum.Dutch)
                Output.WriteLine("               language: 'nl',");

            Output.WriteLine("               autoGrow_maxHeight: 800,");
            Output.WriteLine("               removePlugins: 'resize',");
            Output.WriteLine("               magicline_color: 'blue'");
            Output.WriteLine("			});");
            Output.WriteLine("    });");
            Output.WriteLine("  </script>");
        }