aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/access.php4
-rw-r--r--engine/lib/annotations.php18
-rw-r--r--engine/lib/calendar.php12
-rw-r--r--engine/lib/entities.php34
-rw-r--r--engine/lib/group.php6
-rw-r--r--engine/lib/location.php12
-rw-r--r--engine/lib/metadata.php12
-rw-r--r--engine/lib/relationships.php10
-rw-r--r--engine/lib/users.php12
-rw-r--r--engine/lib/views.php8
-rw-r--r--mod/ecml/ecml_functions.php2
-rw-r--r--mod/file/search.php4
-rw-r--r--mod/file/views/default/file/typecloud.php22
-rw-r--r--mod/file/views/default/object/file.php4
-rw-r--r--mod/pages/views/default/object/page.php2
-rw-r--r--mod/pages/views/default/object/page_top.php2
-rw-r--r--mod/search/views/default/search/entity_list.php30
-rw-r--r--views/default/entities/entity_list.php16
-rw-r--r--views/default/navigation/listtype.php28
-rw-r--r--views/default/navigation/viewtype.php21
-rw-r--r--views/default/object/default.php2
-rw-r--r--views/default/user/default.php2
22 files changed, 142 insertions, 121 deletions
diff --git a/engine/lib/access.php b/engine/lib/access.php
index 053c46e6f..d56eb3dea 100644
--- a/engine/lib/access.php
+++ b/engine/lib/access.php
@@ -859,7 +859,7 @@ function elgg_list_entities_from_access_id(array $options = array()) {
* @deprecated 1.8 Use elgg_list_entities_from_access_id()
*/
function list_entities_from_access_id($access_id, $entity_type = "", $entity_subtype = "",
- $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
+ $owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
elgg_deprecated_notice("All list_entities* functions were deprecated in 1.8. Use elgg_list_entities* instead.", 1.8);
@@ -870,7 +870,7 @@ function list_entities_from_access_id($access_id, $entity_type = "", $entity_sub
'owner_guids' => $owner_guid,
'limit' => $limit,
'full_view' => $fullview,
- 'view_type_toggle' => $viewtypetoggle,
+ 'list_type_toggle' => $listtypetoggle,
'pagination' => $pagination,
));
}
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 02e5bc6e0..851d558b5 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -486,14 +486,14 @@ $count = false, $timelower = 0, $timeupper = 0) {
* @param int $group_guid Group container. Currently only supported if entity_type is object
* @param boolean $asc Whether to list in ascending or descending order (default: desc)
* @param boolean $fullview Whether to display the entities in full
- * @param boolean $viewtypetoggle Can 'gallery' view can be displayed (default: no)
+ * @param boolean $listtypetoggle Can 'gallery' view can be displayed (default: no)
*
* @deprecated 1.7 Use elgg_list_entities_from_annotations()
* @return string Formatted entity list
*/
function list_entities_from_annotations($entity_type = "", $entity_subtype = "", $name = "",
$value = "", $limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true,
-$viewtypetoggle = false) {
+$listtypetoggle = false) {
$msg = 'list_entities_from_annotations is deprecated by elgg_list_entities_from_annotations';
elgg_deprecated_notice($msg, 1.8);
@@ -537,7 +537,7 @@ $viewtypetoggle = false) {
}
$options['full_view'] = $fullview;
- $options['view_type_toggle'] = $viewtypetoggle;
+ $options['list_type_toggle'] = $listtypetoggle;
$options['pagination'] = $pagination;
return elgg_list_entities_from_annotations($options);
@@ -940,7 +940,7 @@ $count = false) {
* @param int $group_guid Group container. Currently only supported if entity_type is object
* @param boolean $asc Whether to list in ascending or descending order (default: desc)
* @param boolean $fullview Whether to display the entities in full
- * @param boolean $viewtypetoggle Can the 'gallery' view can be displayed (default: no)
+ * @param boolean $listtypetoggle Can the 'gallery' view can be displayed (default: no)
* @param boolean $pagination Add pagination
* @param string $orderdir Order desc or asc
*
@@ -948,7 +948,7 @@ $count = false) {
*/
function list_entities_from_annotation_count($entity_type = "", $entity_subtype = "", $name = "",
$limit = 10, $owner_guid = 0, $group_guid = 0, $asc = false, $fullview = true,
-$viewtypetoggle = false, $pagination = true, $orderdir = 'desc') {
+$listtypetoggle = false, $pagination = true, $orderdir = 'desc') {
if ($asc) {
$asc = "asc";
} else {
@@ -963,7 +963,7 @@ $viewtypetoggle = false, $pagination = true, $orderdir = 'desc') {
'', '', $owner_guid, $limit, $offset, $orderdir, false);
return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $pagination);
+ $fullview, $listtypetoggle, $pagination);
}
/**
@@ -980,7 +980,7 @@ $viewtypetoggle = false, $pagination = true, $orderdir = 'desc') {
* @param int $group_guid Group container. Currently only supported if entity_type is object
* @param boolean $asc Whether to list in ascending or descending order (default: desc)
* @param boolean $fullview Whether to display the entities in full
- * @param boolean $viewtypetoggle Can the 'gallery' view can be displayed (default: no)
+ * @param boolean $listtypetoggle Can the 'gallery' view can be displayed (default: no)
* @param boolean $pagination Display pagination
* @param string $orderdir 'desc' or 'asc'
*
@@ -988,7 +988,7 @@ $viewtypetoggle = false, $pagination = true, $orderdir = 'desc') {
*/
function list_entities_from_annotation_count_by_metadata($entity_type = "", $entity_subtype = "",
$name = "", $mdname = '', $mdvalue = '', $limit = 10, $owner_guid = 0, $group_guid = 0,
-$asc = false, $fullview = true, $viewtypetoggle = false, $pagination = true, $orderdir = 'desc') {
+$asc = false, $fullview = true, $listtypetoggle = false, $pagination = true, $orderdir = 'desc') {
if ($asc) {
$asc = "asc";
@@ -1003,7 +1003,7 @@ $asc = false, $fullview = true, $viewtypetoggle = false, $pagination = true, $or
$mdvalue, $owner_guid, $limit, $offset, $orderdir, false);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview,
- $viewtypetoggle, $pagination);
+ $listtypetoggle, $pagination);
}
/**
diff --git a/engine/lib/calendar.php b/engine/lib/calendar.php
index f1a18ddb8..6ee9980e5 100644
--- a/engine/lib/calendar.php
+++ b/engine/lib/calendar.php
@@ -516,13 +516,13 @@ $order_by = "", $limit = 10, $offset = 0, $count = false, $site_guid = 0) {
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to return; 10 by default
* @param boolean $fullview Whether or not to display the full view (default: true)
- * @param boolean $viewtypetoggle Whether or not to allow gallery view
+ * @param boolean $listtypetoggle Whether or not to allow gallery view
* @param boolean $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
*/
function list_notable_entities($start_time, $end_time, $type= "", $subtype = "", $owner_guid = 0,
-$limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true) {
+$limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) {
$offset = (int) get_input('offset');
$count = get_notable_entities($start_time, $end_time, $type, $subtype,
@@ -532,7 +532,7 @@ $limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true) {
$owner_guid, "", $limit, $offset);
return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $navigation);
+ $fullview, $listtypetoggle, $navigation);
}
/**
@@ -545,17 +545,17 @@ $limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true) {
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to return; 10 by default
* @param boolean $fullview Whether or not to display the full view (default: true)
- * @param boolean $viewtypetoggle Whether or not to allow gallery view
+ * @param boolean $listtypetoggle Whether or not to allow gallery view
* @param boolean $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
*/
function list_todays_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10,
-$fullview = true, $viewtypetoggle = false, $navigation = true) {
+$fullview = true, $listtypetoggle = false, $navigation = true) {
$day_start = get_day_start();
$day_end = get_day_end();
return list_notable_entities($day_start, $day_end, $type, $subtype, $owner_guid, $limit,
- $fullview, $viewtypetoggle, $navigation);
+ $fullview, $listtypetoggle, $navigation);
} \ No newline at end of file
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index c8886ac50..3ba416453 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -1315,7 +1315,7 @@ function elgg_get_entity_site_where_sql($table, $site_guids) {
*
* @param array $options Any options from $getter options plus:
* full_view => BOOL Display full view entities
- * view_type_toggle => BOOL Display gallery / list switch
+ * list_type_toggle => BOOL Display gallery / list switch
* pagination => BOOL Display pagination links
*
* @param mixed $getter The entity getter function to use to fetch the entities
@@ -1331,12 +1331,17 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
'offset' => (int) max(get_input('offset', 0), 0),
'limit' => (int) max(get_input('limit', 10), 0),
'full_view' => TRUE,
- 'view_type_toggle' => FALSE,
+ 'list_type_toggle' => FALSE,
'pagination' => TRUE,
);
$options = array_merge($defaults, $options);
+ //backwards compatibility
+ if (isset($options['view_type_toggle'])) {
+ $options['list_type_toggle'] = $options['view_type_toggle'];
+ }
+
$options['count'] = TRUE;
$count = $getter($options);
@@ -1344,7 +1349,7 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
$entities = $getter($options);
return elgg_view_entity_list($entities, $count, $options['offset'], $options['limit'],
- $options['full_view'], $options['view_type_toggle'], $options['pagination']);
+ $options['full_view'], $options['list_type_toggle'], $options['pagination']);
}
/**
@@ -1357,13 +1362,13 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
* @param int $owner_guid Owner GUID
* @param int $limit Limit
* @param bool $fullview Display entity full views?
- * @param bool $viewtypetoggle Allow switching to gallery mode?
+ * @param bool $listtypetoggle Allow switching to gallery mode?
* @param bool $pagination Show pagination?
*
* @return string
*/
function list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true,
-$viewtypetoggle = false, $pagination = true) {
+$listtypetoggle = false, $pagination = true) {
elgg_deprecated_notice('list_entities() was deprecated by elgg_list_entities()!', 1.7);
@@ -1391,7 +1396,7 @@ $viewtypetoggle = false, $pagination = true) {
}
$options['full_view'] = $fullview;
- $options['view_type_toggle'] = $viewtypetoggle;
+ $options['list_type_toggle'] = $listtypetoggle;
$options['pagination'] = $pagination;
return elgg_list_entities($options);
@@ -2344,14 +2349,14 @@ function entities_page_handler($page) {
* @param int $owner_guid Owner GUID
* @param int $limit Limit
* @param bool $fullview Show entity full views
- * @param bool $viewtypetoggle Show list type toggle
+ * @param bool $listtypetoggle Show list type toggle
* @param bool $allowedtypes A string of the allowed types
*
* @return string
* @deprecated 1.7. Use elgg_list_registered_entities().
*/
function list_registered_entities($owner_guid = 0, $limit = 10, $fullview = true,
-$viewtypetoggle = false, $allowedtypes = true) {
+$listtypetoggle = false, $allowedtypes = true) {
elgg_deprecated_notice('list_registered_entities() was deprecated by elgg_list_registered_entities().', 1.7);
@@ -2372,7 +2377,7 @@ $viewtypetoggle = false, $allowedtypes = true) {
// need to send because might be BOOL
$options['full_view'] = $fullview;
- $options['view_type_toggle'] = $viewtypetoggle;
+ $options['list_type_toggle'] = $listtypetoggle;
$options['offset'] = get_input('offset', 0);
@@ -2388,7 +2393,7 @@ $viewtypetoggle = false, $allowedtypes = true) {
*
* full_view => BOOL Display full view entities
*
- * view_type_toggle => BOOL Display gallery / list switch
+ * list_type_toggle => BOOL Display gallery / list switch
*
* allowed_types => TRUE|ARRAY True to show all types or an array of valid types.
*
@@ -2401,12 +2406,17 @@ function elgg_list_registered_entities($options) {
$defaults = array(
'full_view' => TRUE,
'allowed_types' => TRUE,
- 'view_type_toggle' => FALSE,
+ 'list_type_toggle' => FALSE,
'pagination' => TRUE,
'offset' => 0
);
$options = array_merge($defaults, $options);
+ //backwards compatibility
+ if (isset($options['view_type_toggle'])) {
+ $options['list_type_toggle'] = $options['view_type_toggle'];
+ }
+
$typearray = array();
if ($object_types = get_registered_entity_types()) {
@@ -2429,7 +2439,7 @@ function elgg_list_registered_entities($options) {
$entities = elgg_get_entities($options);
return elgg_view_entity_list($entities, $count, $options['offset'],
- $options['limit'], $options['full_view'], $options['view_type_toggle'], $options['pagination']);
+ $options['limit'], $options['full_view'], $options['list_type_toggle'], $options['pagination']);
}
/**
diff --git a/engine/lib/group.php b/engine/lib/group.php
index e554a44c5..def82fa9c 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -272,7 +272,7 @@ $order_by = "", $limit = 10, $offset = 0, $count = FALSE) {
* @param int $container_guid The GUID of the containing group
* @param int $limit The number of entities to display per page (default: 10)
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view (default: true)
+ * @param bool $listtypetoggle Whether or not to allow gallery view (default: true)
* @param bool $pagination Whether to display pagination (default: true)
*
* @return string List of parsed entities
@@ -281,7 +281,7 @@ $order_by = "", $limit = 10, $offset = 0, $count = FALSE) {
* @deprecated 1.8 Use elgg_list_entities() instead
*/
function list_entities_groups($subtype = "", $owner_guid = 0, $container_guid = 0,
-$limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
+$limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
elgg_deprecated_notice("list_entities_groups was deprecated in 1.8. Use elgg_list_entities() instead.", 1.8);
$offset = (int) get_input('offset');
$count = get_objects_in_group($container_guid, $subtype, $owner_guid,
@@ -290,7 +290,7 @@ $limit = 10, $fullview = true, $viewtypetoggle = true, $pagination = true) {
0, "", $limit, $offset);
return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $pagination);
+ $fullview, $listtypetoggle, $pagination);
}
/**
diff --git a/engine/lib/location.php b/engine/lib/location.php
index d5d6b7309..039bb5ee0 100644
--- a/engine/lib/location.php
+++ b/engine/lib/location.php
@@ -220,16 +220,16 @@ $order_by = "", $limit = 10, $offset = 0, $count = false, $site_guid = 0, $conta
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to display per page (default: 10)
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view
+ * @param bool $listtypetoggle Whether or not to allow gallery view
* @param bool $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
*/
function list_entities_location($location, $type= "", $subtype = "", $owner_guid = 0, $limit = 10,
-$fullview = true, $viewtypetoggle = false, $navigation = true) {
+$fullview = true, $listtypetoggle = false, $navigation = true) {
return list_entities_from_metadata('location', $location, $type, $subtype, $owner_guid, $limit,
- $fullview, $viewtypetoggle, $navigation);
+ $fullview, $listtypetoggle, $navigation);
}
/**
@@ -243,13 +243,13 @@ $fullview = true, $viewtypetoggle = false, $navigation = true) {
* @param int $owner_guid The GUID of the owning user
* @param int $limit The number of entities to display per page (default: 10)
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view
+ * @param bool $listtypetoggle Whether or not to allow gallery view
* @param bool $navigation Display pagination? Default: true
*
* @return string A viewable list of entities
*/
function list_entities_in_area($lat, $long, $radius, $type= "", $subtype = "", $owner_guid = 0,
-$limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true) {
+$limit = 10, $fullview = true, $listtypetoggle = false, $navigation = true) {
$offset = (int) get_input('offset');
$count = get_entities_in_area($lat, $long, $radius, $type, $subtype, $owner_guid,
@@ -258,7 +258,7 @@ $limit = 10, $fullview = true, $viewtypetoggle = false, $navigation = true) {
"", $limit, $offset);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview,
- $viewtypetoggle, $navigation);
+ $listtypetoggle, $navigation);
}
// Some distances in degrees (approximate)
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 8b6fe364f..71aa6c0f7 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -980,7 +980,7 @@ $site_guid = 0, $count = FALSE, $case_sensitive = TRUE) {
* @param int $owner_guid Owner GUID
* @param int $limit Number of entities to display per page
* @param bool $fullview WDisplay the full view (default: true)
- * @param bool $viewtypetoggle Allow users to toggle to the gallery view. Default: true
+ * @param bool $listtypetoggle Allow users to toggle to the gallery view. Default: true
* @param bool $pagination Display pagination? Default: true
* @param bool $case_sensitive Case sensitive metadata names?
*
@@ -990,7 +990,7 @@ $site_guid = 0, $count = FALSE, $case_sensitive = TRUE) {
*/
function list_entities_from_metadata($meta_name, $meta_value = "",
$entity_type = ELGG_ENTITIES_ANY_VALUE, $entity_subtype = ELGG_ENTITIES_ANY_VALUE,
-$owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true,
+$owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true,
$pagination = true, $case_sensitive = true) {
elgg_deprecated_notice('list_entities_from_metadata() was deprecated by elgg_list_entities_from_metadata()!', 1.8);
@@ -1014,7 +1014,7 @@ $pagination = true, $case_sensitive = true) {
$entities = elgg_get_entities_from_metadata($options);
return elgg_view_entity_list($entities, $count, $offset, $limit,
- $fullview, $viewtypetoggle, $pagination);
+ $fullview, $listtypetoggle, $pagination);
}
/**
@@ -1115,13 +1115,13 @@ $count = false, $meta_array_operator = 'and') {
* @param int $owner_guid Owner GUID
* @param int $limit Limit
* @param bool $fullview WDisplay the full view (default: true)
- * @param bool $viewtypetoggle Allow users to toggle to the gallery view. Default: true
+ * @param bool $listtypetoggle Allow users to toggle to the gallery view. Default: true
* @param bool $pagination Display pagination? 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, $fullview = true, $viewtypetoggle = true, $pagination = true) {
+$owner_guid = 0, $limit = 10, $fullview = true, $listtypetoggle = true, $pagination = true) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
@@ -1131,7 +1131,7 @@ $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = true, $paginat
$owner_guid, $limit, $offset, "", $site_guid, false);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview,
- $viewtypetoggle, $pagination);
+ $listtypetoggle, $pagination);
}
/**
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index 0b6b9b607..f19c76e8b 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -418,7 +418,7 @@ function elgg_list_entities_from_relationship(array $options = array()) {
function list_entities_from_relationship($relationship, $relationship_guid,
$inverse_relationship = false, $type = ELGG_ENTITIES_ANY_VALUE,
$subtype = ELGG_ENTITIES_ANY_VALUE, $owner_guid = 0, $limit = 10,
-$fullview = true, $viewtypetoggle = false, $pagination = true) {
+$fullview = true, $listtypetoggle = false, $pagination = true) {
elgg_deprecated_notice("list_entities_from_relationship was deprecated by elgg_list_entities_from_relationship()!", 1.8);
return elgg_list_entities_from_relationship(array(
@@ -430,7 +430,7 @@ $fullview = true, $viewtypetoggle = false, $pagination = true) {
'owner_guid' => $owner_guid,
'limit' => $limit,
'full_view' => $fullview,
- 'view_type_toggle' => $viewtypetoggle,
+ 'list_type_toggle' => $listtypetoggle,
'pagination' => $pagination,
));
}
@@ -541,7 +541,7 @@ $subtype = "", $owner_guid = 0, $limit = 10, $offset = 0, $count = false, $site_
* @param int $owner_guid The owner (default: all)
* @param int $limit The number of entities to display on a page
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view
+ * @param bool $listtypetoggle Whether or not to allow gallery view
* @param bool $pagination Whether to display pagination (default: true)
*
* @return string The viewable list of entities
@@ -549,7 +549,7 @@ $subtype = "", $owner_guid = 0, $limit = 10, $offset = 0, $count = false, $site_
function list_entities_by_relationship_count($relationship, $inverse_relationship = true,
$type = "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true,
-$viewtypetoggle = false, $pagination = true) {
+$listtypetoggle = false, $pagination = true) {
$limit = (int) $limit;
$offset = (int) get_input('offset');
@@ -558,7 +558,7 @@ $viewtypetoggle = false, $pagination = true) {
$entities = get_entities_by_relationship_count($relationship, $inverse_relationship,
$type, $subtype, $owner_guid, $limit, $offset);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination);
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle, $pagination);
}
/**
diff --git a/engine/lib/users.php b/engine/lib/users.php
index b116e1083..c9a534b62 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -496,7 +496,7 @@ $timeupper = 0) {
* @param string $subtype The object subtype
* @param int $limit The number of entities to display on a page
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow gallery view (default: true)
+ * @param bool $listtypetoggle Whether or not to allow gallery view (default: true)
* @param bool $pagination Whether to display pagination (default: true)
* @param int $timelower The earliest time the entity can have been created. Default: all
* @param int $timeupper The latest time the entity can have been created. Default: all
@@ -505,7 +505,7 @@ $timeupper = 0) {
* @deprecated 1.8 Use elgg_list_entities() instead
*/
function list_user_objects($user_guid, $subtype = ELGG_ENTITIES_ANY_VALUE, $limit = 10,
-$fullview = true, $viewtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
+$fullview = true, $listtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
elgg_deprecated_notice("list_user_objects() was deprecated in favor of elgg_list_entities()", 1.8);
$offset = (int) get_input('offset');
@@ -513,7 +513,7 @@ $fullview = true, $viewtypetoggle = true, $pagination = true, $timelower = 0, $t
$count = (int) count_user_objects($user_guid, $subtype, $timelower, $timeupper);
$entities = get_user_objects($user_guid, $subtype, $limit, $offset, $timelower, $timeupper);
- return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle,
+ return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $listtypetoggle,
$pagination);
}
@@ -591,7 +591,7 @@ $timelower = 0, $timeupper = 0) {
* @param string $subtype The object subtype
* @param int $limit The number of entities to display on a page
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow you to flip to gallery mode (default: true)
+ * @param bool $listtypetoggle Whether or not to allow you to flip to gallery mode (default: true)
* @param bool $pagination Whether to display pagination (default: true)
* @param int $timelower The earliest time the entity can have been created. Default: all
* @param int $timeupper The latest time the entity can have been created. Default: all
@@ -599,7 +599,7 @@ $timelower = 0, $timeupper = 0) {
* @return string The list in a form suitable to display
*/
function list_user_friends_objects($user_guid, $subtype = "", $limit = 10, $fullview = true,
-$viewtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
+$listtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
$offset = (int) get_input('offset');
$limit = (int) $limit;
@@ -609,7 +609,7 @@ $viewtypetoggle = true, $pagination = true, $timelower = 0, $timeupper = 0) {
$timelower, $timeupper);
return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview,
- $viewtypetoggle, $pagination);
+ $listtypetoggle, $pagination);
}
/**
diff --git a/engine/lib/views.php b/engine/lib/views.php
index 144595c50..9098950e3 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -800,14 +800,14 @@ function elgg_view_annotation(ElggAnnotation $annotation, $bypass = true, $debug
* @param int $offset The current indexing offset
* @param int $limit The number of entities to display per page
* @param bool $fullview Whether or not to display the full view (default: true)
- * @param bool $viewtypetoggle Whether or not to allow users to toggle to gallery view
+ * @param bool $listtypetoggle Whether or not to allow users to toggle to gallery view
* @param bool $pagination Whether pagination is offered.
*
* @return string The list of entities
* @access private
*/
function elgg_view_entity_list($entities, $count, $offset, $limit, $fullview = true,
-$viewtypetoggle = true, $pagination = true) {
+$listtypetoggle = true, $pagination = true) {
$count = (int) $count;
$limit = (int) $limit;
@@ -827,8 +827,8 @@ $viewtypetoggle = true, $pagination = true) {
'baseurl' => $_SERVER['REQUEST_URI'],
'fullview' => $fullview,
'context' => $context,
- 'viewtypetoggle' => $viewtypetoggle,
- 'viewtype' => get_input('search_viewtype', 'list'),
+ 'listtypetoggle' => $listtypetoggle,
+ 'listtype' => get_input('listtype', 'list'),
'pagination' => $pagination
));
diff --git a/mod/ecml/ecml_functions.php b/mod/ecml/ecml_functions.php
index 75839aec4..4d30ee9c7 100644
--- a/mod/ecml/ecml_functions.php
+++ b/mod/ecml/ecml_functions.php
@@ -67,7 +67,7 @@ function ecml_parse_view_match($matches) {
// possible options for elgg_get_entities*() functions...)
$entities = elgg_get_entities_from_relationship($options);
$content = elgg_view_entity_list($entities, count($entities), $options['offset'],
- $options['limit'], $options['full_view'], $options['view_type_toggle'], $options['pagination']);
+ $options['limit'], $options['full_view'], $options['list_type_toggle'], $options['pagination']);
break;
case 'view':
diff --git a/mod/file/search.php b/mod/file/search.php
index 8dd4669a9..5c6c0a969 100644
--- a/mod/file/search.php
+++ b/mod/file/search.php
@@ -14,7 +14,7 @@
// Get input
$md_type = 'simpletype';
$tag = get_input('tag');
- $search_viewtype = get_input('search_viewtype');
+ $listtype = get_input('listtype');
$friends = (int) get_input('friends_guid',0);
if ($friends) {
@@ -73,7 +73,7 @@
$offset = (int)get_input('offset', 0);
$limit = 10;
- if ($search_viewtype == "gallery") $limit = 12;
+ if ($listtype == "gallery") $limit = 12;
if (!empty($tag)) {
$params = array(
'metadata_name' => $md_type,
diff --git a/mod/file/views/default/file/typecloud.php b/mod/file/views/default/file/typecloud.php
index 0e2f3a53c..bb322d4d7 100644
--- a/mod/file/views/default/file/typecloud.php
+++ b/mod/file/views/default/file/typecloud.php
@@ -1,10 +1,10 @@
<?php
$types = $vars['types'];
-
+
if (is_array($vars['types']) && sizeof($vars['types'])) {
-
-?>
+
+?>
<ul>
<?php
@@ -20,7 +20,7 @@
} else {
$label = elgg_echo('all');
}
-
+
$url = elgg_get_site_url() . "mod/file/search.php?subtype=file";
if ($tag != "all")
$url .= "&md_type=simpletype&tag=" . urlencode($tag);
@@ -35,25 +35,25 @@
$url .= "&owner_guid={$owner_guid}";
}
if ($tag == "image")
- $url .= "&search_viewtype=gallery";
-
+ $url .= "&listtype=gallery";
+
$url .= "&page_owner=" . elgg_get_page_owner_guid();
-
+
$inputtag = get_input('tag');
if ($inputtag == $tag || (empty($inputtag) && $tag == "all")) {
$class = " class=\"selected\" ";
} else {
$class = "";
}
-
- add_submenu_item($label, $url, 'filetypes');
+
+ add_submenu_item($label, $url, 'filetypes');
}
-
+
?>
</ul>
<?php
-
+
}
?> \ No newline at end of file
diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php
index 3da9567a5..054184c7b 100644
--- a/mod/file/views/default/object/file.php
+++ b/mod/file/views/default/object/file.php
@@ -24,7 +24,7 @@
if (elgg_get_context() == "search") { // Start search listing version
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
echo "<div class='filerepo_gallery_item'>";
if ($vars['entity']->smallthumb) {
echo "<p class='filerepo_title'>" . $file->title . "</p>";
@@ -94,7 +94,7 @@
<div class="filerepo_title_owner_wrapper">
<?php
//get the user and a link to their gallery
- $user_gallery = elgg_get_site_url() . "mod/file/search.php?md_type=simpletype&subtype=file&tag=image&owner_guid=" . $owner->guid . "&search_viewtype=gallery";
+ $user_gallery = elgg_get_site_url() . "mod/file/search.php?md_type=simpletype&subtype=file&tag=image&owner_guid=" . $owner->guid . "&listtype=gallery";
?>
<div class="filerepo_user_gallery_link"><a href="<?php echo $user_gallery; ?>"><?php echo elgg_echo("file:user:gallery",array('')); ?></a></div>
<div class="filerepo_title"><h2><a href="<?php echo elgg_get_site_url(); ?>mod/file/download.php?file_guid=<?php echo $file_guid; ?>"><?php echo $title; ?></a></h2></div>
diff --git a/mod/pages/views/default/object/page.php b/mod/pages/views/default/object/page.php
index 5b4af5198..dbca0755b 100644
--- a/mod/pages/views/default/object/page.php
+++ b/mod/pages/views/default/object/page.php
@@ -8,7 +8,7 @@
if ($vars['full']) {
echo elgg_view("pages/pageprofile", $vars);
} else {
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
echo elgg_view('pages/pagegallery', $vars);
} else {
echo elgg_view("pages/pagelisting", $vars);
diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php
index 6922118c1..0a1cfdf83 100644
--- a/mod/pages/views/default/object/page_top.php
+++ b/mod/pages/views/default/object/page_top.php
@@ -8,7 +8,7 @@
if ($vars['full']) {
echo elgg_view("pages/pageprofile", $vars);
} else {
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
echo elgg_view('pages/pagegallery', $vars);
} else {
echo elgg_view("pages/pagelisting", $vars);
diff --git a/mod/search/views/default/search/entity_list.php b/mod/search/views/default/search/entity_list.php
index 4a04aaf84..f9105c711 100644
--- a/mod/search/views/default/search/entity_list.php
+++ b/mod/search/views/default/search/entity_list.php
@@ -6,40 +6,40 @@ $limit = $vars['limit'];
$count = $vars['count'];
$baseurl = $vars['baseurl'];
$context = $vars['context'];
-$viewtype = $vars['viewtype'];
+$listtype = $vars['listtype'];
$pagination = $vars['pagination'];
-$fullview = $vars['fullview'];
-
+$fullview = $vars['fullview'];
+
$html = "";
$nav = "";
-if (isset($vars['viewtypetoggle'])) {
- $viewtypetoggle = $vars['viewtypetoggle'];
+if (isset($vars['listtypetoggle'])) {
+ $listtypetoggle = $vars['listtypetoggle'];
} else {
- $viewtypetoggle = true;
+ $listtypetoggle = true;
}
-if ($context == "search" && $count > 0 && $viewtypetoggle) {
- $nav .= elgg_view("navigation/viewtype",array(
-
+if ($context == "search" && $count > 0 && $listtypetoggle) {
+ $nav .= elgg_view("navigation/listtype",array(
+
'baseurl' => $baseurl,
'offset' => $offset,
'count' => $count,
- 'viewtype' => $viewtype,
-
+ 'listtype' => $listtype,
+
));
}
if ($pagination)
$nav .= elgg_view('navigation/pagination',array(
-
+
'baseurl' => $baseurl,
'offset' => $offset,
'count' => $count,
'limit' => $limit,
-
+
));
-if ($viewtype == "list") {
+if ($listtype == "list") {
if (is_array($entities) && sizeof($entities) > 0) {
foreach($entities as $entity) {
// print out the entity
@@ -50,7 +50,7 @@ if ($viewtype == "list") {
}
}
-} else if ($viewtype == "gallery") {
+} else if ($listtype == "gallery") {
if (is_array($entities) && sizeof($entities) > 0) {
$html .= elgg_view("search/gallery",array('entities' => $entities));
}
diff --git a/views/default/entities/entity_list.php b/views/default/entities/entity_list.php
index cf3df78b7..fd6ea27bb 100644
--- a/views/default/entities/entity_list.php
+++ b/views/default/entities/entity_list.php
@@ -13,25 +13,25 @@ $limit = $vars['limit'];
$count = $vars['count'];
$baseurl = $vars['baseurl'];
$context = $vars['context'];
-$viewtype = $vars['viewtype'];
+$listtype = $vars['listtype'];
$pagination = $vars['pagination'];
$fullview = $vars['fullview'];
$html = "";
$nav = "";
-if (isset($vars['viewtypetoggle'])) {
- $viewtypetoggle = $vars['viewtypetoggle'];
+if (isset($vars['listtypetoggle'])) {
+ $listtypetoggle = $vars['listtypetoggle'];
} else {
- $viewtypetoggle = true;
+ $listtypetoggle = true;
}
-if ($context == "search" && $count > 0 && $viewtypetoggle) {
- $nav .= elgg_view('navigation/viewtype', array(
+if ($context == "search" && $count > 0 && $listtypetoggle) {
+ $nav .= elgg_view('navigation/listtype', array(
'baseurl' => $baseurl,
'offset' => $offset,
'count' => $count,
- 'viewtype' => $viewtype,
+ 'listtype' => $listtype,
));
}
@@ -44,7 +44,7 @@ if ($pagination) {
));
}
-if ($viewtype == 'list') {
+if ($listtype == 'list') {
if (is_array($entities) && sizeof($entities) > 0) {
foreach($entities as $entity) {
$html .= elgg_view_entity($entity, $fullview);
diff --git a/views/default/navigation/listtype.php b/views/default/navigation/listtype.php
new file mode 100644
index 000000000..c4693313b
--- /dev/null
+++ b/views/default/navigation/listtype.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Elgg list view switcher
+ *
+ * @package Elgg
+ * @subpackage Core
+ */
+
+$baseurl = elgg_http_remove_url_query_element($vars['baseurl'], 'search_listtype');
+
+if ($vars['listtype'] == "list") {
+ $listtype = "gallery";
+} else {
+ $listtype = "list";
+}
+
+if (substr_count($baseurl,'?')) {
+ $baseurl .= "&search_listtype=" . $listtype;
+} else {
+ $baseurl .= "?search_listtype=" . $listtype;
+}
+
+?>
+
+<p class="margin_top">
+ <?php echo elgg_echo("listtype:change") ?>:
+ <a href="<?php echo $baseurl; ?>"><?php echo elgg_echo("listtype:{$listtype}"); ?></a>
+</p> \ No newline at end of file
diff --git a/views/default/navigation/viewtype.php b/views/default/navigation/viewtype.php
index 8b2a64978..cdf167eb5 100644
--- a/views/default/navigation/viewtype.php
+++ b/views/default/navigation/viewtype.php
@@ -6,23 +6,6 @@
* @subpackage Core
*/
-$baseurl = elgg_http_remove_url_query_element($vars['baseurl'], 'search_viewtype');
+elgg_deprecated_notice('navigation/viewtype was deprecated by navigation/listtype', 1.8);
-if ($vars['viewtype'] == "list") {
- $viewtype = "gallery";
-} else {
- $viewtype = "list";
-}
-
-if (substr_count($baseurl,'?')) {
- $baseurl .= "&search_viewtype=" . $viewtype;
-} else {
- $baseurl .= "?search_viewtype=" . $viewtype;
-}
-
-?>
-
-<p class="margin_top">
- <?php echo elgg_echo("viewtype:change") ?>:
- <a href="<?php echo $baseurl; ?>"><?php echo elgg_echo("viewtype:{$viewtype}"); ?></a>
-</p> \ No newline at end of file
+echo elgg_view('navigation/listtype', $vars); \ No newline at end of file
diff --git a/views/default/object/default.php b/views/default/object/default.php
index 040bae832..6e03e9e78 100644
--- a/views/default/object/default.php
+++ b/views/default/object/default.php
@@ -37,7 +37,7 @@ if ($vars['full']) {
$info = "<div><p><b><a href=\"" . $vars['entity']->getUrl() . "\">" . $title . "</a></b> $controls </p></div>";
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
$icon = "";
}
diff --git a/views/default/user/default.php b/views/default/user/default.php
index 8c5fdee3e..744a54595 100644
--- a/views/default/user/default.php
+++ b/views/default/user/default.php
@@ -9,7 +9,7 @@
if ($vars['full']) {
echo elgg_view("profile/userdetails",$vars);
} else {
- if (get_input('search_viewtype') == "gallery") {
+ if (get_input('listtype') == "gallery") {
echo elgg_view('profile/gallery',$vars);
} else {
echo elgg_view("profile/listing",$vars);