Пример #1
0
/**
 * Sets the URL handler for a particular extender type and name.
 * It is recommended that you do not call this directly, instead use one of the wrapper functions in the
 * subtype files.
 *
 * @param string $function_name The function to register
 * @param string $extender_type Extender type
 * @param string $extender_name The name of the extender
 * @return true|false Depending on success
 *
 * @deprecated 1.8 Use {@link elgg_register_extender_url_handler()}
 */
function register_extender_url_handler($function, $type = "all", $name = "all")
{
    elgg_deprecated_notice("register_extender_url_handler() was deprecated by elgg_register_extender_url_handler()", 1.8);
    return elgg_register_extender_url_handler($type, $name, $function);
}
Пример #2
0
/**
 * Register a metadata url handler.
 *
 * @param string $extender_name The name, default 'all'.
 * @param string $function      The function name.
 *
 * @return bool
 */
function elgg_register_metadata_url_handler($extender_name, $function)
{
    return elgg_register_extender_url_handler('metadata', $extender_name, $function);
}
Пример #3
0
/**
 * Register an annotation url handler.
 *
 * @param string $function_name The function.
 * @param string $extender_name The name, default 'all'.
 *
 * @return string
 */
function elgg_register_annotation_url_handler($extender_name = "all", $function_name)
{
    return elgg_register_extender_url_handler('annotation', $extender_name, $function_name);
}
Пример #4
0
/**
 * Register an annotation url handler.
 *
 * @param string $extender_name The name, default 'all'.
 * @param string $function_name The function.
 *
 * @return string
 * @deprecated 1.9 Use the plugin hook in \ElggExtender::getURL()
 */
function elgg_register_annotation_url_handler($extender_name = "all", $function_name)
{
    // deprecation notice comes from elgg_register_extender_url_handler()
    return elgg_register_extender_url_handler('annotation', $extender_name, $function_name);
}
Пример #5
0
/**
 * Called during system init
 *
 * @return void
 */
