diff options
-rw-r--r-- | mod/members/index.php | 65 | ||||
-rw-r--r-- | mod/members/languages/en.php | 42 | ||||
-rw-r--r-- | mod/members/start.php | 14 | ||||
-rw-r--r-- | mod/members/views/default/members/css.php | 56 | ||||
-rw-r--r-- | mod/members/views/default/members/members_navigation.php (renamed from mod/members/views/default/members/members_sort_menu.php) | 50 | ||||
-rw-r--r-- | mod/members/views/default/members/online.php | 11 | ||||
-rw-r--r-- | mod/members/views/default/members/search.php | 24 |
7 files changed, 110 insertions, 152 deletions
diff --git a/mod/members/index.php b/mod/members/index.php index ecfcabb1c..d9ef0a732 100644 --- a/mod/members/index.php +++ b/mod/members/index.php @@ -1,7 +1,6 @@ <?php - /** - * Elgg members index page - called from filter or search + * Elgg members index page * * @package ElggMembers * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 @@ -11,7 +10,14 @@ */ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - + +// Get the current page's owner +$page_owner = page_owner_entity(); +if ($page_owner === false || is_null($page_owner)) { + $page_owner = $_SESSION['user']; + set_page_owner($page_owner->getGUID()); +} + // get filter parameters $limit = get_input('limit', 10); $offset = get_input('offset', 0); @@ -20,45 +26,54 @@ $filter = get_input("filter", "newest"); // search options $tag = get_input('tag'); +// friends links +$area1 = "<div class='submenu page_navigation'>"; +$area1 .= "<ul><li><a href=\"" . $CONFIG->wwwroot."pg/friends/" . page_owner_entity()->username . "\">". elgg_echo('friends') . "</a></li>"; +$area1 .= "<li><a href=\"" . $CONFIG->wwwroot."pg/friendsof/" . page_owner_entity()->username . "\">". elgg_echo('friends:of') . "</a></li>"; +$area1 .= "<li class='selected'><a href=\"" . $CONFIG->wwwroot."mod/members/index.php\">". elgg_echo('members:browse') . "</a></li>"; +$area1 .= "</ul></div>"; //search members -$sidebar = elgg_view("members/search"); - -// get the correct content based on filter/search -switch ($filter) { +$area1 .= elgg_view("members/search"); + +// count members +$members = get_number_users(); + +// title +$pagetitle = elgg_echo("members:members")." ({$members})"; +$area2 = elgg_view_title($pagetitle); + +//get the correct view based on filter +switch($filter){ + case "newest": + $content = list_entities("user","",0,10,false); + break; case "pop": $filter_content = list_entities_by_relationship_count('friend', true, '', '', 0, 10, false); - break; + break; case "active": - $filter_content = elgg_view("members/online"); - break; + $filter_content = get_online_users(); + break; // search based on name case "search": set_context('search'); $filter_content = list_user_search($tag); - break; + 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; + break; case "newest": case 'default': $filter_content = elgg_list_entities(array('type' => 'user', 'offset' => $offset, 'full_view' => FALSE)); - break; + 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')); +$area2 .= elgg_view('page_elements/elgg_content', array('body' => elgg_view("members/members_navigation", array("count" => $members, "filter" => $filter)) . "<div class='members_list'>".$filter_content."</div>", 'subclass' => 'members')); -$body = elgg_view_layout("sidebar_boxes", $sidebar, $main_content); +//select the correct canvas area +$body = elgg_view_layout("one_column_with_sidebar", $area1, $area2); -page_draw(elgg_echo('members:members'), $body); +// Display page +page_draw(sprintf(elgg_echo('members:members'), $page_owner->name), $body);
\ No newline at end of file diff --git a/mod/members/languages/en.php b/mod/members/languages/en.php index a6c4d0079..fd99aa670 100644 --- a/mod/members/languages/en.php +++ b/mod/members/languages/en.php @@ -1,21 +1,25 @@ <?php +/** + * Elgg members language + * + * @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/ + */ - $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 +$english = array( + 'members:members' => "Site members", + 'members:online' => "Members active now", + 'members:browse' => "Browse members", + 'members:active' => "site members", + 'members:searchtag' => "Member search via tag", + 'members:searchname' => "Member search via name", + + 'members:label:newest' => 'Newest', + 'members:label:popular' => 'Popular', + 'members:label:active' => 'Active', +); + +add_translation('en', $english);
\ No newline at end of file diff --git a/mod/members/start.php b/mod/members/start.php index fa6810157..0a66cacbf 100644 --- a/mod/members/start.php +++ b/mod/members/start.php @@ -1,8 +1,6 @@ <?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 @@ -12,20 +10,10 @@ */ 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'); +register_elgg_event_handler('init','system','members_init');
\ No newline at end of file diff --git a/mod/members/views/default/members/css.php b/mod/members/views/default/members/css.php index 048d71bad..3b8cc1cf0 100644 --- a/mod/members/views/default/members/css.php +++ b/mod/members/views/default/members/css.php @@ -1,54 +1,23 @@ <?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/ - */ - +/** + * Elgg Members Css + * + * @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_list { + } .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; @@ -60,5 +29,4 @@ } #memberssearchform .search_input { width:176px; -} - +}
\ No newline at end of file diff --git a/mod/members/views/default/members/members_sort_menu.php b/mod/members/views/default/members/members_navigation.php index e9ad96039..6abe6f348 100644 --- a/mod/members/views/default/members/members_sort_menu.php +++ b/mod/members/views/default/members/members_navigation.php @@ -1,29 +1,23 @@ -<?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"); - ?> +<?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 class="elgg_horizontal_tabbed_nav margin_top">
+<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>
\ No newline at end of file diff --git a/mod/members/views/default/members/online.php b/mod/members/views/default/members/online.php deleted file mode 100644 index cfbe062b4..000000000 --- a/mod/members/views/default/members/online.php +++ /dev/null @@ -1,11 +0,0 @@ -<?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 index 69d8c06bf..f908d92c4 100644 --- a/mod/members/views/default/members/search.php +++ b/mod/members/views/default/members/search.php @@ -1,19 +1,19 @@ <?php +/** + * Elgg Members search + * + * @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/ + */ - /** - * Simple member search - **/ - -$tag_string = elgg_echo('members:search:tags'); -$name_string = elgg_echo('members:search:name'); - -?> - -<div class="sidebarBox"> +<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="text" name="tag" value="Member tags" onclick="if (this.value=='Member tags') { 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" /> @@ -22,7 +22,7 @@ $name_string = elgg_echo('members:search:name'); <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="text" name="tag" value="Members name" onclick="if (this.value=='Members name') { 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" /> |