Exemple #1
0
 /**
  * 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;
 }
 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));
 }