aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/invitefriends/index.php19
-rw-r--r--mod/invitefriends/start.php46
-rw-r--r--mod/invitefriends/views/default/invitefriends/formitems.php2
-rw-r--r--mod/notifications/groups.php13
-rw-r--r--mod/notifications/index.php13
-rw-r--r--mod/notifications/start.php20
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/form.php8
-rw-r--r--mod/notifications/views/default/notifications/subscriptions/groupsform.php1
8 files changed, 69 insertions, 53 deletions
diff --git a/mod/invitefriends/index.php b/mod/invitefriends/index.php
deleted file mode 100644
index 7b4c34562..000000000
--- a/mod/invitefriends/index.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-/**
- * Elgg invite page
- *
- * @package ElggInviteFriends
- */
-
-require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
-
-gatekeeper();
-
-elgg_set_context('friends');
-set_page_owner(get_loggedin_userid());
-
-$body = elgg_view('invitefriends/form');
-$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
-
-echo elgg_view_page(elgg_echo('friends:invite'), $body);
diff --git a/mod/invitefriends/start.php b/mod/invitefriends/start.php
index abba12f20..bd470f144 100644
--- a/mod/invitefriends/start.php
+++ b/mod/invitefriends/start.php
@@ -5,16 +5,42 @@
* @package ElggInviteFriends
*/
+elgg_register_event_handler('init', 'system', 'invitefriends_init');
+
+function invitefriends_init() {
+ register_page_handler('invite', 'invitefriends_page_handler');
+
+ elgg_register_action('invitefriends/invite', elgg_get_plugin_path() . 'invitefriends/actions/invite.php');
+
+ $params = array(
+ 'name' => 'invite',
+ 'title' => elgg_echo('friends:invite'),
+ 'url' => "pg/invite/",
+ 'contexts' => array('friends'),
+ );
+ elgg_register_menu_item('page', $params);
+}
+
/**
- * Add menu item for invite friends
+ * Page handler function
+ *
+ * @param array $page Page URL segments
*/
-function invitefriends_pagesetup() {
- if (elgg_get_context() == "friends" ||
- elgg_get_context() == "friendsof" ||
- elgg_get_context() == "collections") {
- add_submenu_item(elgg_echo('friends:invite'), "mod/invitefriends/",'invite');
- }
-}
+function invitefriends_page_handler($page) {
+ gatekeeper();
-elgg_register_action('invitefriends/invite', elgg_get_plugin_path() . 'invitefriends/actions/invite.php');
-elgg_register_event_handler('pagesetup', 'system', 'invitefriends_pagesetup');
+ elgg_set_context('friends');
+ set_page_owner(get_loggedin_userid());
+
+ $title = elgg_echo('friends:invite');
+
+ $body = elgg_view('invitefriends/form');
+
+ $params = array(
+ 'content' => $body,
+ 'title' => $title,
+ );
+ $body = elgg_view_layout('one_sidebar', $params);
+
+ echo elgg_view_page($title, $body);
+}
diff --git a/mod/invitefriends/views/default/invitefriends/formitems.php b/mod/invitefriends/views/default/invitefriends/formitems.php
index dceac6bbc..6d381a8ed 100644
--- a/mod/invitefriends/views/default/invitefriends/formitems.php
+++ b/mod/invitefriends/views/default/invitefriends/formitems.php
@@ -7,13 +7,11 @@
*/
if ($CONFIG->allow_registration) {
- $invite = elgg_echo('friends:invite');
$introduction = elgg_echo('invitefriends:introduction');
$message = elgg_echo('invitefriends:message');
$default = elgg_echo('invitefriends:message:default', array($CONFIG->site->name));
echo <<< HTML
-<h2>$invite</h2>
<p class="margin-top">
<label>
$introduction
diff --git a/mod/notifications/groups.php b/mod/notifications/groups.php
index 10e320032..c4f59c049 100644
--- a/mod/notifications/groups.php
+++ b/mod/notifications/groups.php
@@ -1,5 +1,4 @@
<?php
-
/**
* Elgg notifications plugin group index
*
@@ -17,6 +16,8 @@ set_page_owner(get_loggedin_userid());
// Set the context to settings
elgg_set_context('settings');
+$title = elgg_echo('notifications:subscriptions:changesettings:groups');
+
// Get the form
$people = array();
@@ -29,8 +30,10 @@ $body = elgg_view('input/form',array(
'action' => 'action/notificationsettings/groupsave'
));
-// Insert it into the correct canvas layout
-$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
-
+$params = array(
+ 'content' => $body,
+ 'title' => $title,
+);
+$body = elgg_view_layout('one_sidebar', $params);
-echo elgg_view_page(elgg_echo('notifications:subscriptions:changesettings:groups'), $body);
+echo elgg_view_page($title, $body);
diff --git a/mod/notifications/index.php b/mod/notifications/index.php
index c162c34b3..4536b8788 100644
--- a/mod/notifications/index.php
+++ b/mod/notifications/index.php
@@ -1,5 +1,4 @@
<?php
-
/**
* Elgg notifications plugin index
*
@@ -20,6 +19,8 @@ elgg_register_js($js_url, 'friendsPicker');
// Set the context to settings
elgg_set_context('settings');
+$title = elgg_echo('notifications:subscriptions:changesettings');
+
// Get the form
$people = array();
if ($people_ents = elgg_get_entities_from_relationship(array('relationship' => 'notify', 'relationship_guid' => get_loggedin_userid(), 'types' => 'user', 'limit' => 99999))) {
@@ -30,8 +31,10 @@ if ($people_ents = elgg_get_entities_from_relationship(array('relationship' => '
$body = elgg_view('notifications/subscriptions/form', array('people' => $people));
-// Insert it into the correct canvas layout
-$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
-
+$params = array(
+ 'content' => $body,
+ 'title' => $title,
+);
+$body = elgg_view_layout('one_sidebar', $params);
-echo elgg_view_page(elgg_echo('notifications:subscriptions:changesettings'), $body);
+echo elgg_view_page($title, $body);
diff --git a/mod/notifications/start.php b/mod/notifications/start.php
index 1bb99da35..859f4ac14 100644
--- a/mod/notifications/start.php
+++ b/mod/notifications/start.php
@@ -60,11 +60,23 @@ function notifications_page_handler($page) {
*
*/
function notifications_plugin_pagesetup() {
- global $CONFIG;
- if (elgg_get_context() == 'settings') {
- add_submenu_item(elgg_echo('notifications:subscriptions:changesettings'), "pg/notifications/personal");
+ if (elgg_get_context() == "settings" && get_loggedin_userid()) {
+ $user = get_loggedin_user();
+
+ $params = array(
+ 'name' => '2_a_user_notify',
+ 'title' => elgg_echo('notifications:subscriptions:changesettings'),
+ 'url' => "pg/notifications/personal",
+ );
+ elgg_register_menu_item('page', $params);
+
if (is_plugin_enabled('groups')) {
- add_submenu_item(elgg_echo('notifications:subscriptions:changesettings:groups'), "pg/notifications/group");
+ $params = array(
+ 'name' => '2_group_notify',
+ 'title' => elgg_echo('notifications:subscriptions:changesettings:groups'),
+ 'url' => "pg/notifications/group",
+ );
+ elgg_register_menu_item('page', $params);
}
}
}
diff --git a/mod/notifications/views/default/notifications/subscriptions/form.php b/mod/notifications/views/default/notifications/subscriptions/form.php
index 449f908a7..b7a34f98e 100644
--- a/mod/notifications/views/default/notifications/subscriptions/form.php
+++ b/mod/notifications/views/default/notifications/subscriptions/form.php
@@ -1,14 +1,8 @@
<?php
-
/**
- * Elgg SMS Client
- *
- * @package ElggSMS
+ * Elgg personal notifications
*/
-
-// Echo title
- echo elgg_view_title(elgg_echo('notifications:subscriptions:changesettings'));
echo elgg_view('subscriptions/form/additions',$vars);
diff --git a/mod/notifications/views/default/notifications/subscriptions/groupsform.php b/mod/notifications/views/default/notifications/subscriptions/groupsform.php
index bf75f5931..b5328e5ab 100644
--- a/mod/notifications/views/default/notifications/subscriptions/groupsform.php
+++ b/mod/notifications/views/default/notifications/subscriptions/groupsform.php
@@ -17,7 +17,6 @@ foreach($NOTIFICATION_HANDLERS as $method => $foo) {
$subsbig[$method] = $tmparray;
}
-echo elgg_view_title(elgg_echo('notifications:subscriptions:changesettings:groups'));
?>
<div class="user-settings margin-top">