Commit 906e9822 authored by Nicolas Widart's avatar Nicolas Widart

Preparing for multiple settings input types

parent f9c6baf8
......@@ -25,13 +25,27 @@
</ul>
<div class="tab-content">
<div class="tab-pane {{ App::getLocale() == 'en' ? 'active' : '' }}" id="tab_1-1">
<?php foreach($moduleSettings as $moduleInfo): ?>
@include("setting::admin.partials.module-{$moduleInfo['type']}-field", ['lang' => 'en', 'moduleSettings' => $moduleSettings, 'settings' => $settings, 'module' => $module])
<?php foreach($moduleSettings as $settingName => $moduleInfo): ?>
@include("setting::admin.partials.module-{$moduleInfo['type']}-field", [
'lang' => 'en',
'moduleSettings' => $moduleSettings,
'settings' => $settings,
'module' => $module,
'setting' => $settingName,
'moduleInfo' => $moduleInfo,
])
<?php endforeach; ?>
</div>
<div class="tab-pane {{ App::getLocale() == 'fr' ? 'active' : '' }}" id="tab_2-2">
<?php foreach($moduleSettings as $moduleInfo): ?>
@include("setting::admin.partials.module-{$moduleInfo['type']}-field", ['lang' => 'fr', 'moduleSettings' => $moduleSettings, 'settings' => $settings, 'module' => $module])
<?php foreach($moduleSettings as $settingName => $moduleInfo): ?>
@include("setting::admin.partials.module-{$moduleInfo['type']}-field", [
'lang' => 'fr',
'moduleSettings' => $moduleSettings,
'settings' => $settings,
'module' => $module,
'setting' => $settingName,
'moduleInfo' => $moduleInfo,
])
<?php endforeach; ?>
</div>
</div>
......
<?php $settingName = $module . '_' . $setting; ?>
<div class='form-group'>
{!! Form::label($settingName . "[$lang]", $moduleInfo['description']) !!}
<?php if (isset($settings[$settingName])): ?>
{!! Form::text($settingName . "[$lang]", Input::old($settingName . "[$lang]", $settings[$settingName]->translate($lang)->value), ['class' => 'form-control', 'placeholder' => $moduleInfo['description']]) !!}
<?php else: ?>
{!! Form::text($settingName . "[$lang]", Input::old($settingName . "[$lang]"), ['class' => 'form-control', 'placeholder' => $moduleInfo['description']]) !!}
<?php endif; ?>
</div>
<?php foreach($moduleSettings as $setting => $moduleInfo): ?>
<?php $settingName = $module . '_' . $setting; ?>
<div class='form-group'>
<?php $settingName = $module . '_' . $setting; ?>
<div class='form-group'>
{!! Form::label($settingName . "[$lang]", $moduleInfo['description']) !!}
<?php if (isset($settings[$settingName])): ?>
{!! Form::text($settingName . "[$lang]", Input::old($settingName . "[$lang]", $settings[$settingName]->translate($lang)->value), ['class' => 'form-control', 'placeholder' => $moduleInfo['description']]) !!}
<?php else: ?>
{!! Form::text($settingName . "[$lang]", Input::old($settingName . "[$lang]"), ['class' => 'form-control', 'placeholder' => $moduleInfo['description']]) !!}
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment