Example #1
0
 public void Concatenate(char[] inputChars)
 {
     cApi = new Ektron.Cms.ContentAPI();
     int bufSize = 1024 * 64;
     byte[] buf = new byte[bufSize];
     string OutputFileName = this.Server.MapPath(cApi.AppPath + "soundmanager/en-us/audiofile.mp3");
     if (File.Exists(OutputFileName))
         File.Delete(OutputFileName);
     using (FileStream outFile =
         new FileStream(OutputFileName, FileMode.CreateNew,
         FileAccess.Write, FileShare.None, bufSize))
     {
         foreach (char c in inputChars)
         {
             using (FileStream _file = new FileStream(this.Server.MapPath(cApi.AppPath + "soundmanager/en-us/" + c + ".mp3"), FileMode.Open, FileAccess.Read, FileShare.Read, bufSize))
             {
                 int br = 0;
                 while ((br = _file.Read(buf, 0, buf.Length)) > 0)
                 {
                     outFile.Write(buf, 0, br);
                 }
             }
         }
     }
 }
Example #2
0
 public ClientPaging()
 {
     CurrentPageIndex = 0;
     SelectedPage = 0;
     TotalPages = 0;
     _ContentApi = new Ektron.Cms.ContentAPI();
     _MessageHelper = _ContentApi.EkMsgRef;
 }
Example #3
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        Ektron.Cms.ContentAPI contentAPI = new Ektron.Cms.ContentAPI();

            if ((contentAPI.UserId > 0) && (contentAPI.IsLoggedIn))
            {
                if (! System.Convert.ToBoolean(contentAPI.RequestInformationRef.IsMembershipUser))
                {
                    string searchLink = EkFunctions.UrlEncode(Request.Url.AbsoluteUri);
                    seolink.Text = "<a href=\"#\" onclick=\"window.open(\'" + contentAPI.AppPath + "seo/seo.aspx?url=" + EncodeJavascriptString(searchLink) + "\', \'SEOManager\',\'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=1000,height=800\');return false;\"><img src=\'" + contentAPI.AppPath + "seo/seo-button.gif\' border=\'0\' alt=\'\' /> </a>";
                }

            }
    }
Example #4
0
    void context_EndRequest(object sender, EventArgs e)
    {
        if (HttpContext.Current != null
            && HttpContext.Current.Request.PhysicalPath.ToLower().IndexOf("\\help\\") >= 0
            && HttpContext.Current.Response.StatusCode != 200
            && HttpContext.Current.Response.StatusCode != 304
            && HttpContext.Current.Request.Url != null)

        {
            Ektron.Cms.ContentAPI capi = new Ektron.Cms.ContentAPI();
            HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + "/" + capi.RequestInformationRef.ApplicationPath + "/helpmessage.aspx", true);
        }
        else
            return;
    }
Example #5
0
 private Ektron.Cms.ContentAPI getContentAPI()
 {
     Ektron.Cms.ContentAPI refContApi = new Ektron.Cms.ContentAPI();
     int m_intContentLanguage = -1;
     if ((Request.QueryString["LangType"] != null) &&
         (Request.QueryString["LangType"] != ""))
     {
         m_intContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
         if (1 == m_intContentLanguage)
         {
             m_intContentLanguage = refContApi.DefaultContentLanguage;
         }
         refContApi.SetCookieValue("LastValidLanguageID", m_intContentLanguage.ToString());
     }
     else
     {
         if (refContApi.GetCookieValue("LastValidLanguageID") != "")
         {
             m_intContentLanguage = Convert.ToInt32(refContApi.GetCookieValue("LastValidLanguageID"));
             if (1 == m_intContentLanguage)
             {
                 m_intContentLanguage = refContApi.DefaultContentLanguage;
             }
         }
         else
         {
             m_intContentLanguage = refContApi.DefaultContentLanguage;
         }
     }
     refContApi.ContentLanguage = m_intContentLanguage;
     return refContApi;
 }
