| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: views_handler_field_url.inc,v 1.1.4.1 2010/06/17 02:46:52 merlinofchaos Exp $ 3 4 /** 5 * Field handler to provide simple renderer that turns a URL into a clickable link. 6 * 7 * @ingroup views_field_handlers 8 */ 9 class views_handler_field_url extends views_handler_field { 10 function option_definition() { 11 $options = parent::option_definition(); 12 13 $options['display_as_link'] = array('default' => TRUE); 14 15 return $options; 16 } 17 18 /** 19 * Provide link to the page being visited. 20 */ 21 function options_form(&$form, &$form_state) { 22 parent::options_form($form, $form_state); 23 $form['display_as_link'] = array( 24 '#title' => t('Display as link'), 25 '#type' => 'checkbox', 26 '#default_value' => !empty($this->options['display_as_link']), 27 ); 28 } 29 30 function render($values) { 31 $value = $values->{$this->field_alias}; 32 if (!empty($this->options['display_as_link'])) { 33 return l(check_plain($value), $value, array('html' => TRUE)); 34 } 35 else { 36 return check_url($value); 37 } 38 } 39 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |