Ejemplo n.º 1
0
 function getForm($formname)
 {
     if (!empty($formname)) {
         $this->form = \GCore\Admin\Extensions\Chronoforms\Models\Form::getInstance()->find('first', array('conditions' => array('title' => $formname, 'published' => 1)));
         if (!empty($this->form)) {
             $this->data =& \GCore\Libs\Request::raw();
             $this->dna = $this->form['Form']['extras']['DNA'];
             $this->actions_config = !empty($this->form['Form']['extras']['actions_config']) ? $this->form['Form']['extras']['actions_config'] : array();
             $this->params = new \GCore\Libs\Parameter($this->form['Form']['params']);
             //$this->get_events_actions();
         } else {
             echo 'Form not found or is not published';
         }
     } else {
         echo 'Form name can NOT be empty!';
     }
 }
 function render_field_config()
 {
     if (!empty($this->data['form_id']) and !empty($this->data['field_id'])) {
         $k = $this->data['field_id'];
         $this->Form->id = $this->data['form_id'];
         $this->data = $this->Form->load();
         $wizard_field = $this->data['Form']['extras']['fields'][$k];
         $type = isset($wizard_field['render_type']) ? $wizard_field['render_type'] : $wizard_field['type'];
         $class = '\\GCore\\Admin\\Extensions\\Chronoforms\\Fields\\' . \GCore\Libs\Str::camilize($type) . '\\' . \GCore\Libs\Str::camilize($type);
         ob_start();
         $class::config($wizard_field, $k);
         $element_config = ob_get_clean();
         $contents = str_replace('{N}', $k, $element_config);
         $contents = \GCore\Libs\Str::replacer($contents, \GCore\Libs\Request::raw(), array('escape' => true));
         $contents = \GCore\Helpers\DataLoader::load($contents, \GCore\Libs\Request::raw());
         echo $contents;
     }
 }