aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-01 11:32:39 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-01 11:32:39 +0000
commit3cfad8ca8394976823bbacb728821ca371dfd6d8 (patch)
tree2340be281845fbae688986c7129b84c26e913a0b
parentdf9d347e7d5a316a7f5c85ba284ea68c26fe6d2c (diff)
downloadelgg-3cfad8ca8394976823bbacb728821ca371dfd6d8.tar.gz
elgg-3cfad8ca8394976823bbacb728821ca371dfd6d8.tar.bz2
Fixes #3231 welcome back, members plugin
git-svn-id: http://code.elgg.org/elgg/trunk@8895 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/users.php42
-rw-r--r--languages/en.php8
-rw-r--r--mod/members/languages/en.php16
-rw-r--r--mod/members/manifest.xml17
-rw-r--r--mod/members/pages/members/index.php (renamed from pages/members/index.php)4
-rw-r--r--mod/members/pages/members/search.php (renamed from pages/members/search.php)2
-rw-r--r--mod/members/start.php39
-rw-r--r--mod/members/views/default/members/nav.php (renamed from views/default/core/members/nav.php)0
-rw-r--r--mod/members/views/default/members/sidebar.php (renamed from views/default/core/members/sidebar.php)0
9 files changed, 82 insertions, 46 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 638e96aab..4c28acc87 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1419,29 +1419,6 @@ function elgg_profile_page_handler($page) {
}
/**
- * Members page handler
- *
- * @param array $page url segments
- */
-function elgg_members_page_handler($page) {
- global $CONFIG;
-
- if (!isset($page[0])) {
- $page[0] = 'newest';
- }
-
- $vars = array();
- $vars['page'] = $page[0];
-
- if ($page[0] == 'search') {
- $vars['search_type'] = $page[1];
- require_once("{$CONFIG->path}pages/members/search.php");
- } else {
- require_once("{$CONFIG->path}pages/members/index.php");
- }
-}
-
-/**
* Sets up user-related menu items
*
* @return void
@@ -1525,7 +1502,6 @@ function users_pagesetup() {
* @return void
*/
function users_init() {
- global $CONFIG;
elgg_register_page_handler('friends', 'friends_page_handler');
elgg_register_page_handler('friendsof', 'friends_of_page_handler');
@@ -1533,20 +1509,16 @@ function users_init() {
elgg_register_page_handler('register', 'registration_page_handler');
elgg_register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler');
elgg_register_page_handler('login', 'elgg_user_login_page_handler');
- elgg_register_page_handler('members', 'elgg_members_page_handler');
elgg_register_page_handler('avatar', 'elgg_avatar_page_handler');
elgg_register_page_handler('profile', 'elgg_profile_page_handler');
elgg_register_page_handler('collections', 'collections_page_handler');
- $item = new ElggMenuItem('members', elgg_echo('members'), 'members');
- elgg_register_menu_item('site', $item);
-
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'elgg_user_hover_menu');
- elgg_register_action("register", '', 'public');
- elgg_register_action("useradd", '', 'public');
- elgg_register_action("friends/add");
- elgg_register_action("friends/remove");
+ elgg_register_action('register', '', 'public');
+ elgg_register_action('useradd', '', 'public');
+ elgg_register_action('friends/add');
+ elgg_register_action('friends/remove');
elgg_register_action('avatar/upload');
elgg_register_action('avatar/crop');
elgg_register_action('profile/edit');
@@ -1557,10 +1529,10 @@ function users_init() {
elgg_register_plugin_hook_handler('entity:icon:url', 'user', 'user_avatar_hook');
- elgg_register_action("user/passwordreset", '', 'public');
- elgg_register_action("user/requestnewpassword", '', 'public');
+ elgg_register_action('user/passwordreset', '', 'public');
+ elgg_register_action('user/requestnewpassword', '', 'public');
- elgg_register_widget_type('friends', elgg_echo("friends"), elgg_echo('friends:widget:description'));
+ elgg_register_widget_type('friends', elgg_echo('friends'), elgg_echo('friends:widget:description'));
// extend the account settings form
elgg_extend_view('forms/account/settings', 'core/settings/account/name', 100);
diff --git a/languages/en.php b/languages/en.php
index 034282d84..cb970c57d 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -755,14 +755,6 @@ $english = array(
'river:comments:more' => '+%u more',
'river:generic_comment' => 'commented on %s %s',
- 'members:label:newest' => 'Newest',
- 'members:label:popular' => 'Popular',
- 'members:label:online' => 'Online',
- 'members:searchname' => 'Search members by name',
- 'members:searchtag' => 'Search members by tag',
- 'members:title:searchname' => 'Member search for %s',
- 'members:title:searchtag' => 'Members tagged with %s',
-
'friends:widget:description' => "Displays some of your friends.",
'friends:num_display' => "Number of friends to display",
'friends:icon_size' => "Icon size",
diff --git a/mod/members/languages/en.php b/mod/members/languages/en.php
new file mode 100644
index 000000000..73783143e
--- /dev/null
+++ b/mod/members/languages/en.php
@@ -0,0 +1,16 @@
+<?php
+/**
+ * Members English language file
+ */
+
+$english = array(
+ 'members:label:newest' => 'Newest',
+ 'members:label:popular' => 'Popular',
+ 'members:label:online' => 'Online',
+ 'members:searchname' => 'Search members by name',
+ 'members:searchtag' => 'Search members by tag',
+ 'members:title:searchname' => 'Member search for %s',
+ 'members:title:searchtag' => 'Members tagged with %s',
+);
+
+add_translation('en', $english);
diff --git a/mod/members/manifest.xml b/mod/members/manifest.xml
new file mode 100644
index 000000000..b96684198
--- /dev/null
+++ b/mod/members/manifest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8">
+ <name>Members</name>
+ <author>Core developers</author>
+ <version>1.8</version>
+ <category>bundled</category>
+ <description>Lists the members of your site</description>
+ <website>http://www.elgg.org/</website>
+ <copyright>See COPYRIGHT.txt</copyright>
+ <license>GNU Public License version 2</license>
+ <requires>
+ <type>elgg_version</type>
+ <version>2010030101</version>
+ </requires>
+ <activate_on_install>true</activate_on_install>
+ <admin_interface>advanced</admin_interface>
+</plugin_manifest> \ No newline at end of file
diff --git a/pages/members/index.php b/mod/members/pages/members/index.php
index 82adf2a4a..4f23c6322 100644
--- a/pages/members/index.php
+++ b/mod/members/pages/members/index.php
@@ -26,10 +26,10 @@ switch ($vars['page']) {
$params = array(
'content' => $content,
- 'sidebar' => elgg_view('core/members/sidebar'),
+ 'sidebar' => elgg_view('members/sidebar'),
'title' => $title . " ($num_members)",
'buttons' => '',
- 'filter_override' => elgg_view('core/members/nav', array('selected' => $vars['page'])),
+ 'filter_override' => elgg_view('members/nav', array('selected' => $vars['page'])),
);
$body = elgg_view_layout('content', $params);
diff --git a/pages/members/search.php b/mod/members/pages/members/search.php
index e9b4eb170..39b54990e 100644
--- a/pages/members/search.php
+++ b/mod/members/pages/members/search.php
@@ -36,7 +36,7 @@ if ($vars['search_type'] == 'tag') {
$params = array(
'title' => $title,
'content' => $content,
- 'sidebar' => elgg_view('core/members/sidebar'),
+ 'sidebar' => elgg_view('members/sidebar'),
);
$body = elgg_view_layout('one_sidebar', $params);
diff --git a/mod/members/start.php b/mod/members/start.php
new file mode 100644
index 000000000..2c1793c17
--- /dev/null
+++ b/mod/members/start.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Members plugin intialization
+ */
+
+elgg_register_event_handler('init', 'system', 'members_init');
+
+/**
+ * Initialize page handler and site menu item
+ */
+function members_init() {
+ elgg_register_page_handler('members', 'members_page_handler');
+
+ $item = new ElggMenuItem('members', elgg_echo('members'), 'members');
+ elgg_register_menu_item('site', $item);
+}
+
+/**
+ * Members page handler
+ *
+ * @param array $page url segments
+ */
+function members_page_handler($page) {
+ $base = elgg_get_plugins_path() . 'members/pages/members';
+
+ if (!isset($page[0])) {
+ $page[0] = 'newest';
+ }
+
+ $vars = array();
+ $vars['page'] = $page[0];
+
+ if ($page[0] == 'search') {
+ $vars['search_type'] = $page[1];
+ require_once "$base/search.php";
+ } else {
+ require_once "$base/index.php";
+ }
+}
diff --git a/views/default/core/members/nav.php b/mod/members/views/default/members/nav.php
index 510d1849b..510d1849b 100644
--- a/views/default/core/members/nav.php
+++ b/mod/members/views/default/members/nav.php
diff --git a/views/default/core/members/sidebar.php b/mod/members/views/default/members/sidebar.php
index 8fa0fe02b..8fa0fe02b 100644
--- a/views/default/core/members/sidebar.php
+++ b/mod/members/views/default/members/sidebar.php