diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-14 08:04:28 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-14 08:04:28 +0000 |
commit | aa5bb3f0bc17d858831412da82eef805ecafac89 (patch) | |
tree | 1a8c281c27778755bd9db83f8aa5822706a3b5db /views/default | |
parent | bddba2985d89ff3ed9f52681b37cdce7a9c22bd9 (diff) | |
download | elgg-aa5bb3f0bc17d858831412da82eef805ecafac89.tar.gz elgg-aa5bb3f0bc17d858831412da82eef805ecafac89.tar.bz2 |
Fixes #2334: Converted viewtype => listtype and viewtypetoggle => listtypetoggle. Did my best to maintain backwards compatibility but might have missed something...
git-svn-id: http://code.elgg.org/elgg/trunk@7311 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/entities/entity_list.php | 16 | ||||
-rw-r--r-- | views/default/navigation/listtype.php | 28 | ||||
-rw-r--r-- | views/default/navigation/viewtype.php | 21 | ||||
-rw-r--r-- | views/default/object/default.php | 2 | ||||
-rw-r--r-- | views/default/user/default.php | 2 |
5 files changed, 40 insertions, 29 deletions
diff --git a/views/default/entities/entity_list.php b/views/default/entities/entity_list.php index cf3df78b7..fd6ea27bb 100644 --- a/views/default/entities/entity_list.php +++ b/views/default/entities/entity_list.php @@ -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 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 diff --git a/views/default/object/default.php b/views/default/object/default.php index 040bae832..6e03e9e78 100644 --- a/views/default/object/default.php +++ b/views/default/object/default.php @@ -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 = ""; } diff --git a/views/default/user/default.php b/views/default/user/default.php index 8c5fdee3e..744a54595 100644 --- a/views/default/user/default.php +++ b/views/default/user/default.php @@ -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); |