Exemplo n.º 1
0
function format_unix($str)
{
    return unix_newlines($str);
}
Exemplo n.º 2
0
function get_fields()
{
    # no sense in doing all this so many times
    if (isset($GLOBALS['gotten_fields'])) {
        return $GLOBALS['gotten_fields'];
    }
    $fields_str = unix_newlines($_REQUEST['fields']);
    $GLOBALS['gotten_fields'] = array();
    $fields_str = rtrim($fields_str);
    $fields = split("\n", $fields_str);
    foreach ($fields as $field) {
        list($name, $type, $options) = split('  *', $field);
        if ($options) {
            $options = split(',', $options);
        }
        if (!$type) {
            $type = $name;
        }
        $input = field_input($type);
        $format = field_format($type);
        $sql = field_sql($type);
        $GLOBALS['gotten_fields'][] = array($name, $type, $input, $format, $sql, $options);
    }
    return $GLOBALS['gotten_fields'];
}