diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/bookmarks/add.php | 29 | ||||
-rw-r--r-- | mod/bookmarks/index.php | 28 | ||||
-rw-r--r-- | mod/groups/forum.php | 31 | ||||
-rw-r--r-- | mod/groups/views/default/forms/forums/addtopic.php | 56 | ||||
-rw-r--r-- | mod/groups/views/default/forum/viewposts.php | 77 | ||||
-rw-r--r-- | mod/messages/views/default/messages/messages.php | 81 |
6 files changed, 141 insertions, 161 deletions
diff --git a/mod/bookmarks/add.php b/mod/bookmarks/add.php index 6f4ca7889..e5bc67a1a 100644 --- a/mod/bookmarks/add.php +++ b/mod/bookmarks/add.php @@ -1,7 +1,7 @@ <?php /** * Elgg bookmarks plugin add bookmark page - * + * * @package ElggBookmarks * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Curverider <info@elgg.com> @@ -13,10 +13,10 @@ global $CONFIG; // Start engine require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - + // You need to be logged in for this one gatekeeper(); - + // Get the current page's owner $page_owner = page_owner_entity(); if ($page_owner === false || is_null($page_owner)) { @@ -25,17 +25,16 @@ if ($page_owner === false || is_null($page_owner)) { } if ($page_owner instanceof ElggGroup) $container = $page_owner->guid; - + //set up breadcrumbs -$area1 .= elgg_view('page_elements/breadcrumbs', array( - 'breadcrumb_root_url' => $CONFIG->wwwroot."mod/bookmarks/all.php", - 'breadcrumb_root_text' => elgg_echo('bookmarks:all'), - 'breadcrumb_currentpage' => elgg_echo("bookmarks:add") - )); - +elgg_push_breadcrumb(elgg_echo('bookmarks:all'), $CONFIG->wwwroot."mod/bookmarks/all.php"); +elgg_push_breadcrumb(elgg_echo("bookmarks:add")); + +$area1 .= elgg_view('navigation/breadcrumbs'); + // get the filter menu $area1 .= elgg_view('page_elements/content_header', array('context' => "action", 'type' => 'bookmarks')); - + // If we've been given a bookmark to edit, grab it if ($this_guid = get_input('bookmark',0)) { $entity = get_entity($this_guid); @@ -48,12 +47,12 @@ if ($this_guid = get_input('bookmark',0)) { $area3 = elgg_view('bookmarks/ownerblock'); // if logged in, get the bookmarklet -$area3 .= elgg_view("bookmarks/bookmarklet"); +$area3 .= elgg_view("bookmarks/bookmarklet"); //include a view for plugins to extend -$area3 .= elgg_view("bookmarks/sidebar_options", array("object_type" => 'bookmarks')); - +$area3 .= elgg_view("bookmarks/sidebar_options", array("object_type" => 'bookmarks')); + // Format page $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2, $area3); - + // Draw it echo page_draw(elgg_echo('bookmarks:add'),$body);
\ No newline at end of file diff --git a/mod/bookmarks/index.php b/mod/bookmarks/index.php index baff805bf..55f854121 100644 --- a/mod/bookmarks/index.php +++ b/mod/bookmarks/index.php @@ -1,7 +1,7 @@ <?php /** * Elgg bookmarks plugin index page - * + * * @package ElggBookmarks * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Curverider <info@elgg.com> @@ -19,20 +19,18 @@ if ($page_owner === false || is_null($page_owner)) { $page_owner = $_SESSION['user']; set_page_owner($page_owner->getGUID()); } - + +elgg_push_breadcrumb(elgg_echo('bookmarks:all'), $CONFIG->wwwroot."mod/bookmarks/all.php"); +elgg_push_breadcrumb(sprintf(elgg_echo("bookmarks:user"),$page_owner->name)); + //set bookmarks header -if(page_owner()== get_loggedin_user()->guid){ +if(page_owner() == get_loggedin_userid()) { $area1 .= elgg_view('page_elements/content_header', array('context' => "own", 'type' => 'bookmarks')); -}else{ - $area1 .= elgg_view('page_elements/breadcrumbs', array( - 'breadcrumb_root_url' => $CONFIG->wwwroot."mod/bookmarks/all.php", - 'breadcrumb_root_text' => elgg_echo('bookmarks:all'), - 'breadcrumb_currentpage' => sprintf(elgg_echo("bookmarks:user"),$page_owner->name) - )); - +} else { + $area1 .= elgg_view('navigation/breadcrumbs'); $area1 .= elgg_view('page_elements/content_header_member', array('type' => 'bookmarks')); } - + // List bookmarks set_context('search'); $bookmarks = list_entities('object','bookmarks',page_owner()); @@ -44,16 +42,16 @@ set_context('bookmarks'); //if the logged in user is not looking at their stuff, display the ownerblock if(page_owner() != get_loggedin_user()->guid){ $area3 = elgg_view('bookmarks/ownerblock'); -}else{ +}else{ if(isloggedin()){ // if logged in, get the bookmarklet $area3 .= elgg_view("bookmarks/bookmarklet"); - } + } } //include a view for plugins to extend -$area3 .= elgg_view("bookmarks/sidebar_options", array("object_type" => 'bookmarks')); +$area3 .= elgg_view("bookmarks/sidebar_options", array("object_type" => 'bookmarks')); // Format page $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2, $area3); - + // Draw it echo page_draw(sprintf(elgg_echo("bookmarks:user"),page_owner_entity()->name), $body);
\ No newline at end of file diff --git a/mod/groups/forum.php b/mod/groups/forum.php index 12c84adb5..f59c3ed30 100644 --- a/mod/groups/forum.php +++ b/mod/groups/forum.php @@ -1,7 +1,7 @@ <?php /** * Elgg groups forum - * + * * @package ElggGroups * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Curverider @@ -10,32 +10,27 @@ */ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); - + set_page_owner((int)get_input('group_guid')); if (!(page_owner_entity() instanceof ElggGroup)) forward(); - + group_gatekeeper(); - - //get any forum topics + //get any forum topics $topics = list_entities_from_annotations("object", "groupforumtopic", "group_topic_post", "", 20, 0, get_input('group_guid'), false, false, false); - set_context('search'); - - //set up breadcrumbs - $area1 = elgg_view('page_elements/breadcrumbs', array( - 'breadcrumb_root_url' => '', - 'breadcrumb_root_text' => 'Parent Group Name', - 'breadcrumb_currentpage' => elgg_echo('item:object:groupforumtopic') - )); - - + set_context('search'); + + // set up breadcrumbs + elgg_push_breadcrumb('Parent Group Name'); + elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic')); + $area1 .= elgg_view("forum/topics", array('topics' => $topics)); set_context('groups'); - + $body = elgg_view_layout('one_column_with_sidebar', $area1); - + $title = elgg_echo('item:object:groupforumtopic'); - + // Finally draw the page page_draw($title, $body); diff --git a/mod/groups/views/default/forms/forums/addtopic.php b/mod/groups/views/default/forms/forums/addtopic.php index 37075aa6d..e3bc3e1c6 100644 --- a/mod/groups/views/default/forms/forums/addtopic.php +++ b/mod/groups/views/default/forms/forums/addtopic.php @@ -1,13 +1,13 @@ <?php /** * Elgg Groups topic edit/add page - * + * * @package ElggGroups * @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/ - * + * * @uses $vars['object'] Optionally, the topic to edit */ @@ -20,22 +20,20 @@ $message_id = ""; $status = ""; $access_id = ACCESS_DEFAULT; - - // get the group guid - $group_guid = (int) get_input('group_guid'); - - // set breadcrumbs - echo elgg_view('page_elements/breadcrumbs', array( - 'breadcrumb_root_url' => '', - 'breadcrumb_root_text' => 'Parent Group Name', - 'breadcrumb_level1_url' => '#', - 'breadcrumb_level1_text' => elgg_echo('item:object:groupforumtopic'), - 'breadcrumb_currentpage' => elgg_echo("groups:addtopic") - )); - + + // get the group guid + $group_guid = (int) get_input('group_guid'); + + // set breadcrumbs + elgg_push_breadcrumb('', 'Parent Group Name'); + elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), ''); + elgg_push_breadcrumb(elgg_echo("groups:addtopic")); + + echo elgg_view('navigation/breadcrumbs'); + // set the title echo elgg_view_title(elgg_echo("groups:addtopic")); - + ?> <!-- display the input form --> <form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post" class="margin_top"> @@ -44,7 +42,7 @@ <p> <label><?php echo elgg_echo("title"); ?><br /> <?php - //display the topic title input + //display the topic title input echo elgg_view("input/text", array( "internalname" => "topictitle", "value" => $title, @@ -52,7 +50,7 @@ ?> </label> </p> - + <!-- display the tag input --> <p> <label><?php echo elgg_echo("tags"); ?><br /> @@ -62,11 +60,11 @@ "internalname" => "topictags", "value" => $tags, )); - + ?> </label> </p> - + <!-- topic message input --> <p class="longtext_editarea"> <label><?php echo elgg_echo("groups:topicmessage"); ?><br /> @@ -79,17 +77,17 @@ ?> </label> </p> - + <!-- set the topic status --> <p> - <label><?php echo elgg_echo("groups:topicstatus"); ?><br /> - <select name="status"> - <option value="open" <?php if($status == "") echo "SELECTED";?>><?php echo elgg_echo('groups:topicopen'); ?></option> - <option value="closed" <?php if($status == "closed") echo "SELECTED";?>><?php echo elgg_echo('groups:topicclosed'); ?></option> - </select> - </label> + <label><?php echo elgg_echo("groups:topicstatus"); ?><br /> + <select name="status"> + <option value="open" <?php if($status == "") echo "SELECTED";?>><?php echo elgg_echo('groups:topicopen'); ?></option> + <option value="closed" <?php if($status == "closed") echo "SELECTED";?>><?php echo elgg_echo('groups:topicclosed'); ?></option> + </select> + </label> </p> - + <!-- access --> <p> <label> @@ -97,7 +95,7 @@ <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?> </label> </p> - + <!-- required hidden info and submit button --> <p> <input type="hidden" name="group_guid" value="<?php echo $group_guid; ?>" /> diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php index efb7e595c..02ed06b62 100644 --- a/mod/groups/views/default/forum/viewposts.php +++ b/mod/groups/views/default/forum/viewposts.php @@ -1,8 +1,8 @@ <?php - /** + /** * Elgg groups plugin display topic posts - * + * * @package ElggGroups * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Curverider @@ -10,55 +10,48 @@ * @link http://elgg.com/ */ -?> + elgg_push_breadcrumb('', 'Parent Group Name'); + elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), ''); + elgg_push_breadcrumb($vars['entity']->title); -<?php - echo elgg_view('page_elements/breadcrumbs', array( - 'breadcrumb_root_url' => '', - 'breadcrumb_root_text' => 'Parent Group Name', - 'breadcrumb_level1_url' => '#', - 'breadcrumb_level1_text' => elgg_echo('item:object:groupforumtopic'), - 'breadcrumb_currentpage' => $vars['entity']->title - )); + echo elgg_view('navigation/breadcrumbs'); - + //display follow up comments + $count = $vars['entity']->countAnnotations('group_topic_post'); + $offset = (int) get_input('offset',0); - //display follow up comments - $count = $vars['entity']->countAnnotations('group_topic_post'); - $offset = (int) get_input('offset',0); - - $baseurl = $vars['url'] . "mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$vars['entity']->container_guid}"; - echo elgg_view('navigation/pagination',array( - 'limit' => 50, - 'offset' => $offset, - 'baseurl' => $baseurl, - 'count' => $count, - )); + $baseurl = $vars['url'] . "mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$vars['entity']->container_guid}"; + echo elgg_view('navigation/pagination',array( + 'limit' => 50, + 'offset' => $offset, + 'baseurl' => $baseurl, + 'count' => $count, + )); ?> <!-- grab the topic title --> <h2><?php echo $vars['entity']->title; ?></h2> <?php - - foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) { - - echo elgg_view("forum/topicposts",array('entity' => $post)); - + + foreach($vars['entity']->getAnnotations('group_topic_post', 50, $offset, "asc") as $post) { + + echo elgg_view("forum/topicposts",array('entity' => $post)); + } - + // check to find out the status of the topic and act - if($vars['entity']->status != "closed" && page_owner_entity()->isMember($vars['user'])){ - - //display the add comment form, this will appear after all the existing comments - echo elgg_view("forms/forums/addpost", array('entity' => $vars['entity'])); - - } elseif($vars['entity']->status == "closed") { - - //this topic has been closed by the owner - echo "<h2>" . elgg_echo("groups:topicisclosed") . "</h2>"; - echo "<p>" . elgg_echo("groups:topiccloseddesc") . "</p>"; - - } else { - } + if($vars['entity']->status != "closed" && page_owner_entity()->isMember($vars['user'])){ + + //display the add comment form, this will appear after all the existing comments + echo elgg_view("forms/forums/addpost", array('entity' => $vars['entity'])); + + } elseif($vars['entity']->status == "closed") { + + //this topic has been closed by the owner + echo "<h2>" . elgg_echo("groups:topicisclosed") . "</h2>"; + echo "<p>" . elgg_echo("groups:topiccloseddesc") . "</p>"; + + } else { + } ?> diff --git a/mod/messages/views/default/messages/messages.php b/mod/messages/views/default/messages/messages.php index 5c2630ad6..29178bf6d 100644 --- a/mod/messages/views/default/messages/messages.php +++ b/mod/messages/views/default/messages/messages.php @@ -17,15 +17,15 @@ if(get_input("type") == "sent"){ // send back to the users sentbox $url = $vars['url'] . "mod/messages/sent.php"; - // set up breadcrumbs context - $breadcrumb_root_text = elgg_echo('messages:sent'); + // set up breadcrumbs context + elgg_push_breadcrumb(elgg_echo('messages:sent'), $url); //this is used on the delete link so we know which type of message it is $type = "sent"; } else { //send back to the users inbox $url = $vars['url'] . "pg/messages/" . $vars['user']->username; - // set up breadcrumbs context - $breadcrumb_root_text = elgg_echo('messages:inbox'); + // set up breadcrumbs context + elgg_push_breadcrumb(elgg_echo('messages:inbox'), $url); //this is used on the delete link so we know which type of message it is $type = "inbox"; } @@ -41,11 +41,8 @@ if (isloggedin()) if ($vars['entity']->toId == $vars['user']->guid || $vars['entity']->owner_guid == $vars['user']->guid) { // display breadcrumbs - echo elgg_view('page_elements/breadcrumbs', array( - 'breadcrumb_root_url' => $url, - 'breadcrumb_root_text' => $breadcrumb_root_text, - 'breadcrumb_currentpage' => $vars['entity']->title - )); + elgg_push_breadcrumb($vars['entity']->title); + echo elgg_view('navigation/breadcrumbs'); ?> <!-- display the content header block --> <div id="content_header" class="clearfloat"> @@ -57,45 +54,45 @@ if (isloggedin()) 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), 'class' => "action_button disabled" - )); + )); ?> </div> </div> - - <div class="entity_listing messages clearfloat"> - <?php - // we need a different user icon and name depending on whether the user is reading the message - // from their inbox or sentbox. If it is the inbox, then the icon and name will be the person who sent - // the message. If it is the sentbox, the icon and name will be the user the message was sent to - if($type == "sent"){ - //get an instance of the user who the message has been sent to so we can access the name and icon - $user_object = get_entity($vars['entity']->toId); - $message_icon = elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny')); - $message_owner = elgg_echo('messages:to').": <a href='{$vars['url']}pg/profile/".$user_object->username."'>".$user_object->name."</a>"; - }else{ - $user_object = get_entity($vars['entity']->fromId); - $message_icon = elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny')); - $message_owner = elgg_echo('messages:from').": <a href='{$vars['url']}pg/profile/".$user_object->username."'>".get_entity($vars['entity']->fromId)->name."</a>"; - } - ?> - <div class="entity_listing_icon"><?php echo $message_icon ?></div> - <div class="entity_listing_info"><p><?php echo $message_owner ?></p> + + <div class="entity_listing messages clearfloat"> + <?php + // we need a different user icon and name depending on whether the user is reading the message + // from their inbox or sentbox. If it is the inbox, then the icon and name will be the person who sent + // the message. If it is the sentbox, the icon and name will be the user the message was sent to + if($type == "sent"){ + //get an instance of the user who the message has been sent to so we can access the name and icon + $user_object = get_entity($vars['entity']->toId); + $message_icon = elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny')); + $message_owner = elgg_echo('messages:to').": <a href='{$vars['url']}pg/profile/".$user_object->username."'>".$user_object->name."</a>"; + }else{ + $user_object = get_entity($vars['entity']->fromId); + $message_icon = elgg_view("profile/icon",array('entity' => $user_object, 'size' => 'tiny')); + $message_owner = elgg_echo('messages:from').": <a href='{$vars['url']}pg/profile/".$user_object->username."'>".get_entity($vars['entity']->fromId)->name."</a>"; + } + ?> + <div class="entity_listing_icon"><?php echo $message_icon ?></div> + <div class="entity_listing_info"><p><?php echo $message_owner ?></p> <p class="entity_subtext"><?php echo friendly_time($vars['entity']->time_created); ?></p> </div> - </div> - - <div class="messagebody margin_top clearfloat"> - <?php - // if the message is a reply, display the message the reply was for - // @todo I need to figure out how to get the description out using -> (anyone?) - if($main_message = $vars['entity']->getEntitiesFromRelationship("reply")){ - echo $main_message[0][description]; - } - ?> + </div> + + <div class="messagebody margin_top clearfloat"> + <?php + // if the message is a reply, display the message the reply was for + // @todo I need to figure out how to get the description out using -> (anyone?) + if($main_message = $vars['entity']->getEntitiesFromRelationship("reply")){ + echo $main_message[0][description]; + } + ?> <!-- display the message --> <?php echo elgg_view('output/longtext',array('value' => $vars['entity']->description)); ?> </div> - + <!-- reply form --> <div id="message_reply_form" class="hidden margin_top"> <h2><?php echo elgg_echo('messages:answer'); ?></h2> @@ -108,8 +105,8 @@ if (isloggedin()) "internalname" => "message", "value" => '', )); - ?></div> - + ?></div> + <?php //pass across the guid of the message being replied to echo "<input type='hidden' name='reply' value='" . $vars['entity']->getGUID() . "' />"; |