<?php | |||||
/** | |||||
Copyright distrib (2018) | |||||
contact@opendistrib.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
namespace backend\assets; | |||||
use yii\web\AssetBundle; | |||||
use yii ; | |||||
class VuejsSettingFormAsset extends \common\components\MyAssetBundle | |||||
{ | |||||
public $basePath = '@webroot'; | |||||
public $baseUrl = '@web'; | |||||
public $css = []; | |||||
public $js = []; | |||||
public $depends = [ | |||||
'common\assets\CommonAsset' | |||||
]; | |||||
public function __construct() | |||||
{ | |||||
parent::__construct() ; | |||||
$this->addAsset('js','js/vuejs/setting-form.js') ; | |||||
} | |||||
} |
*/ | */ | ||||
use common\logic\Setting\SettingModule; | use common\logic\Setting\SettingModule; | ||||
use lo\widgets\Toggle; | |||||
use yii\bootstrap\ActiveForm; | use yii\bootstrap\ActiveForm; | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
\backend\assets\VuejsSettingFormAsset::register($this); | |||||
$settingModule = SettingModule::getInstance(); | $settingModule = SettingModule::getInstance(); | ||||
$adminSettingDefinition = $settingModule->getAdminSettingDefinition(); | $adminSettingDefinition = $settingModule->getAdminSettingDefinition(); | ||||
?> | ?> | ||||
<div class="setting-admin-index"> | |||||
<script> | |||||
var appInitValues = { | |||||
sectionsArray: <?php echo json_encode($adminSettingDefinition->getSectionsArray()); ?>, | |||||
}; | |||||
</script> | |||||
<div class="setting-admin-index setting-form" id="app-setting-admin"> | |||||
<div id="nav-params"> | |||||
<a v-for="section in sectionsArray" :class="'btn '+((currentSection == section.name) ? 'btn-primary' : 'btn-default')" | |||||
@click="changeSection(section)" :href="'#'+section.name"> | |||||
{{ section.nameDisplay }} | |||||
</a> | |||||
</div> | |||||
<?php $form = ActiveForm::begin(); ?> | <?php $form = ActiveForm::begin(); ?> | ||||
<?php foreach($adminSettingDefinition->getSettingDetails() as $sectionName => $sectionsArray): ?> | <?php foreach($adminSettingDefinition->getSettingDetails() as $sectionName => $sectionsArray): ?> | ||||
<h2><?php echo $adminSettingDefinition->getSectionLabelBySectionName($sectionName); ?></h2> | |||||
<div v-show="currentSection == '<?= $sectionName ?>'" class="panel panel-default"> | |||||
<div class="panel-body"> | |||||
<?php foreach($sectionsArray as $subSectionName => $subSectionsArray): ?> | <?php foreach($sectionsArray as $subSectionName => $subSectionsArray): ?> | ||||
<h2><?php echo $adminSettingDefinition->getSectionLabelBySectionName($subSectionName); ?></h2> | |||||
<h4><?php echo $adminSettingDefinition->getSectionLabelBySectionName($subSectionName); ?></h4> | |||||
<?php foreach($subSectionsArray as $settingDetail): ?> | <?php foreach($subSectionsArray as $settingDetail): ?> | ||||
<?php echo field($form, $model, $settingDetail); ?> | <?php echo field($form, $model, $settingDetail); ?> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
</div> | |||||
</div> | |||||
<?php endforeach; ?> | <?php endforeach; ?> | ||||
<div class="form-group"> | <div class="form-group"> | ||||
<?= Html::submitButton('Sauvegarder', ['class' => 'btn btn-primary']) ?> | <?= Html::submitButton('Sauvegarder', ['class' => 'btn btn-primary']) ?> | ||||
<?php | <?php | ||||
function field($form, $model, $settingDetail) { | function field($form, $model, $settingDetail) { | ||||
if($settingDetail->getType() == 'boolean') { | |||||
return $form->field($model, $settingDetail->getName())->checkbox(); | |||||
} else { | |||||
return $form->field($model, $settingDetail->getName())->textInput(); | |||||
$field = $form->field($model, $settingDetail->getName()); | |||||
if($settingDetail->getFormType() == 'checkbox') { | |||||
return $field->checkbox(); | |||||
} | |||||
elseif($settingDetail->getFormType() == 'toggle') { | |||||
return $form->field($model, $settingDetail->getName(), ['options' => ['class' => 'form-group form-toggle']])->widget(Toggle::class, ['options' => ['data-on' => 'Oui', 'data-off' => 'Non', 'data-offstyle' => 'default']]); | |||||
} | |||||
elseif($settingDetail->getFormType() == 'select') { | |||||
return $field->dropDownList($settingDetail->getOptions()); | |||||
} | |||||
elseif($settingDetail->getFormType() == 'textarea') { | |||||
return $field->textarea(['rows' => 4]); | |||||
} | |||||
elseif($settingDetail->getFormType() == 'input') { | |||||
return $field->textInput(); | |||||
} | |||||
else { | |||||
return '<div class="form-group"><span class="glyphicon glyphicon-alert"></span> Type de champ non défini pour le paramètre "'.$settingDetail->getName().'"</div>'; | |||||
} | } | ||||
} | } | ||||
use yii\helpers\Html; | use yii\helpers\Html; | ||||
use yii\grid\GridView; | use yii\grid\GridView; | ||||
/** | |||||
* @var $this common\components\ViewBackend | |||||
*/ | |||||
$ticketModule = TicketModule::getInstance(); | $ticketModule = TicketModule::getInstance(); | ||||
$adminSettingBag = $this->getSettingModule()->getAdminSettingBag(); | |||||
$userCurrent = $this->getUserCurrent(); | $userCurrent = $this->getUserCurrent(); | ||||
$this->setTitle('Support & contact'); | $this->setTitle('Support & contact'); | ||||
$this->addBreadcrumb($this->getTitle()); | $this->addBreadcrumb($this->getTitle()); | ||||
<span class="info-box-text">Me contacter directement</span> | <span class="info-box-text">Me contacter directement</span> | ||||
<span class="info-box-text"> | <span class="info-box-text"> | ||||
<br/> | <br/> | ||||
<strong><?= Yii::$app->parameterBag->get('adminPhoneNumber'); ?></strong> | |||||
<strong><?= $adminSettingBag->get('administratorPhoneNumber'); ?></strong> | |||||
</span> | </span> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="info-box"> | <div class="info-box"> | ||||
<span class="info-box-icon bg-yellow"><i class="fa fa-envelope"></i></span> | <span class="info-box-icon bg-yellow"><i class="fa fa-envelope"></i></span> | ||||
<div class="info-box-content"> | <div class="info-box-content"> | ||||
<span class="info-box-text"><br/><?= Html::a("M'envoyer un email", 'mailto:'.Yii::$app->parameterBag->get('adminEmail'), ['class' => 'btn btn-sm btn-default']); ?></span> | |||||
<span class="info-box-text"><br/><?= Html::a("M'envoyer un email", 'mailto:'.$adminSettingBag->get('administratorEmail'), ['class' => 'btn btn-sm btn-default']); ?></span> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> |
/* line 344, ../sass/screen.scss */ | /* line 344, ../sass/screen.scss */ | ||||
#nav-params { | #nav-params { | ||||
margin-bottom: 30px; | |||||
margin-bottom: 20px; | |||||
} | } | ||||
/* line 347, ../sass/screen.scss */ | /* line 347, ../sass/screen.scss */ | ||||
#nav-params a { | #nav-params a { | ||||
width: 100px; | width: 100px; | ||||
} | } | ||||
/* line 4, ../sass/setting/_form.scss */ | |||||
.setting-form .panel h4 { | |||||
font-size: 23px; | |||||
margin-bottom: 20px; | |||||
text-transform: uppercase; | |||||
border-bottom: solid 1px gray; | |||||
} | |||||
/* line 10, ../sass/setting/_form.scss */ | |||||
.setting-form .panel h4:not(:first-child) { | |||||
margin-top: 45px; | |||||
} | |||||
/* line 16, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.has-success, .setting-form .form-group.has-success label { | |||||
color: #333; | |||||
} | |||||
/* line 21, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group .checkbox input { | |||||
position: relative; | |||||
top: -1px; | |||||
margin-right: 3px; | |||||
} | |||||
/* line 30, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.form-toggle .control-label { | |||||
position: relative; | |||||
top: 7px; | |||||
left: 10px; | |||||
} | |||||
/* line 36, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.form-toggle .toggle { | |||||
-moz-border-radius: 20px; | |||||
-webkit-border-radius: 20px; | |||||
border-radius: 20px; | |||||
float: left; | |||||
} | |||||
/* line 41, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.form-toggle .toggle .toggle-group .btn.toggle-on { | |||||
color: white; | |||||
} | |||||
/* line 45, ../sass/setting/_form.scss */ | |||||
.setting-form .form-group.form-toggle .toggle .toggle-group .btn.toggle-off { | |||||
border-color: white; | |||||
} | |||||
/** | /** | ||||
Copyright distrib (2018) | Copyright distrib (2018) | ||||
/** | |||||
Copyright distrib (2018) | |||||
contact@opendistrib.net | |||||
Ce logiciel est un programme informatique servant à aider les producteurs | |||||
à distribuer leur production en circuits courts. | |||||
Ce logiciel est régi par la licence CeCILL soumise au droit français et | |||||
respectant les principes de diffusion des logiciels libres. Vous pouvez | |||||
utiliser, modifier et/ou redistribuer ce programme sous les conditions | |||||
de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA | |||||
sur le site "http://www.cecill.info". | |||||
En contrepartie de l'accessibilité au code source et des droits de copie, | |||||
de modification et de redistribution accordés par cette licence, il n'est | |||||
offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, | |||||
seule une responsabilité restreinte pèse sur l'auteur du programme, le | |||||
titulaire des droits patrimoniaux et les concédants successifs. | |||||
A cet égard l'attention de l'utilisateur est attirée sur les risques | |||||
associés au chargement, à l'utilisation, à la modification et/ou au | |||||
développement et à la reproduction du logiciel par l'utilisateur étant | |||||
donné sa spécificité de logiciel libre, qui peut le rendre complexe à | |||||
manipuler et qui le réserve donc à des développeurs et des professionnels | |||||
avertis possédant des connaissances informatiques approfondies. Les | |||||
utilisateurs sont donc invités à charger et tester l'adéquation du | |||||
logiciel à leurs besoins dans des conditions permettant d'assurer la | |||||
sécurité de leurs systèmes et ou de leurs données et, plus généralement, | |||||
à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. | |||||
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez | |||||
pris connaissance de la licence CeCILL, et que vous en avez accepté les | |||||
termes. | |||||
*/ | |||||
var app = new Vue({ | |||||
el: '#app-setting-admin', | |||||
data() { | |||||
return Object.assign({ | |||||
currentSection: null, | |||||
sectionsArray: [] | |||||
}, window.appInitValues); | |||||
}, | |||||
methods: { | |||||
changeSection: function(section) { | |||||
this.currentSection = section.name ; | |||||
}, | |||||
getInitialSection: function() { | |||||
var hash = window.location.hash.substring(1); | |||||
if(hash && hash.length) { | |||||
return hash; | |||||
} | |||||
return this.sectionsArray[0].name; | |||||
} | |||||
}, | |||||
mounted: function() { | |||||
this.currentSection = this.getInitialSection(); | |||||
} | |||||
}); | |||||
} | } | ||||
#nav-params { | #nav-params { | ||||
margin-bottom: 30px ; | |||||
margin-bottom: 20px ; | |||||
a { | a { | ||||
margin-right: 10px ; | margin-right: 10px ; | ||||
@import "support/_view.scss"; | @import "support/_view.scss"; | ||||
@import "producer-admin/_index.scss"; | @import "producer-admin/_index.scss"; | ||||
@import "feature-admin/_index.scss"; | @import "feature-admin/_index.scss"; | ||||
@import "setting/_form.scss"; | |||||
@import "_responsive.scss" ; | @import "_responsive.scss" ; |
.setting-form { | |||||
.panel { | |||||
h4 { | |||||
font-size: 23px; | |||||
margin-bottom: 20px; | |||||
text-transform: uppercase; | |||||
border-bottom: solid 1px gray; | |||||
} | |||||
h4:not(:first-child) { | |||||
margin-top: 45px; | |||||
} | |||||
} | |||||
.form-group { | |||||
&.has-success, &.has-success label { | |||||
color: #333; | |||||
} | |||||
.checkbox { | |||||
input { | |||||
position: relative; | |||||
top: -1px; | |||||
margin-right: 3px; | |||||
} | |||||
} | |||||
&.form-toggle { | |||||
.control-label { | |||||
position: relative; | |||||
top: 7px; | |||||
left: 10px; | |||||
} | |||||
.toggle { | |||||
@include border-radius(20px); | |||||
float: left; | |||||
.toggle-group { | |||||
.btn.toggle-on { | |||||
//border-color: white; | |||||
color: white; | |||||
} | |||||
.btn.toggle-off { | |||||
border-color: white; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} |
public function set(string $name, $value) | public function set(string $name, $value) | ||||
{ | { | ||||
$setting = $this->settingRepository->findOneAdminSettingByName($name); | |||||
$setting = $this->settingBuilder->createSetting($name); | |||||
if($setting) { | if($setting) { | ||||
$this->settingBuilder->updateValue($setting, $value); | $this->settingBuilder->updateValue($setting, $value); |
class AbstractSettingDetail | class AbstractSettingDetail | ||||
{ | { | ||||
const TYPE_STRING = 'string'; | |||||
const TYPE_TEXT = 'text'; | |||||
const TYPE_BOOLEAN = 'boolean'; | |||||
const TYPE_DATE = 'date'; | |||||
const TYPE_INTEGER = 'integer'; | |||||
const TYPE_FLOAT = 'float'; | |||||
const TYPE_DOUBLE = 'double'; | |||||
public string $name; | public string $name; | ||||
public string $label; | public string $label; | ||||
public string $type; | public string $type; | ||||
public string $section; | public string $section; | ||||
public ?string $formType = null; | |||||
public array $options = []; | |||||
public $defaultValue = null; | public $defaultValue = null; | ||||
public ?string $subSection = null; | public ?string $subSection = null; | ||||
public ?string $helpMessage = null; | public ?string $helpMessage = null; | ||||
return $this->helpMessage; | return $this->helpMessage; | ||||
} | } | ||||
public function getFormType(): ?string | |||||
{ | |||||
return $this->formType; | |||||
} | |||||
public function setFormTypeInput(): self | |||||
{ | |||||
$this->formType = 'input'; | |||||
return $this; | |||||
} | |||||
public function setFormTypeTextarea(): self | |||||
{ | |||||
$this->formType = 'textarea'; | |||||
return $this; | |||||
} | |||||
public function setFormTypeCheckbox(): self | |||||
{ | |||||
$this->formType = 'checkbox'; | |||||
return $this; | |||||
} | |||||
public function setFormTypeToggle(): self | |||||
{ | |||||
$this->formType = 'toggle'; | |||||
return $this; | |||||
} | |||||
public function setFormTypeSelect(array $options): self | |||||
{ | |||||
$this->formType = 'select'; | |||||
$this->options = $options; | |||||
return $this; | |||||
} | |||||
public function getOptions(): array | |||||
{ | |||||
return $this->options; | |||||
} | |||||
public function setDefaultValue($defaultValue): self | public function setDefaultValue($defaultValue): self | ||||
{ | { | ||||
$this->defaultValue = $defaultValue; | $this->defaultValue = $defaultValue; | ||||
public function setTypeString(): self | public function setTypeString(): self | ||||
{ | { | ||||
$this->type = self::TYPE_STRING; | |||||
$this->type = 'string'; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function setTypeText(): self | public function setTypeText(): self | ||||
{ | { | ||||
$this->type = self::TYPE_TEXT; | |||||
$this->type = 'text'; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function setTypeBoolean(): self | public function setTypeBoolean(): self | ||||
{ | { | ||||
$this->type = self::TYPE_BOOLEAN; | |||||
$this->type = 'boolean'; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function setTypeDate(): self | public function setTypeDate(): self | ||||
{ | { | ||||
$this->type = self::TYPE_DATE; | |||||
$this->type = 'date'; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function setTypeInteger(): self | public function setTypeInteger(): self | ||||
{ | { | ||||
$this->type = self::TYPE_INTEGER; | |||||
$this->type = 'integer'; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function setTypeFloat(): self | public function setTypeFloat(): self | ||||
{ | { | ||||
$this->type = self::TYPE_FLOAT; | |||||
$this->type = 'float'; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function setTypeDouble(): self | public function setTypeDouble(): self | ||||
{ | { | ||||
$this->type = self::TYPE_DOUBLE; | |||||
$this->type = 'double'; | |||||
return $this; | return $this; | ||||
} | } | ||||
use common\logic\Setting\SettingDefinition; | use common\logic\Setting\SettingDefinition; | ||||
use common\logic\Setting\SettingDetails\Admin\General\AdministratorEmailAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\AdministratorEmailAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\AdministratorPhoneNumberAdminSetting; | use common\logic\Setting\SettingDetails\Admin\General\AdministratorPhoneNumberAdminSetting; | ||||
use common\logic\Setting\SettingDetails\Admin\General\IsTestAdminSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\General\SupportEmailAdminSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\General2\AnOtherTestAdminSetting; | |||||
use common\logic\Setting\SettingDetails\Admin\General\TestToggleAdminSetting; | |||||
class AdminSettingDefinition extends SettingDefinition | class AdminSettingDefinition extends SettingDefinition | ||||
{ | { | ||||
const SECTION_GENERAL = 'general'; | const SECTION_GENERAL = 'general'; | ||||
const SUBSECTION_GENERAL = 'general.main'; | const SUBSECTION_GENERAL = 'general.main'; | ||||
const SECTION_GENERAL2 = 'general2'; | |||||
const SUBSECTION_GENERAL2 = 'general2.main'; | |||||
public function getSettingDetails(): array | public function getSettingDetails(): array | ||||
{ | { | ||||
return [ | return [ | ||||
self::SECTION_GENERAL => [ | self::SECTION_GENERAL => [ | ||||
self::SUBSECTION_GENERAL => [ | self::SUBSECTION_GENERAL => [ | ||||
new AdministratorEmailAdminSetting, | new AdministratorEmailAdminSetting, | ||||
new SupportEmailAdminSetting, | |||||
new AdministratorPhoneNumberAdminSetting, | new AdministratorPhoneNumberAdminSetting, | ||||
new IsTestAdminSetting, | |||||
new TestToggleAdminSetting, | |||||
] | ] | ||||
], | ], | ||||
self::SECTION_GENERAL2 => [ | |||||
self::SUBSECTION_GENERAL2 => [ | |||||
new AnOtherTestAdminSetting, | |||||
], | |||||
] | |||||
]; | ]; | ||||
} | } | ||||
return [ | return [ | ||||
self::SECTION_GENERAL => 'General', | self::SECTION_GENERAL => 'General', | ||||
self::SUBSECTION_GENERAL => 'General', | self::SUBSECTION_GENERAL => 'General', | ||||
self::SECTION_GENERAL2 => 'General deux', | |||||
self::SUBSECTION_GENERAL2 => 'General deux', | |||||
]; | ]; | ||||
} | } | ||||
public function getSectionsArray(): array | |||||
{ | |||||
$sectionsArray = []; | |||||
foreach($this->getSettingDetails() as $sectionName => $subsectionsArray) { | |||||
$sectionsArray[] = [ | |||||
'name' => $sectionName, | |||||
'nameDisplay' => $this->getSectionLabelBySectionName($sectionName), | |||||
]; | |||||
} | |||||
return $sectionsArray; | |||||
} | |||||
public function getSettingDetailsFlat(): array | public function getSettingDetailsFlat(): array | ||||
{ | { | ||||
$settingDetailsFlatArray = []; | $settingDetailsFlatArray = []; |
{ | { | ||||
$this | $this | ||||
->setName('administratorEmail') | ->setName('administratorEmail') | ||||
->setLabel('Administrator Email') | |||||
->setTypeString(); | |||||
->setLabel("Email de l'administrateur") | |||||
->setTypeString() | |||||
->setFormTypeInput(); | |||||
} | } | ||||
} | } |
{ | { | ||||
$this | $this | ||||
->setName('administratorPhoneNumber') | ->setName('administratorPhoneNumber') | ||||
->setLabel('Administrator Phone Number') | |||||
->setTypeString(); | |||||
->setLabel("Numéro de téléphone de l'administrateur") | |||||
->setTypeString() | |||||
->setFormTypeInput(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\General; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class SupportEmailAdminSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('supportEmail') | |||||
->setLabel('Support Email') | |||||
->setTypeString(); | |||||
} | |||||
} |
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | use common\logic\Setting\SettingDetails\AbstractSettingDetail; | ||||
class IsTestAdminSetting extends AbstractSettingDetail | |||||
class TestToggleAdminSetting extends AbstractSettingDetail | |||||
{ | { | ||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$this | $this | ||||
->setName('isTest') | |||||
->setLabel('Is Test') | |||||
->setName('testToggle') | |||||
->setLabel("Activer cette option") | |||||
->setTypeBoolean() | ->setTypeBoolean() | ||||
->setDefaultValue(true); | |||||
->setFormTypeToggle(); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace common\logic\Setting\SettingDetails\Admin\General2; | |||||
use common\logic\Setting\SettingDetails\AbstractSettingDetail; | |||||
class AnOtherTestAdminSetting extends AbstractSettingDetail | |||||
{ | |||||
public function __construct() | |||||
{ | |||||
$this | |||||
->setName('anOtherTest') | |||||
->setLabel('Un autre test') | |||||
->setTypeBoolean(); | |||||
} | |||||
} |