aboutsummaryrefslogtreecommitdiff
path: root/mod/members
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 17:53:05 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 17:53:05 +0000
commit4766f36a4d74924f21ff329c4318ce4e069ffa04 (patch)
tree969b84632f2a8b0db79788a8a6db8e41d63e5cb4 /mod/members
parent57a217fd6b708844407486046a1faa23b46cac08 (diff)
downloadelgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.gz
elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.bz2
Pulled in the interface changes.
git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/members')
-rw-r--r--mod/members/index.php64
-rw-r--r--mod/members/languages/en.php21
-rw-r--r--mod/members/manifest.xml10
-rw-r--r--mod/members/start.php31
-rw-r--r--mod/members/views/default/members/css.php64
-rw-r--r--mod/members/views/default/members/members_sort_menu.php29
-rw-r--r--mod/members/views/default/members/online.php11
-rw-r--r--mod/members/views/default/members/search.php32
8 files changed, 262 insertions, 0 deletions
diff --git a/mod/members/index.php b/mod/members/index.php
new file mode 100644
index 000000000..ecfcabb1c
--- /dev/null
+++ b/mod/members/index.php
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * Elgg members index page - called from filter or search
+ *
+ * @package ElggMembers
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+// get filter parameters
+$limit = get_input('limit', 10);
+$offset = get_input('offset', 0);
+$filter = get_input("filter", "newest");
+
+// search options
+$tag = get_input('tag');
+
+
+//search members
+$sidebar = elgg_view("members/search");
+
+// get the correct content based on filter/search
+switch ($filter) {
+ case "pop":
+ $filter_content = list_entities_by_relationship_count('friend', true, '', '', 0, 10, false);
+ break;
+ case "active":
+ $filter_content = elgg_view("members/online");
+ break;
+ // search based on name
+ case "search":
+ set_context('search');
+ $filter_content = list_user_search($tag);
+ break;
+ // search based on tags
+ case "search_tags":
+ $filter_content = trigger_plugin_hook('search','',$tag,"");
+ $filter_content .= list_entities_from_metadata("", $tag, "user", "", "", 10, false, false);
+ break;
+ case "newest":
+ case 'default':
+ $filter_content = elgg_list_entities(array('type' => 'user', 'offset' => $offset, 'full_view' => FALSE));
+ break;
+}
+
+// create the members navigation/filtering
+$members = get_number_users();
+$members_nav = elgg_view("members/members_sort_menu", array("count" => $members, "filter" => $filter));
+
+$content = $members_nav . $filter_content;
+
+// title
+$main_content = elgg_view_title(elgg_echo("members:members"));
+
+$main_content .= elgg_view('page_elements/contentwrapper', array('body' => $content, 'subclass' => 'members'));
+
+$body = elgg_view_layout("sidebar_boxes", $sidebar, $main_content);
+
+page_draw(elgg_echo('members:members'), $body);
diff --git a/mod/members/languages/en.php b/mod/members/languages/en.php
new file mode 100644
index 000000000..a6c4d0079
--- /dev/null
+++ b/mod/members/languages/en.php
@@ -0,0 +1,21 @@
+<?php
+
+ $english = array(
+
+ 'members:members' => "Members",
+ 'members:online' => "Users active now",
+ 'members:active' => "site users",
+ 'members:searchtag' => "User search via tag",
+ 'members:searchname' => "User search via name",
+
+ 'members:label:newest' => 'Newest',
+ 'members:label:popular' => 'Popular',
+ 'members:label:active' => 'Active',
+ 'members:search:name' => 'Users name',
+ 'members:search:tags' => 'Tags',
+
+ );
+
+ add_translation("en",$english);
+
+?> \ No newline at end of file
diff --git a/mod/members/manifest.xml b/mod/members/manifest.xml
new file mode 100644
index 000000000..2248f8853
--- /dev/null
+++ b/mod/members/manifest.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest>
+ <field key="author" value="Curverider" />
+ <field key="version" value="1.7" />
+ <field key="description" value="A simple plugin to let users browser other members." />
+ <field key="website" value="http://www.elgg.org/" />
+ <field key="copyright" value="(C) Curverider 2008-2010" />
+ <field key="licence" value="GNU Public License version 2" />
+ <field key="elgg_version" value="2010030101" />
+</plugin_manifest>
diff --git a/mod/members/start.php b/mod/members/start.php
new file mode 100644
index 000000000..fa6810157
--- /dev/null
+++ b/mod/members/start.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * Elgg members plugin
+ * This plugin has some interesting options for users; see who is online, site members,
+ *
+ * @package Elggmembers
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+function members_init() {
+
+ global $CONFIG;
+
+ elgg_extend_view('css','members/css');
+
+
+ // Set up menu for logged in users
+ if (isloggedin()) {
+ add_menu(elgg_echo('members:members'), $CONFIG->wwwroot . "mod/members/index.php");
+ }
+
+}
+
+// @todo - use page handler for members index
+register_elgg_event_handler('pagesetup','system','members_pagesetup');
+
+register_elgg_event_handler('init','system','members_init');
diff --git a/mod/members/views/default/members/css.php b/mod/members/views/default/members/css.php
new file mode 100644
index 000000000..048d71bad
--- /dev/null
+++ b/mod/members/views/default/members/css.php
@@ -0,0 +1,64 @@
+<?php
+
+ /**
+ * Elgg Members
+ *
+ * @package Members
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+?>
+
+/* new members page */
+.members .search_listing {
+ border:2px solid #cccccc;
+ margin:0 0 5px 0;
+}
+.members .search_listing:hover {
+ background:#dedede;
+}
+.members .group_count {
+ font-weight: bold;
+ color: #666666;
+ margin:0 0 5px 4px;
+}
+.members .search_listing_info {
+ color:#666666;
+}
+
+.members .profile_status {
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ background:#bbdaf7;
+ line-height:1.2em;
+ padding:2px 4px;
+}
+.members .profile_status span {
+ font-size:90%;
+ color:#666666;
+}
+.members p.owner_timestamp {
+ padding-left:3px;
+}
+.members .pagination {
+ border:2px solid #cccccc;
+ margin:5px 0 5px 0;
+}
+
+
+#memberssearchform {
+ border-bottom: 1px solid #cccccc;
+ margin-bottom: 10px;
+}
+#memberssearchform input[type="submit"] {
+ padding:2px;
+ height:auto;
+ margin:4px 0 5px 0;
+}
+#memberssearchform .search_input {
+ width:176px;
+}
+
diff --git a/mod/members/views/default/members/members_sort_menu.php b/mod/members/views/default/members/members_sort_menu.php
new file mode 100644
index 000000000..e9ad96039
--- /dev/null
+++ b/mod/members/views/default/members/members_sort_menu.php
@@ -0,0 +1,29 @@
+<?php
+
+ /**
+ * A simple view to provide the user with group filters and the number of group on the site
+ **/
+
+ $members = $vars['count'];
+ if(!$num_groups)
+ $num_groups = 0;
+
+ $filter = $vars['filter'];
+
+ //url
+ $url = $vars['url'] . "mod/members/index.php";
+
+?>
+<div id="elgg_horizontal_tabbed_nav">
+<ul>
+ <li <?php if($filter == "newest") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=newest"><?php echo elgg_echo('members:label:newest'); ?></a></li>
+ <li <?php if($filter == "pop") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=pop"><?php echo elgg_echo('members:label:popular'); ?></a></li>
+ <li <?php if($filter == "active") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=active"><?php echo elgg_echo('members:label:active'); ?></a></li>
+</ul>
+</div>
+
+<div class="group_count">
+ <?php
+ echo $members . " " . elgg_echo("members:active");
+ ?>
+</div> \ No newline at end of file
diff --git a/mod/members/views/default/members/online.php b/mod/members/views/default/members/online.php
new file mode 100644
index 000000000..cfbe062b4
--- /dev/null
+++ b/mod/members/views/default/members/online.php
@@ -0,0 +1,11 @@
+<?php
+
+ /**
+ * Show members online
+ **/
+
+ echo "<div class=\"members_online\">";
+ echo get_online_users();
+ echo "</div>";
+
+?> \ No newline at end of file
diff --git a/mod/members/views/default/members/search.php b/mod/members/views/default/members/search.php
new file mode 100644
index 000000000..69d8c06bf
--- /dev/null
+++ b/mod/members/views/default/members/search.php
@@ -0,0 +1,32 @@
+<?php
+
+ /**
+ * Simple member search
+ **/
+
+$tag_string = elgg_echo('members:search:tags');
+$name_string = elgg_echo('members:search:name');
+
+?>
+
+<div class="sidebarBox">
+
+<h3><?php echo elgg_echo('members:searchtag'); ?></h3>
+<form id="memberssearchform" action="<?php echo $vars['url']; ?>mod/members/index.php?" method="get">
+ <input type="text" name="tag" value="<?php echo $tag_string; ?>" onclick="if (this.value=='<?php echo $tag_string; ?>') { this.value='' }" class="search_input" />
+ <input type="hidden" name="subtype" value="" />
+ <input type="hidden" name="object" value="user" />
+ <input type="hidden" name="filter" value="search_tags" />
+ <input type="submit" value="<?php echo elgg_echo('go'); ?>" />
+</form>
+
+<h3><?php echo elgg_echo('members:searchname'); ?></h3>
+<form id="memberssearchform" action="<?php echo $vars['url']; ?>mod/members/index.php?" method="get">
+ <input type="text" name="tag" value="<?php echo $name_string; ?>" onclick="if (this.value=='<?php echo $name_string; ?>') { this.value='' }" class="search_input" />
+ <input type="hidden" name="subtype" value="" />
+ <input type="hidden" name="object" value="user" />
+ <input type="hidden" name="filter" value="search" />
+ <input type="submit" value="<?php echo elgg_echo('go'); ?>" />
+</form>
+
+</div> \ No newline at end of file