function vazco_avatar_init()
{
    global $CONFIG;
    define('VAZCO_AVATAR_PATH', 'vazco_avatars');
    //set admin user ID to 2 - the default admin. TODO: do it cleaner.
    // Since we use ElggFile here, the ID has to belong to the user that is in the system all the time.
    define('VAZCO_AVATAR_ADMIN', 2);
    extend_view('profile/editicon', 'vazco_avatar/select', 601);
    extend_view('css', 'vazco_avatar/css', 601);
    register_action("vazco_avatar/upload", false, $CONFIG->pluginspath . "vazco_avatar/actions/upload.php");
    register_action("vazco_avatar/select", false, $CONFIG->pluginspath . "vazco_avatar/actions/select.php");
    register_action("vazco_avatar/delete", false, $CONFIG->pluginspath . "vazco_avatar/actions/delete.php");
    register_plugin_hook('action', 'profile/cropicon', 'vazco_avatar_cropicon', 600);
    if (isadminloggedin() && get_context() == 'admin' || get_context() == 'vazco_avatar') {
        add_submenu_item(elgg_echo('vazco_avatar:menu'), $CONFIG->wwwroot . 'pg/vazco_avatar/edit');
    }
    if (isadminloggedin() && get_context() == 'vazco_avatar') {
        add_submenu_item(elgg_echo('avatars:upload'), $CONFIG->wwwroot . 'pg/vazco_avatar/upload');
    }
    if (isloggedin()) {
        //update current user's avatar for topbar and edit icon page
        setUserIcon($_SESSION['user'], 'topbar');
        setUserIcon($_SESSION['user'], 'medium');
    }
}
Example #2
0
function dreamfish_admin_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('dreamfish_admin:admin_title'), $CONFIG->wwwroot . 'mod/dreamfish_admin/admintasks.php');
    }
}
Example #3
0
/**
 * Adding the reported content to the admin menu
 *
 */
function reportedcontent_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('reportedcontent'), $CONFIG->wwwroot . 'pg/reportedcontent/');
    }
}
/**
 * Messages initialisation
 *
 * These parameters are required for the event API, but we won't use them:
 * 
 * @param unknown_type $event
 * @param unknown_type $object_type
 * @param unknown_type $object
 */
function messages_init()
{
    // Load system configuration
    global $CONFIG;
    //add submenu options
    if (get_context() == "messages") {
        add_submenu_item(elgg_echo('messages:compose'), $CONFIG->wwwroot . "mod/messages/send.php");
        add_submenu_item(elgg_echo('messages:inbox'), $CONFIG->wwwroot . "pg/messages/" . $_SESSION['user']->username);
        add_submenu_item(elgg_echo('messages:sentmessages'), $CONFIG->wwwroot . "mod/messages/sent.php");
    }
    // Extend system CSS with our own styles, which are defined in the shouts/css view
    extend_view('css', 'messages/css');
    // Extend the elgg topbar
    extend_view('elgg_topbar/extend', 'messages/topbar');
    // Register a page handler, so we can have nice URLs
    register_page_handler('messages', 'messages_page_handler');
    // Register a URL handler for shouts posts
    register_entity_url_handler('messages_url', 'object', 'messages');
    // Extend hover-over and profile menu
    extend_view('profile/menu/links', 'messages/menu');
    // Register a notification handler for site messages
    register_notification_handler("site", "messages_site_notify_handler");
    register_plugin_hook('notify:entity:message', 'object', 'messages_notification_msg');
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'messages', elgg_echo('messages:new'));
    }
    // Shares widget
    //  add_widget_type('messages',elgg_echo("messages:recent"),elgg_echo("messages:widget:description"));
    // Override metadata permissions
    register_plugin_hook('permissions_check:metadata', 'object', 'messages_can_edit_metadata');
}
function ckeditor_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('ckeditor:admin_title'), $CONFIG->wwwroot . 'mod/CKEditor/admin.php');
    }
}
Example #6
0
/**
 * Sets up submenus for the file system.  Triggered on pagesetup.
 *
 */
function file_submenus()
{
    global $CONFIG;
    $page_owner = page_owner_entity();
    // Group submenu option
    if ($page_owner instanceof ElggGroup && get_context() == "groups") {
        if ($page_owner->files_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("file:group"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
        }
    }
    // General submenu options
    if (get_context() == "file") {
        if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
            add_submenu_item(sprintf(elgg_echo("file:yours"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
            add_submenu_item(sprintf(elgg_echo('file:yours:friends'), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/friends/");
        } else {
            if (page_owner()) {
                add_submenu_item(sprintf(elgg_echo("file:user"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
                if ($page_owner instanceof ElggUser) {
                    // This one's for users, not groups
                    add_submenu_item(sprintf(elgg_echo('file:friends'), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/friends/");
                }
            }
        }
        add_submenu_item(elgg_echo('file:all'), $CONFIG->wwwroot . "mod/file/world.php");
        if (can_write_to_container($_SESSION['guid'], page_owner())) {
            add_submenu_item(elgg_echo('file:upload'), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/new/");
        }
    }
}
Example #7
0
function collaboration_pagesetup()
{
    global $CONFIG;
    if (get_context() == 'admin' && isadminloggedin()) {
        add_submenu_item('Manage external sites', $CONFIG->wwwroot . 'pg/collaboration/admin');
    }
}
Example #8
0
function removewidget_pagesetup()
{
    global $CONFIG;
    if (get_context() == 'admin' && isadminloggedin()) {
        add_submenu_item(elgg_echo('remove_widgets'), $CONFIG->wwwroot . 'pg/removewidget/');
    }
}
/**
 * Adding the log browser to the admin menu
 *
 */
function logbrowser_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('logbrowser'), $CONFIG->wwwroot . 'pg/logbrowser/');
    }
}
Example #10
0
/**
 * Sets up submenus. Triggered on pagesetup.
 *
 */
function plugins_add_submenus()
{
    global $CONFIG;
    $plugins_base = "{$CONFIG->wwwroot}pg/plugins";
    if (get_context() == 'admin') {
        $title = elgg_echo("plugins:admin:menu");
        add_submenu_item($title, "{$plugins_base}/admin/");
        return;
    }
    if (get_context() != "plugins") {
        return;
    }
    $page_owner = page_owner_entity();
    if (isloggedin() && page_owner() == get_loggedin_userid()) {
        $title = sprintf(elgg_echo("plugins:yours"), elgg_echo('plugins:types:'));
        add_submenu_item($title, "{$plugins_base}/developer/{$page_owner->username}");
        //add_submenu_item(sprintf(elgg_echo('plugins:yours:friends'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/plugins/". $page_owner->username . "/friends/");
    } else {
        if (page_owner()) {
            $title = sprintf(elgg_echo("plugins:user"), $page_owner->name, elgg_echo('plugins:types:'));
            add_submenu_item($title, "{$plugins_base}/developer/{$page_owner->username}");
            //if ($page_owner instanceof ElggUser) // This one's for users, not groups
            //add_submenu_item(sprintf(elgg_echo('plugins:friends'),$page_owner->name), $CONFIG->wwwroot . "pg/plugins/". $page_owner->username . "/friends/");
        }
    }
    add_submenu_item(elgg_echo('plugins:all'), "{$plugins_base}/all/");
    // add upload link when viewing own plugin page
    if (get_loggedin_userid() == page_owner()) {
        add_submenu_item(elgg_echo('plugins:upload'), "{$plugins_base}/new/project/{$page_owner->username}");
    }
}
Example #11
0
function cclite_pagesetup()
{
    global $CONFIG;
    //add submenu options
    if (get_context() == "cclite") {
    }
}
Example #12
0
/**
 * Set up menu items
 *
 */
function categories_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('categories:settings'), $CONFIG->wwwroot . 'mod/categories/settings.php');
    }
}
Example #13
0
/**
 * Add admin menu item
 */
function elgg_dev_tools_pagesetup()
{
    if (get_context() == 'admin') {
        global $CONFIG;
        add_submenu_item(elgg_echo('elgg_dev_tools:adminlink'), $CONFIG->wwwroot . 'pg/elgg_dev_tools/');
    }
}
Example #14
0
/**
 * Set up menu items
 */
function theme_editable_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('theme_editable:settings'), $CONFIG->wwwroot . 'mod/theme_editable/settings.php');
    }
}
function vazco_topbar_submenus()
{
    global $CONFIG;
    if (isadminloggedin() && get_context() == 'admin' || get_context() == 'vazco_topbar') {
        add_submenu_item(elgg_echo('vazco_topbar:menu:short'), $CONFIG->wwwroot . 'mod/vazco_topbar/edit.php');
    }
}
Example #16
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');
    }
}
/**
 * Adding the diagnostics to the admin menu
 *
 */
function diagnostics_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('diagnostics'), $CONFIG->wwwroot . 'pg/diagnostics/');
    }
}
function bookmarks_pagesetup()
{
    global $CONFIG;
    // Set up menu for logged in users
    //add submenu options
    if (get_context() == "bookmarks") {
        if (isloggedin()) {
            add_submenu_item(elgg_echo('bookmarks:inbox'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/inbox");
            if (page_owner()) {
                $page_owner = page_owner_entity();
                add_submenu_item(sprintf(elgg_echo('bookmarks:read'), $page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . "/items");
            }
            if (!$page_owner instanceof ElggGroup) {
                add_submenu_item(elgg_echo('bookmarks:friends'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/friends");
            }
        }
        //if(!$page_owner instanceof ElggGroup)
        //	add_submenu_item(elgg_echo('bookmarks:everyone'),$CONFIG->wwwroot."mod/bookmarks/everyone.php");
        // Bookmarklet
        if (isloggedin() && page_owner() && can_write_to_container(0, page_owner())) {
            $page_owner = page_owner_entity();
            $bmtext = elgg_echo('bookmarks:bookmarklet');
            if ($page_owner instanceof ElggGroup) {
                $bmtext = elgg_echo('bookmarks:bookmarklet:group');
            }
            add_submenu_item($bmtext, $CONFIG->wwwroot . "pg/bookmarks/{$page_owner->username}/bookmarklet");
        }
    }
    $page_owner = page_owner_entity();
    if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
        if ($page_owner->bookmarks_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("bookmarks:group"), $page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . '/items');
        }
    }
}
Example #19
0
function activityAndPerformanceDashboard_pagesetup()
{
    global $CONFIG;
    //NOTE Must add submenu item to be able to call getData.php!
    if (get_context() == 'dashboard') {
        add_submenu_item('ActivityAndPerformanceDashboard', $CONFIG->url . 'pg/activityAndPerformanceDashboard');
    }
}
Example #20
0
/**
 * Elgg invite page
 * 
 * @package ElggFile
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2009
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @link http://elgg.org/
 */
function invitefriends_pagesetup()
{
    // Menu options
    global $CONFIG;
    if (get_context() == "friends" || get_context() == "friendsof" || get_context() == "collections") {
        add_submenu_item(elgg_echo('friends:invite'), $CONFIG->wwwroot . "mod/invitefriends/", 'invite');
    }
}
Example #21
0
function sw_admin_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('sw:title'), $CONFIG->wwwroot . 'pg/sticky_widgets/admin/edit.php', "s");
        // This will allow editing of default settings of sticky widgets
        //		add_submenu_item(elgg_echo('sw:title:defaults'), $CONFIG->wwwroot . 'pg/sticky_widgets/admin/defaults.php',"s");
    }
}
/**
 * Notification settings page setup function
 *
 */
function notifications_plugin_pagesetup()
{
    global $CONFIG;
    if (get_context() == 'settings') {
        add_submenu_item(elgg_echo('notifications:subscriptions:changesettings'), $CONFIG->wwwroot . "mod/notifications/");
        if (is_plugin_enabled('groups')) {
            add_submenu_item(elgg_echo('notifications:subscriptions:changesettings:groups'), $CONFIG->wwwroot . "mod/notifications/groups.php");
        }
    }
}
function admin_pagesetup()
{
    if (get_context() == 'admin') {
        global $CONFIG;
        add_submenu_item(elgg_echo('admin:statistics'), $CONFIG->wwwroot . 'pg/admin/statistics/');
        add_submenu_item(elgg_echo('admin:site'), $CONFIG->wwwroot . 'pg/admin/site/');
        add_submenu_item(elgg_echo('admin:user'), $CONFIG->wwwroot . 'pg/admin/user/');
        add_submenu_item(elgg_echo('admin:plugins'), $CONFIG->wwwroot . 'pg/admin/plugins/');
    }
}
function flexprofile_pagesetup()
{
    global $CONFIG;
    if (get_context() == 'profile') {
        $form = flexprofile_get_profile_form();
        if (!$form->profile_format || $form->profile_format == 'default') {
            extend_view("profile/menu/actions", "flexprofile/menu/actions");
        }
    }
}
Example #25
0
function beechat_pagesetup()
{
    global $CONFIG;
    if (get_context() == 'settings' && isloggedin()) {
        if (get_loggedin_user()->chatenabled) {
            add_submenu_item(elgg_echo('beechat:disablechat'), $CONFIG->wwwroot . "mod/beechat/disablechat.php");
        } else {
            add_submenu_item(elgg_echo('beechat:enablechat'), $CONFIG->wwwroot . "mod/beechat/enablechat.php");
        }
    }
}
Example #26
0
/**
 * Sets up submenus for the file system.  Triggered on pagesetup.
 *
 */
function file_submenus()
{
    global $CONFIG;
    $page_owner = page_owner_entity();
    // Group submenu option
    if ($page_owner instanceof ElggGroup && get_context() == "groups") {
        if ($page_owner->files_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("file:group"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
        }
    }
}
function plugin_installer_pagesetup()
{
    global $CONFIG;
    if (isadminloggedin()) {
        if (get_context() == "admin") {
            add_submenu_item(elgg_echo("plugin_installer:title"), $CONFIG->wwwroot . "mod/plugin_installer/index.php");
            // fast tool admin
            extend_view("admin/plugins", "plugin_installer/plugin_admin", 400);
        }
    }
}
function usersettings_pagesetup()
{
    // Get config
    global $CONFIG;
    // Menu options
    if (get_context() == "settings") {
        $user = get_loggedin_user();
        add_submenu_item(elgg_echo('usersettings:user:opt:linktext'), $CONFIG->wwwroot . "pg/settings/user/{$user->username}/");
        add_submenu_item(elgg_echo('usersettings:plugins:opt:linktext'), $CONFIG->wwwroot . "pg/settings/plugins/{$user->username}/");
        add_submenu_item(elgg_echo('usersettings:statistics:opt:linktext'), $CONFIG->wwwroot . "pg/settings/statistics/{$user->username}/");
    }
}
function thewire_pagesetup()
{
    global $CONFIG;
    //add submenu options
    if (get_context() == "thewire") {
        if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
            add_submenu_item(elgg_echo('thewire:read'), $CONFIG->wwwroot . "pg/thewire/" . $_SESSION['user']->username);
            add_submenu_item(elgg_echo('thewire:everyone'), $CONFIG->wwwroot . "mod/thewire/everyone.php");
            //add_submenu_item(elgg_echo('thewire:add'),$CONFIG->wwwroot."mod/thewire/add.php");
        }
    }
}
Example #30
0
function simplepiegroupplugin_submenus()
{
    global $CONFIG;
    #Uncomment to add to user profile
    #extend_view('profile/menu/actions', 'simplepiegroupplugin/menu');
    if (get_context() == "groups") {
        $page_owner = page_owner_entity();
        # TODO Get Translation to work
        #add_submenu_item(elgg_echo('simplepiegroupplugin:addgroupfeed'), $CONFIG->wwwroot . "mod/simplepiegroupplugin/addfeed.php");
        add_submenu_item(elgg_echo('Add RSS Feed'), $CONFIG->wwwroot . "mod/simplepiegroupplugin/addfeed.php?id=" . $page_owner->getGUID());
        add_submenu_item(elgg_echo('View Feeds'), $CONFIG->wwwroot . "mod/simplepiegroupplugin/allfeeds.php?id=" . $page_owner->getGUID());
    }
}