diff --git a/core/module/theme/resource/custom.css b/core/module/theme/resource/custom.css index 708caca0..b810b5c6 100755 --- a/core/module/theme/resource/custom.css +++ b/core/module/theme/resource/custom.css @@ -143,4 +143,13 @@ input[type='password']:hover, .inputFile:hover, select:hover, textarea:hover { -} \ No newline at end of file +} + +/* Iframe du module Code */ +iframe#modulecode { + height: 400px !important; + border: none; + margin-top: 10px; + margin-bottom: 10px; + + } \ No newline at end of file diff --git a/module/code/code.php b/module/code/code.php new file mode 100644 index 00000000..e06ee2f8 --- /dev/null +++ b/module/code/code.php @@ -0,0 +1,76 @@ + + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @license GNU General Public License, version 3 + * @link http://zwiicms.com/ + */ + +class code extends common { + + public static $actions = [ + 'config' => self::GROUP_ADMIN, + 'index' => self::GROUP_VISITOR + ]; + + /** + * Configuration + */ + public function config() { + // Soumission du formulaire + if($this->isPost()) { + $this->setData(['module', $this->getUrl(0), 'file', $this->getInput('codeConfigFile', helper::FILTER_URL, true)]); + // Valeurs en sortie + $this->addOutput([ + 'redirect' => helper::baseUrl() . $this->getUrl(), + 'notification' => 'Modifications enregistrées', + 'state' => true + ]); + } + // Valeurs en sortie + $this->addOutput([ + 'title' => 'Configuration du module', + 'view' => 'config' + ]); + } + + /** + * Accueil + */ + public function index() { + // Message si l'utilisateur peut éditer la page + if( + $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') + AND $this->getUser('group') >= self::GROUP_ADMIN + AND $this->getUrl(1) !== 'force' + ) { + // Valeurs en sortie + $this->addOutput([ + 'display' => self::DISPLAY_LAYOUT_BLANK, + 'title' => '', + 'view' => 'index' + ]); + } + // Sinon code + else { + // Incrémente le compteur de clics + $this->setData(['module', $this->getUrl(0), 'count', helper::filter($this->getData(['module', $this->getUrl(0), 'count']) + 1, helper::FILTER_INT)]); + // Valeurs en sortie + $this->addOutput([ + 'content' => '' , + 'state' => true + ]); + } + } + +} \ No newline at end of file diff --git a/module/code/view/config/config.php b/module/code/view/config/config.php new file mode 100644 index 00000000..6b4bd98b --- /dev/null +++ b/module/code/view/config/config.php @@ -0,0 +1,37 @@ + +
+
+ 'buttonGrey', + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'ico' => 'left', + 'value' => 'Retour' + ]); ?> +
+
+ +
+
+
+
+
+

Fichier de code :

+ 'Fichier de code :', + 'placeholder' => helper::baseUrl() . 'site/file/source/', + 'value' => $this->getData(['module', $this->getUrl(0), 'file']) + ]); ?> +
+
+
+
+

Statistiques

+ true, + 'label' => 'Nombre de redirections', + 'value' => helper::filter($this->getData(['module', $this->getUrl(0), 'count']), helper::FILTER_INT) + ]); ?> +
+
+
+ \ No newline at end of file diff --git a/module/code/view/index/index.js.php b/module/code/view/index/index.js.php new file mode 100644 index 00000000..cf4bcfeb --- /dev/null +++ b/module/code/view/index/index.js.php @@ -0,0 +1,15 @@ +/** + * This file is part of Zwii. + * + * For full copyright and license information, please see the LICENSE + * file that was distributed with this source code. + * + * @author Rémi Jean + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @license GNU General Public License, version 3 + * @link http://zwiicms.com/ + * + * + **/ + +self.location='page/edit/getUrl(0); ?>'; \ No newline at end of file diff --git a/module/code/view/index/index.php b/module/code/view/index/index.php new file mode 100644 index 00000000..09938202 --- /dev/null +++ b/module/code/view/index/index.php @@ -0,0 +1,2 @@ + + \ No newline at end of file