From 011c6c14ae31fdfdc9d5689b37bbb69fadadc6a7 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Tue, 31 Dec 2013 15:26:36 -0500 Subject: [PATCH] Fixes #1713. --- extensions/yii/authclient/views/redirect.php | 6 ++--- extensions/yii/authclient/widgets/Choice.php | 36 +++++++++++++++------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/extensions/yii/authclient/views/redirect.php b/extensions/yii/authclient/views/redirect.php index e85aa46..9261ffa 100644 --- a/extensions/yii/authclient/views/redirect.php +++ b/extensions/yii/authclient/views/redirect.php @@ -7,10 +7,10 @@ use yii\helpers\Json; /* @var $enforceRedirect boolean */ $redirectJavaScript = << - \ No newline at end of file + diff --git a/extensions/yii/authclient/widgets/Choice.php b/extensions/yii/authclient/widgets/Choice.php index d0adf28..1bcdd95 100644 --- a/extensions/yii/authclient/widgets/Choice.php +++ b/extensions/yii/authclient/widgets/Choice.php @@ -18,8 +18,9 @@ use yii\authclient\ClientInterface; * to get auth clients information. * * Example: - * ~~~ - * ['site/auth'] * ]); ?> * ~~~ @@ -28,8 +29,8 @@ use yii\authclient\ClientInterface; * along with using method {@link clientLink()} or {@link createClientUrl()}. * For example: * - * ~~~ - * ['site/auth'] * ]); ?> * - * + * * ~~~ * * @see \yii\authclient\AuthAction @@ -51,27 +52,19 @@ use yii\authclient\ClientInterface; class Choice extends Widget { /** - * @var ClientInterface[] auth providers list. - */ - private $_clients; - /** * @var string name of the auth client collection application component. * This component will be used to fetch services value if it is not set. */ public $clientCollection = 'authClientCollection'; /** - * @var array configuration for the external clients base authentication URL. - */ - private $_baseAuthUrl; - /** * @var string name of the GET param , which should be used to passed auth client id to URL - * defined by {@link baseAuthUrl}. + * defined by [[baseAuthUrl]]. */ public $clientIdGetParamName = 'authclient'; /** * @var array the HTML attributes that should be rendered in the div HTML tag representing the container element. */ - public $mainContainerHtmlOptions = [ + public $options = [ 'class' => 'auth-clients' ]; /** @@ -85,6 +78,15 @@ class Choice extends Widget public $autoRender = true; /** + * @var array configuration for the external clients base authentication URL. + */ + private $_baseAuthUrl; + /** + * @var ClientInterface[] auth providers list. + */ + private $_clients; + + /** * @param ClientInterface[] $clients auth providers */ public function setClients(array $clients) @@ -212,8 +214,8 @@ class Choice extends Widget ChoiceAsset::register($view); $view->registerJs("\$('#" . $this->getId() . "').authchoice();"); } - $this->mainContainerHtmlOptions['id'] = $this->getId(); - echo Html::beginTag('div', $this->mainContainerHtmlOptions); + $this->options['id'] = $this->getId(); + echo Html::beginTag('div', $this->options); } /**