Example #6
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        Ektron.Cms.ContentAPI refContApi = new Ektron.Cms.ContentAPI();
        Ektron.Cms.SiteAPI refSiteApi = new Ektron.Cms.SiteAPI();
        Ektron.Cms.Site.EkSite refSite = new Ektron.Cms.Site.EkSite(refContApi.RequestInformationRef);
        long folder = 0;
        @internal.Text = refSite.GetEditorInternal();
        if (LCaseQueryString("mode") == "forum")
        {
            strButtons = Request.QueryString["toolButtons"];
            string[] arTools = strButtons.ToLower().Split(",".ToCharArray());
            foreach (string Item in arTools)
            {
                if (!(options.ContainsKey(Item)))
                {
                    options.Add(Item, Item);
                }
            }
        }
        Response.ContentType = "text/xml";
        m_refMsg = refSiteApi.EkMsgRef;
        settings_data = refSiteApi.GetSiteVariables(-1);
        refSite = refContApi.EkSiteRef;
        FontList = refContApi.GetFontConfigList();
        EKSLK = refSite.GetInternal();
        AppeWebPath = refContApi.AppPath + refContApi.AppeWebPath;

        if (LCaseQueryString("FormToolbarVisible") == "true")
        {
            FormToolbarVisible = "true";
            FormToolbarEnabled = "true";
        }
        else
        {
            FormToolbarVisible = "false";
            FormToolbarEnabled = "true";
        }
        if ("0" == LCaseQueryString("wiki"))
        {
            bWikiButton = bool.Parse("false");
        }
        else
        {
            bWikiButton = bool.Parse("true");
        }
        //Set the state for word styles
        if (settings_data.PreserveWordStyles == true)
        {
            PresWrdStyl = "true";
        }
        else
        {
            PresWrdStyl = "false";
        }
        if (settings_data.PreserveWordClasses == true)
        {
            PresWrdCls = "true";
        }
        else
        {
            PresWrdCls = "false";
        }
        switch (settings_data.Accessibility)
        {
            case "1":
                sAccess = "loose";
                bAccessEval = "true";
                break;
            case "2":
                sAccess = "strict";
                bAccessEval = "true";
                break;
            default:
                sAccess = "none";
                bAccessEval = "false";
                break;
        }
        NoSrcView = LCaseQueryString("nosrc");
        mode = LCaseQueryString("mode");
        if (mode == "")
        {
            mode = "wysiwyg";
        }

        if (mode == "forum")
        {
            mode = "wysiwyg";
            IsForum = true;
        }

        if ("datadesign" == mode || "dataentry" == mode)
        {
            DefaultGetContentType = "datadesignpackage";
        }
        else if ("formdesign" == mode)
        {
            DefaultGetContentType = "designpage";
        }

        ExtUI = LCaseQueryString("extui");

        InterfaceName = LCaseQueryString("InterfaceName");
        if ("" == InterfaceName)
        {
            if ("datadesign" == mode || "formdesign" == mode || "dataentry" == mode)
            {
                InterfaceName = mode;
                FormToolbarEnabled = "false";
            }
            else
            {
                InterfaceName = "standard";
            }
        }
        else if ("none" == InterfaceName)
        {
            MinimalFeatureSet = false;
            FormToolbarEnabled = "false";
        }
        else if ("minimal" == InterfaceName || "calendar" == InterfaceName || "task" == InterfaceName)
        {
            if (strButtons.Length > 0 && true == options.ContainsKey("wmv"))
            {
                MinimalFeatureSet = false;
            }
            else
            {
                MinimalFeatureSet = true;
            }
            FormToolbarEnabled = "false";
        }

        if (settings_data.EnableFontButtons || true == options.ContainsKey("fontmenu"))
        {
            bEnableFontButtons = true;
        }

        string strFolder;
        strFolder = Request.QueryString["folder"];
        if (strFolder != null)
        {
            if (Information.IsNumeric(strFolder))
            {
                folder = Convert.ToInt64(strFolder);
            }
        }
        Ektron.Cms.LibraryConfigData lib_settings;
        extensions = "";
        try
        {
            // Only make this call if we are logged in
            Ektron.Cms.ContentAPI refContentApi = new Ektron.Cms.ContentAPI();
            Ektron.Cms.Content.EkContent refContent;
            refContent = refContentApi.EkContentRef;

            if (refContent.IsAllowed(0, 0, "users", "IsLoggedIn", 0))
            {
                // An exception will be thrown if the user is not authenticated.
                lib_settings = refContApi.GetLibrarySettings(folder);
                if (lib_settings != null)
                {
                    extensions = lib_settings.ImageExtensions + "," + lib_settings.FileExtensions;
                }
            }
        }
        catch (Exception)
        {
            // ignore error
        }

        ContentLanguage = refContApi.RequestInformationRef.ContentLanguage;

        PopulateDataLists(refContApi);
    }
