aboutsummaryrefslogtreecommitdiff
path: root/views/default/navigation
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/navigation')
-rw-r--r--views/default/navigation/listtype.php28
-rw-r--r--views/default/navigation/viewtype.php21
2 files changed, 30 insertions, 19 deletions
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