$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
// 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
}
$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
}
$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
$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
$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
--- /dev/null
+<?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