diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2019-04-14 16:01:27 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2019-04-14 16:01:27 +0200 |
commit | 05ea1fe723534ee29ef757dead0c94d0f6321a0b (patch) | |
tree | 586fafeb9cff2aec8d15424266cf2cbdf14072e4 | |
parent | 11f0907e2effff7af66040f037a95ab394dbd42c (diff) | |
download | wcms-05ea1fe723534ee29ef757dead0c94d0f6321a0b.tar.gz wcms-05ea1fe723534ee29ef757dead0c94d0f6321a0b.zip |
admin global dir bug fix
-rw-r--r-- | app/class/controlleradmin.php | 16 | ||||
-rw-r--r-- | app/view/templates/admin.php | 3 | ||||
-rw-r--r-- | composer.json | 2 |
3 files changed, 14 insertions, 7 deletions
diff --git a/app/class/controlleradmin.php b/app/class/controlleradmin.php index cf2dbc8..03fcb22 100644 --- a/app/class/controlleradmin.php +++ b/app/class/controlleradmin.php @@ -35,10 +35,9 @@ class Controlleradmin extends Controller } public function update() - { - if(!isset($_POST['showeditmenu'])) { - $_POST['showeditmenu'] = false; - } + { + $this->globaldircheck(); + $globalcss = file_put_contents(Model::GLOBAL_DIR . 'global.css', $_POST['globalcss']); Config::hydrate($_POST); @@ -50,7 +49,14 @@ class Controlleradmin extends Controller } - + public function globaldircheck() + { + if(!is_dir(Model::GLOBAL_DIR)) { + return mkdir(Model::GLOBAL_DIR); + } else { + return true; + } + } } diff --git a/app/view/templates/admin.php b/app/view/templates/admin.php index 08126a7..3eba1c4 100644 --- a/app/view/templates/admin.php +++ b/app/view/templates/admin.php @@ -134,7 +134,8 @@ <h4>Edit quick menu</h4> <div class="checkbox"> - <input type="checkbox" name="showeditmenu" id="showeditmenu" <?= Config::showeditmenu() === true ? 'checked' : '' ?>> + <input type="hidden" name="showeditmenu" value="false"> + <input type="checkbox" name="showeditmenu" id="showeditmenu" value="true" <?= Config::showeditmenu() === true ? 'checked' : '' ?>> <label for="showeditmenu">Show editor menu in top right corner of pages</label> </div> diff --git a/composer.json b/composer.json index c279a67..93abe2c 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "w-cms", "description": "point'n think", - "version": "1.2.2", + "version": "1.2.3", "require": { "michelf/php-markdown": "^1.8", "league/plates": "3.*", |