source: sipes/modules_contrib/views/handlers/views_handler_field_custom.inc @ 59029b2

stableversion-3.0
Last change on this file since 59029b2 was 177a560, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio de modulos contribuidos de drupal

  • Propiedad mode establecida a 100644
File size: 990 octetos
Línea 
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 */
8class 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    $options['hide_alter_empty'] = array('default' => FALSE);
19    return $options;
20  }
21
22  function options_form(&$form, &$form_state) {
23    parent::options_form($form, $form_state);
24
25    // Remove the checkbox
26    unset($form['alter']['alter_text']);
27    unset($form['alter']['text']['#dependency']);
28    unset($form['alter']['text']['#process']);
29  }
30
31  function render($values) {
32    // Return the text, so the code never thinks the value is empty.
33    return $this->options['alter']['text'];
34  }
35}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.