Revision: 43494
Author:   jojo
Date:     2008-11-14 13:30:12 +0000 (Fri, 14 Nov 2008)

Log Message:
-----------
added ability to order directly from saved-collection page

Modified Paths:
--------------
    trunk/extensions/Collection/Collection.body.php

Modified: trunk/extensions/Collection/Collection.body.php
===================================================================
--- trunk/extensions/Collection/Collection.body.php     2008-11-14 13:03:03 UTC 
(rev 43493)
+++ trunk/extensions/Collection/Collection.body.php     2008-11-14 13:30:12 UTC 
(rev 43494)
@@ -133,6 +133,11 @@
                        }
                        $this->renderLoadOverwritePage( $title );
                        return;
+               } else if ( $par == 'order_collection/' ) {
+                       $title = Title::newFromText( $wgRequest->getVal( 
'colltitle', '' ) );
+                       $collection = $this->loadCollection( $title );
+                       $partner = $wgRequest->getVal( 'partner', 'pediapress' 
);
+                       return $this->postZIP( $collection, $partner );
                } else if ( $par == 'save_collection/' ) {
                        $collTitle = $wgRequest->getVal( 'colltitle' );
                        if ( $wgRequest->getVal( 'overwrite' ) && !empty( 
$collTitle ) ) {;
@@ -192,8 +197,8 @@
                                $this->renderCollection( $collection, $title, 
$wgRequest->getVal( 'writer', 'rl' ) );
                        }
                } else if ( $par == 'post_zip/' ) {
-                       $partner = $wgRequest->getVal( 'partner', '' );
-                       return $this->postZIP( $partner );
+                       $partner = $wgRequest->getVal( 'partner', 'pediapress' 
);
+                       return $this->postZIP( $_SESSION['wsCollection'], 
$partner );
                } else if ( $par == '' ){
                        $this->renderSpecialPage();                     
                } else {
@@ -850,7 +855,7 @@
                $this->renderCollection( array( 'items' => array( $article ) ), 
$title, $writer );
        }
 
-       function postZIP( $partner ) {
+       function postZIP( $collection, $partner ) {
                global $wgServer;
                global $wgScriptPath;
                global $wgScriptExtension;
@@ -866,7 +871,7 @@
                }
 
                $response = self::mwServeCommand( 'zip_post', array(
-                       'metabook' => $this->buildJSONCollection( 
$_SESSION['wsCollection'] ),
+                       'metabook' => $this->buildJSONCollection( $collection ),
                        'base_url' => $wgServer . $wgScriptPath,
                        'script_extension' => $wgScriptExtension,
                        'template_blacklist' => $wgPDFTemplateBlacklist,



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to