diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2019-08-14 10:23:53 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2019-08-14 10:23:53 +0200 |
commit | 566b995bab45355d814ac5a8bfbf18e3a59c14ba (patch) | |
tree | 304810ec1c8d6c31fe29763472db67e6ec000261 | |
parent | c097ae87df8476b573cf559c9facd2b8e6e2e865 (diff) | |
download | wcms-566b995bab45355d814ac5a8bfbf18e3a59c14ba.tar.gz wcms-566b995bab45355d814ac5a8bfbf18e3a59c14ba.zip |
Change : externaljs become customhead
-rw-r--r-- | app/class/art2.php | 14 | ||||
-rw-r--r-- | app/class/modelrender.php | 5 | ||||
-rw-r--r-- | app/view/templates/editleftbar.php | 17 | ||||
-rw-r--r-- | assets/css/edit.css | 6 | ||||
-rw-r--r-- | composer.json | 2 |
5 files changed, 19 insertions, 25 deletions
diff --git a/app/class/art2.php b/app/class/art2.php index 81b6569..56bc74e 100644 --- a/app/class/art2.php +++ b/app/class/art2.php @@ -20,7 +20,7 @@ class Art2 protected $aside; protected $footer; protected $externalcss; - protected $externalscript; + protected $customhead; protected $renderhead; protected $renderbody; protected $secure; @@ -91,7 +91,7 @@ class Art2 $this->setaside(''); $this->setfooter(''); $this->setexternalcss([]); - $this->setexternalscript([]); + $this->setcustomhead(''); $this->setrenderhead(''); $this->setrenderbody(''); $this->setsecure(Config::defaultprivacy()); @@ -294,9 +294,9 @@ class Art2 return $this->externalcss; } - public function externalscript($type = "array") + public function customhead($type = "string") { - return $this->externalscript; + return $this->customhead; } public function footer($type = "string") @@ -609,10 +609,10 @@ class Art2 } } - public function setexternalscript(array $externalscript) + public function setcustomhead(string $customhead) { - if(is_array($externalscript)) { - $this->externalscript = array_values(array_filter($externalscript)); + if(is_string($customhead)) { + $this->customhead = $customhead; } } diff --git a/app/class/modelrender.php b/app/class/modelrender.php index fb6e002..aa444f0 100644 --- a/app/class/modelrender.php +++ b/app/class/modelrender.php @@ -225,9 +225,8 @@ class Modelrender extends Modelart } } - foreach ($this->art->externalscript() as $externalscript) { - $head .= '<script src="' . $externalscript . '"></script>' . PHP_EOL; - } + $head .= PHP_EOL . $this->art->customhead() . PHP_EOL; + $head .= '<link href="' . Model::globalpath() . 'fonts.css" rel="stylesheet" />' . PHP_EOL; $head .= '<link href="' . Model::globalpath() . 'global.css" rel="stylesheet" />' . PHP_EOL; diff --git a/app/view/templates/editleftbar.php b/app/view/templates/editleftbar.php index 7b4986d..b8f4d4d 100644 --- a/app/view/templates/editleftbar.php +++ b/app/view/templates/editleftbar.php @@ -152,7 +152,7 @@ </fieldset> </details> - <details id="advanced" <?= !empty($art->externalcss()) || !empty($art->externalscript()) ? 'open' : '' ?>> + <details id="advanced" <?= !empty($art->externalcss()) || !empty($art->customhead()) ? 'open' : '' ?>> <summary>Advanced</summary> @@ -173,18 +173,9 @@ } ?> - <label for="externalscript">External script</label> - <input type="text" name="externalscript[]" id="externalscript" placeholder="add external adress"> - <?php - foreach ($art->externalscript() as $script) { - ?> - <div class="checkexternal"> - <input type="checkbox" name="externalscript[]" id="<?= $script ?>" value="<?= $script ?>" checked> - <label for="<?= $script ?>" title="<?= $script ?>"><?= $script ?></label> - </div> - <?php - } - ?> + <label for="customhead">Custom head</label> + <textarea name="customhead" wrap="off" spellcheck="false"><?= $art->customhead() ?></textarea> + </fieldset> </details> diff --git a/assets/css/edit.css b/assets/css/edit.css index 54616ff..1821878 100644 --- a/assets/css/edit.css +++ b/assets/css/edit.css @@ -199,7 +199,11 @@ html { width: 100%; } -.editor .panel input {width: 100%;} + + +.editor .panel textarea {resize: vertical;} + +.editor .panel input, .editor .panel textarea {width: 100%;} diff --git a/composer.json b/composer.json index e8ba552..69d5a98 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "w-cms", "description": "point'n think", - "version": "1.4.1", + "version": "1.4.2", "require": { "michelf/php-markdown": "^1.8", "league/plates": "3.*", |