1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56:
<?php
defined('ICMS_ROOT_PATH') or die("ImpressCMS root path not defined");
class icms_ipf_form_elements_Source extends icms_form_elements_Textarea {
private $_editor = null;
public function __construct($object, $key) {
global $icmsConfig;
parent::__construct($object->vars[$key]['form_caption'], $key, $object->getVar($key, 'e'));
$control = $object->getControl($key);
$editor_handler = icms_plugins_EditorHandler::getInstance('source');
$this->_editor = &$editor_handler->get($icmsConfig['sourceeditor_default'],
array('name' => $key,
'value' => $object->getVar($key, 'e'),
'language' => isset($control['language']) ? $control['language'] : _LANGCODE,
'width' => isset($control['width']) ? $control['width'] : '100%',
'height' => isset($control['height']) ? $control['height'] : '400px',
'syntax' => isset($control['syntax']) ? $control['syntax'] : 'php'));
}
public function render() {
if ($this->_editor) {
return $this->_editor->render();
} else {
return parent::render();
}
}
}