function au_staff_options($pageowner)
{
    $user = elgg_get_logged_in_user_entity();
    $group = elgg_get_page_owner_entity();
    if (elgg_instanceof($group, 'group')) {
        //check group attributes - ignore if au staff
        if ($group->staff_only_enable == 'yes') {
            elgg_extend_view('group/default', 'groups/sidebar/staff_only', 502);
            //do stuff if this is a staff-only group
            //system_message("AU staff-only group: only AU staff members can join this group");
            if (elgg_is_logged_in()) {
                $invited = check_entity_relationship($group->getGUID(), "invited", $user->getGUID());
                //allow invited users in
                if (is_au_staff_member($user) || elgg_is_admin_logged_in() || $group->canEdit() || $invited) {
                    //do other stuff - welcome here
                } else {
                    //remove buttons for non staff members who are not members of the group and not invited
                    if (!$group->isMember($user)) {
                        elgg_register_plugin_hook_handler('register', 'menu:title', 'au_landing_remove_group_join_button', 9999);
                        //remove the link we added in groups_ux to allow joining from discussion forum
                        elgg_unextend_view('discussion/replies', 'discussion/replies/join');
                    }
                }
            }
        } else {
            //this is a normal group
        }
    } else {
        //not a group, do nothing
    }
}
Example #2
0
function basic_pagesetup_handler()
{
    elgg_unextend_view('page/elements/header', 'search/header');
    elgg_unregister_menu_item('topbar', 'dashboard');
    elgg_unregister_menu_item('topbar', 'elgg_logo');
    // Extend footer with copyright
    $year = date('Y');
    $href = "http://www.perjensen-online.dk";
    elgg_register_menu_item('footer', array('name' => 'copyright_this', 'href' => $href, 'title' => elgg_echo('basic_light:tooltip'), 'text' => elgg_echo('basic_light:copyright') . $year . elgg_echo(' Elggzone'), 'priority' => 1, 'section' => 'alt'));
    // Extend footer with elgg link
    $href = "http://elgg.org";
    elgg_register_menu_item('footer', array('name' => 'elgg', 'href' => $href, 'text' => elgg_echo('basic_light:elgg'), 'priority' => 2, 'section' => 'alt'));
    if (elgg_is_logged_in()) {
        $user = elgg_get_logged_in_user_entity();
        if (elgg_is_active_plugin('dashboard')) {
            elgg_register_menu_item('topbar', array('name' => 'dashboard', 'href' => 'dashboard', 'text' => elgg_view_icon('home') . elgg_echo('dashboard'), 'priority' => 1000, 'section' => 'alt'));
        }
        if (elgg_is_active_plugin('reportedcontent')) {
            elgg_unregister_menu_item('footer', 'report_this');
            $href = "javascript:elgg.forward('reportedcontent/add'";
            $href .= "+'?address='+encodeURIComponent(location.href)";
            $href .= "+'&title='+encodeURIComponent(document.title));";
            elgg_register_menu_item('extras', array('name' => 'report_this', 'href' => $href, 'text' => elgg_view_icon('report-this') . elgg_echo(''), 'title' => elgg_echo('reportedcontent:this:tooltip'), 'priority' => 100));
        }
    }
}
Example #3
0
function aalborg_theme_pagesetup()
{
    elgg_unextend_view('page/elements/header', 'search/header');
    if (elgg_is_logged_in()) {
        elgg_extend_view('page/elements/sidebar', 'search/header', 0);
    }
    elgg_unregister_menu_item('topbar', 'dashboard');
    if (elgg_is_active_plugin('dashboard')) {
        elgg_register_menu_item('site', array('name' => 'dashboard', 'href' => 'dashboard', 'text' => elgg_echo('dashboard')));
    }
    if (elgg_is_logged_in()) {
        $user = elgg_get_logged_in_user_entity();
        elgg_register_menu_item('topbar', array('name' => 'account', 'text' => elgg_echo('account'), 'href' => "#", 'priority' => 100, 'section' => 'alt', 'link_class' => 'elgg-topbar-dropdown'));
        elgg_unregister_menu_item('topbar', 'usersettings');
        elgg_register_menu_item('topbar', array('name' => 'usersettings', 'parent_name' => 'account', 'href' => "/settings/user/{$user->username}", 'text' => elgg_echo('settings'), 'priority' => 103, 'section' => 'alt'));
        elgg_unregister_menu_item('topbar', 'logout');
        elgg_register_menu_item('topbar', array('name' => 'logout', 'parent_name' => 'account', 'href' => '/action/logout', 'is_action' => TRUE, 'text' => elgg_echo('logout'), 'priority' => 104, 'section' => 'alt'));
        elgg_unregister_menu_item('topbar', 'administration');
        if (elgg_is_admin_logged_in()) {
            elgg_register_menu_item('topbar', array('name' => 'administration', 'parent_name' => 'account', 'href' => 'admin', 'text' => elgg_echo('admin'), 'priority' => 101, 'section' => 'alt'));
        }
        elgg_unregister_menu_item('footer', 'report_this');
        if (elgg_is_active_plugin('reportedcontent')) {
            $href = "javascript:elgg.forward('reportedcontent/add'";
            $href .= "+'?address='+encodeURIComponent(location.href)";
            $href .= "+'&title='+encodeURIComponent(document.title));";
            elgg_register_menu_item('extras', array('name' => 'report_this', 'href' => $href, 'title' => elgg_echo('reportedcontent:this:tooltip'), 'text' => elgg_view_icon('report-this'), 'priority' => 500));
        }
    }
}
Example #4
0
/**
 * Initialize the theme
 *
 * @return void
 */
