function page_title_get_settings in Page Title 6.2
Same name and namespace in other branches
- 8.2 page_title.module \page_title_get_settings()
- 7.2 page_title.module \page_title_get_settings()
Get the Page Title settings
5 calls to page_title_get_settings()
- page_title_admin_settings in ./
page_title.admin.inc - Displays the form for the standard settings tab.
- page_title_node_type_form_submit in ./
page_title.module - Submit handler for the node_type_form element added in the hook_form_alter() above.
- page_title_page_get_title in ./
page_title.module - Determines what title should be sent to the page template.
- page_title_page_title_pattern_alter in modules/
page_title.page_title.inc - Implementation of hook_page_title_pattern_alter().
- page_title_taxonomy in ./
page_title.module - Implementation of hook_taxonomy().
File
- ./
page_title.module, line 749 - Enhanced control over the page title (in the head tag).
Code
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 Cache
if ($cache = cache_get('page_title:settings')) {
$settings = $cache->data;
return $cache->data;
}
// Ensure that the page title inc files are included before invoking
// This helps avoid the issues in #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;
}