- http://kromack.com/ * @package CodeIgniter * @license http://creativecommons.org/licenses/by-nc-sa/3.0/us/ * @tutorial http://kromack.com/developpement-php/codeigniter/ckeditor-helper-for-codeigniter/ * @see http://codeigniter.com/forums/viewthread/127374/ * @version 2010-08-28 * */ /** * This function adds once the CKEditor's config vars * @author Samuel Sanchez * @access private * @param array $data (default: array()) * @return string */ function cke_initialize($data = array()) { $return = ''; if(!defined('CI_CKEDITOR_HELPER_LOADED')) { define('CI_CKEDITOR_HELPER_LOADED', TRUE); $return = ''; $return .= ""; } return $return; } /** * This function create JavaScript instances of CKEditor * @author Samuel Sanchez * @access private * @param array $data (default: array()) * @return string */ function cke_create_instance($data = array()) { $return = "'; return $return; } /** * This function displays an instance of CKEditor inside a view * @author Samuel Sanchez * @access public * @param array $data (default: array()) * @return string */ function display_ckeditor($data = array()) { // Initialization $return = cke_initialize($data); // Creating a Ckeditor instance $return .= cke_create_instance($data); // Adding styles values if(isset($data['styles'])) { $return .= ""; } return $return; } /** * config_data function. * This function look for extra config data * * @author ronan * @link http://kromack.com/developpement-php/codeigniter/ckeditor-helper-for-codeigniter/comment-page-5/#comment-545 * @access public * @param array $data. (default: array()) * @return String */ function config_data($data = array()) { $return = ''; foreach ($data as $key) { if (is_array($key)) { $return .= "["; foreach ($key as $string) { $return .= "'" . $string . "'"; if ($string != end(array_values($key))) $return .= ","; } $return .= "]"; } else { $return .= "'".$key."'"; } if ($key != end(array_values($data))) $return .= ","; } return $return; }