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

Preparing for multiple settings input types

parent f9c6baf8
...@@ -25,13 +25,27 @@ ...@@ -25,13 +25,27 @@
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane {{ App::getLocale() == 'en' ? 'active' : '' }}" id="tab_1-1"> <div class="tab-pane {{ App::getLocale() == 'en' ? 'active' : '' }}" id="tab_1-1">
<?php foreach($moduleSettings as $moduleInfo): ?> <?php foreach($moduleSettings as $settingName => $moduleInfo): ?>
@include("setting::admin.partials.module-{$moduleInfo['type']}-field", ['lang' => 'en', 'moduleSettings' => $moduleSettings, 'settings' => $settings, 'module' => $module]) @include("setting::admin.partials.module-{$moduleInfo['type']}-field", [
'lang' => 'en',
'moduleSettings' => $moduleSettings,
'settings' => $settings,
'module' => $module,
'setting' => $settingName,
'moduleInfo' => $moduleInfo,
])
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<div class="tab-pane {{ App::getLocale() == 'fr' ? 'active' : '' }}" id="tab_2-2"> <div class="tab-pane {{ App::getLocale() == 'fr' ? 'active' : '' }}" id="tab_2-2">
<?php foreach($moduleSettings as $moduleInfo): ?> <?php foreach($moduleSettings as $settingName => $moduleInfo): ?>
@include("setting::admin.partials.module-{$moduleInfo['type']}-field", ['lang' => 'fr', 'moduleSettings' => $moduleSettings, 'settings' => $settings, 'module' => $module]) @include("setting::admin.partials.module-{$moduleInfo['type']}-field", [
'lang' => 'fr',
'moduleSettings' => $moduleSettings,
'settings' => $settings,
'module' => $module,
'setting' => $settingName,
'moduleInfo' => $moduleInfo,
])
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</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; ?>
<?php $settingName = $module . '_' . $setting; ?> <div class='form-group'>
<div class='form-group'> {!! Form::label($settingName . "[$lang]", $moduleInfo['description']) !!}
{!! Form::label($settingName . "[$lang]", $moduleInfo['description']) !!} <?php if (isset($settings[$settingName])): ?>
<?php if (isset($settings[$settingName])): ?> {!! Form::text($settingName . "[$lang]", Input::old($settingName . "[$lang]", $settings[$settingName]->translate($lang)->value), ['class' => 'form-control', 'placeholder' => $moduleInfo['description']]) !!}
{!! Form::text($settingName . "[$lang]", Input::old($settingName . "[$lang]", $settings[$settingName]->translate($lang)->value), ['class' => 'form-control', 'placeholder' => $moduleInfo['description']]) !!} <?php else: ?>
<?php else: ?> {!! Form::text($settingName . "[$lang]", Input::old($settingName . "[$lang]"), ['class' => 'form-control', 'placeholder' => $moduleInfo['description']]) !!}
{!! Form::text($settingName . "[$lang]", Input::old($settingName . "[$lang]"), ['class' => 'form-control', 'placeholder' => $moduleInfo['description']]) !!} <?php endif; ?>
<?php endif; ?> </div>
</div>
<?php endforeach; ?>
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