Exemple #1
0
function add_condition()
{
    $form_id = JRequest::getVar('form_id');
    $cond_index = JRequest::getVar('cond_index');
    $row = JTable::getInstance('formmaker', 'Table');
    $row->load($form_id);
    $ids = array();
    $types = array();
    $labels = array();
    $fields = explode('*:*new_field*:*', $row->form_fields);
    $fields = array_slice($fields, 0, count($fields) - 1);
    foreach ($fields as $field) {
        $temp = explode('*:*id*:*', $field);
        array_push($ids, $temp[0]);
        $temp = explode('*:*type*:*', $temp[1]);
        array_push($types, $temp[0]);
        $temp = explode('*:*w_field_label*:*', $temp[1]);
        array_push($labels, $temp[0]);
    }
    HTML_contact::add_condition($cond_index, $ids, $types, $labels, $form_id);
}