protected $_enableRevisionsButton = false;
protected $_enableBulk = true;
+ protected $revisionEnabled = true;
+
protected $_flushCacheOnSave = true;
public $timestamps = true;
if ($this->_enableRevisions) {
$ops[] = ReviseOperation::class;
}
+ $this->revisionEnabled = $this->_enableRevisions;
$ops = array_merge($ops, $this->_operations);
foreach ($ops as $operation) {
public function getTranslations(string $key = null, array $allowedLocales = null): array
{
if ($key !== null) {
- if (isset($this->_translations[$key])) {
- return $this->_translations[$key];
- }
// $measure_label = 'Get translation in ' . get_class($this);
// start_measure($measure_label);
$this->guardAgainstNonTranslatableAttribute($key);
return $value !== null && $value !== '';
});
}
- $this->_translations[$key] = $res;
// stop_measure($measure_label);
return $res;
}
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
{{trans('backpack::crud.language')}}
- : {{ $crud->model->getAvailableLocales()[request()->input('_locale')?request()->input('_locale'):App::getLocale()] }}
+ : {{ $entry->getAvailableLocales()[request()->input('_locale')?request()->input('_locale'):App::getLocale()] }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
- @foreach ($crud->model->getAvailableLocales() as $key => $locale)
+ @foreach ($entry->getAvailableLocales() as $key => $locale)
<a class="dropdown-item"
href="{{ url($crud->route.'/'.$entry->getKey().'/edit') }}?_locale={{ $key }}">{{ $locale }}</a>
@endforeach