Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

RichEditor.cshtml

@model string
@inject IPermissionService permissionService
@inject AdminAreaSettings adminAreaSettings
@inject ITinyMceHelper tinyMceHelper
@using Nop.Web.Areas.Admin.Helpers
@using Nop.Services.Security
@{
    // tinyMCE language
    var language = await tinyMceHelper.GetTinyMceLanguageAsync();

    var allowRoxyFileman = await permissionService.AuthorizeAsync(StandardPermissionProvider.HtmlEditorManagePictures);

    var random = CommonHelper.GenerateRandomInteger();

    //extend editor with additional settings
    //Sample setting value (below):
    //settings.plugins.push('print'); settings.toolbar += ' | print';
    var additionalEditorSettings = adminAreaSettings.RichEditorAdditionalSettings;
    //is java-script supported?
    var allowJavaScript = adminAreaSettings.RichEditorAllowJavaScript;

    //allow HTML body? Full page? - http://www.tinymce.com/wiki.php/Plugin:fullpage
    //false by default
    var enableFullPage = Convert.ToBoolean(ViewData["nop.RichEditor.EnableFullPage"] ?? false);

    var extended_valid_elements = new List();
    var valid_children = new List();
    
    if(allowJavaScript)
    {
        extended_valid_elements.Add("script[charset|defer|language|src|type]");
        valid_children.Add("+body[script]");
    }

    if (adminAreaSettings.RichEditorAllowStyleTag)
    {
        extended_valid_elements.Add("style[dir