public function setup() { $c = (string) $this->row->class; if (strpos($c, 'toggle') !== false) { XformJS::instance()->add('toggle_formrows_select'); } }
public function setup() { $c = (string) $this->row->class; if (strpos($c, 'wysiwyg') !== false) { XformJS::instance()->add('wysiwyg'); } if (strpos($c, 'maxchars') !== false) { XformJS::instance()->add('textarea_maxchars'); } }
/** * returns the form html * * @return string * @author Andy Bennett */ public function render($form_name = 'form') { Assets::instance()->add_css('/cache/xform/css/xform'); Assets::instance()->add_javascript('/xform-' . XformJS::instance()->get_id()); $form_data = array(); // include the pagination css / js if there is more than one page set if ($this->is_paginated()) { Assets::instance()->add_css('global/fabtabulous'); Assets::instance()->add_javascript('global/fabtabulous'); if ($form_name == 'form') { $form_name = 'paginated_form'; } } // set defaults $form_data['rownum'] = 0; $form_data['pagenum'] = 1; // set the form, action tags $form_data['tag'] = $this->is_file_uploads() ? 'open_multipart' : 'open'; $form_data['action'] = (string) $this->form['action']; // set the form class $form_data['form_class'] = isset($this->form->action['type']) ? (string) $this->form->action['type'] : ''; // set some default hidden items $form_data['hidden'] = array('nohistory' => 1, 'form_action' => $this->name); if ($this->data->update !== false) { $form_data['hidden']['form_id'] = $this->data->update; } $u = isset($_GET['ajax']) ? '?ajax=true' : ''; if (isset($_POST['current'])) { $form_data['hidden']['current'] = $_POST['current'] . $u; } $form_data['form'] = $this; $form_data['rows'] = $this->rows; return View::factory('xform/' . $form_name, $form_data)->render(); }
public function setup() { XformJS::instance()->add('colour_picker'); }
/** * undocumented function * * @return void * @author Andy Bennett */ protected function rules($fname, &$post) { $v = Kohana::auto_load('valid'); if (isset($this->row->rules)) { foreach ($this->row->rules->rule as $rule) { if (isset($rule['name'])) { XformJS::instance()->add_rule($fname, $rule); if (isset($this->row->class)) { $this->row->class .= ' xform-' . $rule['name']; } else { $this->row->addChild('class', 'xform-' . $rule['name']); } } $post->add_rules($fname, (string) $rule); } } }
public function render() { XformJS::instance()->render(); }