示例#1
0
function right_nav()
{
    global $USER, $THEME;
    safe_require('notification', 'internal');
    $unread = $USER->get('unread');
    $menu = array('settings' => array('path' => 'settings', 'url' => 'account/index.php', 'title' => get_string('settings'), 'alt' => '', 'weight' => 10, 'iconclass' => 'cogs'), 'inbox' => array('path' => 'inbox', 'url' => 'account/activity/index.php', 'title' => get_string('inbox'), 'alt' => get_string('inbox'), 'count' => $unread, 'countclass' => 'unreadmessagecount', 'linkid' => 'mail', 'weight' => 20, 'iconclass' => 'envelope'), 'settings/account' => array('path' => 'settings/account', 'url' => 'account/index.php', 'title' => get_config('dropdownmenu') ? get_string('general') : get_string('account'), 'weight' => 10, 'iconclass' => 'user'), 'settings/notifications' => array('path' => 'settings/notifications', 'url' => 'account/activity/preferences/index.php', 'title' => get_string('notifications'), 'weight' => 30, 'iconclass' => 'flag'));
    // enable plugins to augment the menu structure
    foreach (array('artefact', 'interaction', 'module') as $plugintype) {
        if ($plugins = plugins_installed($plugintype)) {
            foreach ($plugins as &$plugin) {
                if (safe_require_plugin($plugintype, $plugin->name)) {
                    $plugin_nav_menu = call_static_method(generate_class_name($plugintype, $plugin->name), 'right_nav_menu_items');
                    $menu = array_merge($menu, $plugin_nav_menu);
                }
            }
        }
    }
    // local_right_nav_update allows sites to customise the menu by munging the $menu array.
    if (function_exists('local_right_nav_update')) {
        local_right_nav_update($menu);
    }
    $menu_structure = find_menu_children($menu, '');
    return $menu_structure;
}
示例#2
0
function right_nav()
{
    global $USER, $THEME;
    safe_require('notification', 'internal');
    $unread = $USER->get('unread');
    $menu = array('settings' => array('path' => 'settings', 'url' => 'account/index.php', 'title' => get_string('settings'), 'icon' => $THEME->get_url('images/settings.png'), 'alt' => get_string('settings'), 'weight' => 10), 'inbox' => array('path' => 'inbox', 'url' => 'account/activity/index.php', 'icon' => $THEME->get_url($unread ? 'images/newmail.png' : 'images/message.png'), 'alt' => get_string('inbox'), 'count' => $unread, 'countclass' => 'unreadmessagecount', 'weight' => 20), 'settings/account' => array('path' => 'settings/account', 'url' => 'account/index.php', 'title' => get_config('dropdownmenu') ? get_string('general') : get_string('account'), 'weight' => 10), 'settings/notifications' => array('path' => 'settings/notifications', 'url' => 'account/activity/preferences/index.php', 'title' => get_string('notifications'), 'weight' => 30));
    // enable plugins to augment the menu structure
    if ($plugins = plugins_installed('artefact')) {
        foreach ($plugins as &$plugin) {
            safe_require('artefact', $plugin->name);
            $plugin_menu = call_static_method(generate_class_name('artefact', $plugin->name), 'menu_items');
            $menu = array_merge($menu, $plugin_menu);
        }
    }
    if ($plugins = plugins_installed('interaction')) {
        foreach ($plugins as &$plugin) {
            safe_require('interaction', $plugin->name);
            $plugin_menu = call_static_method(generate_class_name('interaction', $plugin->name), 'menu_items');
            $menu = array_merge($menu, $plugin_menu);
        }
    }
    // local_right_nav_update allows sites to customise the menu by munging the $menu array.
    if (function_exists('local_right_nav_update')) {
        local_right_nav_update($menu);
    }
    $menu_structure = find_menu_children($menu, '');
    return $menu_structure;
}