CKEditor wysiwyg para KumbiaPHP

De KumbiaPHP Framework Wiki

CODIGO ESCRITO EN BETA 2, PARA LA BETA 1 CAMBIAR Tag::js POR javascript_include_tag

0) Descarga el ckeditor y el ckfinder en /public/javascript/ckeditor y /public/javascript/ckfinder

DESCARGA: http://ckeditor.com/download y http://ckfinder.com/download

1) Guarda el codigo de abajo en /app/views/_shared/partials/ckeditor.phtml

2) Ejecuta el partial al final de tu view: View::partial( 'ckeditor' );

3) No te olvides de poner la clase ckeditor a los textarea. ej: <textarea class="ckeditor" ...

<?php
# CKEDITOR, EDITOR WYSIWYG. DESCARGA: http://ckeditor.com/download
echo Tag::js( 'ckeditor/ckeditor' );
# CKFINDER, EXPLORADOR DE ARCHIVOS. DESCARGA: http://ckfinder.com/download
echo Tag::js( 'ckfinder/ckfinder' );
?>
<script>
// RUTA DEL CKFINDER. FEATURES: http://docs.cksource.com/ckfinder_2.x_api/
CKFinder.setupCKEditor( CKEDITOR, '/javascript/ckfinder/' );

// CLASES PARA VERLAS REFLEJADAS EN EL CKEDITOR
CKEDITOR.config.contentsCss = [ '/css/my.css', '/css/style.css' ];

// CLASES PARA ELEGIR EN EL CKEDITOR QUE ESTEN EN LOS ARCIVOS QUE PUSISTE EN CKEDITOR.config.contentsCss
CKEDITOR.config.stylesSet =
[
	// CADA LINEA DE ESTAS ES UNA CLASE TUYA PERSONALIZADA DE TU STYLE O ARCHIVO CSS
	{ name : 'blue', element : 'span', attributes : { 'class' : 'blue' } },
	// RECUERDA. LA ULTIMA LINEA SIN COMA XD
	{ name : 'red', element : 'span', attributes : { 'class' : 'red' } }
];

// PARA CONFIGURAR LA ALTURA DEL TEXTAREA. MAS FEATURES: http://docs.cksource.com/ckeditor_api/
CKEDITOR.config.height = 400;
</script>
<!--
RECUERDA CAMBIAR LOS SIGUIENTES 4 PUNTOS EN /javascript/ckfinder/config.php

1) AQUI ES DONDE PERMITES A LOS USUARIOS LOGEADOS SUBIR FICHEROS.
function CheckAuthentication()
{
	return ( $_SESSION['logged'] ) ? true : false;
}
REEMPLAZA $_SESSION['logged'] POR LA VARIABLE DE TU SISTEMA CUANDO UN USUARIO ESTA LOGEADO. 

2) AQUI EL PUBLIC DE TU APP
$baseUrl = '/';

3) CAMBIA images POR img
'url' => $baseUrl . 'img',
'directory' => $baseDir . 'img',

4) CAMBIA flash POR swf
'url' => $baseUrl . 'swf',
'directory' => $baseDir . 'swf',
-->