Exemple #1
0
 protected function init()
 {
     $this->form->att('class', self::getParam('form-type'));
     $this->param['default_component_parent'] = 0;
     $this->response->addCss('/vendor/font-awesome-4.2.0/css/font-awesome.min.css');
     $this->response->addCss('/vendor/jquery/smoothness/jquery-ui-1.9.1.custom.css');
     $this->response->addCss(OSY_WEB_ROOT . HelperOsy::nvl($this->param['css-instance'], '/css/style.css'));
     $this->response->addJsFile('/vendor/jquery/jquery-1.10.2.min.js');
     $this->response->addJsFile('/vendor/jquery/jquery-ui-1.10.3.custom.min.js');
     $this->response->addJsFile('js/view/Form.js');
     $this->response->addJsFile('js/view/FormMain.js');
 }
Exemple #2
0
 /**
  ** @abstract Metodo che si occupa di caricare i parametri dei diversi campi prelevati dal db
  **           all'interno dell'oggetto form al fine di instanziarli e visualizzarli.
  ** @private
  ** @return void
  **/
 private static function buildForm()
 {
     foreach (self::$model->field as $id => $f) {
         /*Istanzio il componente attraverso la ComponentFactory*/
         self::$model->field[$id]['object'] = ComponentFactory::create($f);
         //If ComponentFactory don't return a valid component obscure visibility
         if (!is_object(self::$model->field[$id]['object'])) {
             self::$model->field[$id]['visible'] = false;
             continue;
         }
         //Define visible the component (model will work on the visible component)
         self::$model->field[$id]['visible'] = true;
         if (array_key_exists('ajax', $_REQUEST) && $_REQUEST['ajax'] == $f['name']) {
             //Da migliorare creando metodo separato di gestione
             self::$form->put(self::$model->field[$id]['object'], 'dummy', 'dummy', 1, 1, 0);
             return;
         }
         self::$model->field[$id]['object']->appendRequired(self::$page);
         //If component is displayed on foot add is to command array
         if (!empty($f['in-command-panel'])) {
             self::$model->field[$id]['object']->att('class', 'extra wmin80');
             self::$param['command'][] = self::$model->field[$id]['object'];
             continue;
         }
         //Add component on the form
         self::$form->put(self::$model->field[$id]['object'], $f['label'], $f['name'], HelperOsy::nvl($f['position-row'], -1), HelperOsy::nvl($f['position-column'], 0), HelperOsy::nvl($f['position-panel-parent'], 0));
     }
 }