/// <summary>
    /// Page load
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        FormEngineUserControl label = LoadUserControl("~/CMSFormControls/Basic/LabelControl.ascx") as FormEngineUserControl;

        if (label != null)
        {
            label.Value = GetString("validation.accessibility.standard");
        }

        // Add validation standard
        FormEngineUserControl standard = LoadUserControl("~/CMSFormControls/Basic/DropDownListControl.ascx") as FormEngineUserControl;

        if (standard != null)
        {
            mStandardList = standard.FindControl(standard.InputControlID) as CMSDropDownList;
            mStandardList.Attributes.Add("class", "form-control input-width-60");
        }
        ControlsHelper.FillListControlWithEnum <AccessibilityStandardEnum>(mStandardList, "validation.accessibility.standard");

        // Set default standard value
        if (!RequestHelper.IsPostBack() && (standard != null))
        {
            standard.Value = AccessibilityStandardCode.FromEnum(AccessibilityStandardEnum.WCAG2_0A);
        }

        HeaderActions.AdditionalControls.Add(label);
        HeaderActions.AdditionalControls.Add(standard);
        HeaderActions.AdditionalControlsCssClass = "HeaderActionsLabel control-group-inline";
        HeaderActions.ReloadAdditionalControls();
    }
    /// <summary>
    /// Page load
    /// </summary>
    protected override void OnInit(EventArgs e)
    {
        FormEngineUserControl label = LoadUserControl("~/CMSFormControls/Basic/LabelControl.ascx") as FormEngineUserControl;

        if (label != null)
        {
            label.Value = GetString("validation.accessibility.standard");
        }

        // Add validation standard
        FormEngineUserControl standard = LoadUserControl("~/CMSFormControls/Basic/DropDownListControl.ascx") as FormEngineUserControl;

        if (standard != null)
        {
            mStandardList = standard.FindControl(standard.InputControlID) as DropDownList;
        }
        DataHelper.FillListControlWithEnum(typeof(AccessibilityStandardEnum), mStandardList, "validation.accessibility.standard.", null);

        // Set default standard value
        if (!RequestHelper.IsPostBack() && (standard != null))
        {
            standard.Value = AccessibilityStandardCode.FromEnum(AccessibilityStandardEnum.WCAG2_0A);
        }

        HeaderActions.AdditionalControls.Add(label);
        HeaderActions.AdditionalControls.Add(standard);
        HeaderActions.AdditionalControlsCssClass = "HeaderActionsLabel";
        HeaderActions.ReloadAdditionalControls();
    }
Exemple #3
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (selectedSiteID == -5)
        {
            HeaderActions.ActionsList[0].Enabled = false;

            FormEngineUserControl label = this.LoadUserControl("~/CMSFormControls/Basic/LabelControl.ascx") as FormEngineUserControl;
            label.Value = GetString("banner.choosegloborsite");

            HeaderActions.AdditionalControls.Add(label);
            HeaderActions.AdditionalControlsCssClass = "HeaderActionsLabel";
            HeaderActions.ReloadAdditionalControls();
        }
    }
Exemple #4
0
    /// <summary>
    /// Ensures changes in UI to indicate asynchronous progress
    /// </summary>
    private void HandleAsyncProgress()
    {
        var threadRunning = IsRunningThread();

        if (threadRunning)
        {
            var label = LoadUserControl("~/CMSFormControls/Basic/LabelControl.ascx") as FormEngineUserControl;
            if (label != null)
            {
                label.ID = "lblStatus";

                string text;

                var parameter = ctlAsync.Parameter;
                if (parameter != null)
                {
                    string error;
                    string action;
                    string submissionName;
                    int    submissionId;

                    ParseParameter(parameter, out action, out error, out submissionName, out submissionId);

                    var status  = (action == PROCESS_ACTION) ? TranslationStatusEnum.ProcessingSubmission : TranslationStatusEnum.ResubmittingSubmission;
                    var current = (submissionId == SubmissionInfo.SubmissionID);

                    text = current ? GetString(status.ToLocalizedString(null)) : string.Format(GetString(status.ToLocalizedString("translations.status.name")), HTMLHelper.HTMLEncode(submissionName));
                }
                else
                {
                    text = GetString("translationservice.updatingstatuses");
                }

                label.Value = ScriptHelper.GetLoaderInlineHtml(Page, text);
                HeaderActions.AdditionalControls.Add(label);
                HeaderActions.AdditionalControlsCssClass = "header-actions-label control-group-inline";
                HeaderActions.ReloadAdditionalControls();
            }
        }

        HeaderActions.Enabled          = !threadRunning;
        editElem.UIFormControl.Enabled = !threadRunning;
    }
Exemple #5
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        // Disable action and display label if site is set to "this site and global"
        if (selectedSiteID == -5)
        {
            HeaderActions.ActionsList[0].Enabled = false;

            FormEngineUserControl label = this.LoadUserControl("~/CMSFormControls/Basic/LabelControl.ascx") as FormEngineUserControl;
            label.Value = GetString("chat.chooseglobalorsitetoaddnewroom");

            HeaderActions.AdditionalControls.Add(label);
            HeaderActions.AdditionalControlsCssClass = "header-actions-label control-group-inline";
            HeaderActions.ReloadAdditionalControls();
        }
        else
        {
            HeaderActions.ActionsList[0].Enabled = HasUserModifyPermission(selectedSiteID);
        }
    }
    /// <summary>
    /// Ensures changes in UI to indicate asynchronous progress
    /// </summary>
    private void HandleAsyncProgress()
    {
        if (Grid.IsEmpty)
        {
            return;
        }

        string statusCheck = SettingsKeyInfoProvider.GetValue(SiteContext.CurrentSiteName + ".CMSTranslationsLastStatusCheck");

        if (string.IsNullOrEmpty(statusCheck))
        {
            statusCheck = GetString("general.notavailable");
        }

        ShowInformation(string.Format(GetString("translationservice.laststatuscheck"), statusCheck));

        var page = Page as CMSPage;

        if (page == null)
        {
            return;
        }

        var threadRunning = IsRunningThread();

        if (threadRunning)
        {
            var label = LoadUserControl("~/CMSFormControls/Basic/LabelControl.ascx") as FormEngineUserControl;
            if (label != null)
            {
                label.ID = "lblStatus";

                string text;

                var parameter = ctlAsync.Parameter;
                if (parameter != null)
                {
                    string error;
                    string action;
                    string submissionName;

                    ParseParameter(parameter, out action, out error, out submissionName);

                    if (action == UPDATE_STATUSES_ACTION)
                    {
                        text = GetString("translationservice.updatingstatuses");
                    }
                    else
                    {
                        var status = (action == PROCESS_ACTION) ? TranslationStatusEnum.ProcessingSubmission : TranslationStatusEnum.ResubmittingSubmission;

                        text = string.Format(GetString(status.ToLocalizedString("translations.status.name")), HTMLHelper.HTMLEncode(submissionName));
                    }
                }
                else
                {
                    text = GetString("translationservice.updatingstatuses");
                }

                label.Value = ScriptHelper.GetLoaderInlineHtml(text);
                HeaderActions.AdditionalControls.Add(label);
                HeaderActions.AdditionalControlsCssClass = "header-actions-label control-group-inline";
                HeaderActions.ReloadAdditionalControls();
            }
        }

        HeaderActions.Enabled = !threadRunning;
    }