protected void Page_Load(object sender, EventArgs e) { // Registration to chat webservice AbstractCMSPage cmsPage = Page as AbstractCMSPage; if (cmsPage != null) { ChatScriptHelper.RegisterChatAJAXProxy(cmsPage); } // Script references insertion ChatScriptHelper.RegisterChatManager(Page); ScriptHelper.RegisterJQueryUI(Page); ScriptHelper.RegisterScriptFile(Page, "jquery/jquery-a-tools.js"); ScriptHelper.RegisterScriptFile(Page, "~/CMSModules/Chat/CMSPages/Scripts/BBCodeParser.js"); ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Chat/ChatMessageSend_files/ChatMessageSend.js"); imgInformationDialog.ImageUrl = GetImageUrl("General/Labels/Information.png"); RoomID = ChatUIHelper.GetRoomIdFromQuery(RoomID, GroupID); // Register startup script ScriptHelper.RegisterStartupScript(Page, typeof(string), "ChatMessageSend_" + ClientID, BuildStartupScript(), true); // Set link to documentation and tooltip for canned responses lnkCannedRespHelp.NavigateUrl = DocumentationHelper.GetDocumentationTopicUrl(CANNED_RESPONSES_HELP_TOPIC); lnkCannedRespHelp.ToolTip = ResHelper.GetString("chat.cannedresponses.helplabel"); }
protected void Page_Load(object sender, EventArgs e) { product = SKUInfoProvider.GetSKUInfo(ProductID); // Setup help object options = new { helpName = "lnkProductEditHelp", helpUrl = DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_LINK) }; ScriptHelper.RegisterModule(this, "CMS/DialogContextHelpChange", options); EditedObject = product; if (product != null) { // Check site id CheckEditedObjectSiteID(product.SKUSiteID); // Load product currency productCurrency = CurrencyInfoProvider.GetMainCurrency(product.SKUSiteID); // Display product price headProductPriceInfo.Text = string.Format(GetString("com_sku_volume_discount.skupricelabel"), CurrencyInfoProvider.GetFormattedPrice(product.SKUPrice, productCurrency)); } // Set unigrid properties SetUnigridProperties(); // Initialize the master page elements InitializeMasterPage(); }
protected void Page_Load(object sender, EventArgs e) { var documentationLink = DocumentationHelper.GetDocumentationTopicUrl(CONVERSIONS_LOGGING_LINK); tipConversionsListing.CollapsedStateIdentifier = SMART_TIP_IDENTIFIER; tipConversionsListing.Content = string.Format(GetString("conversions.listingsmarttip"), documentationLink); tipConversionsListing.ExpandedHeader = GetString("conversions.listingsmarttip.header"); }
protected void Page_Load(object sender, EventArgs e) { // Setup help object options = new { helpName = "lnkProductEditHelp", helpUrl = DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_LINK) }; ScriptHelper.RegisterModule(this, "CMS/DialogContextHelpChange", options); // Check UI personalization for product / product option separately if (OptionCategoryID > 0) { // Check elements in product options categories subtree CheckUIElementAccessHierarchical(ModuleName.ECOMMERCE, "ProductOptions.Options.TaxClasses"); } else { CheckUIElementAccessHierarchical(ModuleName.ECOMMERCE, "Products.TaxClasses"); } if (ProductID > 0) { sku = SKUInfoProvider.GetSKUInfo(ProductID); EditedObject = sku; if (sku != null) { // Check products site id CheckEditedObjectSiteID(sku.SKUSiteID); taxForm.ProductID = ProductID; taxForm.UniSelector.OnSelectionChanged += UniSelector_OnSelectionChanged; if (sku.IsProductOption) { var categoryInfo = OptionCategoryInfoProvider.GetOptionCategoryInfo(sku.SKUOptionCategoryID); if (categoryInfo != null) { CreateBreadcrumbs(sku); if (categoryInfo.CategoryType != OptionCategoryTypeEnum.Products) { ShowError(GetString("com.taxesNotSupportedForOptionType")); taxForm.Visible = false; } } } } } }
protected void Page_Load(object sender, EventArgs e) { if (Product != null) { CheckEditedObjectSiteID(Product.SKUSiteID); } if (!RequestHelper.IsPostBack()) { // Show confirmation message after generation of variants on generation page was successful if (QueryHelper.GetBoolean("saved", false)) { ShowConfirmation(GetString("com.variants.generated")); } } // Setup help object options = new { helpName = "lnkProductEditHelp", helpUrl = DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_LINK) }; ScriptHelper.RegisterModule(this, "CMS/DialogContextHelpChange", options); // Setup asynchronous control SetupControl(); // Init action selection InitBulkActionDropdownLists(); string warningMessage = VariantsCanBeGenerated(); if (string.IsNullOrEmpty(warningMessage)) { string url = "~/CMSModules/Ecommerce/Pages/Tools/Products/Variant_New.aspx"; url = URLHelper.AddParameterToUrl(url, "ProductID", ProductID.ToString()); url = URLHelper.AddParameterToUrl(url, "dialog", QueryHelper.GetString("dialog", "0")); // Allow user to generate variants CurrentMaster.HeaderActions.ActionsList.Add(new HeaderAction { Text = GetString("com.products.newvariant"), RedirectUrl = ResolveUrl(url) }); } else { ShowWarning(warningMessage); } }
private object PreparePromotingCampaignsSmartTip() { var documentationLink = DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_TRACKING_CAMPAIGNS_LINK); var smartTipContent = String.Format(GetString("campaigns.promotionsmarttip"), documentationLink); return(new { Identifier = SMART_TIP_PROMOTION_IDENTIFIER, Content = smartTipContent, ExpandedHeader = GetString("campaigns.promotionsmarttip.header"), CollapsedHeader = GetString("campaigns.promotionsmarttip.header"), IsCollapsed = mSmartTipManager.IsSmartTipDismissed(SMART_TIP_PROMOTION_IDENTIFIER) }); }
protected void Page_Load(object sender, EventArgs e) { // Setup help object options = new { helpName = "lnkProductEditHelp", helpUrl = DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_LINK) }; ScriptHelper.RegisterModule(this, "CMS/DialogContextHelpChange", options); if (ProductID > 0) { sku = SKUInfoProvider.GetSKUInfo(ProductID); EditedObject = sku; if (sku != null) { // Check site ID CheckEditedObjectSiteID(sku.SKUSiteID); ucOptions.ProductID = ProductID; // Add new category button in HeaderAction CurrentMaster.HeaderActions.ActionsList.Add(new HeaderAction { Text = GetString("com.productoptions.general.select"), OnClientClick = ucOptions.GetAddCategoryJavaScript(), Enabled = ECommerceContext.IsUserAuthorizedToModifySKU(sku.IsGlobal) }); // New button is active in editing of global product only if global option categories are allowed and user has GlobalModifyPermission permission bool enabledButton = (sku.IsGlobal) ? ECommerceSettings.AllowGlobalProductOptions(CurrentSiteName) && ECommerceContext.IsUserAuthorizedToModifyOptionCategory(true) : ECommerceContext.IsUserAuthorizedToModifyOptionCategory(false); // Create new enabled/disabled category button in HeaderAction var dialogUrl = UrlResolver.ResolveUrl("~/CMSModules/Ecommerce/Pages/Tools/ProductOptions/OptionCategory_New.aspx?ProductID=" + sku.SKUID + "&dialog=1"); dialogUrl = ApplicationUrlHelper.AppendDialogHash(dialogUrl); CurrentMaster.HeaderActions.ActionsList.Add(new HeaderAction { Text = GetString("com.productoptions.new"), Enabled = enabledButton, ButtonStyle = ButtonStyle.Default, OnClientClick = "modalDialog('" + dialogUrl + "','NewOptionCategoryDialog', 1000, 800);" }); } } }
/// <summary> /// Page_Load event handler. /// </summary> protected void Page_Load(object sender, EventArgs e) { // Get original value oldClassName = DocumentType.ClassName; oldInheritedID = DocumentType.ClassInheritsFromClassID; oldResourceID = DocumentType.ClassResourceID; var link = String.Format("<a target=\"_blank\" href=\"{0}\">{1}</a>", DocumentationHelper.GetDocumentationTopicUrl("routing_overview"), GetString("general.ourdocumentation")); tipUrlPattern.Content = string.Format(GetString("documenttype.urlpattern.smarttip.content"), link); tipUrlPattern.Visible = DocumentType.ClassHasURL; // Bind events editElem.OnAfterSave += editElem_OnAfterSave; }
/// <summary> /// Check whether all macros in macro rule are optimized. /// Shows warning when not. /// </summary> private void CheckMacros() { var macroCondition = RuleHelper.GetMacroConditionFromRule(Rule); if (string.IsNullOrEmpty(macroCondition)) { return; } var macroTree = CachedMacroRuleTrees.GetParsedTree(macroCondition); if ((macroTree == null) || !MacroRuleTreeAnalyzer.CanTreeBeTranslated(macroTree)) { var text = string.Format(ResHelper.GetString("om.macros.macro.slow"), DocumentationHelper.GetDocumentationTopicUrl("om_macro_performance")); ShowWarning(text); } }
/// <summary> /// Handles external data bound. /// Renders link to help page and enables/disables grid editing buttons. /// </summary> private object Control_OnExternalDataBound(object sender, string sourceName, object parameter) { switch (sourceName.ToLowerCSafe()) { case "helptopiclink": { string linkUrl = (string)parameter; linkUrl = DocumentationHelper.GetDocumentationTopicUrl(linkUrl); return(String.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", linkUrl, HTMLHelper.HTMLEncode(linkUrl))); } case "delete_modify": case "move_modify": CMSGridActionButton button = (CMSGridActionButton)sender; button.Enabled = EditingEnabled; break; } return(parameter); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); iconHelp.Attributes["class"] = IconName + " " + IconCssClass; iconHelp.Attributes["title"] = Tooltip; if (!String.IsNullOrEmpty(TopicName)) { lnkHelp.NavigateUrl = DocumentationHelper.GetDocumentationTopicUrl(TopicName); } // Render help name script if (!String.IsNullOrEmpty(HelpName)) { object options = new { helpName = HelpName, helpLinkId = lnkHelp.ClientID, helpHidden = String.IsNullOrEmpty(TopicName) }; ScriptHelper.RegisterModule(this, "CMS/DialogContextHelp", options); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Setup help object options = new { helpName = "lnkProductEditHelp", helpUrl = DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_LINK) }; ScriptHelper.RegisterModule(this, "CMS/DialogContextHelpChange", options); if (IsProductOption) { // Check UI personalization for product option CheckUIElementAccessHierarchical(ModuleName.ECOMMERCE, "ProductOptions.Options.General"); } else { // Check UI personalization for product CheckUIElementAccessHierarchical(ModuleName.ECOMMERCE, "Products.General"); } }
/// <summary> /// Retrieves requested data from SharePoint server. /// Displays error message if not able to do so and returns null. /// </summary> /// <returns>Requested data, or null if something goes wrong.</returns> private DataSet GetSharePointData() { // Data does not originate from cache DataRetrievedFromServer = true; DataSet result = null; if (ConnectionInfo == null) { DisplayError(GetString("sharepoint.wp.datasource.noconnection")); return(null); } try { ISharePointListService listService = SharePointServices.GetService <ISharePointListService>(ConnectionInfo.ToSharePointConnectionData()); if (Mode == MODE.LISTS) { result = listService.GetLists(ListType); } else { result = listService.GetListItems(ListTitle, FolderServerRelativeUrl, View, ListItemsSelection); } if (result != null && (result.Tables.Count == 0 || result.Tables[0].Columns.Count == 0)) { result = null; } } catch (SharePointServiceFactoryNotSupportedException) { // No service factory for given SharePoint version DisplayError(GetString("sharepoint.versionnotsupported")); } catch (SharePointServiceNotSupportedException) { // No ISharePointListService implementation for SharePoint version DisplayError(GetString("sharepoint.listsnotsupported")); } catch (SharePointConnectionNotSupportedException) { // The ISharePointListService implementation rejected connection data DisplayError(GetString("sharepoint.invalidconfiguration")); } catch (SharePointCCSDKException ex) { var message = string.Format(GetString("sharepoint.ccsdk.idcrl.msoidclilerror"), DocumentationHelper.GetDocumentationTopicUrl("sharepoint_online_connecting")); DisplayError(message); EventLogProvider.LogException("SharePoint", "DATASOURCE", ex); } catch (WebException ex) { if (ex.Status == WebExceptionStatus.ProtocolError) { // Connection established, but response indicates error condition if (ex.Message.Contains("401")) { // Unauthorized. DisplayError(GetString("sharepoint.protocolerror.unauthorized")); } else if (ex.Message.Contains("404")) { // SharePoint instance not found on given URL DisplayError(GetString("sharepoint.protocolerror.notfound")); } else { // Some other protocol error DisplayError(GetString("sharepoint.protocolerror")); } } else if (ex.Status == WebExceptionStatus.NameResolutionFailure) { // Given site URL does not have a resolution DisplayError(GetString("sharepoint.nameresolutionfailure")); } else { DisplayError(GetString("sharepoint.unknownerror")); EventLogProvider.LogException("SharePoint", "DATASOURCE", ex); } } catch (SharePointServerException ex) { DisplayError(String.Format(GetString("sharepoint.servererror"), HTMLHelper.HTMLEncode(ex.Message))); EventLogProvider.LogException("SharePoint", "DATASOURCE", ex); } catch (Exception ex) { DisplayError(GetString("sharepoint.unknownerror")); EventLogProvider.LogException("SharePoint", "DATASOURCE", ex); } return(result); }
/// <summary> /// Raises warning in Page UI and also into EventLog that no collector or eraser has been registered. /// </summary> private void RaiseNoCollectorOrEraserRegisteredWarning() { if (IdentityCollectorRegister.Instance.Count <= 0) { AddWarning(string.Format(GetString("dataprotection.app.noidentitycollector"), DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_CUSTOM_COLLECTION_LINK)), "<br/><br/>"); EventLogProvider.LogEvent( EventType.WARNING, "DATAPROTECTION", "NOIDENTITYCOLLECTOR", $"No class implementing '{typeof(IIdentityCollector).FullName}' has been registered into '{typeof(IdentityCollectorRegister).FullName}'.\n" + "Data protection application won't return any personal data.", loggingPolicy: LoggingPolicy.ONLY_ONCE); } if (PersonalDataCollectorRegister.Instance.Count <= 0) { AddWarning(string.Format(GetString("dataprotection.app.nopersonaldatacollector"), DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_CUSTOM_COLLECTION_LINK)), "<br/><br/>"); EventLogProvider.LogEvent( EventType.WARNING, "DATAPROTECTION", "NOPERSONALDATACOLLECTOR", $"No class implementing '{typeof(IPersonalDataCollector).FullName}' has been registered into '{typeof(PersonalDataCollectorRegister).FullName}'.\n" + "Data protection application won't return any personal data.", loggingPolicy: LoggingPolicy.ONLY_ONCE); } if (PersonalDataEraserRegister.Instance.Count <= 0 && IsPageInMode(RIGHT_TO_BE_FORGOTTEN)) { AddWarning(string.Format(GetString("dataprotection.app.nopersonaldataeraser"), DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_CUSTOM_ERASURE_LINK)), "<br/><br/>"); EventLogProvider.LogEvent( EventType.WARNING, "DATAPROTECTION", "NOPERSONALDATAERASER", $"No class implementing '{typeof(IPersonalDataEraser).FullName}' has been registered into '{typeof(PersonalDataEraserRegister).FullName}'.\n" + "Data protection application won't erase any personal data.", loggingPolicy: LoggingPolicy.ONLY_ONCE); } }
protected void Page_Load(object sender, EventArgs e) { // Register script for pendingCallbacks repair ScriptHelper.FixPendingCallbacks(Page); // Handle Import settings if (!RequestHelper.IsCallback() && !RequestHelper.IsPostBack()) { // Initialize import settings ImportSettings = GetNewSettings(); } if (wzdImport.ActiveStepIndex < 3) { stpConfigImport.Settings = ImportSettings; stpSiteDetails.Settings = ImportSettings; stpImport.Settings = ImportSettings; } if (!RequestHelper.IsCallback()) { if (!VirtualPathHelper.UsingVirtualPathProvider) { SetWarningLabel(GetString("ImportSite.VirtualPathProviderNotRunning")); } ctrlAsyncUnzip.OnFinished += CtrlAsyncUnzipOnFinished; ctrlAsyncUnzip.OnError += CtrlAsyncUnzipOnError; ctlAsyncImport.OnCancel += ctlAsyncImport_OnCancel; bool notTempPermissions = false; if (wzdImport.ActiveStepIndex < 3) { // Ensure directory try { DirectoryHelper.EnsureDiskPath(ImportSettings.TemporaryFilesPath + "\\temp.file", ImportSettings.WebsitePath); } catch (IOExceptions.IOException ex) { pnlWrapper.Visible = false; SetAlertLabel(lblErrorBlank, ex.Message); return; } // Check permissions notTempPermissions = !DirectoryHelper.CheckPermissions(ImportSettings.TemporaryFilesPath, true, true, false, false); } if (notTempPermissions) { pnlWrapper.Visible = false; pnlPermissions.Visible = true; SetAlertLabel(lblErrorBlank, String.Format(GetString("ImportSite.ErrorPermissions"), ImportSettings.TemporaryFilesPath, WindowsIdentity.GetCurrent().Name)); lnkPermissions.Target = "_blank"; lnkPermissions.Text = GetString("Install.ErrorPermissions"); lnkPermissions.NavigateUrl = DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_DISKPERMISSIONS_LINK); } else { if (!RequestHelper.IsPostBack()) { // Delete temporary files try { // Delete only folder structure if there is not special folder bool onlyFolderStructure = !Directory.Exists(DirectoryHelper.CombinePath(ImportSettings.TemporaryFilesPath, ImportExportHelper.FILES_FOLDER)); ImportProvider.DeleteTemporaryFiles(ImportSettings, onlyFolderStructure); } catch (Exception ex) { pnlWrapper.Visible = false; SetAlertLabel(lblErrorBlank, GetString("ImportSite.ErrorDeletionTemporaryFiles") + " " + ex.Message); return; } } // Javascript functions string script = String.Format( @" function Finished(sender) {{ var errorElement = document.getElementById('{2}'); var errorText = sender.getErrors(); if (errorText != '') {{ errorElement.innerHTML = errorText; document.getElementById('{4}').style.removeProperty('display'); }} var warningElement = document.getElementById('{3}'); var warningText = sender.getWarnings(); if (warningText != '') {{ warningElement.innerHTML = warningText; document.getElementById('{5}').style.removeProperty('display'); }} var actDiv = document.getElementById('actDiv'); if (actDiv != null) {{ actDiv.style.display = 'none'; }} BTN_Disable('{0}'); BTN_Enable('{1}'); if ((errorText == null) || (errorText == '')) {{ BTN_Enable('{6}'); }} }} ", CancelButton.ClientID, FinishButton.ClientID, lblError.LabelClientID, lblWarning.LabelClientID, pnlError.ClientID, pnlWarning.ClientID, NextButton.ClientID ); // Register the script to perform get flags for showing buttons retrieval callback ScriptHelper.RegisterClientScriptBlock(this, GetType(), "Finished", ScriptHelper.GetScript(script)); // Add cancel button attribute CancelButton.Attributes.Add("onclick", ctlAsyncImport.GetCancelScript(true) + "return false;"); wzdImport.NextButtonClick += wzdImport_NextButtonClick; wzdImport.PreviousButtonClick += wzdImport_PreviousButtonClick; wzdImport.FinishButtonClick += wzdImport_FinishButtonClick; if (!RequestHelper.IsPostBack()) { stpConfigImport.InitControl(); } } } }
protected void Page_Load(object sender, EventArgs e) { // Set header actions (add button) string url = ResolveUrl("New.aspx"); hdrActions.AddAction(new HeaderAction { Text = GetString("om.contact.importcsv"), RedirectUrl = ResolveUrl("ImportCSV.aspx"), ButtonStyle = ButtonStyle.Primary }); hdrActions.AddAction(new HeaderAction { Text = GetString("om.contact.new"), RedirectUrl = url, ButtonStyle = ButtonStyle.Default }); var deletingInactiveContactsMethod = SettingsKeyInfoProvider.GetValue("CMSDeleteInactiveContactsMethod"); if (string.IsNullOrEmpty(deletingInactiveContactsMethod) && LicenseHelper.CheckFeature(RequestContext.CurrentDomain, FeatureEnum.FullContactManagement)) { ShowWarning(string.Format(GetString("om.contactlist.inactivecontacts.warning"), DocumentationHelper.GetDocumentationTopicUrl("contacts_automatic_deletion"))); } }
protected void Page_Load(object sender, EventArgs e) { // Register script for pendingCallbacks repair ScriptHelper.FixPendingCallbacks(Page); // Handle export settings if (!RequestHelper.IsCallback() && !RequestHelper.IsPostBack()) { ExportSettings = GetNewSettings(); } if (!RequestHelper.IsCallback()) { // Display BETA warning lblBeta.Visible = CMSVersion.IsBetaVersion(); lblBeta.Text = string.Format(GetString("export.BETAwarning"), CMSVersion.GetFriendlySystemVersion(false)); bool notTargetPermissions = false; bool notTempPermissions = false; ctrlAsyncSelection.OnFinished += CtrlAsyncSelectionOnFinished; ctrlAsyncSelection.OnError += CtrlAsyncSelectionOnError; ctlAsyncExport.OnCancel += ctlAsyncExport_OnCancel; // Init steps if (wzdExport.ActiveStepIndex < 2) { configExport.Settings = ExportSettings; if (!RequestHelper.IsPostBack()) { configExport.SiteId = SiteId; } pnlExport.Settings = ExportSettings; // Ensure directories and check permissions try { DirectoryHelper.EnsureDiskPath(ExportSettings.TargetPath + "\\temp.file", ExportSettings.WebsitePath); notTargetPermissions = !DirectoryHelper.CheckPermissions(ExportSettings.TargetPath, true, true, false, false); } catch (UnauthorizedAccessException) { notTargetPermissions = true; } catch (IOExceptions.IOException ex) { pnlWrapper.Visible = false; SetAlertLabel(lblErrorBlank, ex.Message); return; } try { DirectoryHelper.EnsureDiskPath(ExportSettings.TemporaryFilesPath + "\\temp.file", ExportSettings.WebsitePath); notTempPermissions = !DirectoryHelper.CheckPermissions(ExportSettings.TemporaryFilesPath, true, true, false, false); } catch (UnauthorizedAccessException) { notTempPermissions = true; } catch (IOExceptions.IOException ex) { pnlWrapper.Visible = false; SetAlertLabel(lblErrorBlank, ex.Message); return; } } if (notTargetPermissions || notTempPermissions) { string folder = (notTargetPermissions) ? ExportSettings.TargetPath : ExportSettings.TemporaryFilesPath; pnlWrapper.Visible = false; pnlPermissions.Visible = true; SetAlertLabel(lblErrorBlank, String.Format(GetString("ExportSite.ErrorPermissions"), folder, WindowsIdentity.GetCurrent().Name)); lnkPermissions.Target = "_blank"; lnkPermissions.Text = GetString("Install.ErrorPermissions"); lnkPermissions.NavigateUrl = DocumentationHelper.GetDocumentationTopicUrl(HELP_TOPIC_DISKPERMISSIONS_LINK); } else { // Try to delete temporary files from previous export if (!RequestHelper.IsPostBack()) { try { ExportProvider.DeleteTemporaryFiles(ExportSettings, false); } catch (Exception ex) { pnlWrapper.Visible = false; SetAlertLabel(lblErrorBlank, GetString("ImportSite.ErrorDeletionTemporaryFiles") + " " + ex.Message); return; } } ControlsHelper.EnsureScriptManager(Page).EnablePageMethods = true; // Javascript functions string script = String.Format( @" function Finished(sender) {{ var errorElement = document.getElementById('{2}'); var errorText = sender.getErrors(); if (errorText != '') {{ errorElement.innerHTML = errorText; document.getElementById('{4}').style.removeProperty('display'); }} var warningElement = document.getElementById('{3}'); var warningText = sender.getWarnings(); if (warningText != '') {{ warningElement.innerHTML = warningText; document.getElementById('{5}').style.removeProperty('display'); }} var actDiv = document.getElementById('actDiv'); if (actDiv != null) {{ actDiv.style.display = 'none'; }} BTN_Disable('{0}'); BTN_Enable('{1}'); }} ", CancelButton.ClientID, FinishButton.ClientID, lblError.LabelClientID, lblWarning.LabelClientID, pnlError.ClientID, pnlWarning.ClientID ); // Register the script to perform get flags for showing buttons retrieval callback ScriptHelper.RegisterClientScriptBlock(this, GetType(), "Finished", ScriptHelper.GetScript(script)); // Add cancel button attribute CancelButton.Attributes.Add("onclick", ctlAsyncExport.GetCancelScript(true) + "return false;"); wzdExport.NextButtonClick += wzdExport_NextButtonClick; wzdExport.PreviousButtonClick += wzdExport_PreviousButtonClick; wzdExport.FinishButtonClick += wzdExport_FinishButtonClick; if (!RequestHelper.IsPostBack()) { configExport.InitControl(); } } } }
private void ShowMacroWarning(object sender, EventArgs e) { MacroRuleInfo info = Control.EditedObject as MacroRuleInfo; if (info != null) { string macroName = info.MacroRuleName; if (!MacroRuleMetadataContainer.IsTranslatorAvailable(macroName)) { var text = string.Format(Service.Resolve <ILocalizationService>().GetString("om.configuration.macro.slow"), DocumentationHelper.GetDocumentationTopicUrl("om_macro_performance")); Control.ShowWarning(text); } } }
/// <summary> /// Check whether time-based trigger's macro condition is optimized. /// Show warning if not. /// </summary> private void CheckMacroCondition() { if (Trigger.TriggerID == 0 || Trigger.TriggerType != WorkflowTriggerTypeEnum.TimeBased) { return; } if (!String.IsNullOrEmpty(Trigger.TriggerMacroCondition)) { try { var macroTree = CachedMacroRuleTrees.GetParsedTree(Trigger.TriggerMacroCondition); if ((macroTree == null) || !MacroRuleTreeAnalyzer.CanTreeBeTranslated(macroTree)) { var text = String.Format(ResHelper.GetString("om.macros.macro.slow"), DocumentationHelper.GetDocumentationTopicUrl("om_macro_performance")); ShowWarning(text); } } catch { // in case that macro rule can't be parsed (deleted or changed, etc.) } } }
private void SetLabelMoreInformationText() { litMoreInformation.Text = string.Format(ResHelper.GetString("strands.moreinformationabout"), DocumentationHelper.GetDocumentationTopicUrl("strands_recommender_integration")); }
private void SetExplanationText() { litExplanationText.Text = String.Format(ResHelper.GetString("deleteinactivecontacts.settings.description"), DocumentationHelper.GetDocumentationTopicUrl("contacts_automatic_deletion")); }
/// <summary> /// Initialize the smart tip with the how to video. /// Shows how to video. /// </summary> private void InitSmartTip() { tipHowToListing.ExpandedHeader = GetString("abtesting.howto.howtosetupabtest.title"); if (SiteContext.CurrentSite.SiteIsContentOnly) { tipHowToListing.CollapsedStateIdentifier = SMART_TIP_IDENTIFIER_MVC; tipHowToListing.Content = String.Format(GetString("abtesting.howto.howtosetupabtestmvc.text"), DocumentationHelper.GetDocumentationTopicUrl("ab_testing_mvc")); } else { var linkBuilder = new MagnificPopupYouTubeLinkBuilder(); var linkID = Guid.NewGuid().ToString(); var link = linkBuilder.GetLink("2wU7rNzC95w", linkID, GetString("abtesting.howto.howtosetupabtest.link")); new MagnificPopupYouTubeJavaScriptRegistrator().RegisterMagnificPopupElement(this, linkID); tipHowToListing.CollapsedStateIdentifier = SMART_TIP_IDENTIFIER; tipHowToListing.Content = String.Format("{0} {1}", GetString("abtesting.howto.howtosetupabtest.text"), link); } }
/// <summary> /// Tests SharePoint connection using configuration currently filled in the form. /// </summary> private void TestConnection() { try { ISharePointSiteService siteService = SharePointServices.GetService <ISharePointSiteService>(GetConnectionData()); siteService.GetSiteUrl(); DisplayConnectionStatus(GetString("sharepoint.testconnection.success")); } catch (SharePointServiceFactoryNotSupportedException) { // No service factory for given SharePoint version DisplayConnectionStatus(GetString("sharepoint.versionnotsupported"), false); } catch (SharePointServiceNotSupportedException) { // No ISiteService implementation for SharePoint version DisplayConnectionStatus(GetString("sharepoint.testconnectionnotsupported"), false); } catch (SharePointConnectionNotSupportedException) { // The ISiteService implementation rejected connection data DisplayConnectionStatus(GetString("sharepoint.invalidconfiguration"), false); } catch (SharePointCCSDKException ex) { var message = string.Format(GetString("sharepoint.ccsdk.idcrl.msoidclilerror"), DocumentationHelper.GetDocumentationTopicUrl("sharepoint_online_connecting")); DisplayConnectionStatus(message, false, true); EventLogProvider.LogException("SharePoint", "TESTCONNECTION", ex); } catch (WebException ex) { if (ex.Status == WebExceptionStatus.ProtocolError) { // Connection established, but response indicates error condition if (ex.Message.Contains("401")) { // Unauthorized. DisplayConnectionStatus(GetString("sharepoint.protocolerror.unauthorized"), false); } else if (ex.Message.Contains("404")) { // SharePoint instance not found on given URL DisplayConnectionStatus(GetString("sharepoint.protocolerror.notfound"), false); } else { // Some other protocol error DisplayConnectionStatus(GetString("sharepoint.protocolerror"), false); } } else if (ex.Status == WebExceptionStatus.NameResolutionFailure) { // Given site URL does not have a resolution DisplayConnectionStatus(GetString("sharepoint.nameresolutionfailure"), false); } else { DisplayConnectionStatus(GetString("sharepoint.unknownerror"), false); EventLogProvider.LogException("SharePoint", "TESTCONNECTION", ex); } } catch (Exception ex) { DisplayConnectionStatus(GetString("sharepoint.unknownerror"), false); EventLogProvider.LogException("SharePoint", "TESTCONNECTION", ex); } }
/// <summary> /// Initialize the smart tip with the how to video. /// Shows how to video. /// </summary> private void InitSmartTip() { tipHowToListing.ExpandedHeader = GetString("abtesting.howto.howtosetupabtest.title"); tipHowToListing.CollapsedStateIdentifier = SMART_TIP_IDENTIFIER; tipHowToListing.Content = String.Format(GetString("abtesting.howto.howtosetupabtestmvc.text"), DocumentationHelper.GetDocumentationTopicUrl("ab_testing_mvc")); }