/** * Override accessors for properties * @see htdocs/libraries/icms/ipf/icms_ipf_Object::getVar() */ public function getVar($key, $format = 's') { if ($format == 's' && in_array($key, array())) { return call_user_func(array($this, $key)); } return parent::getVar($key, $format); }
/** * Override accessor for several properties * * @see htdocs/libraries/icms/ipf/icms_ipf_Object::getVar() */ public function getVar($key, $format = 's') { if ($format == 's' && in_array($key, array("color_border", "color_background", "color_link", "color_url", "color_text"))) { return call_user_func(array($this, $key)); } return parent::getVar($key, $format); }
/** * Constructor * @param icms_ipf_Object $object reference to targetobject (@link icms_ipf_Object) * @param string $key the form name */ public function __construct($object, $key) { $var = $object->vars[$key]; $control = $object->controls[$key]; $form_maxlength = isset($control['maxlength']) ? $control['maxlength'] : (isset($var['maxlength']) ? $var['maxlength'] : 255); $form_size = isset($control['size']) ? $control['size'] : 50; $this->_file = $control['file']; parent::__construct($var['form_caption'], $key, $form_size, $form_maxlength, $object->getVar($key, 'e')); }
/** * get value for variable * * @param string $key field name * @param string $format format * @return mixed value */ public function getVar($key, $format = "e") { if (substr($key, 0, 4) == "url_") { return parent::getVar("url", $format); } elseif (substr($key, 0, 4) == "mid_") { return parent::getVar("mid", $format); } elseif (substr($key, 0, 8) == "caption_") { return parent::getVar("caption", $format); } elseif (substr($key, 0, 5) == "desc_") { return parent::getVar("description", $format); } else { return parent::getVar($key, $format); } }
/** * This method returns a view link of the Object * * @param icms_ipf_Object $icmsObj * @param boolean $onlyUrl * @param boolean $withimage * @param boolean $userSide * @return string */ public function getViewItemLink($icmsObj, $onlyUrl = false, $withimage = true, $userSide = false) { if ($this->handler->_moduleName != 'system') { $admin_side = $userSide ? '' : 'admin/'; $ret = $this->handler->_moduleUrl . $admin_side . $this->handler->_page . "?" . $this->handler->keyName . "=" . $icmsObj->getVar($this->handler->keyName); } else { $admin_side = ''; $ret = $this->handler->_moduleUrl . $admin_side . 'admin.php?fct=' . $this->handler->_itemname . "&op=view&" . $this->handler->keyName . "=" . $icmsObj->getVar($this->handler->keyName); } if ($onlyUrl) { return $ret; } elseif ($withimage) { return "<a href='" . $ret . "'>\r\n\t\t\t\t<img src='" . ICMS_IMAGES_SET_URL . "/actions/viewmag.png' style='vertical-align: middle;' alt='" . _PREVIEW . "' title='" . _PREVIEW . "'/></a>"; } return "<a href='" . $ret . "'>" . $icmsObj->getVar($this->handler->identifierName) . "</a>"; }