X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSkinTemplate.php;h=0178b86656f4c527343f581e65c94e6c91144e76;hb=f5c5abd1eade5be126b5aa97f4a66dae21c791c8;hp=2e6c8938d6b07ffdfae31ee712a5fa3ea135dad7;hpb=444d7c8244c0f87730077f83e71098655079248d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 2e6c8938d6..0178b86656 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -219,22 +219,10 @@ class SkinTemplate extends Skin { $tpl->set( 'catlinks', $this->getCategories()); if( $wgOut->isSyndicated() ) { $feeds = array(); - foreach( $wgFeedClasses as $format => $class ) { - $linktext = $format; - if ( $format == "atom" ) { - $linktext = wfMsg( 'feed-atom' ); - } else if ( $format == "rss" ) { - $linktext = wfMsg( 'feed-rss' ); - } - if( is_string( $wgOut->getFeedAppendQuery() ) ) { - $appendQuery = "&" . $wgOut->getFeedAppendQuery(); - } else { - $appendQuery = ""; - } + foreach( $wgOut->getSyndicationLinks() as $format => $link ) { $feeds[$format] = array( - 'text' => $linktext, - 'href' => $wgRequest->appendQuery( "feed={$format}{$appendQuery}" ) - ); + 'text' => wfMsg( "feed-$format" ), + 'href' => $link ); } $tpl->setRef( 'feeds', $feeds ); } else { @@ -356,7 +344,7 @@ class SkinTemplate extends Skin { $dbr = wfGetDB( DB_SLAVE ); $watchlist = $dbr->tableName( 'watchlist' ); $sql = "SELECT COUNT(*) AS n FROM $watchlist - WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBKey()) . + WHERE wl_title='" . $dbr->strencode($this->mTitle->getDBkey()) . "' AND wl_namespace=" . $this->mTitle->getNamespace() ; $res = $dbr->query( $sql, 'SkinTemplate::outputPage'); $x = $dbr->fetchObject( $res ); @@ -718,6 +706,22 @@ class SkinTemplate extends Skin { 'href' => $this->mTitle->getLocalUrl( 'action=history') ); + if($wgUser->isAllowed('delete')){ + $content_actions['delete'] = array( + 'class' => ($action == 'delete') ? 'selected' : false, + 'text' => wfMsg('delete'), + 'href' => $this->mTitle->getLocalUrl( 'action=delete' ) + ); + } + if ( $this->mTitle->quickUserCan( 'move' ) ) { + $moveTitle = SpecialPage::getTitleFor( 'Movepage', $this->thispage ); + $content_actions['move'] = array( + 'class' => $this->mTitle->isSpecial( 'Movepage' ) ? 'selected' : false, + 'text' => wfMsg('move'), + 'href' => $moveTitle->getLocalUrl() + ); + } + if ( $this->mTitle->getNamespace() !== NS_MEDIAWIKI && $wgUser->isAllowed( 'protect' ) ) { if(!$this->mTitle->isProtected()){ $content_actions['protect'] = array( @@ -734,24 +738,9 @@ class SkinTemplate extends Skin { ); } } - if($wgUser->isAllowed('delete')){ - $content_actions['delete'] = array( - 'class' => ($action == 'delete') ? 'selected' : false, - 'text' => wfMsg('delete'), - 'href' => $this->mTitle->getLocalUrl( 'action=delete' ) - ); - } - if ( $this->mTitle->quickUserCan( 'move' ) ) { - $moveTitle = SpecialPage::getTitleFor( 'Movepage', $this->thispage ); - $content_actions['move'] = array( - 'class' => $this->mTitle->isSpecial( 'Movepage' ) ? 'selected' : false, - 'text' => wfMsg('move'), - 'href' => $moveTitle->getLocalUrl() - ); - } } else { //article doesn't exist or is deleted - if( $wgUser->isAllowed( 'delete' ) ) { + if( $wgUser->isAllowed( 'deletedhistory' ) && $wgUser->isAllowed( 'undelete' ) ) { if( $n = $this->mTitle->isDeleted() ) { $undelTitle = SpecialPage::getTitleFor( 'Undelete' ); $content_actions['undelete'] = array( @@ -762,7 +751,25 @@ class SkinTemplate extends Skin { ); } } + + if ( $this->mTitle->getNamespace() !== NS_MEDIAWIKI && $wgUser->isAllowed( 'protect' ) ) { + if( !$this->mTitle->getRestrictions( 'create' ) ) { + $content_actions['protect'] = array( + 'class' => ($action == 'protect') ? 'selected' : false, + 'text' => wfMsg('protect'), + 'href' => $this->mTitle->getLocalUrl( 'action=protect' ) + ); + + } else { + $content_actions['unprotect'] = array( + 'class' => ($action == 'unprotect') ? 'selected' : false, + 'text' => wfMsg('unprotect'), + 'href' => $this->mTitle->getLocalUrl( 'action=unprotect' ) + ); + } + } } + wfProfileOut( "$fname-live" ); if( $this->loggedin ) {