function power_menu_preprocess_page in Power Menu 7
Same name and namespace in other branches
- 6 power_menu.module \power_menu_preprocess_page()
Implements hook_preproces_page().
loading properties for the page scope
Parameters
$vars:
File
- ./
power_menu.module, line 653 - This module provides some additional menu features. The features are not actually new, but are part of other modules. it's though very cumbersome to creating a new menu item, because one has to go to all the different places to configure these…
Code
function power_menu_preprocess_page(&$vars) {
$mlid = power_menu_get_mlid(check_plain($_GET['q']));
if (isset($vars['node']) && is_object($vars['node'])) {
$item = power_menu_node_location($vars['node']);
$mlid = power_menu_get_mlid($item['href']);
}
foreach (power_menu_get_all_property_definitions() as $item) {
if ($item['scope'] == 'page') {
include_once DRUPAL_ROOT . '/' . $item['path'] . '/' . $item['file'];
$ml = is_object($mlid) ? $mlid->mlid : $mlid;
$vars[$item['property_name']] = $item['property_load']($ml);
}
}
}