Example #1
0
function cge_CreateInputHidden(&$mod, $id, $name, $value = '', $addtext = '', $delim = ',')
{
    if (is_array($value)) {
        $val = cge_array::implode_with_key($value);
    } else {
        $val = $value;
    }
    $val = str_replace('"', '"', $val);
    $text = '<input type="hidden" name="' . $id . $name . '" value="' . $val . '"';
    if ($addtext != '') {
        $text .= ' ' . $addtext;
    }
    $text .= " />\n";
    return $text;
}
// get the filter string
$filter = '';
if (isset($params['input_filter']) && $params['input_filter'] != '') {
    $filter = trim($params['input_filter']);
}
if ($filter == '') {
    unset($params['hidden_params']);
}
if (isset($params['filter'])) {
    // optionally display the filter form
    $this->smarty->assign('startform', $this->CreateFormStart($id, 'default', $returnid, $method = 'post', '', true));
    $this->smarty->assign('prompt_filter', $this->Lang('filter'));
    $this->smarty->assign('input_filter', $this->CreateInputText($id, 'input_filter', $filter, 15));
    $this->smarty->assign('input_submit', $this->CreateInputSubmit($id, 'input_submit', $this->Lang('submit')));
    unset($params['input_filter']);
    $this->smarty->assign('hidden_params', $this->CreateInputHidden($id, 'hidden_params', cge_array::implode_with_key($params)));
    $this->smarty->assign('endform', $this->CreateFormEnd());
}
$do_query = true;
if (isset($params['no_initial']) && $params['no_initial'] != '' && isset($params['hidden_params']) == false) {
    $do_query = false;
}
// adjust the filter
$adjusted_filter = $filter;
if ($filter != '') {
    $tmp = explode(' ', $adjusted_filter);
    $adjusted_filter = '%' . $tmp[0] . '%';
}
// get ready for array processing
$rowarray = array();
$query = '';