summaryrefslogtreecommitdiff
path: root/kolab.org
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
parentbd3d35cc30c2f3fb730f2bdca82d8fb6d59a3369 (diff)
downloadkolab.org-www-de878a90f9e1d7d37263f1391aeffc23138ec4c9.tar.gz
added page_title module
Diffstat (limited to 'kolab.org')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/CHANGELOG.txt16
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/LICENSE.txt339
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/README.txt50
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/blog.page_title.inc50
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/comment.page_title.inc82
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/forum.page_title.inc63
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/node.page_title.inc85
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/page_title.page_title.inc68
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/taxonomy.page_title.inc58
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/uc_catalog.page_title.inc70
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/user.page_title.inc45
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/views.page_title.inc53
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title-admin-settings-form.tpl.php42
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.admin.inc73
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.info19
-rwxr-xr-xkolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.install128
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.js39
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.module917
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.test193
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.tokens.inc38
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.views.inc72
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.views_default.inc209
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/views/plugins/page_title_plugin_display_page_with_page_title.inc70
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/page_title/views_handler_field_node_page_title.inc96
24 files changed, 2875 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/CHANGELOG.txt b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/CHANGELOG.txt
new file mode 100644
index 0000000..3acdd17
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/CHANGELOG.txt
@@ -0,0 +1,16 @@
+Page Title 5.x-2.0
+ #119016: Added ability to hide the Page title text box based on content type.
+ #101310: Integrated Token module
+ #165483: Terms in title now possible due to Token module integration
+ #158110: Added ability to set different token patterns for each enabled content type.
+
+
+Page Title 5.x-1.1
+ * Added Russian translation by SadhooKlay.
+ * Removed inaccurate package description from .info file.
+ * Added ability to uninstall module.
+ * Increased length of page title to 255 characters for MySQL users.
+ #158104: Updated MySQL tables to use the system default table type instead of always using MyISAM.
+
+Page Title 5.x-1.0
+ * Initial release.
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/LICENSE.txt b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/LICENSE.txt
new file mode 100644
index 0000000..d159169
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/LICENSE.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/README.txt b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/README.txt
new file mode 100644
index 0000000..2c90088
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/README.txt
@@ -0,0 +1,50 @@
+********************************************************************
+ P A G E T I T L E M O D U L E
+********************************************************************
+Original Author: Robert Douglass
+Current Maintainers: Nicholas Thompson and John Wilkins
+
+********************************************************************
+DESCRIPTION:
+
+ This module gives you control over the page title. It gives you the chance
+ to provide patterns for how the title should be structured, and on node
+ pages, gives you the chance to specify the page title rather than defaulting
+ to the node title.
+
+********************************************************************
+PERMISSIONS:
+
+ This module defines the "set page title" and "administer page titles"
+ permissions. The "set page title" permission determines whether a user will
+ be able to edit the "Page title" field on node edit forms (if visible.) The
+ "administer page titles" permission determines whether a user will be able to
+ edit the "Page title" administration pages.
+
+********************************************************************
+INSTALLATION:
+
+1. Place the entire page_title directory into your Drupal modules/
+ directory or the sites modules directory (eg site/default/modules)
+
+
+2. Enable this module by navigating to:
+
+ Administration > Modules
+
+ At this point the Drupal install system will attempt to create the database
+ table page_title. You should see a message confirming success or
+ proclaiming failure. If the database table creation did not succeed,
+ you will need to manually add the following table definition to your
+ database:
+
+ CREATE TABLE `page_title` (
+ `type` varchar(15) NOT NULL default 'node',
+ `id` int(10) unsigned NOT NULL default '0',
+ `page_title` varchar(255) NOT NULL default '',
+ PRIMARY KEY (`type`,`id`)
+ );
+
+3. Optionally configure the two variations of page title by visiting:
+
+ Administration > Configuration > Search and metadata
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>)',
+ ),
+ );
+}
+
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/comment.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/comment.page_title.inc
new file mode 100644
index 0000000..20846fd
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/comment.page_title.inc
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * @file
+ * Comment implementations of the page title hooks
+ */
+
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function comment_page_title_alter(&$title) {
+ // Get the current menu item and compare the path to the comment reply path.
+ $menu_item = menu_get_item();
+ if ( !strncmp($menu_item['path'], 'comment/reply/%', 15) &&
+ ($node = menu_get_object('node', 2)) ) {
+ // If the node has a custom page title and the node type is configured
+ // to have a custom page title (ie, it's not a leftover from a previous
+ // setting), then use it.
+ if ( !empty($node->page_title) &&
+ variable_get('page_title_type_' . $node->type . '_showfield', 0) ) {
+ $title = $node->page_title;
+ }
+ // Otherwise set the page-title token to the parent node title. Makes more
+ // sense than "Reply to comment".
+ else {
+ $title = $node->title;
+ }
+ }
+}
+
+
+/**
+ * Implements hook_page_title_pattern_alter().
+ */
+function comment_page_title_pattern_alter(&$pattern, &$types) {
+ $menu_item = menu_get_item();
+
+ // Comment reply page.
+ if ( !strncmp($menu_item['path'], 'comment/reply/%', 15) &&
+ ($node = menu_get_object('node', 2)) ) {
+ // The node ID position is in arg 2.
+ $types['node'] = $node;
+
+ // If the node has any taxonomy, grab the first time and pass it over to be
+ // passed as a token.
+ // TODO: Handle multiple terms? Only pass specific terms per content type?
+ if (!empty($types['node']->taxonomy)) {
+ reset($types['node']->taxonomy);
+ $types['taxonomy'] = current($types['node']->taxonomy);
+ }
+
+ if (is_numeric(arg(3)) && ($comment = menu_get_object('comment', 3))) {
+ // Comment Reply...
+ $types['comment'] = $comment;
+ $pattern = variable_get('page_title_comment_child_reply', '');
+ }
+ else {
+ // Reply to node...
+ $pattern = variable_get('page_title_comment_reply', '');
+ }
+ }
+}
+
+
+/**
+ * Implements hook_page_title_settings().
+ */
+function comment_page_title_settings() {
+ return array(
+ 'page_title_comment_reply' => array(
+ 'label' => 'Comment Reply',
+ 'scopes' => array('global', 'node'),
+ 'description' => 'This pattern will be used for comment reply pages, where the reply is directly to a "node"',
+ ),
+ 'page_title_comment_child_reply' => array(
+ 'label' => 'Comment Child Reply',
+ 'scopes' => array('global', 'comment', 'node'),
+ 'description' => 'This pattern with be used for comment reply pages where the reply is to an existing "comment" (eg a comment thread)',
+ ),
+ );
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/forum.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/forum.page_title.inc
new file mode 100644
index 0000000..b69d168
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/forum.page_title.inc
@@ -0,0 +1,63 @@
+<?php
+
+/**
+ * @file
+ * Forum implementations of the page title hooks
+ */
+
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function forum_page_title_alter(&$title) {
+ $menu_item = menu_get_item();
+ // Check we're on a forum page and if there is a number to confirm it's a
+ // container or forum (rather than root).
+ if ( !strncmp($menu_item['path'], 'forum/%', 7) &&
+ ($term = menu_get_object('taxonomy_term')) &&
+ variable_get('page_title_vocab_' . $term->vocabulary_machine_name . '_showfield', 0) &&
+ ($forum_title = page_title_load_title($term->tid, 'term')) ) {
+ $title = $forum_title;
+ }
+}
+
+
+/**
+ * Implements hook_page_title_pattern_alter().
+ */
+function forum_page_title_pattern_alter(&$pattern, &$types) {
+ $menu_item = menu_get_item();
+
+ // Forums Page title Patterns
+ if ( !strncmp($menu_item['path'], 'forum/%', 7) &&
+ ($forum = menu_get_object('forum_forum', 1)) ) {
+ $types['term'] = $forum;
+
+ $forum_vid = variable_get('forum_nav_vocabulary', '');
+ $forum_vocab = taxonomy_vocabulary_load($forum_vid);
+ $pattern = variable_get('page_title_vocab_' . $forum_vocab->machine_name, '');
+
+ $types['vocabulary'] = $forum_vocab;
+ }
+ // Otherwise it's the root - let's grab the root pattern.
+ elseif ($menu_item['path'] == 'forum') {
+ $pattern = variable_get('page_title_forum_root_title', '');
+ $forum_vid = variable_get('forum_nav_vocabulary', 0);
+ $types['vocabulary'] = taxonomy_vocabulary_load($forum_vid);
+ }
+}
+
+
+/**
+ * Implements hook_page_title_settings().
+ */
+function forum_page_title_settings() {
+ return array(
+ 'page_title_forum_root_title' => array(
+ 'label' => 'Forum Root',
+ 'scopes' => array('global'),
+ 'show field' => FALSE,
+ 'description' => 'This pattern will be used on the forum root page (ie <code>/forum</code>)',
+ ),
+ );
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/node.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/node.page_title.inc
new file mode 100644
index 0000000..a94d3a5
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/node.page_title.inc
@@ -0,0 +1,85 @@
+<?php
+
+/**
+ * @file
+ * Node implementations of the page title hooks
+ */
+
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function node_page_title_alter(&$title) {
+ $menu_item = menu_get_item();
+ // Test if this is a node page.
+ if ( !strncmp($menu_item['path'], 'node/%', 6) &&
+ ($node = menu_get_object()) &&
+ !empty($node->page_title) &&
+ variable_get('page_title_type_' . $node->type . '_showfield', 0)) {
+ // If the node has a custom page title and the node type is configured
+ // to have a custom page title (ie, it's not a leftover from a previous
+ // setting), then use it.
+ $title = $node->page_title;
+ }
+}
+
+
+/**
+ * Implements hook_page_title_pattern_alter().
+ */
+function node_page_title_pattern_alter(&$pattern, &$types) {
+ $menu_item = menu_get_item();
+ // Test if this is a node page.
+ if ( !strncmp($menu_item['path'], 'node/%', 6) &&
+ $node = menu_get_object() ) {
+ $types['node'] = $node;
+
+ // If the node has any taxonomy, grab the first term for use in tokens.
+ // TODO: Handle multiple terms? Only pass specific terms per content type?
+ // In Drupal 7, terms are no longer in $node->taxomomy. We need to grab all
+ // taxonomy_term_reference fields for this bundle and attach them.
+ // TODO: Should this be in page_title.taxonomy.inc?!
+ $fields = field_info_fields();
+ foreach ($fields as $field_name => $field) {
+ if ( $field['type'] == 'taxonomy_term_reference' &&
+ !empty($field['bundles']['node']) &&
+ in_array($node->type, $field['bundles']['node']) &&
+ isset($node->{$field_name}[$node->language][0]) ) {
+ // Get the term instance.
+ $instance = $node->{$field_name}[$node->language][0];
+ if (isset($instance['taxonomy_term'])) {
+ $types['term'] = $instance['taxonomy_term'];
+ break;
+ }
+ elseif (isset($instance['tid'])) {
+ $types['term'] = taxonomy_term_load($instance['tid']);
+ break;
+ }
+ }
+ }
+
+ $pattern = variable_get('page_title_type_' . $types['node']->type, '');
+ }
+}
+
+
+/**
+ * Implements hook_page_title_settings().
+ */
+function node_page_title_settings() {
+ $settings = array();
+
+ $types = node_type_get_types();
+ foreach ($types as $type) {
+ $settings['page_title_type_' . $type->type] = array(
+ 'label' => 'Content Type - %type',
+ 'label arguments' => array('%type' => $type->name),
+ 'scopes' => array('global', 'node', 'term', 'vocabulary'),
+ 'show field' => TRUE,
+ 'description' => 'This pattern will be used for all %type node-type pages',
+ 'description arguments' => array('%type' => $type->name),
+ );
+ }
+
+ return $settings;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/page_title.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/page_title.page_title.inc
new file mode 100644
index 0000000..b6034a9
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/page_title.page_title.inc
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * @file
+ * Page Title implementations of the page title hooks
+ */
+
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function page_title_page_title_alter(&$title) {
+ // If nothing above set a title, give the legacy function a chance to act
+ if (empty($title)) {
+ $title = page_title_set_title();
+ }
+
+ // If we still have no title, fall back to the title provided by Drupal Core
+ if (empty($title)) {
+ $title = strip_tags(drupal_get_title());
+ }
+}
+
+
+/**
+ * Implements hook_page_title_pattern_alter().
+ */
+function page_title_page_title_pattern_alter(&$pattern, &$types) {
+ // If frontpage, then use the frontpage pattern and set the title.
+ if (drupal_is_front_page()) {
+ // Get the frontpage pattern
+ $settings = page_title_get_settings();
+ $pattern = variable_get('page_title_front', $settings['page_title_front']['default']);
+ }
+}
+
+
+/**
+ * Implements hook_page_title_settings().
+ */
+function page_title_page_title_settings() {
+ return array(
+ 'page_title_default' => array(
+ 'label' => 'Default',
+ 'scopes' => array('global'),
+ 'required' => TRUE,
+ 'show field' => FALSE,
+ 'description' => 'This pattern will be used as a <em>fallback</em> (ie, when no other pattern is defined)',
+ 'weight' => -50,
+ 'default' => '[current-page:page-title] | [site:name]',
+ ),
+ 'page_title_front' => array(
+ 'label' => 'Frontpage',
+ 'scopes' => array('global'),
+ 'show field' => FALSE,
+ 'description' => 'This pattern will be used for the site frontpage',
+ 'weight' => -49,
+ 'default' => '[site:name] | [site:slogan]',
+ ),
+ 'page_title_pager_pattern' => array(
+ 'label' => 'Pager Suffix',
+ 'scopes' => array('global'),
+ 'show field' => FALSE,
+ 'description' => 'This pattern will be appended to a page title for any given page with a pager on it',
+ 'weight' => -48,
+ ),
+ );
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/taxonomy.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/taxonomy.page_title.inc
new file mode 100644
index 0000000..14ccf6e
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/taxonomy.page_title.inc
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * Taxonomy implementations of the page title hooks
+ */
+
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function taxonomy_page_title_alter(&$title) {
+ $menu_item = menu_get_item();
+ // If we're looking at a taxonomy term page, get the term title.
+ if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) &&
+ ($term = menu_get_object('taxonomy_term', 2)) &&
+ variable_get('page_title_vocab_' . $term->vocabulary_machine_name . '_showfield', 0) &&
+ ($term_title = page_title_load_title($term->tid, 'term')) ) {
+ $title = $term_title;
+ }
+}
+
+
+/**
+ * Implements hook_page_title_pattern_alter().
+ */
+function taxonomy_page_title_pattern_alter(&$pattern, &$types) {
+ $menu_item = menu_get_item();
+
+ // Taxonomy Term Page
+ if ( !strncmp($menu_item['path'], 'taxonomy/term/%', 15) &&
+ ($term = menu_get_object('taxonomy_term', 2)) ) {
+ $types['term'] = $term;
+ $pattern = variable_get('page_title_vocab_' . $term->vocabulary_machine_name, '');
+ }
+}
+
+
+/**
+ * Implements hook_page_title_settings().
+ */
+function taxonomy_page_title_settings() {
+ $settings = array();
+
+ $vocabs = taxonomy_get_vocabularies();
+ foreach ($vocabs as $vocab) {
+ $settings['page_title_vocab_' . $vocab->machine_name] = array(
+ 'label' => 'Vocabulary - %vocab_name',
+ 'label arguments' => array('%vocab_name' => $vocab->name),
+ 'scopes' => array('global', 'term', 'vocabulary'),
+ 'show field' => TRUE,
+ 'description' => 'This pattern will be used for all %vocab_name term pages',
+ 'description arguments' => array('%vocab_name' => $vocab->name),
+ );
+ }
+
+ return $settings;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/uc_catalog.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/uc_catalog.page_title.inc
new file mode 100644
index 0000000..3bd9910
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/uc_catalog.page_title.inc
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * @file
+ * Ubercart Catalog implementations of the page title hooks
+ */
+
+
+/**
+ * Ubercart Catalog pages are on both:
+ * /catalog
+ * /catalog/[tid]
+ *
+ * This means we need to make sure arg(1) in the menu item is a valid term.
+ */
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function uc_catalog_page_title_alter(&$title) {
+ $menu_item = menu_get_item();
+
+ // If we're looking at a UC Catalog term page, get the term title
+ if ( !strncmp($menu_item['path'], 'catalog', 7) &&
+ isset($menu_item['page_arguments'][0]) &&
+ ($term = taxonomy_term_load($menu_item['page_arguments'][0])) &&
+ variable_get('page_title_vocab_' . $term->vocabulary_machine_name . '_showfield', 0) &&
+ ($term_title = page_title_load_title($term->tid, 'term')) ) {
+ $title = $term_title;
+ }
+}
+
+
+/**
+ * Implements hook_page_title_pattern_alter().
+ */
+function uc_catalog_page_title_pattern_alter(&$pattern, &$types) {
+ $menu_item = menu_get_item();
+
+ // Ubercart Catalog Term Page
+ if ( !strncmp($menu_item['path'], 'catalog', 7) &&
+ isset($menu_item['page_arguments'][0]) &&
+ ($term = taxonomy_term_load($menu_item['page_arguments'][0])) ) {
+ $types['taxonomy'] = $term;
+ $pattern = variable_get('page_title_uc_catalog_' . $types['taxonomy']->vid, '');
+ }
+}
+
+
+/**
+ * Implements hook_page_title_settings().
+ */
+function uc_catalog_page_title_settings() {
+ $settings = array();
+
+ $vocabs = taxonomy_get_vocabularies();
+ foreach ($vocabs as $vocab) {
+ $settings['page_title_uc_catalog_' . $vocab->vid] = array(
+ 'label' => 'Ubercart Catalog - %vocab_name',
+ 'label arguments' => array('%vocab_name' => $vocab->name),
+ 'scopes' => array('global', 'taxonomy'),
+ 'show field' => FALSE,
+ 'description' => 'This pattern will be used for all %vocab_name Ubercart catalog pages.<br />' .
+ 'The Show Field setting does not apply here. Use the matching Vocabulary row.',
+ 'description arguments' => array('%vocab_name' => $vocab->name),
+ );
+ }
+
+ return $settings;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/user.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/user.page_title.inc
new file mode 100644
index 0000000..f67fb44
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/user.page_title.inc
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * @file
+ * User implementations of the page title hooks
+ */
+
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function user_page_title_alter(&$title) {
+ // If we're looking at either a user profile page, get the user title
+ if ( ($user = menu_get_object('user')) &&
+ variable_get('page_title_user_showfield', 0) &&
+ ($user_title = page_title_load_title($user->uid, 'user')) ) {
+ $title = $user_title;
+ }
+}
+
+
+/**
+ * Implements hook_page_title_pattern_alter().
+ */
+function user_page_title_pattern_alter(&$pattern, &$types) {
+ if ($user = menu_get_object('user')) {
+ $types['user'] = $user;
+ $pattern = variable_get('page_title_user', '');
+ }
+}
+
+
+/**
+ * Implements hook_page_title_settings().
+ */
+function user_page_title_settings() {
+ return array(
+ 'page_title_user' => array(
+ 'label' => 'User Profile',
+ 'scopes' => array('global', 'user'),
+ 'show field' => TRUE,
+ 'description' => 'This pattern will be used for a user profile page (eg <code>/user/1</code>)',
+ ),
+ );
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/views.page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/views.page_title.inc
new file mode 100644
index 0000000..1dd87ff
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/modules/views.page_title.inc
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * @file
+ * Views implementations of the page title hooks
+ */
+
+
+/**
+ * Implements hook_page_title_alter().
+ */
+function views_page_title_pattern_alter(&$pattern, &$types) {
+ $menu = menu_get_item();
+
+ if ($menu['page_callback'] == 'views_page' && is_array($menu['page_arguments'])) {
+ // Get the args from the menu router
+ $args = $menu['page_arguments'];
+ $name = array_shift($args);
+ $display_id = array_shift($args);
+
+ // Get the active page view
+ $view = views_get_page_view();
+
+ // If there is no view - then return - this helps protect from errors below
+ if (!$view) return;
+
+ // If there are args for this view, process to see if this argument has a SPECIFIC page title pattern
+ if (!empty($args) && !empty($view->argument)) {
+ // Grab the argument handlers
+ $h = $view->argument;
+
+ // Splice the arguments and get the key for the current arg.
+ $hh = array_splice($h, count($args)-1, 1);
+ $h = array_shift($hh);
+
+ // Get the Page Title Pattern from the options array for this handler
+ $pattern = isset($h->options['page_title_pattern']) ? $h->options['page_title_pattern'] : $pattern;
+
+ // If a page title pattern was found AND it contains a "%", assume there are placeholders and apply the %1, %2 type placeholder replacement.
+ if (strpos($pattern, '%') !== FALSE) {
+ // Grab the pre-built substitutions
+ $subs = $view->build_info['substitutions'];
+
+ // Apply any subs to the pattern
+ $pattern = str_replace(array_keys($subs), $subs, $pattern);
+ }
+ }
+ // This is a view with no args provided, or the specific arg has no title - lets use the base display title
+ elseif (isset($view->display_handler) && $view->display_handler->display->display_plugin == 'page_with_page_title') {
+ $pattern = $view->display_handler->get_option('page_title_pattern');
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title-admin-settings-form.tpl.php b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title-admin-settings-form.tpl.php
new file mode 100644
index 0000000..8584c6a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title-admin-settings-form.tpl.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * @file
+ * Template file for the admin settings form. Renders the settings form as a table.
+ */
+
+$form = &$variables['form'];
+
+$rows = array();
+
+foreach (element_children($form['pattern']) as $key) {
+ $title = array(
+ '#markup' => $form['pattern'][$key]['#title'],
+ '#required' => $form['pattern'][$key]['#required'],
+ );
+ unset($form['patterns']['pattern'][$key]['#title']);
+
+ $row = array(
+ array('data' => render($title), 'class' => 'page-type'),
+ array('data' => render($form['scope'][$key]), 'class' => 'scope'),
+ );
+
+ if (isset($form['showfield'][$key .'_showfield'])) {
+ $row[] = array('data' => render($form['pattern'][$key]), 'class' => 'pattern');
+ $row[] = array('data' => render($form['showfield'][$key .'_showfield']), 'class' => 'showfield');
+ }
+ else {
+ $row[] = array('data' => render($form['pattern'][$key]), 'colspan' => 2, 'class' => 'pattern');
+ }
+ $rows[] = $row;
+}
+
+$headers = array(
+ array('data' => t('Page Type'), 'class' => 'page-type'),
+ array('data' => t('Token Scope'), 'class' => 'scope'),
+ array('data' => t('Pattern'), 'class' => 'pattern'),
+ array('data' => t('Show Field'), 'class' => 'showfield'),
+);
+drupal_add_css(drupal_get_path('module', 'page_title') .'/page_title.admin.css', array('type' => 'file', 'preprocess' => FALSE));
+
+print theme('table', array('header' => $headers, 'rows' => $rows, 'attributed' => array('id' => 'page-title-settings')));
+//print drupal_render_children($form);
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.admin.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.admin.inc
new file mode 100644
index 0000000..2f97e4a
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.admin.inc
@@ -0,0 +1,73 @@
+<?php
+
+/**
+ * @file
+ * Admin include file.
+ */
+
+/**
+ * Displays the form for the standard settings tab.
+ *
+ * @return
+ * array A structured array for use with Forms API.
+ */
+function page_title_admin_settings() {
+ // Set the page title - the page is a local task now.
+ drupal_set_title(t('Page titles'));
+
+
+ // Set the theme callback for the patterns section
+ $form['patterns'] = array(
+ '#theme' => 'page_title_admin_settings',
+ );
+
+ $all_settings = page_title_get_settings();
+
+ foreach ($all_settings as $key => $settings) {
+ $form['patterns']['pattern'][$key] = array(
+ '#title' => t($settings['label'], $settings['label arguments']),
+ '#default_value' => variable_get($key, $settings['default']),
+ '#required' => $settings['required'],
+ '#description' => t($settings['description'], $settings['description arguments']),
+ '#weight' => $settings['weight'],
+ '#token_types' => $settings['scopes'],
+ '#element_validate' => array('token_element_validate'),
+ '#type' => 'textfield',
+ '#size' => 30,
+ '#maxlength' => 255,
+ );
+
+ $form['patterns']['scope'][$key] = array(
+ '#markup' => implode('<br />', array_map('_page_title_scope_t', $settings['scopes'])),
+ );
+
+ if ($settings['show field']) {
+ $form['patterns']['showfield'][$key . '_showfield'] = array(
+ '#type' => 'checkbox',
+ '#default_value' => variable_get($key . '_showfield', 0),
+ );
+ }
+ }
+
+
+ // Add the token help to a collapsed fieldset at the end of the configuration page.
+ $form['token_help'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Available Tokens List'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['token_help']['content'] = array(
+ '#theme' => 'token_tree',
+ '#token_types' => array('node', 'comment', 'term', 'vocabulary', 'user'),
+ );
+
+ $form = system_settings_form($form);
+ return $form;
+}
+
+
+
+function _page_title_scope_t($item) {
+ return t(drupal_ucfirst($item));
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.info b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.info
new file mode 100644
index 0000000..8db8dda
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.info
@@ -0,0 +1,19 @@
+name = Page Title
+description = "Enhanced control over the page title (in the &lt;head> tag)."
+core = 7.x
+package = SEO
+dependencies[] = token
+files[] = page_title.module
+files[] = page_title.admin.inc
+files[] = page_title.tokens.inc
+files[] = page_title.test
+files[] = views/plugins/page_title_plugin_display_page_with_page_title.inc
+files[] = views_handler_field_node_page_title.inc
+configure = admin/config/search/page-title
+
+; Information added by drupal.org packaging script on 2012-05-09
+version = "7.x-2.7"
+core = "7.x"
+project = "page_title"
+datestamp = "1336556786"
+
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.install b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.install
new file mode 100755
index 0000000..08033f7
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.install
@@ -0,0 +1,128 @@
+<?php
+
+/**
+ * @file page_title.install
+ *
+ * Handles the install, uninstall and updating of Page Title
+ */
+
+/**
+ * Implements hook_schema().
+ */
+function page_title_schema() {
+ $schema['page_title'] = array(
+ 'fields' => array(
+ 'type' => array('type' => 'varchar', 'length' => 15, 'not null' => TRUE, 'default' => 'node'),
+ 'id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'page_title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
+ ),
+ 'primary key' => array('type', 'id'),
+ );
+
+ return $schema;
+}
+
+
+/**
+ * Implements hook_update_n().
+ */
+function page_title_update_6200() {
+ $ret = array();
+
+ if (db_column_exists('page_title', 'id')) {
+ return $ret;
+ }
+
+ db_create_table($ret, 'page_title_temp', array(
+ 'fields' => array(
+ 'type' => array('type' => 'varchar', 'length' => 15, 'not null' => TRUE, 'default' => 'node'),
+ 'id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
+ 'page_title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '')
+ ),
+ 'primary key' => array('type', 'id'),
+ ));
+
+ $ret[] = update_sql('INSERT INTO {page_title_temp} (id, page_title) SELECT nid, page_title FROM {page_title}');
+
+ db_rename_table($ret, 'page_title', 'page_title_old');
+
+ db_rename_table($ret, 'page_title_temp', 'page_title');
+
+ $display_settings = variable_get('page_title_display', array());
+ foreach ($display_settings as $type) {
+ if ($type) {
+ variable_set('page_title_type_' . $type . '_showfield', 1);
+ }
+ }
+ variable_del('page_title_display');
+
+ return $ret;
+}
+
+
+/**
+ * Implements hook_update_n().
+ * Rename all the Vocabulary settings to reference by the new Machine Name, rather than Vocab ID.
+ */
+function page_title_update_7200() {
+ $ret = array();
+
+ // If taxonomy not enabled, do no further updates
+ if (!module_exists('taxonomy')) {
+ return $ret;
+ }
+
+ foreach (taxonomy_get_vocabularies() as $vocab) {
+ $page_title_vocab_settings = variable_get("page_title_vocab_{$vocab->vid}", FALSE);
+ $page_title_vocab_showfield = variable_get("page_title_vocab_{$vocab->vid}_showfield", FALSE);
+
+ if ($page_title_vocab_settings) {
+ variable_set("page_title_vocab_{$vocab->machine_name}", $page_title_vocab_settings);
+ }
+ if ($page_title_vocab_showfield) {
+ variable_set("page_title_vocab_{$vocab->machine_name}_showfield", $page_title_vocab_showfield);
+ }
+ variable_del("page_title_vocab_{$vocab->vid}_showfield");
+ variable_del("page_title_vocab_{$vocab->vid}");
+ }
+
+ return $ret;
+}
+
+
+/**
+ * Implements hook_uninstall().
+ */
+function page_title_uninstall() {
+ // Clear variables
+ variable_del('page_title_default');
+ variable_del('page_title_individual');
+ variable_del('page_title_front');
+ variable_del('page_title_blog');
+ variable_del('page_title_user');
+ variable_del('page_title_user_showfield');
+ variable_del('page_title_pager_pattern');
+ variable_del('page_title_forum_root_title');
+ variable_del('page_title_comment_reply');
+ variable_del('page_title_comment_child_reply');
+
+ // Clear the node specific variables
+ $types = node_type_get_names();
+ foreach ($types as $type => $name) {
+ variable_del("page_title_type_{$type}");
+ variable_del("page_title_type_{$type}_showfield");
+ }
+
+ // Clear the vocab specific variables
+ if (module_exists('taxonomy')) {
+ $vocabs = taxonomy_get_vocabularies();
+ foreach ($vocabs as $vid => $vocab) {
+ variable_del("page_title_vocab_{$vocab->machine_name}");
+ variable_del("page_title_vocab_{$vocab->machine_name}_showfield");
+
+ // Legacy delete - just in case the uninstall is happening befoer update 7200
+ variable_del("page_title_vocab_{$vid}");
+ variable_del("page_title_vocab_{$vid}_showfield");
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.js b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.js
new file mode 100644
index 0000000..37a86ac
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.js
@@ -0,0 +1,39 @@
+
+(function ($) {
+
+Drupal.behaviors.pageTitleFieldsetSummaries = {
+ attach: function (context) {
+ $('fieldset#edit-page-title', context).drupalSetSummary(function (context) {
+ var pt = $('input', context).val();
+
+ return pt ?
+ Drupal.t('Page Title: @pt', { '@pt': pt }) :
+ Drupal.t('No Page Title');
+ });
+ }
+};
+
+
+Drupal.behaviors.pageTitleCounter = {
+ attach : function(context) {
+ $('fieldset#edit-page-title', context).each(function() {
+ function getLength(element) { return $(element).val().length; }
+
+ var wrapper = this;
+
+ var inputBox = $('input[name=page_title]', wrapper);
+
+ var valueBox = $('div.description', wrapper)
+ .append('<br/><span class="counter">Characters Entered: <span class="value">0</span></span>')
+ .find('.value')
+ .text(getLength(inputBox));
+
+ $('input[name=page_title]', wrapper).keyup(function(e) { $(valueBox).text(getLength(inputBox)); });
+ });
+ }
+
+}
+
+
+})(jQuery);
+
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.module b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.module
new file mode 100644
index 0000000..321a57c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.module
@@ -0,0 +1,917 @@
+<?php
+
+/**
+ * @file
+ * Enhanced control over the page title (in the head tag).
+ *
+ * This module gives you control over the page title. It gives you the chance
+ * to provide patterns for how the title should be structured, and on node
+ * pages, gives you the chance to specify the page title rather than defaulting
+ * to the node title.
+ */
+
+
+/**
+ * Implement hook_help().
+ */
+function page_title_help($path, $arg) {
+ $output = NULL;
+ switch ($path) {
+ case 'admin/config/search/page-title' :
+ $output = '<p>' . t('Page Title provides control over the &lt;title> element on a page using token patterns and an optional textfield to override the title of the item (be it a node, term, user or other). The Token Scope column lets you know which tokens are available for this field (Global is always available). Please click on the <strong><em>more help&hellip;</em></strong> link below if you need further assistance.') . '</p>';
+ $output .= '<p>' . l(t('More Help...'), 'admin/help/page_title') . '</p>';
+ break;
+ case 'admin/help#page_title':
+ $output = '<p>' . t('Drupal\'s default page title follows one of two patterns:') . '</p>';
+ $items = array(
+ t('<strong>Default Page</strong>: <samp><em>page title</em> | <em>site name</em></samp>'),
+ t('<strong>Default Frontpage</strong>: <samp><em>site name</em> | <em>site slogan</em></samp>'),
+ );
+ $output .= theme('item_list', $items, NULL, 'ol');
+ $output .= '<p>' . t('The <strong>Page Title</strong> module lets you change these defaults in two ways. First, you can adjust the patterns below using the placeholders given. This will change the way the default page titles are created. Second, on enabled forms (curently node, term & user editing forms) you have the option of specifying a title that is different to the title of the item. This field only appears if the <em>Show Field</em> box is checked for the item. If a value is provided it will be used to generate the <samp>[current-page:page-title]</samp> placeholder however if it is left blank the <samp>[current-page:page-title]</samp> token will inherit the item\'s own title.') . '</p>';
+ $output .= '<p>' . t('The <samp>[current:page-title]</samp> token will default to the value returned from <samp>drupal_get_title</samp> if there is no value specified or no available page title field.') . '</p>';
+ $output .= '<p>' . t('Certain types of page title pattern have access to special tokens which others do not, depending on their <em>scope</em>. All patterns have access to the <strong>Global</strong> scope. Content type patterns have access to the <strong>Node</strong> tokens, vocabulary patterns have access to the <strong>Taxonomy</strong> tokens and finally the user patterns have access to the <strong>User</strong> tokens.') . '</p>';
+ break;
+ }
+ return $output;
+}
+
+
+/**
+ * Implements hook_requirements().
+ */
+function page_title_requirements($phase) {
+ $requirements = array();
+ if ($phase == 'runtime') {
+ // Are we on an old version?
+ if (!page_title_is_up_to_date()) {
+ $requirements['page_title_version'] = array(
+ 'title' => t('Page title version'),
+ 'value' => t('Out of date'),
+ 'description' => t('The Page Title module must be updated. You should run the !link immediately.', array('!link' => l(t('database update script'), 'update.php'))),
+ 'severity' => REQUIREMENT_ERROR,
+ );
+ }
+ // Nope - we're on the latest version
+ else {
+ // Does the old table exist (it is left after the upgrade in case an admin wants to check the upgrade went ok)
+ if (db_table_exists('page_title_old')) {
+ $requirements['upgrade_table'] = array(
+ 'title' => t('Page Title upgrade table present'),
+ 'value' => '',
+ 'description' => t('The Page Title upgrade table (<code>page_title_old</code>) is present. You can remove it !link', array(
+ '!link' => l(t('using this script'), 'admin/settings/page-title/drop-old-table'),
+ )),
+ 'severity' => REQUIREMENT_WARNING,
+ );
+ }
+
+ // If the page title module exists, check it has the right columns - there are reports of upgrade issues.
+ // If the table doesn't exists, reinstall the module!
+ if (!db_table_exists('page_title') || db_field_exists('page_title', 'nid')) {
+ $requirements['page_title_version'] = array(
+ 'title' => t('Page title version'),
+ 'value' => t('Incorrect Schema'),
+ 'description' => t('It appears Drupal thinks the module is up to date, however the database schema is incorrect. Please uninstall and reinstall the module.'),
+ 'severity' => REQUIREMENT_ERROR,
+ );
+ }
+ else {
+ // Everything seems ok...
+ $rows = db_query('SELECT COUNT(*) FROM {page_title}')->fetchField();
+
+ $requirements['page_title_version'] = array(
+ 'title' => t('Page title version'),
+ 'value' => t('Enabled (<code>page_title</code> table contains !rows)', array('!rows' => format_plural($rows, '1 row', '@count rows'))),
+ 'severity' => REQUIREMENT_OK,
+ );
+ }
+ }
+ }
+
+ return $requirements;
+}
+
+
+/**
+ * Implement hook_perm().
+ */
+function page_title_permission() {
+ return array(
+ 'set page title' => array(
+ 'title' => t('Set Page Title'),
+ 'description' => t('Allow user to set or modify a page title'),
+ ),
+ 'administer page titles' => array(
+ 'title' => t('Administer Page Title'),
+ 'description' => t('Perform administration tasks for Page Title'),
+ ),
+ );
+}
+
+
+/**
+ * Implement hook_menu().
+ */
+function page_title_menu() {
+ $items = array();
+
+ $items['admin/config/search/page-title'] = array(
+ 'title' => 'Page titles',
+ 'description' => 'Configure the page titles for your site (the title in the &lt;head&gt; tag).',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('page_title_admin_settings'),
+ 'access arguments' => array('administer page titles'),
+ 'type' => MENU_NORMAL_ITEM,
+ 'file' => 'page_title.admin.inc',
+ );
+
+ return $items;
+}
+
+
+/**
+ * Implement hook_theme().
+ */
+function page_title_theme() {
+ return array(
+ 'page_title_admin_settings' => array(
+ 'template' => 'page_title-admin-settings-form',
+ 'render element' => 'form',
+ 'file' => 'page_title.admin.inc',
+ ),
+ 'page_title_preprocess_html' => array(
+ 'arguments' => array('vars' => NULL),
+ ),
+ );
+}
+
+
+/**
+ * Implement hook_node_type().
+ *
+ * Updates settings after a node type change.
+ */
+function page_title_node_type($op, $info) {
+ // Handle a content type rename
+ if ($op == 'update' && !empty($info->old_type) && $info->type != $info->old_type) {
+ // Load the old node type settings.
+ $temp = variable_get('page_title_type_' . $info->old_type, '');
+
+ // If the settings aren't empty, then save them into the new type
+ if (!empty($temp)) {
+ variable_set('page_title_type_' . $info->type, $temp);
+ }
+
+ // Delete the old setting
+ variable_del('page_title_type_' . $info->old_type);
+
+ // Essentially, do the same as above but with the _showfield suffix for the node type
+ $temp = variable_get('page_title_type_' . $info->old_type . '_showfield', 0);
+ if ($temp) {
+ variable_set('page_title_type_' . $info->type . '_showfield', $temp);
+ }
+ variable_del('page_title_type_' . $info->old_type . '_showfield');
+
+ }
+
+ // If deleted, remove the variables
+ if ($op == 'delete') {
+ variable_del('page_title_type_' . $info->type);
+ variable_del('page_title_type_' . $info->type . '_showfield');
+ }
+}
+
+
+/**
+ * Implement hook_form_alter().
+ * (cant use hook_form_FORM_ID_alter(). here as the form ID changes from node to node)
+ */
+function page_title_form_alter(&$form, $form_state, $form_id) {
+ // If we dont have permission to set the title then we need to abort this alter now!
+ if (!user_access('set page title')) return;
+
+ // If we're editing a node...
+ if (!empty($form['#node_edit_form'])) {
+ // ... and the show field is enabled for this node type
+ if (variable_get('page_title_type_' . $form['type']['#value'] . '_showfield', 0)) {
+ $page_title = isset($form['#node']->page_title) ? $form['#node']->page_title : NULL;
+ $form['page_title'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Page title settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => empty($page_title),
+ '#group' => 'additional_settings',
+ '#weight' => 35,
+ '#attached' => array(
+ 'js' => array(drupal_get_path('module', 'page_title') . '/page_title.js'),
+ ),
+ );
+ $form['page_title']['page_title'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Page title'),
+ '#description' => t('Provide a description of this node to appear in the &lt;title&gt; tag which search engines can use in search result listings (optional). It is generally accepted this field should be less than 70 characters.'),
+ '#default_value' => $page_title,
+ '#size' => 60,
+ '#maxlength' => 255,
+ );
+ }
+ }
+}
+
+
+/**
+ * Implement hook_form_FORM_ID_alter().
+ */
+function page_title_form_user_profile_form_alter(&$form, $form_state) {
+ // If we dont have permission to set the title then we need to abort this alter now!
+ if (!user_access('set page title')) return;
+
+ // Check the user profile form has the show field enabled
+ if (variable_get('page_title_user_showfield', 0)) {
+ $form['account']['page_title'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Page title'),
+ '#description' => t('Provide a description of this user to appear in the &lt;title&gt; tag which search engines can use in search result listings (optional). It is generally accepted this field should be less than 70 characters.'),
+ '#default_value' => page_title_load_title($form['#user']->uid, 'user'),
+ '#size' => 60,
+ '#maxlength' => 255,
+ '#weight' => 20,
+ );
+ }
+}
+
+
+/**
+ * Implement hook_form_FORM_ID_alter().
+ */
+function page_title_form_taxonomy_form_term_alter(&$form, $form_state) {
+ // If we dont have permission to set the title then we need to abort this alter now!
+ if (!user_access('set page title')) return;
+
+ // For some reason, the term delete confirm form is run through the taxonomy_form_term form - skip if this is case!
+ //if ($form['delete']['#value'] === TRUE) return;
+
+ // Check the term's vocab has the show field enabled
+ if (variable_get('page_title_vocab_' . $form['#vocabulary']->machine_name . '_showfield', 0)) {
+ $form['advanced']['page_title'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Page title'),
+ '#description' => t('Provide a description of this term to appear in the &lt;title&gt; tag which search engines can use in search result listings (optional). It is generally accepted this field should be less than 70 characters.'),
+ '#default_value' => isset($form['tid']) ? page_title_load_title($form['tid']['#value'], 'term') : '',
+ '#size' => 60,
+ '#maxlength' => 255,
+ '#weight' => -20,
+ );
+ }
+}
+
+
+/**
+ * Implement hook_form_FORM_ID_alter().
+ */
+function page_title_form_forum_form_container_alter(&$form, $form_state) {
+ $forum_vid = variable_get('forum_nav_vocabulary', 0);
+ $forum_vocab = taxonomy_vocabulary_load($forum_vid);
+
+ // Check the forum vocab has the show field enabled
+ if (variable_get('page_title_vocab_' . $forum_vocab->machine_name . '_showfield', 0)) {
+ $form['page_title'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Page title'),
+ '#description' => t('Provide a description of this forum to appear in the &lt;title&gt; tag which search engines can use in search result listings (optional). It is generally accepted this field should be less than 70 characters.'),
+ '#default_value' => isset($form['tid']) ? page_title_load_title($form['tid']['#value'], 'term') : '',
+ '#size' => 60,
+ '#maxlength' => 255,
+ '#weight' => -20,
+ );
+ }
+}
+
+
+/**
+ * Implement hook_form_FORM_ID_alter().
+ * (We can re-use the above function)
+ */
+function page_title_form_forum_form_forum_alter(&$form, $form_state) {
+ page_title_form_forum_form_container_alter($form, $form_state);
+}
+
+
+/**
+ * Implement hook_form_FORM_ID_alter().
+ */
+function page_title_form_node_type_form_alter(&$form, $form_state) {
+ // If we dont have permission to administer the title then we need to abort this alter now!
+ if (!user_access('administer page title')) return;
+
+ // Add the node-type specific page title settings to the additional settings section
+ $form['page_title'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Page Title Settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ '#tree' => TRUE,
+ '#group' => 'additional_settings',
+ );
+
+ $form['page_title']['show_field'] = array(
+ '#type' => 'checkboxes',
+ '#title' => t('Page Title Field'),
+ '#description' => t('If checked, the <em>Page Title</em> field will appear on the node edit form for those who have permission to set the title.'),
+ '#options' => array(
+ 'show_field' => t('Show field'),
+ ),
+ '#default_value' => variable_get('page_title_type_' . $form['#node_type']->type . '_showfield', 0) ? array('show_field') : array(),
+ );
+
+ $form['page_title']['pattern'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Page Title Pattern'),
+ '#default_value' => variable_get('page_title_type_' . $form['#node_type']->type, ''),
+ '#description' => t('Enter the <em>Page Title</em> pattern you want to use for this node type. For more information, please use the !link settings page', array('!link' => l('Page Title', 'admin/config/search/page-title'))),
+ '#maxlength' => 255,
+ );
+
+ $form['#submit'][] = 'page_title_node_type_form_submit';
+}
+
+
+/**
+ * Submit handler for the node_type_form element added in the hook_form_FORM_ID_alter() above.
+ */
+function page_title_node_type_form_submit($form, &$form_state) {
+ $show_field = $form_state['values']['page_title']['show_field']['show_field'] ? 1 : 0;
+ variable_set('page_title_type_' . $form_state['values']['type'] . '_showfield', $show_field);
+ variable_set('page_title_type_' . $form_state['values']['type'], $form_state['values']['page_title']['pattern']);
+
+ // For some reason the node module adds the fieldset as a separate entry in the variables table... we dont want this!
+ variable_del('page_title_' . $form_state['values']['type']);
+
+ // Flush the settings on update/insert.
+ page_title_get_settings(TRUE);
+}
+
+
+/**
+ * Implement hook_node_load().
+ */
+function page_title_node_load($nodes) {
+ $nids = array();
+
+ // Get the settings
+ $settings = page_title_get_settings();
+
+ // Get a list of node nids to fetch page_title's later
+ foreach ($nodes AS $node) {
+ // Check the node type has the 'Show Field' enabled, otherwise there is no point querying for the data
+ if (isset($settings['page_title_type_' . $node->type]) && $settings['page_title_type_' . $node->type]['show field']) {
+ $nids[] = $node->nid;
+ }
+ // Otherwise, set a blank value on the node
+ else {
+ $nodes[$node->nid] = '';
+ }
+ }
+
+ // If we have ended up with no nodes to load titles for, lets not query...
+ if (empty($nids)) {
+ return;
+ }
+
+ // Fetch page_title information from database and assign it to nodes
+ // TODO - Can we make this better? IN() queries dont scale welll..
+ $result = db_query('SELECT page_title, id FROM {page_title} WHERE type = :type AND id IN (:nids)', array(':type' => 'node', ':nids' => $nids));
+ foreach ($result AS $record) {
+ $nodes[$record->id]->page_title = $record->page_title;
+ }
+}
+
+
+/**
+ * Implement hook_node_insert().
+ */
+function page_title_node_insert($node) {
+ if (user_access('set page title') && isset($node->page_title) && drupal_strlen(trim($node->page_title)) > 0) {
+ db_insert('page_title')->fields(array('type' => 'node', 'id' => $node->nid, 'page_title' => $node->page_title))->execute();
+ }
+}
+
+
+/**
+ * Implement hook_node_update().
+ */
+function page_title_node_update($node) {
+ if (user_access('set page title') && isset($node->page_title)) {
+ // If there is content to the Page Title, 'merge' it (ie, either UPDATE or INSERT)
+ if (drupal_strlen(trim($node->page_title)) > 0) {
+ db_merge('page_title')->key(array('type' => 'node', 'id' => $node->nid))->fields(array('page_title' => $node->page_title))->execute();
+ }
+ // Otherwise, delete the row (if there is one)
+ else {
+ db_delete('page_title')->condition('type', 'node')->condition('id', $node->nid)->execute();
+ }
+ }
+}
+
+
+/**
+ * Implement hook_node_delete().
+ */
+function page_title_node_delete($node) {
+ db_delete('page_title')->condition('type', 'node')->condition('id', $node->nid)->execute();
+}
+
+
+/**
+ * Implement hook_taxonomy_term_update().
+ */
+function page_title_taxonomy_term_update($term) {
+ if (user_access('set page title')) {
+ if (isset($term->page_title) && drupal_strlen(trim($term->page_title)) > 0) {
+ db_merge('page_title')->key(array('type' => 'term', 'id' => $term->tid))->fields(array('page_title' => $term->page_title))->execute();
+ }
+ else {
+ page_title_taxonomy_term_delete($term);
+ }
+ }
+}
+
+
+/**
+ * Implement hook_taxonomy_term_delete().
+ */
+function page_title_taxonomy_term_delete($term) {
+ db_delete('page_title')->condition('type', 'term')->condition('id', $term->tid)->execute();
+}
+
+
+/**
+ * Implement hook_taxonomy_term_insert().
+ */
+function page_title_taxonomy_term_insert($term) {
+ if (user_access('set page title') && isset($term->page_title) && drupal_strlen(trim($term->page_title)) > 0) {
+ db_insert('page_title')->fields(array('type' => 'term', 'id' => $term->tid, 'page_title' => $term->page_title))->execute();
+ }
+}
+
+
+/**
+ * Implement hook_taxonomy_vocabulary_insert().
+ */
+function page_title_taxonomy_vocabulary_insert($vocabulary) {
+ // Flush the settings on insert.
+ page_title_get_settings(TRUE);
+}
+
+
+/**
+ * Implement hook_taxonomy_vocabulary_update().
+ */
+function page_title_taxonomy_vocabulary_update($vocabulary) {
+ // Flush the settings on update.
+ page_title_get_settings(TRUE);
+}
+
+
+/**
+ * Implement hook_taxonomy_vocabulary_delete().
+ */
+function page_title_taxonomy_vocabulary_delete($vocabulary) {
+ // Flush the settings on update.
+ page_title_get_settings(TRUE);
+}
+
+
+
+/**
+ * Implement hook_user_insert().
+ */
+function page_title_user_insert(&$edit, &$account, $category) {
+ if (user_access('set page title') && isset($edit['page_title']) && drupal_strlen(trim($edit['page_title'])) > 0) {
+ db_insert('page_title')->fields(array('type' => 'user', 'id' => $account->uid, 'page_title' => $edit['page_title']))->execute();
+ }
+}
+
+
+/**
+ * Implement hook_user_update().
+ */
+function page_title_user_update(&$edit, &$account, $category) {
+ if (user_access('set page title')) {
+ if (isset($edit['page_title']) && drupal_strlen(trim($edit['page_title'])) > 0) {
+ db_merge('page_title')->key(array('type' => 'user', 'id' => $account->uid))->fields(array('page_title' => $edit['page_title']))->execute();
+ }
+ else {
+ db_delete('page_title')->condition('type', 'user')->condition('id', $account->uid)->execute();
+ }
+ }
+}
+
+
+/**
+ * Implement hook_user_cancel().
+ */
+function page_title_user_cancel(&$edit, &$account, $method) {
+ switch ($method) {
+ case 'user_cancel_block_unpublish' : break;
+ case 'user_cancel_reassign' : break;
+ case 'user_cancel_delete' :
+ db_delete('page_title')->condition('type', 'user')->condition('id', $account->uid)->execute();
+ break;
+ }
+}
+
+
+/**
+ * Simple wrapper function to get the currently set title for a page
+ *
+ * @param $raw
+ * Optionally set the function to return a result not cleaned by filter_xss. This should be used with caution.
+ *
+ * @return
+ * string the title for the current page
+ */
+function page_title_get_title($raw = FALSE, $flush = FALSE) {
+ $title = &drupal_static(__FUNCTION__);
+
+ if ($flush || is_null($title)) {
+ // Give other modules the oppertunity to use hook_page_title_alter().
+ drupal_alter('page_title', $title);
+ }
+
+ // Return the title
+ return $raw ? $title : filter_xss($title, array());
+}
+
+
+/**
+ * Gets the page title for a type & id.
+ *
+ * @param $id
+ * int The objects id.
+ * @param $type
+ * string What is the scope (usually 'node', 'term' or 'user').
+ *
+ * @return
+ * string the page title for the given type & id.
+ */
+function page_title_load_title($id, $type) {
+ return db_query('SELECT page_title FROM {page_title} WHERE type = :type AND id = :id', array(':type' => $type, ':id' => $id))->fetchField();
+}
+
+
+/**
+ * Wrapper for old function...
+ * NOTE: This has been deprecated in favor of page_title_load_title().
+ */
+function page_title_node_get_title($nid) {
+ return page_title_load_title($nid, 'node');
+}
+
+
+/**
+ * Legacy page title setting function...
+ * NOTE: This has been deprecated in favour of hook_page_title_alter().
+ */
+function page_title_set_title($title = NULL) {
+ $stored_title = &drupal_static(__FUNCTION__);
+
+ if (isset($title)) {
+ $stored_title = $title;
+ }
+
+ return $stored_title;
+}
+
+
+/**
+ * Determines what title should be sent to the page template.
+ *
+ * This function gets called from the implementation of hook_preprocess_html
+ *
+ * @param $raw
+ * Optionally get the result without cleaning it with filter_xss. This should be used with caution.
+ *
+ * @return
+ * string The page's title.
+ */
+function page_title_page_get_title($raw = FALSE) {
+ $title = &drupal_static(__FUNCTION__);
+
+ if (is_null($title)) {
+ $types = array('global' => NULL);
+
+ // Allow hook_page_title_pattern_alter() to modify the pattern and tokens
+ drupal_alter('page_title_pattern', $page_title_pattern, $types);
+
+ // If pattern is empty (either if the type is not overridable or simply not set) fallback to the default pattern
+ if (empty($page_title_pattern)) {
+ $settings = page_title_get_settings();
+ $page_title_pattern = variable_get('page_title_default', $settings['page_title_default']['default']);
+ }
+
+ // Append the pattern for pages with a pager on them
+ $page_title_pattern .= isset($_REQUEST['page']) ? variable_get('page_title_pager_pattern', '') : '';
+
+ // Apply token patterns using token_replace
+ $title = token_replace($page_title_pattern, $types, array('sanitize' => FALSE));
+ }
+
+ // Trim trailing whitespace from the title
+ $title = trim($title);
+
+ return $raw ? $title : filter_xss($title);
+}
+
+
+/**
+ * Implement hook_preprocess_html().
+ */
+function page_title_preprocess_html(&$vars) {
+ $vars['head_title'] = page_title_page_get_title();
+}
+
+
+/**
+ * Implement hook_init().
+ */
+function page_title_init() {
+ // Make sure our API includes are included on all page loads.
+ page_title_include_api_files();
+}
+
+
+/**
+ * Function to ensure API files are included.
+ * We use a static variable so we can use include, which is faster than include_one
+ */
+function page_title_include_api_files() {
+ // Using $runonce, we can ensure the include code below only gets run once.
+ $runonce = &drupal_static(__FUNCTION__, FALSE);
+ if ($runonce) return;
+
+ // Include relevant page_title.inc's. We cannot use drupal_load() here due to the folder structure.
+ // We also avoice using include_once due to its performance hit on the Filesystem
+ foreach (page_title_get_module_apis() as $module => $info) {
+ if (file_exists(DRUPAL_ROOT . "/{$info['path']}/{$module}.page_title.inc")) {
+ include DRUPAL_ROOT . "/{$info['path']}/{$module}.page_title.inc";
+ }
+ }
+
+ $runonce = TRUE;
+}
+
+
+/**
+ * Form Alter handler for the views ui config form (used for filters and args)
+ */
+function page_title_form_views_ui_config_item_form_alter(&$form, &$form_state) {
+ // Don't bother altering non-argument forms
+ if ($form_state['type'] != 'argument') return;
+
+ $view = &$form_state['view'];
+ $display_handler = &$view->display_handler;
+
+ // Check the display handler is a page - if not, dont bother altering.
+ if ($display_handler->display->display_plugin != 'page_with_page_title') return;
+
+ // Now check the display has arguments. This ensures we are on an overidden Contextual Filter
+ if (empty($display_handler->options['arguments'])) return;
+
+ list($display_id, $section, $section_id) = explode('-', $form['#secton']);
+ $argument_handler = &$form_state['handler'];
+
+ // Build a page title options fieldset wrapper
+ $form['options']['page_title_pattern'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Page Title'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ '#weight' => 120,
+ );
+
+ // Add the Page Title field
+ $form['options']['page_title_pattern']['page_title_pattern'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Page Title Pattern'),
+ '#description' => t('Optionally enter a Page Title Pattern for this argument. This will override the main view Page Title Pattern. You can also use the tokens below.'),
+ '#default_value' => $argument_handler->options['page_title_pattern'],
+ '#parents' => array('options', 'page_title_pattern'),
+ '#element_validate' => array('token_element_validate_token_context'),
+ '#token_types' => array(),
+ );
+
+ // Add the token help to a collapsed fieldset at the end of the configuration page.
+ $form['options']['page_title_pattern']['token_help'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Available Tokens List'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['options']['page_title_pattern']['token_help']['content'] = array(
+ '#theme' => 'token_tree',
+ '#token_types' => array(),
+ );
+ $form['buttons']['submit']['#submit'][] = 'page_title_form_views_ui_config_item_form_alter_submit';
+}
+
+
+/**
+ * Submit handler for the above Argument handling code
+ */
+function page_title_form_views_ui_config_item_form_alter_submit($form, &$form_state) {
+ $options = &$form_state['values']['options'];
+ $page_title_pattern = isset($options['page_title_pattern']) ? $options['page_title_pattern'] : '';
+
+ $view = &$form_state['view'];
+
+ $view->set_item_option($form_state['display_id'], $form_state['type'], $form_state['id'], 'page_title_pattern', $page_title_pattern);
+ views_ui_cache_set($view);
+}
+
+
+/**
+ * Implements hook_views_api().
+ */
+function page_title_views_api() {
+ return array(
+ 'api' => 2,
+ );
+}
+
+
+/**
+ * Implements hook_views_plugins().
+ */
+function page_title_views_plugins() {
+ return array(
+ 'module' => 'page_title',
+ 'display' => array(
+ 'page_with_page_title' => array(
+ 'title' => t('Page (with Page Title)'),
+ 'help' => t('Same as a normal Page, but also includes the Page Title control.'),
+ 'parent' => 'page',
+ 'uses hook menu' => TRUE,
+ 'use ajax' => FALSE,
+ 'use pager' => TRUE,
+ 'accept attachments' => TRUE,
+ 'admin' => t('Page with Page Title'),
+ 'module' => 'page_title',
+ 'path' => drupal_get_path('module', 'page_title') . '/views/plugins',
+ 'file' => 'page_title_plugin_display_page_with_page_title.inc',
+ 'handler' => 'page_title_plugin_display_page_with_page_title',
+ 'theme' => 'views_view',
+ 'theme path' => drupal_get_path('module', 'views') . '/theme',
+ 'theme file' => 'theme.inc',
+ ),
+ ),
+ );
+}
+
+
+/**
+ * Implements hook_entity_uuid_save().
+ */
+function page_title_uuid_entity_uuid_save(&$entity, $entity_type) {
+ if (!empty($entity->page_title)) {
+ // Insert page_title record for this entity.
+ db_insert('page_title')
+ ->fields(array(
+ 'type' => $entity_type,
+ 'id' => entity_id($entity_type, $entity),
+ 'page_title' => $entity->page_title,
+ ))
+ ->execute();
+ }
+ else {
+ // Delete item so we get an auto-generated value basedo on settings.
+ db_delete('page_title')
+ ->condition('type', $entity_type)
+ ->condition('id', entity_id($entity_type, $entity))
+ ->execute();
+ }
+}
+
+
+/**
+ * Get the Page Title Setttings
+ */
+function page_title_get_settings($flush = FALSE) {
+ static $settings = NULL;
+
+ // Flush the settings, if set.
+ if ($flush) {
+ $settings = NULL;
+ cache_clear_all('page_title:settings', 'cache');
+ }
+
+ // If we have it statically cached, return it.
+ if (!empty($settings)) {
+ return $settings;
+ }
+
+ // Get from the cache, if present
+ if ($cache = cache_get('page_title:settings')) {
+ $settings = $cache->data;
+ return $cache->data;
+ }
+
+ // We run this here as there are edge cases where it seems hook_init() and
+ // cache clearing intefere with each other, casuing INC files to not be included
+ // See: http://drupal.org/node/1567790
+ page_title_include_api_files();
+
+ // Get the settings from hook_page_title_settings().
+ $settings = module_invoke_all('page_title_settings');
+
+ // For each setting, apply a "default" mask (this makes it easier to use
+ // later as we can assume presence).
+ foreach ($settings as $k => $v) {
+ $settings[$k] = (array) $v + array(
+ 'label' => '',
+ 'label arguments' => array(),
+ 'required' => FALSE,
+ 'show field' => FALSE,
+ 'description' => '',
+ 'description arguments' => array(),
+ 'weight' => 0,
+ 'default' => '',
+ );
+ }
+
+ // Now sort
+ uasort($settings, '_page_title_settings_sort');
+
+ // Cache this so we dont have to do this EVERY time
+ cache_set('page_title:settings', $settings);
+
+ return $settings;
+}
+
+
+/**
+ * Internal function for sorting the page title settings array.
+ */
+function _page_title_settings_sort($a, $b) {
+ // Sort by weight and, failing that, label alphabetical.
+ return $a['weight'] < $b['weight'] ? -1 : ($a['weight'] > $b['weight'] ? 1 : ($a['label'] < $b['label'] ? -1 : 1));
+}
+
+
+
+/**
+ * Get a list of modules that support the current Page Title API.
+ */
+function page_title_get_module_apis() {
+ // For efficiency, cache the hook implementations and settings
+ $cache = &drupal_static(__FUNCTION__);
+
+ if (!isset($cache)) {
+ $cache = array();
+ foreach (module_implements('page_title_api') as $module) {
+ $function = $module . '_page_title_api';
+ $info = $function();
+ if (isset($info['api']) && $info['api'] == 1.000) {
+ if (!isset($info['path'])) {
+ $info['path'] = drupal_get_path('module', $module);
+ }
+ $cache[$module] = $info;
+ }
+ }
+ }
+
+ return $cache;
+}
+
+
+/**
+ * Implements hook_page_title_api().
+ */
+function page_title_page_title_api() {
+ return array(
+ 'api' => 1,
+ 'path' => drupal_get_path('module', 'page_title') . '/modules',
+ );
+}
+
+
+/**
+ * Core implementations of hook_page_title_api().
+ */
+function taxonomy_page_title_api() { return page_title_page_title_api(); }
+function node_page_title_api() { return page_title_page_title_api(); }
+function comment_page_title_api() { return page_title_page_title_api(); }
+function forum_page_title_api() { return page_title_page_title_api(); }
+function user_page_title_api() { return page_title_page_title_api(); }
+function blog_page_title_api() { return page_title_page_title_api(); }
+function views_page_title_api() { return page_title_page_title_api(); }
+function uc_catalog_page_title_api() { return page_title_page_title_api(); }
+
+
+/**
+ * Internal function for checking if Page Title is ok to run
+ */
+function page_title_is_up_to_date() {
+ return drupal_get_installed_schema_version('page_title') >= max(drupal_get_schema_versions('page_title'));
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.test b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.test
new file mode 100644
index 0000000..abc0bae
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.test
@@ -0,0 +1,193 @@
+<?php
+
+/**
+ * @file
+ * Test cases for the Page Title module.
+ */
+
+class PageTitleTestCase extends DrupalWebTestCase {
+ public static function getInfo() {
+ return array(
+ 'name' => 'Page Title',
+ 'description' => 'Ensure that Page Title functions correctly',
+ 'group' => 'Page Title',
+ 'dependencies' => array('token'),
+ );
+ }
+
+ public function setUp() {
+ parent::setUp('token', 'page_title', 'forum', 'taxonomy');
+
+ // Create an admin user
+ $this->admin_user = $this->drupalCreateUser(array(
+ 'administer page titles',
+ 'administer taxonomy',
+ 'access content',
+ 'create page content',
+ 'edit any page content',
+ 'administer forums',
+ 'create forum content',
+ 'set page title')
+ );
+ }
+
+
+ private function pageTitleCheck($path, $pattern, $tokens = array(), $section = '') {
+ // Get the path...
+ if (is_array($path)) {
+ $this->drupalGet($path['path'], $path['options']);
+ }
+ else {
+ $this->drupalGet($path);
+ }
+
+ // Apply tokens to pattern
+ $title = strtr($pattern, $tokens);
+
+ // Do some verbose output
+ $this->pass(t('Pattern: %pat', array('%pat' => '<title>' . $pattern . '</title>')));
+ $this->pass(t('Looking for title: %title', array('%title' => '<title>' . $title . '</title>')));
+
+ // Look for the title in the content
+ $res = $this->assertRaw($title, t('Correct page title found in the <head> for: %section', array('%section' => $section)), 'Page Title');
+
+ // If the search failed, do some more verbose debugging
+ if (!$res) {
+ preg_match('/<title>.*<\/title>/', $this->drupalGetContent(), $found_title);
+ $this->pass(t('Found instead: %found', array('%found' => $found_title[0])));
+ }
+ }
+
+
+ public function testPageTitleTest() {
+ $this->drupalLogin($this->admin_user);
+
+ // Create a term
+ $term = array(
+ 'name' => 'Test Term Foo',
+ );
+ $this->drupalPost('admin/structure/taxonomy/tags/add', $term, t('Save'));
+
+
+
+
+ // Define our settings
+ $settings = array(
+ 'page_title_default' => '[current-page:page-title] - DEFAULT TEST',
+ 'page_title_front' => '[site:name]',
+ 'page_title_user' => 'Profile For [user]',
+ 'page_title_type_page' => 'PAGE NODE: [current-page:page-title]',
+ 'page_title_type_page_showfield' => 1,
+ 'page_title_type_forum' => 'Forum - [current-page:page-title]',
+ 'page_title_pager_pattern' => ' - page [current-page:page-number]',
+ 'page_title_vocab_forums' => 'FORUM: [term:name]',
+ 'page_title_vocab_tags' => 'TERM: [current-page:page-title]',
+ 'page_title_vocab_forums_showfield' => 1,
+ 'page_title_vocab_tags_showfield' => 1,
+ 'page_title_forum_root_title' => 'Welcome to [site:name] [current-page:page-title]',
+ );
+
+ // Save the settings
+ $this->drupalPost('admin/config/search/page-title', $settings, t('Save configuration'));
+ $this->assertText(t('The configuration options have been saved.'), t('The configuration saved message was found'), 'Page Title');
+
+
+
+
+
+ /**
+ * Lets check the frontpage page title is working
+ */
+ $this->pageTitleCheck('<front>', $settings['page_title_front'], array('[site:name]' => 'Drupal'), 'Frontpage Title');
+
+
+
+ /**
+ * Lets check a "default" page, such a the page title admin form
+ */
+ $this->pageTitleCheck('admin/config/search/page-title', $settings['page_title_default'], array('[current-page:page-title]' => 'Page titles'), 'Admin Page');
+
+
+
+ /**
+ * Let's create a page node and check that
+ */
+
+ //Create a basic page node
+ $node = array(
+ 'type' => 'page',
+ 'title' => 'Test Page Node',
+ 'taxonomy' => array(2 => 1), // Set taxonomy for vocab 2 to term 1 See Hack/assumption above
+ );
+
+ // Save the node
+ $node = $this->drupalCreateNode($node);
+
+ // Pass out a message to confirm the save
+ $this->pass(t('Created Node !nid', array('!nid' => $node->nid)), 'Page Title');
+
+ // Load the node page and check for the title in the head
+ $this->pageTitleCheck('node/' . $node->nid, $settings['page_title_type_page'], array('[current-page:page-title]' => $node->title), 'Page Node Type');
+
+ // Post a page_title into the node and reload the node
+ $edit['page_title'] = 'I am a test Page Title field';
+ $this->drupalPost('node/' . $node->nid . '/edit', $edit, 'Save');
+ $node = node_load($node->nid, NULL, TRUE);
+
+ // Node load the node page and check for the title in the head
+ $this->pageTitleCheck('node/' . $node->nid, $settings['page_title_type_page'], array('[current-page:page-title]' => $node->page_title), 'Page Node Type');
+
+
+
+ /**
+ * TAXONOMY
+ */
+
+ // Lets check a taxonomy/term/tid page (should be term from earlier!)
+ // Load the term page and check for the title in the head
+ $this->pageTitleCheck('taxonomy/term/2', $settings['page_title_vocab_tags'], array('[current-page:page-title]' => $term['name']), 'Taxonomy Title');
+
+
+
+ // Lets check the pagenation suffix is working but appending it to taxonomy/term/1.
+ // This is a little messy - but it works for our purpose
+ // Remember, the page value in the URL is zero indexed. This means page=1 in URL is Page 2 on the site
+ $this->pageTitleCheck(
+ array('path' => 'taxonomy/term/2', 'options' => array('query' => array('page' => 1))),
+ $settings['page_title_vocab_tags'] . $settings['page_title_pager_pattern'],
+ array('[current-page:page-title]' => $term['name'], '[current-page:page-number]' => 2),
+ 'Taxonomy Title with pagenation suffix'
+ );
+
+
+
+ /**
+ * FORUMS
+ */
+ // Updating term 1 - The General Discussion forum
+ #$forum_forum = array('page_title' => 'I AM A TEST FORUM');
+ #$this->drupalPost('admin/structure/forum/edit/forum/1', $forum_forum, t('Save'));
+
+ //Create a basic forum topic node
+ $forum_node = array(
+ 'nid' => NULL,
+ 'type' => 'forum',
+ 'title' => 'Test Forum Node',
+ 'taxonomy_forums' => array('und' => array(0 => array('tid' => 1))), // Set taxonomy for vocab 1 (forum vocab) to term 1 (the General discussion forum)... See Hack/assumptions above
+ );
+
+ // Save the node
+ $forum_node = $this->drupalCreateNode($forum_node);
+
+
+ // Node load the node page and check for the title in the head
+ $this->pageTitleCheck('node/' . $forum_node->nid, $settings['page_title_type_forum'], array('[current-page:page-title]' => $forum_node->title), 'Forum Topic');
+
+
+ //Now test the forum root...
+ $this->pageTitleCheck('forum', $settings['page_title_forum_root_title'], array('[current-page:page-title]' => 'Forums', '[site:name]' => 'Drupal'), 'Forum Topic');
+
+ //Now test the forum forum...
+ $this->pageTitleCheck('forum/1', $settings['page_title_vocab_forums'], array('[term:name]' => 'General discussion'), 'Forum Container');
+ }
+}
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;
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.views.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.views.inc
new file mode 100644
index 0000000..a3e4c48
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.views.inc
@@ -0,0 +1,72 @@
+<?php
+
+/**
+ * @file
+ * Include file for Views hooks
+ */
+
+
+/**
+ * Implements hook_views_data().
+ *
+ * Provides the Page Title as a Views field for Views 2.
+ */
+function page_title_views_data() {
+ $data = array();
+
+ // Define the table.
+ $data['page_title']['table']['group'] = t('Page Title');
+
+ // Join the node table.
+ $data['page_title']['table']['join'] = array(
+ 'node' => array(
+ 'table' => 'page_title',
+ 'left_field' => 'nid',
+ 'field' => 'id',
+ 'extra' => array(
+ array('field' => 'type', 'value' => 'node', 'operator' => '='),
+ ),
+ ),
+ );
+
+ // Define the field.
+ $data['page_title']['page_title'] = array(
+ 'title' => t('Title'),
+ 'help' => t('A Page Title alternative to the Node: Title field.'),
+ 'field' => array(
+ 'field' => 'page_title', // The real field.
+ 'group' => t('Page Title'), // The group it appears in on the UI.
+ 'handler' => 'views_handler_field_node_page_title',
+ 'click sortable' => TRUE,
+ ),
+ 'sort' => array(
+ 'handler' => 'views_handler_sort',
+ ),
+ // Information for accepting a Page Title as a filter.
+ 'filter' => array(
+ 'handler' => 'views_handler_filter_string', // We can "borrow" the node handler.
+ ),
+ 'argument' => array(
+ 'handler' => 'views_handler_argument_string', // We can "borrow" the node handler.
+ ),
+ );
+ return $data;
+}
+
+
+/**
+ * Implements hook_views_handlers().
+ */
+function page_title_views_handlers() {
+ return array(
+ 'info' => array(
+ 'path' => drupal_get_path('module', 'page_title'),
+ ),
+ 'handlers' => array(
+ // field handlers
+ 'views_handler_field_node_page_title' => array(
+ 'parent' => 'views_handler_field',
+ ),
+ ),
+ );
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.views_default.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.views_default.inc
new file mode 100644
index 0000000..4c53a1c
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/page_title.views_default.inc
@@ -0,0 +1,209 @@
+<?php
+
+
+/**
+ * @file
+ * Default Page Title Views
+ */
+
+
+/**
+ * Implementation hook_views_default_views().
+ */
+function page_title_views_default_views() {
+ // This lets us locally cache the result - in case the function is called twice
+ static $views;
+ if (isset($views)) {
+ return $views;
+ }
+
+ // No views cached, generate the default views array and return
+ $views = array();
+ $views += _page_title_views_default_views_list_node_page_titles();
+ return $views;
+}
+
+
+/**
+ * Local "internal" function as a wrapper aroudn the list_page_titles view
+ */
+function _page_title_views_default_views_list_node_page_titles() {
+ $view = new view;
+ $view->name = 'list_node_page_titles';
+ $view->description = 'List all Nodes with their Page Titles';
+ $view->tag = '';
+ $view->base_table = 'node';
+ $view->human_name = 'List Node Page Titles';
+ $view->core = 7;
+ $view->api_version = '3.0-alpha1';
+ $view->disabled = FALSE;
+
+ /* Display: Defaults */
+ $handler = $view->new_display('default', 'Defaults', 'default');
+ $handler->display->display_options['title'] = 'Page Title List';
+ $handler->display->display_options['use_ajax'] = FALSE;
+ $handler->display->display_options['access']['type'] = 'perm';
+ $handler->display->display_options['access']['perm'] = 'administer page titles';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'full';
+ $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+ $handler->display->display_options['pager']['options']['offset'] = '0';
+ $handler->display->display_options['pager']['options']['id'] = '0';
+ $handler->display->display_options['pager']['options']['expose']['items_per_page'] = TRUE;
+ $handler->display->display_options['pager']['options']['expose']['items_per_page_options'] = '5, 10, 25, 50';
+ $handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 1;
+ $handler->display->display_options['style_plugin'] = 'table';
+ $handler->display->display_options['style_options']['columns'] = array(
+ 'nid' => 'nid',
+ 'title' => 'title',
+ 'edit_node' => 'edit_node',
+ );
+ $handler->display->display_options['style_options']['default'] = 'nid';
+ $handler->display->display_options['style_options']['info'] = array(
+ 'nid' => array(
+ 'sortable' => 1,
+ 'default_sort_order' => 'desc',
+ 'align' => '',
+ 'separator' => '',
+ ),
+ 'title' => array(
+ 'sortable' => 1,
+ 'default_sort_order' => 'asc',
+ 'align' => '',
+ 'separator' => '',
+ ),
+ 'page_title' => array(
+ 'sortable' => 1,
+ 'default_sort_order' => 'asc',
+ 'align' => '',
+ 'separator' => '',
+ ),
+ 'edit_node' => array(
+ 'align' => '',
+ 'separator' => '',
+ ),
+ );
+ $handler->display->display_options['style_options']['override'] = 1;
+ $handler->display->display_options['style_options']['sticky'] = 0;
+ $handler->display->display_options['style_options']['order'] = 'desc';
+ /* Header: Header Text */
+ $handler->display->display_options['header']['area']['id'] = 'area';
+ $handler->display->display_options['header']['area']['table'] = 'views';
+ $handler->display->display_options['header']['area']['field'] = 'area';
+ $handler->display->display_options['header']['area']['ui_name'] = 'Header Text';
+ $handler->display->display_options['header']['area']['empty'] = FALSE;
+ $handler->display->display_options['header']['area']['content'] = 'Listed below are all the nodes on the site with their Page Title (if set).';
+ /* Empty text: Empty Text */
+ $handler->display->display_options['empty']['area']['id'] = 'area';
+ $handler->display->display_options['empty']['area']['table'] = 'views';
+ $handler->display->display_options['empty']['area']['field'] = 'area';
+ $handler->display->display_options['empty']['area']['ui_name'] = 'Empty Text';
+ $handler->display->display_options['empty']['area']['empty'] = FALSE;
+ $handler->display->display_options['empty']['area']['content'] = 'There is no content to list.';
+ /* Field: Node: Nid */
+ $handler->display->display_options['fields']['nid']['id'] = 'nid';
+ $handler->display->display_options['fields']['nid']['table'] = 'node';
+ $handler->display->display_options['fields']['nid']['field'] = 'nid';
+ /* Field: Node: Title */
+ $handler->display->display_options['fields']['title']['id'] = 'title';
+ $handler->display->display_options['fields']['title']['table'] = 'node';
+ $handler->display->display_options['fields']['title']['field'] = 'title';
+ $handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
+ $handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
+ $handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
+ $handler->display->display_options['fields']['title']['alter']['trim'] = 0;
+ $handler->display->display_options['fields']['title']['alter']['word_boundary'] = 1;
+ $handler->display->display_options['fields']['title']['alter']['ellipsis'] = 1;
+ $handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
+ $handler->display->display_options['fields']['title']['alter']['html'] = 0;
+ $handler->display->display_options['fields']['title']['element_label_colon'] = 1;
+ $handler->display->display_options['fields']['title']['element_default_classes'] = 1;
+ $handler->display->display_options['fields']['title']['hide_empty'] = 0;
+ $handler->display->display_options['fields']['title']['empty_zero'] = 0;
+ $handler->display->display_options['fields']['title']['link_to_node'] = 1;
+ /* Field: Page Title: Title */
+ $handler->display->display_options['fields']['page_title']['id'] = 'page_title';
+ $handler->display->display_options['fields']['page_title']['table'] = 'page_title';
+ $handler->display->display_options['fields']['page_title']['field'] = 'page_title';
+ $handler->display->display_options['fields']['page_title']['alter']['alter_text'] = 0;
+ $handler->display->display_options['fields']['page_title']['alter']['make_link'] = 0;
+ $handler->display->display_options['fields']['page_title']['alter']['absolute'] = 0;
+ $handler->display->display_options['fields']['page_title']['alter']['trim'] = 0;
+ $handler->display->display_options['fields']['page_title']['alter']['word_boundary'] = 1;
+ $handler->display->display_options['fields']['page_title']['alter']['ellipsis'] = 1;
+ $handler->display->display_options['fields']['page_title']['alter']['strip_tags'] = 0;
+ $handler->display->display_options['fields']['page_title']['alter']['html'] = 0;
+ $handler->display->display_options['fields']['page_title']['element_label_colon'] = 1;
+ $handler->display->display_options['fields']['page_title']['element_default_classes'] = 1;
+ $handler->display->display_options['fields']['page_title']['hide_empty'] = 0;
+ $handler->display->display_options['fields']['page_title']['empty_zero'] = 0;
+ $handler->display->display_options['fields']['page_title']['link_to_node'] = 0;
+ $handler->display->display_options['fields']['page_title']['use_node_title'] = 0;
+ /* Field: Node: Edit link */
+ $handler->display->display_options['fields']['edit_node']['id'] = 'edit_node';
+ $handler->display->display_options['fields']['edit_node']['table'] = 'node';
+ $handler->display->display_options['fields']['edit_node']['field'] = 'edit_node';
+ /* Filter: Node: Nid */
+ $handler->display->display_options['filters']['nid']['id'] = 'nid';
+ $handler->display->display_options['filters']['nid']['table'] = 'node';
+ $handler->display->display_options['filters']['nid']['field'] = 'nid';
+ $handler->display->display_options['filters']['nid']['exposed'] = TRUE;
+ $handler->display->display_options['filters']['nid']['expose']['use_operator'] = FALSE;
+ $handler->display->display_options['filters']['nid']['expose']['label'] = 'Node ID (NID) is:';
+ $handler->display->display_options['filters']['nid']['expose']['identifier'] = 'nid';
+ $handler->display->display_options['filters']['nid']['expose']['single'] = TRUE;
+ /* Filter: Node: Title */
+ $handler->display->display_options['filters']['title']['id'] = 'title';
+ $handler->display->display_options['filters']['title']['table'] = 'node';
+ $handler->display->display_options['filters']['title']['field'] = 'title';
+ $handler->display->display_options['filters']['title']['operator'] = 'contains';
+ $handler->display->display_options['filters']['title']['exposed'] = TRUE;
+ $handler->display->display_options['filters']['title']['expose']['use_operator'] = FALSE;
+ $handler->display->display_options['filters']['title']['expose']['label'] = 'Title Contains:';
+ $handler->display->display_options['filters']['title']['expose']['identifier'] = 'title';
+ $handler->display->display_options['filters']['title']['expose']['single'] = TRUE;
+ /* Filter: Page Title: Title */
+ $handler->display->display_options['filters']['page_title']['id'] = 'page_title';
+ $handler->display->display_options['filters']['page_title']['table'] = 'page_title';
+ $handler->display->display_options['filters']['page_title']['field'] = 'page_title';
+ $handler->display->display_options['filters']['page_title']['operator'] = 'contains';
+ $handler->display->display_options['filters']['page_title']['exposed'] = TRUE;
+ $handler->display->display_options['filters']['page_title']['expose']['use_operator'] = FALSE;
+ $handler->display->display_options['filters']['page_title']['expose']['label'] = '"Page Title" Contains:';
+ $handler->display->display_options['filters']['page_title']['expose']['identifier'] = 'page_title';
+ $handler->display->display_options['filters']['page_title']['expose']['single'] = TRUE;
+
+ /* Display: Page */
+ $handler = $view->new_display('page', 'Page', 'page_1');
+ $handler->display->display_options['path'] = 'admin/reports/page-title';
+ $handler->display->display_options['menu']['type'] = 'normal';
+ $handler->display->display_options['menu']['title'] = 'Page Title List';
+ $handler->display->display_options['menu']['description'] = 'List all nodes with their Page Titles';
+ $handler->display->display_options['menu']['weight'] = '0';
+ $translatables['list_page_titles'] = array(
+ t('Defaults'),
+ t('Page Title List'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort By'),
+ t('Asc'),
+ t('Desc'),
+ t('Items per page'),
+ t('- All -'),
+ t('Offset'),
+ t('Listed below are all the nodes on the site with their Page Title (if set).'),
+ t('There is no content to list.'),
+ t('Nid'),
+ t('Title'),
+ t('Edit link'),
+ t('Node ID (NID) is:'),
+ t('Title Contains:'),
+ t('"Page Title" Contains:'),
+ t('Page'),
+ );
+
+ return array($view->name => $view);
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/views/plugins/page_title_plugin_display_page_with_page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/views/plugins/page_title_plugin_display_page_with_page_title.inc
new file mode 100644
index 0000000..de4d85b
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/views/plugins/page_title_plugin_display_page_with_page_title.inc
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * @file
+ * Custom Views display handler. Extends the Page display by adding our own page title option to it.
+ */
+
+class page_title_plugin_display_page_with_page_title extends views_plugin_display_page {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['page_title_pattern'] = array('default' => '');
+ return $options;
+ }
+
+ function options_summary(&$categories, &$options) {
+ parent::options_summary($categories, $options);
+
+ // Lookup the current title and strip any tags out.
+ $title = strip_tags($this->get_option('page_title_pattern'));
+
+ if (empty($title)) {
+ $title = t('None');
+ }
+ elseif (drupal_strlen($title) > 16) {
+ $title = drupal_substr($title, 0, 16) . '...';
+ }
+
+ $options['page_title_pattern'] = array(
+ 'category' => 'page',
+ 'title' => t('Page Title Pattern'),
+ 'value' => $title,
+ );
+ }
+
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ if ($form_state['section'] == 'page_title_pattern') {
+ $form['#title'] = t('The <em>Page Title Pattern</em> of this view');
+
+ $form['page_title_pattern'] = array(
+ '#title' => t('Page Title Pattern'),
+ '#type' => 'textfield',
+ '#description' => t('Optionally use this field to define a Page Title Pattern (not the Page Title). You may use the Tokens listed below'),
+ '#default_value' => $this->get_option('page_title_pattern'),
+ );
+
+ // Add the token help to a collapsed fieldset at the end of the configuration page.
+ $form['token_help'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Available Tokens List'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['token_help']['content'] = array(
+ '#theme' => 'token_tree',
+ '#token_types' => array(),
+ );
+ }
+ }
+
+
+ function options_submit(&$form, &$form_state) {
+ parent::options_submit($form, $form_state);
+
+ if ($form_state['section'] == 'page_title_pattern') {
+ $this->set_option('page_title_pattern', $form_state['values']['page_title_pattern']);
+ }
+ }
+}
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/page_title/views_handler_field_node_page_title.inc b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/views_handler_field_node_page_title.inc
new file mode 100644
index 0000000..bec0a6f
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/page_title/views_handler_field_node_page_title.inc
@@ -0,0 +1,96 @@
+<?php
+/**
+ * @file
+ * Contains the Views field handler for the Page Title field.
+ */
+
+/**
+ * Field handler to provide simple renderer that allows linking to a node.
+ *
+ * This is a copy from views_handler_field_node.inc in the Views module.
+ * Additions are commented inline.
+ */
+class views_handler_field_node_page_title extends views_handler_field_node {
+
+ /**
+ * We need to tweak the init() - if we fallback to title, ensure title is in the query!
+ */
+ function init(&$view, &$options) {
+ parent::init($view, $options);
+ if (!empty($this->options['use_node_title'])) {
+ $this->additional_fields['title'] = array('table' => 'node', 'field' => 'title');
+ }
+ }
+
+
+ /**
+ * Define out default options
+ */
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['link_to_node'] = array('default' => FALSE);
+
+ // Page Title: Adding the node title fallback option and default value.
+ $options['use_node_title'] = array('default' => FALSE);
+
+ return $options;
+ }
+
+ /**
+ * Provide link to node option and fallback to node title option.
+ */
+ function options_form(&$form, &$form_state) {
+ parent::options_form($form, $form_state);
+
+ $form['link_to_node'] = array(
+ '#title' => t('Link this field to its node'),
+ '#description' => t('This will override any other link you have set.'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['link_to_node']),
+ );
+
+ // Page Title: Adding the form field for the node title fallback option.
+ $form['use_node_title'] = array(
+ '#title' => t('Fall back on to Node: Title'),
+ '#description' => t('If no Page Title is set for a node then the normal node title will be used instead.'),
+ '#type' => 'checkbox',
+ '#default_value' => !empty($this->options['use_node_title']),
+ );
+ }
+
+ /**
+ * Render whatever the data is as a link to the node.
+ *
+ * Data should be made XSS safe prior to calling this function.
+ */
+ function render_link($data, $values) {
+ if (!empty($this->options['link_to_node']) && $data !== NULL && $data !== '') {
+ $this->options['alter']['make_link'] = TRUE;
+
+ $key = isset($this->aliases['nid']) ? $this->aliases['nid'] : 'nid';
+ $this->options['alter']['path'] = "node/" . $values->{$key};
+
+ if (isset($this->aliases['language'])) {
+ $languages = language_list();
+ if (isset($languages[$values->{$this->aliases['language']}])) {
+ $this->options['alter']['language'] = $languages[$values->{$this->aliases['language']}];
+ }
+ else {
+ unset($this->options['alter']['language']);
+ }
+ }
+ }
+ return $data;
+ }
+
+ function render($values) {
+ if (empty($values->{$this->field_alias}) && !empty($this->options['use_node_title'])) {
+ $key = isset($this->aliases['title']) ? $this->aliases['title'] : 'title';
+ return $this->render_link(check_plain($values->{$key}), $values);
+ }
+ else {
+ return $this->render_link(check_plain($values->{$this->field_alias}), $values);
+ }
+ }
+}
+