1 | <?php |
||
36 | class LoginDialog extends Application\UI\Control |
||
37 | { |
||
38 | /** |
||
39 | * @var array of function(LoginDialog $dialog) |
||
40 | */ |
||
41 | public $onResponse = []; |
||
42 | |||
43 | /** |
||
44 | * @var Flickr\Client |
||
45 | */ |
||
46 | protected $client; |
||
47 | |||
48 | /** |
||
49 | * @var Flickr\Configuration |
||
50 | */ |
||
51 | protected $config; |
||
52 | |||
53 | /** |
||
54 | * @var Flickr\SessionStorage |
||
55 | */ |
||
56 | protected $session; |
||
57 | |||
58 | /** |
||
59 | * @param Flickr\Client $flickr |
||
60 | */ |
||
61 | public function __construct(Flickr\Client $flickr) |
||
71 | |||
72 | /** |
||
73 | * @return Flickr\Client |
||
74 | */ |
||
75 | public function getClient() |
||
79 | |||
80 | /** |
||
81 | * @param Nette\ComponentModel\Container $obj |
||
82 | */ |
||
83 | protected function attached($obj) |
||
91 | |||
92 | public function handleCallback() |
||
96 | |||
97 | /** |
||
98 | * Checks, if there is a user in storage and if not, it redirects to login dialog. |
||
99 | * If the user is already in session storage, it will behave, as if were redirected from flickr right now, |
||
100 | * this means, it will directly call onResponse event. |
||
101 | * |
||
102 | * @throws Nette\Application\AbortException |
||
103 | */ |
||
104 | public function handleOpen() |
||
113 | |||
114 | /** |
||
115 | * @throws Nette\Application\AbortException |
||
116 | * @throws OAuth\Exceptions\RequestFailedException |
||
117 | */ |
||
118 | public function open() |
||
127 | |||
128 | /** |
||
129 | * @return array |
||
130 | */ |
||
131 | public function getQueryParams() |
||
140 | |||
141 | /** |
||
142 | * @return string |
||
143 | */ |
||
144 | public function getUrl() |
||
148 | |||
149 | public function handleResponse() |
||
155 | } |