Adding method to get the theme version

parent f31edb91
......@@ -34,6 +34,13 @@ if (! function_exists('is_core_module')) {
}
}
if (! function_exists('is_core_theme')) {
function is_core_theme(string $theme)
{
return in_array($theme, ['AdminLTE', 'Flatly'], false);
}
}
if (! function_exists('asgard_i18n_editor')) {
function asgard_i18n_editor($fieldName, $labelName, $content, $lang)
{
......
......@@ -51,7 +51,7 @@
</td>
<td>
<a href="{{ route('admin.workshop.themes.show', [$theme->getName()]) }}">
{{ $theme->version }}
{{ theme_version($theme) }}
</a>
</td>
<td>
......
......@@ -57,7 +57,7 @@
<div class="module-type pull-left">
<i class="fa fa-picture-o"></i>
<span>
{{ $theme->version }}
{{ theme_version($theme) }}
</span>
</div>
<h2>{{ ucfirst($theme->getName()) }}</h2>
......
......@@ -10,3 +10,14 @@ if (! function_exists('module_version')) {
return $module->version;
}
}
if (! function_exists('theme_version')) {
function theme_version(\FloatingPoint\Stylist\Theme\Theme $theme)
{
if (is_core_theme($theme->getName()) === true) {
return \Modules\Core\Foundation\AsgardCms::VERSION;
}
return $theme->version;
}
}
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