Пример #1
0
 /**
  * Remove control with given name from controls collection
  *
  * @param string $name
  */
 public function removeControl($name)
 {
     parent::removeControl($name);
     if (array_key_exists($name, $this->databaseControls)) {
         unset($this->databaseControls[$name]);
         if (array_key_exists($name, $this->readOnlyDbControls)) {
             unset($this->readOnlyDbControls[$name]);
         }
     }
 }
Пример #2
0
 /**
  * @param type $aParams
  */
 public function show($aParams = null)
 {
     $aParams = $this->actionController->getRequest()->getParams();
     $aDefaultOptions = array('' => 'Not selected');
     $aControlsValues = array();
     foreach ($this->_aParams['controls'] as $sKey => $aValue) {
         $aControlsValues[$sKey] = array();
         if (isset($aValue['values']) && !is_array($aValue['values'])) {
             switch ($aValue['values']) {
                 case 'issue':
                     $aQuery = $this->_oDbAdapter->select()->from($aValue['values'], array('id', 'title'))->where('application = ?', $aParams['aid']);
                     $aControlsValues[$sKey] = $this->_oDbAdapter->fetchPairs($aQuery);
                     break;
                 default:
                     break;
             }
         }
         if (!isset($this->_aParams['controls'][$sKey]['values']) || !is_array($aValue['values'])) {
             is_array($aControlsValues[$sKey]) ? $aControlsValues[$sKey] = $aDefaultOptions + $aControlsValues[$sKey] : $aDefaultOptions;
         } else {
             $aControlsValues[$sKey] = $this->_aParams['controls'][$sKey]['values'];
         }
     }
     $this->actionController->view->{$this->getName()} = array('controlsValues' => $aControlsValues);
     parent::show();
 }
Пример #3
0
 /**
  * @return void
  */
 public function show()
 {
     $this->view->errors = $this->getErrors();
     return parent::show();
 }
Пример #4
0
 /**
  * @param AM_Controller_Action     $oActionController
  * @param string $sName
  * @param AM_Component_Grid $oComponentGrid
  */
 public function __construct(AM_Controller_Action $oActionController, $sName, AM_Component_Grid $oComponentGrid)
 {
     $this->_oComponentGrid = $oComponentGrid;
     parent::__construct($oActionController, $sName, array());
 }