diff options
author | Brion Vibber <brion@pobox.com> | 2010-09-27 13:34:35 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-09-28 07:44:25 -0700 |
commit | 7d51cda25d7a056ffdf8e7928b4dfa958597067f (patch) | |
tree | e40b7b2514ceaf74f078ea16288cb1f7e2ce6565 /plugins/YammerImport/lib | |
parent | c2de0a74072433ad0cc356694a03971e890ebb76 (diff) |
Yammer import (work run via background queues) now can be started from the admin panel! :DDDD Still requires that the app be registered on your network manually first.
Diffstat (limited to 'plugins/YammerImport/lib')
-rw-r--r-- | plugins/YammerImport/lib/yammerauthverifyform.php | 19 | ||||
-rw-r--r-- | plugins/YammerImport/lib/yammerqueuehandler.php | 3 | ||||
-rw-r--r-- | plugins/YammerImport/lib/yammerrunner.php | 9 |
3 files changed, 24 insertions, 7 deletions
diff --git a/plugins/YammerImport/lib/yammerauthverifyform.php b/plugins/YammerImport/lib/yammerauthverifyform.php index 96decea10..2b3efbcb1 100644 --- a/plugins/YammerImport/lib/yammerauthverifyform.php +++ b/plugins/YammerImport/lib/yammerauthverifyform.php @@ -64,7 +64,20 @@ class YammerAuthVerifyForm extends Form function formData() { - $this->out->input('verify_token', _m('Verification code:'), '', _m("Click through and paste the code it gives you below...")); + $this->out->elementStart('p'); + $this->out->text(_m('Follow this link to confirm authorization at Yammer; you will be prompted to log in if necessary:')); + $this->out->elementEnd('p'); + + $this->out->elementStart('blockquote'); + $this->out->element('a', + array('href' => $this->runner->getAuthUrl(), + 'target' => '_blank'), + _m('Open Yammer authentication window')); + $this->out->elementEnd('blockquote'); + + $this->out->element('p', array(), _m('Copy the verification code you are given into the form below:')); + + $this->out->input('verify_token', _m('Verification code:')); // iframe would be nice to avoid leaving -- since they don't seem to have callback url O_O /* @@ -72,10 +85,6 @@ class YammerAuthVerifyForm extends Form 'src' => $this->runner->getAuthUrl())); */ // yeah, it ignores the callback_url - $this->out->element('a', - array('href' => $this->runner->getAuthUrl(), - 'target' => '_blank'), - 'clicky click'); } /** diff --git a/plugins/YammerImport/lib/yammerqueuehandler.php b/plugins/YammerImport/lib/yammerqueuehandler.php index 5fc377783..acc807311 100644 --- a/plugins/YammerImport/lib/yammerqueuehandler.php +++ b/plugins/YammerImport/lib/yammerqueuehandler.php @@ -41,8 +41,7 @@ class YammerQueueHandler extends QueueHandler if ($runner->iterate()) { if ($runner->hasWork()) { // More to do? Shove us back on the queue... - $qm = QueueManager::get(); - $qm->enqueue('YammerImport', 'yammer'); + $runner->startBackgroundImport(); } return true; } else { diff --git a/plugins/YammerImport/lib/yammerrunner.php b/plugins/YammerImport/lib/yammerrunner.php index aee6b17e1..e0aec0d16 100644 --- a/plugins/YammerImport/lib/yammerrunner.php +++ b/plugins/YammerImport/lib/yammerrunner.php @@ -386,4 +386,13 @@ class YammerRunner return $map->count(); } + /** + * Start running import work in the background queues... + */ + public function startBackgroundImport() + { + $qm = QueueManager::get(); + $qm->enqueue('YammerImport', 'yammer'); + } + } |