summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.tokens.inc
diff options
context:
space:
mode:
authorTorsten Grote <grote@kolabsys.com>2012-08-15 15:01:04 (GMT)
committerTorsten Grote <grote@kolabsys.com>2012-08-15 15:01:04 (GMT)
commitde878a90f9e1d7d37263f1391aeffc23138ec4c9 (patch)
treea6165318e65a2da04fbd2919aaf6ea01702a95c9 /kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.tokens.inc
parentbd3d35cc30c2f3fb730f2bdca82d8fb6d59a3369 (diff)
downloadkolab.org-www-de878a90f9e1d7d37263f1391aeffc23138ec4c9.tar.gz
added page_title module
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.tokens.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.tokens.inc38
1 files changed, 38 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.tokens.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.tokens.inc
new file mode 100644
index 0000000..51970bc
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.tokens.inc
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @file
+ * Builds placeholder replacement tokens for page titles.
+ */
+
+/**
+ * Implements hook_token_info().
+ */
+function page_title_token_info() {
+ $info['tokens']['current-page']['page-title'] = array(
+ 'name' => t('Page Title'),
+ 'description' => t('The title of the current page, as processed by the Page Title module.'),
+ );
+
+ return $info;
+}
+
+/**
+ * Implements hook_token_values().
+ */
+function page_title_tokens($type, $tokens, array $data = array(), array $options = array()) {
+ $replacements = array();
+ $sanitize = !empty($options['sanitize']);
+
+ if ($type == 'current-page') {
+ foreach ($tokens as $name => $original) {
+ switch ($name) {
+ case 'page-title':
+ $replacements[$original] = page_title_get_title(!$sanitize);
+ break;
+ }
+ }
+ }
+
+ return $replacements;
+}