Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Form for update Indicators data.
- */
- function atico_countrysheets_update_data($form_state) {
- if (isset($_GET['code'])) {
- $code = filter_xss($_GET['code']);
- if (_atico_countrysheets_exist_indicator($code)) {
- $query_indica = db_select('atico_countrysheets', 't')
- ->fields('t')
- ->condition('code', $code, '=')
- ->execute()
- ->fetch();
- $form['name'] = array(
- '#type' => 'textfield',
- '#title' => t('Name'),
- '#description' => t('Name of the indicator. (Max length: 500 characters)'),
- '#size' => 100,
- '#default_value' => $query_indica->name,
- '#maxlength' => 500,
- );
- $form['shortname'] = array(
- '#type' => 'textfield',
- '#title' => t('Short Name'),
- '#description' => t('Short name of the indicator. This name will be used in filters and tables where there is limited space. (Max length: 100 characters)'),
- '#size' => 100,
- '#default_value' => $query_indica->shortname,
- '#maxlength' => 100,
- );
- $form['definition'] = array(
- '#type' => 'textarea',
- '#title' => t('Definition'),
- '#description' => t('Definition of indicator. (Max length: 1500 characters)'),
- '#rows' => 5,
- '#cols' => 5,
- '#default_value' => $query_indica->definition,
- '#maxlength' => 1500,
- );
- $form['notes'] = array(
- '#type' => 'textarea',
- '#title' => t('Notes'),
- '#description' => t('Important notes or relevant information regarding the indicator. (Max length: 1500 characters)'),
- '#rows' => 5,
- '#cols' => 5,
- '#default_value' => $query_indica->notes,
- '#maxlength' => 1500,
- );
- $form['unit_value'] = array(
- '#type' => 'textfield',
- '#title' => t('Value unit'),
- '#description' => t('Unit of the indicator. (Max length: 200 characters)'),
- '#size' => 100,
- '#default_value' => $query_indica->unit_value,
- '#maxlength' => 200,
- );
- $form['unit_change'] = array(
- '#type' => 'textfield',
- '#title' => t('Change unit'),
- '#description' => t('Unit for the variation calculations for this indicator. In most cases it is absolute, relative or average annual percentage change. (Max length: 200 characters)'),
- '#size' => 100,
- '#default_value' => $query_indica->unit_change,
- '#maxlength' => 200,
- );
- $form['link'] = array(
- '#type' => 'textfield',
- '#title' => t('External Link'),
- '#description' => t('Link for additional information. (Max length: 200 characters)'),
- '#size' => 100,
- '#default_value' => $query_indica->link,
- '#maxlength' => 200,
- );
- $form['source'] = array(
- '#type' => 'textfield',
- '#title' => t('Source'),
- '#description' => t('Source of the indicator. Only informative. (Max length: 200 characters)'),
- '#size' => 100,
- '#default_value' => $query_indica->source,
- '#maxlength' => 200,
- );
- $form['display_vs'] = array(
- '#type' => 'textfield',
- '#title' => t('Base year for comparison'),
- '#description' => t('This value must be a year that is available in the time series. If not, the value will be automatically set to 2005. (Max length: 50 characters)'),
- '#size' => 100,
- '#default_value' => $query_indica->display_vs,
- '#maxlength' => 50,
- );
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Submit'),
- );
- return $form;
- }
- }
- drupal_goto('atico_countrysheets/administrator');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement