protected function layout_preprocess($l, $name, $data) { $selector = '.' . $this->css_class_name($name, $data); $imagelink = false; if (!empty($data['imagelist'])) { $imagelink = $data['imagelist']; } elseif (method_exists(CMS::$current_controller, 'field_action_url')) { $imagelink = CMS::$current_controller->field_action_url($name, 'imagelist', $data['__item']); } $editor = $this->get_editor($name, $data); $editor->set_images_link($imagelink); $l->redactor->add($editor, $selector); // $editor->process_template($l, $selector); parent::layout_preprocess($l, $name, $data); }
protected function layout_preprocess($l, $name, $data) { $formats = $this->get_formats($name, $data); foreach ($formats as $code => $format) { if (!empty($format['__langs_name'])) { foreach ($format['__langs_name'] as $lang => $lname) { $format['__type']->layout_preprocess($l, $lname, $format['__data']); } } else { $format['__type']->layout_preprocess($l, $format['__name'], $format['__data']); } } $l->update_parm('formats', $formats); $l->use_scripts(CMS::stdfile_url('scripts/fields/content.js')); $l->use_styles(CMS::stdfile_url('styles/fields/content.css')); $id = $this->url_class(); $code = <<<JS \$(function() { \$(".{$id}.field-{$name}").each(function() {TAO.fields.content(\$(this));}); }); JS; $l->append_to('js', $code); $l->with('url_class', $id); return parent::layout_preprocess($l, $name, $data); }