~spreadubuntu/spreadubuntu/devel-drupal6

« back to all changes in this revision

Viewing changes to modules/views/modules/system/views_handler_argument_file_fid.inc

  • Committer: ruben
  • Date: 2009-06-08 09:38:49 UTC
  • Revision ID: ruben@captive-20090608093849-s1qtsyctv2vwp1x1
SpreadUbuntu moving to Drupal6. Based on ubuntu-drupal theme and adding our modules

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
// $Id: views_handler_argument_file_fid.inc,v 1.1 2008/09/03 19:21:30 merlinofchaos Exp $
 
3
/**
 
4
 * Argument handler to accept a file id.
 
5
 */
 
6
class views_handler_argument_file_fid extends views_handler_argument {
 
7
  /**
 
8
   * Override the behavior of title(). Get the title of the file.
 
9
   */
 
10
  function title() {
 
11
    $title = db_result(db_query(db_rewrite_sql("SELECT f.filename FROM {files} f WHERE f.fid = %d", $this->argument)));
 
12
    if (empty($title)) {
 
13
      return t('No title');
 
14
    }
 
15
 
 
16
    return check_plain($title);
 
17
  }
 
18
}