|
@@ -9,8 +9,6 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
|
|
|
|
|
class SettingController extends Controller
|
|
class SettingController extends Controller
|
|
{
|
|
{
|
|
- public const DEFAULT_THEME_URL = 'https://bootswatch.com/4/_vendor/bootstrap/dist/css/bootstrap.min.css';
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* @param Request $request
|
|
* @param Request $request
|
|
* @param Response $response
|
|
* @param Response $response
|
|
@@ -76,7 +74,8 @@ class SettingController extends Controller
|
|
if (!is_writable(BASE_DIR.'static/bootstrap/css/bootstrap.min.css')) {
|
|
if (!is_writable(BASE_DIR.'static/bootstrap/css/bootstrap.min.css')) {
|
|
$this->session->alert(lang('cannot_write_file'), 'danger');
|
|
$this->session->alert(lang('cannot_write_file'), 'danger');
|
|
} else {
|
|
} else {
|
|
- file_put_contents(BASE_DIR.'static/bootstrap/css/bootstrap.min.css', file_get_contents(param($request, 'css')));
|
|
|
|
|
|
+ file_put_contents(BASE_DIR.'static/bootstrap/css/bootstrap.min.css',
|
|
|
|
+ file_get_contents(param($request, 'css')));
|
|
}
|
|
}
|
|
|
|
|
|
// if is default, remove setting
|
|
// if is default, remove setting
|
|
@@ -95,9 +94,11 @@ class SettingController extends Controller
|
|
private function updateSetting($key, $value = null)
|
|
private function updateSetting($key, $value = null)
|
|
{
|
|
{
|
|
if (!$this->database->query('SELECT `value` FROM `settings` WHERE `key` = '.$this->database->getPdo()->quote($key))->fetch()) {
|
|
if (!$this->database->query('SELECT `value` FROM `settings` WHERE `key` = '.$this->database->getPdo()->quote($key))->fetch()) {
|
|
- $this->database->query('INSERT INTO `settings`(`key`, `value`) VALUES ('.$this->database->getPdo()->quote($key).', ?)', $value);
|
|
|
|
|
|
+ $this->database->query('INSERT INTO `settings`(`key`, `value`) VALUES ('.$this->database->getPdo()->quote($key).', ?)',
|
|
|
|
+ $value);
|
|
} else {
|
|
} else {
|
|
- $this->database->query('UPDATE `settings` SET `value`=? WHERE `key` = '.$this->database->getPdo()->quote($key), $value);
|
|
|
|
|
|
+ $this->database->query('UPDATE `settings` SET `value`=? WHERE `key` = '.$this->database->getPdo()->quote($key),
|
|
|
|
+ $value);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|