summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2012-08-14 13:29:52 (GMT)
committerTorsten Grote <grote@kolabsys.com>2012-08-14 13:29:52 (GMT)
commit8a7a4f8e58df35a10fda833a9904eb8fd961a1ca (patch)
tree35e2f907372d637f76c0e3c3ac1c0f27f2dc1391 /kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc
parent146e20fc2d0941a6783641f26b3ea074dc03fc84 (diff)
downloadkolab.org-www-8a7a4f8e58df35a10fda833a9904eb8fd961a1ca.tar.gz
upgrade to drupal 7.15
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc21
1 files changed, 21 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc
new file mode 100644
index 0000000..b91b08f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Argument handler to accept a vocabulary machine name.
+ *
+ * @ingroup views_argument_handlers
+ */
+class views_handler_argument_vocabulary_machine_name extends views_handler_argument_string {
+ /**
+ * Override the behavior of title(). Get the name of the vocabulary..
+ */
+ function title() {
+ $title = db_query("SELECT v.name FROM {taxonomy_vocabulary} v WHERE v.machine_name = :machine_name", array(':machine_name' => $this->argument))->fetchField();
+
+ if (empty($title)) {
+ return t('No vocabulary');
+ }
+
+ return check_plain($title);
+ }
+}