/[drupal]/contributions/modules/views/handlers/views_handler_field_custom.inc
ViewVC logotype

Contents of /contributions/modules/views/handlers/views_handler_field_custom.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Fri Jan 30 00:01:41 2009 UTC (9 months, 4 weeks ago) by merlinofchaos
Branch: MAIN
CVS Tags: DRUPAL-6--2-7, DRUPAL-6--2-6, DRUPAL-6--2-5, DRUPAL-6--2-4, DRUPAL-6--2-3, DRUPAL-6--3-0-ALPHA1, HEAD
Branch point for: DRUPAL-6--2, DRUPAL-6--3, DRUPAL-7--3
File MIME type: text/x-php
#349178 by agentrickard: Add generic link handling plus a custom text field. Also automatic trimming.
1 <?php
2 // $Id: views_handler_field_boolean.inc,v 1.1 2008/09/03 19:21:28 merlinofchaos Exp $
3
4 /**
5 * A handler to provide a field that is completely custom by the administrator.
6 *
7 * @ingroup views_field_handlers
8 */
9 class views_handler_field_custom extends views_handler_field {
10 function query() {
11 // do nothing -- to override the parent query.
12 }
13
14 function option_definition() {
15 $options = parent::option_definition();
16
17 // Override the alter text option to always alter the text.
18 $options['alter']['contains']['alter_text'] = array('default' => TRUE);
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 // Nothing to render.
33 return '';
34 }
35 }

  ViewVC Help
Powered by ViewVC 1.1.2