'.*', 'NUMBERS_ONLY' => '[0-9]+', 'ALPHA_ONLY' => '[\w]+', 'ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+');
$validate_options = '';
foreach ($validate_ary as $lang => $value)
{
$selected = ($this->vars['field_validation'] == $value) ? ' selected="selected"' : '';
$validate_options .= '';
}
return $validate_options;
}
/**
* Get string options for second step in ACP
*/
function get_string_options()
{
global $user;
$options = array(
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => ''),
1 => array('TITLE' => $user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''),
2 => array('TITLE' => $user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''),
3 => array('TITLE' => $user->lang['FIELD_VALIDATION'], 'FIELD' => '')
);
return $options;
}
/**
* Get text options for second step in ACP
*/
function get_text_options()
{
global $user;
$options = array(
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => ' ' . $user->lang['ROWS'] . '
' . $user->lang['COLUMNS'] . ' '),
1 => array('TITLE' => $user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''),
2 => array('TITLE' => $user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''),
3 => array('TITLE' => $user->lang['FIELD_VALIDATION'], 'FIELD' => '')
);
return $options;
}
/**
* Get int options for second step in ACP
*/
function get_int_options()
{
global $user;
$options = array(
0 => array('TITLE' => $user->lang['FIELD_LENGTH'], 'FIELD' => ''),
1 => array('TITLE' => $user->lang['MIN_FIELD_NUMBER'], 'FIELD' => ''),
2 => array('TITLE' => $user->lang['MAX_FIELD_NUMBER'], 'FIELD' => ''),
3 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => '')
);
return $options;
}
/**
* Get bool options for second step in ACP
*/
function get_bool_options()
{
global $user, $config, $lang_defs;
$default_lang_id = $lang_defs['iso'][$config['default_lang']];
$profile_row = array(
'var_name' => 'field_default_value',
'field_id' => 1,
'lang_name' => $this->vars['lang_name'],
'lang_explain' => $this->vars['lang_explain'],
'lang_id' => $default_lang_id,
'field_default_value' => $this->vars['field_default_value'],
'field_ident' => 'field_default_value',
'field_type' => FIELD_BOOL,
'field_length' => $this->vars['field_length'],
'lang_options' => $this->vars['lang_options']
);
$options = array(
0 => array('TITLE' => $user->lang['FIELD_TYPE'], 'EXPLAIN' => $user->lang['BOOL_TYPE_EXPLAIN'], 'FIELD' => ''),
1 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row))
);
return $options;
}
/**
* Get dropdown options for second step in ACP
*/
function get_dropdown_options()
{
global $user, $config, $lang_defs;
$default_lang_id = $lang_defs['iso'][$config['default_lang']];
$profile_row[0] = array(
'var_name' => 'field_default_value',
'field_id' => 1,
'lang_name' => $this->vars['lang_name'],
'lang_explain' => $this->vars['lang_explain'],
'lang_id' => $default_lang_id,
'field_default_value' => $this->vars['field_default_value'],
'field_ident' => 'field_default_value',
'field_type' => FIELD_DROPDOWN,
'lang_options' => $this->vars['lang_options']
);
$profile_row[1] = $profile_row[0];
$profile_row[1]['var_name'] = 'field_novalue';
$profile_row[1]['field_ident'] = 'field_novalue';
$profile_row[1]['field_default_value'] = $this->vars['field_novalue'];
$options = array(
0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row[0])),
1 => array('TITLE' => $user->lang['NO_VALUE_OPTION'], 'EXPLAIN' => $user->lang['NO_VALUE_OPTION_EXPLAIN'], 'FIELD' => $this->process_field_row('preview', $profile_row[1]))
);
return $options;
}
/**
* Get date options for second step in ACP
*/
function get_date_options()
{
global $user, $config, $lang_defs;
$default_lang_id = $lang_defs['iso'][$config['default_lang']];
$profile_row = array(
'var_name' => 'field_default_value',
'lang_name' => $this->vars['lang_name'],
'lang_explain' => $this->vars['lang_explain'],
'lang_id' => $default_lang_id,
'field_default_value' => $this->vars['field_default_value'],
'field_ident' => 'field_default_value',
'field_type' => FIELD_DATE,
'field_length' => $this->vars['field_length']
);
$always_now = request_var('always_now', -1);
if ($always_now == -1)
{
$s_checked = ($this->vars['field_default_value'] == 'now') ? true : false;
}
else
{
$s_checked = ($always_now) ? true : false;
}
$options = array(
0 => array('TITLE' => $user->lang['DEFAULT_VALUE'], 'FIELD' => $this->process_field_row('preview', $profile_row)),
1 => array('TITLE' => $user->lang['ALWAYS_TODAY'], 'FIELD' => ''),
);
return $options;
}
}