don't tab to toolbar
[lhc/web/wiklou.git] / index.php
index 4496160..9793044 100644 (file)
--- a/index.php
+++ b/index.php
@@ -26,7 +26,7 @@ OutputPage::setEncodings(); # Not really used yet
 # Query string fields
 $action = $wgRequest->getVal( "action", "view" );
 
-if( isset( $_SERVER['PATH_INFO'] ) ) {
+if( isset( $_SERVER['PATH_INFO'] ) && $wgUsePathInfo ) {
        $title = substr( $_SERVER['PATH_INFO'], 1 );
 } else {
        $title = $wgRequest->getVal( "title" );
@@ -93,6 +93,9 @@ if ( $search = $wgRequest->getText( 'search' ) ) {
        wfQuery("BEGIN", DB_WRITE);
        switch( $action ) {
                case "view":
+                       $wgOut->setSquidMaxage( $wgSquidMaxage );
+                       $wgArticle->$action();
+                       break;
                case "watch":
                case "unwatch":
                case "delete":
@@ -105,6 +108,22 @@ if ( $search = $wgRequest->getText( 'search' ) ) {
                case "print":
                        $wgArticle->view();
                        break;
+               case "dublincore":
+                       if( !$wgEnableDublinCoreRdf ) {
+                               wfHttpError( 403, "Forbidden", wfMsg( "nodublincore" ) );
+                       } else {
+                               include_once( "Metadata.php" );
+                               wfDublinCoreRdf( $wgArticle );
+                       }
+                       break;
+               case "creativecommons":
+                       if( !$wgEnableCreativeCommonsRdf ) {
+                               wfHttpError( 403, "Forbidden", wfMsg("nocreativecommons") );
+                       } else {
+                               include_once( "Metadata.php" );
+                               wfCreativeCommonsRdf( $wgArticle );
+                       }
+                       break;
                case "edit":
                case "submit":
                        if( !$wgCommandLineMode && !$wgRequest->checkSessionCookie() ) {
@@ -115,10 +134,18 @@ if ( $search = $wgRequest->getText( 'search' ) ) {
                        $editor->$action();
                        break;
                case "history":
+                       if ($_SERVER["REQUEST_URI"] == $wgTitle->getInternalURL('action=history')) {
+                               $wgOut->setSquidMaxage( $wgSquidMaxage );
+                       }
                        include_once( "PageHistory.php" );
                        $history = new PageHistory( $wgArticle );
                        $history->history();
                        break;
+               case "purge":
+                       wfPurgeSquidServers(array($wgTitle->getInternalURL()));
+                       $wgOut->setSquidMaxage( $wgSquidMaxage );
+                       $wgArticle->view();
+                       break;
                default:
                        $wgOut->errorpage( "nosuchaction", "nosuchactiontext" );
        }
@@ -126,6 +153,7 @@ if ( $search = $wgRequest->getText( 'search' ) ) {
 }
 
 $wgOut->output();
+
 foreach ( $wgDeferredUpdateList as $up ) { $up->doUpdate(); }
 logProfilingData();
 wfDebug( "Request ended normally\n" );