]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed some display issues with the common lists
authorCash Costello <cash.costello@gmail.com>
Sun, 1 Nov 2009 23:25:25 +0000 (23:25 +0000)
committerCash Costello <cash.costello@gmail.com>
Sun, 1 Nov 2009 23:25:25 +0000 (23:25 +0000)
lib/tidypics.php
pages/lists/mostrecentimages.php
pages/lists/mostviewedimages.php
pages/lists/recentlycommented.php
pages/lists/recentlyviewed.php
pages/lists/yourmostviewed.php
views/default/tidypics/gallery.php [new file with mode: 0644]

index 38afc27f2b061afd113aaf126636e6f2eb4da8bb..a5b713ee4ef5386662269b33850ccb7a9e946b64 100644 (file)
                $count = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset, true);\r
                $entities = tp_get_entities($type, $subtype, $owner_guid, "", $limit, $offset);\r
 \r
-               return elgg_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination);\r
+               return tp_view_entity_list($entities, $count, $offset, $limit, $fullview, $viewtypetoggle, $pagination);\r
+       }\r
+       \r
+       function tp_view_entity_list($entities, $count, $offset, $limit, $fullview = true, $viewtypetoggle = false, $pagination = true) {\r
+               $context = get_context();\r
+\r
+               $html = elgg_view('tidypics/gallery',array(\r
+                       'entities' => $entities,\r
+                       'count' => $count,\r
+                       'offset' => $offset,\r
+                       'limit' => $limit,\r
+                       'baseurl' => $_SERVER['REQUEST_URI'],\r
+                       'fullview' => $fullview,\r
+                       'context' => $context,\r
+                       'viewtypetoggle' => $viewtypetoggle,\r
+                       'viewtype' => get_input('search_viewtype','list'),\r
+                       'pagination' => $pagination\r
+               ));\r
                \r
+               return $html;\r
        }\r
        \r
        /**\r
index 2708171786497ed4dc1957c5de8ac0d19ebaa10c..5f51165139d25e7dc563d74195db2fb46745cb6b 100644 (file)
@@ -31,8 +31,6 @@
        
        // grab the html to display the images
        $images = tp_list_entities("object", "image", $user_id, $max, false, false, true);
-//     echo "<pre>"; var_dump( $images ); echo "</pre>";
-       $images .= '<div class="clearfloat"></div>'; // hack until elgg fixes problem with css/list entities html
        
        
        // this view takes care of the title on the main column and the content wrapper
index da8a20b5f06097432fbd13be606cd40030f79124..b8cc67b51f39b1d19bd541decf17a8e65649ca9b 100644 (file)
        }
        $title = elgg_echo("tidypics:mostviewed");
        $area2 = elgg_view_title($title);
-       $area2 .= elgg_view_entity_list($entities, $max, 0, $max, false);
+       
+       // grab the html to display the images
+       $images = tp_view_entity_list($entities, $max, 0, $max, false);
+       
+       // this view takes care of the title on the main column and the content wrapper
+       $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $images,));
+       if( empty( $area2 )) $area2 = $images;  
+       
        $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
        page_draw($title, $body);
 ?>
\ No newline at end of file
index fd1a244545dc7556810470e1d039af3f499b16f2..962732dba7c8b875de2e8410c45a4c1f6418d6d0 100644 (file)
        }
        $title = elgg_echo("tidypics:recentlycommented");
        $area2 = elgg_view_title($title);
-       $area2 .= elgg_view_entity_list($entities, $max, 0, $max, false);
+       
+       // grab the html to display the images
+       $images = tp_view_entity_list($entities, $max, 0, $max, false);
+       
+       // this view takes care of the title on the main column and the content wrapper
+       $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $images,));
+       if( empty( $area2 )) $area2 = $images;
+               
        $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
        page_draw($title, $body);
 ?>
\ No newline at end of file
index 6189b07de18f3be7ac996f71d280eab9d6aef290..1fa1be0ea2d81165e403ac92372ea8d661682425 100644 (file)
        
        $title = elgg_echo("tidypics:recentlyviewed");
        $area2 = elgg_view_title($title);
-       $area2 .= elgg_view_entity_list($entities, $max, 0, $max, false);
+       
+       // grab the html to display the images
+       $images = tp_view_entity_list($entities, $max, 0, $max, false);
+       
+       // this view takes care of the title on the main column and the content wrapper
+       $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $images,));
+       if( empty( $area2 )) $area2 = $images;
+       
        $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
        page_draw($title, $body);
 ?>
\ No newline at end of file
index b00ddafa1e0ce43615af877972fe6b2daa5cb5bd..9155c44542c35714cb67ffd85590cb6ea7aaf6c3 100644 (file)
        
        $title = elgg_echo("tidypics:yourmostviewed");
        $area2 = elgg_view_title($title);
-       $area2 .= elgg_view_entity_list($entities, $max, 0, $max, false);
+       
+       // grab the html to display the images
+       $images = tp_view_entity_list($entities, $max, 0, $max, false);
+       
+       // this view takes care of the title on the main column and the content wrapper
+       $area2 = elgg_view('tidypics/content_wrapper', array('title' => $title, 'content' => $images,));
+       if( empty( $area2 )) $area2 = $images;
+               
        $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
        page_draw($title, $body);
 ?>
\ No newline at end of file
diff --git a/views/default/tidypics/gallery.php b/views/default/tidypics/gallery.php
new file mode 100644 (file)
index 0000000..29c706b
--- /dev/null
@@ -0,0 +1,64 @@
+<?php\r
+/**\r
+ * view a gallery of photos or albums\r
+ *\r
+ */\r
+\r
+$context = $vars['context'];\r
+$offset = $vars['offset'];\r
+$entities = $vars['entities'];\r
+$limit = $vars['limit'];\r
+$count = $vars['count'];\r
+$baseurl = $vars['baseurl'];\r
+$context = $vars['context'];\r
+$viewtype = $vars['viewtype'];\r
+$pagination = $vars['pagination'];\r
+$fullview = $vars['fullview'];\r
+\r
+$html = "";\r
+$nav = "";\r
+\r
+if (isset($vars['viewtypetoggle'])) {\r
+       $viewtypetoggle = $vars['viewtypetoggle'];\r
+} else {\r
+       $viewtypetoggle = true;\r
+}\r
+\r
+if ($context == "search" && $count > 0 && $viewtypetoggle) {\r
+       $nav .= elgg_view('navigation/viewtype', array(\r
+               'baseurl' => $baseurl,\r
+               'offset' => $offset,\r
+               'count' => $count,\r
+               'viewtype' => $viewtype,\r
+       ));\r
+}\r
+\r
+if ($pagination) {\r
+       $nav .= elgg_view('navigation/pagination',array(\r
+               'baseurl' => $baseurl,\r
+               'offset' => $offset,\r
+               'count' => $count,\r
+               'limit' => $limit,\r
+       ));\r
+}\r
+\r
+$html .= $nav;\r
+if ($viewtype == 'list') {\r
+       if (is_array($entities) && sizeof($entities) > 0) {\r
+               foreach($entities as $entity) {\r
+                       $html .= elgg_view_entity($entity, $fullview);\r
+               }\r
+       }\r
+} else {\r
+       if (is_array($entities) && sizeof($entities) > 0) {\r
+               $html .= elgg_view('entities/gallery', array('entities' => $entities));\r
+       }\r
+}\r
+\r
+$html .= '<div class="clearfloat"></div>';\r
+\r
+if ($count) {\r
+       $html .= $nav;\r
+}\r
+\r
+echo $html;
\ No newline at end of file