]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/YammerImport/actions/yammeradminpanel.php
Fix mising require_once (now required here because of rearranging)
[quix0rs-gnu-social.git] / plugins / YammerImport / actions / yammeradminpanel.php
index 13960d905109a103cab1f5c7060cf004c95a5b91..4714154290781bb6df6c64aa5f7f8b7e7197b879 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');
             }
@@ -163,12 +176,12 @@ class YammeradminpanelAction extends AdminPanelAction
     function showStylesheets()
     {
         parent::showStylesheets();
-        $this->cssLink('plugins/YammerImport/css/admin.css', null, 'screen, projection, tv');
+        $this->cssLink(Plugin::staticPath('YammerImport', 'css/admin.css'), null, 'screen, projection, tv');
     }
 
     function showScripts()
     {
         parent::showScripts();
-        $this->script('plugins/YammerImport/js/yammer-admin.js');
+        $this->script(Plugin::staticPath('YammerImport', 'js/yammer-admin.js'));
     }
 }