PDA

View Full Version : CKEditor osC 2.3.1



michael_s
08-18-2014, 12:19 PM
Just a fix so the editor won't show on comments, categories and head tags.

On admin/includes/template_top.php (after installing joli1811 contribution from 4 Jan 2014) replace:

_?php
if (!defined('USE_CKEDITOR_ADMIN_TEXTAREA')) {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, set_function) values ('', 'Use CKEditor', 'USE_CKEDITOR_ADMIN_TEXTAREA','true','Use CKEditor for WYSIWYG editing of textarea fields in admin',1,99,now(),'tep_cfg_select_option(array('tr ue', 'false'),' )");
define ('USE_CKEDITOR_ADMIN_TEXTAREA','true');
}
if (USE_CKEDITOR_ADMIN_TEXTAREA == "true") {
?_
_script type="text/javascript" src="_?php echo tep_href_link('ext/ckeditor/ckeditor.js'); ?_"__/script_
_script type="text/javascript" src="_?php echo tep_href_link('ext/ckeditor/adapters/jquery.js'); ?_"__/script_
_script type="text/javascript"_
$(function() {
var $editors = $('textarea');
if ($editors.length) {
$editors.each(function() {
var editorID = $(this).attr("id");
var checkName = $(this).attr("name");
if (checkName != "products_head_keywords_tag[1]" && checkName != "products_head_keywords_tag[2]" && checkName != "products_head_title_tag[1]" && checkName != "products_head_title_tag[2]" &&checkName != "products_head_desc_tag[1]" && checkName != "products_head_desc_tag[2]" && checkName.substr(0,26) != "products_image_htmlcontent" && checkName != "comments") {
var instance = CKEDITOR.instances[editorID];
if (instance) { CKEDITOR.remove(instance); }
CKEDITOR.replace(editorID);
});
}
});
_/script_
_?php
}
?_

WITH:

_?php
if (!defined('USE_CKEDITOR_ADMIN_TEXTAREA')) {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, set_function) values ('', 'Use CKEditor', 'USE_CKEDITOR_ADMIN_TEXTAREA','true','Use CKEditor for WYSIWYG editing of textarea fields in admin',1,99,now(),'tep_cfg_select_option(array('tr ue', 'false'),' )");
define ('USE_CKEDITOR_ADMIN_TEXTAREA','true');
}
if (USE_CKEDITOR_ADMIN_TEXTAREA == "true") {
?_
_script type="text/javascript" src="_?php echo tep_href_link('ext/ckeditor/ckeditor.js'); ?_"__/script_
_script type="text/javascript" src="_?php echo tep_href_link('ext/ckeditor/adapters/jquery.js'); ?_"__/script_
_script type="text/javascript"_
$(function() {
var $editors = $('textarea');
if ($editors.length) {
$editors.each(function() {
var editorID = $(this).attr("id");
var checkName = $(this).attr("name");
if (checkName != "products_head_keywords_tag[1]" && checkName != "products_head_keywords_tag[2]" && checkName != "products_head_title_tag[1]" && checkName != "products_head_title_tag[2]" &&checkName != "products_head_desc_tag[1]" && checkName != "products_head_desc_tag[2]" && checkName.substr(0,26) != "products_image_htmlcontent" && checkName != "comments") {
var instance = CKEDITOR.instances[editorID];
if (instance) { CKEDITOR.remove(instance); }
CKEDITOR.replace(editorID);
});
}
});
_/script_
_?php
}
?_

Works like a charm!
Thank you, trotterman!
http://forums.oscommerce.com/topic/381611-ckeditor-osc-231-how-to-disable-in-certain-cases-on-the-admin-page/?p=1662765

[Just the fix]

Patty
www.cybernetfx.com
www.forumdowebmaster.com.br

More... (http://addons.oscommerce.com/info/7650)