object_id = $object_id; $this->replace_to = unpack_object($replace_to); parent::__construct($name); $this->onClick('visibilityStatusChanges(this.checked, '.zbx_jsvalue($this->object_id).', '. zbx_jsvalue($this->replace_to).');'); } /** * Set the label for the checkbox and put it on the left. * * @param string $label * * @return CVisibilityBox */ public function setLabel($label) { parent::setLabel($label); $this->setLabelPosition(self::LABEL_POSITION_LEFT); return $this; } public function toString($destroy = true) { if (!isset($this->attributes['checked'])) { zbx_add_post_js('visibilityStatusChanges(false, '.zbx_jsvalue($this->object_id).', '. zbx_jsvalue($this->replace_to).');'); } return parent::toString($destroy); } }