summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Wehner2011-11-26 11:39:24 (GMT)
committer Daniel Wehner2011-11-26 11:39:24 (GMT)
commit880c95871ae810b28adc0682dc8e44966ec286c3 (patch)
tree90dc38a194966e63222bbc7f3c64b0c834554811
parentb7bb1754d1fb80830514471c0bbad34e89340ad4 (diff)
parent0c61bd051b616cfe6967e88033ef324627eb0e0d (diff)
Merge branch '6.x-3.x' of git.drupal.org:project/views into 6.x-3.x
-rw-r--r--modules/system.views.inc2
-rw-r--r--modules/system/views_handler_argument_file_fid.inc14
2 files changed, 9 insertions, 7 deletions
diff --git a/modules/system.views.inc b/modules/system.views.inc
index fbd104f..96d55c3 100644
--- a/modules/system.views.inc
+++ b/modules/system.views.inc
@@ -53,7 +53,9 @@ function system_views_data() {
),
'argument' => array(
'handler' => 'views_handler_argument_file_fid',
+ 'parent' => 'views_handler_argument_numeric', // make sure parent is included
'name field' => 'filename', // the field to display in the summary.
+ 'numeric' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
diff --git a/modules/system/views_handler_argument_file_fid.inc b/modules/system/views_handler_argument_file_fid.inc
index 755e0a3..e5939c8 100644
--- a/modules/system/views_handler_argument_file_fid.inc
+++ b/modules/system/views_handler_argument_file_fid.inc
@@ -2,16 +2,16 @@
/**
* Argument handler to accept a file id.
*/
-class views_handler_argument_file_fid extends views_handler_argument {
+class views_handler_argument_file_fid extends views_handler_argument_numeric {
/**
* Override the behavior of title(). Get the title of the file.
*/
- function title() {
- $title = db_result(db_query(db_rewrite_sql("SELECT f.filename FROM {files} f WHERE f.fid = %d", $this->argument)));
- if (empty($title)) {
- return t('No title');
+ function title_query() {
+ $titles = array();
+ $result = db_query(db_rewrite_sql('SELECT f.fid, f.filename FROM {files} f WHERE f.fid IN (' . db_placeholders($this->value, 'int') . ')', 'f', 'fid'), $this->value);
+ while ($file = db_fetch_object($result)) {
+ $titles[] = check_plain($file->filename);
}
-
- return check_plain($title);
+ return $titles;
}
}