change nav selected css class

This commit is contained in:
Fabio Comuni 2011-07-25 16:52:30 +02:00
parent dfba0f13c8
commit e6444adafd
11 changed files with 16 additions and 11 deletions

View file

@ -2946,6 +2946,11 @@ function get_plugin_info($plugin){
return $info; return $info;
}} }}
if(! function_exists('set_nav_selected')){
function set_nav_selected($id){
return '<script> $(document).ready(function() { $("#'.$id.'").addClass("selected"); });</script>';
}}
if(! function_exists('return_bytes')) { if(! function_exists('return_bytes')) {
function return_bytes ($size_str) { function return_bytes ($size_str) {
switch (substr ($size_str, -1)) switch (substr ($size_str, -1))
@ -2968,4 +2973,4 @@ function generate_guid() {
$found = false; $found = false;
} while ($found == true ); } while ($found == true );
return $guid; return $guid;
} }

View file

@ -41,7 +41,7 @@ function nav(&$a) {
$nav['logout'] = Array('logout',t('Logout'), "", t('End this session')); $nav['logout'] = Array('logout',t('Logout'), "", t('End this session'));
} }
else { else {
$nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'nav-selected':''), t('Sign in')); $nav['login'] = Array('login',t('Login'), ($a->module == 'login'?'selected':''), t('Sign in'));
} }

View file

@ -25,7 +25,7 @@ function community_content(&$a, $update = 0) {
$o .= '<h3>' . t('Community') . '</h3>'; $o .= '<h3>' . t('Community') . '</h3>';
if(! $update) { if(! $update) {
$o .= '<script> $(document).ready(function() { $(\'#nav-community-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected('nav-community-link');
$o .= '<div id="live-community"></div>' . "\r\n"; $o .= '<div id="live-community"></div>' . "\r\n";
$o .= "<script> var profile_uid = -1; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n"; $o .= "<script> var profile_uid = -1; var netargs = '/?f='; var profile_page = " . $a->pager['page'] . "; </script>\r\n";
} }

View file

@ -112,7 +112,7 @@ function contacts_content(&$a) {
$sort_type = 0; $sort_type = 0;
$o = ''; $o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-contacts-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected('nav-contacts-link');
$_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd; $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;

View file

@ -22,7 +22,7 @@ function directory_content(&$a) {
} }
$o = ''; $o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-directory-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected('nav-directory-link');
if(x($_SESSION,'theme')) if(x($_SESSION,'theme'))
unset($_SESSION['theme']); unset($_SESSION['theme']);

View file

@ -110,7 +110,7 @@ function message_post(&$a) {
function message_content(&$a) { function message_content(&$a) {
$o = ''; $o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-messages-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected('nav-messages-link');
if(! local_user()) { if(! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);

View file

@ -98,7 +98,7 @@ function network_content(&$a, $update = 0) {
} }
} }
$o .= '<script> $(document).ready(function() { $(\'#nav-network-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected('nav-network-link');
$_SESSION['return_url'] = $a->cmd; $_SESSION['return_url'] = $a->cmd;

View file

@ -64,7 +64,7 @@ function notifications_content(&$a) {
} }
$o = ''; $o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-notify-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected("nav-notifications-link");
if(($a->argc > 1) && ($a->argv[1] == 'all')) if(($a->argc > 1) && ($a->argv[1] == 'all'))
$sql_extra = ''; $sql_extra = '';

View file

@ -70,7 +70,7 @@ function profile_content(&$a, $update = 0) {
} }
else { else {
if($a->profile['profile_uid'] == local_user()) if($a->profile['profile_uid'] == local_user())
$o .= '<script> $(document).ready(function() { $(\'#nav-home-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected('nav-home-link');
} }
$contact = null; $contact = null;

View file

@ -220,7 +220,7 @@ function profiles_post(&$a) {
function profiles_content(&$a) { function profiles_content(&$a) {
$o = ''; $o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-profiles-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected('nav-profiles-link');
if(! local_user()) { if(! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);

View file

@ -299,7 +299,7 @@ if(! function_exists('settings_content')) {
function settings_content(&$a) { function settings_content(&$a) {
$o = ''; $o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-settings-link\').addClass(\'nav-selected\'); });</script>'; $o .= set_nav_selected('nav-settings-link');
if(! local_user()) { if(! local_user()) {
notice( t('Permission denied.') . EOL ); notice( t('Permission denied.') . EOL );