function theme_eersel_init()
{
    elgg_register_css('font-awesome', 'mod/theme_eersel/vendors/font-awesome-4.3.0/css/font-awesome.min.css');
    elgg_load_css('font-awesome');
    // extend views
    elgg_extend_view("js/elgg", "js/theme_eersel");
    elgg_extend_view("css/elgg", "css/theme_eersel");
    elgg_extend_view("css/elgg", "css/theme_eersel_images");
    elgg_extend_view("page/layouts/widgets", "theme_eersel/widgets_fix");
    elgg_extend_view('icon/default', 'theme_eersel/group/icon', 400);
    elgg_unextend_view("page/elements/header", "search/header");
    elgg_unextend_view("page/elements/owner_block/extend", "group_tools/owner_block");
    // page handlers
    elgg_register_page_handler("theme_eersel", "theme_eersel_page_handler");
    elgg_register_page_handler("profile", "theme_eersel_profile_page_handler");
    elgg_register_js('jquery.flexslider', 'mod/theme_eersel/vendors/jquery.flexslider/jquery.flexslider-min.js');
    elgg_load_js('jquery.flexslider');
    // register widgets
    elgg_register_widget_type("profile_owner_block", elgg_echo("theme_eersel:widgets:profile_owner_block:title"), elgg_echo("theme_eersel:widgets:profile_owner_block:description"), "profile");
    elgg_register_widget_type("index_photos", elgg_echo("theme_eersel:widgets:index_photos:title"), elgg_echo("theme_eersel:widgets:index_photos:description"), "index");
    elgg_register_widget_type("index_sidebar", elgg_echo("theme_eersel:widgets:index_sidebar:title"), elgg_echo("theme_eersel:widgets:index_sidebar:description"), "index");
    // register plugin hooks
    elgg_register_plugin_hook_handler("register", "menu:topbar", "theme_eersel_register_topbar_menu_handler");
    elgg_register_plugin_hook_handler("prepare", "menu:owner_block", "theme_eersel_prepare_owner_block_menu_handler");
    elgg_register_plugin_hook_handler('route', 'groups', 'theme_eersel_route_groups_handler');
    // register events
    elgg_register_event_handler('pagesetup', 'system', 'theme_eersel_pagesetup');
    // register admin menu item
    elgg_register_admin_menu_item("configure", "theme_eersel", "appearance");
    // register actions
    elgg_register_action("theme_eersel/slider_upload", dirname(__FILE__) . "/actions/slider_upload.php", "admin");
    elgg_register_action("theme_eersel/links", dirname(__FILE__) . "/actions/links.php", "admin");
}
Example #5
0
function twitter_bootswatch_init()
{
    $bootswatch_style = elgg_get_plugin_setting('bootswatch_style', 'twitter_bootswatch');
    switch ($bootswatch_style) {
        case 'amelia':
        case 'cerulean':
        case 'cosmo':
        case 'cyborg':
        case 'flatty':
        case 'journal':
        case 'readable':
        case 'simplex':
        case 'slate':
        case 'spacelab':
        case 'spruce':
        case 'superhero':
        case 'united':
            break;
        default:
            $bootswatch_style = 'cyborg';
    }
    // Unextend the default bootstrap override css
    elgg_unextend_view('css/elgg', 'twitter_bootstrap/css');
    // Extend system CSS with our own styles
    elgg_extend_view('css/elgg', 'twitter_bootswatch/css');
    // united bootstrap
    $bootstrap_css = 'mod/twitter_bootswatch/vendors/bootstrap-' . $bootswatch_style . '.min.css';
    elgg_register_css('twitter_bootswatch_css', $bootstrap_css, 5);
    //unload default bootstrap css and load new one
    elgg_unregister_css('bootstrap_css');
    if (get_context() != 'admin') {
        elgg_load_css('twitter_bootswatch_css');
    }
}
Example #6
0
function gvtheme_init()
{
    // custom topbar
    elgg_unregister_menu_item('topbar', 'elgg_logo');
    elgg_register_plugin_hook_handler('register', 'menu:topbar', 'gvtheme_custom_topbarmenu_setup');
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'gvtheme_custom_entitymenu_setup');
    elgg_register_plugin_hook_handler('register', 'menu:river', 'gvtheme_custom_rivermenu_setup');
    elgg_register_event_handler('pagesetup', 'system', 'gvtheme_custom_usersettings_pagesetup');
    elgg_extend_view('css/elgg', 'gvtheme/css');
    elgg_extend_view('page/elements/head', 'gvtheme/head');
    // remove entities statistics views from user account
    elgg_unextend_view('core/settings/statistics', 'core/settings/statistics/numentities');
    // override some actions
    $action_base = elgg_get_plugins_path() . 'gvtheme/actions';
    elgg_register_action("avatar/upload", "{$action_base}/avatar/upload.php");
    elgg_register_action("avatar/crop", "{$action_base}/avatar/crop.php");
    elgg_register_action("friends/add", "{$action_base}/friends/add.php");
    // get number of users
    $num_members = get_number_users();
    elgg_register_menu_item('topbar', array('name' => 'member_number', 'href' => "members/newest", 'text' => elgg_echo("gvtheme:num_members", array($num_members)), 'priority' => 1000, 'section' => 'alt'));
    $initiatives_item = new ElggMenuItem('initiatives', elgg_echo('gvtheme:initiatives'));
    $cnc_item = new ElggMenuItem('cnc', elgg_echo('gvtheme:cnc'), 'file/group/9545/all');
    $cnc_item->setItemClass('gvgroup-child-menu');
    $initiatives_item->addChild($cnc_item);
    elgg_register_menu_item('site', $initiatives_item);
}
Example #7
0
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");
    }
}
/**
 * Initialize the plugin
 * @return void
 */
function actions_feature_init()
{
    elgg_register_action('feature', __DIR__ . '/actions/feature.php');
    elgg_register_action('unfeature', __DIR__ . '/actions/unfeature.php');
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'actions_feature_entity_menu_setup');
    elgg_unextend_view('js/elgg', 'groups/js');
    elgg_extend_view('js/elgg', 'feature.js');
    elgg_register_plugin_hook_handler('feature', 'group', 'Elgg\\Values::getTrue');
}
Example #9
0
function facebook_theme_init()
{
    /**
     * Customize pages
     */
    elgg_register_plugin_hook_handler('index', 'system', 'facebook_theme_index_handler');
    elgg_register_page_handler('profile', 'facebook_theme_profile_page_handler');
    elgg_register_page_handler('dashboard', 'facebook_theme_dashboard_handler');
    elgg_register_page_handler('page/elements/nologin', 'facebook_theme_nologin_handler');
    //What a hack!  Overriding groups page handler without blowing away other plugins doing the same
    global $CONFIG, $facebook_theme_original_groups_page_handler;
    $facebook_theme_original_groups_page_handler = $CONFIG->pagehandler['groups'];
    elgg_register_page_handler('groups', 'facebook_theme_groups_page_handler');
    elgg_register_ajax_view('thewire/composer');
    elgg_register_ajax_view('messageboard/composer');
    elgg_register_ajax_view('blog/composer');
    elgg_register_ajax_view('file/composer');
    elgg_register_ajax_view('bookmarks/composer');
    /**
     * Customize menus
     */
    elgg_unregister_plugin_hook_handler('register', 'menu:river', 'likes_river_menu_setup');
    elgg_unregister_plugin_hook_handler('register', 'menu:river', 'elgg_river_menu_setup');
    elgg_register_plugin_hook_handler('register', 'menu:river', 'facebook_theme_river_menu_handler');
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'facebook_theme_owner_block_menu_handler', 600);
    elgg_register_plugin_hook_handler('register', 'menu:composer', 'facebook_theme_composer_menu_handler');
    elgg_register_event_handler('pagesetup', 'system', 'facebook_theme_pagesetup_handler', 1000);
    /**
     * Customize permissions
     */
    elgg_register_plugin_hook_handler('permissions_check:annotate', 'all', 'facebook_theme_annotation_permissions_handler');
    elgg_register_plugin_hook_handler('container_permissions_check', 'all', 'facebook_theme_container_permissions_handler');
    /**
     * Miscellaneous customizations
     */
    //Small "correction" to groups profile -- brief description makes more sense to come first!
    elgg_register_plugin_hook_handler('profile:fields', 'group', 'facebook_theme_group_profile_fields', 1);
    //@todo report some of the extra patterns to be included in Elgg core
    elgg_extend_view('css/elgg', 'facebook_theme/css');
    elgg_extend_view('js/elgg', 'js/topbar');
    //Likes summary bar -- "You, John, and 3 others like this"
    if (elgg_is_active_plugin('likes')) {
        elgg_extend_view('river/elements/responses', 'likes/river_footer', 1);
    }
    elgg_extend_view('river/elements/responses', 'discussion/river_footer');
    //Elgg only includes the search bar in the header by default,
    //but we usually don't show the header when the user is logged in
    if (elgg_is_active_plugin('search')) {
        elgg_extend_view('page/elements/topbar', 'search/search_box');
        elgg_unextend_view('page/elements/header', 'search/search_box');
        if (!elgg_is_logged_in()) {
            elgg_unextend_view('page/elements/header', 'search/header');
        }
    }
}
/**
 * Initialize the plugin
 * @return void
 */
function group_subtypes_init()
{
    // Search
    elgg_unregister_entity_type('group', '');
    elgg_unregister_plugin_hook_handler('search', 'group', 'search_groups_hook');
    elgg_register_plugin_hook_handler('search', 'group', 'group_subtypes_search_hook');
    elgg_register_plugin_hook_handler('route', 'groups', 'group_subtypes_route_edit_pages');
    $hooks = _elgg_services()->hooks->getAllHandlers();
    $conf = group_subtypes_get_config();
    $identifiers = array();
    foreach ($conf as $subtype => $options) {
        elgg_register_entity_type('group', $subtype);
        $identifier = elgg_extract('identifier', $options, 'groups');
        if (in_array($identifier, $identifiers)) {
            continue;
        }
        elgg_register_plugin_hook_handler('page_identifier', "group:{$subtype}", 'group_subtypes_page_identifier');
        elgg_register_plugin_hook_handler('list_subtypes', $identifier, 'group_subtypes_list_subtypes');
        if ($identifier !== 'groups') {
            elgg_register_menu_item('site', array('name' => $identifier, 'href' => "{$identifier}/all", 'text' => elgg_echo($identifier)));
            elgg_register_plugin_hook_handler('route', $identifier, 'group_subtypes_router', 1);
            // core doesn't run 'route' hooks on an updated page identifier, so we will register the callback manually
            if (!isset($hooks['route']['groups'])) {
                continue;
            }
            foreach ($hooks['route']['groups'] as $priority => $callbacks) {
                $callbacks = (array) $callbacks;
                foreach ($callbacks as $callback) {
                    elgg_register_plugin_hook_handler('route', $identifier, $callback, $priority);
                }
            }
        }
    }
    elgg_register_plugin_hook_handler('permissions_check:parent', 'group', 'group_subtypes_can_parent');
    // Form hacks
    elgg_register_plugin_hook_handler('action', 'groups/edit', 'group_subtypes_update_fields_config');
    elgg_extend_view('forms/groups/edit', 'forms/groups/edit/subtype');
    elgg_extend_view('forms/groups/edit', 'forms/groups/edit/parent_guid');
    // Group URL
    elgg_register_plugin_hook_handler('entity:url', 'group', 'group_subtypes_rewrite_group_urls');
    // Admin
    elgg_register_admin_menu_item('administer', 'groups', null, 20);
    elgg_register_admin_menu_item('administer', 'subtypes', 'groups', 10);
    elgg_register_action('admin/groups/subtypes/add', __DIR__ . '/actions/admin/groups/subtypes/add.php', 'admin');
    elgg_register_action('admin/groups/subtypes/config', __DIR__ . '/actions/admin/groups/subtypes/config.php', 'admin');
    elgg_register_action('admin/groups/subtypes/change_subtype', __DIR__ . '/actions/admin/groups/subtypes/change_subtype.php', 'admin');
    elgg_extend_view('admin.css', 'forms/admin/groups/subtypes/config.css');
    // Group tools
    if (elgg_is_active_plugin('group_tools')) {
        elgg_unextend_view("groups/edit", "group_tools/group_edit_tabbed", 1);
        elgg_unextend_view("groups/edit", "group_tools/group_edit_tabbed_js", 999999999);
        elgg_extend_view('css/elgg', 'forms/groups/edit/group_tools.css');
    }
}
Example #11
0
function notifications_plugin_init()
{
    elgg_extend_view('css/elgg', 'notifications/css');
    // Unset the default notification settings
    elgg_unregister_plugin_hook_handler('usersettings:save', 'user', 'notification_user_settings_save');
    elgg_unextend_view('forms/account/settings', 'core/settings/account/notifications');
    elgg_extend_view('forms/account/settings', 'notifications/subscriptions/personal');
    elgg_register_plugin_hook_handler('usersettings:save', 'user', 'zhnotifications_user_settings_save');
    // update notifications based on relationships changing
    elgg_register_event_handler('delete', 'member', 'notifications_relationship_remove');
}
/**
 * Rearrange menu items
 */
function aalborg_theme_pagesetup()
{
    elgg_unextend_view('page/elements/header', 'search/header');
    if (elgg_is_logged_in()) {
        elgg_extend_view('page/elements/sidebar', 'search/header', 0);
    }
    if (elgg_is_logged_in()) {
        elgg_register_menu_item('topbar', array('name' => 'account', 'text' => elgg_echo('account'), 'href' => "#", 'priority' => 100, 'section' => 'alt', 'link_class' => 'elgg-topbar-dropdown'));
        if (elgg_is_active_plugin('dashboard')) {
            $item = elgg_unregister_menu_item('topbar', 'dashboard');
            if ($item) {
                $item->setText(elgg_echo('dashboard'));
                $item->setSection('default');
                elgg_register_menu_item('site', $item);
            }
        }
        $item = elgg_get_menu_item('topbar', 'usersettings');
        if ($item) {
            $item->setParentName('account');
            $item->setText(elgg_echo('settings'));
            $item->setPriority(103);
        }
        $item = elgg_get_menu_item('topbar', 'logout');
        if ($item) {
            $item->setParentName('account');
            $item->setText(elgg_echo('logout'));
            $item->setPriority(104);
        }
        $item = elgg_get_menu_item('topbar', 'administration');
        if ($item) {
            $item->setParentName('account');
            $item->setText(elgg_echo('admin'));
            $item->setPriority(101);
        }
        if (elgg_is_active_plugin('site_notifications')) {
            $item = elgg_get_menu_item('topbar', 'site_notifications');
            if ($item) {
                $item->setParentName('account');
                $item->setText(elgg_echo('site_notifications:topbar'));
                $item->setPriority(102);
            }
        }
        if (elgg_is_active_plugin('reportedcontent')) {
            $item = elgg_unregister_menu_item('footer', 'report_this');
            if ($item) {
                $item->setText(elgg_view_icon('report-this'));
                $item->setPriority(500);
                $item->setSection('default');
                elgg_register_menu_item('extras', $item);
            }
        }
    }
}
Example #13
0
/**
 * Gets called when the Elgg system initializes
 *
 * @return void
 */
