[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/views/handlers/ -> views_handler_field_custom.inc (source)

   1  <?php
   2  
   3  /**
   4   * A handler to provide a field that is completely custom by the administrator.
   5   *
   6   * @ingroup views_field_handlers
   7   */
   8  class views_handler_field_custom extends views_handler_field {
   9    function query() {
  10      // do nothing -- to override the parent query.
  11    }
  12  
  13    function option_definition() {
  14      $options = parent::option_definition();
  15  
  16      // Override the alter text option to always alter the text.
  17      $options['alter']['contains']['alter_text'] = array('default' => TRUE);
  18      return $options;
  19    }
  20  
  21    function options_form(&$form, &$form_state) {
  22      parent::options_form($form, $form_state);
  23  
  24      // Remove the checkbox
  25      unset($form['alter']['alter_text']);
  26      unset($form['alter']['text']['#dependency']);
  27      unset($form['alter']['text']['#process']);
  28    }
  29  
  30    function render($values) {
  31      // Return the text, so the code never thinks the value is empty.
  32      return $this->options['alter']['text'];
  33    }
  34  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7