commit
e19694b98a
|
|
@ -154,7 +154,7 @@
|
|||
<?php $selectedOption = old('theme') ?: $channel->theme ?>
|
||||
|
||||
<select class="control" id="theme" name="theme">
|
||||
@foreach (themes()->all() as $theme)
|
||||
@foreach (themes()->getChannelThemes() as $theme)
|
||||
<option value="{{ $theme->code }}" {{ $selectedOption == $theme->code ? 'selected' : '' }}>
|
||||
{{ $theme->name }}
|
||||
</option>
|
||||
|
|
|
|||
|
|
@ -66,6 +66,32 @@ class Themes
|
|||
return $this->themes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of registered themes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getChannelThemes()
|
||||
{
|
||||
$themes = config('themes.themes', []);
|
||||
$channelThemes = [];
|
||||
|
||||
foreach ($themes as $code => $data) {
|
||||
$channelThemes[] = new Theme(
|
||||
$code,
|
||||
isset($data['name']) ? $data['name'] : '',
|
||||
isset($data['assets_path']) ? $data['assets_path'] : '',
|
||||
isset($data['views_path']) ? $data['views_path'] : ''
|
||||
);
|
||||
|
||||
if (isset($data['parent']) && $data['parent']) {
|
||||
$parentThemes[$code] = $data['parent'];
|
||||
}
|
||||
}
|
||||
|
||||
return $channelThemes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if specified exists
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue