From: Gabriel Wicke Date: Thu, 22 Apr 2004 22:31:57 +0000 (+0000) Subject: SkinPHPTal: X-Git-Tag: 1.3.0beta1~324 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=6921cfbd7e199b391e3168a98c288e730c175c86;p=lhc%2Fweb%2Fwiklou.git SkinPHPTal: * anon user links if enabled * page title shows action if set --- diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 1588207688..c642ea57b0 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -69,6 +69,8 @@ extract( $wgRequest->getValues( 'oldid', 'diff' ) ); $this->thispage = $wgTitle->getPrefixedDbKey(); + $this->thisurl = $wgTitle->getPrefixedURL(); + $this->thisurle = urlencode($this->thisurl); $this->loggedin = $wgUser->getID() != 0; $this->username = $wgUser->getName(); $this->userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName(); @@ -82,7 +84,9 @@ #} $tpl->setRef( "title", &$this->titletxt ); // ? - $tpl->set( "pagetitle", wfMsg( "pagetitle", $this->titletxt ) ); + $taction = $this->getPageTitleActionText(); + $taction = !empty($taction)?' - '.$taction:''; + $tpl->set( "pagetitle", wfMsg( "pagetitle", $this->titletxt.$taction ) ); $tpl->setRef( "thispage", &$this->thispage ); $tpl->set( "subtitle", $out->getSubtitle() ); $tpl->set( 'catlinks', getCategories()); @@ -114,7 +118,7 @@ $ntl = wfMsg( "newmessages", $this->makeKnownLink( $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) ) - . ":" . $wgUser->getName(), + . ":" . $this->username, wfMsg("newmessageslink") ) ); } @@ -152,7 +156,7 @@ 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?$wgLang->getLanguageName( $nt->getInterwiki()) : $l), 'class' => $wgLang->isRTL() ? 'rtl' : 'ltr'); } - if(count($language_urls) != 0 ) { + if(count($language_urls)) { $tpl->setRef( 'language_urls', &$language_urls); } else { $tpl->set('language_urls', false); @@ -185,38 +189,76 @@ # build array of urls for personal toolbar function buildPersonalUrls() { /* set up the default links for the personal toolbar */ + global $wgShowIPinHeader; $personal_urls = array(); if ($this->loggedin) { - $personal_urls['userpage'] = array('text' => $this->username, + $personal_urls['userpage'] = array( + 'text' => $this->username, 'href' => $this->makeUrl($this->userpage), 'ttip' => wfMsg('tooltip-userpage'), - 'akey' => wfMsg('accesskey-userpage')); - $personal_urls['mytalk'] = array('text' => wfMsg('mytalk'), + 'akey' => wfMsg('accesskey-userpage') + ); + $personal_urls['mytalk'] = array( + 'text' => wfMsg('mytalk'), 'href' => $this->makeTalkUrl($this->userpage), 'ttip' => wfMsg('tooltip-mytalk'), - 'akey' => wfMsg('accesskey-mytalk')); - $personal_urls['preferences'] = array('text' => wfMsg('preferences'), + 'akey' => wfMsg('accesskey-mytalk') + ); + $personal_urls['preferences'] = array( + 'text' => wfMsg('preferences'), 'href' => $this->makeSpecialUrl('Preferences'), 'ttip' => wfMsg('tooltip-preferences'), - 'akey' => wfMsg('accesskey-preferences')); - $personal_urls['watchlist'] = array('text' => wfMsg('watchlist'), + 'akey' => wfMsg('accesskey-preferences') + ); + $personal_urls['watchlist'] = array( + 'text' => wfMsg('watchlist'), 'href' => $this->makeSpecialUrl('Watchlist'), 'ttip' => wfMsg('tooltip-watchlist'), - 'akey' => wfMsg('accesskey-watchlist')); - $personal_urls['mycontris'] = array('text' => wfMsg('mycontris'), + 'akey' => wfMsg('accesskey-watchlist') + ); + $personal_urls['mycontris'] = array( + 'text' => wfMsg('mycontris'), 'href' => $this->makeSpecialUrl('Contributions','target=' . $this->username), 'ttip' => wfMsg('tooltip-mycontris'), - 'akey' => wfMsg('accesskey-mycontris')); - $personal_urls['logout'] = array('text' => wfMsg('userlogout'), - 'href' => $this->makeSpecialUrl('Userlogout','returnpage=' . $this->thispage), + 'akey' => wfMsg('accesskey-mycontris') + ); + $personal_urls['logout'] = array( + 'text' => wfMsg('userlogout'), + 'href' => $this->makeSpecialUrl('Userlogout','returnpage=' . $this->thisurle), 'ttip' => wfMsg('tooltip-logout'), - 'akey' => wfMsg('accesskey-logout')); + 'akey' => wfMsg('accesskey-logout') + ); } else { - $personal_urls['login'] = array('text' => wfMsg('userlogin'), - 'href' => $this->makeSpecialUrl('Userlogin'), - 'ttip' => wfMsg('tooltip-login'), - 'akey' => wfMsg('accesskey-login')); + if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) { + $personal_urls['anonuserpage'] = array( + 'text' => $this->username, + 'href' => $this->makeUrl($this->userpage), + 'ttip' => wfMsg('tooltip-anonuserpage'), + 'akey' => wfMsg('accesskey-anonuserpage') + ); + $personal_urls['anontalk'] = array( + 'text' => wfMsg('anontalk'), + 'href' => $this->makeTalkUrl($this->userpage), + 'ttip' => wfMsg('tooltip-anontalk'), + 'akey' => wfMsg('accesskey-anontalk') + ); + $personal_urls['anonlogin'] = array( + 'text' => wfMsg('userlogin'), + 'href' => $this->makeSpecialUrl('Userlogin', 'return='.$this->thisurle), + 'ttip' => wfMsg('tooltip-login'), + 'akey' => wfMsg('accesskey-login') + ); + } else { + + $personal_urls['login'] = array( + 'text' => wfMsg('userlogin'), + 'href' => $this->makeSpecialUrl('Userlogin', 'return='.$this->thisurle), + 'ttip' => wfMsg('tooltip-login'), + 'akey' => wfMsg('accesskey-login') + ); + } } + return $personal_urls; } @@ -428,6 +470,27 @@ return $nav_urls; } + function getPageTitleActionText () { + global $action; + switch($action) { + case edit: + return wfMsg('edit'); + case history: + return wfMsg('history_short'); + case protect: + return wfMsg('unprotect'); + case unprotect: + return wfMsg('unprotect'); + case delete: + return wfMsg('delete'); + case watch: + return wfMsg('watch'); + case unwatch: + return wfMsg('unwatch'); + default: + return ''; + } + } /*static*/ function makeSpecialUrl( $name, $urlaction='' ) { $title = Title::makeTitle( NS_SPECIAL, $name ); $this->checkTitle(&$title, &$name); diff --git a/includes/memcached-client.php b/includes/memcached-client.php index 934ca7680f..3f0eb44f9e 100644 --- a/includes/memcached-client.php +++ b/includes/memcached-client.php @@ -292,7 +292,7 @@ class memcached $key = is_array($key) ? $key[1] : $key; - $this->stats['delete']++; + @$this->stats['delete']++; $cmd = "delete $key $time\r\n"; if(!fwrite($sock, $cmd, strlen($cmd))) { diff --git a/languages/Language.php b/languages/Language.php index 1d74ec658e..7e26d5bdd5 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -491,6 +491,7 @@ $wgLanguageNamesEn =& $wgLanguageNames; "moredotdotdot" => "More...", "mypage" => "My page", "mytalk" => "My talk", +"anontalk" => "Talk for this IP", 'navigation' => 'Navigation', "currentevents" => "Current events", "disclaimers" => "Disclaimers", @@ -1482,7 +1483,9 @@ amusement.", 'accesskey-unwatch' => 'w', 'accesskey-watchlist' => 'l', 'accesskey-userpage' => '.', +'accesskey-anonuserpage' => '.', 'accesskey-mytalk' => 'n', +'accesskey-anontalk' => 'n', 'accesskey-preferences' => '', 'accesskey-mycontris' => 'y', 'accesskey-login' => 'o', @@ -1521,7 +1524,9 @@ amusement.", 'tooltip-unwatch' => 'Remove this page from your watchlist [alt-w]', 'tooltip-watchlist' => 'The list of pages you\'re monitoring for changes. [alt-l]', 'tooltip-userpage' => 'My user page [alt-.]', +'tooltip-anonuserpage' => 'The user page for the ip you\'re editing as [alt-.]', 'tooltip-mytalk' => 'My talk page [alt-n]', +'tooltip-anontalk' => 'Discussion about edits from this ip address [alt-n]', 'tooltip-preferences' => 'My preferences', 'tooltip-mycontris' => 'List of my contributions [alt-y]', 'tooltip-login' => 'You are encouraged to log in, it is not mandatory however. [alt-o]', diff --git a/stylesheets/monobook/main.css b/stylesheets/monobook/main.css index 3ce0169191..653e1b3170 100644 --- a/stylesheets/monobook/main.css +++ b/stylesheets/monobook/main.css @@ -816,6 +816,7 @@ input.searchButton { /* the icon in front of the user name, single quotes in bg url to hide it from iemac */ li#personaltools-userpage, +li#personaltools-anonuserpage, li#personaltools-login { background: transparent url('user.gif') center left no-repeat; background-repeat: no-repeat;