Пример #1
0
function modules_init()
{
    // Register and load library
    elgg_register_library('ajaxmodule', elgg_get_plugins_path() . 'modules/lib/ajaxmodule.php');
    elgg_load_library('ajaxmodule');
    // Ajax module page handler
    elgg_register_page_handler('ajaxmodule', 'ajaxmodule_page_handler');
    // Register view hook handler
    elgg_register_plugin_hook_handler('view', 'all', 'ajaxmodule_view_hook_handler');
    // Register icon handlers
    elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'simpleicon_hook_handler', 600);
    // Register JS
    $ajaxmodule_js = elgg_get_simplecache_url('js', 'modules/ajaxmodule');
    elgg_register_simplecache_view('js/modules/ajaxmodule');
    elgg_register_js('elgg.modules.ajaxmodule', $ajaxmodule_js);
    // Register JS
    $genericmodule_js = elgg_get_simplecache_url('js', 'modules/genericmodule');
    elgg_register_simplecache_view('js/modules/genericmodule');
    elgg_register_js('elgg.modules.genericmodule', $genericmodule_js);
    // Register CSS
    $m_css = elgg_get_simplecache_url('css', 'modules/css');
    elgg_register_simplecache_view('css/modules/css');
    elgg_register_css('elgg.modules', $m_css);
    // Load JS/CSS
    elgg_load_js('elgg.modules.ajaxmodule');
    elgg_load_js('elgg.modules.genericmodule');
    elgg_load_css('lightbox');
    elgg_load_js('lightbox');
    elgg_load_css('elgg.modules');
}
Пример #2
0
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'));
}
Пример #3
0
function elgg_file_viewer_init()
{
    // Registering a new viewtype for output buffer
    elgg_register_viewtype('ob');
    elgg_register_viewtype_fallback('ob');
    // Exposing a function for remote access to non-public files
    expose_function('efv.download', 'elgg_file_viewer_download', array('guid' => array('type' => 'int', 'required' => true)), 'Access a non-public file from a remote location', 'GET', false, true);
    // Projekktor for Video/Audio support
    elgg_register_js('projekktor', '/mod/elgg_file_viewer/vendors/projekktor-1.2.38r332/projekktor-1.2.38r332.min.js');
    elgg_register_simplecache_view('js/elgg_file_viewer/projekktor');
    elgg_register_js('elgg.projekktor', elgg_get_simplecache_url('js', 'elgg_file_viewer/projekktor'), 'footer');
    elgg_register_css('projekktor', '/mod/elgg_file_viewer/vendors/projekktor-1.2.38r332/theme/maccaco/projekktor.style.css');
    // Syntax highlighter / text support
    elgg_register_js('syntaxhighlighter', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shCore.js', 'footer');
    elgg_register_js('syntaxhighlighter.css', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushCss.js', 'footer');
    elgg_register_js('syntaxhighlighter.xml', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushXml.js', 'footer');
    elgg_register_js('syntaxhighlighter.plain', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushPlain.js', 'footer');
    elgg_register_js('syntaxhighlighter.js', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushJScript.js', 'footer');
    elgg_register_js('syntaxhighlighter.php', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushPhp.js', 'footer');
    elgg_register_simplecache_view('js/elgg_file_viewer/syntaxhighlighter');
    elgg_register_js('elgg.syntaxhighlighter', elgg_get_simplecache_url('js', 'elgg_file_viewer/syntaxhighlighter'), 'footer');
    elgg_register_css('syntaxhighlighter.core', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/styles/shCore.css');
    elgg_register_css('syntaxhighlighter.theme', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/styles/shThemeDefault.css');
    // FFmpeg class
    elgg_register_class('FFmpeg', elgg_get_plugins_path() . 'elgg_file_viewer/vendors/ffmpeg/src/ffmpeg.class.php');
    elgg_register_page_handler('projekktor', 'elgg_file_viewer_projekktor_video');
}
Пример #4
0
/**
* 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();
}
Пример #5
0
function uservalidationbyadmin_init()
{
    require_once dirname(__FILE__) . '/lib/functions.php';
    // Register page handler to validate users
    // This doesn't need to be an action because security is handled by the validation codes.
    elgg_register_page_handler('uservalidationbyadmin', 'uservalidationbyadmin_page_handler');
    // mark users as unvalidated and disable when they register
    elgg_register_plugin_hook_handler('register', 'user', 'uservalidationbyadmin_disable_new_user');
    // canEdit override to allow not logged in code to disable a user
    elgg_register_plugin_hook_handler('permissions_check', 'user', 'uservalidationbyadmin_allow_new_user_can_edit');
    // prevent users from logging in if they aren't validated
    register_pam_handler('uservalidationbyadmin_check_auth_attempt', "required");
    // when requesting a new password
    elgg_register_plugin_hook_handler('action', 'user/requestnewpassword', 'uservalidationbyadmin_check_request_password');
    // prevent the engine from logging in users via login()
    elgg_register_event_handler('login', 'user', 'uservalidationbyadmin_check_manual_login');
    // make admin users always validated
    elgg_register_event_handler('make_admin', 'user', 'uservalidationbyadmin_validate_new_admin_user');
    // register Walled Garden public pages
    elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'uservalidationbyadmin_public_pages');
    // admin interface to manually validate users
    elgg_register_admin_menu_item('administer', 'unvalidated', 'users');
    elgg_extend_view('css/admin', 'uservalidationbyadmin/css');
    elgg_register_simplecache_view('js/elgg/uservalidationbyadmin');
    elgg_register_js('elgg.uservalidationbyadmin', elgg_get_simplecache_url('js', 'elgg/uservalidationbyadmin'), 'footer');
    $action_path = dirname(__FILE__) . '/actions/uservalidationbyadmin';
    elgg_register_action('uservalidationbyadmin/spam', "{$action_path}/spam.php", 'admin');
    elgg_register_action('uservalidationbyadmin/validate', "{$action_path}/validate.php", 'admin');
    elgg_register_action('uservalidationbyadmin/delete', "{$action_path}/delete.php", 'admin');
    elgg_register_action('uservalidationbyadmin/bulk_action', "{$action_path}/bulk_action.php", 'admin');
}
Пример #6
0
/**
 * The Wire initialization
 */
function thewire_init()
{
    // register the wire's JavaScript
    $thewire_js = elgg_get_simplecache_url('thewire.js');
    elgg_register_js('elgg.thewire', $thewire_js, 'footer');
    elgg_register_ajax_view('thewire/previous');
    // add a site navigation item
    $item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'thewire/all');
    elgg_register_menu_item('site', $item);
    // owner block menu
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'thewire_owner_block_menu');
    // remove edit and access and add thread, reply, view previous
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'thewire_setup_entity_menu_items');
    // Extend system CSS with our own styles, which are defined in the thewire/css view
    elgg_extend_view('elgg.css', 'thewire/css');
    // Add a user's latest wire post to profile
    elgg_extend_view('profile/status', 'thewire/profile_status');
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('thewire', 'thewire_page_handler');
    // Register a URL handler for thewire posts
    elgg_register_plugin_hook_handler('entity:url', 'object', 'thewire_set_url');
    // Register for search
    elgg_register_entity_type('object', 'thewire');
    // Register for notifications
    elgg_register_notification_event('object', 'thewire');
    elgg_register_plugin_hook_handler('prepare', 'notification:create:object:thewire', 'thewire_prepare_notification');
    elgg_register_plugin_hook_handler('get', 'subscriptions', 'thewire_add_original_poster');
    // allow to be liked
    elgg_register_plugin_hook_handler('likes:is_likable', 'object:thewire', 'Elgg\\Values::getTrue');
    elgg_register_plugin_hook_handler('unit_test', 'system', 'thewire_test');
}
Пример #7
0
/**
 * The Wire initialization
 */
function thewire_init()
{
    // register the wire's JavaScript
    $thewire_js = elgg_get_simplecache_url('js', 'thewire');
    elgg_register_js('elgg.thewire', $thewire_js, 'footer');
    elgg_register_ajax_view('thewire/previous');
    // add a site navigation item
    $item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'thewire/all');
    elgg_register_menu_item('site', $item);
    // owner block menu
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'thewire_owner_block_menu');
    // remove edit and access and add thread, reply, view previous
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'thewire_setup_entity_menu_items');
    // Extend system CSS with our own styles, which are defined in the thewire/css view
    elgg_extend_view('css/elgg', 'thewire/css');
    // Add a user's latest wire post to profile
    elgg_extend_view('profile/status', 'thewire/profile_status');
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('thewire', 'thewire_page_handler');
    // Register a URL handler for thewire posts
    elgg_register_plugin_hook_handler('entity:url', 'object', 'thewire_set_url');
    elgg_register_widget_type('thewire', elgg_echo('thewire'), elgg_echo("thewire:widget:desc"));
    // Register for search
    elgg_register_entity_type('object', 'thewire');
    // Register for notifications
    elgg_register_notification_event('object', 'thewire');
    elgg_register_plugin_hook_handler('prepare', 'notification:create:object:thewire', 'thewire_prepare_notification');
    elgg_register_plugin_hook_handler('get', 'subscriptions', 'thewire_add_original_poster');
    // Register actions
    $action_base = elgg_get_plugins_path() . 'thewire/actions';
    elgg_register_action("thewire/add", "{$action_base}/add.php");
    elgg_register_action("thewire/delete", "{$action_base}/delete.php");
    elgg_register_plugin_hook_handler('unit_test', 'system', 'thewire_test');
    elgg_register_event_handler('upgrade', 'system', 'thewire_run_upgrades');
}
Пример #8
0
/**
 * initialization of plugin
 *
 * @return void
 */
function advanced_statistics_init()
{
    // register page handler for nice URLs
    elgg_register_page_handler("advanced_statistics", "advanced_statistics_page_handler");
    if (elgg_is_admin_logged_in()) {
        elgg_register_admin_menu_item('administer', 'users', 'advanced_statistics');
        elgg_register_admin_menu_item('administer', 'groups', 'advanced_statistics');
        elgg_register_admin_menu_item('administer', 'content', 'advanced_statistics');
        elgg_register_admin_menu_item('administer', 'activity', 'advanced_statistics');
        elgg_register_admin_menu_item('administer', 'widgets', 'advanced_statistics');
        elgg_register_admin_menu_item('administer', 'system', 'advanced_statistics');
        elgg_extend_view("js/admin", "js/advanced_statistics/admin");
        $vendors = elgg_get_site_url() . "mod/advanced_statistics/vendors/";
        elgg_register_js("excanvas", $vendors . "jqplot/excanvas.min.js");
        // only for IE < 9
        // jqplot base library
        elgg_register_js("jquery.jqplot", $vendors . "jqplot/jquery.jqplot.js");
        // jqplot plugins
        elgg_register_js("jquery.jqplot.barRenderer", $vendors . "jqplot/plugins/jqplot.barRenderer.js");
        elgg_register_js("jquery.jqplot.pieRenderer", $vendors . "jqplot/plugins/jqplot.pieRenderer.js");
        elgg_register_js("jquery.jqplot.canvasAxisTickRenderer", $vendors . "jqplot/plugins/jqplot.canvasAxisTickRenderer.js");
        elgg_register_js("jquery.jqplot.canvasTextRenderer", $vendors . "jqplot/plugins/jqplot.canvasTextRenderer.js");
        elgg_register_js("jquery.jqplot.categoryAxisRenderer", $vendors . "jqplot/plugins/jqplot.categoryAxisRenderer.js");
        elgg_register_js("jquery.jqplot.dateAxisRenderer", $vendors . "jqplot/plugins/jqplot.dateAxisRenderer.js");
        elgg_register_js("jquery.jqplot.pointLabels", $vendors . "jqplot/plugins/jqplot.pointLabels.js");
        elgg_register_js("jquery.jqplot.highlighter", $vendors . "jqplot/plugins/jqplot.highlighter.js");
        elgg_register_simplecache_view("css/advanced_statistics/jqplot");
        elgg_register_css("jquery.jqplot", elgg_get_simplecache_url("css", "advanced_statistics/jqplot"));
        // register admin widgets
        elgg_register_widget_type("advanced_statistics", elgg_echo("advanced_statistics:widgets:advanced_statistics:title"), elgg_echo("advanced_statistics:widgets:advanced_statistics:description"), array("admin"), true);
        elgg_register_widget_type("online_user_count", elgg_echo("advanced_statistics:widgets:online_user_count:title"), elgg_echo("advanced_statistics:widgets:online_user_count:description"), array("admin"));
        elgg_register_ajax_view("widgets/online_user_count/content");
    }
}
Пример #9
0
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');
}
Пример #10
0
 public function __construct($page)
 {
     admin_gatekeeper();
     global $CONFIG;
     $cshop = new stdClass();
     $this->controller = GLOBAL_IZAP_CURRENT_CONTROLLER;
     $this->action = 'action' . ucfirst($page[0]);
     $this->_page = $page;
     $this->url_vars = $this->_page;
     $this->page_layout = $this->page_shell = 'admin';
     $cshop->view = $this->_view = 'admin/' . implode('/', $page);
     $this->page_elements['title'] = elgg_echo("admin:{$page[0]}");
     if (count($page) > 1) {
         $this->page_elements['title'] .= ' : ' . elgg_echo('admin:' . implode(':', $page));
     }
     if (method_exists($this, $this->action)) {
         elgg_admin_add_plugin_settings_menu();
         elgg_set_context('admin');
         elgg_unregister_css('elgg');
         $url = elgg_get_simplecache_url('js', 'admin');
         elgg_register_js('elgg.admin', $url);
         elgg_load_js('elgg.admin');
         elgg_register_js('jquery.jeditable', 'vendors/jquery/jquery.jeditable.mini.js');
         elgg_load_js('jquery.jeditable');
     }
     $CONFIG->cshop = $cshop;
 }
/**
 * 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');
}
Пример #12
0
Файл: Plugin.php Проект: n8b/VMN
 /**
  * System init callback
  * @return void
  */
 public function init()
 {
     hypeInbox()->config->registerLabels();
     elgg_register_menu_item('page', array('name' => 'message_types', 'text' => elgg_echo('admin:inbox:message_types'), 'href' => 'admin/inbox/message_types', 'priority' => 500, 'contexts' => array('admin'), 'section' => 'configure'));
     elgg_register_css('inbox.base.css', elgg_get_simplecache_url('css', 'framework/inbox/stylesheet.css'));
     elgg_unregister_page_handler('messages', 'messages_page_handler');
     elgg_register_page_handler($this->config->pagehandler_id, array($this->router, 'handlePages'));
     $action_path = $this->plugin->getPath() . '/actions/';
     elgg_register_action("hypeInbox/settings/save", $action_path . 'settings/save.php', 'admin');
     elgg_register_action('inbox/admin/import', $action_path . 'admin/import.php', 'admin');
     elgg_register_action('messages/send', $action_path . 'messages/send.php');
     elgg_register_action('messages/delete', $action_path . 'messages/delete.php');
     elgg_register_action('messages/markread', $action_path . 'messages/markread.php');
     elgg_register_action('messages/markunread', $action_path . 'messages/markunread.php');
     // Third party integrations
     elgg_register_plugin_hook_handler('config:user_types', 'framework:inbox', array($this->hooks, 'filterUserTypes'));
     // Menu
     elgg_register_plugin_hook_handler('register', 'menu:page', array($this->hooks, 'setupPageMenu'));
     elgg_register_plugin_hook_handler('register', 'menu:inbox', array($this->hooks, 'setupInboxMenu'));
     elgg_register_plugin_hook_handler('register', 'menu:inbox:thread', array($this->hooks, 'setupInboxThreadMenu'));
     elgg_register_plugin_hook_handler('register', 'menu:entity', array($this->hooks, 'setupMessageMenu'));
     // Replace user hover menu items
     elgg_unregister_plugin_hook_handler('register', 'menu:user_hover', 'messages_user_hover_menu');
     elgg_register_plugin_hook_handler('register', 'menu:user_hover', array($this->hooks, 'setupUserHoverMenu'));
     // URLs
     elgg_register_plugin_hook_handler('entity:url', 'object', array($this->hooks, 'handleMessageURL'));
     elgg_register_plugin_hook_handler('entity:icon:url', 'object', array($this->hooks, 'handleMessageIconURL'));
 }
Пример #13
0
function zhsocial_init()
{
    elgg_register_simplecache_view("js/zhsocial/login");
    $login_js = elgg_get_simplecache_url("js", "zhsocial/login");
    elgg_register_js("zhsocial.login", $login_js);
    elgg_extend_view('forms/login', 'zhsocial/login', 501);
}
Пример #14
0
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");
}
Пример #15
0
function polls_init()
{
    elgg_register_library('elgg:polls', elgg_get_plugins_path() . 'polls/models/model.php');
    // Set up menu for logged in users
    if (elgg_is_logged_in()) {
        $item = new ElggMenuItem('polls', elgg_echo('polls'), 'polls/owner/' . elgg_get_logged_in_user_entity()->username);
    } else {
        $item = new ElggMenuItem('polls', elgg_echo('poll'), 'polls/all');
    }
    elgg_register_menu_item('site', $item);
    // Extend system CSS with our own styles, which are defined in the polls/css view
    elgg_extend_view('css/elgg', 'polls/css');
    // Extend hover-over menu
    elgg_extend_view('profile/menu/links', 'polls/menu');
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('polls', 'polls_page_handler');
    // Register a URL handler for poll posts
    elgg_register_entity_url_handler('object', 'poll', 'polls_url');
    // notifications
    $elgg_version = explode('.', get_version(true));
    if ($elgg_version[1] > 8) {
        $send_notification = elgg_get_plugin_setting('send_notification', 'polls');
        if (!$send_notification || $send_notification != 'no') {
            elgg_register_notification_event('object', 'poll');
            elgg_register_plugin_hook_handler('prepare', 'notification:create:object:poll', 'polls_prepare_notification');
        }
    }
    // add link to owner block
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'polls_owner_block_menu');
    elgg_register_plugin_hook_handler('widget_url', 'widget_manager', 'polls_widget_url_handler');
    // Register entity type
    elgg_register_entity_type('object', 'poll');
    // register the JavaScript
    $js = elgg_get_simplecache_url('js', 'polls/js');
    elgg_register_simplecache_view('js/polls/js');
    elgg_register_js('elgg.polls', $js);
    // add group widget
    $group_polls = elgg_get_plugin_setting('group_polls', 'polls');
    if (!$group_polls || $group_polls != 'no') {
        elgg_extend_view('groups/tool_latest', 'polls/group_module');
    }
    if (!$group_polls || $group_polls == 'yes_default') {
        add_group_tool_option('polls', elgg_echo('polls:enable_polls'), TRUE);
    } else {
        if ($group_polls == 'yes_not_default') {
            add_group_tool_option('polls', elgg_echo('polls:enable_polls'), FALSE);
        }
    }
    //add widgets
    elgg_register_widget_type('poll', elgg_echo('polls:my_widget_title'), elgg_echo('polls:my_widget_description'), "profile,groups");
    elgg_register_widget_type('latestPolls', elgg_echo('polls:latest_widget_title'), elgg_echo('polls:latest_widget_description'), "index,profile,dashboard,groups");
    elgg_register_widget_type('poll_individual', elgg_echo('polls:individual'), elgg_echo('poll_individual_group:widget:description'), "index,profile,dashboard,groups");
    // Register actions
    $action_path = elgg_get_plugins_path() . 'polls/actions/polls';
    elgg_register_action("polls/add", "{$action_path}/add.php");
    elgg_register_action("polls/edit", "{$action_path}/edit.php");
    elgg_register_action("polls/delete", "{$action_path}/delete.php");
    elgg_register_action("polls/vote", "{$action_path}/vote.php");
}
Пример #16
0
function simplekaltura_init()
{
    $plugin_root = dirname(__FILE__);
    elgg_register_library('simplekaltura', "{$plugin_root}/lib/simplekaltura_lib.php");
    elgg_register_library('KalturaClient', "{$plugin_root}/vendors/kaltura_client/KalturaClient.php");
    elgg_load_library('simplekaltura');
    // helper libs
    $libs = array('swfobject', 'html5', 'utility', 'thumbs');
    foreach ($libs as $lib) {
        $url = elgg_get_simplecache_url('js', "simplekaltura/{$lib}");
        elgg_register_js("simplekaltura:{$lib}", $url);
    }
    // Register SKUploader
    elgg_register_external_view('js/simplekaltura/SKUploader.js', TRUE);
    // Include html5 js library
    elgg_load_js('simplekaltura:html5');
    elgg_load_js('simplekaltura:utility');
    elgg_extend_view('css/elgg', 'simplekaltura/css');
    // If plugin is properly configured
    if (simplekaltura_is_configured()) {
        // Add to main menu
        $item = new ElggMenuItem('simplekaltura', elgg_get_plugin_setting('kaltura_entity_title', 'simplekaltura'), 'videos');
        elgg_register_menu_item('site', $item);
        // Register page handler
        elgg_register_page_handler('videos', 'simplekaltura_page_handler');
    } else {
        elgg_add_admin_notice('simpkaltura_not_configured', elgg_echo('simplekaltura:error:pluginnotconfigured'));
    }
    // add the group pages tool option
    add_group_tool_option('simplekaltura', elgg_echo('groups:enablesimplekaltura'), TRUE);
    // Profile block hook
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'simplekaltura_owner_block_menu');
    // Modify entity menu for addional video items
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'simplekaltura_setup_entity_menu');
    // notifications
    elgg_register_notification_event('object', 'simplekaltura_video', array('create'));
    elgg_register_plugin_hook_handler('prepare', 'notification:publish:object:simplekaltura_video', 'simplekaltura_prepare_notification');
    // actions
    $actions_root = "{$plugin_root}/actions/simplekaltura";
    elgg_register_action('simplekaltura/save', "{$actions_root}/save.php");
    elgg_register_action('simplekaltura/update', "{$actions_root}/update.php");
    elgg_register_action('simplekaltura/get_embed', "{$actions_root}/get_embed.php");
    elgg_register_action('simplekaltura/featured', "{$actions_root}/featured.php", 'admin');
    elgg_register_action('videos/delete', "{$actions_root}/delete.php");
    elgg_register_action('simplekaltura/migrate', "{$actions_root}/migrate.php", 'admin');
    // entity url and icon handlers
    elgg_register_plugin_hook_handler('entity:url', 'object', 'simplekaltura_url_handler');
    elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'simplekaltura_icon_url_override');
    // Register type
    elgg_register_entity_type('object', 'simplekaltura_video');
    // register CRON hook to poll video plays/duration/etc..
    elgg_register_plugin_hook_handler('cron', 'fifteenmin', 'simplekaltura_bulk_update');
    // Most Played Sidebar
    elgg_extend_view('simplekaltura/sidebar', 'simplekaltura/featured');
    elgg_extend_view('simplekaltura/sidebar', 'simplekaltura/most_played');
    // Whitelist ajax views
    elgg_register_ajax_view('simplekaltura/popup');
    return TRUE;
}
Пример #17
0
/**
 * 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'));
}
Пример #18
0
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);
}
Пример #19
0
function hj_alive_search_init()
{
    $plugin = 'hypeAlive';
    $shortcuts = hj_path_shortcuts($plugin);
    elgg_register_action('livesearch/parse', $shortcuts['actions'] . 'hj/livesearch/parse.php', 'public');
    elgg_extend_view('css/elements/modules', 'css/hj/livesearch/base');
    $js = elgg_get_simplecache_url('js', 'hj/livesearch/autocomplete');
    elgg_register_js('hj.livesearch.autocomplete', $js, 'footer');
}
Пример #20
0
function file_tools_init()
{
    // extend CSS
    elgg_extend_view("css/elgg", "file_tools/css/site");
    if (file_tools_use_folder_structure()) {
        elgg_extend_view("groups/edit", "file_tools/group_settings");
    }
    // extend js
    elgg_extend_view("js/elgg", "file_tools/js/site");
    // register JS libraries
    $vendors = elgg_get_site_url() . "mod/file_tools/vendors/";
    elgg_register_js("jquery.uploadify", $vendors . "uploadify/jquery.uploadify-3.1.min.js");
    elgg_register_simplecache_view("css/uploadify/uploadify");
    elgg_register_css("jquery.uploadify", elgg_get_simplecache_url("css", "uploadify/uploadify"));
    elgg_register_js("jquery.tree", $vendors . "jstree/jquery.tree.min.js");
    elgg_register_css("jquery.tree", $vendors . "jstree/themes/default/style.css");
    elgg_register_js("jquery.hashchange", $vendors . "hashchange/jquery.hashchange.js");
    // register page handler for nice URL's
    elgg_register_page_handler("file_tools", "file_tools_page_handler");
    // make our own URLs for folders
    elgg_register_entity_url_handler("object", FILE_TOOLS_SUBTYPE, "file_tools_folder_url_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"), "dashboard,profile,groups");
    // group files
    elgg_register_widget_type("group_files", elgg_echo("file:group"), elgg_echo("widgets:group_files:description"), "groups");
    // index files
    elgg_register_widget_type("index_file", elgg_echo("file"), elgg_echo("widgets:index_file:description"), "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");
    elgg_register_event_handler("upgrade", "system", "file_tools_upgrade_handler");
    // 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("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");
}
Пример #21
0
function themes_register_themes()
{
    $themes = array('default', 'bronco', 'palesky');
    foreach ($themes as $theme) {
        elgg_register_simplecache_view("css/themes/{$theme}");
        $url = elgg_get_simplecache_url('css', "themes/{$theme}");
        elgg_register_css($theme, $url);
    }
}
Пример #22
0
function tinymce_init()
{
    elgg_extend_view('css/elgg', 'tinymce/css');
    elgg_extend_view('css/admin', 'tinymce/css');
    elgg_register_js('tinymce', 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/tiny_mce.js');
    elgg_register_js('elgg.tinymce', elgg_get_simplecache_url('js', 'tinymce'));
    elgg_extend_view('input/longtext', 'tinymce/init');
    elgg_extend_view('embed/custom_insert_js', 'tinymce/embed_custom_insert_js');
    elgg_register_plugin_hook_handler('register', 'menu:longtext', 'tinymce_longtext_menu');
}
Пример #23
0
function favicon_override_head($hook, $type, $data)
{
    $data['links']['apple-touch-icon'] = array('rel' => 'apple-touch-icon', 'href' => elgg_get_simplecache_url('favicon_override/favicon-128.png'));
    $data['links']['icon-ico'] = array('rel' => 'icon', 'href' => elgg_get_simplecache_url('favicon_override/favicon.ico'));
    $data['links']['icon-16'] = array('rel' => 'icon', 'sizes' => '16x16', 'type' => 'image/png', 'href' => elgg_get_simplecache_url('favicon_override/favicon-16.png'));
    $data['links']['icon-32'] = array('rel' => 'icon', 'sizes' => '32x32', 'type' => 'image/png', 'href' => elgg_get_simplecache_url('favicon_override/favicon-32.png'));
    $data['links']['icon-64'] = array('rel' => 'icon', 'sizes' => '64x64', 'type' => 'image/png', 'href' => elgg_get_simplecache_url('favicon_override/favicon-64.png'));
    $data['links']['icon-128'] = array('rel' => 'icon', 'sizes' => '128x128', 'type' => 'image/png', 'href' => elgg_get_simplecache_url('favicon_override/favicon-128.png'));
    return $data;
}
Пример #24
0
/**
 * Profile init function; sets up the upload_groups functions
 *
 */
