]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/YammerImport/lib/yammerauthverifyform.php
More info for a proper, fancy-url lighttpd setup
[quix0rs-gnu-social.git] / plugins / YammerImport / lib / yammerauthverifyform.php
index 488b5b8d1f143a8ff732ea476ae78f3b2b35d44c..bb82eba6ae52f361bbe8237b9c4579a64a495672 100644 (file)
@@ -2,12 +2,12 @@
 
 class YammerAuthVerifyForm extends Form
 {
-    private $verify_url;
+    private $runner;
 
-    function __construct($out, $auth_url)
+    function __construct($out, YammerRunner $runner)
     {
         parent::__construct($out);
-        $this->verify_url = $auth_url;
+        $this->runner = $runner;
     }
 
     /**
@@ -30,7 +30,7 @@ class YammerAuthVerifyForm extends Form
 
     function formClass()
     {
-        return 'form_yammer_auth_verify';
+        return 'form_yammer_auth_verify form_settings';
     }
 
 
@@ -53,6 +53,7 @@ class YammerAuthVerifyForm extends Form
      */
     function formLegend()
     {
+        // TRANS: Form legend.
         $this->out->element('legend', null, _m('Connect to Yammer'));
     }
 
@@ -64,6 +65,46 @@ class YammerAuthVerifyForm extends Form
 
     function formData()
     {
+        $this->out->hidden('subaction', 'authverify');
+
+        $this->out->elementStart('fieldset');
+
+        $this->out->elementStart('p');
+        // TRANS: Form instructions.
+        $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');
+
+        // iframe would be nice to avoid leaving -- since they don't seem to have callback url O_O
+        /*
+        $this->out->element('iframe', array('id' => 'yammer-oauth',
+                                            'src' => $this->runner->getAuthUrl()));
+        */
+        // yeah, it ignores the callback_url
+        // soo... crappy link. :(
+
+        $this->out->elementStart('p', array('class' => 'magiclink'));
+        $this->out->element('a',
+            array('href' => $this->runner->getAuthUrl(),
+                  'target' => '_blank'),
+            // TRANS: Link description for a link in an external Yammer system.
+            _m('Open Yammer authentication window'));
+        $this->out->elementEnd('p');
+
+        // TRANS: Form instructions.
+        $this->out->element('p', array(), _m('Copy the verification code you are given below:'));
+
+        $this->out->elementStart('ul', array('class' => 'form_data'));
+        $this->out->elementStart('li');
+        // TRANS: Field label.
+        $this->out->input('verify_token', _m('Verification code:'));
+        $this->out->elementEnd('li');
+        $this->out->elementEnd('ul');
+
+        // TRANS: Button text for saving  Yammer authorisation data and starting Yammer import.
+        $this->out->submit('submit', _m('BUTTON','Continue'),
+                           // TRANS: Button title for saving  Yammer authorisation data and starting Yammer import.
+                           'submit', null, _m('Save the verification code and begin import.'));
+        $this->out->elementEnd('fieldset');
     }
 
     /**
@@ -74,9 +115,5 @@ class YammerAuthVerifyForm extends Form
 
     function formActions()
     {
-        $this->out->input('verify-code', _m('Verification code:'), '', _m("Click through and paste the code it gives you below..."));
-        $this->out->submit('submit', _m('Verify code'), 'submit', null, _m('Verification code'));
-        $this->element('iframe', array('id' => 'yammer-oauth',
-                                       'src' => $this->auth_url));
     }
 }