You are here

function views_customfield_views_tables in Views Custom Field 5

Implementation of hook_views_tables()

Return value

array

File

./views_customfield.module, line 8

Code

function views_customfield_views_tables() {
  $tables['views_customfield'] = array(
    'fields' => array(
      'text' => array(
        'name' => t('Customfield: PHP code'),
        'help' => t('Display row-specific custom text using PHP.'),
        'sortable' => FALSE,
        'notafield' => TRUE,
        'handler' => 'views_customfield_handler_field_phpcode',
        /**
         * @see http://drupal.org/node/99792#option (complex option fields)
         */
        'option' => array(
          'value' => array(
            '#type' => 'textarea',
            '#title' => t('Value'),
            '#description' => t('The text that should be displayed.') . ' ' . t('Include &lt;?php ?&gt; delimiters when using PHP code.') . ' ' . t('Available variables:') . '<br/>' . t('$data: contains the retrieved record from the database (e.g. $data->nid).') . '<br/>' . t('$static: can be used to store reusable data per row.'),
            '#rows' => 5,
          ),
          '#type' => 'views_customfield_option',
          '#process' => array(
            '_views_customfield_option_process' => array(),
          ),
          '#after_build' => array(
            '_views_customfield_option_after_build',
          ),
        ),
      ),
      'rownumber' => array(
        'name' => t('Customfield: Rownumber'),
        'help' => t('Display rownumber.'),
        'sortable' => FALSE,
        'notafield' => TRUE,
        'handler' => 'views_customfield_handler_field_rownumber',
        'option' => 'string',
      ),
    ),
  );
  if (module_exists('validator_phpcode')) {
    $tables['views_customfield']['fields']['text']['validate'] = 'views_customfield_handler_field_phpcode_validate';
  }
  return $tables;
}