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)
//**********************
'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_music' => array( 'mp3', 'mpga', 'm4a', 'ac3', 'aiff', 'mid', 'ogg', 'wav' ), //Audio
'ext_misc' => array( 'zip', 'rar', 'gz', 'tar', 'iso', 'dmg' ), //Archives

View File

@ -10,12 +10,9 @@
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.com/
*
* @author Module Frédéric Tempez <ftempez@gmail.com>
*
*/
class redirection extends common {
class inclusion extends common {
public static $actions = [
'config' => self::GROUP_MODERATOR,
@ -28,14 +25,14 @@ class redirection extends common {
public function config() {
// Soumission du formulaire
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
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(),
'notification' => 'Modifications enregistrées',
'state' => true
]);
}s
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration du module',
@ -60,13 +57,13 @@ class redirection extends common {
'view' => 'index'
]);
}
// Sinon redirection
// Sinon inclusion
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([
'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
]);
}

View File

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

View File

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