/** * Abstract implementation that interates of the children of the element * invoking loadRequestData. During this phase of the processing cycle * elements should retrieve input data from the ZRequest object * * @return boolean true if all children were processed, false otherwise */ public function loadRequestData() { $id = $this->getID(); if ($this->multiple) { $id = substr($id, 0, strlen($id) - 2); } $value = ZRequest::get($id); if (!$value) { $value = ZRequest::post($id); } if ($value) { $this->setValue($value); if (!is_array($value)) { $value = array($value); } foreach ($this->_childNodes as $child) { foreach ($value as $setting) { if ($setting == $child->getValue()) { $child->selected = true; } } } } return true; }
/** * The methods will loaded the x & y position of the image click into the * ZFormImage component. * * @return void */ public function loadRequestData() { /** * * @todo I don't like getting from both get and post, * Options include getting parent until a form is identified * Potentially pass bucket in as well * I don't like searching up, because for other controls you may not * be contained within a form */ $id = $this->getIDPath(); $x = ZRequest::get($id . "_x"); if (!$x) { $x = ZRequest::post($id . "_x"); } $y = ZRequest::get($id . "_y"); if (!$y) { $y = ZRequest::post($id . "_y"); } if ($x && $y) { $this->_x = $x; $this->_y = $y; } return parent::loadRequestData(); }
/** * Retrieves the data associated with this element from the ZRequest object. * * @returns void * @todo I don't like getting from both get and post, * Options include getting parent until a form is identified * Potentially pass bucket in as well * I don't like searching up, because for other controls you may not * be contained withing a form */ public function loadRequestData() { $id = $this->getIDPath(); $value = ZRequest::get($id); if (!$value) { $value = ZRequest::post($id); } if ($value) { $this->setValue($value); } else { $id = $this->name; $value = ZRequest::get($id); if (!$value) { $value = ZRequest::post($id); } if ($value && $value == $this->value) { $this->checked = true; } else { unset($this->_attributes['checked']); } } return true; }
/** * Retrieves the data associated with this element from the ZRequest object. * * @returns void * @todo I don't like getting from both get and post, * Options include getting parent until a form is identified * Potentially pass bucket in as well * I don't like searching up, because for other controls you may not * be contained withing a form */ public function loadRequestData() { $id = $this->name ? $this->name : $this->getID(); $value = ZRequest::get($id); if (!$value) { $value = ZRequest::post($id); } if ($value) { $this->setValue($value); } return parent::loadRequestData(); }