/** * Initialize the plugin. */ function tour_init() { $js_lib = elgg_get_plugin_setting('js_library', 'tour'); if ($js_lib == 'joyride') { elgg_register_css('joyride', '/mod/tour/vendors/joyride/joyride-2.1.css'); elgg_load_css('joyride'); elgg_define_js('joyride', array('src' => '/mod/tour/vendors/joyride/jquery.joyride-2.1.js', 'exports' => 'joyride')); } else { elgg_register_css('hopscotch', '/mod/tour/vendors/hopscotch/css/hopscotch.min.css'); elgg_load_css('hopscotch'); elgg_define_js('hopscotch', array('src' => '/mod/tour/vendors/hopscotch/hopscotch.min.js', 'exports' => 'hopscotch')); } elgg_require_js('elgg/tour/display'); //elgg_require_js('elgg/tour/edit'); elgg_register_ajax_view('ajax/tour_stop/save'); elgg_extend_view('page/elements/footer', 'tour/outline'); elgg_extend_view('css/elgg', 'css/tour'); elgg_extend_view('css/admin', 'css/tour_admin'); elgg_register_action('tour_page/save', __DIR__ . '/actions/tour_page/save.php', 'admin'); elgg_register_action('tour_page/reorder', __DIR__ . '/actions/tour_page/reorder.php', 'admin'); elgg_register_action('tour_page/delete', __DIR__ . '/actions/tour_page/delete.php', 'admin'); elgg_register_action('tour_stop/save', __DIR__ . '/actions/tour_stop/save.php', 'admin'); elgg_register_action('tour_stop/delete', __DIR__ . '/actions/tour_stop/delete.php', 'admin'); elgg_register_page_handler('tour', 'tour_page_handler'); elgg_register_page_handler('tour_stop', 'tour_page_handler'); // For convenience elgg_register_admin_menu_item('administer', 'tour', 'administer_utilities'); elgg_register_menu_item('topbar', array('name' => 'tour', 'href' => '', 'text' => elgg_echo('tour:start'), 'id' => 'tour-start', 'section' => 'alt', 'data-library' => $js_lib)); elgg_register_plugin_hook_handler('register', 'menu:entity', array('Tour\\Page\\EntityMenu', 'setUp')); elgg_register_plugin_hook_handler('register', 'menu:entity', array('Tour\\Stop\\EntityMenu', 'setUp')); elgg_register_viewtype('json'); }
function hydra_theme_init() { elgg_unextend_view('page/elements/header', 'search/header'); elgg_extend_view('page/elements/sidebar', 'search/header', 0); if (elgg_get_context() != "admin") { elgg_require_js("lorea_hydra/js"); } $bower = elgg_get_site_url() . "mod/lorea_hydra/vendors/bower_components/"; elgg_register_css("bootstrap", "{$bower}bootstrap/dist/css/bootstrap.css", 0); elgg_register_css("bootstrap-select", "{$bower}bootstrap-select/dist/css/bootstrap-select.min.css"); elgg_register_css("jasny", "{$bower}jasny-bootstrap/dist/css/jasny-bootstrap.min.css"); elgg_register_css("lorea_hydra", elgg_get_site_url() . "mod/hydra_theme/css/lorea_hydra.css", 10000); elgg_define_js("bootstrap", array("src" => "{$bower}bootstrap/dist/js/bootstrap.min.js")); //elgg_register_js("bootstrap", "{$bower}bootstrap/dist/js/bootstrap.min.js"); elgg_register_js("bootstrap-select", "{$bower}bootstrap-select/dist/js/bootstrap-select.min.js"); elgg_register_js("jasny", "{$bower}jasny-bootstrap/dist/js/jasny-bootstrap.min.js"); elgg_register_js("lorea_hydra", elgg_get_site_url() . "mod/hydra_theme/css/lorea_hydra.css", 10000); if (elgg_get_context() != "admin") { elgg_load_css("bootstrap"); elgg_load_css("bootstrap-select"); elgg_load_css("lorea_hydra"); elgg_load_css("jasny"); elgg_load_js("bootstrap"); elgg_load_js("jasny"); elgg_load_js("bootstrap-select"); elgg_load_js("lorea_hydra"); } }
function init() { elgg_extend_view('css/elgg', 'css/elgg_recaptcha'); elgg_register_plugin_hook_handler('view', 'all', __NAMESPACE__ . '\\view_hook'); elgg_register_plugin_hook_handler('action', 'all', __NAMESPACE__ . '\\action_hook'); elgg_define_js('google_recaptcha', array('src' => 'https://www.google.com/recaptcha/api.js?render=explicit&onload=elgg_recaptcha_render&hl=' . get_language())); }
/** * Init * @return void */ function prototyper_validators_init() { elgg_extend_view('prototyper/elements/help', 'prototyper/elements/validation'); elgg_extend_view('prototyper/input/before', 'prototyper/elements/js_validation'); elgg_register_plugin_hook_handler('validate:type', 'prototyper', 'prototyper_validate_type'); hypePrototyper()->config->registerValidationRule('type', array('string', 'alnum', 'alpha', 'int', 'numeric', 'date', 'url', 'email', 'guid', 'image')); elgg_register_plugin_hook_handler('validate:min', 'prototyper', 'prototyper_validate_min'); hypePrototyper()->config->registerValidationRule('min'); elgg_register_plugin_hook_handler('validate:max', 'prototyper', 'prototyper_validate_max'); hypePrototyper()->config->registerValidationRule('max'); elgg_register_plugin_hook_handler('validate:minlength', 'prototyper', 'prototyper_validate_minlength'); hypePrototyper()->config->registerValidationRule('minlength'); elgg_register_plugin_hook_handler('validate:maxlength', 'prototyper', 'prototyper_validate_maxlength'); hypePrototyper()->config->registerValidationRule('maxlength'); elgg_register_plugin_hook_handler('validate:contains', 'prototyper', 'prototyper_validate_contains'); hypePrototyper()->config->registerValidationRule('contains'); elgg_register_plugin_hook_handler('validate:regex', 'prototyper', 'prototyper_validate_regex'); hypePrototyper()->config->registerValidationRule('regex'); if (\hypeJunction\Integration::isElggVersionBelow('1.9.0')) { elgg_register_js('parsley', '/mod/hypePrototyperValidators/vendors/parsley/parsley.min.js', 'footer'); elgg_register_simplecache_view('js/framework/legacy/prototyper_validation'); elgg_register_js('prototyper_validation', elgg_get_simplecache_url('js', 'framework/legacy/prototyper_validation'), 'footer'); } else { elgg_define_js('parsley', array('src' => '/mod/hypePrototyperValidators/vendors/parsley/parsley.min.js', 'deps' => array('jquery'))); } elgg_register_plugin_hook_handler('input_vars', 'prototyper', 'prototyper_filter_input_view_vars'); }
function stripe_init() { // Register Stripe js //elgg_register_js('stripe.js', 'https://js.stripe.com/v2/', 'head', 50); //elgg_load_js('stripe.js'); elgg_define_js('stripe', ['src' => 'https://js.stripe.com/v2/stripe.js']); elgg_require_js('stripe'); elgg_extend_view('js/initialize_elgg', 'js/stripe/config'); elgg_extend_view('js/elgg', 'js/stripe/cards'); elgg_extend_view('css/elgg', 'css/stripe/css'); elgg_extend_view('css/admin', 'css/stripe/css'); // Registering actions elgg_register_action('stripe/customers/sync', __DIR__ . '/actions/stripe/customers/sync.php', 'admin'); elgg_register_action('stripe/cards/add', __DIR__ . '/actions/stripe/cards/add.php', 'public'); elgg_register_action('stripe/cards/remove', __DIR__ . '/actions/stripe/cards/remove.php'); elgg_register_action('stripe/cards/set_default', __DIR__ . '/actions/stripe/cards/make_default.php'); elgg_register_action('stripe/subscriptions/cancel', __DIR__ . '/actions/stripe/subscriptions/cancel.php'); // Page handler elgg_register_page_handler('billing', 'stripe_page_handler'); elgg_register_plugin_hook_handler('register', 'menu:stripe-actions', 'stripe_actions_menu'); elgg_register_plugin_hook_handler('ping', 'stripe.events', 'stripe_ping_event'); elgg_register_plugin_hook_handler('customer.created', 'stripe.events', 'stripe_customer_created_event'); elgg_register_plugin_hook_handler('customer.deleted', 'stripe.events', 'stripe_customer_deleted_event'); elgg_register_plugin_hook_handler('charge.succeeded', 'stripe.events', 'stripe_charge_succeeded_event'); elgg_register_plugin_hook_handler('charge.failed', 'stripe.events', 'stripe_charge_failed_event'); elgg_register_plugin_hook_handler('charge.refunded', 'stripe.events', 'stripe_charge_refunded_event'); // Stripe Webhooks elgg_ws_expose_function('stripe.webhooks', 'stripe_webhook_handler', array('environment' => array('type' => 'string', 'required' => true)), 'Handles webhooks received from Stripe', 'POST', false, false); // Map newly registered users to their Stripe profiles if any elgg_register_event_handler('create', 'user', 'stripe_register_user'); }
function elggchat_init() { elgg_extend_view('css/admin', 'elggchat/admin_css'); elgg_extend_view('css/elgg', 'elggchat/css'); $js_elggchat_sound = elgg_get_simplecache_url('js', 'elggchat/buzz.js'); elgg_register_simplecache_view('js/elggchat/buzz.js'); elgg_register_js('elggchat_sound', $js_elggchat_sound, 'head', 400); elgg_define_js('elggchat_scroll', array('src' => elgg_get_site_url() . 'mod/elggchat/views/default/js/elggchat/jquery.scrollTo.js')); if (elgg_is_logged_in()) { if (elgg_get_plugin_user_setting("enableChat", 0, "elggchat") != "no") { elgg_extend_view('page/elements/footer', 'elggchat/session_monitor'); } } elgg_register_admin_menu_item('administer', 'elggchat', 'administer_utilities'); // Extend avatar hover menu elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'elggchat_user_hover_menu'); // Register cron job $keepsessions = elgg_get_plugin_setting("keepsessions", "elggchat"); if (elgg_get_plugin_setting("keepsessions", "elggchat") != "yes") { elgg_register_plugin_hook_handler('cron', 'hourly', 'elggchat_session_cleanup'); } // Actions $action_path = elgg_get_plugins_path() . 'elggchat/actions'; elgg_register_action("elggchat/create", "{$action_path}/create.php", "logged_in"); elgg_register_action("elggchat/post_message", "{$action_path}/post_message.php", "logged_in"); elgg_register_action("elggchat/poll", "{$action_path}/poll.php", "logged_in"); elgg_register_action("elggchat/invite", "{$action_path}/invite.php", "logged_in"); elgg_register_action("elggchat/leave", "{$action_path}/leave.php", "logged_in"); elgg_register_action("elggchat/get_smiley", "{$action_path}/get_smiley.php", "logged_in"); elgg_register_action("elggchat/admin_message", "{$action_path}/admin_message.php", "admin"); elgg_register_action("elggchat/delete_session", "{$action_path}/delete_session.php", "admin"); // Logout event handler elgg_register_event_handler('logout:before', 'user', 'elggchat_logout_handler'); }
function staticsites_init() { // Register backbone elgg_register_library('elgg:backbone', elgg_get_plugins_path() . 'staticsites/lib/backbone/backbone.php'); elgg_load_library('elgg:backbone'); elgg_register_library('elgg:staticsites', elgg_get_plugins_path() . 'staticsites/lib/staticsites.php'); elgg_load_library('elgg:staticsites'); // Include plugin vendors require elgg_get_plugins_path() . 'staticsites/vendor/autoload.php'; // Static sites CSS elgg_extend_view('css/elgg', 'css/staticsites/css'); // Register underscore with requirejs (and elgg) elgg_define_js('underscore', array('src' => 'mod/staticsites/vendors/underscore-min.js', 'location' => 'footer', 'exports' => '_')); // Register backbone with requirejs (and elgg) elgg_define_js('backbone', array('src' => 'mod/staticsites/vendors/backbone-min.js', 'location' => 'footer', 'deps' => array('jquery'), 'exports' => 'Backbone')); // Alloy Editor elgg_define_js('alloyEditor', array('src' => 'mod/staticsites/vendors/alloy-editor/alloy-editor-all-min.js', 'location' => 'footer', 'exports' => 'AlloyEditor')); // Alloy Editor CSS elgg_register_css('alloyeditor', 'mod/staticsites/vendors/alloy-editor/assets/alloy-editor-ocean-min.css'); elgg_load_css('alloyeditor'); // Set up group admin tools menu elgg_register_plugin_hook_handler('register', 'menu:groups:admin', 'staticsites_groups_admin_menu_setup'); // Register main page handler elgg_register_page_handler('staticsites', 'staticsites_page_handler'); // Actions $action_base = elgg_get_plugins_path() . "staticsites/actions/staticsites"; elgg_register_action('staticsites/save_page', "{$action_base}/save_page.php"); elgg_register_action('staticsites/delete_page', "{$action_base}/delete_page.php"); // Whitelist template dir for ajax loads backbone_whitelist_templates(elgg_get_plugins_path() . 'staticsites/views/default/staticsites/templates/'); }
function zaudio_init() { elgg_extend_view('elgg.css', 'zaudio/css'); elgg_define_js('AudioPlayer', ['exports' => 'AudioPlayer']); // leave library registered for BC elgg_register_js('elgg.zaudio', elgg_get_simplecache_url('AudioPlayer.js')); }
function elgg_clean_init() { elgg_unextend_view('page/elements/header', 'search/header'); elgg_extend_view('page/elements/sidebar', 'search/header', 0); if (elgg_get_context() != "admin") { elgg_require_js("elgg_clean/js"); } elgg_register_event_handler('pagesetup', 'system', 'elgg_clean_pagesetup', 1000); elgg_register_plugin_hook_handler('head', 'page', 'elgg_clean_setup_head'); $bower = elgg_get_site_url() . "mod/elgg_clean/vendors/bower_components/"; elgg_register_css("bootstrap", "{$bower}bootstrap/dist/css/bootstrap.css", 0); elgg_register_css("open", "http://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic"); elgg_register_css("passion", "http://fonts.googleapis.com/css?family=Passion+One"); elgg_register_css("elgg_clean", elgg_get_site_url() . "mod/elgg_clean/css/elgg_clean.css", 10000); elgg_register_css("font-awesome", "{$bower}fontawesome/css/font-awesome.min.css"); elgg_register_css("bootstrap-select", "{$bower}bootstrap-select/dist/css/bootstrap-select.min.css"); elgg_register_css("jasny", "{$bower}jasny-bootstrap/dist/css/jasny-bootstrap.min.css"); elgg_register_css("fuelux", "{$bower}fuelux/dist/css/fuelux.min.css"); elgg_register_css("agency", elgg_get_site_url() . "mod/elgg_clean/css/agency.css", 20000); elgg_register_css("home", elgg_get_site_url() . "mod/elgg_clean/css/home.css", 30000); elgg_register_js('respond', '{$bower}respond/src/respond.js'); elgg_define_js("bootstrap", array("src" => "{$bower}bootstrap/dist/js/bootstrap.min.js")); elgg_register_js("bootstrap-select", "{$bower}bootstrap-select/dist/js/bootstrap-select.min.js"); elgg_register_js("jasny", "{$bower}jasny-bootstrap/dist/js/jasny-bootstrap.min.js"); elgg_register_js("agency", elgg_get_site_url() . "mod/elgg_clean/js/agency.js"); elgg_register_js("cbpAnimatedHeader", elgg_get_site_url() . "mod/elgg_clean/js/cbpAnimatedHeader.js"); elgg_register_js("classie", elgg_get_site_url() . "mod/elgg_clean/js/classie.js"); elgg_register_js("contact_me", elgg_get_site_url() . "mod/elgg_clean/js/contact_me.js"); elgg_register_js("scrollspy", "{$bower}scrollspy/jquery.scrollspy.js"); elgg_register_js("parallax", "{$boder}jquery-parallax/scripts/jquery.parallax-1.13.js"); elgg_register_js("scrollto", "{$bower}jquery-parallax/scripts/jquery.scrollTo-1.4.2-min.js"); elgg_define_js('fuelux', array('src' => "{$bower}fuelux/dist/js/fuelux.min.js")); if (elgg_get_context() != "admin") { elgg_load_js('respond'); elgg_load_js("bootstrap"); elgg_load_js("jscolor"); elgg_load_js("elgg_clean"); elgg_load_js("bootstrap-select"); elgg_load_js("jasny"); elgg_load_js("agency"); elgg_load_js("parallax"); elgg_load_js("scrollto"); elgg_require_js("fuelux"); elgg_load_css("bootstrap"); elgg_load_css("open"); elgg_load_css("passion"); elgg_load_css("font-awesome"); elgg_load_css("bootstrap-select"); elgg_load_css("elgg_clean"); elgg_load_css("jasny"); elgg_load_css("fuelux"); elgg_load_css("agency"); } // non-members do not get visible links to RSS feeds if (!elgg_is_logged_in()) { elgg_unregister_plugin_hook_handler('output:before', 'layout', 'elgg_views_add_rss_link'); } elgg_register_action("elgg_clean/contact", elgg_get_plugins_path() . "elgg_clean/actions/contact.php", "public"); }
/** * Initialize the plugin * @return void */ function arck_avatar_init() { elgg_register_action('avatar/upload', __DIR__ . '/actions/avatar/upload.php'); elgg_register_plugin_hook_handler('route', 'avatar', 'arck_avatar_router'); elgg_define_js('cropper', array('src' => '/mod/arck_avatar/vendors/jquery.cropper/cropper.min.js', 'deps' => array('jquery'))); elgg_register_css('jquery.cropper', '/mod/arck_avatar/vendors/jquery.cropper/cropper.min.css'); elgg_register_css('arck.avatar', elgg_get_simplecache_url('css', 'arck/avatar.css')); }
function extended_tinymce_init() { elgg_extend_view('css/elgg', 'extended_tinymce/css'); elgg_extend_view('css/admin', 'extended_tinymce/css'); elgg_define_js('extended_tinymce', array('src' => 'mod/extended_tinymce/vendor/tinymce/js/tinymce/jquery.tinymce.min.js', 'deps' => array('jquery', 'elgg'))); elgg_extend_view('input/longtext', 'extended_tinymce/init'); elgg_extend_view('js/embed/embed', 'js/elgg/extended_tinymce/insert.js'); // extend allowed styles for tinymce editor as filtered by htmlawed elgg_register_plugin_hook_handler('allowed_styles', 'htmlawed', 'extended_tinymce_allowed_styles'); }
function xoxco_tags_init() { elgg_extend_view('css/elgg', 'xoxco_tags/css/elgg_after', 501); elgg_extend_view('css/admin', 'xoxco_tags/css/elgg_after', 501); elgg_define_js('jquery.tagsinput', array('src' => '/mod/xoxco_tags/js/lib/jquery.tagsinput.min.js')); // Include the feature only if Elgg is displaying the tags input elgg_register_plugin_hook_handler('view', 'input/tags', function () { elgg_require_js('xoxco_tags'); }); }
/** * Initialize the pages plugin. * */ function pages_init() { // register a library of helper functions elgg_register_library('elgg:pages', __DIR__ . '/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_plugin_hook_handler('entity:url', 'object', 'pages_set_url'); elgg_register_plugin_hook_handler('entity:url', 'object', 'pages_set_url'); elgg_register_plugin_hook_handler('extender:url', 'annotation', 'pages_set_revision_url'); // Register some actions $action_base = __DIR__ . '/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('elgg.css', 'pages/css'); elgg_define_js('jquery.treeview', array('src' => '/mod/pages/vendors/jquery-treeview/jquery.treeview.min.js', 'exports' => 'jQuery.fn.treeview', 'deps' => array('jquery'))); $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 for notifications elgg_register_notification_event('object', 'page'); elgg_register_notification_event('object', 'page_top'); elgg_register_plugin_hook_handler('prepare', 'notification:create:object:page', 'pages_prepare_notification'); elgg_register_plugin_hook_handler('prepare', 'notification:create:object:page_top', 'pages_prepare_notification'); // 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'); elgg_register_plugin_hook_handler('access:collections:write', 'user', 'pages_write_access_options_hook'); // 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'); // register ecml views to parse elgg_register_plugin_hook_handler('get_views', 'ecml', 'pages_ecml_views_hook'); // allow to be liked elgg_register_plugin_hook_handler('likes:is_likable', 'object:page', 'Elgg\\Values::getTrue'); elgg_register_plugin_hook_handler('likes:is_likable', 'object:page_top', 'Elgg\\Values::getTrue'); // prevent public write access elgg_register_plugin_hook_handler('view_vars', 'input/access', 'pages_write_access_vars'); }
/** * Called during system initialization * * @return void */ function file_tools_init() { // extend CSS elgg_extend_view("css/elgg", "css/file_tools/site"); $vendors = elgg_get_site_url() . "mod/file_tools/vendors/"; // register JS libraries elgg_define_js('jquery.uploadify', array('src' => '/mod/file_tools/vendors/uploadify/jquery.uploadify-3.1.min.js', 'deps' => array('jquery'))); elgg_register_simplecache_view("css/uploadify/uploadify"); elgg_register_css("jquery.uploadify", elgg_get_simplecache_url("css", "uploadify/uploadify")); elgg_register_css("jquery.tree", $vendors . "jstree/dist/themes/default/style.css"); elgg_define_js('jquery.tree', array('src' => $vendors . 'jstree/dist/jstree.min.js', 'deps' => array('jquery'))); elgg_define_js('jquery.hashchange', array('src' => '/mod/file_tools/vendors/hashchange/jquery.hashchange.js', 'exports' => 'jQuery.fn.hashchange', 'deps' => array('jquery'))); // Make settings file loadable through AMD elgg_register_simplecache_view('js/file_tools/settings.js'); // extend views elgg_extend_view("groups/edit", "file_tools/group_settings"); // register page handler for nice URL's elgg_register_page_handler("file_tools", "file_tools_page_handler"); // make our own URLs for folder icons elgg_register_plugin_hook_handler("entity:icon:url", "object", "file_tools_folder_icon_hook"); // register group option to allow management of file tree structure add_group_tool_option("file_tools_structure_management", elgg_echo("file_tools:group_tool_option:structure_management")); // register widgets // add folder widget // need to keep file_tree for the widget name to be compatible with previous filetree plugin users elgg_register_widget_type("file_tree", elgg_echo("widgets:file_tree:title"), elgg_echo("widgets:file_tree:description"), array("dashboard", "profile", "groups"), true); // group files elgg_register_widget_type("group_files", elgg_echo("file:group"), elgg_echo("widgets:group_files:description"), array("groups")); // index files elgg_register_widget_type("index_file", elgg_echo("file"), elgg_echo("widgets:index_file:description"), array("index"), true); // register events elgg_register_event_handler("create", "object", "file_tools_object_handler"); elgg_register_event_handler("update", "object", "file_tools_object_handler"); elgg_register_event_handler("delete", "object", "file_tools_object_handler_delete"); // register hooks elgg_register_plugin_hook_handler("register", "menu:entity", "file_tools_entity_menu_hook"); elgg_register_plugin_hook_handler("permissions_check:metadata", "object", "file_tools_can_edit_metadata_hook"); // elgg_register_plugin_hook_handler("access:collections:write", "all", "file_tools_write_acl_plugin_hook", 550); elgg_register_plugin_hook_handler("route", "file", "file_tools_file_route_hook"); elgg_register_plugin_hook_handler("widget_url", "widget_manager", "file_tools_widget_url_hook"); elgg_register_plugin_hook_handler("entity:url", "object", "file_tools_folder_url_handler"); elgg_register_plugin_hook_handler("register", "menu:file_tools_folder_breadcrumb", "file_tools_folder_breadcrumb_hook"); elgg_register_plugin_hook_handler("register", "menu:file_tools_folder_sidebar_tree", "file_tools_folder_sidebar_tree_hook"); // register actions elgg_register_action("file_tools/groups/save_sort", dirname(__FILE__) . "/actions/groups/save_sort.php"); elgg_register_action("file_tools/folder/edit", dirname(__FILE__) . "/actions/folder/edit.php"); elgg_register_action("file_tools/folder/delete", dirname(__FILE__) . "/actions/folder/delete.php"); elgg_register_action("file_tools/folder/reorder", dirname(__FILE__) . "/actions/folder/reorder.php"); elgg_register_action("file_tools/upload/zip", dirname(__FILE__) . "/actions/upload/zip.php"); elgg_register_action("file_tools/folder/delete", dirname(__FILE__) . "/actions/folder/delete.php"); elgg_register_action("file_tools/file/hide", dirname(__FILE__) . "/actions/file/hide.php"); elgg_register_action("file/move", dirname(__FILE__) . "/actions/file/move.php"); elgg_register_action("file/bulk_delete", dirname(__FILE__) . "/actions/file/bulk_delete.php"); }
/** * Initialize the plugin */ function elgg_tokeninput_init() { elgg_register_library('elgg.tokeninput', elgg_get_plugins_path() . 'elgg_tokeninput/lib/tokeninput.php'); elgg_define_js('jquery.tokeninput', array('src' => 'mod/elgg_tokeninput/vendors/jquery-tokeninput/build/jquery.tokeninput.min.js', 'deps' => array('jquery'))); elgg_require_js('tokeninput/init'); elgg_extend_view('css/elgg', 'css/tokeninput/stylesheet.css'); elgg_extend_view('css/admin', 'css/tokeninput/stylesheet.css'); elgg_register_plugin_hook_handler('action', 'all', 'elgg_tokeninput_explode_field_values', 1); elgg_register_page_handler(ELGG_TOKENINPUT_PAGEHANDLER, 'elgg_tokeninput_page_handler'); elgg_extend_view('theme_sandbox/forms', 'theme_sandbox/forms/elgg_tokeninput'); }
/** * Initialize the plugin * * @return void */ function init() { /** * JS/CSS */ elgg_register_css('cropper', '/mod/' . PLUGIN_ID . '/vendors/cropper/dist/cropper.min.css'); elgg_define_js('cropper', array('src' => '/mod/' . PLUGIN_ID . '/vendors/cropper/dist/cropper.min.js', 'deps' => array('jquery'))); /** * Tests */ elgg_register_plugin_hook_handler('unit_test', 'system', __NAMESPACE__ . '\\unit_test'); }
/** * Initialize the plugin * @return void */ function cropper_init() { elgg_register_plugin_hook_handler('view_vars', 'input/file', 'cropper_file_input_view_vars_hook'); elgg_extend_view('input/file', 'elements/input/file/cropper'); elgg_extend_view('css/elgg', 'input/cropper.css'); // override previously defined assets elgg_unregister_css('jquery.cropper'); elgg_register_simplecache_view('js/cropper.js'); $src = elgg_get_simplecache_url('js', 'cropper.js'); elgg_register_js('jquery.cropper', $src); elgg_define_js('cropper', ['src' => $src, 'deps' => ['jquery']]); }
/** * Initializes the captcha plugin * * @return void */ function image_captcha_init() { elgg_define_js('s3capcha', array('src' => '/mod/image_captcha/vendors/s3capcha/s3capcha.js', 'exports' => 's3capcha')); // Register a function that provides some default override actions elgg_register_plugin_hook_handler('actionlist', 'captcha', 'image_captcha_actionlist_hook'); // Register actions to intercept $actions = elgg_trigger_plugin_hook('actionlist', 'captcha', null, array()); if ($actions && is_array($actions)) { foreach ($actions as $action) { elgg_register_plugin_hook_handler("action", $action, "image_captcha_verify_action_hook"); } } }
function ckeditor_init() { elgg_extend_view('elgg.css', 'ckeditor.css'); elgg_extend_view('admin.css', 'ckeditor.css'); elgg_extend_view('elgg/wysiwyg.css', 'elements/reset.css', 100); elgg_extend_view('elgg/wysiwyg.css', 'elements/typography.css', 100); elgg_define_js('ckeditor', array('exports' => 'CKEDITOR')); elgg_define_js('jquery.ckeditor', array('deps' => array('jquery', 'ckeditor'), 'exports' => 'jQuery.fn.ckeditor')); // need to set basepath early elgg_extend_view('elgg.js', 'elgg/ckeditor/set-basepath.js'); elgg_extend_view('input/longtext', 'ckeditor/init'); elgg_extend_view('embed/embed.js', 'elgg/ckeditor/insert.js'); elgg_register_plugin_hook_handler('register', 'menu:longtext', 'ckeditor_longtext_menu'); }
/** * Initialize the plugin * @return void */ function init() { // Register actions $actions_path = dirname(__FILE__) . "/actions/db_explorer/"; elgg_register_action('db_explorer/entities', $actions_path . 'entities.php', 'admin'); elgg_register_action('db_explorer/users_entity', $actions_path . 'users_entity.php', 'admin'); elgg_register_action('db_explorer/objects_entity', $actions_path . 'objects_entity.php', 'admin'); elgg_register_action('db_explorer/groups_entity', $actions_path . 'groups_entity.php', 'admin'); elgg_register_action('db_explorer/sites_entity', $actions_path . 'sites_entity.php', 'admin'); elgg_register_action('db_explorer/owned_entities', $actions_path . 'owned_entities.php', 'admin'); elgg_register_action('db_explorer/contained_entities', $actions_path . 'contained_entities.php', 'admin'); elgg_register_action('db_explorer/river_items', $actions_path . 'river_items.php', 'admin'); elgg_register_action('db_explorer/metadata', $actions_path . 'metadata.php', 'admin'); elgg_register_action('db_explorer/metadata_ownership', $actions_path . 'metadata_ownership.php', 'admin'); elgg_register_action('db_explorer/annotations', $actions_path . 'annotations.php', 'admin'); elgg_register_action('db_explorer/annotations_ownership', $actions_path . 'annotations_ownership.php', 'admin'); elgg_register_action('db_explorer/private_settings', $actions_path . 'private_settings.php', 'admin'); elgg_register_action('db_explorer/access_collections_ownership', $actions_path . 'access_collections_ownership.php', 'admin'); elgg_register_action('db_explorer/access_collections_membership', $actions_path . 'access_collections_membership.php', 'admin'); elgg_register_action('db_explorer/entity_relationships', $actions_path . 'entity_relationships.php', 'admin'); elgg_register_action('db_explorer/batch', $actions_path . 'batch.php'); elgg_register_action('db_explorer/user/validate', $actions_path . 'user/validate.php'); elgg_register_action('db_explorer/user/ban', $actions_path . 'user/ban.php'); elgg_register_action('db_explorer/user/unban', $actions_path . 'user/unban.php'); elgg_register_action('db_explorer/user/enable', $actions_path . 'user/enable.php'); elgg_register_action('db_explorer/user/disable', $actions_path . 'user/disable.php'); elgg_register_action('db_explorer/user/delete', $actions_path . 'user/delete.php'); elgg_register_action('db_explorer/content/enable', $actions_path . 'content/enable.php'); elgg_register_action('db_explorer/content/disable', $actions_path . 'content/disable.php'); elgg_register_action('db_explorer/content/delete', $actions_path . 'content/delete.php'); // Register javascripts elgg_define_js('jqgrid', array('src' => '/mod/hypeDBExplorer/vendors/jqgrid/js/minified/jquery.jqGrid.min.js', 'deps' => array('jquery', 'jqgrid.locale'))); $locale = get_current_language(); elgg_define_js('jqgrid.locale', array('src' => "/mod/hypeDBExplorer/vendors/jqgrid/js/i18n/grid.locale-{$locale}.js", 'deps' => array('jquery'))); // Register stylesheets //elgg_register_css('jquery.jqgrid', '/mod/hypeDBExplorer/vendor/jqgrid/css/ui.jqgrid.css'); elgg_register_css('db_explorer.jquery-ui', '/mod/hypeDBExplorer/vendors/jquery-ui/themes/smoothness/jquery-ui.min.css'); elgg_register_css('db_explorer.stylesheet', elgg_get_simplecache_url('css', 'framework/db_explorer/stylesheet.css')); if (elgg_is_admin_logged_in()) { if (elgg_get_config('debug')) { // Register menu items to quickly navigate to the DB explorer for the given user/entity elgg_register_plugin_hook_handler('register', 'menu:user_hover', __NAMESPACE__ . '\\user_hover_menu_setup'); elgg_register_plugin_hook_handler('register', 'menu:entity', __NAMESPACE__ . '\\entity_menu_setup'); } // Register ajax views elgg_register_ajax_view('admin/developers/db_explorer'); // Add an admin menu item elgg_register_menu_item('page', array('name' => 'db_explorer', 'href' => 'admin/developers/db_explorer', 'text' => elgg_echo('admin:developers:db_explorer'), 'context' => 'admin', 'section' => 'develop')); } }
public function init() { elgg_register_action('dropzone/upload', $this->plugin->getPath() . 'actions/dropzone/upload.php'); /** * JS, CSS and Views */ elgg_extend_view('css/elgg', 'css/dropzone/stylesheet'); if (\hypeJunction\Integration::isElggVersionAbove('1.9.0')) { elgg_define_js('dropzone/lib', array('src' => '/mod/hypeDropzone/vendors/dropzone/dropzone-amd-module.min.js', 'deps' => array('jquery'), 'exports' => 'dropzone')); } else { elgg_register_js('dropzone.min.js', '/mod/hypeDropzone/vendors/dropzone/dropzone.min.js', 'footer'); elgg_register_simplecache_view('js/dropzone/legacy/lib'); elgg_register_js('dropzone', elgg_get_simplecache_url('js', 'dropzone/legacy/dropzone')); } }
/** * Init * @return void */ function prototyper_ui_init() { elgg_extend_view('css/elgg', 'css/framework/prototyper/ui/stylesheet'); if (\hypeJunction\Integration::isElggVersionBelow('1.9.0')) { elgg_register_simplecache_view('js/framework/legacy/prototyper_ui'); elgg_register_js('prototyper_ui', elgg_get_simplecache_url('js', 'framework/legacy/prototyper_ui'), 'footer'); elgg_register_js('jquery.cropper', '/mod/hypePrototyperUI/vendors/jquery.cropper/cropper.min.js', 'footer'); elgg_register_simplecache_view('js/framework/legacy/prototyper_cropper'); elgg_register_js('prototyper_cropper', elgg_get_simplecache_url('js', 'framework/legacy/prototyper_cropper'), 'footer'); } else { elgg_define_js('cropper', array('src' => '/mod/hypePrototyperUI/vendors/jquery.cropper/cropper.min.js', 'deps' => array('jquery'))); } elgg_register_css('jquery.cropper', '/mod/hypePrototyperUI/vendors/jquery.cropper/cropper.min.css'); elgg_extend_view('input/file', 'prototyper/ui/cropper'); }
/** * Init * @return void */ function elgg_file_viewer_init() { // Syntax highlighting elgg_register_css('prism', elgg_get_simplecache_url('prism/themes/prism.css')); elgg_extend_view('prism/themes/prism.css', 'prism/plugins/line-numbers/prism-line-numbers.css'); elgg_define_js('prism', ['src' => elgg_get_simplecache_url('prism/prism.js'), 'exports' => 'Prism']); elgg_define_js('prism-line-numbers', ['src' => elgg_get_simplecache_url('prism/plugins/line-numbers/prism-line-numbers.js'), 'deps' => ['prism']]); // Videojs elgg_register_css('videojs', elgg_get_simplecache_url('videojs/video-js.min.css')); elgg_define_js('videojs', ['src' => elgg_get_simplecache_url('videojs/video.min.js')]); elgg_register_page_handler('projekktor', 'elgg_file_viewer_projekktor_video'); elgg_register_event_handler('create', 'object', 'elgg_file_viewer_make_web_compatible'); elgg_register_event_handler('update:after', 'object', 'elgg_file_viewer_make_web_compatible'); elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'elgg_file_view_set_video_icon_url'); }
function developers_init() { elgg_register_event_handler('pagesetup', 'system', 'developers_setup_menu'); elgg_extend_view('css/admin', 'developers/css'); elgg_extend_view('css/elgg', 'developers/css'); elgg_register_page_handler('theme_sandbox', 'developers_theme_sandbox_controller'); elgg_register_external_view('developers/ajax'); // for lightbox in sandbox $sandbox_css = elgg_get_simplecache_url('css', 'theme_sandbox.css'); elgg_register_css('dev.theme_sandbox', $sandbox_css); $action_base = elgg_get_plugins_path() . 'developers/actions/developers'; elgg_register_action('developers/settings', "{$action_base}/settings.php", 'admin'); elgg_define_js('jquery.jstree', array('src' => '/mod/developers/vendors/jsTree/jquery.jstree.js', 'exports' => 'jQuery.fn.jstree', 'deps' => array('jquery'))); elgg_register_css('jquery.jstree', '/mod/developers/vendors/jsTree/themes/default/style.css'); elgg_require_js('elgg/dev'); }
/** * Initialization of plugin * * @return void */ function profile_manager_init() { // register libraries elgg_define_js('jquery.multiselect', ['src' => 'mod/profile_manager/vendors/jquery_ui_multiselect/jquery.multiselect.js', 'deps' => ['elgg', 'jquery']]); // Extend CSS elgg_extend_view('css/admin', 'css/profile_manager/global.css'); elgg_extend_view('css/admin', 'css/profile_manager/admin.css'); elgg_extend_view('css/admin', 'css/profile_manager/multiselect.css'); elgg_extend_view('css/elgg', 'css/profile_manager/multiselect.css'); elgg_extend_view('css/elgg', 'css/profile_manager/global.css'); elgg_extend_view('css/elgg', 'css/profile_manager/site.css'); // 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'), ['profile', 'dashboard']); } elgg_register_widget_type('register', elgg_echo('widgets:register:title'), elgg_echo('widgets:register:description'), ['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'); // extend public pages elgg_register_plugin_hook_handler('public_pages', 'walled_garden', '\\ColdTrick\\ProfileManager\\Sites::publicPages'); // 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', '\\ColdTrick\\ProfileManager\\Users::usernameChange'); elgg_register_plugin_hook_handler('view_vars', 'input/form', '\\ColdTrick\\ProfileManager\\Users::registerViewVars'); // menu hooks elgg_register_plugin_hook_handler('register', 'menu:page', '\\ColdTrick\\ProfileManager\\Menus::registerAdmin'); // site join event handler elgg_register_event_handler('create', 'relationship', '\\ColdTrick\\ProfileManager\\Sites::createMember'); elgg_register_event_handler('delete', 'relationship', '\\ColdTrick\\ProfileManager\\Sites::deleteMember'); // 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'); }
/** * Called during system init * * @return void */ function poll_init() { // register js if (file_exists(dirname(__FILE__) . '/vendor/npm-asset/chart.js/dist/Chart.min.js')) { elgg_define_js('chartjs', ['src' => '/mod/poll/vendor/npm-asset/chart.js/dist/Chart.min.js']); } else { elgg_define_js('chartjs', ['src' => '/vendor/npm-asset/chart.js/dist/Chart.min.js']); } // css elgg_extend_view('css/elgg', 'css/poll/site.css'); // register page handler elgg_register_page_handler('poll', ['\\ColdTrick\\Poll\\PageHandlers', 'pollHandler']); // searchable elgg_register_entity_type('object', Poll::SUBTYPE); // group tool option if (poll_is_enabled_for_group()) { add_group_tool_option('poll', elgg_echo('poll:group_tool:title'), false); elgg_extend_view('groups/tool_latest', 'poll/group_module'); elgg_extend_view('groups/edit', 'poll/group_settings'); } // widgets elgg_register_widget_type('recent_polls', elgg_echo('poll:widgets:recent_polls:title'), elgg_echo('poll:widgets:recent_polls:description'), ['index', 'profile', 'dashboard', 'groups']); elgg_register_widget_type('single_poll', elgg_echo('poll:widgets:single_poll:title'), elgg_echo('poll:widgets:single_poll:description'), ['index', 'profile', 'groups'], true); elgg_register_plugin_hook_handler('entity:url', 'object', ['\\ColdTrick\\Poll\\Widgets', 'widgetUrls']); elgg_register_plugin_hook_handler('group_tool_widgets', 'widget_manager', ['\\ColdTrick\\Poll\\Widgets', 'groupToolWidgets']); // notifications elgg_register_notification_event('object', Poll::SUBTYPE, ['create']); elgg_register_plugin_hook_handler('prepare', 'notification:create:object:' . Poll::SUBTYPE, ['\\ColdTrick\\Poll\\Notifications', 'createPoll']); elgg_register_plugin_hook_handler('entity_types', 'content_subscriptions', '\\ColdTrick\\Poll\\ContentSubscriptions::registerEntityType'); elgg_register_plugin_hook_handler('cron', 'daily', '\\ColdTrick\\Poll\\Notifications::closeCron'); // plugin hooks elgg_register_plugin_hook_handler('register', 'menu:site', ['\\ColdTrick\\Poll\\MenuHandler', 'siteMenu']); elgg_register_plugin_hook_handler('register', 'menu:owner_block', ['\\ColdTrick\\Poll\\MenuHandler', 'userOwnerBlock']); elgg_register_plugin_hook_handler('register', 'menu:owner_block', ['\\ColdTrick\\Poll\\MenuHandler', 'groupOwnerBlock']); elgg_register_plugin_hook_handler('register', 'menu:poll_tabs', ['\\ColdTrick\\Poll\\MenuHandler', 'pollTabs']); elgg_register_plugin_hook_handler('container_permissions_check', 'all', ['\\ColdTrick\\Poll\\Permissions', 'canWriteContainer']); elgg_register_plugin_hook_handler('likes:is_likable', 'object:' . \Poll::SUBTYPE, '\\Elgg\\Values::getTrue'); elgg_register_plugin_hook_handler('supported_types', 'entity_tools', '\\ColdTrick\\Poll\\MigratePoll::supportedSubtypes'); // register actions elgg_register_action('poll/edit', dirname(__FILE__) . '/actions/poll/edit.php'); elgg_register_action('poll/delete', dirname(__FILE__) . '/actions/poll/delete.php'); elgg_register_action('poll/vote', dirname(__FILE__) . '/actions/answer/vote.php'); elgg_register_action('poll/group_settings', dirname(__FILE__) . '/actions/group_settings.php'); }
/** * This function is called during the "init" event * * @return void */ function tag_tools_init() { elgg_register_event_handler("pagesetup", "system", "tag_tools_pagesetup"); // register js/ss lib elgg_define_js("jquery.tag-it", array("src" => "mod/tag_tools/vendors/jquery/tag_it/js/tag-it.min.js")); elgg_extend_view("css/elgg", "css/tag_tools/jquery.tagit.css"); elgg_extend_view("css/elgg", "css/tag_tools/follow"); elgg_extend_view("js/elgg", "js/tag_tools/follow"); // extend views elgg_extend_view("input/tags", "tag_tools/extend_tags"); // register events elgg_register_event_handler("create", "metadata", "tag_tools_create_metadata_event_handler"); // plugin hooks elgg_register_plugin_hook_handler("route", "tags", "tag_tools_route_tags_hook"); elgg_register_plugin_hook_handler("route", "activity", "tag_tools_route_activity_hook"); elgg_register_plugin_hook_handler("route", "notifications", "tag_tools_route_notifications_hook"); elgg_register_plugin_hook_handler("register", "menu:filter", "tag_tools_activity_filter_menu_hook_handler"); // widgets elgg_register_widget_type("follow_tags", elgg_echo("tag_tools:widgets:follow_tags:title"), elgg_echo("tag_tools:widgets:follow_tags:description"), array("profile", "dashboard")); // actions elgg_register_action("tag_tools/follow_tag", dirname(__FILE__) . "/actions/follow_tag.php"); elgg_register_action("tag_tools/notifications/edit", dirname(__FILE__) . "/actions/notifications/edit.php"); }
/** * Initializes the plugin * * @return void */ function search_advanced_init() { // page handler for search actions and results elgg_register_page_handler('search_advanced', 'search_advanced_page_handler'); elgg_register_page_handler('search', 'search_advanced_search_page_handler'); search_advanced_prepare_search_hooks(); // unregister object:page_top from search elgg_unregister_entity_type('object', 'page_top'); elgg_register_plugin_hook_handler('search', 'object:page', 'search_advanced_search_page'); // views elgg_extend_view('css/elgg', 'css/search_advanced/site'); elgg_extend_view('js/elgg', 'js/search_advanced/site.js'); elgg_define_js('browserstate-history', ['src' => '/mod/search_advanced/vendors/browserstate-history.js/jquery.history.js', 'exports' => 'History']); elgg_extend_view('page/elements/foot', 'search_advanced/foot', 400); // widgets elgg_register_widget_type('search', elgg_echo('search'), elgg_echo('search'), ['profile', 'dashboard', 'index', 'groups'], true); elgg_register_widget_type('search_user', elgg_echo('search_advanced:widgets:search_user:title'), elgg_echo('search_advanced:widgets:search_user:description'), ['dashboard', 'index']); // register hooks elgg_register_plugin_hook_handler('register', 'menu:search_type_selection', 'search_advanced_register_menu_type_selection'); elgg_register_plugin_hook_handler('register', 'menu:search_list', 'search_advanced_register_menu_list'); // actions elgg_register_action('search_advanced/settings/save', dirname(__FILE__) . '/actions/plugins/settings/save.php', 'admin'); }
/** * This function is called during the 'init' event * * @return void */ function tag_tools_init() { // register js/ss lib elgg_define_js('jquery.tag-it', ['src' => 'mod/tag_tools/vendors/jquery/tag_it/js/tag-it.min.js']); elgg_extend_view('css/elgg', 'css/tag_tools/jquery.tagit.css'); elgg_extend_view('css/elgg', 'css/tag_tools/follow.css'); elgg_extend_view('js/elgg', 'js/tag_tools/follow.js'); // extend views elgg_extend_view('input/tags', 'tag_tools/extend_tags'); elgg_extend_view('output/tag', 'tag_tools/output/tag'); // register events elgg_register_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Enqueue::createMetadata'); elgg_register_event_handler('update:after', 'all', '\\ColdTrick\\TagTools\\Enqueue::afterEntityUpdate'); elgg_register_event_handler('upgrade', 'system', '\\ColdTrick\\TagTools\\Upgrade::markOldTagsAsSent'); // plugin hooks elgg_register_plugin_hook_handler('route', 'tags', '\\ColdTrick\\TagTools\\Router::tags'); elgg_register_plugin_hook_handler('route', 'activity', '\\ColdTrick\\TagTools\\Router::activity'); elgg_register_plugin_hook_handler('route', 'notifications', '\\ColdTrick\\TagTools\\Router::notifications'); elgg_register_plugin_hook_handler('register', 'menu:filter', '\\ColdTrick\\TagTools\\MenuItems::registerActivityTab'); elgg_register_plugin_hook_handler('register', 'menu:page', '\\ColdTrick\\TagTools\\MenuItems::registerSettingsMenuItem'); elgg_register_plugin_hook_handler('register', 'menu:follow_tag', '\\ColdTrick\\TagTools\\MenuItems::registerFollowTag'); // notifications elgg_register_notification_event('relationship', 'tag_tools:notification'); elgg_register_plugin_hook_handler('get', 'subscriptions', '\\ColdTrick\\TagTools\\Notifications::getSubscribers', 9999); elgg_register_plugin_hook_handler('prepare', 'notification:create:relationship:tag_tools:notification', '\\ColdTrick\\TagTools\\Notifications::prepareMessage'); elgg_register_plugin_hook_handler('send:after', 'notifications', '\\ColdTrick\\TagTools\\Notifications::afterCleanup'); elgg_register_plugin_hook_handler('relationship:url', 'relationship', '\\ColdTrick\\TagTools\\Notifications::getNotificationURL'); // widgets elgg_register_widget_type('follow_tags', elgg_echo('tag_tools:widgets:follow_tags:title'), elgg_echo('tag_tools:widgets:follow_tags:description'), ['profile', 'dashboard']); if (elgg_is_active_plugin('tagcloud')) { elgg_register_widget_type('tagcloud', elgg_echo('tagcloud'), elgg_echo('tag_tools:widgets:tagcloud:description'), ['profile', 'dashboard', 'index', 'groups'], false); } // actions elgg_register_action('tag_tools/follow_tag', dirname(__FILE__) . '/actions/follow_tag.php'); elgg_register_action('tag_tools/notifications/edit', dirname(__FILE__) . '/actions/notifications/edit.php'); elgg_register_action('tag_tools/upgrades/set_tag_notifications_sent', dirname(__FILE__) . '/actions/upgrades/set_tag_notifications_sent.php', 'admin'); }
function elgg_stars_init() { // Register valid annotaiton names $criteria = elgg_get_plugin_setting('criteria', 'elgg_stars'); if (!$criteria) { elgg_stars_register_rating_annotation_name('starrating'); } else { $criteria = string_to_tag_array($criteria); foreach ($criteria as $criterion) { elgg_stars_register_rating_annotation_name($criterion); } } $root = dirname(__FILE__); // Register actions elgg_register_action('elgg_stars/settings/save', "{$root}/actions/settings/elgg_stars.php", 'admin'); elgg_register_action('stars/rate', "{$root}/actions/stars/rate.php"); elgg_register_action('stars/delete', "{$root}/actions/stars/delete.php"); // Stars JS and CSS elgg_extend_view('css/elgg', 'stars/css'); elgg_define_js('jquery.rateit', array('src' => '/mod/elgg_stars/vendors/rateit/jquery.rateit.min.js', 'deps' => array('jquery'))); elgg_require_js('stars/init'); // Setup menus elgg_register_plugin_hook_handler('register', 'menu:entity', 'elgg_stars_menu_setup'); elgg_register_plugin_hook_handler('register', 'menu:annotation', 'elgg_stars_annotation_menu_setup'); // Permissions elgg_register_plugin_hook_handler('permissions_check:annotate', 'all', 'elgg_stars_can_annotate'); // Add an annotation view for registered ratings elgg_register_plugin_hook_handler('view', 'annotation/default', 'elgg_stars_annotation_view_replacement'); // Extend the sidebar with the ratings module elgg_register_plugin_hook_handler('view', 'page/elements/comments', 'elgg_stars_comments_rating_addon', 900); elgg_register_plugin_hook_handler('comments', 'all', 'elgg_stars_comments_rating_addon', 900); // Get rating criteria that applies to an entity elgg_register_plugin_hook_handler('criteria', 'stars', 'elgg_stars_rating_criteria_hook'); // Setup widgets elgg_register_widget_type('highestrating', elgg_echo('stars:widget:highestrating'), elgg_echo('stars:widget:highestrating:desc'), array('all'), false); }