<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * Description
 *
 * @author Igor Ratsun
 */
class Rtgc_texteditor implements Rtgc_callback
{

    public function column($value = '', $data = array())
    {
        return $value;
    }

    public function field($name = '', $value = NULL)
    {
        $ci = & get_instance();
        $ci->ciext->load_jquery();
        $ci->js_css->add_js('/assets/plugins/ckeditor/ckeditor.js');
        $ci->js_css->add_js('/assets/plugins/ckeditor/adapters/jquery.js');
        $ci->js_css->add_js_string('$(function(){$(".texteditor").ckeditor({toolbar:\'RTpanel\', height: \'600px\'});});');

        return '<textarea class="texteditor" name="' . $name . '">' . $value . '</textarea>';
    }

}
