Advertisement:

Author Topic: TinyMCE in Admin  (Read 612 times)

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
TinyMCE in Admin
« on: September 04, 2016, 01:15:42 am »
Hi there,

I was facing the issue that tinyMCE was NOT showing in Admin Pages management and Email template management which made sending a test email also impossible. I managed to get it fixed on my website by editing the TinyMCE Init() script inside a function, now all works fine.
Since it might help others here's the code I have changed in the file: \oc-admin\themes\modern\emails\frm.php

BE WARNED! IF you chose to try and use this fix just make sure to create a backup since this concerns a core file change which will be overwritten when upgrading Osclass in the future.

Function customHead() inside the script tags
Code: [Select]
            tinyMCE.init({
                mode : "textareas",
                width: "100%",
                height: "440px",
                language: 'en',
                theme_advanced_toolbar_align : "left",
                theme_advanced_toolbar_location : "top",
                plugins : [
                    "advlist autolink lists link image charmap preview anchor",
                    "searchreplace visualblocks code fullscreen",
                    "insertdatetime media table contextmenu paste"
                ],
                entity_encoding : "raw",
                theme_advanced_buttons1_add : "forecolorpicker,fontsizeselect",
                theme_advanced_buttons2_add: "media",
                theme_advanced_buttons3: "",
                theme_advanced_disable : "styleselect,anchor",
                relative_urls : false,
                remove_script_host : false,
                convert_urls : false
            });

is replaced with the following code:
Code: [Select]
            tinyMCE.init({
// General options
mode : "textareas",
doctype : "<!DOCTYPE html>",
theme : "advanced",
                width: "100%",
                height: "440px",
                language: "en",
    plugins : "advlist,autolink,lists,link,image,charmap,preview,anchor,searchreplace,visualblocks,code,fullscreen,insertdatetime,media,table,contextmenu,paste",

// Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",

theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,

// Skin options
skin : "o2k7",
skin_variant : "silver",

                entity_encoding : "raw",
                theme_advanced_buttons1_add : "forecolorpicker,fontsizeselect",
                theme_advanced_buttons2_add: "media",
                theme_advanced_buttons3: "",
                theme_advanced_disable : "styleselect,anchor",

        forced_root_block : false,

                relative_urls : false,
                remove_script_host : false,
                convert_urls : false
            });

To get the TinyMCE also working in the Pages admin page I copied the same javascript TinyMCE_Init() code to frm.php in oc-admin/themes/modern/pages/frm.php


Regards,
Eric
« Last Edit: September 04, 2016, 01:22:21 am by SmaRTeY »