function list_jumpto_box(&$udm, $options) { $output = " Go: <SELECT name=\"UDM_offset\" class=side onchange=\"document.forms['" . $options['list_form'] . "'].elements['offset'].value=this.value; document.forms['" . $options['list_form'] . "'].submit();\">"; $sortfields = explode(",", $options['sort_by']); $sortfields[0] = str_replace(" DESC", " ", $sortfields[0]); $sortfields[0] = str_replace(" ASC", " ", $sortfields[0]); $mysort = trim($sortfields[0]); for ($n = 0; $n <= count($udm->results); $n = $n + $options['qty_displayed']) { $output .= "<option value=\"{$n}\""; if ($n == $options['current_offset']) { $output .= " selected"; } $output .= ">" . list_translateFields($mysort, $udm, $options) . ": " . $udm->results[$n]["hide_sort_" . $mysort] . "</option>"; } $output .= "</select>"; return $output; }
function list_translateallFieldsForSql(&$udm, &$options) { if (isset($udm->_module_def['field_order'])) { $fieldOrder = split(',', $udm->_module_def['field_order']); if ($options['include_id_column'] && $udm->admin) { $fieldOrder[] = 'id'; } if (isset($options['include_modin_column'])) { $fieldOrder[] = 'modin'; } foreach ($fieldOrder as $field) { $field = trim($field); if (strlen($field) > 0 && $udm->fields[$field]['type'] != 'static' && $udm->fields[$field]['type'] != 'header') { if ($options['allow_lookups'] && isset($options['Lookups'][$field])) { if ($this_lookup = list_makeLookupsforSql($udm, $options, $field)) { $output .= $this_lookup; } } else { if ($udm->admin) { $output .= $field . " AS " . $udm->dbcon->qstr(list_translateFields($field, $udm, $options)) . ", "; } else { if ($udm->fields[$field]['public']) { $output .= $field . " AS " . $udm->dbcon->qstr(list_translateFields($field, $udm, $options)) . ", "; } } } } $finishedElements[$field] = 1; } } foreach ($udm->fields as $field => $field_def) { // Skip fields that have already been added. if (isset($finishedElements[$field])) { continue; } $output .= $field . " AS " . $udm->dbcon->qstr(str_replace('"', '_', list_translateFields($field, $udm, $options))) . ", "; } if (strlen($output) > 5) { $output = substr($output, 0, strlen($output) - 2); } return $output; }