diff --git a/_config.php b/_config.php index cffe37f..978af2c 100644 --- a/_config.php +++ b/_config.php @@ -15,18 +15,18 @@ if (!defined('DC_CONTEXT_MODULE')) { } $redir = empty($_REQUEST['redir']) ? - dcCore::app()->admin->list->getURL() . '#plugins' : $_REQUEST['redir']; + dcCore::app()->admin->__get('list')->getURL() . '#plugins' : $_REQUEST['redir']; # -- Get settings -- $s = dcCore::app()->blog->settings->addNamespace(basename(__DIR__)); -$lb_overwrite = (bool) $s->overwrite; -$lb_write_full = (bool) $s->write_full; -$lb_write_php = (bool) $s->write_php; -$lb_write_js = (bool) $s->write_js; -$lb_exclude_locales = (bool) $s->exclude_locales; -$lb_license_name = licenseBootstrap::getName($s->license_name); -$lb_license_head = licenseBootstrap::gethead($s->license_name, licenseBootstrap::decode($s->license_head)); +$lb_overwrite = (bool) $s->get('overwrite'); +$lb_write_full = (bool) $s->get('write_full'); +$lb_write_php = (bool) $s->get('write_php'); +$lb_write_js = (bool) $s->get('write_js'); +$lb_exclude_locales = (bool) $s->get('exclude_locales'); +$lb_license_name = licenseBootstrap::getName($s->get('license_name')); +$lb_license_head = licenseBootstrap::gethead($s->get('license_name'), licenseBootstrap::decode($s->get('license_head'))); # -- Set settings -- if (!empty($_POST['save'])) { @@ -51,8 +51,8 @@ if (!empty($_POST['save'])) { __('Configuration has been successfully updated.') ); http::redirect( - dcCore::app()->admin->list->getURL('module=' . basename(__DIR__) . '&conf=1&redir=' . - dcCore::app()->admin->list->getRedir()) + dcCore::app()->admin->__get('list')->getURL('module=' . basename(__DIR__) . '&conf=1&redir=' . + dcCore::app()->admin->__get('list')->getRedir()) ); } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); diff --git a/_install.php b/_install.php index 970bb1b..a9c32b8 100644 --- a/_install.php +++ b/_install.php @@ -74,7 +74,7 @@ $mod_conf = [ try { # Check module version if (!dcCore::app()->newVersion( - basename(__DIR__), + basename(__DIR__), dcCore::app()->plugins->moduleInfo(basename(__DIR__), 'version') )) { return null; diff --git a/inc/class.license.bootstrap.php b/inc/class.license.bootstrap.php index 47cd83d..2879680 100644 --- a/inc/class.license.bootstrap.php +++ b/inc/class.license.bootstrap.php @@ -36,22 +36,22 @@ class licenseBootstrap $module ); - if ($s->write_full) { + if ($s->get('write_full')) { licenseBootstrap::writeFullContent( - $s->license_name, + $s->get('license_name'), $module, - $s->overwrite + $s->get('overwrite') ); } licenseBootstrap::writeHeadContent( - $s->license_name, - licenseBootstrap::decode($s->license_head), + $s->get('license_name'), + licenseBootstrap::decode($s->get('license_head')), $module, dcCore::app()->auth, - $s->overwrite, - $s->write_php, - $s->write_js, - $s->exclude_locales + $s->get('overwrite'), + $s->get('write_php'), + $s->get('write_js'), + $s->get('exclude_locales') ); # --BEHAVIOR-- licenseBootstrapAfterAddLicense @@ -288,10 +288,10 @@ class licenseBootstrap /** * Replace info in license * - * @param string $content License content - * @param array $module Module info - * @param array $user User info - * @return string License content + * @param string $content License content + * @param array $module Module info + * @param object $user User info + * @return string License content */ protected static function replaceInfo($content, $module, $user) { diff --git a/index.php b/index.php index c9349ab..f650450 100644 --- a/index.php +++ b/index.php @@ -24,7 +24,7 @@ $type = isset($_POST['type']) && in_array($_POST['type'], ['plugins', 'themes' $s = dcCore::app()->blog->settings->addNamespace(basename(__DIR__)); # Modules -if (!isset(dcCore::app()->themes)) { +if (!(dcCore::app()->themes instanceof dcThemes)) { dcCore::app()->themes = new dcThemes(); dcCore::app()->themes->loadModules(dcCore::app()->blog->themes_path, null); }