Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.71 KB | None | 0 0
  1. /**
  2.  * Form for update Indicators data.
  3.  */
  4. function atico_countrysheets_update_data($form_state) {
  5.   if (isset($_GET['code'])) {
  6.     $code = filter_xss($_GET['code']);
  7.     if (_atico_countrysheets_exist_indicator($code)) {
  8.       $query_indica = db_select('atico_countrysheets', 't')
  9.                 ->fields('t')
  10.                 ->condition('code', $code, '=')
  11.                 ->execute()
  12.                 ->fetch();
  13.       $form['name'] = array(
  14.         '#type' => 'textfield',
  15.         '#title' => t('Name'),
  16.         '#description' => t('Name of the indicator. (Max length: 500 characters)'),
  17.         '#size' => 100,
  18.         '#default_value' => $query_indica->name,
  19.         '#maxlength' => 500,
  20.       );
  21.       $form['shortname'] = array(
  22.         '#type' => 'textfield',
  23.         '#title' => t('Short Name'),
  24.         '#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)'),
  25.         '#size' => 100,
  26.         '#default_value' => $query_indica->shortname,
  27.         '#maxlength' => 100,
  28.       );
  29.       $form['definition'] = array(
  30.         '#type' => 'textarea',
  31.         '#title' => t('Definition'),
  32.         '#description' => t('Definition of indicator. (Max length: 1500 characters)'),
  33.         '#rows' => 5,
  34.         '#cols' => 5,
  35.         '#default_value' => $query_indica->definition,
  36.         '#maxlength' => 1500,
  37.       );
  38.       $form['notes'] = array(
  39.         '#type' => 'textarea',
  40.         '#title' => t('Notes'),
  41.         '#description' => t('Important notes or relevant information regarding the indicator. (Max length: 1500 characters)'),
  42.         '#rows' => 5,
  43.         '#cols' => 5,
  44.         '#default_value' => $query_indica->notes,
  45.         '#maxlength' => 1500,
  46.       );
  47.       $form['unit_value'] = array(
  48.         '#type' => 'textfield',
  49.         '#title' => t('Value unit'),
  50.         '#description' => t('Unit of the indicator. (Max length: 200 characters)'),
  51.         '#size' => 100,
  52.         '#default_value' => $query_indica->unit_value,
  53.         '#maxlength' => 200,
  54.       );
  55.       $form['unit_change'] = array(
  56.         '#type' => 'textfield',
  57.         '#title' => t('Change unit'),
  58.         '#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)'),
  59.         '#size' => 100,
  60.         '#default_value' => $query_indica->unit_change,
  61.         '#maxlength' => 200,
  62.       );
  63.       $form['link'] = array(
  64.         '#type' => 'textfield',
  65.         '#title' => t('External Link'),
  66.         '#description' => t('Link for additional information. (Max length: 200 characters)'),
  67.         '#size' => 100,
  68.         '#default_value' => $query_indica->link,
  69.         '#maxlength' => 200,
  70.       );
  71.       $form['source'] = array(
  72.         '#type' => 'textfield',
  73.         '#title' => t('Source'),
  74.         '#description' => t('Source of the indicator. Only informative. (Max length: 200 characters)'),
  75.         '#size' => 100,
  76.         '#default_value' => $query_indica->source,
  77.         '#maxlength' => 200,
  78.       );
  79.       $form['display_vs'] = array(
  80.         '#type' => 'textfield',
  81.         '#title' => t('Base year for comparison'),
  82.         '#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)'),
  83.         '#size' => 100,
  84.         '#default_value' => $query_indica->display_vs,
  85.         '#maxlength' => 50,
  86.       );
  87.       $form['submit'] = array(
  88.         '#type' => 'submit',
  89.         '#value' => t('Submit'),
  90.       );
  91.       return $form;
  92.     }
  93.   }
  94.   drupal_goto('atico_countrysheets/administrator');
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement