本文整理汇总了PHP中add_menu函数的典型用法代码示例。如果您正苦于以下问题:PHP add_menu函数的具体用法?PHP add_menu怎么用?PHP add_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_menu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bookmarks_init
function bookmarks_init()
{
// Grab the config global
global $CONFIG;
//add a tools menu option
if (isloggedin()) {
add_menu(elgg_echo('bookmarks'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . '/items');
// add "bookmark this" to owner block
elgg_extend_view('owner_block/extend', 'bookmarks/owner_block');
}
// Register a page handler, so we can have nice URLs
register_page_handler('bookmarks', 'bookmarks_page_handler');
// Add our CSS
elgg_extend_view('css', 'bookmarks/css');
// Register granular notification for this type
if (is_callable('register_notification_object')) {
register_notification_object('object', 'bookmarks', elgg_echo('bookmarks:new'));
}
// Listen to notification events and supply a more useful message
register_plugin_hook('notify:entity:message', 'object', 'bookmarks_notify_message');
// Register a URL handler for shared items
register_entity_url_handler('bookmark_url', 'object', 'bookmarks');
// Shares widget
add_widget_type('bookmarks', elgg_echo("bookmarks:recent"), elgg_echo("bookmarks:widget:description"));
// Register entity type
register_entity_type('object', 'bookmarks');
// Add group menu option
add_group_tool_option('bookmarks', elgg_echo('bookmarks:enablebookmarks'), true);
}
示例2: thewire_init
/**
* thewire initialisation
*
* These parameters are required for the event API, but we won't use them:
*
* @param unknown_type $event
* @param unknown_type $object_type
* @param unknown_type $object
*/
function thewire_init()
{
// Load system configuration
global $CONFIG;
// Set up menu for logged in users
if (isloggedin()) {
add_menu(elgg_echo('thewire'), $CONFIG->wwwroot . "mod/thewire/everyone.php");
}
// Extend system CSS with our own styles, which are defined in the thewire/css view
extend_view('css', 'thewire/css');
//extend views
extend_view('activity/thewire', 'thewire/activity_view');
extend_view('profile/status', 'thewire/profile_status');
// Register a page handler, so we can have nice URLs
register_page_handler('thewire', 'thewire_page_handler');
// Register a URL handler for thewire posts
register_entity_url_handler('thewire_url', 'object', 'thewire');
// Your thewire widget
add_widget_type('thewire', elgg_echo("thewire:read"), elgg_echo("thewire:yourdesc"));
// Register entity type
register_entity_type('object', 'thewire');
// Listen for SMS create event
register_elgg_event_handler('create', 'object', 'thewire_incoming_sms');
// Register granular notification for this type
if (is_callable('register_notification_object')) {
register_notification_object('object', 'thewire', elgg_echo('thewire:newpost'));
}
// Listen to notification events and supply a more useful message for SMS'
register_plugin_hook('notify:entity:message', 'object', 'thewire_notify_message');
}
示例3: tasks_init
function tasks_init()
{
// Grab the config file
global $CONFIG;
extend_view('metatags', 'tasks/js');
//add a tools menu option
if (isloggedin()) {
add_menu(elgg_echo('tasks'), $CONFIG->wwwroot . "pg/tasks/" . $_SESSION['user']->username . '/items');
}
// Register a page handler, so we can have nice URLs
register_page_handler('tasks', 'tasks_page_handler');
// Add our CSS
extend_view('css', 'tasks/css');
// Add to groups context
extend_view('groups/left_column', 'tasks/groupprofile_tasks');
// Register granular notification for this type
if (is_callable('register_notification_object')) {
register_notification_object('object', 'tasks', elgg_echo('tasks:new'));
}
// Listen to notification events and supply a more useful message
register_plugin_hook('notify:entity:message', 'object', 'tasks_notify_message');
// Register a URL handler for shared items
register_entity_url_handler('task_url', 'object', 'tasks');
// Shares widget
add_widget_type('tasks', elgg_echo("tasks:recent"), elgg_echo("tasks:widget:description"));
// Register entity type
register_entity_type('object', 'tasks');
// Add group menu option
add_group_tool_option('tasks', elgg_echo('tasks:enabletasks'), true);
}
示例4: blog_init
/**
* Blog initialisation
*
* These parameters are required for the event API, but we won't use them:
*
* @param unknown_type $event
* @param unknown_type $object_type
* @param unknown_type $object
*/
function blog_init()
{
// Load system configuration
global $CONFIG;
// Set up menu for logged in users
if (isloggedin()) {
add_menu(elgg_echo('blogs'), $CONFIG->wwwroot . "pg/blog/" . $_SESSION['user']->username);
// And for logged out users
} else {
add_menu(elgg_echo('blog'), $CONFIG->wwwroot . "mod/blog/everyone.php", array());
}
// Extend system CSS with our own styles, which are defined in the blog/css view
extend_view('css', 'blog/css');
// Extend hover-over menu
extend_view('profile/menu/links', 'blog/menu');
// Register a page handler, so we can have nice URLs
register_page_handler('blog', 'blog_page_handler');
// Register a URL handler for blog posts
register_entity_url_handler('blog_url', 'object', 'blog');
// Register this plugin's object for sending pingbacks
register_plugin_hook('pingback:object:subtypes', 'object', 'blog_pingback_subtypes');
// Register granular notification for this type
if (is_callable('register_notification_object')) {
register_notification_object('object', 'blog', elgg_echo('blog:newpost'));
}
// Listen to notification events and supply a more useful message
register_plugin_hook('notify:entity:message', 'object', 'blog_notify_message');
// Listen for new pingbacks
register_elgg_event_handler('create', 'object', 'blog_incoming_ping');
// Register entity type
register_entity_type('object', 'blog');
}
示例5: file_init
/**
* File plugin initialisation functions.
*/
function file_init()
{
// Get config
global $CONFIG;
// Set up menu for logged in users
if (isloggedin()) {
add_menu(elgg_echo('file'), $CONFIG->wwwroot . "pg/file/" . $_SESSION['user']->username);
}
// Extend CSS
extend_view('css', 'file/css');
// Extend hover-over and profile menu
extend_view('profile/menu/links', 'file/menu');
extend_view('groups/left_column', 'file/groupprofile_files');
extend_view('dgroups/left_column', 'file/groupprofile_files');
// Register a page handler, so we can have nice URLs
register_page_handler('file', 'file_page_handler');
// Add a new file widget
add_widget_type('filerepo', elgg_echo("file:widget"), elgg_echo("file:widget:description"));
// Register a URL handler for files
register_entity_url_handler('file_url', 'object', 'file');
// Register granular notification for this type
if (is_callable('register_notification_object')) {
register_notification_object('object', 'file', elgg_echo('file:newupload'));
}
// Listen to notification events and supply a more useful message
register_plugin_hook('notify:entity:message', 'object', 'file_notify_message');
// add the group files tool option
add_group_tool_option('files', elgg_echo('groups:enablefiles'), true);
// Register entity type
register_entity_type('object', 'file');
}
示例6: westorElggMan_menu_add
function westorElggMan_menu_add($menu_name, $menu_url)
{
if (function_exists("elgg_register_menu_item")) {
return elgg_register_menu_item('site', array('name' => $menu_name, 'text' => $menu_name, 'href' => $menu_url));
} else {
return add_menu($menu_name, $menu_url);
}
}
示例7: diapos_init
/**
* init function;
*
*/
function diapos_init()
{
// Get config
global $CONFIG;
register_page_handler('diapos', 'diapos_page_handler');
// Add menu link
add_menu(elgg_echo('diapos'), $CONFIG->wwwroot . "pg/diapos/");
}
示例8: members_init
/**
* Elgg members plugin
* This plugin has some interesting options for users; see who is online, site members,
*
* @package Elggmembers
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd <info@elgg.com>
* @copyright Curverider Ltd 2008-2010
* @link http://elgg.com/
*/
function members_init()
{
global $CONFIG;
elgg_extend_view('css', 'members/css');
// Set up menu for logged in users
if (isloggedin()) {
add_menu(elgg_echo('members:members'), $CONFIG->wwwroot . "mod/members/index.php");
}
}
示例9: everybody_init
function everybody_init()
{
global $CONFIG;
// Set up menu for logged in users
register_translations($CONFIG->pluginspath . "everybody/languages/");
if (isloggedin()) {
add_menu(elgg_echo('everybody'), $CONFIG->wwwroot . "pg/everybody");
}
register_page_handler('everybody', 'everybody_page_handler');
}
示例10: members_init
/**
* Elgg members plugin
* This plugin has some interesting options for users; see who is online, site members,
*
* @package Elggmembers
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd <info@elgg.com>
* @copyright Curverider Ltd 2008-2009
* @link http://elgg.com/
*/
function members_init()
{
// Load system configuration
global $CONFIG;
extend_view('css', 'members/css');
// Set up menu for logged in users
if (isloggedin()) {
add_menu(elgg_echo('Members'), $CONFIG->wwwroot . "mod/members/index.php");
}
$CONFIG->member_skills = 'Arts, Account Management / Sales, Business Services, Coaching and Mentorship, Community Management, Education and Training, Engineering - Industrial, Engineering - Software, Environmental, Design, Group Facilitation, Funding, Fundraising, Health and Wellness, Insurance, ICT - Information Communication Tech, Marketing, NGO Management, Outsourcing, Project Management, Strategy / Planning, Value and Social Impact Analysis, Virtual Assistance - Data / Contact management, Virtual Assistance - Research, Virtual Assistance - Social networking, Virtual Assistance - Scheduling / ToDo List, Virtual Assistance - Technical, Virtual Assistance - Transcription, Web hosting - Systems Administration, Writing, Other';
}
示例11: dgroups_init
/**
* Initialise the dgroups plugin.
* Register actions, set up menus
*/
function dgroups_init()
{
global $CONFIG;
// Set up the menu for logged in users
if (isloggedin()) {
add_menu(elgg_echo('dgroups'), $CONFIG->wwwroot . "pg/dgroups/world/");
//add_menu(elgg_echo('dgroups:alldiscussion'),$CONFIG->wwwroot."mod/dgroups/discussions.php");
} else {
add_menu(elgg_echo('dgroups'), $CONFIG->wwwroot . "pg/dgroups/world/");
}
// Register a page handler, so we can have nice URLs
register_page_handler('dgroups', 'dgroups_page_handler');
// Register a URL handler for dgroups and forum topics
register_entity_url_handler('dgroups_url', 'group', 'dgroup');
register_entity_url_handler('dgroups_dgroupforumtopic_url', 'object', 'dgroupforumtopic');
// Register an icon handler for dgroups
register_page_handler('dgroupicon', 'dgroups_icon_handler');
// Register some actions
register_action("dgroups/edit", false, $CONFIG->pluginspath . "dgroups/actions/edit.php");
register_action("dgroups/delete", false, $CONFIG->pluginspath . "dgroups/actions/delete.php");
register_action("dgroups/join", false, $CONFIG->pluginspath . "dgroups/actions/join.php");
register_action("dgroups/leave", false, $CONFIG->pluginspath . "dgroups/actions/leave.php");
register_action("dgroups/joinrequest", false, $CONFIG->pluginspath . "dgroups/actions/joinrequest.php");
register_action("dgroups/killrequest", false, $CONFIG->pluginspath . "dgroups/actions/dgroupskillrequest.php");
register_action("dgroups/addtodgroup", false, $CONFIG->pluginspath . "dgroups/actions/addtodgroup.php");
register_action("dgroups/invite", false, $CONFIG->pluginspath . "dgroups/actions/invite.php");
extend_view('dgroups/menu/links', 'pages/menu');
// Add to groups context
extend_view('dgroups/right_column', 'pages/groupprofile_pages');
// Add to groups context
// Use dgroup widgets
use_widgets('dgroups');
// Add a page owner handler
add_page_owner_handler('dgroups_page_owner_handler');
// Add some widgets
add_widget_type('a_users_dgroups', elgg_echo('dgroups:widget:membership'), elgg_echo('dgroups:widgets:description'));
//extend some views
extend_view('profile/icon', 'dgroups/icon');
extend_view('css', 'dgroups/css');
// Write access permissions
register_plugin_hook('access:collections:write', 'all', 'dgroups_write_acl_plugin_hook');
// Notification hooks
if (is_callable('register_notification_object')) {
register_notification_object('object', 'dgroupforumtopic', elgg_echo('dgroupforumtopic:new'));
}
register_plugin_hook('object:notifications', 'object', 'dgroup_object_notifications_intercept');
// Listen to notification events and supply a more useful message
register_plugin_hook('notify:entity:message', 'object', 'dgroupforumtopic_notify_message');
// add the forum tool option
// Now override icons
register_plugin_hook('entity:icon:url', 'group', 'dgroups_dgroupicon_hook');
}
示例12: riverdashboard_init
/**
* Elgg river dashboard plugin
*/
function riverdashboard_init()
{
global $CONFIG;
// Register and optionally replace the dashboard
if (get_plugin_setting('useasdashboard', 'riverdashboard') == 'yes') {
register_page_handler('dashboard', 'riverdashboard_page_handler');
} else {
// Activity main menu
add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/");
}
// Page handler
register_page_handler('riverdashboard', 'riverdashboard_page_handler');
elgg_extend_view('css', 'riverdashboard/css');
}
示例13: mmsearch_init
function mmsearch_init()
{
global $CONFIG;
//extend css if style is required
//elgg_extend_view('css','css/jquery-ui-1.8.7.custom');
//add a widget
//add_widget_type('twitter',"Twitter","This is your twitter feed");
//add a menu
add_menu(elgg_echo('search'), $CONFIG->wwwroot . "mod/mmsearch/");
if (get_context() == "mmsearch") {
add_submenu_item(elgg_echo('Search'), $CONFIG->wwwroot . "mod/mmsearch/?username=" . $_SESSION['user']->username);
add_submenu_item(elgg_echo('Saved searches'), "#");
add_submenu_item(elgg_echo('Favorites resources'), "#");
}
}
示例14: pages_init
/**
* Initialise the pages plugin.
*
*/
function pages_init()
{
global $CONFIG;
// Set up the menu for logged in users
if (isloggedin()) {
add_menu(elgg_echo('pages'), $CONFIG->wwwroot . "pg/pages/owned/" . $_SESSION['user']->username, 'pages');
} else {
add_menu(elgg_echo('pages'), $CONFIG->wwwroot . "mod/pages/world.php");
}
// Extend hover-over menu
elgg_extend_view('profile/menu/links', 'pages/menu');
// Register a page handler, so we can have nice URLs
register_page_handler('pages', 'pages_page_handler');
// Register a url handler
register_entity_url_handler('pages_url', 'object', 'page_top');
register_entity_url_handler('pages_url', 'object', 'page');
// Register some actions
register_action("pages/edit", false, $CONFIG->pluginspath . "pages/actions/pages/edit.php");
register_action("pages/editwelcome", false, $CONFIG->pluginspath . "pages/actions/pages/editwelcome.php");
register_action("pages/delete", false, $CONFIG->pluginspath . "pages/actions/pages/delete.php");
// Extend some views
elgg_extend_view('css', 'pages/css');
elgg_extend_view('groups/menu/links', 'pages/menu');
// Add to groups context
elgg_extend_view('groups/right_column', 'pages/groupprofile_pages');
// Add to groups context
// Register entity type
register_entity_type('object', 'page');
register_entity_type('object', 'page_top');
// Register granular notification for this type
if (is_callable('register_notification_object')) {
register_notification_object('object', 'page', elgg_echo('pages:new'));
register_notification_object('object', 'page_top', elgg_echo('pages:new'));
}
// Listen to notification events and supply a more useful message
register_plugin_hook('notify:entity:message', 'object', 'page_notify_message');
// add the group pages tool option
add_group_tool_option('pages', elgg_echo('groups:enablepages'), true);
//add a widget
add_widget_type('pages', elgg_echo('pages'), elgg_echo('pages:widget:description'));
// For now, we'll hard code the groups profile items as follows:
// TODO make this user configurable
// Language short codes must be of the form "pages:key"
// where key is the array key below
$CONFIG->pages = array('title' => 'text', 'description' => 'longtext', 'tags' => 'tags', 'access_id' => 'access', 'write_access_id' => 'access');
}
示例15: mediawiki_init
/**
* mediawiki_init
*
* @return void
*/
function mediawiki_init()
{
// Load system configuration
global $CONFIG;
// Load the language files
register_translations($CONFIG->pluginspath . "mediawiki/languages/");
add_group_tool_option('mediawiki_minor_edits', elgg_echo('mediawiki:enable_minor_edits'), FALSE);
// add to the css
extend_view('css', 'mediawiki/css');
// Set up menu for users
if (isloggedin()) {
$mediawiki_url = get_plugin_setting('url', 'mediawiki');
add_menu(elgg_echo('item:object:mediawiki'), $mediawiki_url . "index.php");
}
// add a widget
add_widget_type('mediawiki', elgg_echo("mediawiki:widget_title"), elgg_echo('mediawiki:widget:description'));
}