function embed_extended_init()
{
    // add CSS / JS
    elgg_extend_view('css/elgg', 'css/embed_extended.css');
    elgg_extend_view('css/admin', 'css/embed_extended.css');
    // register page handler
    elgg_register_ajax_view('embed_extended/list', 'embed_extended_page_handler');
    // register plugin hooks
    elgg_register_plugin_hook_handler('register', 'menu:embed', '\\ColdTrick\\EmbedExtended\\Menus::embedMenuRegister');
    elgg_register_plugin_hook_handler('prepare', 'menu:longtext', '\\ColdTrick\\EmbedExtended\\Menus::longtextMenuPrepare');
    elgg_unextend_view('embed/embed.js', 'elgg/ckeditor/insert.js');
}
Example #14
0
function aalborg_theme_init()
{
    elgg_register_event_handler('pagesetup', 'system', 'aalborg_theme_pagesetup', 1000);
    // theme specific CSS
    elgg_extend_view('elgg.css', 'aalborg_theme/css');
    elgg_unextend_view('page/elements/header', 'search/header');
    elgg_extend_view('page/elements/sidebar', 'search/header', 0);
    elgg_register_plugin_hook_handler('head', 'page', 'aalborg_theme_setup_head');
    // 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');
    }
}
/**
 * Init timeline finder plugin.
 */
function timeline_init()
{
    // register a library of helper functions
    elgg_register_library('elgg:timeline', elgg_get_plugins_path() . 'timeline_theme/lib/timeline.php');
    // Elgg way...
    // Let us load the library
    elgg_load_library('elgg:timeline');
    // register a library of helper functions
    // 	require_once(dirname(__FILE__) . "/lib/timeline.php"); // Non elgg way of loading the lib functions
    // add to the main css
    // elgg_extend_view('css/elgg', 'timeline_theme/timeline_theme_css/demo'); // Timeline_theme index page login
    // elgg_extend_view('css/elgg', 'timeline_theme/timeline_theme_css/style'); // Timeline_theme custom css
    // elgg_extend_view('css/elgg', 'timeline_theme/timeline_theme_css/animate-custom'); // TM: timelne index
    elgg_extend_view('css/elgg', 'timeline_theme/timeline_theme_css/topbar');
    // TM: Top bar css
    elgg_extend_view('css/elgg', 'timeline_theme/css');
    elgg_extend_view('css/elgg', 'timeline_theme/timelinemenu');
    // Timeline_theme menu buttons
    elgg_extend_view('css/elgg', 'timeline_theme/searchcss');
    // TM: added css for search bar
    elgg_extend_view('css/elements/elgg', 'css/elements/layout');
    elgg_extend_view('css/elements/elgg', 'css/elements/navigation');
    elgg_unregister_menu_item('topbar', 'elgg_logo');
    //elgg_unregister_menu_item('topbar', array(
    //		'name' => 'messages',
    //
    //	));
    elgg_extend_view('page/elements/elgg', 'page/elements/walled_garden');
    elgg_extend_view('page/elements/sidebar', 'sidebar/extedsidebar_alt', 1000);
    elgg_unextend_view('page/elements/header', 'search/header');
    // when now use elgg_get_context()
    if (elgg_get_context() == 'groups') {
        elgg_extend_view('page/elements/header', 'page/elements/header_group');
    } else {
        // let us extend the header with our header contents
        elgg_extend_view('page/elements/header', 'page/elements/header_user');
    }
    if (elgg_is_logged_in()) {
        //    elgg_extend_view('page/elements/header', 'search/header');
    }
    // Replace the default index page
    elgg_register_plugin_hook_handler('index', 'system', 'timeline_index', 300);
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('timeline', 'timeline_page_handler');
    elgg_extend_view('page/elements/header.php', 'page/elements/ownericon/owner_block_icon.php', '500');
    //Tom : Invocational codes
    /**
     * Customize menus
     */
    //	elgg_register_event_handler('pagesetup', 'system', 'timeline_pagesetup_handler', 1000);
}
function remove_all_group_modules($modules_mantener)
{
    global $CONFIG;
    $modules_hay = $CONFIG->group_tool_options;
    //var_dump($modules_hay);
    if (!isset($modules_hay) || $modules_hay == NULL) {
        return;
    }
    //METODO REGULAR
    foreach ($modules_hay as $entity) {
        elgg_unextend_view('groups/tool_latest', "{$entity->name}/group_module");
        if ($entity->name == "forum") {
            elgg_unextend_view('groups/tool_latest', "discussion/group_module");
        }
        if ($entity->name == "activity") {
            elgg_unextend_view('groups/tool_latest', "groups/profile/activity_module");
        }
        if ($entity->name == "subgroups") {
            elgg_unextend_view('groups/tool_latest', "au_subgroups/group_module");
        }
    }
    foreach ($modules_mantener as $module) {
        elgg_extend_view('groups/tool_latest', "{$module}/group_module");
    }
    /*
    //INTENTO DE METODO MEJOR
    foreach($modules_hay->name as $entity){
    	foreach($modules_mantener as $modules){
    		if ($entity == $modules){
    			$entity = "";
    		}
    	}
    }
    
    foreach($modules_hay as $entity){
    	if ($entity!=""){
    		elgg_unextend_view('groups/tool_latest', "$entity->name/group_module");
    		if ($entity->name == "forum"){
    			elgg_unextend_view('groups/tool_latest', "discussion/group_module");
    		}
    		if ($entity->name == "activity"){
    			elgg_unextend_view('groups/tool_latest', "groups/profile/activity_module");
    		}
    		if ($entity->name == "subgroups"){
    			elgg_unextend_view('groups/tool_latest', "au_subgroups/group_module");
    		}
    	}
    }
    */
}
Example #17
0
/**
 * Initialize the plugin
 */
function hj_themex_init()
{
    if (elgg_in_context('admin')) {
        return;
    }
    elgg_unextend_view('page/elements/header', 'search/header');
    // Very annoying extention that needs to disappear
    elgg_unextend_view('css/elgg', 'custom_index/css');
    elgg_unextend_view('css/elgg', 'groups/css');
    elgg_unextend_view('css/elgg', 'messages/css');
    elgg_unextend_view('css/elgg', 'profile/css');
    elgg_unextend_view('css/elgg', 'search/css');
    elgg_extend_view('page/elements/head', 'page/elements/metatags');
    $jquery_ui = JQUERY_UI_THEME;
    elgg_register_css('jquery-ui', "/mod/hypeThemeX/stylesheets/jquery-ui-themes-1.10.3/themes/{$jquery_ui}/jquery-ui.min.css", 300);
    elgg_load_css('jquery-ui');
    $theme = ELGG_THEME;
    elgg_register_css('elgg.theme', "/mod/hypeThemeX/stylesheets/themes/{$theme}/theme.css", 400);
    elgg_load_css('elgg.theme');
    elgg_register_js('modernizr', '/mod/hypeThemeX/javascripts/vendor/custom.modernizr.js', 'head', 100);
    elgg_register_js('jquery', '/mod/hypeThemeX/javascripts/vendor/jquery-1.10.2.min.js', 'head', 125);
    elgg_register_js('jquery-migrate', '/mod/hypeThemeX/javascripts/vendor/jquery-migrate-1.2.1.min.js', 'head', 150);
    elgg_register_js('jquery-ui', '/mod/hypeThemeX/javascripts/vendor/jquery-ui-1.10.3.custom.min.js', 'head', 175);
    elgg_register_js('foundation', '/mod/hypeThemeX/javascripts/foundation/foundation.js', 'footer', 200);
    elgg_register_js('foundation.abide', '/mod/hypeThemeX/javascripts/foundation/foundation.abide.js', 'footer', 201);
    elgg_register_js('foundation.alerts', '/mod/hypeThemeX/javascripts/foundation/foundation.alerts.js', 'footer', 201);
    elgg_register_js('foundation.clearing', '/mod/hypeThemeX/javascripts/foundation/foundation.clearing.js', 'footer', 201);
    elgg_register_js('foundation.cookie', '/mod/hypeThemeX/javascripts/foundation/foundation.cookie.js', 'footer', 201);
    elgg_register_js('foundation.dropdown', '/mod/hypeThemeX/javascripts/foundation/foundation.dropdown.js', 'footer', 201);
    elgg_register_js('foundation.forms', '/mod/hypeThemeX/javascripts/foundation/foundation.forms.js', 'footer', 201);
    elgg_register_js('foundation.interchange', '/mod/hypeThemeX/javascripts/foundation/foundation.interchange.js', 'footer', 201);
    elgg_register_js('foundation.joyride', '/mod/hypeThemeX/javascripts/foundation/foundation.joyride.js', 'footer', 201);
    elgg_register_js('foundation.magellan', '/mod/hypeThemeX/javascripts/foundation/foundation.magellan.js', 'footer', 201);
    elgg_register_js('foundation.orbit', '/mod/hypeThemeX/javascripts/foundation/foundation.orbit.js', 'footer', 201);
    elgg_register_js('foundation.placeholder', '/mod/hypeThemeX/javascripts/foundation/foundation.placeholder.js', 'footer', 201);
    elgg_register_js('foundation.reveal', '/mod/hypeThemeX/javascripts/foundation/foundation.reveal.js', 'footer', 201);
    elgg_register_js('foundation.section', '/mod/hypeThemeX/javascripts/foundation/foundation.section.js', 'footer', 201);
    elgg_register_js('foundation.tooltips', '/mod/hypeThemeX/javascripts/foundation/foundation.tooltips.js', 'footer', 201);
    elgg_register_js('foundation.topbar', '/mod/hypeThemeX/javascripts/foundation/foundation.topbar.js', 'footer', 201);
    elgg_load_js('modernizr');
    elgg_load_js('jquery');
    // Foundation needs higher version of jquery than that in Elgg
    elgg_load_js('jquery-migrate');
    elgg_load_js('jquery-ui');
    elgg_load_js('foundation');
    // loads Foundation js
    elgg_extend_view('js/elgg', 'js/theme/init');
}
Example #18
0
File: start.php Project: elgg/elgg
function notifications_plugin_init()
{
    elgg_extend_view('elgg.css', 'notifications.css');
    elgg_register_page_handler('notifications', 'notifications_page_handler');
    elgg_register_plugin_hook_handler('register', 'menu:page', '_notifications_page_menu');
    // Unset the default notification settings
    elgg_unregister_plugin_hook_handler('usersettings:save', 'user', '_elgg_save_notification_user_settings');
    elgg_unextend_view('forms/account/settings', 'core/settings/account/notifications');
    // update notifications based on relationships changing
    elgg_register_event_handler('delete', 'relationship', 'notifications_relationship_remove');
    // update notifications when new friend or access collection membership
    elgg_register_event_handler('create', 'relationship', 'notifications_update_friend_notify');
    elgg_register_plugin_hook_handler('access:collections:add_user', 'collection', 'notifications_update_collection_notify');
    // register unit tests
    elgg_register_plugin_hook_handler('unit_test', 'system', 'notifications_register_tests');
}
Example #19
0
/**
 * Init admin_blog plugin.
 */
function init()
{
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', __NAMESPACE__ . '\\owner_block_menu');
    elgg_register_action('blog/save', elgg_get_config('pluginspath') . 'blog/actions/blog/save.php', 'admin');
    elgg_register_action('blog/auto_save_revision', elgg_get_config('pluginspath') . 'blog/actions/blog/auto_save_revision.php', 'admin');
    elgg_register_action('blog/delete', elgg_get_config('pluginspath') . 'blog/actions/blog/delete.php', 'admin');
    $group_blogs = (int) elgg_get_plugin_setting('group_blog', PLUGIN_ID);
    $widget_contexts = array('profile', 'dashboard', 'index');
    if (!$group_blogs) {
        elgg_unextend_view('groups/tool_latest', 'blog/group_module');
        remove_group_tool_option('blog');
    } else {
        $widget_contexts[] = 'group';
    }
    elgg_unregister_widget_type('blog');
    elgg_register_widget_type('blog', elgg_echo('blog'), elgg_echo('blog:widget:description'), $widget_contexts);
}
Example #20
0
function notifications_plugin_init()
{
    elgg_extend_view('css/elgg', 'notifications/css');
    elgg_register_page_handler('notifications', 'notifications_page_handler');
    elgg_register_event_handler('pagesetup', 'system', 'notifications_plugin_pagesetup');
    // Unset the default notification settings
    elgg_unregister_plugin_hook_handler('usersettings:save', 'user', 'notification_user_settings_save');
    elgg_unextend_view('forms/account/settings', 'core/settings/account/notifications');
    // update notifications based on relationships changing
    elgg_register_event_handler('delete', 'member', 'notifications_relationship_remove');
    elgg_register_event_handler('delete', 'friend', 'notifications_relationship_remove');
    // update notifications when new friend or access collection membership
    elgg_register_event_handler('create', 'friend', 'notifications_update_friend_notify');
    elgg_register_plugin_hook_handler('access:collections:add_user', 'collection', 'notifications_update_collection_notify');
    $actions_base = elgg_get_plugins_path() . 'notifications/actions';
    elgg_register_action("notificationsettings/save", "{$actions_base}/save.php");
    elgg_register_action("notificationsettings/groupsave", "{$actions_base}/groupsave.php");
}
Example #21
0
/**
 * Initialize the plugin
 * @return void
 */
function user_settings_init()
{
    elgg_unregister_page_handler('settings', '_elgg_user_settings_page_handler');
    elgg_register_page_handler('settings', 'user_settings_page_handler');
    elgg_unregister_event_handler('pagesetup', 'system', '_elgg_user_settings_menu_setup');
    if (!elgg_get_plugin_setting('show_language', 'user_settings', true)) {
        elgg_unregister_plugin_hook_handler('usersettings:save', 'user', '_elgg_set_user_language');
        elgg_unextend_view('forms/account/settings', 'core/settings/account/language');
    }
    if (elgg_is_active_plugin('notifications')) {
        elgg_register_plugin_hook_handler('route', 'notifications', 'user_settings_notifications_router');
    }
    elgg_register_plugin_hook_handler('route', 'profile', 'user_settings_profile_router');
    elgg_register_plugin_hook_handler('route', 'avatar', 'user_settings_avatar_router');
    elgg_unregister_event_handler('pagesetup', 'system', 'notifications_plugin_pagesetup');
    elgg_extend_view('elgg.css', 'elements/tables/notifications.css');
    elgg_register_action('notificationsettings/save', __DIR__ . '/actions/notificationsettings/save.php');
}
Example #22
0
/**
 * Initialize the theme
 *
 * @return void
 */
function theme_oirschot_init()
{
    elgg_register_css('font-awesome', 'mod/theme_oirschot/vendors/font-awesome-4.0.3/css/font-awesome.min.css');
    elgg_load_css('font-awesome');
    elgg_extend_view("js/elgg", "js/theme_oirschot");
    elgg_extend_view("css/elgg", "css/theme_oirschot");
    elgg_extend_view("page/layouts/widgets", "theme_oirschot/widgets_fix");
    elgg_register_js('jquery.flexslider', 'mod/theme_oirschot/vendors/jquery.flexslider/jquery.flexslider-min.js');
    elgg_load_js('jquery.flexslider');
    elgg_unextend_view("page/elements/header", "search/header");
    elgg_unextend_view("page/elements/owner_block/extend", "group_tools/owner_block");
    elgg_register_page_handler("theme_oirschot", "theme_oirschot_page_handler");
    elgg_register_widget_type("profile_owner_block", elgg_echo("theme_oirschot:widgets:profile_owner_block:title"), elgg_echo("theme_oirschot:widgets:profile_owner_block:description"), "profile");
    elgg_register_plugin_hook_handler("register", "menu:site", "theme_oirschot_register_site_menu_handler");
    elgg_register_plugin_hook_handler("prepare", "menu:owner_block", "theme_oirschot_prepare_owner_block_menu_handler");
    elgg_register_plugin_hook_handler("route", "groups", "theme_oirschot_groups_route_handler");
    elgg_register_admin_menu_item("configure", "theme_oirschot", "appearance");
    elgg_register_action("theme_oirschot/slider_upload", dirname(__FILE__) . "/actions/slider_upload.php", "admin");
}
Example #23
0
function twitter_bootstrap_init()
{
    //include custom css for this theme
    elgg_extend_view('css/elgg', 'twitter_bootstrap/css');
    //custom js
    $custom_js = 'mod/twitter_bootstrap/views/default/twitter_bootstrap/custom.js';
    elgg_register_js('custom_js', $custom_js);
    //we use google jquery instead of Elgg's as it is more up-to-date and required for bootstrap
    $google_jquery = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
    elgg_register_js('google_jquery', $google_jquery, 'head', 10);
    //register bootstrap css and js
    $bootstrap_js = 'mod/twitter_bootstrap/vendors/bootstrap/js/bootstrap.min.js';
    elgg_register_js('bootstrap', $bootstrap_js, 'footer');
    $bootstrap_css = 'mod/twitter_bootstrap/vendors/bootstrap/css/bootstrap.min.css';
    elgg_register_css('bootstrap_css', $bootstrap_css, 10);
    $bootstrap_css_resp = 'mod/twitter_bootstrap/vendors/bootstrap/css/bootstrap-responsive.min.css';
    elgg_register_css('bootstrap_css_resp', $bootstrap_css_resp, 10);
    //unregister internal jquery as we will link to Google to get the latest library, required for bootstrap
    elgg_unregister_js('jquery');
    //elgg_unregister_js('jquery-ui');
    //load ibraries @todo not sure if this is the best place to do this?
    elgg_load_js('google_jquery');
    $get_context = elgg_get_context();
    //we don't want bootstrap loading when in the admin area, not sure this is the best way to do this
    //@todo find out the best approach - perhaps this should be in the pagesetup_handler?
    if ($get_context != 'admin') {
        elgg_load_js('bootstrap');
        elgg_load_js('custom_js');
        elgg_load_css('bootstrap_css');
        elgg_load_css('bootstrap_css_resp');
    }
    /**
     * Custom menus
     **/
    elgg_register_event_handler('pagesetup', 'system', 'bootstrap_theme_pagesetup_handler', 1000);
    //Elgg only includes the search bar in the header by default,
    //but I am not sure where the best location is yet - header, topbar or... ?
    if (elgg_is_active_plugin('search')) {
        //elgg_extend_view('page/elements/topbar', 'search/search_box');
        elgg_unextend_view('page/elements/header', 'search/search_box');
    }
}
Example #24
0
function pleio_template_selector_init()
{
    // set colors for template
    pleio_template_selector_set_colors();
    // extend css
    elgg_extend_view("css/admin", "css/pleio_template_selector/admin");
    elgg_extend_view("css/elgg", "css/pleio_template_selector/custom", 9999);
    // place it at the end so it can easily override other css
    // extend js
    elgg_extend_view("js/admin", "js/pleio_template_selector/admin");
    // register pagehandler for nice URL's
    elgg_register_page_handler("template_selector", "pleio_template_selector_page_handler");
    elgg_register_plugin_hook_handler("public_pages", "walled_garden", "pleio_template_selector_walled_garden_hook");
    elgg_register_admin_menu_item("configure", "template", "appearance", 50);
    // register libraries
    elgg_register_js("colorpicker", elgg_get_site_url() . "mod/pleio_template_selector/vendors/colorpicker/js/colorpicker.js");
    elgg_register_css("colorpicker", elgg_get_site_url() . "mod/pleio_template_selector/vendors/colorpicker/css/colorpicker.css");
    // theme header will control display of search
    elgg_unextend_view('page/elements/header', 'search/header');
}
Example #25
0
function au_landing_init()
{
    elgg_extend_view('css/elgg', 'css/au_landing');
    elgg_extend_view('page/elements/footer', 'au_landing/messages_count');
    elgg_extend_view('groups/edit', 'au_landing/gcl');
    // fix title link in event_calendar widget
    elgg_register_plugin_hook_handler('widget_url', 'widget_manager', 'au_landing_widget_manager_titles');
    // add group acls back as access options
    // also make some logical fixes for invisible groups
    elgg_register_plugin_hook_handler('access:collections:write', 'all', 'au_landing_group_acls', 1000);
    // prevent users from seeing online users
    elgg_register_plugin_hook_handler('members:config', 'tabs', 'au_landing_remove_online_tab', 1000);
    elgg_register_plugin_hook_handler('route', 'members', 'au_landing_remove_online_users', 1000);
    // change the page menu
    elgg_register_plugin_hook_handler('register', 'menu:page', 'au_landing_pagemenu', 1000);
    // add in missing group forum topics widget
    elgg_register_widget_type("index_groups", elgg_echo("widget_manager:widgets:index_groups:name"), elgg_echo("widget_manager:widgets:index_groups:description"), array("index"), true);
    // new notification handlers to append subscription modification info
    elgg_register_plugin_hook_handler('email', 'system', 'au_landing_email_append', 0);
    // modify some routing
    elgg_register_plugin_hook_handler('route', 'all', 'au_landing_router');
    //get rid of ugly embed code on side bars from gallielggembed
    elgg_unextend_view('page/elements/sidebar', 'galliElggEmbed/share');
    //handle staff-only options
    elgg_register_event_handler('pagesetup', 'system', 'au_staff_options');
    // only allow AU staff to make groups staff-only
    $user = elgg_get_logged_in_user_entity();
    if (is_au_staff_member($user)) {
        add_group_tool_option("staff_only", elgg_echo("AU staff-only group"), false);
    } else {
        elgg_register_plugin_hook_handler('action', 'groups/join', 'au_landing_prevent_group_join', 9999);
    }
    // move the mail members button to the top
    elgg_register_plugin_hook_handler('register', 'menu:title', 'au_landing_title_menu');
    // set group widgets to display by default (if group is closed)
    elgg_register_event_handler('create', 'group', 'au_landing_group_create');
    // send notification when someone other than the owner edits a page
    elgg_register_event_handler('update', 'object', 'au_landing_page_update');
    // make sure users have email addresses
    elgg_register_event_handler('login:after', 'user', 'au_landing_user_login');
}
Example #26
0
/**
 * Initialize the plugin
 */
function customizations_init()
{
    elgg_extend_view('css/elgg', 'customizations/css');
    if (function_exists("elgg_ws_unexpose_function")) {
        elgg_ws_unexpose_function('auth.gettoken');
    }
    // filter certain items from going to the river
    elgg_register_plugin_hook_handler('creating', 'river', 'customizations_filter_river');
    elgg_register_event_handler('delete', 'user', 'customizations_purge_messages');
    // convert messageboard to private message interface
    elgg_register_widget_type('messageboard', elgg_echo("customizations:widget:pm"), elgg_echo("customizations:widget:pm:desc"), array("profile"));
    elgg_register_plugin_hook_handler('forward', 'system', 'customizations_pm_forward');
    // do not want the pages link in hover menu
    elgg_unextend_view('profile/menu/links', 'pages/menu');
    // button for flushing apc cache
    elgg_register_plugin_hook_handler('register', 'menu:admin_control_panel', 'customizations_control_panel');
    // shut googlebot out from search
    elgg_register_plugin_hook_handler('route', 'search', 'customizations_stop_googlebot');
    $action_path = elgg_get_plugins_path() . "community_customizations/actions";
    elgg_register_action('comments/edit', "{$action_path}/edit_comment.php", 'admin');
    elgg_register_action('admin/flush_apc', "{$action_path}/admin/flush_apc.php", 'admin');
    elgg_register_action('comments/disable', "{$action_path}/comments_disable.php", 'admin');
}
Example #27
0
function theme_ffd_init()
{
    elgg_unextend_view("page/elements/header", "search/header");
    elgg_extend_view("css/elgg", "css/theme_ffd/site");
    elgg_extend_view('js/elgg', 'theme_ffd/js/site');
    // Replace the default index page
    elgg_register_plugin_hook_handler("index", "system", "theme_ffd_index");
    elgg_register_plugin_hook_handler("route", "questions", "theme_ffd_route_questions_hook");
    elgg_register_plugin_hook_handler("register", "menu:filter", "theme_ffd_category_filter_menu_hook_handler");
    elgg_register_plugin_hook_handler("register", "menu:ffd_questions_alt", "theme_ffd_questions_alt_menu_hook_handler");
    elgg_register_plugin_hook_handler("register", "menu:ffd_questions_body", "theme_ffd_questions_body_menu_hook_handler");
    elgg_register_plugin_hook_handler("register", "menu:entity", "theme_ffd_entity_hook");
    // pagehandlers
    elgg_register_page_handler("profile", "theme_ffd_profile_page_handler");
    elgg_register_page_handler("cafe", "theme_ffd_cafe_page_handler");
    elgg_register_page_handler("login", "theme_ffd_index");
    // actions
    $actions_base = dirname(__FILE__) . "/actions/cafe";
    elgg_register_action("cafe/save", "{$actions_base}/save.php");
    elgg_register_action("cafe/delete", "{$actions_base}/delete.php");
    // register objects
    elgg_register_menu_item("site", array("name" => 'cafe', "text" => elgg_echo('cafe'), "href" => 'cafe'));
    elgg_register_entity_type("object", "cafe");
    elgg_register_entity_url_handler("object", "cafe", "theme_ffd_cafe_url");
    elgg_register_plugin_hook_handler('register', 'menu:annotation', 'theme_ffd_annotation_menu_setup');
    elgg_register_plugin_hook_handler("register", 'menu:filter', 'theme_ffd_cafe_filter_menu_handler');
    //add a widget
    elgg_register_widget_type("ffd_stats", elgg_echo("ffd_theme:widgets:ffd_stats:title"), elgg_echo("ffd_theme:widgets:ffd_stats:description"), "index");
    elgg_register_widget_type("recent_questions", elgg_echo("ffd_theme:widgets:recent_questions:title"), elgg_echo("ffd_theme:widgets:recent_questions:description"), "index");
    elgg_register_widget_type("recent_cafe", elgg_echo("ffd_theme:widgets:recent_cafe:title"), elgg_echo("ffd_theme:widgets:recent_cafe:description"), "index");
    elgg_register_widget_type("ask_question", elgg_echo("ffd_theme:widgets:ask_question:title"), elgg_echo("ffd_theme:widgets:ask_question:description"), "index");
    elgg_register_widget_type("ffd_datetime", elgg_echo("date:month:" . date("m"), array(date("j"))), elgg_echo("ffd_theme:widgets:ffd_datetime:description"), "index");
    elgg_register_widget_type("ffd_videos", elgg_echo("ffd_theme:widgets:ffd_videos:title"), elgg_echo("ffd_theme:widgets:ffd_videos:description"), "index");
    // custom translations
    add_translation(get_current_language(), array("questions:add" => elgg_echo("theme_ffd:questions:add")));
}
Example #28
0
    elgg_register_event_handler('delete', 'user', function ($event, $type, $user) {
        // make sure we delete them all
        $entity_disable_override = access_get_show_hidden_status();
        access_show_hidden_entities(true);
        $messages = elgg_get_entities_from_metadata(array('type' => 'object', 'subtype' => 'messages', 'metadata_name' => 'fromId', 'metadata_value' => $user->getGUID(), 'limit' => 0));
        if ($messages) {
            foreach ($messages as $e) {
                $e->delete();
            }
        }
        access_show_hidden_entities($entity_disable_override);
    });
    // convert messageboard to private message interface
    elgg_register_widget_type('messageboard', elgg_echo("customizations:widget:pm"), elgg_echo("customizations:widget:pm:desc"), array("profile"));
    // Forward to referrer if posting PM from a widget
    elgg_register_plugin_hook_handler('forward', 'system', function () {
        if (get_input('pm_widget') == true) {
            return $_SERVER['HTTP_REFERER'];
        }
    });
    // do not want the pages link in hover menu
    elgg_unextend_view('profile/menu/links', 'pages/menu');
    // button for flushing apc cache
    elgg_register_plugin_hook_handler('register', 'menu:admin_control_panel', function ($hook, $type, $menu, $params) {
        $options = array('name' => 'flush_apc', 'text' => elgg_echo('apc:flush'), 'href' => 'action/admin/flush_apc', 'is_action' => true, 'link_class' => 'elgg-button elgg-button-action');
        $menu[] = ElggMenuItem::factory($options);
        return $menu;
    });
    $actions = __DIR__ . "/actions";
    elgg_register_action('admin/flush_apc', "{$actions}/admin/flush_apc.php", 'admin');
});
Example #29
0
function minimal_hide_search_init()
{
    if (!elgg_is_logged_in()) {
        elgg_unextend_view('page/elements/header', 'search/header');
    }
}
Example #30
0
/**
 * @package Deyan
 * @author Angel Gabriel
 * @web http://angelgabriel.tk
 * @mail angel.wrt@gmail.com
 **/  

function deyan_init() {

    //Register & Load our libraries
	$lib_path = elgg_get_plugins_path() . 'deyan/lib/';
	elgg_register_library('deyan', $lib_path . 'deyan.php');
	elgg_register_library('iconslib', $lib_path . 'icons.php');
	elgg_register_library('panel', $lib_path . 'panel.php');
	elgg_register_library('themes', $lib_path . 'themes.php');
	
	elgg_load_library('deyan'); 
	elgg_load_library('iconslib'); 
	elgg_load_library('panel'); 
	elgg_load_library('themes'); 
	
    //Register our hook for the index
	elgg_register_plugin_hook_handler('index', 'system', 'deyan_index_handler');

    //Register actions
	$action_path = elgg_get_plugins_path() . 'deyan/actions/deyan';
	elgg_register_action("deyan/xor_selector", "$action_path/xor_selector.php");
	elgg_register_action("deyan/background", "$action_path/background.php");
	elgg_register_action("deyan/panel", "$action_path/panel.php");
	elgg_register_action("deyan/iconadmin", "$action_path/iconadmin.php");
	
        
    //page handlers
	elgg_register_page_handler('dashboard', 'deyan_dashboard_handler'); 
	elgg_register_page_handler('personalize', 'deyan_personalize_handler');
	elgg_register_page_handler('register', 'deyan_register_handler');
	elgg_register_page_handler('login', 'deyan_login_handler');
	elgg_register_page_handler('forgotpassword', 'deyan_forgotpassword_handler');
	
    //render admin section
	deyan_admin_init();

	
    //we don't want search box in the header
	elgg_unextend_view('page/elements/header', 'search/search_box');
    //also the search css is included on theme's panel css
	elgg_unextend_view('css/elgg', 'search/css');
    
    //Page menus
    $user = elgg_get_logged_in_user_entity();
    
		// Personalize > appearance
		elgg_register_menu_item('page', array(
			'name' => 'personalize_appearance',
			'text' => elgg_echo('deyan:appearance'),
			'href' => "personalize/appearance/{$user->username}",
			'context' => 'personalize',
		));
		
		// Personalize > theme
		if(elgg_get_plugin_setting('theme_selector', 'deyan') == 'yes') {
		elgg_register_menu_item('page', array(
			'name' => 'personalize_theme',
			'text' => elgg_echo('deyan:theme'),
			'href' => "personalize/theme/{$user->username}",
			'context' => 'personalize',
		));
		}
		// Personalize > icons
		if(elgg_get_plugin_setting('icon_selector', 'deyan') == 'yes') {
		elgg_register_menu_item('page', array(
			'name' => 'personalize_icons',
			'text' => elgg_echo('deyan:icons'),
			'href' => "personalize/icons/{$user->username}",
			'context' => 'personalize',
		));
		}
		// personalize > panel
		elgg_register_menu_item('page', array(
			'name' => 'personalize_panel',
			'text' => elgg_echo('deyan:panel'),
			'href' => "personalize/panel/{$user->username}",
			'context' => 'personalize',
		));


    // Register our panel modules. Also we register the user & start menus to be showed on the modules 
    // user_menu & start_menu.
    
    if (elgg_is_active_plugin('search')) {
			deyan_register_panel_mod('search', 'right', 1000);
		}
		
    if(elgg_is_logged_in()){
		
		
		
		// Mods for the left side of the panel
		
		deyan_register_panel_mod('dashboard', 'left', 600);
		deyan_register_panel_mod('start_menu');
			//Register the start menu
			elgg_register_menu_item('start', array(	
				'name' => 'activity',
				'href' => "activity",
				'text' => deyan_view_icon('world') . elgg_echo('activity'),
				'priority' => 10,
			));
			if (elgg_is_active_plugin('blog')) {
			elgg_register_menu_item('start', array(	
				'name' => 'blog',
				'href' => "/blog/owner/$user->username",
				'text' => deyan_view_icon('notepad') . elgg_echo('blog'),
				'priority' => 70,
			));
			}
			
			if (elgg_is_active_plugin('pages')) {
				elgg_register_menu_item('start', array(	
					'name' => 'pages',
					'href' => "/pages/owner/$user->username",
					'text' => deyan_view_icon('file') . elgg_echo('pages'),
					'priority' => 20,
				));
			}
			
			if (elgg_is_active_plugin('groups')) {
				elgg_register_menu_item('start', array(	
					'name' => 'groups',
					'href' => "/groups/member/$user->username",
					'text' => deyan_view_icon('friends') . elgg_echo('groups'),
					'priority' => 30,
				));
			}
			
			if (elgg_is_active_plugin('bookmarks')) {
				elgg_register_menu_item('start', array(	
					'name' => 'bookmarks',
					'href' => "/bookmarks/owner/$user->username",
					'text' => deyan_view_icon('bookmarks') . elgg_echo('bookmarks'),
					'priority' => 40,
				));
			}
			
			if (elgg_is_active_plugin('file')) {
				elgg_register_menu_item('start', array(	
					'name' => 'file',
					'href' => "/file/owner/$user->username",
					'text' => deyan_view_icon('hard-drive') . elgg_echo('files'),
					'priority' => 50,
				));
			}
			
			if (elgg_is_active_plugin('thewire')) {
				elgg_register_menu_item('start', array(	
					'name' => 'thewire',
					'href' => "/thewire/friends/$user->username",
					'text' => deyan_view_icon('wireless') . elgg_echo('thewire'),
					'priority' => 60,
				));
			}
				
		
		
		// Mods for the right side of the panel
		
		deyan_register_panel_mod('friends', 'right', 800);
		
		if (elgg_is_active_plugin('messages')) {
			deyan_register_panel_mod('messages', 'right', 600);
		}

		deyan_register_panel_mod('user_menu', 'right', 400);			
			//Register the user menu
			elgg_register_menu_item('user', array(
				'name' => 'usersettings',
				'href' => "settings/user/" . $user->username,
				'text' => deyan_view_icon('settings', 16) . elgg_echo('settings'),
				'priority' => 800,
			));

			elgg_register_menu_item('user', array(
				'name' => 'logout',
				'href' => "action/logout",
				'text' => deyan_view_icon('logout', 16) . elgg_echo('logout'),
				'is_action' => TRUE,
				'priority' => 1000,
			));
			
			elgg_register_menu_item('user', array(
				'name' => 'profile',
				'href' =>  $user->getURL(),
				'text' => deyan_view_icon('user', 16) . elgg_echo('profile'),
				'priority' => 200,
			));
			
			elgg_register_menu_item('user', array(
				'name' => 'personalize',
				'href' =>  "personalize/appearance/$user->username",
				'text' => deyan_view_icon('paint', 16) . elgg_echo('deyan:personalize'),
				'priority' => 400,
			));
			
			if (elgg_is_admin_logged_in()) {
			elgg_register_menu_item('user', array(
				'name' => 'administration',
				'href' => 'admin',
				'text' => deyan_view_icon('gear', 16) . elgg_echo('admin'),
				'priority' => 600,
			));
			}
		
	}
	else{
	// Mods for non-logged in people
		deyan_register_panel_mod('login_menu', 'right');
		deyan_register_panel_mod('register', 'right');
	}
	
	
    // Register default theme <glass>
	deyan_register_theme('glass');
	
    // Register the default icon library
	deyan_register_iconlib('gray');
	
    
}