function upload_groups_init()
{
    $path = elgg_get_plugins_path() . 'upload_groups/';
    elgg_register_classes("{$path}classes/");
    elgg_register_admin_menu_item('administer', 'upload', 'groups');
    elgg_register_action('upload_groups/upload', "{$path}actions/upload_groups/upload.php", 'admin');
    $css = elgg_get_simplecache_url('css', 'upload_groups/css');
    elgg_register_css('upload_groups.css', $css);
    $js = elgg_get_simplecache_url('js', 'upload_groups/js');
    elgg_register_js('upload_groups.js', $js);
}
Пример #25
0
function site_notifications_init()
{
    // register as a notification type
    elgg_register_notification_method('site');
    elgg_register_plugin_hook_handler('send', 'notification:site', 'site_notifications_send');
    elgg_register_page_handler('site_notifications', 'site_notifications_page_handler');
    elgg_extend_view('elgg.css', 'site_notifications/css');
    $js = elgg_get_simplecache_url('site_notifications.js');
    elgg_register_js('elgg.site_notifications', $js, 'footer');
    site_notifications_set_topbar();
}
Пример #26
0
/**
 * 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']]);
}
Пример #27
0
/**
 * Initialize the tasks management plugin.
 *
 */
function tasks_init()
{
    // register a library of helper functions
    elgg_register_library('elgg:tasks', elgg_get_plugins_path() . 'tasks/lib/tasks.php');
    $item = new ElggMenuItem('tasks', elgg_echo('tasks'), 'tasks/all');
    elgg_register_menu_item('site', $item);
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('tasks', 'tasks_page_handler');
    // Register a url handler
    elgg_register_entity_url_handler('object', 'task', 'tasks_url');
    // Register some actions
    $action_base = elgg_get_plugins_path() . 'tasks/actions/tasks';
    elgg_register_action("tasks/edit", "{$action_base}/edit.php");
    elgg_register_action("tasks/delete", "{$action_base}/delete.php");
    elgg_register_action("tasks/comments/add", "{$action_base}/comments/add.php");
    elgg_register_action("tasks/comments/delete", "{$action_base}/comments/delete.php");
    // Extend the main css and js views
    elgg_extend_view('css/elgg', 'tasks/css');
    elgg_extend_view('js/elgg', 'tasks/js');
    // register the blog's JavaScript
    elgg_register_simplecache_view('js/tasks/tasklists');
    elgg_register_js('elgg.tasks', elgg_get_simplecache_url('js', 'tasks/tasklists'));
    elgg_register_ajax_view('object/task');
    elgg_register_ajax_view('tasks/tasklist_graph');
    // Register entity type for search
    elgg_register_entity_type('object', 'task');
    // Register a different form for annotations
    elgg_register_plugin_hook_handler('comments', 'object', 'tasks_comments_hook');
    // Register granular notification for this type
    register_notification_object('object', 'task', elgg_echo('tasks:new'));
    elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'tasks_notify_message');
    // add to groups
    add_group_tool_option('tasks', elgg_echo('groups:enabletasks'), true);
    elgg_extend_view('groups/tool_latest', 'tasks/group_module');
    //add a widget
    elgg_register_widget_type('tasks', elgg_echo('tasks:active'), elgg_echo('tasks:widget:description'));
    // Language short codes must be of the form "tasks:key"
    // where key is the array key below
    elgg_set_config('tasks', array('title' => 'text', 'description' => 'longtext', 'list_guid' => 'tasks/list', 'enddate' => 'date', 'priority' => 'tasks/priority', 'tags' => 'tags', 'access_id' => 'access'));
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'tasks_owner_block_menu');
    elgg_register_event_handler('pagesetup', 'system', 'tasks_pagesetup');
    // write permission plugin hooks
    elgg_register_plugin_hook_handler('permissions_check', 'object', 'tasks_write_permission_check');
    elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'tasks_container_permission_check');
    // icon url override
    elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'tasks_icon_url_override');
    // entity menu
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'tasks_entity_menu_setup');
    // register ecml views to parse
    elgg_register_plugin_hook_handler('get_views', 'ecml', 'tasks_ecml_views_hook');
    elgg_register_plugin_hook_handler('format', 'friendly:time', 'tasks_get_friendly_time');
    elgg_register_event_handler('upgrade', 'system', 'tasks_run_upgrades');
}
Пример #28
0
/**
 * Init function
 */
