fix unknown model on first use
This commit is contained in:
parent
f304f15d87
commit
6a87e4c5ff
2 changed files with 3 additions and 0 deletions
|
@ -115,9 +115,11 @@ class Manage extends dcNsProcess
|
||||||
$models = iterator_to_array($models);
|
$models = iterator_to_array($models);
|
||||||
$s = dcCore::app()->blog->settings->get(My::id());
|
$s = dcCore::app()->blog->settings->get(My::id());
|
||||||
$model = json_decode((string) $s->get('model'), true);
|
$model = json_decode((string) $s->get('model'), true);
|
||||||
|
$model = array_merge(My::defaultModel(), is_array($model) ? $model : []);
|
||||||
$header = '';
|
$header = '';
|
||||||
|
|
||||||
foreach ($models as $m) {
|
foreach ($models as $m) {
|
||||||
|
$m = array_merge(My::defaultModel(), $m);
|
||||||
$header .= "\t" .
|
$header .= "\t" .
|
||||||
'arlequin.addModel(' .
|
'arlequin.addModel(' .
|
||||||
'"' . Html::escapeJS($m['name']) . '",' .
|
'"' . Html::escapeJS($m['name']) . '",' .
|
||||||
|
|
|
@ -85,6 +85,7 @@ class My
|
||||||
public static function defaultModel(): array
|
public static function defaultModel(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
'name' => __('Default'),
|
||||||
'e_html' => '<li><a href="%1$s%2$s%3$s">%4$s</a></li>',
|
'e_html' => '<li><a href="%1$s%2$s%3$s">%4$s</a></li>',
|
||||||
'a_html' => '<li><strong>%4$s</strong></li>',
|
'a_html' => '<li><strong>%4$s</strong></li>',
|
||||||
's_html' => '<ul>%2$s</ul>',
|
's_html' => '<ul>%2$s</ul>',
|
||||||
|
|
Loading…
Reference in a new issue