aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-08-12 17:43:19 +0200
committervincent-peugnet <v.peugnet@free.fr>2020-08-12 17:43:19 +0200
commit2722f77adf442481fb37f795e92ac8af672b2ed1 (patch)
tree20ec1fe296e66276cc852e1d88e7da3f96052a19 /app/view/templates
parentab324b42a3223b882145852c49a17bfa72099174 (diff)
downloadwcms-2722f77adf442481fb37f795e92ac8af672b2ed1.tar.gz
wcms-2722f77adf442481fb37f795e92ac8af672b2ed1.zip
disable javascript config option, close #114
Diffstat (limited to 'app/view/templates')
-rw-r--r--app/view/templates/admin.php7
-rw-r--r--app/view/templates/edit.php8
-rw-r--r--app/view/templates/home.php6
-rw-r--r--app/view/templates/media.php5
4 files changed, 25 insertions, 1 deletions
diff --git a/app/view/templates/admin.php b/app/view/templates/admin.php
index adda7f8..33f27a9 100644
--- a/app/view/templates/admin.php
+++ b/app/view/templates/admin.php
@@ -228,6 +228,13 @@
<h2 id="interface">Interface</h2>
+ <div class="checkbox">
+ <input type="hidden" name="disablejavascript" value="0" form="admin">
+ <input type="checkbox" name="disablejavascript" id="disablejavascript" value="1" <?= Wcms\Config::disablejavascript() ? 'checked' : '' ?> form="admin">
+ <label for="disablejavascript">Disable javascript</label>
+ </div>
+
+
<p>Set interface Style</p>
<select name="interfacecss" id="interfacecss" form="admin">
diff --git a/app/view/templates/edit.php b/app/view/templates/edit.php
index 22dda20..dfb4dec 100644
--- a/app/view/templates/edit.php
+++ b/app/view/templates/edit.php
@@ -1,4 +1,6 @@
-<?php $this->layout('layout', ['title' => '✏ '.$page->title(), 'stylesheets' => [$css . 'edit.css'], 'favicon' => $page->favicon()]) ?>
+<?php
+
+$this->layout('layout', ['title' => '✏ '.$page->title(), 'stylesheets' => [$css . 'edit.css'], 'favicon' => $page->favicon()]) ?>
@@ -26,10 +28,14 @@
</main>
+<?php if(!Wcms\Config::disablejavascript()) { ?>
+
<script>
const pageid = '<?= $page->id() ?>';
let pagetitle = '<?= $page->title() ?>';
</script>
<script src="<?= Wcms\Model::jspath() ?>edit.bundle.js"></script>
+<?php } ?>
+
<?php $this->stop('page') ?> \ No newline at end of file
diff --git a/app/view/templates/home.php b/app/view/templates/home.php
index 387ef0c..3d0b497 100644
--- a/app/view/templates/home.php
+++ b/app/view/templates/home.php
@@ -236,9 +236,15 @@
<?php $this->insert('footer', ['footer' => $footer]) ?>
+
+<?php if(!Wcms\Config::disablejavascript()) { ?>
+
<script src="<?= Wcms\Model::jspath() ?>home.bundle.js"></script>
<?php } ?>
+<?php } ?>
+
+
<?php $this->stop() ?> \ No newline at end of file
diff --git a/app/view/templates/media.php b/app/view/templates/media.php
index a8b7157..7f2101b 100644
--- a/app/view/templates/media.php
+++ b/app/view/templates/media.php
@@ -185,7 +185,12 @@ $this->layout('layout', ['title' => 'media', 'stylesheets' => [$css . 'home.css'
</main>
+<?php if(!Wcms\Config::disablejavascript()) { ?>
+
<script src="<?= Wcms\Model::jspath() ?>media.bundle.js"></script>
+<?php } ?>
+
+
<?php $this->stop('page') ?> \ No newline at end of file