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: 58:
<?php
defined('ICMS_ROOT_PATH') or die("ImpressCMS root path not defined");
class icms_ipf_form_elements_Image extends icms_form_elements_Tray {
public function __construct($object, $key) {
$var = $object->vars[$key];
$control = $object->getControl($key);
$object_imageurl = $object->getImageDir();
parent::__construct($var['form_caption'], ' ');
if (isset($objectArray['image'])){
$objectArray['image'] = str_replace('{ICMS_URL}', ICMS_URL, $objectArray['image']);
}
if ($object->getVar($key, 'e') != '' && (substr($object->getVar($key, 'e'), 0, 4) == 'http' || substr($object->getVar($key, 'e'), 0, 10) == '{ICMS_URL}')) {
$this->addElement(new icms_form_elements_Label('', "<img src='" . str_replace('{ICMS_URL}', ICMS_URL, $object->getVar($key, 'e')) . "' alt='' /><br/><br/>" ));
} elseif ($object->getVar($key, 'e') != '') {
$this->addElement(new icms_form_elements_Label('', "<a rel='lightbox' title='" . $object_imageurl . $object->getVar($key, 'e')
. "' href='" . $object_imageurl . $object->getVar($key, 'e')
. "' ><img class='acp_object_imageurl' src='" . $object_imageurl . $object->getVar($key, 'e')
. "' alt='" . $object_imageurl . $object->getVar($key, 'e') . "' height='150' /></a><br/><br/>" ));
}
$this->addElement(new icms_ipf_form_elements_Fileupload($object, $key));
if (!isset($control['nourl']) || !$control['nourl']) {
$this->addElement(new icms_form_elements_Label('<div style="padding-top: 8px; font-size: 80%;">'._CO_ICMS_URL_FILE_DSC.'</div>', ''));
$this->addElement(new icms_form_elements_Label('', '<br />' . _CO_ICMS_URL_FILE));
$this->addElement(new icms_form_elements_Text('', 'url_'.$key, 50, 500));
}
if (!$object->isNew()) {
$this->addElement(new icms_form_elements_Label('', '<br /><br />'));
$delete_check = new icms_form_elements_Checkbox('', 'delete_'.$key);
$delete_check->addOption(1, '<span style="color:red;">'._CO_ICMS_DELETE.'</span>');
$this->addElement($delete_check);
}
}
}