]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Routing.class.php
Merge pull request #1019 from wallabag/revert-1018-fix-share-email-body-dev
[github/wallabag/wallabag.git] / inc / poche / Routing.class.php
index 653fa90035633ae7f03537bc344c6fa85961a02f..be06a433dce544c17a72c5d015a4b0f083348fe6 100755 (executable)
@@ -97,16 +97,17 @@ class Routing
 
     private function _launchAction()
     {
-        if (isset($_GET['login'])) {\r
-               // hello to you\r
-               $this->wallabag->login($this->referer);\r
+        if (isset($_GET['login'])) {
+               // hello to you
+               $this->wallabag->login($this->referer);
         } elseif (isset($_GET['feed']) && isset($_GET['user_id'])) {
             $tag_id = (isset($_GET['tag_id']) ? intval($_GET['tag_id']) : 0);
-            $this->wallabag->generateFeeds($_GET['token'], filter_var($_GET['user_id'],FILTER_SANITIZE_NUMBER_INT), $tag_id, $_GET['type']);
+            $limit = (isset($_GET['limit']) ? intval($_GET['limit']) : 0);
+            $this->wallabag->generateFeeds($_GET['token'], filter_var($_GET['user_id'],FILTER_SANITIZE_NUMBER_INT), $tag_id, $_GET['type'], $limit);
         }
         
         //allowed ONLY to logged in user
-        if ( \Session::isLogged() === true 
+        if (\Session::isLogged() === true
         {
             if (isset($_GET['logout'])) {
                 // see you soon !
@@ -119,13 +120,20 @@ class Routing
             } elseif (isset($_GET['deluser'])) {
                 $this->wallabag->deleteUser($_POST['password4deletinguser']);
             } elseif (isset($_GET['epub'])) {
-                $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['id'], $_GET['value']);
-                $epub->run();
+                $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['value']);
+                $epub->prepareData();
+                $epub->produceEpub();
+            } elseif (isset($_GET['mobi'])) {
+                $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']);
+                $mobi->prepareData();
+                $mobi->produceMobi();
+            } elseif (isset($_GET['pdf'])) {
+                $pdf = new WallabagPDF($this->wallabag, $_GET['method'], $_GET['value']);
+                $pdf->prepareData();
+                $pdf->producePDF();
             } elseif (isset($_GET['import'])) {
                 $import = $this->wallabag->import();
                 $tplVars = array_merge($this->vars, $import);
-            } elseif (isset($_GET['download'])) {
-                Tools::downloadDb();
             } elseif (isset($_GET['empty-cache'])) {
                 Tools::emptyCache();
             } elseif (isset($_GET['export'])) {
@@ -150,4 +158,4 @@ class Routing
     {
         echo $this->wallabag->tpl->render($file, $vars);
     }
-} 
\ No newline at end of file
+}