]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/YammerImport/actions/yammeradminpanel.php
Made YammerImport more robust against errors; can now pause/resume/reset the import...
[quix0rs-gnu-social.git] / plugins / YammerImport / actions / yammeradminpanel.php
index 13960d905109a103cab1f5c7060cf004c95a5b91..3faf390ac135c10894cd25bfeb8e5192e1a86456 100644 (file)
@@ -73,6 +73,7 @@ class YammeradminpanelAction extends AdminPanelAction
     {
         // @fixme move this to saveSettings and friends?
         if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+            StatusNet::setApi(true); // short error pages :P
             $this->checkSessionToken();
             if ($this->subaction == 'change-apikey') {
                 $form = new YammerApiKeyForm($this);
@@ -97,6 +98,18 @@ class YammeradminpanelAction extends AdminPanelAction
                 $this->runner->startBackgroundImport();
 
                 $form = new YammerProgressForm($this, $this->runner);
+            } else if ($this->subaction == 'pause-import') {
+                $this->runner->recordError(_m('Paused from admin panel.'));
+                $form = $this->statusForm();
+            } else if ($this->subaction == 'continue-import') {
+                $this->runner->clearError();
+                $this->runner->startBackgroundImport();
+                $form = $this->statusForm();
+            } else if ($this->subaction == 'abort-import') {
+                $this->runner->reset();
+                $form = $this->statusForm();
+            } else if ($this->subaction == 'progress') {
+                $form = $this->statusForm();
             } else {
                 throw new ClientException('Invalid POST');
             }