Implement program parameter management

This commit is contained in:
Eike Foken
2011-08-18 04:16:43 +02:00
parent 2903b367f1
commit c373296953
8 changed files with 343 additions and 42 deletions

View File

@@ -36,6 +36,44 @@ $config['auth/forgot_password'] = array(
),
);
/**
* Rules for the settings page.
*
* @var array
*/
$config['auth/settings'] = array(
array(
'field' => 'firstname',
'label' => _('First name'),
'rules' => 'required|max_length[50]|trim',
),
array(
'field' => 'lastname',
'label' => _('Last name'),
'rules' => 'required|max_length[50]|trim',
),
array(
'field' => 'email',
'label' => _('Email address'),
'rules' => 'required|valid_email|trim',
),
array(
'field' => 'institution',
'label' => _('Institution'),
'rules' => 'max_length[100]|trim',
),
array(
'field' => 'phone',
'label' => _('Phone number'),
'rules' => 'regex_match[/^\+\d{2,4}\s\d{2,4}\s\d{3,10}+$/i]|trim',
),
array(
'field' => 'new_password',
'label' => _('New password'),
'rules' => 'min_length[6]|matches[new_password_confirm]',
),
);
/**
* Rules for creating users.
*
@@ -131,40 +169,35 @@ $config['programs/edit'] = array(
);
/**
* Rules for the settings page.
* Rules for creating parameters.
*
* @var array
*/
$config['auth/settings'] = array(
$config['parameters/create'] = array(
array(
'field' => 'firstname',
'label' => _('First name'),
'rules' => 'required|max_length[50]|trim',
'field' => 'name',
'label' => _('Name'),
'rules' => 'required|max_length[255]|trim',
),
array(
'field' => 'lastname',
'label' => _('Last name'),
'rules' => 'required|max_length[50]|trim',
'field' => 'readable',
'label' => _('Human-readable name'),
'rules' => 'required|max_length[100]|trim',
),
array(
'field' => 'email',
'label' => _('Email address'),
'rules' => 'required|valid_email|trim',
'field' => 'unit',
'label' => _('Name'),
'rules' => 'max_length[20]|trim',
),
array(
'field' => 'institution',
'label' => _('Institution'),
'rules' => 'max_length[100]|trim',
'field' => 'default_value',
'label' => _('Default value'),
'rules' => 'max_length[255]|trim',
),
array(
'field' => 'phone',
'label' => _('Phone number'),
'rules' => 'regex_match[/^\+\d{2,4}\s\d{2,4}\s\d{3,10}+$/i]|trim',
),
array(
'field' => 'new_password',
'label' => _('New password'),
'rules' => 'min_length[6]|matches[new_password_confirm]',
'field' => 'type',
'label' => _('Type'),
'rules' => 'required|max_length[20]|trim',
),
);