* not occur.
*/
function crontrigger_shutdownhook() {
- global $CONFIG;
$minute = 60;
$fiveminute = $minute * 5;
* Cron job
*/
function garbagecollector_cron($hook, $entity_type, $returnvalue, $params) {
- global $CONFIG;
echo elgg_echo('garbagecollector');
* Add menu item for invite friends
*/
function invitefriends_pagesetup() {
- global $CONFIG;
if (elgg_get_context() == "friends" ||
elgg_get_context() == "friendsof" ||
elgg_get_context() == "collections") {
}
}
-elgg_register_action('invitefriends/invite', $CONFIG->pluginspath . 'invitefriends/actions/invite.php');
+elgg_register_action('invitefriends/invite', elgg_get_plugin_path() . 'invitefriends/actions/invite.php');
elgg_register_event_handler('pagesetup', 'system', 'invitefriends_pagesetup');
* Initialize the log browser plugin.
*/
function logbrowser_init() {
- global $CONFIG;
// Extend CSS
elgg_extend_view('css/admin', 'logbrowser/css');
*/
function members_init() {
- global $CONFIG;
elgg_extend_view('css','members/css');
}
// add a messageboard widget - only for profile
add_widget_type('messageboard', elgg_echo("messageboard:board"), elgg_echo("messageboard:desc"), "profile");
+
+ // Register actions
+ $action_path = elgg_get_plugin_path() . 'messageboard/actions';
+ elgg_register_action("messageboard/add", "$action_path/add.php");
+ elgg_register_action("messageboard/delete", "$action_path/delete.php");
}
/**
*/
function messageboard_page_handler($page) {
- global $CONFIG;
-
// The username should be the first array entry
if (isset($page[0])) {
set_input('username', $page[0]);
}
// Include the standard messageboard index
- include($CONFIG->pluginspath . "messageboard/index.php");
+ include(elgg_get_plugin_path() . "messageboard/index.php");
}
/**
* @return bool
*/
function messageboard_add($poster, $owner, $message, $access_id = ACCESS_PUBLIC) {
- global $CONFIG;
$result = $owner->annotate('messageboard', $message, $access_id, $poster->guid);
if (!$result) {
// Register initialisation callback
elgg_register_event_handler('init', 'system', 'messageboard_init');
-
-// Register actions
-elgg_register_action("messageboard/add", $CONFIG->pluginspath . "messageboard/actions/add.php");
-elgg_register_action("messageboard/delete", $CONFIG->pluginspath . "messageboard/actions/delete.php");
* Initialize the plugin
*/
function reportedcontent_init() {
- global $CONFIG;
// Register a page handler, so we can have nice URLs
register_page_handler('reportedcontent', 'reportedcontent_page_handler');
elgg_add_admin_submenu_item('reportedcontent', elgg_echo('reportedcontent'), 'overview');
// Register actions
- $action_path = "{$CONFIG->pluginspath}reportedcontent/actions";
+ $action_path = elgg_get_plugin_path() . "reportedcontent/actions";
elgg_register_action('reportedcontent/add', "$action_path/add.php");
elgg_register_action('reportedcontent/delete', "$action_path/delete.php", 'admin');
elgg_register_action('reportedcontent/archive', "$action_path/archive.php", 'admin');
*/
function sitepages_init() {
require_once(dirname(__FILE__) . '/sitepages_functions.php');
- global $CONFIG;
// Extend CSS
elgg_extend_view('css', 'sitepages/css');
// hook into the walled garden pages
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'sitepages_public_pages');
- elgg_register_action('settings/sitepages/save', "{$CONFIG->pluginspath}sitepages/actions/edit_settings.php");
+ $action_path = elgg_get_plugin_path() . 'sitepages/actions';
+ elgg_register_action('settings/sitepages/save', "$action_path/edit_settings.php");
}
* @return unknown_type
*/
function sitepages_page_handler($page) {
- global $CONFIG;
// for the owner block.
if ($logged_in_guid = get_loggedin_userid()) {
*/
function thewire_init() {
-
- // Load system configuration
- global $CONFIG;
// Set up menu for logged in users
add_menu(elgg_echo('thewire:title'), "pg/thewire");
// Listen to notification events and supply a more useful message for SMS'
elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'thewire_notify_message');
+
+ $action_path = elgg_get_plugin_path() . 'thewire/actions';
+ elgg_register_action("thewire/add", "$action_path/add.php");
+ elgg_register_action("thewire/delete", "$action_path/delete.php");
}
function thewire_pagesetup() {
-
- global $CONFIG;
+
+ $base_url = elgg_get_site_url();
//add submenu options
if (elgg_get_context() == "thewire") {
if ((elgg_get_page_owner_guid() == get_loggedin_userid() || !elgg_get_page_owner_guid()) && isloggedin()) {
- add_submenu_item(elgg_echo('thewire:read'),$CONFIG->wwwroot."pg/thewire/" . get_loggedin_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");
+ add_submenu_item(elgg_echo('thewire:read'),"{$base_url}pg/thewire/" . get_loggedin_user()->username);
+ add_submenu_item(elgg_echo('thewire:everyone'),"{$base_url}mod/thewire/everyone.php");
}
}
elgg_register_event_handler('init','system','thewire_init');
elgg_register_event_handler('pagesetup','system','thewire_pagesetup');
- // Register actions
- global $CONFIG;
- elgg_register_action("thewire/add", $CONFIG->pluginspath . "thewire/actions/add.php");
- elgg_register_action("thewire/delete", $CONFIG->pluginspath . "thewire/actions/delete.php");
+
?>
* @return string
*/
function uservalidationbyemail_generate_code($user_guid, $email_address) {
- global $CONFIG;
+
+ $site_url = elgg_get_site_url();
// Note I bind to site URL, this is important on multisite!
- return md5($user_guid . $email_address . $CONFIG->site->url . get_site_secret());
+ return md5($user_guid . $email_address . $site_url . get_site_secret());
}
/**
function uservalidationbyemail_request_validation($user_guid) {
global $CONFIG;
+ $site_url = elgg_get_site_url();
+
$user_guid = (int)$user_guid;
$user = get_entity($user_guid);
if (($user) && ($user instanceof ElggUser)) {
// Work out validate link
$code = uservalidationbyemail_generate_code($user_guid, $user->email);
- $link = "{$CONFIG->site->url}pg/uservalidationbyemail/confirm?u=$user_guid&c=$code";
+ $link = "{$site_url}pg/uservalidationbyemail/confirm?u=$user_guid&c=$code";
$site = $CONFIG->site;
// Send validation email
elgg_register_event_handler('init', 'system', 'uservalidationbyemail_init');
function uservalidationbyemail_init() {
- global $CONFIG;
require_once dirname(__FILE__) . '/lib/functions.php';
* @param array $page
*/
function uservalidationbyemail_page_handler($page) {
- global $CONFIG;
if (isset($page[0]) && $page[0] == 'confirm') {
$code = sanitise_string(get_input('c', FALSE));