function upgrades() { if (elgg_is_admin_logged_in()) { elgg_load_library(PLUGIN_ID . ':upgrades'); run_function_once(__NAMESPACE__ . '\\upgrade_20150321'); } }
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"); }
/** * Start the site pages plugin. */ function sitepages_init() { require_once dirname(__FILE__) . '/sitepages_functions.php'; global $CONFIG; // register our subtype run_function_once('sitepages_runonce'); // Register a page handler, so we can have nice URLs register_page_handler('sitepages', 'sitepages_page_handler'); // Register a URL handler for external pages register_entity_url_handler('sitepages_url', 'object', 'sitepages'); elgg_extend_view('footer/links', 'sitepages/footer_menu'); elgg_extend_view('metatags', 'sitepages/metatags'); // Replace the default index page if user has requested if (get_plugin_setting('ownfrontpage', 'sitepages') == 'yes') { register_plugin_hook('index', 'system', 'sitepages_custom_index'); } // parse views for keywords register_plugin_hook('display', 'view', 'sitepages_parse_view'); // register the views we want to parse for the keyword replacement // right now this is just the custom front page, but we can // expand it to the other pages later. $CONFIG->sitepages_parse_views = array('sitepages/custom_frontpage'); // an example of how to register and respond to the get_keywords trigger register_plugin_hook('get_keywords', 'sitepages', 'sitepages_keyword_hook'); // grab the list of keywords and their views from plugins if ($keywords = trigger_plugin_hook('get_keywords', 'sitepages', NULL, array())) { $CONFIG->sitepages_keywords = $keywords; } register_action("sitepages/add", FALSE, $CONFIG->pluginspath . "sitepages/actions/add.php"); register_action("sitepages/addfront", FALSE, $CONFIG->pluginspath . "sitepages/actions/addfront.php"); register_action("sitepages/addmeta", FALSE, $CONFIG->pluginspath . "sitepages/actions/addmeta.php"); register_action("sitepages/edit", FALSE, $CONFIG->pluginspath . "sitepages/actions/edit.php"); register_action("sitepages/delete", FALSE, $CONFIG->pluginspath . "sitepages/actions/delete.php"); }
/** * initialization of plugin * * @return unknown_type */ function profile_manager_init() { // Extend CSS elgg_extend_view("css/admin", "profile_manager/css/global"); elgg_extend_view("css/admin", "profile_manager/css/admin"); elgg_extend_view("css/elgg", "profile_manager/css/global"); elgg_extend_view("css/elgg", "profile_manager/css/site"); elgg_extend_view("js/elgg", "profile_manager/js/site"); elgg_extend_view("js/admin", "profile_manager/js/admin"); // Register Page handler elgg_register_page_handler("profile_manager", "profile_manager_page_handler"); // admin user add, registered here to overrule default action elgg_register_action("useradd", dirname(__FILE__) . "/actions/useradd.php", "admin"); // Register all custom field types register_custom_field_types(); // add profile_completeness widget if (elgg_get_plugin_setting("enable_profile_completeness_widget", "profile_manager") == "yes") { elgg_register_widget_type("profile_completeness", elgg_echo("widgets:profile_completeness:title"), elgg_echo("widgets:profile_completeness:description"), "profile,dashboard"); } // free_text on register form elgg_extend_view("register/extend_side", "profile_manager/register/free_text"); // where to put extra profile fields if (elgg_get_plugin_setting("registration_extra_fields", "profile_manager") == "beside") { // besides the default registration page elgg_extend_view("register/extend_side", "profile_manager/register/fields"); } else { // just below the default registration page elgg_extend_view("register/extend", "profile_manager/register/fields"); } // Run once function to configure this plugin run_function_once('profile_manager_run_once', 1287964800); // 2010-10-25 run_function_once('pm_fix_access_default'); }
function subsite_manager_plugins_boot() { // handle run once functions run_function_once("subsite_manager_runonce"); run_function_once("subsite_manager_runonce_elgg18"); // Check if current user should be a admin of this site if ($user = elgg_get_logged_in_user_entity()) { // don't check for super admins if (!subsite_manager_is_superadmin($user->getGUID())) { // where are we if (subsite_manager_on_subsite()) { // is the user suppose to be an admin if (elgg_get_site_entity()->isAdmin($user->getGUID())) { // is the user currently an admin if (!$user->isAdmin()) { $user->makeAdmin(); } } elseif ($user->isAdmin()) { // user is an admin, but shouldn't be $user->removeAdmin(); } } elseif ($user->isAdmin()) { // user is an admin, but shouldn't be $user->removeAdmin(); } } } // check the site email address $config_email = elgg_get_config("siteemail"); $site = elgg_get_site_entity(); if (empty($config_email) || $site->email != $config_email) { elgg_set_config("siteemail", $site->email); } }
/** * Vouchers plugin initialization functions. */ function vouchers_init() { // register a library of helper functions elgg_register_library('elgg:vouchers', elgg_get_plugins_path() . 'vouchers/lib/vouchers.php'); // Register subtype run_function_once('vouchers_manager_run_once_subtypes'); // Register entity_type for search elgg_register_entity_type('object', Voucher::SUBTYPE); // Site navigation $item = new ElggMenuItem('vouchers', elgg_echo('vouchers:menu'), 'vouchers/all'); elgg_register_menu_item('site', $item); // Extend CSS elgg_extend_view('css/elgg', 'vouchers/css'); elgg_register_css('vouchers_tooltip_css', '//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css'); // Extend js elgg_register_js('vouchersjs', elgg_get_site_url() . 'mod/vouchers/assets/vouchers.js'); elgg_register_js('vouchers_tooltip_js', '//code.jquery.com/ui/1.11.1/jquery-ui.js'); // Register a page handler, so we can have nice URLs elgg_register_page_handler('vouchers', 'vouchers_page_handler'); // Register a URL handler for voucher $release = get_version(true); // Register a URL handler for agora if ($release < 1.9) { // version 1.8 elgg_register_entity_url_handler('object', 'vouchers', 'voucher_url'); } else { // use this since Elgg 1.9 elgg_register_plugin_hook_handler('entity:url', 'object', 'vouchers_set_url'); } // Register menu item to an ownerblock elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'vouchers_owner_block_menu'); // Register admin transaction log menu under "Utilities" elgg_register_admin_menu_item('administer', 'vouchers_transactions_log', 'administer_utilities'); // register plugin hooks elgg_register_plugin_hook_handler("public_pages", "walled_garden", "vouchers_walled_garden_hook"); // Register actions $action_path = elgg_get_plugins_path() . 'vouchers/actions'; elgg_register_action("vouchers/addvoucher", "{$action_path}/addvoucher.php"); elgg_register_action("vouchers/delete", "{$action_path}/delvoucher.php"); elgg_register_action("vouchers/set_featured", "{$action_path}/vouchers/set_featured.php"); // set a voucher post as featured elgg_register_action("vouchers/unset_featured", "{$action_path}/vouchers/unset_featured.php"); // unset a voucher post from featured elgg_register_action("vouchers/get_with_points", "{$action_path}/vouchers/get_with_points.php"); // voucher purchase with points only elgg_register_action('vouchers/be_interested', "{$action_path}/be_interested.php"); // send interest elgg_register_action("vouchers/usersettings", "{$action_path}/usersettings.php"); // save user settings // extend group main page elgg_extend_view('groups/tool_latest', 'vouchers/group_module'); //elgg_extend_view("print", "printpreview/pageshell/pageshell"); // add the group vouchers tool option add_group_tool_option('vouchers', elgg_echo('vouchers:group:enablevouchers'), true); // Add vouchers widgets elgg_register_widget_type('vouchers', elgg_echo('vouchers:widget'), elgg_echo('vouchers:widget:description'), 'profile,groups,dashboard'); // member's voucher posts elgg_register_widget_type('vouchers_featured', elgg_echo('vouchers:widget:featured'), elgg_echo('vouchers:widget:featured:description'), 'dashboard'); // featured vouchers for dashboard }
/** * * Initializes the Roles plugin */ function roles_init($event, $type, $object) { elgg_register_library('roles', elgg_get_plugins_path() . 'roles/lib/roles.php'); elgg_register_library('roles_config', elgg_get_plugins_path() . 'roles/lib/config.php'); elgg_load_library('roles'); elgg_load_library('roles_config'); // Provides default roles by own handler. This should be extended by site specific handlers elgg_register_plugin_hook_handler('roles:config', 'role', 'roles_get_roles_config'); // Catch all actions and page route requests elgg_register_plugin_hook_handler('action', 'all', 'roles_actions_permissions'); elgg_register_plugin_hook_handler('route', 'all', 'roles_pages_permissions'); // Due to dynamically created (or extended) menus, we need to catch all 'register' hooks _after_ other modules added/removed their menu items elgg_register_plugin_hook_handler('register', 'all', 'roles_menus_permissions', 9999); // Set up roles based hooks and event listener, after all plugin is initialized elgg_register_event_handler('ready', 'system', 'roles_hooks_permissions'); elgg_register_event_handler('ready', 'system', 'roles_events_permissions'); // Check for role configuration updates if (elgg_is_admin_logged_in()) { // @TODO think through if this should rather be a role-based permission run_function_once('roles_update_100_to_101'); elgg_register_event_handler('ready', 'system', 'roles_check_update'); } // Set up roles based view management elgg_register_event_handler('ready', 'system', 'roles_register_views'); }
function translation_editor_plugins_boot_event() { global $CONFIG; run_function_once("translation_editor_version_053"); // add the custom_keys_locations to language paths $custom_keys_path = $CONFIG->dataroot . "translation_editor" . DIRECTORY_SEPARATOR . "custom_keys" . DIRECTORY_SEPARATOR; if (is_dir($custom_keys_path)) { $CONFIG->language_paths[$custom_keys_path] = true; } // force creation of static to prevent reload of unwanted translations reload_all_translations(); translation_editor_load_custom_languages(); if (elgg_get_context() != "translation_editor") { // remove disabled languages translation_editor_unregister_translations(); } // load custom translations $user_language = get_current_language(); $elgg_default_language = "en"; $load_languages = array($user_language, $elgg_default_language); $load_languages = array_unique($load_languages); $disabled_languages = translation_editor_get_disabled_languages(); foreach ($load_languages as $language) { if (empty($disabled_languages) || !in_array($language, $disabled_languages)) { // add custom translations translation_editor_load_translations($language); } } }
/** * Init the OhYesChat * * @access system * @return null; */ function OhYesChat() { $plugin = elgg_get_plugins_path() . 'OhYesChat/'; elgg_register_simplecache_view('css/ohyes/ohyeschat'); $ohyescss = elgg_get_simplecache_url('css', 'ohyes/ohyeschat'); elgg_register_css('ohyeschat.css', $ohyescss); elgg_register_simplecache_view('css/ohyes/ohyeschat.admin'); $ohyescssadmin = elgg_get_simplecache_url('css', 'ohyes/ohyeschat.admin'); elgg_register_css('ohyeschat.admin.css', $ohyescssadmin); elgg_register_simplecache_view('js/ohyes/ohyescha'); $ohyesjs = elgg_get_simplecache_url('js', 'ohyes/ohyeschat'); elgg_register_js('ohyeschat.js', $ohyesjs); if (elgg_is_logged_in()) { elgg_register_page_handler('ohyeschat', 'ohyeschat_page_handler'); elgg_register_page_handler('chat', 'ohyeschat_page_handler'); } elgg_register_action('ohyes/chat/deletemssages', "{$plugin}actions/admin/deletemssages.php", 'admin'); elgg_extend_view('page/elements/foot', 'ohyes/chat/bar'); elgg_extend_view('page/elements/body', 'ohyes/header/chat', 1); elgg_extend_view('page/elements/body', 'ohyes/chat/sound'); OhYesChat::loadCss(); OhYesChat::loadJs(); run_function_once('ohyeschat_setup'); //register menu items OhYesChat::RegisterMenus(); }
function upgrades() { if (!elgg_is_admin_logged_in()) { return; } require_once __DIR__ . '/upgrades.php'; run_function_once(__NAMESPACE__ . '\\upgrade20150911'); }
function upgrades() { if (!elgg_is_admin_logged_in()) { return true; } elgg_load_library(__NAMESPACE__ . '\\upgrades'); run_function_once(__NAMESPACE__ . '\\upgrade_20141130'); }
function group_tools_init() { // extend css & js elgg_extend_view("css/elgg", "group_tools/css/site"); // register JS and CSS libs elgg_register_js("jquery.autocomplete.min", elgg_get_site_url() . "vendors/jquery/jquery.autocomplete.min.js"); elgg_register_simplecache_view("js/group_tools/autocomplete"); elgg_register_js("group_tools.autocomplete", elgg_get_simplecache_url("js", "group_tools/autocomplete")); elgg_register_simplecache_view("css/group_tools/autocomplete"); elgg_register_css("group_tools.autocomplete", elgg_get_simplecache_url("css", "group_tools/autocomplete")); // extend groups page handler elgg_register_plugin_hook_handler("route", "groups", "group_tools_route_groups_handler"); // hook on title menu elgg_register_plugin_hook_handler("register", "menu:title", "group_tools_menu_title_handler"); elgg_register_plugin_hook_handler("register", "menu:user_hover", "group_tools_menu_entity_handler"); if (elgg_get_plugin_setting("multiple_admin", "group_tools") == "yes") { // add group tool option add_group_tool_option("group_multiple_admin_allow", elgg_echo("group_tools:multiple_admin:group_tool_option"), false); // register permissions check hook elgg_register_plugin_hook_handler("permissions_check", "group", "group_tools_multiple_admin_can_edit_hook"); // register on group leave elgg_register_event_handler("leave", "group", "group_tools_multiple_admin_group_leave"); } // register group activity widget // 2012-05-03: restored limited functionality of group activity widget, will be fully restored if Elgg fixes widget settings elgg_register_widget_type("group_river_widget", elgg_echo("widgets:group_river_widget:title"), elgg_echo("widgets:group_river_widget:description"), "dashboard,profile,index,groups", true); // unregister dashboard widget elgg_unregister_widget_type("group_activity"); // register group members widget elgg_register_widget_type("group_members", elgg_echo("widgets:group_members:title"), elgg_echo("widgets:group_members:description"), "groups", false); // register groups invitations widget elgg_register_widget_type("group_invitations", elgg_echo("widgets:group_invitations:title"), elgg_echo("widgets:group_invitations:description"), "index,dashboard", false); // register featured groups widget elgg_register_widget_type("featured_groups", elgg_echo("groups:featured"), elgg_echo("widgets:featured_groups:description"), "index"); // group invitation elgg_register_action("groups/invite", dirname(__FILE__) . "/actions/groups/invite.php"); // manage auto join for groups elgg_extend_view("groups/edit", "group_tools/forms/auto_join", 400); elgg_register_event_handler("create", "member_of_site", "group_tools_join_site_handler"); // show group edit as tabbed elgg_extend_view("groups/edit", "group_tools/group_edit_tabbed", 1); elgg_extend_view("groups/edit", "group_tools/group_edit_tabbed_js", 999999999); // show group profile widgets - edit form elgg_extend_view("groups/edit", "group_tools/forms/profile_widgets", 400); // show group status in owner block elgg_extend_view("page/elements/owner_block/extend", "group_tools/owner_block"); // show group status in stats (on group profile) elgg_extend_view("groups/profile/summary", "group_tools/group_stats"); if (elgg_is_admin_logged_in()) { run_function_once("group_tools_version_1_3"); } // group creation can be limited to admins if (!elgg_is_admin_logged_in() && group_tools_is_group_creation_limited()) { elgg_unregister_action("groups/edit"); } // register index widget to show latest discussions elgg_register_widget_type("index_discussions", elgg_echo("discussion:latest"), elgg_echo("widgets:index_discussions:description"), "index", false); }
function upgrades() { // only allow admin to perform upgrades if (!elgg_is_admin_logged_in()) { return true; } elgg_load_library('plugins:upgrades'); run_function_once(__NAMESPACE__ . '\\upgrade_20141121'); run_function_once(__NAMESPACE__ . '\\upgrade_20141125'); }
/** * initialization of plugin * * @return void */ function profile_manager_init() { // register libraries elgg_register_js("jquery.ui.multiselect", "mod/profile_manager/vendors/jquery_ui_multiselect/jquery.multiselect.js"); // Extend CSS elgg_extend_view("css/admin", "css/profile_manager/global"); elgg_extend_view("css/admin", "css/profile_manager/admin"); elgg_extend_view("css/admin", "css/profile_manager/multiselect"); elgg_extend_view("css/elgg", "css/profile_manager/multiselect"); elgg_extend_view("css/elgg", "css/profile_manager/global"); elgg_extend_view("css/elgg", "css/profile_manager/site"); elgg_extend_view("js/elgg", "js/profile_manager/site"); elgg_extend_view("js/admin", "js/profile_manager/admin"); // Register Page handler elgg_register_page_handler("profile_manager", "profile_manager_page_handler"); // admin user add, registered here to overrule default action elgg_register_action("useradd", dirname(__FILE__) . "/actions/useradd.php", "admin"); // Register all custom field types profile_manager_register_custom_field_types(); // add profile_completeness widget if (elgg_get_plugin_setting("enable_profile_completeness_widget", "profile_manager") == "yes") { elgg_register_widget_type("profile_completeness", elgg_echo("widgets:profile_completeness:title"), elgg_echo("widgets:profile_completeness:description"), array("profile", "dashboard")); } elgg_register_widget_type("register", elgg_echo("widgets:register:title"), elgg_echo("widgets:register:description"), array("index")); // free_text on register form elgg_extend_view("register/extend_side", "profile_manager/register/free_text"); // where to put extra profile fields elgg_extend_view("register/extend_side", "profile_manager/register/fields"); elgg_extend_view("register/extend", "profile_manager/register/fields"); // login history elgg_extend_view('core/settings/statistics', 'profile_manager/account/login_history'); // hook for extending menus elgg_register_plugin_hook_handler('register', 'menu:entity', 'profile_manager_register_entity_menu', 600); // extend public pages elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'profile_manager_public_pages'); elgg_register_plugin_hook_handler('permissions_check:annotate', 'site', 'profile_manager_permissions_check_annotate'); // enable username change elgg_extend_view("forms/account/settings", "profile_manager/account/username", 50); // positioned at the beginning of the options // register hook for saving the new username elgg_register_plugin_hook_handler('usersettings:save', 'user', 'profile_manager_username_change_hook'); // site join event handler elgg_register_event_handler("create", "member_of_site", "profile_manager_create_member_of_site"); // always cleanup elgg_register_event_handler("delete", "member_of_site", "profile_manager_delete_member_of_site"); // Run once function to configure this plugin run_function_once('profile_manager_run_once', 1287964800); // 2010-10-25 run_function_once('profile_manager_fix_access_default'); // register ajax views elgg_register_ajax_view("forms/profile_manager/type"); elgg_register_ajax_view("forms/profile_manager/category"); elgg_register_ajax_view("forms/profile_manager/group_field"); elgg_register_ajax_view("forms/profile_manager/profile_field"); }
function roles_pm_init() { elgg_register_event_handler('create', 'object', 'roles_pm_event_create'); elgg_register_event_handler('delete', 'object', 'roles_pm_event_delete'); // Listen to profile_manager and change user role when profile type changes elgg_register_event_handler('all', 'metadata', 'roles_pm_profile_type_change'); // Listen to roles and change profile type when role changes elgg_register_event_handler('all', 'has_role', 'roles_pm_role_change'); // Initial setup of profile types based on existing roles run_function_once('roles_pm_create_profile_types_from_roles'); }
function au_subgroups_init() { // add in our own css elgg_extend_view('css/elgg', 'au_subgroups/css'); elgg_extend_view('forms/groups/edit', 'forms/au_subgroups/edit'); elgg_extend_view('navigation/breadcrumbs', 'au_subgroups/breadcrumb_override', 1); elgg_extend_view('group/elements/summary', 'au_subgroups/group/elements/summary'); elgg_extend_view('groups/tool_latest', 'au_subgroups/group_module'); elgg_extend_view('groups/sidebar/members', 'au_subgroups/sidebar/subgroups'); elgg_extend_view('groups/edit', 'au_subgroups/group/transfer'); elgg_extend_view('groups/profile/fields', 'au_subgroups/groups/profile/fields'); // register the edit page's JavaScript $js = elgg_get_simplecache_url('js', 'au_subgroups/edit_js'); elgg_register_js('au_subgroups_edit.js', $js); elgg_register_simplecache_view('js/au_subgroups/edit_js'); // after group creation or editing we need to check the permissions elgg_register_event_handler('update', 'group', 'au_subgroups_group_visibility'); elgg_register_event_handler('create', 'member', 'au_subgroups_join_group', 0); elgg_register_event_handler('leave', 'group', 'au_subgroups_leave_group'); // break up the create/update events to be more manageable elgg_register_event_handler('create', 'group', 'au_subgroups_add_parent', 1000); elgg_register_event_handler('create', 'group', 'au_subgroups_clone_layout_on_create', 1000); elgg_register_event_handler('create', 'group', 'au_subgroups_group_visibility', 1000); elgg_register_event_handler('pagesetup', 'system', 'au_subgroups_pagesetup'); // replace the existing groups library so we can push some display options elgg_register_library('elgg:groups', elgg_get_plugins_path() . 'au_subgroups/lib/groups.php'); add_group_tool_option('subgroups', elgg_echo('au_subgroups:group:enable')); add_group_tool_option('subgroups_members_create', elgg_echo('au_subgroups:group:memberspermissions')); // route some urls that go through 'groups' handler elgg_register_plugin_hook_handler('route', 'groups', 'au_subgroups_groups_router', 499); // make sure river entries have the correct access elgg_register_plugin_hook_handler('creating', 'river', 'au_subgroups_river_permissions'); // admins of the parent group can edit the sub-group elgg_register_plugin_hook_handler('permissions_check', 'group', 'au_subgroups_group_canedit'); // sort out what happens when a parent group is deleted elgg_register_plugin_hook_handler('action', 'groups/delete', 'au_subgroups_delete_group'); // prevent users from being invited into a subgroup they can't join elgg_register_plugin_hook_handler('action', 'groups/invite', 'au_subgroups_group_invite'); // remove 'join' and 'request membership' title links on subgroups for people not members of the parent elgg_register_plugin_hook_handler('register', 'menu:title', 'au_subgroups_titlemenu'); // register our widget elgg_register_widget_type('au_subgroups', elgg_echo('au_subgroups'), elgg_echo('au_subgroups:widget:description'), 'groups'); //elgg_register_plugin_hook_handler("register", "menu:entity", "group_member_entity_menu_handler"); elgg_register_ajax_view('au_subgroups/search_results'); // group entity menu //elgg_register_plugin_hook_handler('register', 'menu:entity', 'subgroups_entity_menu_setup'); // actions elgg_register_action('au_subgroups/move', dirname(__FILE__) . '/actions/move.php'); // fix some problems if (elgg_is_admin_logged_in()) { run_function_once('au_subgroups_bugfix_20121024a'); } }
/** * initialization of plugin * * @return unknown_type */ function profile_manager_init() { /* Profile NoIndex*/ //if(elgg_get_plugin_setting("allow_profile_noindex", "profile_manager") == 'yes'){ // elgg_extend_view("profile/edit", "profile_manager/profile/edit_profile", 400); //} // Extend CSS elgg_extend_view("css/admin", "profile_manager/css/global"); elgg_extend_view("css/admin", "profile_manager/css/admin"); elgg_extend_view("css/elgg", "profile_manager/css/global"); elgg_extend_view("css/elgg", "profile_manager/css/site"); elgg_extend_view("js/elgg", "profile_manager/js/site"); elgg_extend_view("js/admin", "profile_manager/js/admin"); // Register Page handler elgg_register_page_handler("profile_manager", "profile_manager_page_handler"); /* * TODO: get it working for 1.8 // Register Page handler for Members listing if(elgg_get_plugin_setting("show_members_search") == "yes"){ elgg_register_page_handler("members", "profile_manager_members_page_handler"); add_menu(elgg_echo("profile_manager:members:menu"), $CONFIG->wwwroot . "pg/members"); } */ // admin user add, registered here to overrule default action elgg_register_action("useradd", dirname(__FILE__) . "/actions/useradd.php", "admin"); // Register all custom field types register_custom_field_types(); // add profile_completeness widget if (elgg_get_plugin_setting("enable_profile_completeness_widget", "profile_manager") == "yes") { elgg_register_widget_type("profile_completeness", elgg_echo("widgets:profile_completeness:title"), elgg_echo("widgets:profile_completeness:description"), "profile,dashboard"); } // free_text on register form elgg_extend_view("register/extend_side", "profile_manager/register/free_text"); // where to put extra profile fields if (elgg_get_plugin_setting("registration_extra_fields", "profile_manager") == "beside") { // besides the default registration page elgg_extend_view("register/extend_side", "profile_manager/register/fields"); } else { // just below the default registration page elgg_extend_view("register/extend", "profile_manager/register/fields"); } // Run once function to configure this plugin run_function_once('profile_manager_run_once', 1287964800); // 2010-10-25 run_function_once('pm_fix_access_default'); }
/** * 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); }
/** * This function is called during the "init" event * * @return void */ function thewire_tools_init() { elgg_extend_view("js/elgg", "js/thewire_tools/site"); elgg_extend_view("css/elgg", "css/thewire_tools/site"); if (thewire_tools_groups_enabled()) { // add widget (for Widget Manager only) elgg_register_widget_type("thewire_groups", elgg_echo("widgets:thewire_groups:title"), elgg_echo("widgets:thewire_groups:description"), array("groups"), true); // add group tool option add_group_tool_option("thewire", elgg_echo("thewire_tools:groups:tool_option"), true); // add a menu item to the owner block elgg_register_plugin_hook_handler("register", "menu:owner_block", "thewire_tools_owner_block_menu"); } // adds wire post form to the wire widget elgg_extend_view("core/river/filter", "thewire_tools/activity_post", 400); elgg_extend_view("page/layouts/elements/filter", "thewire_tools/group_activity", 400); // settings elgg_extend_view("notifications/subscriptions/personal", "thewire_tools/notifications/settings"); // register ajax view elgg_register_ajax_view("thewire_tools/reshare"); elgg_register_ajax_view("thewire_tools/reshare_list"); elgg_register_ajax_view("thewire_tools/thread"); // add some extra widgets (for Widget Manager only) elgg_register_widget_type("index_thewire", elgg_echo("widgets:index_thewire:title"), elgg_echo("widgets:index_thewire:description"), array("index"), true); elgg_register_widget_type("thewire_post", elgg_echo("widgets:thewire_post:title"), elgg_echo("widgets:thewire_post:description"), array("index", "dashboard"), false); // register events elgg_register_event_handler("create", "object", "thewire_tools_create_object_event_handler", 100); elgg_register_event_handler("upgrade", "system", "thewire_tools_upgrade_system_event_handler"); // register hooks elgg_register_plugin_hook_handler("route", "thewire", "thewire_tools_route_thewire"); elgg_register_plugin_hook_handler("access:collections:write", "all", "thewire_tools_access_write_hook", 999); elgg_register_plugin_hook_handler("entity:url", "object", "thewire_tools_widget_title_url"); elgg_register_plugin_hook_handler("group_tool_widgets", "widget_manager", "thewire_tools_tool_widgets_handler"); elgg_register_plugin_hook_handler("register", "menu:entity", "thewire_tools_register_entity_menu_items"); elgg_register_plugin_hook_handler("register", "menu:entity", array('\\ColdTrick\\TheWireTools\\EntityMenu', 'registerReshare')); elgg_register_plugin_hook_handler("register", "menu:river", "thewire_tools_register_river_menu_items"); elgg_register_plugin_hook_handler("action", "notificationsettings/save", "thewire_tools_notifications_settings_save_hook"); // upgrade function run_function_once("thewire_tools_runonce"); // overrule default save action elgg_unregister_action("thewire/add"); elgg_register_action("thewire/add", dirname(__FILE__) . "/actions/thewire/add.php"); elgg_register_action("thewire_tools/mentions_upgrade", dirname(__FILE__) . "/actions/upgrades/mentions.php"); }
/** * initialization of plugin * * @return unknown_type */ function profile_manager_init() { // Extend CSS elgg_extend_view("css/admin", "profile_manager/css/global"); elgg_extend_view("css/admin", "profile_manager/css/admin"); elgg_extend_view("css/elgg", "profile_manager/css/global"); elgg_extend_view("css/elgg", "profile_manager/css/site"); elgg_extend_view("js/elgg", "profile_manager/js/site"); elgg_extend_view("js/admin", "profile_manager/js/admin"); // Register Page handler elgg_register_page_handler("profile_manager", "profile_manager_page_handler"); // admin user add, registered here to overrule default action elgg_register_action("useradd", dirname(__FILE__) . "/actions/useradd.php", "admin"); // Register all custom field types register_custom_field_types(); // add profile_completeness widget if (elgg_get_plugin_setting("enable_profile_completeness_widget", "profile_manager") == "yes") { elgg_register_widget_type("profile_completeness", elgg_echo("widgets:profile_completeness:title"), elgg_echo("widgets:profile_completeness:description"), "profile,dashboard"); } // free_text on register form elgg_extend_view("register/extend_side", "profile_manager/register/free_text"); // where to put extra profile fields if (elgg_get_plugin_setting("registration_extra_fields", "profile_manager") == "beside") { // besides the default registration page elgg_extend_view("register/extend_side", "profile_manager/register/fields"); } else { // just below the default registration page elgg_extend_view("register/extend", "profile_manager/register/fields"); } // enable username change $enable_username_change = elgg_get_plugin_setting("enable_username_change", "profile_manager"); if ($enable_username_change == "yes" || $enable_username_change == "admin" && elgg_is_admin_logged_in()) { elgg_extend_view("forms/account/settings", "profile_manager/account/username", 50); // positioned at the beginning of the options // register hook for saving the new username elgg_register_plugin_hook_handler('usersettings:save', 'user', 'profile_manager_username_change_hook'); } // Run once function to configure this plugin run_function_once('profile_manager_run_once', 1287964800); // 2010-10-25 run_function_once('pm_fix_access_default'); }
function spam_login_filter_init() { $action_path = elgg_get_plugins_path() . "spam_login_filter/actions/spam_login_filter"; elgg_register_plugin_hook_handler("action", "register", "spam_login_filter_verify_action_hook", 999); elgg_register_plugin_hook_handler('cron', 'daily', 'spam_login_filter_cron'); elgg_register_plugin_hook_handler('route', 'all', 'spam_login_filter_router'); elgg_register_event_handler('login', 'user', 'spam_login_filter_login_event'); elgg_register_action('spam_login_filter/delete_ip', "{$action_path}/delete_ip.php", 'admin'); elgg_register_admin_menu_item('administer', 'manageip', 'administer_utilities'); // Extend context menu with admin links if (elgg_is_admin_logged_in()) { if (elgg_is_active_plugin('tracker')) { elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'spam_login_filter_hover_menu', 1000); elgg_register_action("spam_login_filter/delete", "{$action_path}/delete.php", "admin"); } // run upgrades run_function_once('spam_login_filter_upgrade_1'); } return true; }
/** * Initializes the Roles plugin * @return void */ function roles_init() { elgg_extend_view('forms/useradd', 'roles/useradd'); // Provides default roles by own handler. This should be extended by site specific handlers elgg_register_plugin_hook_handler('roles:config', 'role', 'roles_get_roles_config'); // Catch all actions and page route requests elgg_register_plugin_hook_handler('action', 'all', 'roles_actions_permissions'); elgg_register_plugin_hook_handler('route', 'all', 'roles_pages_permissions'); // Remove menu items after all items have been registered elgg_register_plugin_hook_handler('register', 'all', 'roles_menus_permissions', 9999); elgg_register_plugin_hook_handler('register', 'all', 'roles_menus_cleanup', 9999); // Check for role configuration updates if (elgg_is_admin_logged_in()) { // @TODO think through if this should rather be a role-based permission run_function_once('roles_update_100_to_101'); elgg_register_event_handler('ready', 'system', 'roles_check_update', 1); } // Set up role-specific views, hooks and events, after all plugins are initialized elgg_register_event_handler('ready', 'system', 'roles_hooks_permissions', 9999); elgg_register_event_handler('ready', 'system', 'roles_events_permissions', 9999); elgg_register_event_handler('ready', 'system', 'roles_register_views', 9999); elgg_register_event_handler('create', 'user', 'roles_create_user'); }
/** * Elgg oauth client and server * * @author Justin Richer * @copyright The MITRE Corporation * @link http://mitre.org/ */ function oauth_init() { // Get config global $CONFIG; // include the OAuth library if (!class_exists('OAuthConsumer')) { include $CONFIG->pluginspath . 'oauth/lib/OAuth.php'; } // set up the data store include $CONFIG->pluginspath . 'oauth/lib/ElggOAuthDataStore.php'; // set up our actions and hooks // mechanisms to register and unregister consumers elgg_register_action('oauth/register', $CONFIG->pluginspath . 'oauth/actions/register.php'); elgg_register_action('oauth/unregister', $CONFIG->pluginspath . 'oauth/actions/unregister.php'); elgg_register_action('oauth/editconsumer', $CONFIG->pluginspath . 'oauth/actions/editconsumer.php'); // mechanisms to let the user authorize and revoke their tokens elgg_register_action('oauth/authorize', $CONFIG->pluginspath . 'oauth/actions/authorize.php'); elgg_register_action('oauth/revoke', $CONFIG->pluginspath . 'oauth/actions/revoke.php'); // mechanisms to allow consumers of remote sites to request tokens elgg_register_action('oauth/gettoken', $CONFIG->pluginspath . 'oauth/actions/gettoken.php'); // page handler elgg_register_page_handler('oauth', 'oauth_page_handler'); // plugins hooks (for permissions on OAuth token and consumer objects) elgg_register_plugin_hook_handler('permissions_check', 'object', 'oauth_permissions_check'); // cron to clean up old nonces and tokens elgg_register_plugin_hook_handler('cron', 'hourly', 'oauth_cron_cleanup'); // add our menu pieces elgg_register_menu_item('site', array('name' => elgg_echo('oauth:menu'), 'text' => elgg_echo('oauth:menu'), 'href' => $CONFIG->wwwroot . 'oauth/authorize')); // hook for the PAM permissions system register_pam_handler('oauth_pam_handler', 'sufficient', 'user'); register_pam_handler('oauth_pam_handler', 'sufficient', 'api'); // API Test function expose_function('oauth.echo', 'oauth_echo', array('string' => array('type' => 'string')), 'A testing method for OAuth authentication', 'GET', true, true); // run our set up and upgrade functions run_function_once('oauth_run_once'); run_function_once('oauth_upgrade_201004'); }
/** * This function is called during the "init" event * * @return void */ function thewire_tools_init() { elgg_extend_view("js/elgg", "thewire_tools/js/site"); elgg_extend_view("css/elgg", "thewire_tools/css/site"); // overrule url handler elgg_register_entity_url_handler("thewire_tools_url_handler", "object", "thewire"); if (thewire_tools_groups_enabled()) { // add widget (for Widget Manager only) elgg_register_widget_type("thewire_groups", elgg_echo("widgets:thewire_groups:title"), elgg_echo("widgets:thewire_groups:description"), "groups", true); // add group tool option add_group_tool_option("thewire", elgg_echo("thewire_tools:groups:tool_option"), true); // add a menu item to the owner block elgg_register_plugin_hook_handler("register", "menu:owner_block", "thewire_tools_owner_block_menu"); } // adds wire post form to the wire widget elgg_extend_view("widgets/thewire/content", "thewire_tools/thewire_post", 400); elgg_extend_view("widgets/index_thewire/content", "thewire_tools/thewire_post", 400); elgg_extend_view("core/river/filter", "thewire_tools/activity_post", 400); elgg_extend_view("page/layouts/content", "thewire_tools/group_activity", 400); // add some extra widgets (for Widget Manager only) elgg_register_widget_type("index_thewire", elgg_echo("widgets:index_thewire:title"), elgg_echo("widgets:index_thewire:description"), "index", true); elgg_register_widget_type("thewire_post", elgg_echo("widgets:thewire_post:title"), elgg_echo("widgets:thewire_post:description"), "index,dashboard", false); // register events elgg_register_event_handler("create", "object", "thewire_tools_create_object_event_handler", 100); // register hooks elgg_register_plugin_hook_handler("route", "thewire", "thewire_tools_route_thewire"); elgg_register_plugin_hook_handler("access:collections:write", "all", "thewire_tools_access_write_hook", 999); elgg_register_plugin_hook_handler("forward", "all", "thewire_tools_forward_hook"); elgg_register_plugin_hook_handler("widget_url", "widget_manager", "thewire_tools_widget_title_url"); elgg_register_plugin_hook_handler("register", "menu:entity", "thewire_tools_register_entity_menu_items"); elgg_register_plugin_hook_handler("register", "menu:river", "thewire_tools_register_river_menu_items"); // upgrade function run_function_once("thewire_tools_runonce"); // overrule default save action elgg_unregister_action("thewire/add"); elgg_register_action("thewire/add", dirname(__FILE__) . "/actions/thewire/add.php"); }
/** * initialization of plugin * * @return unknown_type */ function profile_manager_init() { global $CONFIG; // Extend CSS extend_view("css", "profile_manager/css"); extend_view("css", "members/css"); extend_view("js/initialise_elgg", "profile_manager/global_js"); // add custom profile fields to register page extend_view("account/forms/register", "profile_manager/register"); // extend the user profile view extend_view("profile/userdetails", "profile_manager/profile/userdetails"); // link to full profile if (get_plugin_setting("show_full_profile_link") == "yes") { extend_view("profile/menu/actions", "profile_manager/profile/userlinks"); } // Extend the admin statistics if (get_plugin_setting("show_admin_stats") == "yes") { extend_view("admin/statistics", "profile_manager/admin_stats"); } // Register a page handler, so we can have nice URLs register_page_handler('defaultprofile', 'profile_manager_edit_defaults_page_handler'); // Register Page handler for Custom Profile Fields register_page_handler("profile_manager", "profile_manager_page_handler"); // Register Page handler for Members listing if (get_plugin_setting("show_members_search") == "yes") { register_page_handler("members", "profile_manager_members_page_handler"); add_menu(elgg_echo("profile_manager:members:menu"), $CONFIG->wwwroot . "pg/members"); } // admin user add, registered here to overrule default action register_action("useradd", false, $CONFIG->pluginspath . "profile_manager/actions/admin/useradd.php", true); // Register all custom field types register_custom_field_types(); // Run once function to configure this plugin run_function_once('profile_manager_run_once', 1265673600); // 2010-02-09 }
<?php // hypeForum upgrade scripts $ia = elgg_set_ignore_access(true); ini_set('memory_limit', '512M'); ini_set('max_execution_time', '500'); run_function_once('hj_forum_1358206168'); run_function_once('hj_forum_1358285155'); run_function_once('hj_forum_1359738428'); run_function_once('hj_forum_1360277917'); run_function_once('hj_forum_1360948016'); run_function_once('hj_forum_1360948621'); run_function_once('hj_forum_1361379905'); run_function_once('hj_forum_1372438394'); elgg_set_ignore_access($ia); function hj_forum_1358206168() { $subtypes = array('hjforum' => 'hjForum', 'hjforumcategory' => 'hjForumCategory', 'hjforumtopic' => 'hjForumTopic', 'hjforumpost' => 'hjForumPost'); foreach ($subtypes as $subtype => $class) { if (get_subtype_id('object', $subtype)) { update_subtype('object', $subtype, $class); } else { add_subtype('object', $subtype, $class); } } $subtypeIdForum = get_subtype_id('object', 'hjforum'); $subtypeIdForumTopic = get_subtype_id('object', 'hjforumtopic'); $subtypeIdAnnotation = get_subtype_id('object', 'hjannotation'); $dbprefix = elgg_get_config('dbprefix'); $segments = elgg_get_entities_from_metadata(array('types' => 'object', 'subtypes' => 'hjsegment', 'metadata_name_value_pairs' => array('name' => 'handler', 'value' => 'hjforumtopic'), 'limit' => 0)); /**
/** * Initialize the plugin system * Listens to system init and registers actions * * @return void * @access private */ function plugin_init() { run_function_once("plugin_run_once"); elgg_register_plugin_hook_handler('unit_test', 'system', 'plugins_test'); // note - plugins are booted by the time this handler is registered // deactivation due to error may have already occurred elgg_register_event_handler('deactivate', 'plugin', '_plugins_deactivate_dependency_check'); elgg_register_action("plugins/settings/save", '', 'admin'); elgg_register_action("plugins/usersettings/save"); elgg_register_action('admin/plugins/activate', '', 'admin'); elgg_register_action('admin/plugins/deactivate', '', 'admin'); elgg_register_action('admin/plugins/activate_all', '', 'admin'); elgg_register_action('admin/plugins/deactivate_all', '', 'admin'); elgg_register_action('admin/plugins/set_priority', '', 'admin'); elgg_register_library('elgg:markdown', elgg_get_root_path() . 'vendors/markdown/markdown.php'); }
/** * Initialise the file modules. * Listens to system init and configures the default filestore * * @return void * @access private */ function filestore_init() { global $CONFIG; // Now register a default filestore if (isset($CONFIG->dataroot)) { set_default_filestore(new ElggDiskFilestore($CONFIG->dataroot)); } // Now run this stuff, but only once run_function_once("filestore_run_once"); }
/** * Initialize the plugin system * Listens to system init and registers actions * * @return void * @access private */ function plugin_init() { run_function_once("plugin_run_once"); elgg_register_plugin_hook_handler('unit_test', 'system', 'plugins_test'); elgg_register_action("plugins/settings/save", '', 'admin'); elgg_register_action("plugins/usersettings/save"); elgg_register_action('admin/plugins/activate', '', 'admin'); elgg_register_action('admin/plugins/deactivate', '', 'admin'); elgg_register_action('admin/plugins/activate_all', '', 'admin'); elgg_register_action('admin/plugins/deactivate_all', '', 'admin'); elgg_register_action('admin/plugins/set_priority', '', 'admin'); elgg_register_library('elgg:markdown', elgg_get_root_path() . 'vendors/markdown/markdown.php'); }
/** * Initialise the file modules. * Listens to system boot and registers any appropriate file types and classes */ function plugin_init() { // Now run this stuff, but only once run_function_once("plugin_run_once"); // Register some actions register_action("plugins/settings/save", false, "", true); register_action("plugins/usersettings/save"); register_action('admin/plugins/enable', false, "", true); // Enable register_action('admin/plugins/disable', false, "", true); // Disable register_action('admin/plugins/enableall', false, "", true); // Enable all register_action('admin/plugins/disableall', false, "", true); // Disable all register_action('admin/plugins/reorder', false, "", true); // Reorder }