Example #7
0
 private void Redirect()
 {
     Ektron.Cms.ContentAPI capi = new Ektron.Cms.ContentAPI();
     HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + "/" + capi.RequestInformationRef.ApplicationPath + "/helpmessage.aspx", true);
 }
Example #8
0
    private void Page_Load(object sender, EventArgs e)
    {
        Ektron.Cms.ContentAPI refAPI = new Ektron.Cms.ContentAPI();
        Ektron.Cms.PermissionData security_data = refAPI.LoadPermissions(0, "folder", 0);
        this.hasPermissionToView = security_data.IsAdmin;
        this.hasPermissionToEnable = this.hasPermissionToView;
        this.hasPermissionToEdit = this.hasPermissionToEnable;
        this.hasPermissionToAdd = this.hasPermissionToEdit && this.localeMgrBO.AddEnabled();

        if (!this.hasPermissionToView)
        {
            Response.Redirect("../blank.htm", false);
            return;
        }

        ltrStyleSheet.Text = this.styleHelper.GetClientScript();
        Utilities.ValidateUserLogin();
        this.RegisterResources();

        // Determine if EDITING or UPDATING
        this.pageAction = Request.QueryString["action"];
        if (IsPostBack)
        {
            string eventTarget = Request.Form["__EVENTTARGET"];
            string eventArgument = Request.Form["__EVENTARGUMENT"];
            if ("action" == eventTarget)
            {
                this.pageAction = eventArgument;
            }
            else if ("LocaleDetail$Save" == eventTarget)
            {
                this.pageAction = "save_detail";
            }
            else if ("LocaleDetail$Update" == eventTarget)
            {
                this.pageAction = "edit_detail";
            }
            else if (!String.IsNullOrEmpty(eventTarget) && eventTarget.StartsWith("LocaleDetail$"))
            {
                this.pageAction = "edit_detail";
            }
        }

        if (!String.IsNullOrEmpty(this.pageAction))
        {
            this.pageAction = this.pageAction.ToLower();
        }

        object sortDir = Request.QueryString["sortdir"];
        if (sortDir != null)
        {
            try
            {
                this.sortDirection = (SortDirection)Enum.Parse(typeof(SortDirection), (string)sortDir);
            }
            catch
            {
                // ignore
            }
        }
        else
        {
            sortDir = ViewState[this.UniqueID + "_SortDirection"];
            if (sortDir != null)
            {
                this.sortDirection = (SortDirection)sortDir;
            }
        }

        string sortExpr = Request.QueryString["sort"];
        if (String.IsNullOrEmpty(sortExpr))
        {
            sortExpr = ViewState[this.UniqueID + "_SortExpression"] as string;
        }

        if (!String.IsNullOrEmpty(sortExpr))
        {
            try
            {
                if (typeof(LocaleData).GetProperty(sortExpr) != null)
                {
                    this.sortExpression = sortExpr;
                }
            }
            catch
            {
                // ignore
            }
        }
    }