1 | <?php |
||
22 | class ConnectWidget extends AuthChoice |
||
23 | { |
||
24 | /** |
||
25 | * @var array|null An array of user's accounts |
||
26 | */ |
||
27 | public $accounts; |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | 4 | public function init() |
|
33 | { |
||
34 | 4 | AuthChoiceAsset::register(Yii::$app->view); |
|
35 | 4 | if ($this->popupMode) { |
|
36 | 4 | Yii::$app->view->registerJs("\$('#" . $this->getId() . "').authchoice();"); |
|
37 | } |
||
38 | 4 | $this->options['id'] = $this->getId(); |
|
39 | 4 | echo Html::beginTag('div', $this->options); |
|
40 | 4 | } |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | * |
||
45 | * @throws InvalidParamException |
||
46 | */ |
||
47 | public function createClientUrl($provider) |
||
55 | |||
56 | /** |
||
57 | * Checks if provider already connected to user. |
||
58 | * |
||
59 | * @param ClientInterface $provider |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | public function isConnected(ClientInterface $provider) |
||
67 | } |
||
68 |