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: 57:
<?php
defined("ICMS_ROOT_PATH") or die("ImpressCMS root path not defined");
class icms_ipf_form_elements_Richfile extends icms_form_elements_Tray {
public function __construct($object, $key) {
parent::__construct($object->vars[$key]['form_caption'], " ");
$fileObj = $object->getFileObj($key);
$module_handler = icms::handler("icms_module");
$module = $module_handler->getByDirname($object->handler->_moduleName);
if ($fileObj->getVar("url") != "") {
$this->addElement(new icms_form_elements_Label("", _CO_ICMS_CURRENT_FILE . $fileObj->render() . "<br /><br />"));
}
if ($fileObj->isNew()) {
$this->addElement(new icms_ipf_form_elements_Fileupload($fileObj, $key));
$this->addElement(new icms_form_elements_Label("", "<br /><br /><small>" . _CO_ICMS_URL_FILE_DSC . "</small>"));
$this->addElement(new icms_form_elements_Label("","<br />" . _CO_ICMS_URL_FILE));
$this->addElement(new icms_ipf_form_elements_Text($fileObj, "url_" . $key));
}
$this->addElement(new icms_form_elements_Hidden("mid_" . $key, $module->getVar("mid")));
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_CAPTION));
$this->addElement(new icms_ipf_form_elements_Text($fileObj, "caption_" . $key));
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_DESC));
$this->addElement(new icms_ipf_form_elements_Text($fileObj, "desc_" . $key));
if (!$fileObj->isNew()) {
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_CHANGE_FILE));
$this->addElement(new icms_ipf_form_elements_Fileupload($fileObj, $key));
$this->addElement(new icms_form_elements_Label("", "<br /><br /><small>" . _CO_ICMS_URL_FILE_DSC . "</small>"));
$this->addElement(new icms_form_elements_Label("", "<br />" . _CO_ICMS_URL_FILE));
$this->addElement(new icms_ipf_form_elements_Text($fileObj, "url_" . $key));
}
}
}