summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/blog.page_title.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/blog.page_title.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/blog.page_title.inc50
1 files changed, 50 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/blog.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/blog.page_title.inc
new file mode 100644
index 0000000..dd6ed50
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/blog.page_title.inc
@@ -0,0 +1,50 @@
+<?php
+
+/**
+ * @file
+ * Blog implementations of the page title hooks
+ */
+
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function blog_page_title_alter(&$title) {
+ $menu_item = menu_get_item();
+
+ // If we're looking at a users blog page, get the user title
+ if (!strncmp($menu_item['path'], 'blog/%', 6) && ($user = menu_get_object('user_uid_optional'))) {
+ if (variable_get('page_title_blog_showfield', 0) && ($blog_title = page_title_load_title(arg(1), 'user'))) {
+ $title = $blog_title;
+ }
+ }
+}
+
+
+/**
+ * Implements hook_page_title_pattern_alter().
+ */
+function blog_page_title_pattern_alter(&$pattern, &$types) {
+ $menu_item = menu_get_item();
+
+ if (!strncmp($menu_item['path'], 'blog/%', 6) && ($user = menu_get_object('user_uid_optional'))) {
+ $types['user'] = $user;
+ $pattern = variable_get('page_title_blog', '');
+ }
+}
+
+
+/**
+ * Implements hook_page_title_settings().
+ */
+function blog_page_title_settings() {
+ return array(
+ 'page_title_blog' => array(
+ 'label' => 'Blog Homepage',
+ 'scopes' => array('global', 'user'),
+ 'show field' => FALSE,
+ 'description' => 'This pattern will be used for a users blog page (ie <code>/blog/1</code>)',
+ ),
+ );
+}
+