-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextension.php
36 lines (28 loc) · 960 Bytes
/
extension.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
class PocketButtonExtension extends Minz_Extension {
public function init() {
$this->registerTranslates();
Minz_View::appendScript($this->getFileUrl('script.js', 'js'), false, false, false);
Minz_View::appendStyle($this->getFileUrl('style.css', 'css'));
Minz_View::appendScript(_url('pocketButton', 'jsVars'), false, true, false);
$this->registerController('pocketButton');
$this->registerViews();
}
public function handleConfigureAction() {
$this->registerTranslates();
if (Minz_Request::isPost()) {
$keyboard_shortcut = Minz_Request::param('keyboard_shortcut', '');
FreshRSS_Context::$user_conf->pocket_keyboard_shortcut = $keyboard_shortcut;
FreshRSS_Context::$user_conf->save();
}
}
public function isConfigured() {
if (FreshRSS_Context::$user_conf->pocket_access_token == '') {
return false;
}
if (FreshRSS_Context::$user_conf->pocket_consumer_key == '') {
return false;
}
return true;
}
}