diff options
Diffstat (limited to 'views/default/navigation')
| -rw-r--r-- | views/default/navigation/breadcrumbs.php | 41 | ||||
| -rw-r--r-- | views/default/navigation/menu/default.php | 31 | ||||
| -rw-r--r-- | views/default/navigation/menu/elements/item.php | 43 | ||||
| -rw-r--r-- | views/default/navigation/menu/elements/section.php | 30 | ||||
| -rw-r--r-- | views/default/navigation/menu/page.php | 36 | ||||
| -rw-r--r-- | views/default/navigation/menu/site.php | 30 | ||||
| -rw-r--r-- | views/default/navigation/menu/user_hover.php | 60 | ||||
| -rw-r--r-- | views/default/navigation/pagination.php | 258 | ||||
| -rw-r--r-- | views/default/navigation/tabs.php | 81 | ||||
| -rw-r--r-- | views/default/navigation/toolbox.php | 84 | ||||
| -rw-r--r-- | views/default/navigation/topbar_tools.php | 71 | ||||
| -rw-r--r-- | views/default/navigation/viewtype.php | 45 |
12 files changed, 488 insertions, 322 deletions
diff --git a/views/default/navigation/breadcrumbs.php b/views/default/navigation/breadcrumbs.php new file mode 100644 index 000000000..88577a8ff --- /dev/null +++ b/views/default/navigation/breadcrumbs.php @@ -0,0 +1,41 @@ +<?php +/** + * Displays breadcrumbs. + * + * @package Elgg + * @subpackage Core + * + * @uses $vars['breadcrumbs'] (Optional) Array of arrays with keys 'title' and 'link' + * @uses $vars['class'] + * + * @see elgg_push_breadcrumb + */ + +if (isset($vars['breadcrumbs'])) { + $breadcrumbs = $vars['breadcrumbs']; +} else { + $breadcrumbs = elgg_get_breadcrumbs(); +} + +$class = 'elgg-menu elgg-breadcrumbs'; +$additional_class = elgg_extract('class', $vars, ''); +if ($additional_class) { + $class = "$class $additional_class"; +} + +if (is_array($breadcrumbs) && count($breadcrumbs) > 0) { + echo "<ul class=\"$class\">"; + foreach ($breadcrumbs as $breadcrumb) { + if (!empty($breadcrumb['link'])) { + $crumb = elgg_view('output/url', array( + 'href' => $breadcrumb['link'], + 'text' => $breadcrumb['title'], + 'is_trusted' => true, + )); + } else { + $crumb = $breadcrumb['title']; + } + echo "<li>$crumb</li>"; + } + echo '</ul>'; +} diff --git a/views/default/navigation/menu/default.php b/views/default/navigation/menu/default.php new file mode 100644 index 000000000..006deb3ea --- /dev/null +++ b/views/default/navigation/menu/default.php @@ -0,0 +1,31 @@ +<?php +/** + * Default menu + * + * @uses $vars['name'] Name of the menu + * @uses $vars['menu'] Array of menu items + * @uses $vars['class'] Additional CSS class for the menu + * @uses $vars['item_class'] Additional CSS class for each menu item + * @uses $vars['show_section_headers'] Do we show headers for each section? + */ + +// we want css classes to use dashes +$vars['name'] = preg_replace('/[^a-z0-9\-]/i', '-', $vars['name']); +$headers = elgg_extract('show_section_headers', $vars, false); +$item_class = elgg_extract('item_class', $vars, ''); + +$class = "elgg-menu elgg-menu-{$vars['name']}"; +if (isset($vars['class'])) { + $class .= " {$vars['class']}"; +} + +foreach ($vars['menu'] as $section => $menu_items) { + echo elgg_view('navigation/menu/elements/section', array( + 'items' => $menu_items, + 'class' => "$class elgg-menu-{$vars['name']}-$section", + 'section' => $section, + 'name' => $vars['name'], + 'show_section_headers' => $headers, + 'item_class' => $item_class, + )); +} diff --git a/views/default/navigation/menu/elements/item.php b/views/default/navigation/menu/elements/item.php new file mode 100644 index 000000000..fd9738826 --- /dev/null +++ b/views/default/navigation/menu/elements/item.php @@ -0,0 +1,43 @@ +<?php +/** + * A single element of a menu. + * + * @package Elgg.Core + * @subpackage Navigation + * + * @uses $vars['item'] ElggMenuItem + * @uses $vars['item_class'] Additional CSS class for the menu item + */ + +$item = $vars['item']; + +$link_class = 'elgg-menu-closed'; +if ($item->getSelected()) { + // @todo switch to addItemClass when that is implemented + //$item->setItemClass('elgg-state-selected'); + $link_class = 'elgg-menu-opened'; +} + +$children = $item->getChildren(); +if ($children) { + $item->addLinkClass($link_class); + $item->addLinkClass('elgg-menu-parent'); +} + +$item_class = $item->getItemClass(); +if ($item->getSelected()) { + $item_class = "$item_class elgg-state-selected"; +} +if (isset($vars['item_class']) && $vars['item_class']) { + $item_class .= ' ' . $vars['item_class']; +} + +echo "<li class=\"$item_class\">"; +echo $item->getContent(); +if ($children) { + echo elgg_view('navigation/menu/elements/section', array( + 'items' => $children, + 'class' => 'elgg-menu elgg-child-menu', + )); +} +echo '</li>'; diff --git a/views/default/navigation/menu/elements/section.php b/views/default/navigation/menu/elements/section.php new file mode 100644 index 000000000..c0e9ba750 --- /dev/null +++ b/views/default/navigation/menu/elements/section.php @@ -0,0 +1,30 @@ +<?php +/** + * Menu group + * + * @uses $vars['items'] Array of menu items + * @uses $vars['class'] Additional CSS class for the section + * @uses $vars['name'] Name of the menu + * @uses $vars['section'] The section name + * @uses $vars['item_class'] Additional CSS class for each menu item + * @uses $vars['show_section_headers'] Do we show headers for each section + */ + +$headers = elgg_extract('show_section_headers', $vars, false); +$class = elgg_extract('class', $vars, ''); +$item_class = elgg_extract('item_class', $vars, ''); + +if ($headers) { + $name = elgg_extract('name', $vars); + $section = elgg_extract('section', $vars); + echo '<h2>' . elgg_echo("menu:$name:header:$section") . '</h2>'; +} + +echo "<ul class=\"$class\">"; +foreach ($vars['items'] as $menu_item) { + echo elgg_view('navigation/menu/elements/item', array( + 'item' => $menu_item, + 'item_class' => $item_class, + )); +} +echo '</ul>'; diff --git a/views/default/navigation/menu/page.php b/views/default/navigation/menu/page.php new file mode 100644 index 000000000..56a288234 --- /dev/null +++ b/views/default/navigation/menu/page.php @@ -0,0 +1,36 @@ +<?php +/** + * Page menu + * + * @uses $vars['menu'] + * @uses $vars['selected_item'] + * @uses $vars['class'] + * @uses $vars['name'] + * @uses $vars['show_section_headers'] + */ + +$headers = elgg_extract('show_section_headers', $vars, false); + +$class = 'elgg-menu elgg-menu-page'; +if (isset($vars['class'])) { + $class = "$class {$vars['class']}"; +} + +if (isset($vars['selected_item'])) { + $parent = $vars['selected_item']->getParent(); + + while ($parent) { + $parent->setSelected(); + $parent = $parent->getParent(); + } +} + +foreach ($vars['menu'] as $section => $menu_items) { + echo elgg_view('navigation/menu/elements/section', array( + 'items' => $menu_items, + 'class' => "$class elgg-menu-page-$section", + 'section' => $section, + 'name' => $vars['name'], + 'show_section_headers' => $headers + )); +} diff --git a/views/default/navigation/menu/site.php b/views/default/navigation/menu/site.php new file mode 100644 index 000000000..24c21dd57 --- /dev/null +++ b/views/default/navigation/menu/site.php @@ -0,0 +1,30 @@ +<?php +/** + * Site navigation menu + * + * @uses $vars['menu']['default'] + * @uses $vars['menu']['more'] + */ + +$default_items = elgg_extract('default', $vars['menu'], array()); +$more_items = elgg_extract('more', $vars['menu'], array()); + +echo '<ul class="elgg-menu elgg-menu-site elgg-menu-site-default clearfix">'; +foreach ($default_items as $menu_item) { + echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); +} + +if ($more_items) { + echo '<li class="elgg-more">'; + + $more = elgg_echo('more'); + echo "<a href=\"#\">$more</a>"; + + echo elgg_view('navigation/menu/elements/section', array( + 'class' => 'elgg-menu elgg-menu-site elgg-menu-site-more', + 'items' => $more_items, + )); + + echo '</li>'; +} +echo '</ul>'; diff --git a/views/default/navigation/menu/user_hover.php b/views/default/navigation/menu/user_hover.php new file mode 100644 index 000000000..5c89e585c --- /dev/null +++ b/views/default/navigation/menu/user_hover.php @@ -0,0 +1,60 @@ +<?php +/** + * User hover menu + * + * Register for the 'register', 'menu:user_hover' plugin hook to add to the user + * hover menu. There are three sections: action, default, and admin. + * + * @uses $vars['menu'] Menu array provided by elgg_view_menu() + */ + +$user = $vars['entity']; +$actions = elgg_extract('action', $vars['menu'], null); +$main = elgg_extract('default', $vars['menu'], null); +$admin = elgg_extract('admin', $vars['menu'], null); + +echo '<ul class="elgg-menu elgg-menu-hover">'; + +// name and username +$name_link = elgg_view('output/url', array( + 'href' => $user->getURL(), + 'text' => "<span class=\"elgg-heading-basic\">$user->name</span>@$user->username", + 'is_trusted' => true, +)); +echo "<li>$name_link</li>"; + +// actions +if (elgg_is_logged_in() && $actions) { + echo '<li>'; + echo elgg_view('navigation/menu/elements/section', array( + 'class' => "elgg-menu elgg-menu-hover-actions", + 'items' => $actions, + )); + echo '</li>'; +} + +// main +if ($main) { + echo '<li>'; + + echo elgg_view('navigation/menu/elements/section', array( + 'class' => 'elgg-menu elgg-menu-hover-default', + 'items' => $main, + )); + + echo '</li>'; +} + +// admin +if (elgg_is_admin_logged_in() && $admin) { + echo '<li>'; + + echo elgg_view('navigation/menu/elements/section', array( + 'class' => 'elgg-menu elgg-menu-hover-admin', + 'items' => $admin, + )); + + echo '</li>'; +} + +echo '</ul>'; diff --git a/views/default/navigation/pagination.php b/views/default/navigation/pagination.php index c8d961ea7..04044c51c 100644 --- a/views/default/navigation/pagination.php +++ b/views/default/navigation/pagination.php @@ -1,156 +1,132 @@ <?php +/** + * Elgg pagination + * + * @package Elgg + * @subpackage Core + * + * @uses int $vars['offset'] The offset in the list + * @uses int $vars['limit'] Number of items per page + * @uses int $vars['count'] Number of items in list + * @uses string $vars['base_url'] Base URL to use in links + * @uses string $vars['offset_key'] The string to use for offet in the URL + */ - /** - * Elgg pagination - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008 - * @link http://elgg.org/ - * - */ - - if (!isset($vars['offset'])) { - $offset = 0; - } else { - $offset = $vars['offset']; - } - if (!isset($vars['limit'])) { - $limit = 10; - } else { - $limit = $vars['limit']; - } - if (!isset($vars['count'])) { - $count = 0; - } else { - $count = $vars['count']; - } - if (!isset($vars['word'])) { - $word = "offset"; - } else { - $word = $vars['word']; +if (elgg_in_context('widget')) { + // widgets do not show pagination + return true; +} + +$offset = abs((int) elgg_extract('offset', $vars, 0)); +// because you can say $vars['limit'] = 0 +if (!$limit = (int) elgg_extract('limit', $vars, 10)) { + $limit = 10; +} + +$count = (int) elgg_extract('count', $vars, 0); +$offset_key = elgg_extract('offset_key', $vars, 'offset'); +// some views pass an empty string for base_url +if (isset($vars['base_url']) && $vars['base_url']) { + $base_url = $vars['base_url']; +} else if (isset($vars['baseurl']) && $vars['baseurl']) { + elgg_deprecated_notice("Use 'base_url' instead of 'baseurl' for the navigation/pagination view", 1.8); + $base_url = $vars['baseurl']; +} else { + $base_url = current_page_url(); +} + +$num_pages = elgg_extract('num_pages', $vars, 10); +$delta = ceil($num_pages / 2); + +if ($count <= $limit && $offset == 0) { + // no need for pagination + return true; +} + +$total_pages = ceil($count / $limit); +$current_page = ceil($offset / $limit) + 1; + +$pages = new stdClass(); +$pages->prev = array( + 'text' => '« ' . elgg_echo('previous'), + 'href' => '', + 'is_trusted' => true, +); +$pages->next = array( + 'text' => elgg_echo('next') . ' »', + 'href' => '', + 'is_trusted' => true, +); +$pages->items = array(); + +// Add pages before the current page +if ($current_page > 1) { + $prev_offset = $offset - $limit; + if ($prev_offset < 0) { + $prev_offset = 0; } - if (isset($vars['nonefound'])) { - $nonefound = $vars['nonefound']; - } else { - $nonefound = true; + + $pages->prev['href'] = elgg_http_add_url_query_elements($base_url, array($offset_key => $prev_offset)); + + $first_page = $current_page - $delta; + if ($first_page < 1) { + $first_page = 1; } - - $totalpages = ceil($count / $limit); - $currentpage = ceil($offset / $limit) + 1; - $baseurl = preg_replace('/[\&\?]'.$word.'\=[0-9]*/',"",$vars['baseurl']); - - //only display if there is content to paginate through or if we already have an offset - if ($count >= $limit || $offset > 0){ + $pages->items = range($first_page, $current_page - 1); +} -?> -<div class="pagination"> - <p> -<?php +$pages->items[] = $current_page; + - //if ($count == 0) { - - // static $notfounddisplayed; - // if (!isset($notfounddisplayed) && $nonefound) { - // echo elgg_echo("notfound"); - // $notfounddisplayed = true; - // } - - //} - - if ($offset > 0) { - - $prevoffset = $offset - $limit; - if ($prevoffset < 0) $prevoffset = 0; - - $prevurl = $baseurl; - if (substr_count($baseurl,'?')) { - $prevurl .= "&{$word}=" . $prevoffset; - } else { - $prevurl .= "?{$word}=" . $prevoffset; - } - - echo "<a href=\"{$prevurl}\" class=\"pagination_previous\">« ". elgg_echo("previous") ."</a> "; - +// add pages after the current one +if ($current_page < $total_pages) { + $next_offset = $offset + $limit; + if ($next_offset >= $count) { + $next_offset--; } - if ($offset > 0 || $offset < ($count - $limit)) { - - $currentpage = round($offset / $limit) + 1; - $allpages = ceil($count / $limit); - - $i = 1; - $pagesarray = array(); - while ($i <= $allpages && $i <= 4) { - $pagesarray[] = $i; - $i++; - } - $i = $currentpage - 2; - while ($i <= $allpages && $i <= ($currentpage + 2)) { - if ($i > 0 && !in_array($i,$pagesarray)) - $pagesarray[] = $i; - $i++; - } - $i = $allpages - 3; - while ($i <= $allpages) { - if ($i > 0 && !in_array($i,$pagesarray)) - $pagesarray[] = $i; - $i++; - } - - sort($pagesarray); - - $prev = 0; - foreach($pagesarray as $i) { - - if (($i - $prev) > 1) { - - echo " ... "; - - } - - $counturl = $baseurl; - $curoffset = (($i - 1) * $limit); - if (substr_count($baseurl,'?')) { - $counturl .= "&{$word}=" . $curoffset; - } else { - $counturl .= "?{$word}=" . $curoffset; - } - if ($curoffset != $offset) { - echo " <a href=\"{$counturl}\" class=\"pagination_number\">{$i}</a> "; - } else { - echo "<span class=\"pagination_currentpage\"> {$i} </span>"; - } - $prev = $i; - - } + $pages->next['href'] = elgg_http_add_url_query_elements($base_url, array($offset_key => $next_offset)); + $last_page = $current_page + $delta; + if ($last_page > $total_pages) { + $last_page = $total_pages; } - - if ($offset < ($count - $limit)) { - - $nextoffset = $offset + $limit; - if ($nextoffset >= $count) $nextoffset--; - - $nexturl = $baseurl; - if (substr_count($baseurl,'?')) { - $nexturl .= "&{$word}=" . $nextoffset; - } else { - $nexturl .= "?{$word}=" . $nextoffset; - } - - echo " <a href=\"{$nexturl}\" class=\"pagination_next\">" . elgg_echo("next") . " »</a>"; - + + $pages->items = array_merge($pages->items, range($current_page + 1, $last_page)); +} + + +echo '<ul class="elgg-pagination">'; + +if ($pages->prev['href']) { + $link = elgg_view('output/url', $pages->prev); + echo "<li>$link</li>"; +} else { + echo "<li class=\"elgg-state-disabled\"><span>{$pages->prev['text']}</span></li>"; +} + +foreach ($pages->items as $page) { + if ($page == $current_page) { + echo "<li class=\"elgg-state-selected\"><span>$page</span></li>"; + } else { + $page_offset = (($page - 1) * $limit); + $url = elgg_http_add_url_query_elements($base_url, array($offset_key => $page_offset)); + $link = elgg_view('output/url', array( + 'href' => $url, + 'text' => $page, + 'is_trusted' => true, + )); + echo "<li>$link</li>"; } +} -?> - </p> -</div> +if ($pages->next['href']) { + $link = elgg_view('output/url', $pages->next); + echo "<li>$link</li>"; +} else { + echo "<li class=\"elgg-state-disabled\"><span>{$pages->next['text']}</span></li>"; +} -<?php - } // end of pagination check if statement -?>
\ No newline at end of file +echo '</ul>'; diff --git a/views/default/navigation/tabs.php b/views/default/navigation/tabs.php new file mode 100644 index 000000000..95e3f2669 --- /dev/null +++ b/views/default/navigation/tabs.php @@ -0,0 +1,81 @@ +<?php +/** + * Tab navigation + * + * @uses string $vars['type'] horizontal || vertical - Defaults to horizontal + * @uses string $vars['class'] Additional class to add to ul + * @uses array $vars['tabs'] A multi-dimensional array of tab entries in the format array( + * 'text' => string, // The string between the <a></a> tags + * 'href' => string, // URL for the link + * 'class' => string // Class of the li element + * 'id' => string, // ID of the li element + * 'selected' => bool // if this tab is currently selected (applied to li element) + * 'link_class' => string, // Class to pass to the link + * 'link_id' => string, // ID to pass to the link + * ) + */ +$options = elgg_clean_vars($vars); + +$type = elgg_extract('type', $vars, 'horizontal'); + +if ($type == 'horizontal') { + $options['class'] = "elgg-tabs elgg-htabs"; +} else { + $options['class'] = "elgg-tabs elgg-vtabs"; +} +if (isset($vars['class'])) { + $options['class'] = "{$options['class']} {$vars['class']}"; +} + +unset($options['tabs']); +unset($options['type']); + +$attributes = elgg_format_attributes($options); + +if (isset($vars['tabs']) && is_array($vars['tabs']) && !empty($vars['tabs'])) { + ?> + <ul <?php echo $attributes; ?>> + <?php + foreach ($vars['tabs'] as $info) { + $class = elgg_extract('class', $info, ''); + $id = elgg_extract('id', $info, ''); + + $selected = elgg_extract('selected', $info, FALSE); + if ($selected) { + $class .= ' elgg-state-selected'; + } + + $class_str = ($class) ? "class=\"$class\"" : ''; + $id_str = ($id) ? "id=\"$id\"" : ''; + + $options = $info; + unset($options['class']); + unset($options['id']); + unset($options['selected']); + + if (!isset($info['href']) && isset($info['url'])) { + $options['href'] = $info['url']; + unset($options['url']); + } + if (!isset($info['text']) && isset($info['title'])) { + $options['text'] = $options['title']; + unset($options['title']); + } + if (isset($info['link_class'])) { + $options['class'] = $options['link_class']; + unset($options['link_class']); + } + + if (isset($info['link_id'])) { + $options['id'] = $options['link_id']; + unset($options['link_id']); + } + + $link = elgg_view('output/url', $options); + + echo "<li $id_str $class_str>$link</li>"; + } + ?> + </ul> + <?php +} diff --git a/views/default/navigation/toolbox.php b/views/default/navigation/toolbox.php deleted file mode 100644 index 91a96d1fb..000000000 --- a/views/default/navigation/toolbox.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - - /** - * Elgg standard toolbox - * The standard user toolbox that displays a users menu options - * This will be populated depending on the plugins active - only plugin navigation will appear here - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008 - * @link http://elgg.org/ - * - */ - - $menu = get_register('menu');
- $contexts = $vars['config']->menucontexts; - - if (is_array($menu) && sizeof($menu) > 0) { - -?> -<div class="elggtoolbar"> -<div class="elggtoolbar_header"><h1>Your tools</h1></div> -<ul class="drawers"> - -<?php -
- $key = 0; - foreach($menu as $item) { - -?> - - <li class="drawer"> - <h2 id="nav_<?php echo $contexts[$key]; ?>" class="drawer-handle"><?php echo $item->name ?></h2> -<?php - - if (sizeof($item->children) > 0 ) { - echo "<ul>"; - foreach($item->children as $subitem) { -?> - <li> - <a href="<?php echo $subitem->value ?>"><?php echo $subitem->name; ?></a> - </li> -<?php - } - echo "</ul>"; - - } - -?> - </li> - -<?php
- $key++; - - } - -?> - -</ul> -</div><!-- /.elggtoolbar --> - -<?php - - } -
- if (in_array(get_context(),$contexts)) {
- $key = array_search(get_context(),$contexts); -?> - - -<script language="javascript">
- $(document).ready(function(){
- $('h2#nav_<?php echo $contexts[$key]; ?>').click();
- });
-</script>
-
-
-<?php
-
- }
-
-?>
\ No newline at end of file diff --git a/views/default/navigation/topbar_tools.php b/views/default/navigation/topbar_tools.php index bb9021380..307f03fc6 100644 --- a/views/default/navigation/topbar_tools.php +++ b/views/default/navigation/topbar_tools.php @@ -1,64 +1,9 @@ <?php - - /** - * Elgg standard tools drop down - * This will be populated depending on the plugins active - only plugin navigation will appear here - * - * @package Elgg - * @subpackage Core - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Curverider Ltd - * @copyright Curverider Ltd 2008 - * @link http://elgg.org/ - * - */ - - $menu = get_register('menu'); - - //var_export($menu); - - if (is_array($menu) && sizeof($menu) > 0) { - -?> - -<ul id="tools_menu"> - <li><a href="#">Tools</a> - <ul> - <?php - - foreach($menu as $item) { - - echo "<li><a href=\"{$item->value}\">" . $item->name . "</a></li>"; - - } - - ?> - </ul> - </li> -</ul> - -<?php - - } - -?> - -<script type="text/javascript"> -function tools_menu(){ -$(" #tools_menu li").hover(function(){ - $(this).find('ul:first').slideDown("fast"); - $(this).parent().parent().parent().find("#tools_menu a").addClass('tools_menu_on'); - - },function(){ - $(this).find('ul:first').slideUp("fast"); - $(this).parent().parent().parent().find("#tools_menu a").removeClass('tools_menu_on'); - }); -} - - - - $(document).ready(function(){ - tools_menu(); -}); -</script> - +/** + * Empty view for backward compatibility. + * + * @package Elgg + * @subpackage Core + * + * @deprecated 1.8 Extend the topbar menus or the page/elements/topbar view directly + */ diff --git a/views/default/navigation/viewtype.php b/views/default/navigation/viewtype.php index 103e9c450..6dfa4ebc7 100644 --- a/views/default/navigation/viewtype.php +++ b/views/default/navigation/viewtype.php @@ -1,34 +1,11 @@ -<?php
-
- /**
- * Elgg list view switcher
- *
- * @package Elgg
- * @subpackage Core
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd
- * @copyright Curverider Ltd 2008
- * @link http://elgg.org/
- */
-
-
- $baseurl = preg_replace('/[\&\?]search\_viewtype\=[A-Za-z0-9]*/',"",$vars['baseurl']);
-
- if ($vars['viewtype'] == "list") {
- $viewtype = "gallery";
- } else {
- $viewtype = "list";
- }
-
- if (substr_count($baseurl,'?')) {
- $baseurl .= "&search_viewtype=" . $viewtype;
- } else {
- $baseurl .= "?search_viewtype=" . $viewtype;
- }
-
-?>
-
- <p>
- <?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 +<?php +/** + * Elgg list view switcher + * + * @package Elgg + * @subpackage Core + * + * @deprecated 1.8 See how file plugin adds a toggle in function file_register_toggle() + */ + +elgg_deprecated_notice('navigation/viewtype was deprecated', 1.8); |
