Module Inclusion

This commit is contained in:
Fred Tempez 2018-04-08 19:37:06 +02:00
parent 9ed51ecc5c
commit 4cea29a797
6 changed files with 150 additions and 145 deletions

View File

@ -339,7 +339,7 @@ $config = array(
//Allowed extensions (lowercase insert) //Allowed extensions (lowercase insert)
//********************** //**********************
'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg','ico' ), //Images 'ext_img' => array( 'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg','ico' ), //Images
'ext_file' => array( 'doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai', 'kmz','dwg', 'dxf', 'hpgl', 'plt', 'spl', 'step', 'stp', 'iges', 'igs', 'sat', 'cgm', 'ico'), //Files 'ext_file' => array( 'doc', 'docx', 'rtf', 'pdf', 'xls', 'xlsx', 'txt', 'csv', 'html', 'xhtml', 'psd', 'sql', 'log', 'fla', 'xml', 'ade', 'adp', 'mdb', 'accdb', 'ppt', 'pptx', 'odt', 'ots', 'ott', 'odb', 'odg', 'otp', 'otg', 'odf', 'ods', 'odp', 'css', 'ai', 'kmz','dwg', 'dxf', 'hpgl', 'plt', 'spl', 'step', 'stp', 'iges', 'igs', 'sat', 'cgm', 'php'), //Files
'ext_video' => array( 'mov', 'mpeg', 'm4v', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm" ), //Video 'ext_video' => array( 'mov', 'mpeg', 'm4v', 'mp4', 'avi', 'mpg', 'wma', "flv", "webm" ), //Video
'ext_music' => array( 'mp3', 'mpga', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav' ), //Audio 'ext_music' => array( 'mp3', 'mpga', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav' ), //Audio
'ext_misc' => array( 'zip', 'rar', 'gz', 'tar', 'iso', 'dmg' ), //Archives 'ext_misc' => array( 'zip', 'rar', 'gz', 'tar', 'iso', 'dmg' ), //Archives

View File

@ -10,12 +10,9 @@
* @copyright Copyright (C) 2008-2018, Rémi Jean * @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3 * @license GNU General Public License, version 3
* @link http://zwiicms.com/ * @link http://zwiicms.com/
*
* @author Module Frédéric Tempez <ftempez@gmail.com>
*
*/ */
class redirection extends common { class inclusion extends common {
public static $actions = [ public static $actions = [
'config' => self::GROUP_MODERATOR, 'config' => self::GROUP_MODERATOR,
@ -28,14 +25,14 @@ class redirection extends common {
public function config() { public function config() {
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
$this->setData(['module', $this->getUrl(0), 'url', $this->getInput('redirectionConfigUrl', helper::FILTER_URL, true)]); $this->setData(['module', $this->getUrl(0), 'url', $this->getInput('inclusionConfigUrl', helper::FILTER_URL, true)]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(), 'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => 'Modifications enregistrées', 'notification' => 'Modifications enregistrées',
'state' => true 'state' => true
]); ]);
}s }
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => 'Configuration du module', 'title' => 'Configuration du module',
@ -60,13 +57,13 @@ class redirection extends common {
'view' => 'index' 'view' => 'index'
]); ]);
} }
// Sinon redirection // Sinon inclusion
else { else {
// Incrémente le compteur de clics // 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)]); $this->setData(['module', $this->getUrl(0), 'count', helper::filter($this->getData(['module', $this->getUrl(0), 'count']) + 1, helper::FILTER_INT)]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => $this->getData(['module', $this->getUrl(0), 'url']), 'content' => '<iframe src="' . helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), 'url']) . '"></iframe>' ,
'state' => true 'state' => true
]); ]);
} }

View File

@ -1,7 +1,7 @@
<?php echo template::formOpen('redirectionConfig'); ?> <?php echo template::formOpen('inclusionConfig'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('redirectionConfigBack', [ <?php echo template::button('inclusionConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'ico' => 'left', 'ico' => 'left',
@ -9,16 +9,16 @@
]); ?> ]); ?>
</div> </div>
<div class="col2 offset8"> <div class="col2 offset8">
<?php echo template::submit('redirectionConfigSubmit'); ?> <?php echo template::submit('inclusionConfigSubmit'); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<div class="block"> <div class="block">
<h4>Redirection</h4> <h4>inclusion</h4>
<?php echo template::text('redirectionConfigUrl', [ <?php echo template::file('inclusionConfigUrl', [
'label' => 'Lien de redirection', 'label' => 'Lien d\'inclusion',
'placeholder' => 'http://', 'placeholder' => helper::baseUrl() . 'site/file/source/',
'value' => $this->getData(['module', $this->getUrl(0), 'url']) 'value' => $this->getData(['module', $this->getUrl(0), 'url'])
]); ?> ]); ?>
</div> </div>
@ -26,9 +26,9 @@
<div class="col6"> <div class="col6">
<div class="block"> <div class="block">
<h4>Statistiques</h4> <h4>Statistiques</h4>
<?php echo template::text('redirectionConfigCount', [ <?php echo template::text('inclusionConfigCount', [
'disabled' => true, 'disabled' => true,
'label' => 'Nombre de redirection', 'label' => 'Nombre de redirections',
'value' => helper::filter($this->getData(['module', $this->getUrl(0), 'count']), helper::FILTER_INT) 'value' => helper::filter($this->getData(['module', $this->getUrl(0), 'count']), helper::FILTER_INT)
]); ?> ]); ?>
</div> </div>

View File

@ -3,6 +3,7 @@
* ou supprimer des propriétés CSS en fonction de vos besoins. * ou supprimer des propriétés CSS en fonction de vos besoins.
*/ */
/** /**
* Éléments principaux * Éléments principaux
*/ */
@ -124,3 +125,10 @@ input[type='password']:hover,
select:hover, select:hover,
textarea:hover { textarea:hover {
} }
/* iframe du module Inclusion*/
iframe {
width:100%;
height:1000px;
border:none;
}