use page title as default in widget
This commit is contained in:
parent
6160c2125a
commit
fd210890b5
@ -37,13 +37,13 @@ dcCore::app()->addBehaviors([
|
||||
]);
|
||||
},
|
||||
'adminSimpleMenuAddType' => function (ArrayObject $items) {
|
||||
$items[basename(__DIR__)] = new ArrayObject([__('Comments list'), false]);
|
||||
$items[basename(__DIR__)] = new ArrayObject([__('Comments list'), false]);
|
||||
},
|
||||
'adminSimpleMenuBeforeEdit' => function ($type, $select, &$item) {
|
||||
if (basename(__DIR__) == $type) {
|
||||
if (basename(__DIR__) == $type) {
|
||||
$item[0] = __('Comments list');
|
||||
$item[1] = __('Comments list');
|
||||
$item[1] = dcCore::app()->blog->settings->get(basename(__DIR__))->get('page_title') ?? __('Comments list');
|
||||
$item[2] = dcCore::app()->admin->blog_url . dcCore::app()->url->getURLFor(basename(__DIR__));
|
||||
}
|
||||
}
|
||||
},
|
||||
]);
|
||||
|
@ -25,12 +25,12 @@ class comListeWidget
|
||||
__('Comments list'),
|
||||
['comListeWidget','publicWidget'],
|
||||
null,
|
||||
__('Comments list')
|
||||
__('Link to comments list public page')
|
||||
)
|
||||
->addTitle(__('Comments list'))
|
||||
->setting(
|
||||
'link_title',
|
||||
__('Link title:'),
|
||||
__('Link title: (leave empty to use page title'),
|
||||
__('Comments list')
|
||||
)
|
||||
->addHomeOnly()
|
||||
@ -56,7 +56,7 @@ class comListeWidget
|
||||
sprintf(
|
||||
'<p><a href="%s">%s</a></p>',
|
||||
dcCore::app()->blog->url . dcCore::app()->url->getBase('comListe'),
|
||||
$w->link_title ? html::escapeHTML($w->link_title) : __('Comments list')
|
||||
$w->link_title ? html::escapeHTML($w->link_title) : (dcCore::app()->blog->settings->get(basename(__DIR__))->get('page_title') ?? __('Comments list'))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user