protected function setOptions() { if (isset($this->_vars[0])) { switch (is_numeric($this->_vars[0])) { case true: $this->setOption('id', $this->_vars[0]); break; case false: $this->setOption('name', $this->_vars[0]); break; } } switch ($this->_action) { case 'open': $start = isset($this->_vars[1]) && is_numeric($this->_vars[1]) ? $this->_vars[1] : TFRouter::getParam('start'); $limit = isset($this->_vars[2]) && is_numeric($this->_vars[2]) ? $this->_vars[2] : TFRouter::getParam('limit'); $this->setOption('start', $start); $this->setOption('limit', $limit); break; case 'close': $this->setOption('close', true); $this->setOption('action', 'restrict'); break; } parent::setOptions(); }
public function setOptions() { switch ($this->_action) { case 'create': $this->setOption('new-permissions', array(TFRouter::getParam('new-permission'))); break; case 'open': if (isset($this->_vars[0])) { switch (is_numeric($this->_vars[0])) { case true: $this->setOption('id', $this->_vars[0]); break; case false: $this->setOption('name', $this->_vars[0]); break; } } break; } parent::setOptions(); }
protected function setOptions() { if (isset($this->_vars[0])) { if (is_numeric($this->_vars[0])) { $this->setOption('id', array_shift($this->_vars)); } elseif (is_string($this->_vars[0])) { $this->setOption('name', array_shift($this->_vars)); } } switch ($this->_action) { case 'new': if (isset($this->_vars[0])) { while (count($this->_vars) > 0) { $name = array_shift($this->_vars); $value = array_shift($this->_vars); $this->setOption($name, $value); } } break; } parent::setOptions(); }