* some comments (using # instead of /* */ )
[lhc/web/wiklou.git] / includes / SkinPHPTal.php
index 5479d20..4fe28c4 100644 (file)
@@ -26,6 +26,9 @@
 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # http://www.gnu.org/copyleft/gpl.html
 
+
+# This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+if( defined( "MEDIAWIKI" ) ) {
        require_once "GlobalFunctions.php";
        global $IP;
        require_once $IP."/PHPTAL-NP-0.7.0/libs/PHPTAL.php";
                        $tpl->set( "reporttime", $out->reportTime() );
                        $tpl->set( "sitenotice", $wgSiteNotice );
 
+                       $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
+                       $out->mBodytext .= $printfooter ;
                        $tpl->setRef( "bodytext", $out->mBodytext );
 
                        $language_urls = array();
 
                # an array of edit links by default used for the tabs
                function buildContentActionUrls () {
-                       global $wgTitle, $wgUser, $wgRequest;
+                       global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
                        $action = $wgRequest->getText( 'action' );
                        $section = $wgRequest->getText( 'section' );
                        $oldid = $wgRequest->getVal( 'oldid' );
                        if( $this->iscontent ) {
 
                                $nskey = $this->getNameSpaceKey();
-                               $content_actions[$nskey] = array('class' => (!Namespace::isTalk( $wgTitle->getNamespace())) ? 'selected' : false,
+                               $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
+                               if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
+                               $content_actions[$nskey] = array('class' => ($is_active) ? 'selected' : false,
                                'text' => wfMsg($nskey),
                                'href' => $this->makeArticleUrl($this->thispage));
 
                                                'text' => wfMsg('watch'),
                                                'href' => $this->makeUrl($this->thispage, 'action=watch'));
                                        } else {
-                                               $content_actions['watch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ? 'selected' : false,
+                                               $content_actions['unwatch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ? 'selected' : false,
                                                'text' => wfMsg('unwatch'),
                                                'href' => $this->makeUrl($this->thispage, 'action=unwatch'));
                                        }
                                }
+
+                               # Show validate tab
+                               if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
+                                       global $wgArticle ;
+                                       $article_time = "&timestamp=" . $wgArticle->mTimestamp ;
+                                       $content_actions['validate'] = array('class' => ($action == 'validate') ? 'selected' : false ,
+                                               'text' => wfMsg('val_tab'),
+                                               'href' => $this->makeUrl($this->thispage, "action=validate{$article_time}"));
+                                       }
+
                        } else {
                                /* show special page tab */
 
                        $s .= wfMsg(ucfirst($this->skinname).'.js');
                        return $s;
                }
-
        }
 
        class SkinDaVinci extends SkinPHPTal {
                }
        }
 
+       class SkinChick extends SkinPHPTal {
+               function initPage( &$out ) {
+                       SkinPHPTal::initPage( $out );
+                       $this->skinname = "chick";
+                       $this->template = "xhtml_minimal";
+               }
+               function suppressUrlExpansion() { return true; }
+               function printSource() { return ""; }
+       }
+}
 ?>