/** * initialise the form row * * @return void * @author Andy Bennett */ function init() { $nm = (string) $this->p->row->name; $c = $this->form->return_form_data('current'); $e = $this->form->return_form_data('existing'); $this->p->current = isset($c->{$nm}) ? $c->{$nm} : false; $this->p->existing = isset($e->{$nm}) ? $e->{$nm} : false; // define the row name $this->p->oname = (string) $this->p->row->name; $this->p->name = 'form_' . $this->p->row->name; // evaluate the method for the row $v = steamform_helper::evaluate_method($this->p->row); if (is_numeric($v) || is_string($v)) { $this->p->row->value = $v; } $r = $this->form->return_form_data('replacements'); $this->p->title = $this->set_title($r); $this->p->row->class = isset($this->p->row->class) ? ' ' . $this->p->row->class : ''; $this->p->row->divclass = isset($this->p->row->divclass) ? ' ' . $this->p->row->divclass : ''; }
<?php if ($select = steamform_helper::evaluate_method($o->rp('row'))) { $class = $o->rp('row')->class != '' ? $o->rp('row')->class : ''; $class .= ' multiselect'; $cval = $o->rp('cval'); if ($cval != '') { $cval = unserialize($cval); } $e = $o->rp('existing'); if ($e && $e != '') { $e = implode(',', array_keys(unserialize($e))); } ?> <div class="<?php echo $class; ?> "> <?php foreach ($select as $option) { ?> <?php echo form::radio(array('id' => $o->form->get_form_name() . '-' . $o->rp('name') . '_' . $option->id, 'name' => $o->rp('name'), 'checked' => isset($cval[(string) $option->id]), 'value' => $option->id)); ?> <label for="<?php echo $o->rp('name') . '_' . $option->id; ?> "><?php echo $option->title; ?> </label><br/>