function theme_haarlem_intranet_init()
{
    // theme specific CSS
    elgg_register_css("sourcesanspro", "//fonts.googleapis.com/css?family=Source+Sans+Pro:400,600,700");
    elgg_load_css("sourcesanspro");
    elgg_register_css("slickmap", elgg_get_site_url() . 'mod/theme_haarlem_intranet/vendors/slickmap/slickmap.css');
    elgg_load_css("slickmap");
    elgg_register_js('tinymce', 'mod/theme_haarlem_intranet/vendors/tinymce/js/tinymce/tinymce.min.js');
    elgg_register_js('placeholders', elgg_get_site_url() . 'mod/theme_haarlem_intranet/vendors/placeholders/placeholders.jquery.min.js', 'footer');
    elgg_load_js('placeholders');
    $userpicker_js = elgg_get_simplecache_url('js', 'theme_haarlem_intranet/ui.userpicker');
    elgg_register_js('elgg.userpicker', $userpicker_js);
    elgg_extend_view('css/elgg', 'css/theme_haarlem_intranet/site');
    elgg_extend_view('css/elgg', 'css/theme_haarlem_intranet/responsive');
    elgg_extend_view('css/elgg', 'css/theme_haarlem_intranet/print');
    elgg_extend_view('js/elgg', 'js/bfa_plugin');
    elgg_extend_view('js/elgg', 'js/theme_haarlem_intranet/site');
    elgg_extend_view('page/elements/foot', 'js/theme_haarlem_intranet/accordion');
    elgg_extend_view('page/layouts/widgets', 'theme_haarlem_intranet/widgets_fix');
    elgg_extend_view('widgets/free_html/edit', 'theme_haarlem_intranet/longtext_disclaimer');
    elgg_extend_view('widgets/promo_widget/edit', 'theme_haarlem_intranet/longtext_disclaimer');
    elgg_extend_view('river/elements/body', 'theme_haarlem_intranet/river/elements/body', 400);
    elgg_extend_view('page/elements/header', 'theme_haarlem_intranet/mobile_forward');
    elgg_extend_view('output/longtext', 'theme_haarlem_intranet/shortcodes', 100);
    elgg_extend_view('profile_manager/profile_completeness/content', 'theme_haarlem_intranet/profile/completeness/push', 400);
    elgg_extend_view('profile_manager/profile_completeness/content', 'theme_haarlem_intranet/profile/completeness/pop', 900);
    elgg_register_plugin_hook_handler('categorized_profile_fields', 'profile_manager', 'theme_haarlem_profile_completeness_fields', 99999);
    // unextend views
    elgg_unextend_view('page/elements/header', 'search/header');
    if (!theme_haarlem_is_extranet()) {
        define('THEME_BLUE', '00ADEF');
        elgg_extend_view('page/elements/header', 'search/header');
    } else {
        define('THEME_BLUE', 'A60F0F');
        elgg_extend_view('css/elgg', 'css/theme_haarlem_intranet/extranet');
    }
    elgg_unextend_view("page/elements/owner_block/extend", "group_tools/owner_block");
    elgg_unextend_view("groups/sidebar/members", "group_tools/group_admins");
    elgg_set_view_location('plugins/simplesaml/usersettings', 'nonexisting');
    // events
    elgg_register_event_handler('pagesetup', 'system', 'theme_haarlem_intranet_pagesetup', 600);
    elgg_register_event_handler('create', 'member_of_site', 'theme_haarlem_intranet_site_join_event');
    elgg_register_event_handler('delete', 'member_of_site', 'theme_haarlem_intranet_site_leave_event');
    elgg_register_event_handler('update_user', 'profile_sync', 'theme_haarlem_intranet_profile_sync_site_membership');
    elgg_register_event_handler('update_user', 'profile_sync', 'theme_haarlem_intranet_profile_sync_zakelijkemail');
    elgg_register_event_handler('update_user', 'profile_sync', 'theme_haarlem_intranet_profile_sync_profile_icon');
    // plugin hooks
    elgg_register_plugin_hook_handler("register", "menu:personal", "theme_haarlem_intranet_personal_menu");
    elgg_register_plugin_hook_handler("register", "menu:entity", "theme_haarlem_intranet_entity_menu_icons");
    elgg_register_plugin_hook_handler("register", "menu:entity", "theme_haarlem_intranet_thewire_entity_menu");
    elgg_register_plugin_hook_handler("register", "menu:user_hover", "theme_haarlem_intranet_user_hover_menu");
    elgg_register_plugin_hook_handler("register", "menu:quick_nav", "theme_haarlem_intranet_quick_nav_menu");
    elgg_register_plugin_hook_handler("register", "menu:file_tools_folder_sidebar_tree", "theme_haarlem_intranet_folder_tree_menu");
    elgg_register_plugin_hook_handler("prepare", "menu:page", "theme_haarlem_intranet_prepare_page_menu_static");
    elgg_register_plugin_hook_handler("prepare", "menu:page", "theme_haarlem_intranet_prepare_menu_icons");
    elgg_register_plugin_hook_handler("prepare", "menu:owner_block", "theme_haarlem_intranet_prepare_menu_icons");
    elgg_register_plugin_hook_handler("prepare", "menu:site", "theme_haarlem_intranet_prepare_site_menu", 99999);
    elgg_register_plugin_hook_handler("prepare", "menu:site", "theme_haarlem_intranet_responsive_toggle_links", 99999);
    elgg_register_plugin_hook_handler('route', 'all', 'theme_haarlem_intranet_route_static_handler');
    elgg_register_plugin_hook_handler('route', 'settings', 'theme_haarlem_intranet_route_settings_handler');
    elgg_register_plugin_hook_handler('route', 'avatar', 'theme_haarlem_intranet_route_avatar_handler');
    elgg_unregister_plugin_hook_handler("route", "file", "file_tools_file_route_hook");
    elgg_register_plugin_hook_handler("route", "file", "theme_haarlem_intranet_file_route_handler");
    elgg_register_plugin_hook_handler("route", "file", "file_tools_file_route_hook");
    elgg_register_plugin_hook_handler("route", "groups", "theme_haarlem_intranet_groups_route_handler");
    elgg_register_plugin_hook_handler('route', 'pages', 'theme_haarlem_intranet_pages_route_handler');
    elgg_register_plugin_hook_handler("route", "livesearch", "theme_haarlem_intranet_livesearch_route_handler");
    elgg_register_plugin_hook_handler('config', 'htmlawed', 'theme_haarlem_intranet_htmlawed_config');
    elgg_register_plugin_hook_handler("register", "menu:page", "theme_haarlem_intranet_cleanup_menu");
    elgg_register_plugin_hook_handler('register', 'menu:longtext', 'theme_haarlem_intranet_cleanup_menu');
    elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'theme_haarlem_intranet_cleanup_menu');
    elgg_unregister_plugin_hook_handler("search_multisite", "search", "subsite_manager_search_multisite_search_hook");
    elgg_register_plugin_hook_handler('entity:icon:url', 'user', 'theme_haarlem_intranet_profile_icon', 2000);
    // high prio to overrule subsite_manager
    elgg_register_plugin_hook_handler("action", "logout", "theme_haarlem_intranet_logout_action_hook");
    elgg_register_plugin_hook_handler("access:default", "user", "theme_haarlem_intranet_access_default");
    // page handlers
    elgg_register_page_handler('profile', 'theme_haarlem_intranet_profile_page_handler');
    elgg_register_page_handler('dashboard', 'theme_haarlem_intranet_dashboard_page_handler');
    elgg_register_page_handler('haarlem_avatar', 'theme_haarlem_intranet_avatar_page_handler');
    // quick nav
    elgg_register_ajax_view('theme_haarlem_intranet/forms/quick_nav');
    $js = elgg_get_simplecache_url('js', 'theme_haarlem_intranet/quick_nav');
    elgg_register_js('theme_haarlem_intranet_quick_nav', $js);
    elgg_register_widget_type('quick_nav', elgg_echo('theme_haarlem_intranet:quick_nav:widget:title'), elgg_echo('theme_haarlem_intranet:quick_nav:widget:description'), 'index', true);
    elgg_register_widget_type('pages', elgg_echo('pages'), elgg_echo('pages:widget:description'), 'all', true);
    elgg_register_action('theme_haarlem_intranet/quick_nav', dirname(__FILE__) . '/actions/quick_nav.php');
    elgg_register_action('theme_haarlem_intranet/admin/reset_mentions', dirname(__FILE__) . '/actions/admin/reset_mentions.php', 'admin');
    // izine
    elgg_register_widget_type('izine', elgg_echo('theme_haarlem_intranet:izine:widget:title'), elgg_echo('theme_haarlem_intranet:izine:widget:description'), 'index', true);
    elgg_register_widget_type('haarlem_news', elgg_echo('theme_haarlem_intranet:haarlem_news:widget:title'), elgg_echo('theme_haarlem_intranet:haarlem_news:widget:description'), 'index', true);
    // increase master icon sizes
    $icon_sizes = elgg_get_config('icon_sizes');
    $icon_sizes['master']['h'] = 1024;
    $icon_sizes['master']['w'] = 1024;
    elgg_set_config('icon_sizes', $icon_sizes);
    // don't allow main profile fields to be edited
    $current_url = current_page_url();
    $user = elgg_get_logged_in_user_entity();
    if (!theme_haarlem_is_extranet()) {
        if (stristr($current_url, 'action/profile/edit') !== false || !empty($user) && stristr($current_url, "profile/{$user->username}/edit") !== false) {
            elgg_unregister_plugin_hook_handler('profile:fields', 'profile', 'subsite_manager_profile_fields_hook');
            elgg_unregister_plugin_hook_handler('categorized_profile_fields', 'profile_manager', 'subsite_manager_profile_manager_profile_hook');
        }
    }
    // 	elgg_register_page_handler('search', 'theme_haarlem_intranet_search_page_handler');
    // restore tags search
    elgg_register_plugin_hook_handler('search_advanced_types', 'get_types', 'search_custom_types_tags_hook');
    elgg_register_plugin_hook_handler('search', 'tags', 'search_tags_hook');
    elgg_register_plugin_hook_handler('search_types', 'get_types', 'search_custom_types_tags_hook');
    elgg_register_extender_url_handler('annotation', 'group_topic_post', 'theme_haarlem_intranet_annotation_url_handler');
    // actions
    elgg_register_action('messages/send', dirname(__FILE__) . '/actions/messages/send.php');
    elgg_register_action('theme_haarlem_intranet/toggle_sidebar', dirname(__FILE__) . '/actions/toggle_sidebar.php');
    // overrule outgoing email
    // 	register_notification_handler("email", "theme_haarlem_intranet_notification_handler");
    // 	elgg_unregister_plugin_hook_handler("email", "system", "html_email_handler_email_hook");
    // 	elgg_register_plugin_hook_handler("email", "system", "theme_haarlem_intranet_notification_handler");
    elgg_register_plugin_hook_handler("setting", "plugin", "theme_haarlem_intranet_invalidate_cache");
}