image_gallery_handler_field_gallery_cover_latest_time.inc in Image 6        
                          
                  
                        
  
  
  
File
  contrib/image_gallery/views/image_gallery_handler_field_gallery_cover_latest_time.inc
  
    View source  
  <?php
class image_gallery_handler_field_gallery_cover_latest_time extends image_gallery_handler_field_gallery_cover {
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    
    $form['descendants']['#description'] = theme('advanced_help_topic', 'image_gallery', 'descendants') . t('Whether to only consider this gallery itself, or consider subgalleries all together, or recurse into subgalleries if the gallery itself is empty.');
    $form['descendants']['#options'] = array(
      'single' => t('Only get latest time from this gallery'),
      'flat' => t('Consider subgalleries, flattened.'),
      'recurse' => t('Consider subgalleries, recursively. (Warning: this can produce many queries per row if your parent galleries are empty!).'),
    );
  }
  
  function render($values) {
    $nid = $this
      ->get_cover_node_nid($values);
    
    static $original_label;
    if (!isset($original_label)) {
      $original_label = $this->options['label'];
    }
    if (isset($nid)) {
      $this->options['label'] = $original_label;
      $latest_node = node_load($nid);
      $output = theme('image_gallery_updated', $latest_node->changed);
      return $this
        ->render_link($output, $values);
    }
    else {
      $this->options['label'] = '';
    }
  }
}