function embed_init()
{
    elgg_extend_view('css/elgg', 'embed/css');
    elgg_extend_view('css/admin', 'embed/css');
    elgg_register_plugin_hook_handler('register', 'menu:longtext', 'embed_longtext_menu');
    elgg_register_plugin_hook_handler('register', 'menu:embed', 'embed_select_tab', 1000);
    // Page handler for the modal media embed
    elgg_register_page_handler('embed', 'embed_page_handler');
    $embed_js = elgg_get_simplecache_url('js', 'embed/embed');
    elgg_register_simplecache_view('js/embed/embed');
    elgg_register_js('elgg.embed', $embed_js, 'footer');
}
Пример #29
0
function videolist_init()
{
    elgg_register_library('elgg:videolist', elgg_get_plugins_path() . 'videolist/lib/videolist.php');
    if (!class_exists('Videolist_PlatformInterface')) {
        // ./classes autoloading failed (pre 1.9)
        spl_autoload_register('videolist_load_class');
    }
    // add a site navigation item
    $item = new ElggMenuItem('videolist', elgg_echo('videolist'), 'videolist/all');
    elgg_register_menu_item('site', $item);
    // Extend system CSS with our own styles
    elgg_extend_view('css/elgg', 'videolist/css');
    // register the js
    $js = elgg_get_simplecache_url('js', 'videolist/videolist');
    elgg_register_simplecache_view('js/videolist/videolist');
    elgg_register_js('elgg.videolist', $js);
    $js = elgg_get_simplecache_url('js', 'videolist/json2');
    elgg_register_simplecache_view('js/videolist/json2');
    elgg_register_js('elgg.videolist.json2', $js);
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('videolist', 'videolist_page_handler');
    // Language short codes must be of the form "videolist:key"
    // where key is the array key below
    elgg_set_config('videolist', array('video_url' => 'url', 'title' => 'text', 'description' => 'longtext', 'tags' => 'tags', 'access_id' => 'access'));
    elgg_set_config('videolist_dimensions', array('width' => 600, 'height' => 400));
    // add to groups
    add_group_tool_option('videolist', elgg_echo('groups:enablevideolist'), true);
    elgg_extend_view('groups/tool_latest', 'videolist/group_module');
    //add a widget
    elgg_register_widget_type('videolist', elgg_echo('videolist'), elgg_echo('videolist:widget:description'));
    // Register granular notification for this type
    register_notification_object('object', 'videolist_item', elgg_echo('videolist:notification:subject'));
    elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'videolist_notify_message');
    // Register entity type for search
    elgg_register_entity_type('object', 'videolist_item');
    // add a file link to owner blocks
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'videolist_owner_block_menu');
    //register entity url handler
    elgg_register_entity_url_handler('object', 'videolist_item', 'videolist_url');
    elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'videolist_icon_url_override');
    // register for embed
    elgg_register_plugin_hook_handler('embed_get_sections', 'all', 'videolist_embed_get_sections');
    elgg_register_plugin_hook_handler('embed_get_items', 'videolist', 'videolist_embed_get_items');
    // handle URLs without scheme
    elgg_register_plugin_hook_handler('videolist:preprocess', 'url', 'videolist_preprocess_url');
    // Register actions
    $actions_path = elgg_get_plugins_path() . "videolist/actions/videolist";
    elgg_register_action("videolist/add", "{$actions_path}/add.php");
    elgg_register_action("videolist/edit", "{$actions_path}/edit.php");
    elgg_register_action("videolist/delete", "{$actions_path}/delete.php");
    elgg_register_action("videolist/get_metadata_from_url", "{$actions_path}/get_metadata_from_url.php");
    elgg_register_event_handler('upgrade', 'system', 'videolist_run_upgrades');
}
Пример #30
0
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');
    }
}