remove magic

This commit is contained in:
Jean-Christian Denis 2023-04-23 20:36:02 +02:00
parent 357d143121
commit 7f6b8947c4
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951
2 changed files with 14 additions and 9 deletions

View file

@ -113,10 +113,15 @@ class Backend extends dcNsProcess
echo
'<div class="fieldset">' .
'<h4>' . Html::escapeHTML(My::name()) . '</h4>' .
(new Para())->items([
(new Checkbox('dcLatestVersionsItems', (bool) dcCore::app()->auth->user_prefs->get('dashboard')->get('dcLatestVersionsItems')))->value(1),
(new Label(__("Show Dotclear's latest versions on dashboards."), Label::OUTSIDE_LABEL_AFTER))->for('dcLatestVersionsItems')->class('classic'),
])->render() .
(new Para())
->__call('items', [[
(new Checkbox('dcLatestVersionsItems', (bool) dcCore::app()->auth->user_prefs->get('dashboard')->get('dcLatestVersionsItems')))
->__call('value', [1]),
(new Label(__("Show Dotclear's latest versions on dashboards."), Label::OUTSIDE_LABEL_AFTER))
->__call('for', ['dcLatestVersionsItems'])
->__call('class', ['classic']),
]])
->render() .
'</div>';
},

View file

@ -49,7 +49,7 @@ class Widgets
public static function parseWidget(WidgetsElement $w): string
{
if ($w->offline || !$w->checkHomeOnly(dcCore::app()->url->type) || $w->text == '') {
if ($w->__get('offline') || !$w->checkHomeOnly(dcCore::app()->url->type) || $w->__get('text') == '') {
return '';
}
@ -93,7 +93,7 @@ class Widgets
$updater->getVersion(),
$updater->getFileURL(),
],
$w->text
$w->__get('text')
));
}
@ -103,10 +103,10 @@ class Widgets
# Display
return $w->renderDiv(
(bool) $w->content_only,
'dclatestversionswidget ' . $w->class,
(bool) $w->__get('content_only'),
'dclatestversionswidget ' . $w->__get('class'),
'',
($w->title ? $w->renderTitle(Html::escapeHTML($w->title)) : '') . sprintf('<ul>%s</ul>', implode('', $li))
($w->__get('title') ? $w->renderTitle(Html::escapeHTML($w->__get('title'))) : '') . sprintf('<ul>%s</ul>', implode('', $li))
);
}
}