예제 #1
0
파일: Row.php 프로젝트: laiello/resmania
 /**
  * Returns view state as an array with arrays of panel ID's
  *
  * @return array in format <column number> => array(panelID_1, panelID_2, ...);
  */
 function getState()
 {
     $formStateJSON = $this->state;
     $formState = Zend_Json::decode($formStateJSON);
     $formPanelModel = new RM_FormPanels();
     $panelColumns = array();
     foreach ($formState as $columnNumber => $column) {
         $panelColumns[$columnNumber] = array();
         if (is_array($column) == false) {
             continue;
         }
         foreach ($column as $panel) {
             $panelID = RM_Form_Naming_Manager::generatePanelID($panel['xtype']);
             $panel = $formPanelModel->find($panelID)->current();
             $panelColumns[$columnNumber][] = $panel;
         }
     }
     return $panelColumns;
 }
예제 #2
0
 public function allpanelsAction()
 {
     $unitModel = new RM_Units();
     $unitTypeID = $this->_getParam('unitTypeID');
     $unitTypeModel = new RM_UnitTypes();
     $unitType = $unitTypeModel->find($unitTypeID)->current();
     $unit = $unitModel->getAll(new RM_Unit_Search_Criteria(array('type' => $unitType, 'includeOptionUnits' => true, 'includeExcursionUnits' => true)))->current();
     if ($unitTypeID == RM_UnitTypes::DEFAULT_TYPE && $unit == null) {
         $unit = $unitModel->getAll(new RM_Unit_Search_Criteria())->current();
     }
     if ($unit == null) {
         $unit = $unitModel->createRow();
     }
     $this->view->unit = $unit;
     $this->view->admin = true;
     // this is required by captcha
     $panelModel = new RM_FormPanels();
     $panels = $panelModel->fetchAll();
     $this->view->panels = $panels;
 }
예제 #3
0
 function updatepanelsettingsJsonAction()
 {
     $align = $this->_getParam('rm_formdesigner_panelsettings_alignment_hidden');
     $width = $this->_getParam('rm_formdesigner_panelsettings_width');
     $form_id = $this->_getParam('form_id');
     $settings = array("align" => $align, "width" => $width);
     $panelModel = new RM_FormPanels();
     $form = $panelModel->find($form_id)->current();
     $form->settings = Zend_Json::encode($settings);
     $result = $form->save();
     $resultJson = false;
     if ($result) {
         $resultJson = true;
     }
     return array('data' => array('success' => $resultJson));
 }