osCommerce-2.3.4 ckeditor

///osCommerce-2.3.4 ckeditor

osCommerce-2.3.4 ckeditor

CKEditor es un editor de texto HTML/ WYSIWYG de código abierto que porporciona funciones de procesador de texto en páginas web, sin la necesidad de instalarlo como aplicación en la computadora del cliente.

La primera versión de CKEditor, bajo el nombre de FCKeditor, fue lanzado en marzo de 2003 por Frederico Caldeira Knabben, el creador del editor y del proyecto de Beneficencia Dictator for Life . Después de cruzar 3 millones de descargas, FCKeditor fue completamente revisado y rediseñado en CKEditor 3.0, con especial atención al rendimiento, accesibilidad y una nueva interfaz de usuario. En diciembre de 2012, CKEditor 4.0 fue liberado con una solución Edición en línea, el código fuente reformateado, el aumento de rendimiento de DOM y CSS. Se eliminaron Las implementaciones de servidor.

Categorías: ,

Descripción

====== EASY CK EDITOR INSTALLATION INSTRUCTIONS ======
(mommaroodles’s preferred method of adding the CK Editor)
=======================================================================================================
=== STEP 1 – DOWNLOAD THE EDITOR ===
=======================================================================================================
Download the latest CKEditor from http://ckeditor.com/download.

The following versions are available:
a.) basic
b.) standard
c.) full

Choose the version best suited for your needs and unpack to catalog/admin/ext/ckeditor.
HINT: You can also visit the plugin and skins sections and add various free plugins to your editor before downloading.
==========================================================================================================
=== STEP 2 – EDIT YOUR /catalog/admin/includes/functions/html_output.php ===
==========================================================================================================
Find the ” function tep_draw_textarea_field ”

Copy the entire function and directly below that function paste the function so that you now have 2 identical functions the one below each other.

Then what you going to do is change the name of the one function – anyone, it can the first or second tep_draw_textarea_field function.
Change the one function to read:

” function tep_draw_textarea_field_ckeditor ”

then find this line within the same function:

 

$field = ‘<textarea name=”‘ . tep_output_string($name) . ‘” cols=”‘ . tep_output_string($width) . ‘” rows=”‘ . tep_output_string($height) . ‘”‘;

 

and change it to

 

$field = ‘<textarea name=”‘ . tep_output_string($name) . ‘” id=”‘ . tep_output_string($name) . ‘” cols=”‘ . tep_output_string($width) . ‘” rows=”‘ . tep_output_string($height) . ‘”‘;

Save your file.
============================================================================================================
=== STEP 3 – EDITOR YOUR /catalog/admin/includes/template_top.php ===
============================================================================================================

Add the following to your admin’s template_top.php file just before the closing </head> tag.

<?php
//this code block is optional – if you want the ability to turn the editor on and off in admin add this – its not necessary and is not needed to make the editor work

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(\’true\’, \’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>
<!– If you would rather use ckeditor.js file from a CDN uncomment the line below and comment the line above – if the version number has changed remember to change the version number – you’ll actually find the line of code on the ck editor web site for your version –>
<!– <script src=”//cdn.ckeditor.com/4.4.4/full/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 instance = CKEDITOR.instances[editorID];
if (instance) { CKEDITOR.remove(instance); }
CKEDITOR.replace(editorID);
});
}
});
</script>

<?php
// the closing brace here forms part of the php code block above
} //if you decide to leave out the php code block above then comment or remove this too
?>
=====================================================================================================================
=== STEP 4. DECIDE WHAT TEXT AREA FIELDS YOU WANT THE EDITOR ON ===
=====================================================================================================================
More than likely, you will want the editor on your categories.php page so that you can edit product descriptions.
Other text area fields may also include the newsletter.php text area field and the mail.php text area field. You may even have added additional modules/addons which contain text area fields and would like to have the CK Editor on those fields to. In some cases it is not necessary for the CK Editor to be on the text area fields, eg. comments, if you have the header tags contribution.

The final step in getting your ck editor to appear on the pages is to change the name of the “tep_draw_textarea_field” to your newly created “tep_draw_textarea_field_ckeditor” function in the html_output.php file.

Do this for all the text area fields where you want editor on.

In categories.php find the:

 

<td class=”main”><?php echo tep_draw_textarea_field(‘products_description[‘ . $languages[$i][‘id’] . ‘]’, ‘soft’, ’70’, ’15’, (empty($pInfo->products_id) ? ” : tep_get_products_description($pInfo->products_id, $languages[$i][‘id’]))); ?></td>

 

and change it to:

 

<td class=”main”><?php echo tep_draw_textarea_field_ckeditor(‘products_description[‘ . $languages[$i][‘id’] . ‘]’, ‘soft’, ’70’, ’15’, (empty($pInfo->products_id) ? ” : tep_get_products_description($pInfo->products_id, $languages[$i][‘id’]))); ?></td>

 

all your really doing is adding ‘ _ckeditor ‘ to the end of ‘ tep_draw_textarea_field ‘ and your ckeditor will then only appear on those text area fields.

I personally find this a better solution than having to edit the jQuery script file every time you add a textarea field that you DONT want the editor on.

==================================================================================================================================================

Repeat the step above on any other file that has a text area that you’d like the CK Editor On

The instructions below is for the KC Finder – I use a CDN for images so have not tested or tried the below instructions.

====== ENDOF EASY CK EDITOR INSTALLATION INSTRUCTIONS ======

Valoraciones

No hay valoraciones aún.

Sé el primero en valorar “osCommerce-2.3.4 ckeditor”

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

*