/** * @param Widget $target the element to be shown or hidden when this link is clicked * @param string $show_desc the description to use when clicking this link will show the target * @param string $hide_desc the description to use when clicking this link will hide the target * @param boolean $initially_hidden is the target hidden when the page loads? */ public function __construct($id, $unique, $target, $show_desc = 'Show', $hide_desc = 'Hide', $initially_hidden = true) { parent::__construct($id, $unique, 'javascript:void(0)', $initially_hidden ? $show_desc : $hide_desc); if (!$target->identifier) { //STUB throw new Exception('You may only link a display toggle to a widget with a unique identifier.'); } $this->target_id = $target->identifier; $this->show_desc = $show_desc; $this->hide_desc = $hide_desc; $this->initially_hidden = $initially_hidden; }