Commit 6ae12dda authored by Nicholas Thompson's avatar Nicholas Thompson
Browse files

Converted function static variables to use drupal_static + fixed an admin form...

Converted function static variables to use drupal_static + fixed an admin form bug with the current-user token
parent 9664469d
......@@ -216,8 +216,8 @@ function theme_page_title_token_help() {
$output = '<p>'. t('Available tokens are:') .'</p>';
$output .= '<dl>';
// TODO - figure out what to do with the user token...
unset($token_info['types']['user']);
// TODO - figure out what to do with the curren user token...
unset($token_info['types']['current-user']);
foreach($token_info['types'] as $key => $type) {
$output .= "<dt><strong>{$type['name']}</strong> - {$type['description']}</dt>";
......
......@@ -416,7 +416,7 @@ function page_title_user_cancel(&$edit, &$account, $method) {
* string the title for the current page
*/
function page_title_get_title($raw = FALSE) {
static $title;
$title = &drupal_static(__FUNCTION__);
if (empty($title)) {
// If we're looking at a node or a comment on a node, get the node object from the menu system.
......@@ -506,11 +506,12 @@ function page_title_node_get_title($nid) {
* NOTE: This has been depreicated in favour of hook_page_title_alter().
*/
function page_title_set_title($title = NULL) {
static $stored_title;
$stored_title = &drupal_static(__FUNCTION__);
if (isset($title)) {
$stored_title = $title;
}
return $stored_title;
}
......@@ -527,10 +528,11 @@ function page_title_set_title($title = NULL) {
* string The page's title.
*/
function page_title_page_get_title($raw = FALSE) {
static $title = NULL;
$title = &drupal_static(__FUNCTION__);
$types = array('global' => NULL);
if (is_null($title)) {
if (!isset($title)) {
// If frontpage, then use the frontpage pattern and set the title.
if (drupal_is_front_page()) {
// Get the frontpage pattern
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment