Exemplo n.º 1
0
/**
 * Start the site pages plugin.
 */
function sitepages_init()
{
    require_once dirname(__FILE__) . '/sitepages_functions.php';
    global $CONFIG;
    // register our subtype
    run_function_once('sitepages_runonce');
    // Register a page handler, so we can have nice URLs
    register_page_handler('sitepages', 'sitepages_page_handler');
    // Register a URL handler for external pages
    register_entity_url_handler('sitepages_url', 'object', 'sitepages');
    elgg_extend_view('footer/links', 'sitepages/footer_menu');
    elgg_extend_view('metatags', 'sitepages/metatags');
    // Replace the default index page if user has requested
    if (get_plugin_setting('ownfrontpage', 'sitepages') == 'yes') {
        register_plugin_hook('index', 'system', 'sitepages_custom_index');
    }
    // parse views for keywords
    register_plugin_hook('display', 'view', 'sitepages_parse_view');
    // register the views we want to parse for the keyword replacement
    // right now this is just the custom front page, but we can
    // expand it to the other pages later.
    $CONFIG->sitepages_parse_views = array('sitepages/custom_frontpage');
    // an example of how to register and respond to the get_keywords trigger
    register_plugin_hook('get_keywords', 'sitepages', 'sitepages_keyword_hook');
    // grab the list of keywords and their views from plugins
    if ($keywords = trigger_plugin_hook('get_keywords', 'sitepages', NULL, array())) {
        $CONFIG->sitepages_keywords = $keywords;
    }
    register_action("sitepages/add", FALSE, $CONFIG->pluginspath . "sitepages/actions/add.php");
    register_action("sitepages/addfront", FALSE, $CONFIG->pluginspath . "sitepages/actions/addfront.php");
    register_action("sitepages/addmeta", FALSE, $CONFIG->pluginspath . "sitepages/actions/addmeta.php");
    register_action("sitepages/edit", FALSE, $CONFIG->pluginspath . "sitepages/actions/edit.php");
    register_action("sitepages/delete", FALSE, $CONFIG->pluginspath . "sitepages/actions/delete.php");
}
Exemplo n.º 2
0
function theme_editable_init()
{
    global $CONFIG;
    // make sure we have a css_file and if not, create a default one based on the system's css.php
    init_css_file();
    register_action("theme_editable/save", false, $CONFIG->pluginspath . "theme_editable/actions/save.php", true);
}
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');
    }
}
function ckeditor_init()
{
    global $CONFIG;
    register_action('CKEditor/upload', false, $CONFIG->pluginspath . "CKEditor/actions/upload.php");
    register_plugin_hook('delete', 'user', 'Remove_files_when_user_isDel');
    extend_view('metatags', 'CKEditor/js/javascript');
}
Exemplo n.º 5
0
/**
 * Initialise categories actions etc
 *
 */
function categories_init()
{
    // Get config
    global $CONFIG;
    extend_view('css', 'categories/css');
    // Register action
    register_action('categories/save', false, $CONFIG->pluginspath . 'categories/actions/save.php', true);
}
/**
 * Email user validation plugin.
 * Non-admin or admin created accounts are invalid until their email address is confirmed. 
 * 
 * @package ElggUserValidationByEmail
 * @author Curverider Ltd
 * @link http://elgg.com/
 */
function uservalidationbyemail_init()
{
    global $CONFIG;
    // Register actions
    register_action("email/confirm", true, $CONFIG->pluginspath . "uservalidationbyemail/actions/email/confirm.php");
    // Register hook listening to new users.
    register_elgg_event_handler('validate', 'user', 'uservalidationbyemail_email_validation');
}
/**
 * Initialise the diagnostics tool
 *
 */
function diagnostics_init()
{
    global $CONFIG;
    // Register a page handler, so we can have nice URLs
    register_page_handler('diagnostics', 'diagnostics_page_handler');
    // Register some actions
    register_action("diagnostics/download", false, $CONFIG->pluginspath . "diagnostics/actions/download.php");
}
function vazco_topbar_init()
{
    global $CONFIG;
    extend_view('css', 'vazco_topbar/css');
    extend_view('vanillaforum/topbar_css', 'vazco_topbar/css');
    register_action("vazco_topbar/edit", false, $CONFIG->pluginspath . "vazco_topbar/actions/edit.php");
    register_action("vazco_topbar/userlinks", false, $CONFIG->pluginspath . "vazco_topbar/actions/userlinks.php");
}
Exemplo n.º 9
0
function request_password_init()
{
    global $CONFIG;
    // overrides the default password request action
    register_action('user/requestnewpassword', true, $CONFIG->pluginspath . 'request_password/actions/requestnewpassword.php');
    // regsiter new action for username request
    register_action('user/requestusername', true, $CONFIG->pluginspath . 'request_password/actions/requestusername.php');
}
Exemplo n.º 10
0
/**
 * This plugin adds Dreamfish specific functionality. It allows
 * email messages to be customized.
 * 
 * The plugin adds an additional admin entry in the admin navigation
 * on the left. Clicking on it will show all possible customizable
 * emails. The admin can edit these and save them.
 * 
 * WARNING:
 * Saving happens by overwriting the original language file.
 * This is dangerous because if there's a problem with the new
 * value the whole file might become corrupt, even causing the
 * whole application to stop working!
 * 
 * To add a new email message to the list of customizable messages:
 * <lu>
 * <li>Edit <elgg_plugin_path>dreamfish_admin/views/default/dreamfish_admin/list.php
 *   and add a new link to the new message there</li>
 * <li>Create a new file "configure_<your_new_message>.php" in dreamfish_admin/views/default
 *   which actually just calls the form:</li>
 * <li>Create a new file "dreamfish_admin/views/default/dreamfish_admin/forms/<your_new_message>.php",
 *   which is the form that displays the data</li>
 * <li>Create a new file "dreamfish_admin/actions/<your_new_message>.php" which does
 *   the saving. Copy and paste from existing actions/forms</li>
 * </ul>
 * 
 * This could be simplified as the interface looks always rather the same,
 * by just having only one form, one page and one action which renders data and
 * saves the file according to parameters.
 */
function dreamfish_admin_init()
{
    global $CONFIG;
    register_action('dreamfish_admin/email_confirm', false, $CONFIG->pluginspath . "dreamfish_admin/actions/email_confirm.php");
    register_action('dreamfish_admin/welcome', false, $CONFIG->pluginspath . "dreamfish_admin/actions/welcome.php");
    register_action('dreamfish_admin/new_friend', false, $CONFIG->pluginspath . "dreamfish_admin/actions/new_friend.php");
    register_action('dreamfish_admin/new_message', false, $CONFIG->pluginspath . "dreamfish_admin/actions/new_message.php");
    //register_notification_handler('email','df_notification_handler');
}
Exemplo n.º 11
0
function action()
{
    $args = func_get_args();
    $vars = array();
    if (count($args) > 0) {
        $action = array_shift($args);
        $vars = array_flatten($args);
        return register_action($action, $action, $vars);
    }
}
Exemplo n.º 12
0
function groups_from_members_init()
{
    global $CONFIG;
    add_group_tool_option('members_invite', elgg_echo('groupsfrommembers:members-invite'), false);
    if (get_plugin_setting('maxusers') == 0) {
        set_plugin_setting('maxusers', 20);
    }
    register_plugin_hook('permissions_check', 'group', 'groups_from_members_member_can_invite');
    register_elgg_event_handler('pagesetup', 'system', 'groups_from_members_submenus');
    register_plugin_hook('action', 'groups/invite', 'groups_from_members_member_invited_action');
    register_action('groupsfrommembers/search', false, $CONFIG->pluginspath . 'groupsfrommembers/actions/search.php');
}
Exemplo n.º 13
0
/**
 * Initialise the diagnostics tool
 *
 */
function diagnostics_init()
{
    global $CONFIG;
    // Register a page handler, so we can have nice URLs
    register_page_handler('diagnostics', 'diagnostics_page_handler');
    // Register some actions
    register_action("diagnostics/download", false, $CONFIG->pluginspath . "diagnostics/actions/download.php");
    // If debug on then enable an example test
    if (isset($CONFIG->debug) && $CONFIG->debug) {
        register_elgg_test(elgg_echo('diagnostics:unittest:example'), 'diagnostics_test_test');
    }
}
Exemplo n.º 14
0
function friends_of_friends_init()
{
    global $CONFIG;
    // Register a page handler, so we can have nice URLs
    register_page_handler('friendsoffriends', 'friends_of_friends_page_handler');
    // Extend CSS
    extend_view('css', 'friends_of_friends/css');
    //Read Settings
    $CONFIG->mod->friends_of_friends->config->hidefriendsof = get_plugin_setting('hidefriendsof', 'friends_of_friends');
    register_action("friends_of_friends/get_text", false, $CONFIG->pluginspath . "friends_of_friends/actions/get_text.php", true);
    register_action("friends_of_friends/translate", false, $CONFIG->pluginspath . "friends_of_friends/actions/translate.php", true);
}
Exemplo n.º 15
0
/**
 * Initialise the dgroups plugin.
 * Register actions, set up menus
 */
function dgroups_init()
{
    global $CONFIG;
    // Set up the menu for logged in users
    if (isloggedin()) {
        add_menu(elgg_echo('dgroups'), $CONFIG->wwwroot . "pg/dgroups/world/");
        //add_menu(elgg_echo('dgroups:alldiscussion'),$CONFIG->wwwroot."mod/dgroups/discussions.php");
    } else {
        add_menu(elgg_echo('dgroups'), $CONFIG->wwwroot . "pg/dgroups/world/");
    }
    // Register a page handler, so we can have nice URLs
    register_page_handler('dgroups', 'dgroups_page_handler');
    // Register a URL handler for dgroups and forum topics
    register_entity_url_handler('dgroups_url', 'group', 'dgroup');
    register_entity_url_handler('dgroups_dgroupforumtopic_url', 'object', 'dgroupforumtopic');
    // Register an icon handler for dgroups
    register_page_handler('dgroupicon', 'dgroups_icon_handler');
    // Register some actions
    register_action("dgroups/edit", false, $CONFIG->pluginspath . "dgroups/actions/edit.php");
    register_action("dgroups/delete", false, $CONFIG->pluginspath . "dgroups/actions/delete.php");
    register_action("dgroups/join", false, $CONFIG->pluginspath . "dgroups/actions/join.php");
    register_action("dgroups/leave", false, $CONFIG->pluginspath . "dgroups/actions/leave.php");
    register_action("dgroups/joinrequest", false, $CONFIG->pluginspath . "dgroups/actions/joinrequest.php");
    register_action("dgroups/killrequest", false, $CONFIG->pluginspath . "dgroups/actions/dgroupskillrequest.php");
    register_action("dgroups/addtodgroup", false, $CONFIG->pluginspath . "dgroups/actions/addtodgroup.php");
    register_action("dgroups/invite", false, $CONFIG->pluginspath . "dgroups/actions/invite.php");
    extend_view('dgroups/menu/links', 'pages/menu');
    // Add to groups context
    extend_view('dgroups/right_column', 'pages/groupprofile_pages');
    // Add to groups context
    // Use dgroup widgets
    use_widgets('dgroups');
    // Add a page owner handler
    add_page_owner_handler('dgroups_page_owner_handler');
    // Add some widgets
    add_widget_type('a_users_dgroups', elgg_echo('dgroups:widget:membership'), elgg_echo('dgroups:widgets:description'));
    //extend some views
    extend_view('profile/icon', 'dgroups/icon');
    extend_view('css', 'dgroups/css');
    // Write access permissions
    register_plugin_hook('access:collections:write', 'all', 'dgroups_write_acl_plugin_hook');
    // Notification hooks
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'dgroupforumtopic', elgg_echo('dgroupforumtopic:new'));
    }
    register_plugin_hook('object:notifications', 'object', 'dgroup_object_notifications_intercept');
    // Listen to notification events and supply a more useful message
    register_plugin_hook('notify:entity:message', 'object', 'dgroupforumtopic_notify_message');
    // add the forum tool option
    // Now override icons
    register_plugin_hook('entity:icon:url', 'group', 'dgroups_dgroupicon_hook');
}
Exemplo n.º 16
0
function vazco_mainpage_init()
{
    global $CONFIG;
    register_page_handler('vazco_mainpage', 'vazco_mainpage_page_handler');
    if (get_context() == 'admin') {
        add_submenu_item(elgg_echo('vazco_mainpage:menu'), $CONFIG->wwwroot . 'pg/vazco_mainpage/');
    }
    extend_view("canvas/layouts/vazco_index", "vazco_mainpage/widget_list", 1);
    extend_view("vazco_mainpage/mainpage_editor", "vazco_mainpage/widget_list", 1);
    extend_view("css", "vazco_mainpage/css", 800);
    //Replace the default index page
    register_plugin_hook('index', 'system', 'vazco_mainpage_custom_index');
    register_action("vazco_mainpage/update", false, $CONFIG->pluginspath . "vazco_mainpage/actions/update.php");
    register_action("vazco_mainpage/upload", false, $CONFIG->pluginspath . "vazco_mainpage/actions/upload.php");
}
Exemplo n.º 17
0
/**
 * Initialise the plugin.
 *
 */
function uncaptcha_init()
{
    global $CONFIG;
    //override the default register.php action
    register_action('register', true, $CONFIG->pluginspath . "uncaptcha/actions/register.php");
    // inserts form-mangling JS on the registration page.
    extend_view('account/forms/register', 'uncaptcha/register');
    // css to hide the trick field
    extend_view('css', 'uncaptcha/register_css');
    // allow us to catch validation events and enable / validate users immediately
    // as per config.
    register_elgg_event_handler('validate', 'user', 'uncaptcha_validate_user');
    register_plugin_hook('uncaptcha:register_user', 'user', 'uncaptcha_register_user');
    return true;
}
Exemplo n.º 18
0
 function __construct()
 {
     $class = get_called_class();
     $methods = get_class_methods($class);
     foreach ($methods as $method) {
         if ($method[0] != '_') {
             $rmethod = new ReflectionMethod($class, $method);
             $rparams = $rmethod->getParameters();
             $params = array();
             foreach ($rparams as $param) {
                 $params[] = $param->getName();
             }
             register_action($method, array($this, $method), $params);
         }
     }
 }
/**
 * Initialise the pages plugin.
 *
 */
function pages_init()
{
    global $CONFIG;
    // Set up the menu for logged in users
    if (isloggedin()) {
        add_menu(elgg_echo('pages'), $CONFIG->wwwroot . "pg/pages/owned/" . $_SESSION['user']->username, 'pages');
    } else {
        add_menu(elgg_echo('pages'), $CONFIG->wwwroot . "mod/pages/world.php");
    }
    // Extend hover-over menu
    elgg_extend_view('profile/menu/links', 'pages/menu');
    // Register a page handler, so we can have nice URLs
    register_page_handler('pages', 'pages_page_handler');
    // Register a url handler
    register_entity_url_handler('pages_url', 'object', 'page_top');
    register_entity_url_handler('pages_url', 'object', 'page');
    // Register some actions
    register_action("pages/edit", false, $CONFIG->pluginspath . "pages/actions/pages/edit.php");
    register_action("pages/editwelcome", false, $CONFIG->pluginspath . "pages/actions/pages/editwelcome.php");
    register_action("pages/delete", false, $CONFIG->pluginspath . "pages/actions/pages/delete.php");
    // Extend some views
    elgg_extend_view('css', 'pages/css');
    elgg_extend_view('groups/menu/links', 'pages/menu');
    // Add to groups context
    elgg_extend_view('groups/right_column', 'pages/groupprofile_pages');
    // Add to groups context
    // Register entity type
    register_entity_type('object', 'page');
    register_entity_type('object', 'page_top');
    // Register granular notification for this type
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'page', elgg_echo('pages:new'));
        register_notification_object('object', 'page_top', elgg_echo('pages:new'));
    }
    // Listen to notification events and supply a more useful message
    register_plugin_hook('notify:entity:message', 'object', 'page_notify_message');
    // add the group pages tool option
    add_group_tool_option('pages', elgg_echo('groups:enablepages'), true);
    //add a widget
    add_widget_type('pages', elgg_echo('pages'), elgg_echo('pages:widget:description'));
    // For now, we'll hard code the groups profile items as follows:
    // TODO make this user configurable
    // Language short codes must be of the form "pages:key"
    // where key is the array key below
    $CONFIG->pages = array('title' => 'text', 'description' => 'longtext', 'tags' => 'tags', 'access_id' => 'access', 'write_access_id' => 'access');
}
Exemplo n.º 20
0
/**
 * Initialise the groups plugin.
 * Register actions, set up menus
 */
function groups_init()
{
    global $CONFIG;
    // Set up the menu
    add_menu(elgg_echo('groups'), $CONFIG->wwwroot . "pg/groups/member/");
    // Register a page handler, so we can have nice URLs
    register_page_handler('groups', 'groups_page_handler');
    // Register a URL handler for groups and forum topics
    register_entity_url_handler('groups_url', 'group', 'all');
    register_entity_url_handler('groups_groupforumtopic_url', 'object', 'groupforumtopic');
    // Register an icon handler for groups
    register_page_handler('groupicon', 'groups_icon_handler');
    // Register some actions
    register_action("groups/edit", false, $CONFIG->pluginspath . "groups/actions/edit.php");
    register_action("groups/delete", false, $CONFIG->pluginspath . "groups/actions/delete.php");
    register_action("groups/join", false, $CONFIG->pluginspath . "groups/actions/join.php");
    register_action("groups/leave", false, $CONFIG->pluginspath . "groups/actions/leave.php");
    register_action("groups/joinrequest", false, $CONFIG->pluginspath . "groups/actions/joinrequest.php");
    register_action("groups/killrequest", false, $CONFIG->pluginspath . "groups/actions/groupskillrequest.php");
    register_action("groups/killinvitation", false, $CONFIG->pluginspath . "groups/actions/groupskillinvitation.php");
    register_action("groups/addtogroup", false, $CONFIG->pluginspath . "groups/actions/addtogroup.php");
    register_action("groups/invite", false, $CONFIG->pluginspath . "groups/actions/invite.php");
    // Use group widgets
    use_widgets('groups');
    // Add a page owner handler
    add_page_owner_handler('groups_page_owner_handler');
    // Add some widgets
    add_widget_type('a_users_groups', elgg_echo('groups:widget:membership'), elgg_echo('groups:widgets:description'));
    //extend some views
    elgg_extend_view('profile/icon', 'groups/icon');
    elgg_extend_view('css', 'groups/css');
    // Access permissions
    register_plugin_hook('access:collections:write', 'all', 'groups_write_acl_plugin_hook');
    //register_plugin_hook('access:collections:read', 'all', 'groups_read_acl_plugin_hook');
    // Notification hooks
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'groupforumtopic', elgg_echo('groupforumtopic:new'));
    }
    register_plugin_hook('object:notifications', 'object', 'group_object_notifications_intercept');
    // Listen to notification events and supply a more useful message
    register_plugin_hook('notify:entity:message', 'object', 'groupforumtopic_notify_message');
    // add the forum tool option
    add_group_tool_option('forum', elgg_echo('groups:enableforum'), true);
    // Now override icons
    register_plugin_hook('entity:icon:url', 'group', 'groups_groupicon_hook');
}
Exemplo n.º 21
0
/**
 * Initialize the community plugin repository plugin
 */
function plugins_init()
{
    global $CONFIG;
    run_function_once('plugins_run_once');
    // Set up menu for logged in users
    add_menu(elgg_echo('plugins'), "{$CONFIG->wwwroot}pg/plugins/all/");
    // Extend CSS
    extend_view('css', 'plugins/css');
    // Extend hover-over and profile menu
    extend_view('profile/menu/links', 'plugins/profile_menu');
    extend_view('groups/left_column', 'plugins/groupprofile_files');
    // Register a page handler, so we can have nice URLs
    register_page_handler('plugins', 'plugins_page_handler');
    // Image handler
    register_page_handler('plugins_image', 'plugins_image_page_handler');
    register_notification_object('object', 'plugins', elgg_echo('plugins:new'));
    //register a widget
    add_widget_type('plugins', elgg_echo('plugins'), elgg_echo('plugins'), 'profile');
    // register url handlers for the 2 object subtypes
    register_entity_url_handler('plugins_release_url_handler', 'object', 'plugin_release');
    register_entity_url_handler('plugins_project_url_handler', 'object', 'plugin_project');
    register_elgg_event_handler('pagesetup', 'system', 'plugins_add_submenus');
    // Only projects should show up in search
    register_entity_type('object', 'plugin_project');
    // Special hook for searching against metadata (category)
    register_plugin_hook('search', 'object:plugin_project', 'plugins_search_hook');
    // Elgg versions
    $CONFIG->elgg_versions = array('1.8', '1.7', '1.6', '1.5', '1.2', '1.0');
    // GPL-compatible licenses
    $CONFIG->gpllicenses = array('none' => 'No license selected', 'gpl2' => 'GNU General Public License (GPL) version 2', 'lgpl2.1' => 'GNU Lesser General Public License (LGPL) version 2.1', 'berkeleydb' => 'Berkeley Database License (aka the Sleepycat Software Product License)', 'mbsd' => 'Modified BSD license', 'cbsd' => 'The Clear BSD License', 'expat' => 'Expat (MIT) License', 'freebsd' => 'FreeBSD license', 'intel' => 'Intel Open Source License', 'openbsd' => 'ISC (OpenBSD) License', 'ncsa' => 'NCSA/University of Illinois Open Source License', 'w3c' => 'W3C Software Notice and License', 'x11' => 'X11 License', 'zope' => 'Zope Public License, versions 2.0 and 2.1');
    // Defined plugin categories
    $CONFIG->plugincats = array('admin' => 'Site admin', 'user' => 'User admin', 'events' => 'Events', 'authentication' => 'Authentication', 'clients' => 'Clients', 'photos' => 'Photos and Images', 'tpintegrations' => 'Third Party integrations', 'tools' => 'Tools', 'media' => 'Media', 'communication' => 'Communication', 'widgets' => 'Widgets', 'games' => 'Games', 'ecommerce' => 'eCommerce', 'languages' => 'Languages', 'themes' => 'Themes', 'misc' => 'Misc', 'uncategorized' => 'Uncategorized');
    $action_base = "{$CONFIG->pluginspath}community_plugins/actions/plugins";
    register_action("plugins/create_project", FALSE, "{$action_base}/create_project.php");
    register_action("plugins/create_release", FALSE, "{$action_base}/create_release.php");
    register_action("plugins/save_project", FALSE, "{$action_base}/save_project.php");
    register_action("plugins/save_release", FALSE, "{$action_base}/save_release.php");
    register_action("plugins/delete_project", FALSE, "{$action_base}/delete_project.php");
    register_action("plugins/delete_release", FALSE, "{$action_base}/delete_release.php");
    register_action("plugins/delete_project_image", FALSE, "{$action_base}/delete_project_image.php");
    register_action("plugins/digg", FALSE, "{$action_base}/digg.php");
    register_action("plugins/upgrade", FALSE, "{$action_base}/admin/upgrade.php", TRUE);
    register_action("plugins/combine", FALSE, "{$action_base}/admin/combine.php", TRUE);
    register_action("plugins/normalize", FALSE, "{$action_base}/admin/normalize.php", TRUE);
}
Exemplo n.º 22
0
/**
 * Dev Tools initialization
 */
function elgg_dev_tools_init()
{
    global $CONFIG;
    // if enabled, we include this for every user
    require_once dirname(__FILE__) . '/includes/ElggDevTools.php';
    ElggDevTools::launcher();
    // this can be removed in Elgg 1.8 (still won't be avilable until plugins load
    require_once dirname(__FILE__) . '/classes/ElggDevTimer.php';
    require_once dirname(__FILE__) . '/classes/ElggDevTimerManager.php';
    elgg_extend_view('css', 'elgg_dev_tools/css');
    register_elgg_event_handler('pagesetup', 'system', 'elgg_dev_tools_pagesetup');
    register_page_handler('elgg_dev_tools', 'elgg_dev_tools_page_handler');
    register_action("elgg_dev_tools/updatesettings", FALSE, $CONFIG->pluginspath . "elgg_dev_tools/actions/updatesettings.php", TRUE);
    register_action("elgg_dev_tools/buildplugin", FALSE, $CONFIG->pluginspath . "elgg_dev_tools/actions/buildplugin.php", TRUE);
    // this should only run when HTML is produced and Elgg makes this difficult to determine
    //if ((int)get_plugin_setting('htmllog', 'elgg_developer_tools') != 0) {
    //	elgg_dev_setup_html_debugging();
    //}
}
Exemplo n.º 23
0
/**
 * Initialise the admin page.
 */
function admin_init()
{
    // Add plugin main menu option (last)
    extend_elgg_admin_page('admin/main_opt/statistics', 'admin/main');
    extend_elgg_admin_page('admin/main_opt/site', 'admin/main');
    extend_elgg_admin_page('admin/main_opt/user', 'admin/main');
    extend_elgg_admin_page('admin/main_opt/plugins', 'admin/main', 999);
    // Always last
    register_action('admin/user/ban', false, "", true);
    register_action('admin/user/unban', false, "", true);
    register_action('admin/user/delete', false, "", true);
    register_action('admin/user/resetpassword', false, "", true);
    register_action('admin/user/makeadmin', false, "", true);
    register_action('admin/user/removeadmin', false, "", true);
    register_action('admin/site/update_basic', false, "", true);
    register_action('admin/menu_items', false, "", true);
    // Page handler
    register_page_handler('admin', 'admin_settings_page_handler');
}
Exemplo n.º 24
0
function stickywidgets_init()
{
    global $CONFIG;
    add_subtype("object", "sticky_widget", "StickyElggWidget");
    // Register a page handler, so we can have nice URLs
    register_page_handler('sticky_widgets', 'sw_page_handler');
    // Register page handler for the dashboard
    register_page_handler('dashboard', 'sw_dashboard');
    // Register page handler for profile
    register_page_handler('profile', 'sw_profile_page_handler');
    register_action('sticky_widgets/getWidgets', false, $CONFIG->pluginspath . "sticky_widgets/actions/getWidgets.php", true);
    register_action('sticky_widgets/reorder', false, $CONFIG->pluginspath . "sticky_widgets/actions/reorder.php", true);
    register_action('sticky_widgets/uninstall', false, $CONFIG->pluginspath . "sticky_widgets/actions/uninstall.php", true);
    register_action('sticky_widgets/save', false, $CONFIG->pluginspath . "sticky_widgets/actions/save.php", true);
    // Extend system CSS with our own styles, which are defined in the messageboard/css view
    extend_view('css', 'sticky_widgets/css');
    //	extend_view("metatags","sticky_widgets/js");
    register_plugin_hook('container_permissions_check', 'object', 'sticky_widgets_container_permission_check');
    register_plugin_hook('permissions_check', 'object', 'sticky_widgets_container_permission_check');
}
Exemplo n.º 25
0
Arquivo: start.php Projeto: rasul/Elgg
/**
 * The Wire initialization
 */
function thewire_init()
{
    global $CONFIG;
    if (!update_subtype('object', 'thewire', 'ElggWire')) {
        add_subtype('object', 'thewire', 'ElggWire');
    }
    // register the wire's JavaScript
    $thewire_js = elgg_get_simplecache_url('js', 'thewire');
    elgg_register_js('elgg.thewire', $thewire_js, 'footer');
    // 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', 'thewire/css');
    //extend views
    elgg_extend_view('activity/thewire', 'thewire/activity_view');
    elgg_extend_view('profile/status', 'thewire/profile_status');
    elgg_extend_view('js/initialise_elgg', 'thewire/js/textcounter');
    // 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_entity_url_handler('object', 'thewire', 'thewire_url');
    // Your thewire widget
    add_widget_type('thewire', elgg_echo('thewire'), elgg_echo("thewire:widget:desc"));
    // Register entity type
    elgg_register_entity_type('object', 'thewire');
    // Register granular notification for this type
    register_notification_object('object', 'thewire', elgg_echo('thewire:notify:subject'));
    // Listen to notification events and supply a more useful message
    register_plugin_hook('notify:entity:message', 'object', 'thewire_notify_message');
    // Register actions
    $action_base = $CONFIG->pluginspath . 'thewire/actions';
    register_action("thewire/add", false, "{$action_base}/add.php");
    register_action("thewire/delete", false, "{$action_base}/delete.php");
    register_plugin_hook('unit_test', 'system', 'thewire_test');
}
Exemplo n.º 26
0
function siteaccess_init()
{
    global $CONFIG;
    $CONFIG->disable_registration = false;
    if (siteaccess_walledgarden_enabled()) {
        if (!isloggedin()) {
            siteaccess_allowed_pages();
        }
    }
    register_plugin_hook('action', 'register', 'siteaccess_register_hook');
    register_plugin_hook('action', 'login', 'siteaccess_login_hook');
    register_plugin_hook('usersettings:save', 'user', 'siteaccess_user_settings_hook', 25);
    $period = get_plugin_setting('period', 'siteaccess');
    switch ($period) {
        case 'hourly':
        case 'daily':
        case 'weekly':
        case 'monthly':
            break;
        default:
            $period = 'weekly';
    }
    register_plugin_hook('cron', $period, 'siteaccess_cron_hook');
    if (issuperadminloggedin()) {
        register_page_handler('siteaccess', 'siteaccess_page_handler');
        // Add siteaccess/index.php
        extend_view('profile/menu/adminlinks', 'siteaccess/menu/siteaccess_adminlinks');
        // Add links to user profile
        register_action("siteaccess/activate", false, $CONFIG->pluginspath . "siteaccess/actions/activate.php", true);
        // Enable validate action
        register_action("siteaccess/email/save", false, $CONFIG->pluginspath . "siteaccess/actions/siteaccess/email/save.php", true);
        register_action("siteaccess/email/delete", false, $CONFIG->pluginspath . "siteaccess/actions/siteaccess/email/delete.php", true);
    }
    extend_view('css', 'siteaccess/css');
    register_action("siteaccess/confirm", true, $CONFIG->pluginspath . "siteaccess/actions/confirm.php");
    register_action("siteaccess/code", true, $CONFIG->pluginspath . "siteaccess/actions/code.php");
    register_elgg_event_handler('validate', 'user', 'siteaccess_validate_user');
    register_elgg_event_handler('create', 'user', 'siteaccess_create_user');
}
Exemplo n.º 27
0
function beechat_init()
{
    global $CONFIG;
    register_translations($CONFIG->pluginspath . "beechat/languages/");
    register_elgg_event_handler('pagesetup', 'system', 'beechat_pagesetup');
    register_action('beechat/get_statuses', false, $CONFIG->pluginspath . 'beechat/actions/get_statuses.php');
    register_action('beechat/get_icons', false, $CONFIG->pluginspath . 'beechat/actions/get_icons.php');
    register_action('beechat/get_details', false, $CONFIG->pluginspath . 'beechat/actions/get_details.php');
    register_action('beechat/get_connection', false, $CONFIG->pluginspath . 'beechat/actions/get_connection.php');
    register_action('beechat/get_state', false, $CONFIG->pluginspath . 'beechat/actions/get_state.php');
    register_action('beechat/save_state', false, $CONFIG->pluginspath . 'beechat/actions/save_state.php');
    register_plugin_hook('action', 'friends/add', 'beechat_xmpp_add_friend');
    register_plugin_hook('action', 'friends/remove', 'beechat_xmpp_remove_friend');
    extend_view('js/initialise_elgg', 'js/json2.js');
    extend_view('js/initialise_elgg', 'js/jquery.cookie.min.js');
    extend_view('js/initialise_elgg', 'js/jquery.scrollTo-min.js');
    extend_view('js/initialise_elgg', 'js/jquery.serialScroll-min.js');
    extend_view('js/initialise_elgg', 'js/b64.js');
    extend_view('js/initialise_elgg', 'js/sha1.js');
    extend_view('js/initialise_elgg', 'js/md5.js');
    extend_view('js/initialise_elgg', 'js/strophe.min.js');
    extend_view('js/initialise_elgg', 'js/jquery.tools.min.js');
    extend_view('css', 'beechat/screen.css');
    extend_view('js/initialise_elgg', 'beechat/beechat.js');
    extend_view('metatags', 'beechat/beechat.userjs');
    extend_view('footer/analytics', 'beechat/beechat');
    $domain = get_plugin_setting("domain", "beechat");
    $dbname = get_plugin_setting("dbname", "beechat");
    $dbhost = get_plugin_setting("dbhost", "beechat");
    $dbuser = get_plugin_setting("dbuser", "beechat");
    $dbpassword = get_plugin_setting("dbpassword", "beechat");
    $CONFIG->chatsettings['domain'] = $domain;
    $CONFIG->chatsettings['dbname'] = $dbname;
    $CONFIG->chatsettings['dbhost'] = $dbhost;
    $CONFIG->chatsettings['dbuser'] = $dbuser;
    $CONFIG->chatsettings['dbpassword'] = $dbpassword;
}
Exemplo n.º 28
0
/**
 * Initialise the admin page.
 */
function admin_init()
{
    // Add plugin main menu option (last)
    extend_elgg_admin_page('admin/main_opt/statistics', 'admin/main');
    extend_elgg_admin_page('admin/main_opt/site', 'admin/main');
    extend_elgg_admin_page('admin/main_opt/user', 'admin/main');
    extend_elgg_admin_page('admin/main_opt/plugins', 'admin/main', 999);
    // Always last
    register_action('admin/user/ban', false, "", true);
    register_action('admin/user/unban', false, "", true);
    register_action('admin/user/delete', false, "", true);
    register_action('admin/user/resetpassword', false, "", true);
    register_action('admin/user/makeadmin', false, "", true);
    register_action('admin/user/removeadmin', false, "", true);
    // Register some actions
    register_action('admin/site/update_basic', false, "", true);
    // Register basic site admin action
    // Page handler
    register_page_handler('admin', 'admin_settings_page_handler');
    if (isadminloggedin()) {
        global $is_admin;
        $is_admin = true;
    }
}
Exemplo n.º 29
0
/**
 * Init blog plugin.
 *
 * @return TRUE
 */
function blog_init()
{
    global $CONFIG;
    require_once dirname(__FILE__) . '/blog_lib.php';
    add_menu(elgg_echo('blog'), "{$CONFIG->wwwroot}pg/blog/", array());
    elgg_extend_view('css', 'blog/css');
    register_elgg_event_handler('pagesetup', 'system', 'blog_page_setup');
    register_page_handler('blog', 'blog_page_handler');
    register_entity_url_handler('blog_url_handler', 'object', 'blog');
    // notifications
    register_notification_object('object', 'blog', elgg_echo('blog:newpost'));
    register_plugin_hook('notify:entity:message', 'object', 'blog_notify_message');
    // pingbacks
    //register_elgg_event_handler('create', 'object', 'blog_incoming_ping');
    //register_plugin_hook('pingback:object:subtypes', 'object', 'blog_pingback_subtypes');
    // Register for search.
    register_entity_type('object', 'blog');
    add_group_tool_option('blog', elgg_echo('blog:enableblog'), true);
    //add_widget_type('blog', elgg_echo('blog'), elgg_echo('blog:widget:description'), 'profile, dashboard');
    $action_path = dirname(__FILE__) . '/actions/blog';
    register_action('blog/save', FALSE, "{$action_path}/save.php");
    register_action('blog/auto_save_revision', FALSE, "{$action_path}/auto_save_revision.php");
    register_action('blog/delete', FALSE, "{$action_path}/delete.php");
}
Exemplo n.º 30
0
/**
 * initialization of plugin
 * 
 * @return unknown_type
 */
function profile_manager_init()
{
    global $CONFIG;
    // Extend CSS
    extend_view("css", "profile_manager/css");
    extend_view("css", "members/css");
    extend_view("js/initialise_elgg", "profile_manager/global_js");
    // add custom profile fields to register page
    extend_view("account/forms/register", "profile_manager/register");
    // extend the user profile view
    extend_view("profile/userdetails", "profile_manager/profile/userdetails");
    // link to full profile
    if (get_plugin_setting("show_full_profile_link") == "yes") {
        extend_view("profile/menu/actions", "profile_manager/profile/userlinks");
    }
    // Extend the admin statistics
    if (get_plugin_setting("show_admin_stats") == "yes") {
        extend_view("admin/statistics", "profile_manager/admin_stats");
    }
    // Register a page handler, so we can have nice URLs
    register_page_handler('defaultprofile', 'profile_manager_edit_defaults_page_handler');
    // Register Page handler for Custom Profile Fields
    register_page_handler("profile_manager", "profile_manager_page_handler");
    // Register Page handler for Members listing
    if (get_plugin_setting("show_members_search") == "yes") {
        register_page_handler("members", "profile_manager_members_page_handler");
        add_menu(elgg_echo("profile_manager:members:menu"), $CONFIG->wwwroot . "pg/members");
    }
    // admin user add, registered here to overrule default action
    register_action("useradd", false, $CONFIG->pluginspath . "profile_manager/actions/admin/useradd.php", true);
    // Register all custom field types
    register_custom_field_types();
    // Run once function to configure this plugin
    run_function_once('profile_manager_run_once', 1265673600);
    // 2010-02-09
}