mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
fixed flags does not exist
This commit is contained in:
parent
18117469ad
commit
37e007480e
@ -1,6 +1,7 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Adv;
|
||||
|
||||
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface;
|
||||
use Anomaly\Streams\Platform\Addon\AddonCollection;
|
||||
use Anomaly\Streams\Platform\Entry\EntryCriteria;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Visiosoft\RecentlyviewedadsModule\Recently\RecentlyModel;
|
||||
@ -97,4 +98,17 @@ class AdvCriteria extends EntryCriteria
|
||||
return $logo;
|
||||
}
|
||||
|
||||
public function Flags()
|
||||
{
|
||||
$addonCollection = app(AddonCollection::class);
|
||||
$dir = $addonCollection->themes->active('standard')->getPath('resources')."/images/flags";
|
||||
$dh = opendir($dir);
|
||||
while (false !== ($filename = readdir($dh))) {
|
||||
$files[] = $filename;
|
||||
}
|
||||
$images=preg_grep ('/\.png$/i', $files);
|
||||
$images=preg_replace('/\\.[^.\\s]{3,4}$/', '', $images);
|
||||
return $images;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
{% set Flags = entries('advs').Flags() %}
|
||||
<li class="{{ container.class }} language-navigation-field {{ toggle.class|raw }}">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ toggle.title|raw }}<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
{% for locale in locales %}
|
||||
<li><a href="#" onclick="window.location = '?_locale={{ locale.name }}'"><img src="{{ img('theme::images/flags/'~locale.name~'.png').url }}" class="lang-flag" >{{ trans('streams::locale.' ~ locale.name ~ '.name') }} ({{ locale.name }})</a></li>
|
||||
<li><a href="#" onclick="window.location = '?_locale={{ locale.name }}'">{% if locale.name in Flags %} <img src="{{ img('theme::images/flags/'~locale.name~'.png').url }}" class="lang-flag" > {% endif %}{{ trans('streams::locale.' ~ locale.name ~ '.name') }} ({{ locale.name }})</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user