]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #1253 using 'list_type' string instead of boolean 'gallery' for entity listing
authorcash <cash.costello@gmail.com>
Sat, 25 Jun 2011 00:25:34 +0000 (20:25 -0400)
committercash <cash.costello@gmail.com>
Sat, 25 Jun 2011 00:25:34 +0000 (20:25 -0400)
engine/lib/entities.php
engine/lib/views.php
mod/custom_index/index.php
mod/file/views/default/file/typecloud.php
mod/groups/views/default/groups/sidebar/members.php
views/default/widgets/friends/content.php

index cb197b56939902f8330438c245fc772e9ab020fc..10313fc8cd2370d442968d55f8caef8babb02b30 100644 (file)
@@ -1190,10 +1190,10 @@ $time_created_lower = NULL, $time_updated_upper = NULL, $time_updated_lower = NU
  * @internal This also provides the views for elgg_view_annotation().
  *
  * @param array $options Any options from $getter options plus:
- *      full_view => BOOL Display full view entities
- *      list_type_toggle => BOOL Display gallery / list switch
- *      pagination => BOOL Display pagination links
- *   gallery => BOOL display in gallery view
+ *     full_view => BOOL Display full view entities
+ *     list_type => STR 'list' or 'gallery'
+ *     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
  * @param mixed $viewer  The function to use to view the entity list.
@@ -1216,7 +1216,6 @@ function elgg_list_entities(array $options = array(), $getter = 'elgg_get_entiti
                'full_view' => TRUE,
                'list_type_toggle' => FALSE,
                'pagination' => TRUE,
-               'gallery' => FALSE,
        );
 
        $options = array_merge($defaults, $options);
index df69593f9bd32f5913f44f3506ecf440ffa8733a..7358fc0ba755e0356853ae4884e85cd76a2d3657 100644 (file)
@@ -950,9 +950,10 @@ function elgg_view_annotation(ElggAnnotation $annotation, array $vars = array(),
  *             'offset'           The current indexing offset
  *             'limit'            The number of entities to display per page
  *             'full_view'        Display the full view of the entities?
- *             'list_class'       CSS Class applied to the list
+ *             'list_class'       CSS class applied to the list
+ *             'item_class'       CSS class applied to the list items
  *             'pagination'       Display pagination?
- *             'gallery'          Display as gallery?
+ *             'list_type'        List type: 'list' (default), 'gallery'
  *             'list_type_toggle' Display the list type toggle?
  *
  * @return string The rendered list of entities
@@ -965,6 +966,13 @@ $list_type_toggle = true, $pagination = true) {
                $offset = (int)get_input('offset', 0);
        }
 
+       // list type can be passed as request parameter
+       $list_type = get_input('list_type', 'list');
+       if (get_input('listtype')) {
+               elgg_deprecated_notice("'listtype' has been deprecated by 'list_type' for lists", 1.8);
+               $list_type = get_input('listtype');
+       }
+
        if (is_array($vars)) {
                // new function
                $defaults = array(
@@ -972,7 +980,7 @@ $list_type_toggle = true, $pagination = true) {
                        'list_class' => 'elgg-list-entity',
                        'full_view' => true,
                        'pagination' => true,
-                       'gallery' => false,
+                       'list_type' => $list_type,
                        'list_type_toggle' => false,
                        'offset' => $offset,
                );
@@ -990,18 +998,13 @@ $list_type_toggle = true, $pagination = true) {
                        'limit' => (int) $limit,
                        'full_view' => $full_view,
                        'pagination' => $pagination,
-                       'gallery' => false,
+                       'list_type' => $list_type,
                        'list_type_toggle' => $list_type_toggle,
                        'list_class' => 'elgg-list-entity',
                );
        }
 
-       $listtype = get_input('listtype', 'list');
-       if ($listtype != 'list') {
-               $vars['gallery'] = true;
-       }
-
-       if ($vars['gallery']) {
+       if ($vars['list_type'] != 'list') {
                return elgg_view('page/components/gallery', $vars);
        } else {
                return elgg_view('page/components/list', $vars);
index e39e6ef290960071c6dc73f044ec2a4ce6cfef8f..831114127262ef91745ccd59e61824232f35e1bf 100644 (file)
@@ -35,7 +35,7 @@ $newest_members = elgg_list_entities_from_metadata(array(
        'limit' => 10,
        'full_view' => false,
        'pagination' => false,
-       'gallery' => true,
+       'list_type' => 'gallery',
        'size' => 'small',
 ));
 
index ce4d6c127dba713c8ac23af39ed21448545ef78a..4253bf6748b915e9a94cff143811b956239ed044 100644 (file)
@@ -15,7 +15,7 @@ function file_type_cloud_get_url($type, $friends) {
        } 
 
        if ($type->tag == "image") {
-               $url .= "&listtype=gallery";
+               $url .= "&list_type=gallery";
        }
 
        if (elgg_get_page_owner_guid()) {
index 28111554fd4cc48dab4aeac23ae087f68d5027d5..3026c05f29f7f3b11e8f1ccd8ea24dcf953e15f6 100644 (file)
@@ -21,7 +21,7 @@ $body = elgg_list_entities_from_relationship(array(
        'inverse_relationship' => true,
        'types' => 'user',
        'limit' => $limit,
-       'gallery' => true,
+       'list_type' => 'gallery',
 ));
 
 $body .= "<div class='center mts'>$all_link</div>";
index ec842a252739637795812bd98c0ff0d254fd8e6a..bb5bd7a8d7abc54d6772d118310f5785eaee519f 100644 (file)
@@ -16,7 +16,7 @@ $size = $vars['entity']->icon_size;
 if (elgg_instanceof($owner, 'user')) {
        $html = $owner->listFriends('', $num, array(
                'size' => $size,
-               'gallery' => true,
+               'list_type' => 'gallery',
        ));
        if ($html) {
                echo $html;