]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2895: Converted content filter to a menu, duplicated styles to mimic tabs....
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 1 Mar 2011 05:40:42 +0000 (05:40 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Tue, 1 Mar 2011 05:40:42 +0000 (05:40 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8527 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/css/elements/navigation.php
views/default/page/layouts/content/filter.php

index 783d6481106b32311813969841d9541bb92788c9..d7c225d8ab7d182d5e0897a33a6b2cca3c7dd81c 100644 (file)
        background: white;
 }
 
+/* ***************************************
+       FILTER MENU
+*************************************** */
+.elgg-menu-filter {
+       margin-bottom: 5px;
+       border-bottom: 2px solid #cccccc;
+       display: table;
+       width: 100%;
+}
+.elgg-menu-filter > li {
+       float: left;
+       border: 2px solid #cccccc;
+       border-bottom: 0;
+       background: #eeeeee;
+       margin: 0 0 0 10px;
+       -moz-border-radius: 5px 5px 0 0;
+       -webkit-border-radius: 5px 5px 0 0;
+}
+.elgg-menu-filter > li > a {
+       text-decoration: none;
+       display: block;
+       padding: 3px 10px 0 10px;
+       text-align: center;
+       height: 21px;
+       color: #999999;
+}
+.elgg-menu-filter > li > a:hover {
+       background: #dedede;
+       color:#4690D6;
+}
+.elgg-menu-filter > .elgg-state-selected {
+       border-color: #cccccc;
+       background: white;
+}
+.elgg-menu-filter > .elgg-state-selected > a {
+       position: relative;
+       top: 2px;
+       background: white;
+}
+
 /* ***************************************
  * MENUS
  *
index 9daee6d71e8cc2432af61c29a63542a1fa2d8836..f22f2b76141220965ef1469c27ed61ed29026683 100644 (file)
@@ -23,21 +23,27 @@ if (elgg_is_logged_in() && $context) {
        // generate a list of default tabs
        $tabs = array(
                'all' => array(
-                       'title' => elgg_echo('all'),
-                       'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "pg/$context/all/",
+                       'text' => elgg_echo('all'),
+                       'href' => (isset($vars['all_link'])) ? $vars['all_link'] : "pg/$context/all/",
                        'selected' => ($filter_context == 'all'),
                ),
                'mine' => array(
-                       'title' => elgg_echo('mine'),
-                       'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$context/owner/$username/",
+                       'text' => elgg_echo('mine'),
+                       'href' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$context/owner/$username/",
                        'selected' => ($filter_context == 'mine'),
                ),
                'friend' => array(
-                       'title' => elgg_echo('friends'),
-                       'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$context/friends/$username/",
+                       'text' => elgg_echo('friends'),
+                       'href' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$context/friends/$username/",
                        'selected' => ($filter_context == 'friends'),
                ),
        );
+       
+       foreach ($tabs as $name => $tab) {
+               $tab['name'] = $name;
+               
+               elgg_register_menu_item('filter', $tab);
+       }
 
-       echo elgg_view('navigation/tabs', array('tabs' => $tabs));
+       echo elgg_view_menu('filter', array('sort_by' => 'weight'));
 }