/** * 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'); }
/** * Messages 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 messages_init() { // Load system configuration global $CONFIG; //add submenu options if (get_context() == "messages") { add_submenu_item(elgg_echo('messages:compose'), $CONFIG->wwwroot . "mod/messages/send.php"); add_submenu_item(elgg_echo('messages:inbox'), $CONFIG->wwwroot . "pg/messages/" . $_SESSION['user']->username); add_submenu_item(elgg_echo('messages:sentmessages'), $CONFIG->wwwroot . "mod/messages/sent.php"); } // Extend system CSS with our own styles, which are defined in the shouts/css view extend_view('css', 'messages/css'); // Extend the elgg topbar extend_view('elgg_topbar/extend', 'messages/topbar'); // Register a page handler, so we can have nice URLs register_page_handler('messages', 'messages_page_handler'); // Register a URL handler for shouts posts register_entity_url_handler('messages_url', 'object', 'messages'); // Extend hover-over and profile menu extend_view('profile/menu/links', 'messages/menu'); // Register a notification handler for site messages register_notification_handler("site", "messages_site_notify_handler"); register_plugin_hook('notify:entity:message', 'object', 'messages_notification_msg'); if (is_callable('register_notification_object')) { register_notification_object('object', 'messages', elgg_echo('messages:new')); } // Shares widget // add_widget_type('messages',elgg_echo("messages:recent"),elgg_echo("messages:widget:description")); // Override metadata permissions register_plugin_hook('permissions_check:metadata', 'object', 'messages_can_edit_metadata'); }
function event_manager_init() { // Register subtype run_function_once("event_manager_run_once_subtypes"); // Register entity_type for search elgg_register_entity_type("object", Event::SUBTYPE); elgg_extend_view("css/elgg", "event_manager/css/site"); elgg_extend_view("js/elgg", "js/event_manager/site"); elgg_extend_view("page/elements/head", "event_manager/metatags"); elgg_register_page_handler("events", "event_manager_page_handler"); // Register granular notification for this type register_notification_object("object", Event::SUBTYPE, elgg_echo("event_manager:notification:subject")); // Listen to notification events and supply a more useful message elgg_register_plugin_hook_handler("notify:entity:message", "object", "event_manager_notify_message"); // add site menu item elgg_register_menu_item("site", array("name" => "event_manager", "text" => elgg_echo("event_manager:menu:title"), "href" => "/events")); // add group tool option add_group_tool_option("event_manager", elgg_echo("groups:enableevents"), true); // add to group profile elgg_extend_view("groups/tool_latest", "event_manager/group_module"); // add widgets elgg_register_widget_type("events", elgg_echo("event_manager:widgets:events:title"), elgg_echo("event_manager:widgets:events:description"), "index,dashboard,profile,groups"); elgg_register_plugin_hook_handler("widget_url", "widget_manager", "event_manager_widget_events_url"); // register js libraries $maps_key = elgg_get_plugin_setting("google_api_key", "event_manager"); elgg_register_simplecache_view("js/event_manager/googlemaps"); $em_maps_js = elgg_get_simplecache_url("js", "event_manager/googlemaps"); elgg_register_js("event_manager.maps.helper", $em_maps_js); elgg_register_js("event_manager.maps.base", "//maps.googleapis.com/maps/api/js?key=" . $maps_key . "&sensor=true"); elgg_register_js("addthisevent", elgg_get_site_url() . "mod/event_manager/vendors/addthisevent/atemay.js"); }
/** * video init */ function videos_init() { $root = dirname(__FILE__); elgg_register_library('elgg:videos', elgg_get_plugins_path() . 'videos/lib/videos.php'); // For now we can use the embed video library of Cash. Once that plugin is updated to 1.8 // we can use the elgg's manifest file to make the users use that library along with this // and remove the library from this plugin // V1.4 Added support for https in Cash's library elgg_register_library('elgg:videos:embed', elgg_get_plugins_path() . 'videos/lib/embed_video.php'); elgg_register_library('elgg:youtube_api', elgg_get_plugins_path() . 'videos/lib/youtube_functions.php'); $action_path = "{$root}/actions/videos"; elgg_register_action('videos/save', "{$action_path}/save.php"); elgg_register_action('videos/delete', "{$action_path}/delete.php"); elgg_register_menu_item('site', array('name' => 'videos', 'text' => elgg_echo('videos'), 'href' => 'videos/all')); elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'videos_owner_block_menu'); elgg_register_page_handler('videos', 'videos_page_handler'); elgg_extend_view('css/elgg', 'videos/css'); elgg_register_widget_type('videos', elgg_echo('videos'), elgg_echo('videos:widget:description')); register_notification_object('object', 'videos', elgg_echo('videos:new')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'videos_notify_message'); elgg_register_entity_url_handler('object', 'videos', 'video_url'); elgg_register_entity_type('object', 'videos'); add_group_tool_option('videos', elgg_echo('videos:enablevideos'), true); elgg_extend_view('groups/tool_latest', 'videos/group_module'); $views = array('output/longtext', 'output/plaintext'); foreach ($views as $view) { elgg_register_plugin_hook_handler("view", $view, "videos_view_filter", 500); } }
function messages_init() { // register a library of helper functions elgg_register_library('elgg:messages', elgg_get_plugins_path() . 'messages/lib/messages.php'); // add page menu items if (elgg_is_logged_in()) { elgg_register_menu_item('page', array('name' => 'messages:inbox', 'text' => elgg_echo('messages:inbox'), 'href' => "messages/inbox/" . elgg_get_logged_in_user_entity()->username, 'context' => 'messages')); elgg_register_menu_item('page', array('name' => 'messages:sentmessages', 'text' => elgg_echo('messages:sentmessages'), 'href' => "messages/sent/" . elgg_get_logged_in_user_entity()->username, 'context' => 'messages')); } elgg_register_event_handler('pagesetup', 'system', 'messages_notifier'); // Extend system CSS with our own styles, which are defined in the messages/css view elgg_extend_view('css/elgg', 'messages/css'); elgg_extend_view('js/elgg', 'messages/js'); // Register a page handler, so we can have nice URLs elgg_register_page_handler('messages', 'messages_page_handler'); // Register a URL handler elgg_register_entity_url_handler('object', 'messages', 'messages_url'); // Extend avatar hover menu elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'messages_user_hover_menu'); // Register a notification handler for site messages register_notification_handler("site", "messages_site_notify_handler"); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'messages_notification_msg'); register_notification_object('object', 'messages', elgg_echo('messages:new')); // ecml elgg_register_plugin_hook_handler('get_views', 'ecml', 'messages_ecml_views_hook'); // permission overrides elgg_register_plugin_hook_handler('permissions_check:metadata', 'object', 'messages_can_edit_metadata'); elgg_register_plugin_hook_handler('permissions_check', 'object', 'messages_can_edit'); elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'messages_can_edit_container'); // Register actions $action_path = elgg_get_plugins_path() . 'messages/actions/messages'; elgg_register_action("messages/send", "{$action_path}/send.php"); elgg_register_action("messages/delete", "{$action_path}/delete.php"); elgg_register_action("messages/process", "{$action_path}/process.php"); }
/** * Bookmark init */ function bookmarks_init() { $root = dirname(__FILE__); elgg_register_library('elgg:bookmarks', "{$root}/lib/bookmarks.php"); // actions $action_path = "{$root}/actions/bookmarks"; elgg_register_action('bookmarks/save', "{$action_path}/save.php"); elgg_register_action('bookmarks/delete', "{$action_path}/delete.php"); elgg_register_action('bookmarks/share', "{$action_path}/share.php"); // menus elgg_register_menu_item('site', array('name' => 'bookmarks', 'text' => elgg_echo('bookmarks'), 'href' => 'bookmarks/all')); elgg_register_plugin_hook_handler('register', 'menu:page', 'bookmarks_page_menu'); elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'bookmarks_owner_block_menu'); elgg_register_page_handler('bookmarks', 'bookmarks_page_handler'); elgg_extend_view('css/elgg', 'bookmarks/css'); elgg_extend_view('js/elgg', 'bookmarks/js'); elgg_register_widget_type('bookmarks', elgg_echo('bookmarks'), elgg_echo('bookmarks:widget:description')); if (elgg_is_logged_in()) { $user_guid = elgg_get_logged_in_user_guid(); $address = urlencode(current_page_url()); elgg_register_menu_item('extras', array('name' => 'bookmark', 'text' => elgg_view_icon('push-pin-alt'), 'href' => "bookmarks/add/{$user_guid}?address={$address}", 'title' => elgg_echo('bookmarks:this'), 'rel' => 'nofollow')); } // Register granular notification for this type register_notification_object('object', 'bookmarks', elgg_echo('bookmarks:new')); // Listen to notification events and supply a more useful message elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'bookmarks_notify_message'); // Register a URL handler for bookmarks elgg_register_entity_url_handler('object', 'bookmarks', 'bookmark_url'); // Register entity type for search elgg_register_entity_type('object', 'bookmarks'); // Groups add_group_tool_option('bookmarks', elgg_echo('bookmarks:enablebookmarks'), true); elgg_extend_view('groups/tool_latest', 'bookmarks/group_module'); }
function messages_init() { // register a library of helper functions elgg_register_library('elgg:messages', elgg_get_plugins_path() . 'messages/lib/messages.php'); //Display notification of new messages in topbar is moved into zhaohu_theme //elgg_register_event_handler('pagesetup', 'system', 'messages_notifier'); // Extend system CSS with our own styles, which are defined in the messages/css view elgg_extend_view('css/elgg', 'messages/css'); elgg_extend_view('js/elgg', 'messages/js'); // Register a page handler, so we can have nice URLs elgg_register_page_handler('messages', 'messages_page_handler'); // Register a URL handler elgg_register_entity_url_handler('object', 'messages', 'messages_url'); // Extend avatar hover menu elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'messages_user_hover_menu'); // Register a notification handler for site messages register_notification_handler("site", "messages_site_notify_handler"); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'messages_notification_msg'); register_notification_object('object', 'messages', elgg_echo('messages:new')); // ecml elgg_register_plugin_hook_handler('get_views', 'ecml', 'messages_ecml_views_hook'); // permission overrides elgg_register_plugin_hook_handler('permissions_check:metadata', 'object', 'messages_can_edit_metadata'); elgg_register_plugin_hook_handler('permissions_check', 'object', 'messages_can_edit'); elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'messages_can_edit_container'); // Register actions $action_path = elgg_get_plugins_path() . 'messages/actions/messages'; elgg_register_action("messages/send", "{$action_path}/send.php"); elgg_register_action("messages/delete", "{$action_path}/delete.php"); elgg_register_action("messages/process", "{$action_path}/process.php"); }
/** * 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 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); }
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); }
/** * 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'); }
/** * System init callback * @return void */ public function init() { elgg_register_page_handler($this->router->getPageHandlerId(), array($this->router, 'handlePages')); elgg_register_plugin_hook_handler('entity:url', 'object', array($this->hooks, 'urlHandler')); elgg_register_entity_type('object', Post::SUBTYPE); elgg_extend_view('css/elgg', 'css/framework/wall/stylesheet'); elgg_extend_view('js/initialize_elgg', 'js/framework/wall/config'); // AJAX view to load URL previews elgg_register_ajax_view('output/wall/url'); if (\hypeJunction\Integration::isElggVersionBelow('1.9.0')) { elgg_load_js('jquery.form'); elgg_extend_view('js/elgg', 'js/framework/wall/legacy/status'); // Display wall form elgg_extend_view('page/layouts/content/filter', 'framework/wall/container', 100); // Notifications register_notification_object('object', Post::SUBTYPE, elgg_echo('wall:new:notification:generic')); elgg_register_event_handler('publish', 'object', array($this->notifications, 'sendMessageLegacy')); elgg_register_plugin_hook_handler('object:notifications', 'object', array($this->notifications, 'disableDefaultHandlerLegacy')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', array($this->notifications, 'formatMessageLegacy')); } else { // Display wall form elgg_extend_view('page/layouts/elements/filter', 'framework/wall/container', 100); // JS elgg_extend_view('js/elgg', 'js/framework/wall/elgg.js'); // Notifications elgg_register_event_handler('publish', 'object', array($this->notifications, 'sendCustomNotifications')); elgg_register_notification_event('object', 'hjwall', array('publish')); elgg_register_notification_event('object', 'thewire', array('publish')); elgg_register_plugin_hook_handler('prepare', 'notification:publish:object:hjwall', array($this->notifications, 'formatMessage')); elgg_register_plugin_hook_handler('prepare', 'notification:publish:object:thewire', array($this->notifications, 'formatMessage')); elgg_register_plugin_hook_handler('likes:is_likable', 'object:hjwall', 'Elgg\\Values::getTrue'); } $action_path = $this->plugin->getPath() . '/actions/'; elgg_register_action('wall/status', $action_path . 'wall/status.php'); elgg_register_action('wall/photo', $action_path . 'wall/status.php'); elgg_register_action('wall/file', $action_path . 'wall/status.php'); elgg_register_action('wall/url', $action_path . 'wall/status.php'); elgg_register_action('wall/content', $action_path . 'wall/status.php'); elgg_register_action('wall/delete', $action_path . 'wall/delete.php'); elgg_register_action('wall/remove_tag', $action_path . 'wall/remove_tag.php'); elgg_register_action('wall/geopositioning/update', $action_path . 'wall/geopositioning/update.php', 'public'); elgg_register_plugin_hook_handler('container_permissions_check', 'object', array($this->hooks, 'containerPermissionsCheck')); elgg_register_plugin_hook_handler('register', 'menu:river', array($this->hooks, 'riverMenuSetup')); elgg_register_plugin_hook_handler('register', 'menu:entity', array($this->hooks, 'entityMenuSetup')); elgg_register_plugin_hook_handler('register', 'menu:owner_block', array($this->hooks, 'ownerBlockMenuSetup')); elgg_register_plugin_hook_handler('register', 'menu:user_hover', array($this->hooks, 'userHoverMenuSetup')); elgg_register_plugin_hook_handler('get_views', 'ecml', array($this->hooks, 'getECMLViews')); elgg_register_plugin_hook_handler('view', 'object/thewire', array($this->hooks, 'hijackWire')); elgg_register_plugin_hook_handler('view', 'river/object/thewire/create', array($this->hooks, 'hijackWireRiver')); elgg_register_widget_type('wall', elgg_echo('wall'), elgg_echo('wall:widget:description')); add_group_tool_option('wall', elgg_echo('wall:groups:enable'), false); elgg_extend_view('groups/tool_latest', 'framework/wall/group_module'); // Export $subtype = Post::SUBTYPE; elgg_register_plugin_hook_handler('aliases', 'graph', array($this->hooks, 'getGraphAlias')); elgg_register_plugin_hook_handler('graph:properties', "object:{$subtype}", array($this->hooks, 'getPostProperties')); // @todo Move graph controller when interface is implemented in hypeApps }
/** * Initialize the projects plugin. * */ function projects_init() { // register a library of helper functions elgg_register_library('elgg:projects', elgg_get_plugins_path() . 'projects/lib/projects.php'); elgg_load_library('elgg:projects'); //register css $css_url = 'mod/projects/css/styles.css'; elgg_register_css('projectsCss', $css_url); elgg_load_css('projectsCss'); // register an elgg menu item $item = new ElggMenuItem('projects', elgg_echo('projects'), 'projects/all'); //elgg_register_menu_item('site', $item); // register a project handler, so we can have nice URLs elgg_register_page_handler('projects', 'projects_page_handler'); // register a url handler elgg_register_entity_url_handler('object', 'project_top', 'projects_url'); elgg_register_entity_url_handler('object', 'project', 'projects_url'); elgg_register_annotation_url_handler('project', 'projects_revision_url'); // register entity type for search elgg_register_entity_type('object', 'project'); elgg_register_entity_type('object', 'project_top'); // register some actions $action_base = elgg_get_plugins_path() . 'projects/actions/projects'; $requests_action_base = elgg_get_plugins_path() . 'projects/actions/requests'; elgg_register_action("projects/edit", "{$action_base}/edit.php"); elgg_register_action("projects/editwelcome", "{$action_base}/editwelcome.php"); elgg_register_action("projects/delete", "{$action_base}/delete.php"); elgg_register_action("requests/add", "{$requests_action_base}/add.php"); elgg_register_action("requests/edit", "{$requests_action_base}/edit.php"); elgg_register_action("projects/helperFuncs", elgg_get_plugins_path() . 'lib/projects.php'); //elgg_register_action("projects/search", elgg_get_plugins_path() ."projects/pages/projects/search.php"); // register granular notification for this type register_notification_object('object', 'project', elgg_echo('projects:new')); register_notification_object('object', 'project_top', elgg_echo('projects:new')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'project_notify_message'); // add to groups add_group_tool_option('projects', elgg_echo('groups:enableprojects'), true); elgg_extend_view('groups/tool_latest', 'projects/group_module'); // Language short codes must be of the form "projects:key" // where key is the array key below elgg_set_config('projects', array('title' => 'text', 'description' => 'longtext', 'project_type' => 'dr_down', 'cost' => 'text', 'organization' => 'text', 'funding' => 'text', 'status' => 'dr_down', 'start_date' => 'date', 'end_date' => 'date', 'assigned_to[]' => 'assign_to', 'tags' => 'tags', 'access_id' => 'access', 'write_access_id' => 'write_access', 'upload' => 'file')); // register the hook handler elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'projects_owner_block_menu'); // write permission plugin hooks elgg_register_plugin_hook_handler('permissions_check', 'object', 'projects_write_permission_check'); elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'projects_container_permission_check'); // icon url override elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'projects_icon_url_override'); // entity menu elgg_register_plugin_hook_handler('register', 'menu:entity', 'projects_entity_menu_setup'); // Access permissions //elgg_register_plugin_hook_handler('access:collections:write', 'all', 'projects_write_acl_plugin_hook'); //elgg_register_plugin_hook_handler('access:collections:read', 'all', 'projects_read_acl_plugin_hook'); }
/** * Initialize the tasks management plugin. * */ function tasks_init() { // register a library of helper functions elgg_register_library('elgg:tasks', elgg_get_plugins_path() . 'tasks/lib/tasks.php'); $item = new ElggMenuItem('tasks', elgg_echo('tasks'), 'tasks/all'); elgg_register_menu_item('site', $item); // Register a page handler, so we can have nice URLs elgg_register_page_handler('tasks', 'tasks_page_handler'); // Register a url handler elgg_register_entity_url_handler('object', 'task', 'tasks_url'); // Register some actions $action_base = elgg_get_plugins_path() . 'tasks/actions/tasks'; elgg_register_action("tasks/edit", "{$action_base}/edit.php"); elgg_register_action("tasks/delete", "{$action_base}/delete.php"); elgg_register_action("tasks/comments/add", "{$action_base}/comments/add.php"); elgg_register_action("tasks/comments/delete", "{$action_base}/comments/delete.php"); // Extend the main css and js views elgg_extend_view('css/elgg', 'tasks/css'); elgg_extend_view('js/elgg', 'tasks/js'); // register the blog's JavaScript elgg_register_simplecache_view('js/tasks/tasklists'); elgg_register_js('elgg.tasks', elgg_get_simplecache_url('js', 'tasks/tasklists')); elgg_register_ajax_view('object/task'); elgg_register_ajax_view('tasks/tasklist_graph'); // Register entity type for search elgg_register_entity_type('object', 'task'); // Register a different form for annotations elgg_register_plugin_hook_handler('comments', 'object', 'tasks_comments_hook'); // Register granular notification for this type register_notification_object('object', 'task', elgg_echo('tasks:new')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'tasks_notify_message'); // add to groups add_group_tool_option('tasks', elgg_echo('groups:enabletasks'), true); elgg_extend_view('groups/tool_latest', 'tasks/group_module'); //add a widget elgg_register_widget_type('tasks', elgg_echo('tasks:active'), elgg_echo('tasks:widget:description')); // Language short codes must be of the form "tasks:key" // where key is the array key below elgg_set_config('tasks', array('title' => 'text', 'description' => 'longtext', 'list_guid' => 'tasks/list', 'enddate' => 'date', 'priority' => 'tasks/priority', 'tags' => 'tags', 'access_id' => 'access')); elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'tasks_owner_block_menu'); elgg_register_event_handler('pagesetup', 'system', 'tasks_pagesetup'); // write permission plugin hooks elgg_register_plugin_hook_handler('permissions_check', 'object', 'tasks_write_permission_check'); elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'tasks_container_permission_check'); // icon url override elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'tasks_icon_url_override'); // entity menu elgg_register_plugin_hook_handler('register', 'menu:entity', 'tasks_entity_menu_setup'); // register ecml views to parse elgg_register_plugin_hook_handler('get_views', 'ecml', 'tasks_ecml_views_hook'); elgg_register_plugin_hook_handler('format', 'friendly:time', 'tasks_get_friendly_time'); elgg_register_event_handler('upgrade', 'system', 'tasks_run_upgrades'); }
function videolist_init() { elgg_register_library('elgg:videolist', elgg_get_plugins_path() . 'videolist/lib/videolist.php'); if (!class_exists('Videolist_PlatformInterface')) { // ./classes autoloading failed (pre 1.9) spl_autoload_register('videolist_load_class'); } // add a site navigation item $item = new ElggMenuItem('videolist', elgg_echo('videolist'), 'videolist/all'); elgg_register_menu_item('site', $item); // Extend system CSS with our own styles elgg_extend_view('css/elgg', 'videolist/css'); // register the js $js = elgg_get_simplecache_url('js', 'videolist/videolist'); elgg_register_simplecache_view('js/videolist/videolist'); elgg_register_js('elgg.videolist', $js); $js = elgg_get_simplecache_url('js', 'videolist/json2'); elgg_register_simplecache_view('js/videolist/json2'); elgg_register_js('elgg.videolist.json2', $js); // Register a page handler, so we can have nice URLs elgg_register_page_handler('videolist', 'videolist_page_handler'); // Language short codes must be of the form "videolist:key" // where key is the array key below elgg_set_config('videolist', array('video_url' => 'url', 'title' => 'text', 'description' => 'longtext', 'tags' => 'tags', 'access_id' => 'access')); elgg_set_config('videolist_dimensions', array('width' => 600, 'height' => 400)); // add to groups add_group_tool_option('videolist', elgg_echo('groups:enablevideolist'), true); elgg_extend_view('groups/tool_latest', 'videolist/group_module'); //add a widget elgg_register_widget_type('videolist', elgg_echo('videolist'), elgg_echo('videolist:widget:description')); // Register granular notification for this type register_notification_object('object', 'videolist_item', elgg_echo('videolist:notification:subject')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'videolist_notify_message'); // Register entity type for search elgg_register_entity_type('object', 'videolist_item'); // add a file link to owner blocks elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'videolist_owner_block_menu'); //register entity url handler elgg_register_entity_url_handler('object', 'videolist_item', 'videolist_url'); elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'videolist_icon_url_override'); // register for embed elgg_register_plugin_hook_handler('embed_get_sections', 'all', 'videolist_embed_get_sections'); elgg_register_plugin_hook_handler('embed_get_items', 'videolist', 'videolist_embed_get_items'); // handle URLs without scheme elgg_register_plugin_hook_handler('videolist:preprocess', 'url', 'videolist_preprocess_url'); // Register actions $actions_path = elgg_get_plugins_path() . "videolist/actions/videolist"; elgg_register_action("videolist/add", "{$actions_path}/add.php"); elgg_register_action("videolist/edit", "{$actions_path}/edit.php"); elgg_register_action("videolist/delete", "{$actions_path}/delete.php"); elgg_register_action("videolist/get_metadata_from_url", "{$actions_path}/get_metadata_from_url.php"); elgg_register_event_handler('upgrade', 'system', 'videolist_run_upgrades'); }
/** * Initialize the pages plugin. * */ function pages_init() { // register a library of helper functions elgg_register_library('elgg:pages', elgg_get_plugins_path() . 'pages/lib/pages.php'); $item = new ElggMenuItem('pages', elgg_echo('pages'), 'pages/all'); elgg_register_menu_item('site', $item); // Register a page handler, so we can have nice URLs elgg_register_page_handler('pages', 'pages_page_handler'); // Register a url handler elgg_register_entity_url_handler('object', 'page_top', 'pages_url'); elgg_register_entity_url_handler('object', 'page', 'pages_url'); elgg_register_annotation_url_handler('page', 'pages_revision_url'); // Register some actions $action_base = elgg_get_plugins_path() . 'pages/actions'; elgg_register_action("pages/edit", "{$action_base}/pages/edit.php"); elgg_register_action("pages/delete", "{$action_base}/pages/delete.php"); elgg_register_action("annotations/page/delete", "{$action_base}/annotations/page/delete.php"); // Extend the main css view elgg_extend_view('css/elgg', 'pages/css'); // Register javascript needed for sidebar menu $js_url = 'mod/pages/vendors/jquery-treeview/jquery.treeview.min.js'; elgg_register_js('jquery-treeview', $js_url); $css_url = 'mod/pages/vendors/jquery-treeview/jquery.treeview.css'; elgg_register_css('jquery-treeview', $css_url); // Register entity type for search elgg_register_entity_type('object', 'page'); elgg_register_entity_type('object', 'page_top'); // Register granular notification for this type register_notification_object('object', 'page', elgg_echo('pages:new')); register_notification_object('object', 'page_top', elgg_echo('pages:new')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'page_notify_message'); // add to groups add_group_tool_option('pages', elgg_echo('groups:enablepages'), true); elgg_extend_view('groups/tool_latest', 'pages/group_module'); //add a widget elgg_register_widget_type('pages', elgg_echo('pages'), elgg_echo('pages:widget:description')); // Language short codes must be of the form "pages:key" // where key is the array key below elgg_set_config('pages', array('title' => 'text', 'description' => 'longtext', 'tags' => 'tags', 'parent_guid' => 'parent', 'access_id' => 'access', 'write_access_id' => 'write_access')); elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'pages_owner_block_menu'); // write permission plugin hooks elgg_register_plugin_hook_handler('permissions_check', 'object', 'pages_write_permission_check'); elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'pages_container_permission_check'); // icon url override elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'pages_icon_url_override'); // entity menu elgg_register_plugin_hook_handler('register', 'menu:entity', 'pages_entity_menu_setup'); // hook into annotation menu //elgg_register_plugin_hook_handler('register', 'menu:annotation', 'pages_annotation_menu_setup'); // register ecml views to parse elgg_register_plugin_hook_handler('get_views', 'ecml', 'pages_ecml_views_hook'); elgg_register_event_handler('upgrade', 'system', 'pages_run_upgrades'); }
/** * 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'); }
/** * Init assemblies plugin. */ function assemblies_init() { if (!elgg_is_active_plugin('crud')) { return; } elgg_register_library('elgg:assemblies', elgg_get_plugins_path() . 'assemblies/lib/assemblies.php'); // add to the main css elgg_extend_view('css/elgg', 'assemblies/css'); // notifications register_notification_object('object', 'assembly', elgg_echo('assemblies:newpost')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'assemblies_notify_message'); // handler for link to assembly menu item elgg_register_plugin_hook_handler('crud:decision:view_buttons', 'view_buttons', 'assemblies_decision_view_buttons'); // Add group option add_group_tool_option('assemblies', elgg_echo('assemblies:enableassemblies'), false); #elgg_extend_view('groups/tool_latest', 'assemblies/group_module'); elgg_extend_view('groups/profile/summary', 'assemblies/group_module'); // add a assemblies widget elgg_register_widget_type('assembly', elgg_echo('assemblies'), elgg_echo('assemblies:widget:description')); // register actions $action_path = elgg_get_plugins_path() . 'assemblies/actions/assemblies'; elgg_register_action("assemblies/link", "{$action_path}/link.php"); //elgg_register_action('assemblies/save', "$action_path/save.php"); //elgg_register_action('assemblies/delete', "$action_path/delete.php"); // entity menu elgg_register_plugin_hook_handler('register', 'menu:entity', 'assemblies_entity_menu_setup'); // ecml elgg_register_plugin_hook_handler('get_views', 'ecml', 'assemblies_ecml_views_hook'); // specific actions $action_path = elgg_get_plugins_path() . 'assemblies/actions/assemblies'; elgg_register_action("assemblies/general", "{$action_path}/general.php"); // data types $variables = array('title' => array('type' => 'text', 'default_value' => elgg_echo('assemblies:general_assembly')), 'category' => array('type' => 'tags', 'default_value' => 'informativos, debate'), 'date' => 'date', 'time' => 'time', 'location' => 'text', 'access_id' => 'access'); $crud = crud_register_type('assembly', $variables, 'ElggAssembly'); $crud->children_type = 'decision'; $crud->children_categories = 'category'; $crud->module = 'assemblies'; $crud->list_order = 'date'; $crud->list_order_direction = 'DESC'; $crud->owner_menu = 'group'; $crud->title_extend = 'date'; $crud->list_tabs = 'date'; $variables = array('title' => 'text', 'description' => 'longtext', 'proposal' => array('type' => 'longtext', 'embedded' => 'description'), 'status' => array('type' => 'crud/select', 'default_value' => 'new', 'options' => array('draft', 'new', 'accepted', 'discarded', 'delayed')), 'category' => array('type' => 'crud/parentselect', 'property' => 'category'), 'mode' => array('type' => 'crud/select', 'default_value' => 'conjunctural', 'options' => array('permanent', 'conjunctural')), 'tags' => 'tags', 'access_id' => 'access'); if (elgg_is_active_plugin('crud')) { $crud = crud_register_type('decision', $variables); #$crud->children_type = 'agenda_point'; $crud->module = 'assemblies'; $crud->embed = 'firstchild'; $crud->icon_var = 'status'; $crud->list_tabs = 'status'; } }
/** * Initialize the webinar plugin. */ function webinar_init() { // register a library for new object class webinar elgg_register_library('elgg:webinar', elgg_get_plugins_path() . 'webinar/lib/webinar.php'); // register BigBlueButton API elgg_register_library('elgg:bbb', elgg_get_plugins_path() . 'webinar/vendors/bbb-api-php/bbb_api.php'); // Register a url handler for the new object elgg_register_entity_url_handler('object', 'webinar', 'webinar_url'); //add a tab in site menu $item = new ElggMenuItem('webinar', elgg_echo('webinar:menu:site'), 'webinar/all'); elgg_register_menu_item('site', $item); // Register a page handler, so we can have nice URLs elgg_register_page_handler('webinar', 'webinar_page_handler'); // Register some actions $action_base = elgg_get_plugins_path() . 'webinar/actions/webinar'; elgg_register_action("webinar/subscribe", "{$action_base}/subscribe.php"); elgg_register_action("webinar/unsubscribe", "{$action_base}/unsubscribe.php"); elgg_register_action("webinar/join", "{$action_base}/join.php"); elgg_register_action("webinar/save", "{$action_base}/save.php"); elgg_register_action("webinar/delete", "{$action_base}/delete.php"); elgg_register_action("webinar/start", "{$action_base}/start.php"); elgg_register_action("webinar/stop", "{$action_base}/stop.php"); // Extend the main css view elgg_extend_view('css', 'webinar/css'); // Register entity type for search elgg_register_entity_type('object', 'webinar'); //register_elgg_event_handler('pagesetup','system','webinar_pagesetup'); // Register for notifications register_notification_object('object', 'webinar', elgg_echo('webinar:notify:new')); // add checkbox on group edit page to activate webinar add_group_tool_option('webinar', elgg_echo('webinar:enable'), false); elgg_extend_view('groups/tool_latest', 'webinar/group_module'); // owner_block menu elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'webinar_handler_menu_owner_block'); // entity menu elgg_register_plugin_hook_handler('register', 'menu:entity', 'webinar_handler_menu_entity'); // Listen to notification events and supply a more useful message elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'webinar_handler_notify_message'); elgg_register_plugin_hook_handler('permissions_check', 'object', 'webinar_handler_permissions_check'); //intercept event_calendar notification because event that type is webinar are create by webinar object elgg_register_plugin_hook_handler('object:notifications', 'object', 'webinar_handler_notifications_intercept'); //on event create attendee relation ship, call add_river elgg_register_event_handler('create', 'attendee', 'webinar_handler_relationship_river'); // add a blog widget elgg_register_widget_type('webinar', elgg_echo('webinar:webinars'), elgg_echo('webinar:widget:description'), 'profile'); //elgg_extend_view('profile/tabs/menu_extend','webinar/group_profile_tabs_menu'); }
/** * File plugin initialization functions. */ function file_init() { // register a library of helper functions elgg_register_library('elgg:file', elgg_get_plugins_path() . 'file/lib/file.php'); // Site navigation $item = new ElggMenuItem('file', elgg_echo('file'), 'file/all'); elgg_register_menu_item('site', $item); // Extend CSS elgg_extend_view('css/elgg', 'file/css'); // add enclosure to rss item elgg_extend_view('extensions/item', 'file/enclosure'); // extend group main page elgg_extend_view('groups/tool_latest', 'file/group_module'); //register walled garden public pages for cron job elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'file_public_pages'); // Register a page handler, so we can have nice URLs elgg_register_page_handler('file', 'file_page_handler'); // Add a new file widget elgg_register_widget_type('filerepo', elgg_echo("file"), elgg_echo("file:widget:description")); // Register URL handlers for files elgg_register_entity_url_handler('object', 'file', 'file_url_override'); elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'file_icon_url_override'); // Register granular notification for this object type register_notification_object('object', 'file', elgg_echo('file:newupload')); // Listen to notification events and supply a more useful message elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'file_notify_message'); // add the group files tool option add_group_tool_option('file', elgg_echo('groups:enablefiles'), true); // Register entity type for search elgg_register_entity_type('object', 'file'); // add a file link to owner blocks elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'file_owner_block_menu'); // Register actions $action_path = elgg_get_plugins_path() . 'file/actions/file'; elgg_register_action("file/upload", "{$action_path}/upload.php"); elgg_register_action("file/delete", "{$action_path}/delete.php"); //elgg_register_action("file/release", elgg_get_plugins_path() . "file/cron/releaser.php"); // temporary - see #2010 elgg_register_action("file/download", "{$action_path}/download.php"); // embed support $item = ElggMenuItem::factory(array('name' => 'file', 'text' => elgg_echo('file'), 'priority' => 10, 'data' => array('options' => array('type' => 'object', 'subtype' => 'file')))); elgg_register_menu_item('embed', $item); $item = ElggMenuItem::factory(array('name' => 'file_upload', 'text' => elgg_echo('file:upload'), 'priority' => 100, 'data' => array('view' => 'embed/file_upload/content'))); elgg_register_menu_item('embed', $item); //register cron plugin hook handler //elgg_register_plugin_hook_handler("cron", "hourly", "files_cron_handler"); }
/** * 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'); }
/** * 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'); }
/** * @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); }
/** * video init */ function videos_init() { // add a site navigation item $item = new ElggMenuItem('video', elgg_echo('videos'), 'videos/all'); elgg_register_menu_item('site', $item); elgg_register_library('elgg:videos', elgg_get_plugins_path() . 'videos/lib/videos.php'); elgg_register_library('elgg:videos:embed', elgg_get_plugins_path() . 'videos/lib/embed_video.php'); elgg_register_library('elgg:youtube_api', elgg_get_plugins_path() . 'videos/lib/youtube_functions.php'); $action_path = elgg_get_plugins_path() . "videos/actions/videos"; elgg_register_action('videos/save', "{$action_path}/save.php"); elgg_register_action('videos/delete', "{$action_path}/delete.php"); //extend owner block menu elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'videos_owner_block_menu'); //Add menu's in sidebar elgg_register_plugin_hook_handler('register', 'menu:page', 'videos_page_menu'); $context = elgg_get_context(); $contexts = elgg_get_plugin_setting('search_contexts', 'videos'); $contexts = explode(",", $contexts); if (in_array($context, $contexts)) { elgg_extend_view('page/elements/sidebar', 'page/elements/search', '400'); } // get items in video menu elgg_register_plugin_hook_handler("register", "menu:entity", "videos_entity_menu_setup"); // register actions elgg_register_action("videos/toggle_metadata", dirname(__FILE__) . "/actions/toggle_metadata.php"); elgg_register_page_handler('videos', 'videos_page_handler'); elgg_extend_view('css/elgg', 'videos/css'); elgg_register_widget_type('videos', elgg_echo('videos'), elgg_echo('videos:widget:description'), array('dashboard', 'profile', 'main', 'index')); if (function_exists('elgg_get_version')) { elgg_register_notification_event('object', 'videos'); } else { register_notification_object('object', 'videos', elgg_echo('videos:new')); } elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'videos_notify_message'); // Register a URL handler for video posts elgg_register_entity_url_handler('object', 'videos', 'videos_url'); elgg_register_entity_type('object', 'videos'); add_group_tool_option('videos', elgg_echo('videos:enablevideos'), true); elgg_extend_view('groups/tool_latest', 'videos/group_module'); $views = array('output/longtext', 'output/plaintext'); foreach ($views as $view) { elgg_register_plugin_hook_handler("view", $view, "videos_view_filter", 500); } }
/** * Init blog plugin. */ function blog_init() { elgg_register_library('elgg:blog', elgg_get_plugins_path() . 'blog/lib/blog.php'); // add a site navigation item $item = new ElggMenuItem('blog', elgg_echo('blog:blogs'), 'blog/all'); elgg_register_menu_item('site', $item); elgg_register_event_handler('upgrade', 'upgrade', 'blog_run_upgrades'); // add to the main css elgg_extend_view('css/elgg', 'blog/css'); // register the blog's JavaScript $blog_js = elgg_get_simplecache_url('js', 'blog/save_draft'); elgg_register_simplecache_view('js/blog/save_draft'); elgg_register_js('elgg.blog', $blog_js); // routing of urls elgg_register_page_handler('blog', 'blog_page_handler'); // override the default url to view a blog object elgg_register_entity_url_handler('object', 'blog', 'blog_url_handler'); // notifications register_notification_object('object', 'blog', elgg_echo('blog:newpost')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'blog_notify_message'); // add blog link to elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'blog_owner_block_menu'); // pingbacks //elgg_register_event_handler('create', 'object', 'blog_incoming_ping'); //elgg_register_plugin_hook_handler('pingback:object:subtypes', 'object', 'blog_pingback_subtypes'); // Register for search. elgg_register_entity_type('object', 'blog'); // Add group option add_group_tool_option('blog', elgg_echo('blog:enableblog'), true); elgg_extend_view('groups/tool_latest', 'blog/group_module'); // add a blog widget elgg_register_widget_type('blog', elgg_echo('blog'), elgg_echo('blog:widget:description'), array('profile')); // register actions $action_path = elgg_get_plugins_path() . 'blog/actions/blog'; elgg_register_action('blog/save', "{$action_path}/save.php"); elgg_register_action('blog/auto_save_revision', "{$action_path}/auto_save_revision.php"); elgg_register_action('blog/delete', "{$action_path}/delete.php"); // entity menu elgg_register_plugin_hook_handler('register', 'menu:entity', 'blog_entity_menu_setup'); // ecml elgg_register_plugin_hook_handler('get_views', 'ecml', 'blog_ecml_views_hook'); }
function answers_init() { // register a library of helper functions $root = dirname(__FILE__); elgg_register_library('answers:utilities', "{$root}/lib/answers.php"); // Add a menu item to the main site menu $item = new ElggMenuItem('answers', elgg_echo('answers:questions'), 'answers/all'); elgg_register_menu_item('site', $item); // Extend css and js elgg_extend_view('css/elgg', 'answers/css'); elgg_extend_view('js/elgg', 'answers/js'); // live search elgg_register_ajax_view('answers/search'); elgg_register_widget_type('answers', elgg_echo('answers'), elgg_echo('answers:widget'), 'all,groups,index', TRUE); elgg_register_page_handler('answers', 'answers_page_handler'); elgg_register_entity_url_handler('object', 'answer', 'answer_url'); elgg_register_entity_url_handler('object', 'question', 'question_url'); register_notification_object('object', 'question', elgg_echo('answers:question:new')); register_notification_object('object', 'answer', elgg_echo('answers:answer:new')); elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'answers_notify_message'); // support group questions/answers elgg_extend_view('groups/tool_latest', 'answers/group_module'); add_group_tool_option('answers', elgg_echo('groups:enableanswers'), true); // register questions and answers for search elgg_register_entity_type('object', 'question'); // on enregistre les objets que l'on veux pouvoir trouver par la recherche ou voir dans les colonnes du deck. elgg_register_entity_type('object', 'answer'); // register actions. Les actions sont dans le dossier actions/answers. C'est mieux si on veut les overrider. $action_path = "{$root}/actions/answers"; elgg_register_action("answers/question/save", "{$action_path}/question/save.php"); elgg_register_action("answers/answer/save", "{$action_path}/answer/save.php"); elgg_register_action("answers/answer/edit", "{$action_path}/editanswer.php"); elgg_register_action("answers/delete", "{$action_path}/delete.php"); elgg_register_action("answers/choose", "{$action_path}/chooseanswer.php"); elgg_register_action("answers/like", "{$action_path}/like.php"); elgg_register_action("answers/dislike", "{$action_path}/dislike.php"); elgg_register_plugin_hook_handler('creating', 'river', 'answer_comment_river_create_hook'); elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'answers_owner_block_menu'); elgg_register_plugin_hook_handler('register', 'menu:entity', 'answers_setup_entity_menu_items'); // remove likes plugin integration for questions and answers elgg_register_plugin_hook_handler('register', 'menu:river', 'answers_river_menu_setup'); }
/** * The Wire initialization */ function thewire_init() { global $CONFIG; // this can be removed in favor of activate/deactivate scripts 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_simplecache_view('js/thewire'); elgg_register_js('elgg.thewire', $thewire_js, 'footer'); elgg_register_ajax_view('thewire/previous'); // 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'); elgg_register_widget_type('thewire', elgg_echo('thewire'), elgg_echo("thewire:widget:desc")); // Register for search 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 elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'thewire_notify_message'); // Register actions $action_base = $CONFIG->pluginspath . 'thewire/actions'; elgg_register_action("thewire/add", "{$action_base}/add.php"); elgg_register_action("thewire/delete", "{$action_base}/delete.php"); elgg_register_plugin_hook_handler('unit_test', 'system', 'thewire_test'); }
/** * cclite 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 cclite_init() { // Load system configuration global $CONFIG; // require libraries require_once "{$CONFIG->pluginspath}cclite/cclite-oauth/oauthservice_lib.php"; if (!class_exists('LinkedinOAuth')) { require_once "{$CONFIG->pluginspath}cclite/cclite-oauth/ccliteoauth.php"; } // Set up menu for logged in users if (isloggedin()) { add_menu(elgg_echo('cclite'), $CONFIG->wwwroot . "pg/cclite/" . $_SESSION['user']->username); // And for logged out users } else { add_menu(elgg_echo('cclite'), $CONFIG->wwwroot . "mod/cclite/everyone.php", array()); } // Extend system CSS with our own styles, which are defined in the cclite/css view extend_view('css', 'cclite/css'); // Extend hover-over menu, not sure that this is needed extend_view('profile/menu/links', 'cclite/menu'); // Register a page handler, so we can have nice URLs register_page_handler('cclite', 'cclite_page_handler'); // Register a URL handler for cclite posts register_entity_url_handler('cclite_url', 'object', 'cclite'); // Register this plugin's object for sending pingbacks register_plugin_hook('pingback:object:subtypes', 'object', 'cclite_pingback_subtypes'); // Register granular notification for this type if (is_callable('register_notification_object')) { register_notification_object('object', 'cclite', elgg_echo('cclite:newpost')); } // Listen to notification events and supply a more useful message register_plugin_hook('notify:entity:message', 'object', 'cclite_notify_message'); // Listen for new pingbacks register_elgg_event_handler('create', 'object', 'cclite_incoming_ping'); // Register entity type register_entity_type('object', 'cclite'); // widget created data is metadata, mainly to be posted to remote cclite instance // this is a little ugly but I haven't found better... register_elgg_event_handler('create', 'metadata', 'cclite_post_data', 1000); register_elgg_event_handler('create', 'user', 'post_create_update_handler', 501); }
function videolist_init() { elgg_register_library('elgg:videolist', elgg_get_plugins_path() . 'videolist/lib/videolist.php'); // add a site navigation item $item = new ElggMenuItem('videolist', elgg_echo('videolist'), 'videolist/all'); elgg_register_menu_item('site', $item); // Extend system CSS with our own styles elgg_extend_view('css/elgg', 'videolist/css'); // Register a page handler, so we can have nice URLs elgg_register_page_handler('videolist', 'videolist_page_handler'); // Language short codes must be of the form "videolist:key" // where key is the array key below elgg_set_config('videolist', array('video_url' => 'url', 'title' => 'text', 'description' => 'longtext', 'tags' => 'tags', 'access_id' => 'access')); // add to groups add_group_tool_option('videolist', elgg_echo('groups:enablevideolist'), true); elgg_extend_view('groups/tool_latest', 'videolist/group_module'); //add a widget elgg_register_widget_type('videolist', elgg_echo('videolist'), elgg_echo('videolist:widget:description')); // Register granular notification for this type register_notification_object('object', 'videolist_item', elgg_echo('videolist:new')); // Register entity type for search elgg_register_entity_type('object', 'videolist_item'); // add a file link to owner blocks elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'videolist_owner_block_menu'); elgg_register_event_handler('annotate', 'all', 'videolist_object_notifications'); elgg_register_plugin_hook_handler('object:notifications', 'object', 'videolist_object_notifications_intercept'); //register entity url handler elgg_register_entity_url_handler('object', 'videolist_item', 'videolist_url'); elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'videolist_icon_url_override'); // register for embed elgg_register_plugin_hook_handler('embed_get_sections', 'all', 'videolist_embed_get_sections'); elgg_register_plugin_hook_handler('embed_get_items', 'videolist', 'videolist_embed_get_items'); // handle URLs without scheme elgg_register_plugin_hook_handler('videolist:preprocess', 'url', 'videolist_preprocess_url'); // Register actions $actions_path = elgg_get_plugins_path() . "videolist/actions/videolist"; elgg_register_action("videolist/add", "{$actions_path}/add.php"); elgg_register_action("videolist/edit", "{$actions_path}/edit.php"); elgg_register_action("videolist/delete", "{$actions_path}/delete.php"); elgg_register_event_handler('upgrade', 'system', 'videolist_run_upgrades'); }