minor refactoring
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index dfb75e8..bbbcff0 100644 (file)
@@ -370,11 +370,10 @@ class SkinTemplate extends Skin {
 
                        $this->credits = false;
 
-                       if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
-                               require_once("Credits.php");
-                               $this->credits = getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
+                       if( $wgMaxCredits != 0 ){
+                               $this->credits = Credits::getCredits( $wgArticle, $wgMaxCredits, $wgShowCreditsIfMax );
                        } else {
-                               $tpl->set('lastmod', $this->lastModified());
+                               $tpl->set( 'lastmod', $this->lastModified() );
                        }
 
                        $tpl->setRef( 'credits', $this->credits );
@@ -693,7 +692,7 @@ class SkinTemplate extends Skin {
                                if ( $istalk || $wgOut->showNewSectionLink() ) {
                                        $content_actions['addsection'] = array(
                                                'class' => $section == 'new'?'selected':false,
-                                               'text' => $istalk ? wfMsg( 'postcomment' ) : wfMsg('addsection'),
+                                               'text' => wfMsg('addsection'),
                                                'href' => $this->mTitle->getLocalUrl( 'action=edit&section=new' )
                                        );
                                }
@@ -707,7 +706,7 @@ class SkinTemplate extends Skin {
                        wfProfileOut( __METHOD__."-edit" );
 
                        wfProfileIn( __METHOD__."-live" );
-                       if ( $this->mTitle->getArticleId() ) {
+                       if ( $this->mTitle->exists() ) {
 
                                $content_actions['history'] = array(
                                        'class' => ($action == 'history') ? 'selected' : false,
@@ -732,7 +731,7 @@ class SkinTemplate extends Skin {
                                }
 
                                if ( $this->mTitle->getNamespace() !== NS_MEDIAWIKI && $wgUser->isAllowed( 'protect' ) ) {
-                                       if(!$this->mTitle->isProtected()){
+                                       if( !$this->mTitle->isProtected() ){
                                                $content_actions['protect'] = array(
                                                        'class' => ($action == 'protect') ? 'selected' : false,
                                                        'text' => wfMsg('protect'),