]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2334: Converted viewtype => listtype and viewtypetoggle => listtypetoggle...
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 14 Nov 2010 08:04:28 +0000 (08:04 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 14 Nov 2010 08:04:28 +0000 (08:04 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7311 36083f99-b078-4883-b0ff-0f9b5a30f544

22 files changed:
engine/lib/access.php
engine/lib/annotations.php
engine/lib/calendar.php
engine/lib/entities.php
engine/lib/group.php
engine/lib/location.php
engine/lib/metadata.php
engine/lib/relationships.php
engine/lib/users.php
engine/lib/views.php
mod/ecml/ecml_functions.php
mod/file/search.php
mod/file/views/default/file/typecloud.php
mod/file/views/default/object/file.php
mod/pages/views/default/object/page.php
mod/pages/views/default/object/page_top.php
mod/search/views/default/search/entity_list.php
views/default/entities/entity_list.php
views/default/navigation/listtype.php [new file with mode: 0644]
views/default/navigation/viewtype.php
views/default/object/default.php
views/default/user/default.php

index 053c46e6f55a3126543f31995a3069d2a956cd36..d56eb3deae076fde350824b9bb523572ce6e668c 100644 (file)
@@ -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,
        ));
 }
index 02e5bc6e09d6dc1da823ebb5f026403e2be984fd..851d558b5991b7f662f5ff865df21731355677ae 100644 (file)
@@ -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);
 }
 
 /**
index f1a18ddb8a4a6cbc032292af6424118819e43dc7..6ee9980e5b199363c913da945a93bab35d605983 100644 (file)
@@ -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
index c8886ac50378cb29ef922d8d4e25cff18f39b596..3ba4164533248cf35731345298f8fc35813f9f09 100644 (file)
@@ -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']);
 }
 
 /**
index e554a44c5adc98e6808e6b7258a917d9349178e4..def82fa9c18e69dddde7e9c9ec96036adfcfcf9b 100644 (file)
@@ -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);
 }
 
 /**
index d5d6b7309d861bc777530a9530d451b3f5b733eb..039bb5ee06a704f0be4ae1ab66d9ea7bb744116b 100644 (file)
@@ -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)
index 8b6fe364fd670a314fb3b472557b3f0639e07c0e..71aa6c0f7a1d7646916b3c9ffca32e44284e4fca 100644 (file)
@@ -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);
 }
 
 /**
index 0b6b9b60753cb6dbe82c6290f47cd9809b8447cd..f19c76e8bc16dd4a90b465c4bd80c6b270b43527 100644 (file)
@@ -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);
 }
 
 /**
index b116e108372d53b55fc64b7b007a7f317c41fe48..c9a534b626b8bbef3c199bde6380f8e7ae490a33 100644 (file)
@@ -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);
 }
 
 /**
index 144595c50b4e8840b7a12b224d459e2787062bc1..9098950e32ec09e9d3dd92be180b68cd668cd6ad 100644 (file)
@@ -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
        ));
 
index 75839aec43c23e5153418ae79ae61417cb36b9d9..4d30ee9c7cefccafc90a7a7d2ca36db0434c2ec7 100644 (file)
@@ -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':
index 8dd4669a928e75b3a7a0caba862e728d0965cec0..5c6c0a96997f79090b685151406743dc86d84993 100644 (file)
@@ -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,
index 0e2f3a53c7a508b0f7cd0688ebbff144b2af940e..bb322d4d7b6e8db0836e63c0cc9d372ef1efca7c 100644 (file)
@@ -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);
                        $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
index 3da9567a54c11009f8f29209796c547af45b90d0..054184c7b5b67e472bab107a5938bc68b8e9b793 100644 (file)
@@ -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>
index 5b4af5198da2efc952e5d53e0c511f2691489557..dbca0755b6aba4fb8b9c13db912c2e1f8c458de8 100644 (file)
@@ -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);
index 6922118c17a121aa43d89c482dce514bc70202b8..0a1cfdf8384487a7104e405a717749d9d979f871 100644 (file)
@@ -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);
index 4a04aaf844458c0c46c0e8b2acfceca63ba684b2..f9105c71179eb91a835c4ebb3823ae4330017050 100644 (file)
@@ -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));
        }
index cf3df78b734beab5c0ebae5481f1bdb9e0f01277..fd6ea27bb893ab0b161b4ae8f71a672beda92223 100644 (file)
@@ -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 (file)
index 0000000..c469331
--- /dev/null
@@ -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
index 8b2a649780d94342f53c13bf42928f45c74510da..cdf167eb578d70ceb823ec7d082afc84621175b1 100644 (file)
@@ -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
index 040bae8329f9235944ca9e91005436c67f93458a..6e03e9e78961e8b5cc52473e23251b7c1995b993 100644 (file)
@@ -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 = "";
        }
 
index 8c5fdee3ee710815b7de44290718e0d257afe2a5..744a545955c0c550c448789ea1199568f66e152a 100644 (file)
@@ -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);