Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
 }