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); }
/** * Elgg Friends widget * This plugin allows users to put a list of their friends, on their profile * * @package ElggFriends * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Curverider Ltd <*****@*****.**> * @copyright Curverider Ltd 2008-2009 * @link http://elgg.com/ */ function friends_init() { // Load system configuration global $CONFIG; //add a widget add_widget_type('friends', "Connections", elgg_echo('friends:widget:description')); }
/** * 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'); }
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); }
/** * Blog extended initialization * * Register css extensions, contentes view for groups, widgets and event handlers */ function blogextended_init() { global $CONFIG; extend_view("css", "blogextended/css"); extend_view("blog/fields_before", "blog/forms/type"); extend_view("blog/fields_before", "groups/groupselector"); //extend_view('groups/left_column', 'groups/groupcontents',1); add_widget_type('blog', elgg_echo('blog:widget:title'), elgg_echo('blog:widget:description')); register_elgg_event_handler("create", "object", "blog_type_handler"); register_elgg_event_handler("update", "object", "blog_type_handler"); register_elgg_event_handler("create", "object", "group_selector_handler"); register_elgg_event_handler("update", "object", "group_selector_handler"); register_page_handler('gblog', 'gblog_page_handler'); if (is_plugin_enabled("itemicon")) { if (!isset($CONFIG->itemicon)) { $CONFIG->itemicon[] = array(); } $CONFIG->itemicon[] = "blog"; extend_view("blog/fields_after", "itemicon/add"); } $options = array("" => "All", "WorkStories" => "Work Stories", "HowTo" => "How To's", "GroupGuides" => "Group Guides", "ManagingProjects" => "Managing a Project", "TellingYourStory" => "Telling your Story"); $CONFIG->BLOG_TYPES = $options; if (file_exists(dirname(__FILE__) . "/config.php")) { @(require_once dirname(__FILE__) . "/config.php"); } $CONFIG->blogextended = $options; }
/** * Elgg twitter widget * This plugin allows users to pull in their twitter feed to display on their profile * * @package ElggTwitter * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Curverider Ltd <*****@*****.**> * @copyright Curverider Ltd 2008-2010 * @link http://elgg.com/ */ function twitter_init() { //extend css if style is required elgg_extend_view('css', 'twitter/css'); //add a widget add_widget_type('twitter', "Twitter", "This is your twitter feed"); }
function gmap_init() { extend_view('css', 'google-map/css'); extend_view('page_elements/footer', 'google-map/footer'); extend_view('widgets/wrapper', 'google-map/gmap-support', 499); add_widget_type('google-map', elgg_echo('gmap'), elgg_echo('gmap:desc')); }
/** * 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'); }
/** * MessageBoard 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 messageboard_init() { // Load system configuration global $CONFIG; // Extend system CSS with our own styles, which are defined in the messageboard/css view extend_view('css', 'messageboard/css'); // Register a page handler, so we can have nice URLs register_page_handler('messageboard', 'messageboard_page_handler'); // add a messageboard widget add_widget_type('messageboard', "" . elgg_echo("messageboard:board") . "", "" . elgg_echo("messageboard:desc") . ".", "profile"); }
function tagcloud_init() { add_widget_type('tagcloud', elgg_echo('tagcloud:widget:title'), elgg_echo('tagcloud:widget:description')); // Extend CSS elgg_extend_view('css', 'tagcloud/css'); if (is_plugin_enabled('blog')) { // extend blog sidebar with a tag-cloud } if (is_plugin_enabled('bookmarks')) { // extend bkmrks sidebar with a tag-cloud } }
/** * 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'); }
/** * 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'); }
/** * 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')); }
/** * Elgg river dashboard plugin * * @package ElggRiverDash * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Curverider Ltd <*****@*****.**> * @copyright Curverider Ltd 2008-2010 * @link http://elgg.org/ */ 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 if (isloggedin()) { add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/"); } } // Page handler register_page_handler('riverdashboard', 'riverdashboard_page_handler'); elgg_extend_view('css', 'riverdashboard/css'); add_widget_type('river_widget', elgg_echo('river:widget:title'), elgg_echo('river:widget:description')); }
/** * Initialise the groups plugin. * Register actions, set up menus */ function groups_init() { global $CONFIG; // Set up the menu add_menu(elgg_echo('groups'), $CONFIG->wwwroot . "pg/groups/member/"); // Register a page handler, so we can have nice URLs register_page_handler('groups', 'groups_page_handler'); // Register a URL handler for groups and forum topics register_entity_url_handler('groups_url', 'group', 'all'); register_entity_url_handler('groups_groupforumtopic_url', 'object', 'groupforumtopic'); // Register an icon handler for groups register_page_handler('groupicon', 'groups_icon_handler'); // Register some actions register_action("groups/edit", false, $CONFIG->pluginspath . "groups/actions/edit.php"); register_action("groups/delete", false, $CONFIG->pluginspath . "groups/actions/delete.php"); register_action("groups/join", false, $CONFIG->pluginspath . "groups/actions/join.php"); register_action("groups/leave", false, $CONFIG->pluginspath . "groups/actions/leave.php"); register_action("groups/joinrequest", false, $CONFIG->pluginspath . "groups/actions/joinrequest.php"); register_action("groups/killrequest", false, $CONFIG->pluginspath . "groups/actions/groupskillrequest.php"); register_action("groups/killinvitation", false, $CONFIG->pluginspath . "groups/actions/groupskillinvitation.php"); register_action("groups/addtogroup", false, $CONFIG->pluginspath . "groups/actions/addtogroup.php"); register_action("groups/invite", false, $CONFIG->pluginspath . "groups/actions/invite.php"); // Use group widgets use_widgets('groups'); // Add a page owner handler add_page_owner_handler('groups_page_owner_handler'); // Add some widgets add_widget_type('a_users_groups', elgg_echo('groups:widget:membership'), elgg_echo('groups:widgets:description')); //extend some views elgg_extend_view('profile/icon', 'groups/icon'); elgg_extend_view('css', 'groups/css'); // Access permissions register_plugin_hook('access:collections:write', 'all', 'groups_write_acl_plugin_hook'); //register_plugin_hook('access:collections:read', 'all', 'groups_read_acl_plugin_hook'); // Notification hooks if (is_callable('register_notification_object')) { register_notification_object('object', 'groupforumtopic', elgg_echo('groupforumtopic:new')); } register_plugin_hook('object:notifications', 'object', 'group_object_notifications_intercept'); // Listen to notification events and supply a more useful message register_plugin_hook('notify:entity:message', 'object', 'groupforumtopic_notify_message'); // add the forum tool option add_group_tool_option('forum', elgg_echo('groups:enableforum'), true); // Now override icons register_plugin_hook('entity:icon:url', 'group', 'groups_groupicon_hook'); }
/** * @package Elgg * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Roger Curry, Grid Research Centre [curry@cpsc.ucalgary.ca] * @author Tingxi Tan, Grid Research Centre [txtan@cpsc.ucalgary.ca] * @link http://grc.ucalgary.ca/ */ function publication_init() { // Load system configuration global $CONFIG; // Set up menu for logged in users if (isloggedin()) { add_menu(elgg_echo('publications'), $CONFIG->wwwroot . "pg/publications/" . $_SESSION['user']->username); // And for logged out users } else { add_menu(elgg_echo('publications'), $CONFIG->wwwroot . "mod/publications/everyone.php", array()); } if (!$CONFIG->publication) { $CONFIG->publication['source'] = 'text'; $CONFIG->publication['year'] = 'text'; $CONFIG->publication['volume'] = 'text'; $CONFIG->publication['issue'] = 'text'; $CONFIG->publication['pages'] = 'text'; } // Extend system CSS with our own styles, which are defined in the publication/css view extend_view('css', 'publication/css'); extend_view('metatags', 'publication/metatags'); // Extend hover-over menu // extend_view('profile/menu/links','publication/menu'); extend_view('account/forms/register', 'publication/register'); // Register a page handler, so we can have nice URLs register_page_handler('publications', 'publication_page_handler'); // Register a URL handler for publication posts register_entity_url_handler('publication_url', 'object', 'publication'); // Register this plugin's object for sending pingbacks register_plugin_hook('pingback:object:subtypes', 'object', 'publication_pingback_subtypes'); // Add a new widget add_widget_type('publications', elgg_echo("publications:widget"), elgg_echo("publications:widget:description")); // Register granular notification for this type if (is_callable('register_notification_object')) { register_notification_object('object', 'publication', elgg_echo('publication:newpost')); } // Listen to notification events and supply a more useful message register_plugin_hook('notify:entity:message', 'object', 'publication_notify_message'); // Listen for new pingbacks register_elgg_event_handler('create', 'object', 'publication_incoming_ping'); // Register entity type register_entity_type('object', 'publication'); // Register an annotation handler for comments etc register_plugin_hook('entity:annotate', 'object', 'publication_annotate_comments'); }
/** * Initialize the community plugin repository plugin */ function plugins_init() { global $CONFIG; run_function_once('plugins_run_once'); // Set up menu for logged in users add_menu(elgg_echo('plugins'), "{$CONFIG->wwwroot}pg/plugins/all/"); // Extend CSS extend_view('css', 'plugins/css'); // Extend hover-over and profile menu extend_view('profile/menu/links', 'plugins/profile_menu'); extend_view('groups/left_column', 'plugins/groupprofile_files'); // Register a page handler, so we can have nice URLs register_page_handler('plugins', 'plugins_page_handler'); // Image handler register_page_handler('plugins_image', 'plugins_image_page_handler'); register_notification_object('object', 'plugins', elgg_echo('plugins:new')); //register a widget add_widget_type('plugins', elgg_echo('plugins'), elgg_echo('plugins'), 'profile'); // register url handlers for the 2 object subtypes register_entity_url_handler('plugins_release_url_handler', 'object', 'plugin_release'); register_entity_url_handler('plugins_project_url_handler', 'object', 'plugin_project'); register_elgg_event_handler('pagesetup', 'system', 'plugins_add_submenus'); // Only projects should show up in search register_entity_type('object', 'plugin_project'); // Special hook for searching against metadata (category) register_plugin_hook('search', 'object:plugin_project', 'plugins_search_hook'); // Elgg versions $CONFIG->elgg_versions = array('1.8', '1.7', '1.6', '1.5', '1.2', '1.0'); // GPL-compatible licenses $CONFIG->gpllicenses = array('none' => 'No license selected', 'gpl2' => 'GNU General Public License (GPL) version 2', 'lgpl2.1' => 'GNU Lesser General Public License (LGPL) version 2.1', 'berkeleydb' => 'Berkeley Database License (aka the Sleepycat Software Product License)', 'mbsd' => 'Modified BSD license', 'cbsd' => 'The Clear BSD License', 'expat' => 'Expat (MIT) License', 'freebsd' => 'FreeBSD license', 'intel' => 'Intel Open Source License', 'openbsd' => 'ISC (OpenBSD) License', 'ncsa' => 'NCSA/University of Illinois Open Source License', 'w3c' => 'W3C Software Notice and License', 'x11' => 'X11 License', 'zope' => 'Zope Public License, versions 2.0 and 2.1'); // Defined plugin categories $CONFIG->plugincats = array('admin' => 'Site admin', 'user' => 'User admin', 'events' => 'Events', 'authentication' => 'Authentication', 'clients' => 'Clients', 'photos' => 'Photos and Images', 'tpintegrations' => 'Third Party integrations', 'tools' => 'Tools', 'media' => 'Media', 'communication' => 'Communication', 'widgets' => 'Widgets', 'games' => 'Games', 'ecommerce' => 'eCommerce', 'languages' => 'Languages', 'themes' => 'Themes', 'misc' => 'Misc', 'uncategorized' => 'Uncategorized'); $action_base = "{$CONFIG->pluginspath}community_plugins/actions/plugins"; register_action("plugins/create_project", FALSE, "{$action_base}/create_project.php"); register_action("plugins/create_release", FALSE, "{$action_base}/create_release.php"); register_action("plugins/save_project", FALSE, "{$action_base}/save_project.php"); register_action("plugins/save_release", FALSE, "{$action_base}/save_release.php"); register_action("plugins/delete_project", FALSE, "{$action_base}/delete_project.php"); register_action("plugins/delete_release", FALSE, "{$action_base}/delete_release.php"); register_action("plugins/delete_project_image", FALSE, "{$action_base}/delete_project_image.php"); register_action("plugins/digg", FALSE, "{$action_base}/digg.php"); register_action("plugins/upgrade", FALSE, "{$action_base}/admin/upgrade.php", TRUE); register_action("plugins/combine", FALSE, "{$action_base}/admin/combine.php", TRUE); register_action("plugins/normalize", FALSE, "{$action_base}/admin/normalize.php", TRUE); }
/** * The Wire initialization */ function thewire_init() { global $CONFIG; if (!update_subtype('object', 'thewire', 'ElggWire')) { add_subtype('object', 'thewire', 'ElggWire'); } // register the wire's JavaScript $thewire_js = elgg_get_simplecache_url('js', 'thewire'); elgg_register_js('elgg.thewire', $thewire_js, 'footer'); // add a site navigation item $item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'thewire/all'); elgg_register_menu_item('site', $item); // owner block menu elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'thewire_owner_block_menu'); // remove edit and access and add thread, reply, view previous elgg_register_plugin_hook_handler('register', 'menu:entity', 'thewire_setup_entity_menu_items'); // Extend system CSS with our own styles, which are defined in the thewire/css view elgg_extend_view('css', 'thewire/css'); //extend views elgg_extend_view('activity/thewire', 'thewire/activity_view'); elgg_extend_view('profile/status', 'thewire/profile_status'); elgg_extend_view('js/initialise_elgg', 'thewire/js/textcounter'); // Register a page handler, so we can have nice URLs elgg_register_page_handler('thewire', 'thewire_page_handler'); // Register a URL handler for thewire posts elgg_register_entity_url_handler('object', 'thewire', 'thewire_url'); // Your thewire widget add_widget_type('thewire', elgg_echo('thewire'), elgg_echo("thewire:widget:desc")); // Register entity type elgg_register_entity_type('object', 'thewire'); // Register granular notification for this type register_notification_object('object', 'thewire', elgg_echo('thewire:notify:subject')); // Listen to notification events and supply a more useful message register_plugin_hook('notify:entity:message', 'object', 'thewire_notify_message'); // Register actions $action_base = $CONFIG->pluginspath . 'thewire/actions'; register_action("thewire/add", false, "{$action_base}/add.php"); register_action("thewire/delete", false, "{$action_base}/delete.php"); register_plugin_hook('unit_test', 'system', 'thewire_test'); }
function bookmarks_init() { // Grab the config file global $CONFIG; // Set up menu for logged in users if (isloggedin()) { add_menu(elgg_echo('bookmarks'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . '/items'); // And for logged out users } else { add_menu(elgg_echo('bookmarks'), $CONFIG->wwwroot . "mod/bookmarks/everyone.php"); } //add submenu options if (get_context() == "bookmarks") { add_submenu_item(elgg_echo('bookmarks:inbox'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/inbox"); add_submenu_item(elgg_echo('bookmarks:read'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/items"); add_submenu_item(elgg_echo('bookmarks:bookmarklet'), $CONFIG->wwwroot . "mod/bookmarks/bookmarklet.php"); add_submenu_item(elgg_echo('bookmarks:friends'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/friends"); add_submenu_item(elgg_echo('bookmarks:everyone'), $CONFIG->wwwroot . "mod/bookmarks/everyone.php"); } // Register a page handler, so we can have nice URLs register_page_handler('bookmarks', 'bookmarks_page_handler'); // Add our CSS 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'); }
function activityAndPerformanceDashboard_init() { add_widget_type('activityAndPerformanceDashboard', 'Activity and Performance Dashboard', 'Activity and Performance Dashboard'); register_elgg_event_handler('pagesetup', 'system', 'activityAndPerformanceDashboard_pagesetup'); }
} /* cclite content is currently in widgets, this is code from drupal really, probably unecessary */ function post_create_update_handler($event, $object_type, $object) { $user = $object; $username = $user->username; global $CONFIG; include $CONFIG->wwwroot . "/mod/cclite/cclite-common.php"; // do any followup operations on successfull login // ensure "admin" is a friend for all users ... if you want // any other user just use it below // if ( ($username != "admin") && ($admin = get_user_by_username ("admin")) ) { // $block_content = cclite_contents('adduser',$username) ; // system_message ( "trying to create cclite user $block_content"); // } // put out a greeting message ... this could be customized // depending on user's profile, etc. // system_message ( "Welcome " . $user->name . " to " . $CONFIG->wwwroot ); } //register plugin initialization handler register_elgg_event_handler('init', 'system', 'post_create_update_init'); // Make sure the cclite initialisation function is called on initialisation register_elgg_event_handler('init', 'system', 'cclite_init'); register_elgg_event_handler('pagesetup', 'system', 'cclite_pagesetup'); register_elgg_event_handler('create', 'user', 'post_login_update_handler', 501); add_widget_type('summary', elgg_echo("Trading Summary"), elgg_echo("Trading Summary")); add_widget_type('transactions', elgg_echo("Recent Transactions"), elgg_echo("Recent Transactions")); add_widget_type('payment', elgg_echo("Payment"), elgg_echo("Payment")); // Register actions global $CONFIG; register_action("cclite/pay", false, $CONFIG->pluginspath . "cclite/actions/pay.php");