mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-31 07:18:21 -04:00
Clean up and fix.
This commit is contained in:
parent
509074c263
commit
d6040b028e
3 changed files with 4 additions and 7 deletions
|
@ -2,14 +2,13 @@
|
|||
|
||||
class Api {
|
||||
|
||||
private $actions, $app, $options;
|
||||
private $actions, $app;
|
||||
|
||||
|
||||
public function __construct($app) {
|
||||
|
||||
$this->actions = array("login", "logout", "get", "getThumbHref", "download");
|
||||
$this->app = $app;
|
||||
$this->options = $app->get_options();
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,7 +98,7 @@ class Api {
|
|||
|
||||
private function on_getThumbHref() {
|
||||
|
||||
Util::json_fail(Util::RC_DISABLED, "thumbnails disabled", !$this->get_option("thumbnails.enabled", false));
|
||||
Util::json_fail(Util::RC_DISABLED, "thumbnails disabled", !$this->app->get_option("thumbnails.enabled", false));
|
||||
Util::json_fail(Util::RC_UNSUPPORTED, "thumbnails not supported", !HAS_PHP_JPG);
|
||||
|
||||
$type = Util::get_request_param("type");
|
||||
|
@ -117,7 +116,7 @@ class Api {
|
|||
|
||||
private function on_download() {
|
||||
|
||||
Util::json_fail(Util::RC_DISABLED, "downloads disabled", !$this->get_option("download.enabled", false));
|
||||
Util::json_fail(Util::RC_DISABLED, "downloads disabled", !$this->app->get_option("download.enabled", false));
|
||||
|
||||
$as = Util::get_request_param("as");
|
||||
$type = Util::get_request_param("type");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue