diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-27 11:25:31 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-27 11:25:31 +0000 |
commit | 41fed2568509d6eb581be9aa1df000b25b079d63 (patch) | |
tree | f318c78f1337d944a0aaf4798db17b5ebf4c30fc | |
parent | 689c997f58b25df81164df9acdf5ebd9c1ad2bc9 (diff) | |
download | elgg-41fed2568509d6eb581be9aa1df000b25b079d63.tar.gz elgg-41fed2568509d6eb581be9aa1df000b25b079d63.tar.bz2 |
Added a 'display full view' parameter to all of the listings functions
git-svn-id: https://code.elgg.org/elgg/trunk@1170 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/lib/elgglib.php | 5 | ||||
-rw-r--r-- | engine/lib/entities.php | 5 | ||||
-rw-r--r-- | engine/lib/metadata.php | 10 | ||||
-rw-r--r-- | engine/lib/relationships.php | 5 | ||||
-rw-r--r-- | engine/lib/sites.php | 5 | ||||
-rw-r--r-- | engine/lib/users.php | 10 | ||||
-rw-r--r-- | friends/index.php | 2 | ||||
-rw-r--r-- | friends/of.php | 2 | ||||
-rw-r--r-- | search/index.php | 2 |
9 files changed, 27 insertions, 19 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 166757ea4..31693906d 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -350,9 +350,10 @@ * @param int $count The total number of entities across all pages
* @param int $offset The current indexing offset
* @param int $limit The number of entities to display per page
+ * @param true|false $fullview Whether or not to display the full view (default: true)
* @return string The list of entities
*/
- function elgg_view_entity_list($entities, $count, $offset, $limit) {
+ function elgg_view_entity_list($entities, $count, $offset, $limit, $fullview = true) {
$count = (int) $count;
$offset = (int) $offset;
@@ -372,7 +373,7 @@ if (is_array($entities) && sizeof($entities) > 0) {
foreach($entities as $entity) {
- $html .= elgg_view_entity($entity, "", false);
+ $html .= elgg_view_entity($entity, "", $fullview);
}
}
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index c97c560b8..c76e8d970 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1091,15 +1091,16 @@ * @param string $subtype The arbitrary subtype of the entity
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to display per page (default: 10)
+ * @param true|false $fullview Whether or not to display the full view (default: true)
* @return string A viewable list of entities
*/
- function list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10) {
+ function list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true) {
$offset = (int) get_input('offset');
$count = get_entities($type, $subtype, $owner_guid, "", $limit, $offset, true);
$entities = get_entities($type, $subtype, $owner_guid, "", $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
}
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index 51d932c1a..36c2e65c7 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -519,17 +519,18 @@ * @param string $entity_type The type of entity to look for, eg 'site' or 'object'
* @param string $entity_subtype The subtype of the entity
* @param int $limit Number of entities to display per page
+ * @param true|false $fullview Whether or not to display the full view (default: true)
*
* @return string A list of entities suitable for display
*/
- function list_entities_from_metadata($meta_name, $meta_value = "", $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10) {
+ function list_entities_from_metadata($meta_name, $meta_value = "", $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
$count = get_entities_from_metadata($meta_name, $meta_value, $entity_type, $entity_subtype, $owner_guid, $limit, $offset, "", 0, true);
$entities = get_entities_from_metadata($meta_name, $meta_value, $entity_type, $entity_subtype, $owner_guid, $limit, $offset, "", 0, false);
- return elgg_view_entity_list($entities, $count, $offset, $limit);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
}
@@ -625,16 +626,17 @@ * @param int $limit
* @param int $offset
* @param string $order_by Optional ordering.
+ * @param true|false $fullview Whether or not to display the full view (default: true)
* @return string List of ElggEntities suitable for display
*/
- function list_entities_from_metadata_multi($meta_array, $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10) {
+ function list_entities_from_metadata_multi($meta_array, $entity_type = "", $entity_subtype = "", $owner_guid = 0, $limit = 10, $fullview = true) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
$count = get_entities_from_metadata_multi($meta_array, $entity_type, $entity_subtype, $owner_guid, $limit, $offset, "", $site_guid, true);
$entities = get_entities_from_metadata_multi($meta_array, $entity_type, $entity_subtype, $owner_guid, $limit, $offset, "", $site_guid, false);
- return elgg_view_entity_list($entities, $count, $offset, $limit);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
} diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index 642b2f5c6..b7008409c 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -513,16 +513,17 @@ * @param string $subtype The entity subtype
* @param int $owner_guid The owner (default: all)
* @param int $limit The number of entities to display on a page
+ * @param true|false $fullview Whether or not to display the full view (default: true)
* @return string The viewable list of entities
*/
- function list_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship = false, $type = "", $subtype = "", $owner_guid = 0, $limit = 10) {
+ function list_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship = false, $type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true) {
$limit = (int) $limit;
$offset = (int) get_input('offset');
$count = get_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship, $type, $subtype, $owner_guid, "", $limit, 0, true);
$entities = get_entities_from_relationship($relationship, $relationship_guid, $inverse_relationship, $type, $subtype, $owner_guid, "", $limit, 0);
- return elgg_view_entity_list($entities, $count, $offset, $Limit);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
} diff --git a/engine/lib/sites.php b/engine/lib/sites.php index 40ff02f6c..f126e4e4e 100644 --- a/engine/lib/sites.php +++ b/engine/lib/sites.php @@ -374,16 +374,17 @@ *
* @param int $site_guid The GUID of the site
* @param int $limit The number of members to display on a page
+ * @param true|false $fullview Whether or not to display the full view (default: true)
* @return string A displayable list of members
*/
- function list_site_members($site_guid, $limit = 10) {
+ function list_site_members($site_guid, $limit = 10, $fullview = true) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
$count = (int) get_entities_from_relationship("member_of_site", $site_guid, true, "user", "", 0, "time_created desc", $limit, $offset, true);
$entities = get_site_members($site_guid, $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
} diff --git a/engine/lib/users.php b/engine/lib/users.php index 554ada22b..60d279ebf 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -535,16 +535,17 @@ * @param int $user_guid The GUID of the user
* @param string $subtype The object subtype
* @param int $limit The number of entities to display on a page
+ * @param true|false $fullview Whether or not to display the full view (default: true)
* @return string The list in a form suitable to display
*/
- function list_user_objects($user_guid, $subtype = "", $limit = 10) {
+ function list_user_objects($user_guid, $subtype = "", $limit = 10, $fullview = true) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
$count = (int) count_user_objects($user_guid, $subtype);
$entities = get_user_objects($user_guid, $subtype, $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
}
@@ -594,16 +595,17 @@ * @param int $user_guid The GUID of the user
* @param string $subtype The object subtype
* @param int $limit The number of entities to display on a page
+ * @param true|false $fullview Whether or not to display the full view (default: true)
* @return string The list in a form suitable to display
*/
- function list_user_friends_objects($user_guid, $subtype = "", $limit = 10) {
+ function list_user_friends_objects($user_guid, $subtype = "", $limit = 10, $fullview = true) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
$count = (int) count_user_friends_objects($user_guid, $subtype);
$entities = get_user_friends_objects($user_guid, $subtype, $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview);
}
diff --git a/friends/index.php b/friends/index.php index 8b5e17ef0..cde20877d 100644 --- a/friends/index.php +++ b/friends/index.php @@ -17,7 +17,7 @@ $owner = $_SESSION['user'];
}
- $area1 = list_entities_from_relationship('friend',$owner->getGUID(),false,'user','');
+ $area1 = list_entities_from_relationship('friend',$owner->getGUID(),false,'user','',0,10,false);
$body = elgg_view_layout('one_column',$area1);
echo page_draw(sprintf(elgg_echo("friends:owned"),$owner->name),$body);
diff --git a/friends/of.php b/friends/of.php index 68aa47778..702ae16ad 100644 --- a/friends/of.php +++ b/friends/of.php @@ -17,7 +17,7 @@ $owner = $_SESSION['user'];
}
- $area1 = list_entities_from_relationship('friend',$owner->getGUID(),true,'user','');
+ $area1 = list_entities_from_relationship('friend',$owner->getGUID(),true,'user','',0,10,false);
$body = elgg_view_layout('one_column',$area1);
echo page_draw(sprintf(elgg_echo("friends:of:owned"),$owner->name),$body);
diff --git a/search/index.php b/search/index.php index 5718047ad..0825fee25 100644 --- a/search/index.php +++ b/search/index.php @@ -29,7 +29,7 @@ $owner_guid = explode(",",$owner_guid);
}
- $body = list_entities_from_metadata($md_type, $tag, $objecttype, $subtype, $owner_guid);
+ $body = list_entities_from_metadata($md_type, $tag, $objecttype, $subtype, $owner_guid, 10, false);
$body = elgg_view_layout('one_column',$body);
page_draw(sprintf(elgg_echo('searchtitle'),$tag),$body);
|