• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

modules/statistics/views_handler_field_accesslog_path.inc

00001 <?php
00007 class views_handler_field_accesslog_path extends views_handler_field {
00011   function init(&$view, &$options) {
00012     parent::init($view, $options);
00013     if (!empty($this->options['display_as_link'])) {
00014       $this->additional_fields['path'] = 'path';
00015     }
00016   }
00017 
00018   function option_definition() {
00019     $options = parent::option_definition();
00020 
00021     $options['display_as_link'] = array('default' => TRUE);
00022 
00023     return $options;
00024   }
00025 
00029   function options_form(&$form, &$form_state) {
00030     $form['display_as_link'] = array(
00031       '#title' => t('Display as link'),
00032       '#type' => 'checkbox',
00033       '#default_value' => !empty($this->options['display_as_link']),
00034     );
00035     parent::options_form($form, $form_state);
00036   }
00037 
00038   function render($values) {
00039     $value = $this->get_value($values);
00040     return $this->render_link($this->sanitize_value($value), $values);
00041   }
00042 
00043   function render_link($data, $values) {
00044     if (!empty($this->options['display_as_link'])) {
00045       $this->options['alter']['make_link'] = TRUE;
00046       $this->options['alter']['path'] = $this->get_value($values, 'path');
00047       $this->options['alter']['html'] = TRUE;
00048     }
00049 
00050     return $data;
00051   }
00052 }

Generated on Sun Feb 26 2012 12:52:51 for Views by  doxygen 1.7.1