remove all the magic
parent
6af93533c4
commit
11b43e5c4e
|
@ -42,16 +42,16 @@ class Widgets
|
||||||
__('List filtered contents.')
|
__('List filtered contents.')
|
||||||
);
|
);
|
||||||
# Title
|
# Title
|
||||||
$w->epclist->addTitle(__('In this article'));
|
$w->__get('epclist')->addTitle(__('In this article'));
|
||||||
# Text
|
# Text
|
||||||
$w->epclist->setting(
|
$w->__get('epclist')->setting(
|
||||||
'text',
|
'text',
|
||||||
__('Description:'),
|
__('Description:'),
|
||||||
'',
|
'',
|
||||||
'text'
|
'text'
|
||||||
);
|
);
|
||||||
# Type
|
# Type
|
||||||
$w->epclist->setting(
|
$w->__get('epclist')->setting(
|
||||||
'type',
|
'type',
|
||||||
__('Type:'),
|
__('Type:'),
|
||||||
'Definition',
|
'Definition',
|
||||||
|
@ -60,7 +60,7 @@ class Widgets
|
||||||
);
|
);
|
||||||
# Content
|
# Content
|
||||||
foreach (Epc::widgetAllowedTemplateValue() as $name => $info) {
|
foreach (Epc::widgetAllowedTemplateValue() as $name => $info) {
|
||||||
$w->epclist->setting(
|
$w->__get('epclist')->setting(
|
||||||
'content' . $info['id'],
|
'content' . $info['id'],
|
||||||
sprintf(__('Enable filter on %s'), __($name)),
|
sprintf(__('Enable filter on %s'), __($name)),
|
||||||
1,
|
1,
|
||||||
|
@ -68,14 +68,14 @@ class Widgets
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
# Show count
|
# Show count
|
||||||
$w->epclist->setting(
|
$w->__get('epclist')->setting(
|
||||||
'show_total',
|
'show_total',
|
||||||
__('Show the number of appearance'),
|
__('Show the number of appearance'),
|
||||||
1,
|
1,
|
||||||
'check'
|
'check'
|
||||||
);
|
);
|
||||||
# widget options
|
# widget options
|
||||||
$w->epclist
|
$w->__get('epclist')
|
||||||
->addContentOnly()
|
->addContentOnly()
|
||||||
->addClass()
|
->addClass()
|
||||||
->addOffline();
|
->addOffline();
|
||||||
|
@ -88,7 +88,7 @@ class Widgets
|
||||||
*/
|
*/
|
||||||
public static function parseWidget(WidgetsElement $w): string
|
public static function parseWidget(WidgetsElement $w): string
|
||||||
{
|
{
|
||||||
if ($w->offline) {
|
if ($w->__get('offline')) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ class Widgets
|
||||||
$content = '';
|
$content = '';
|
||||||
foreach (Epc::widgetAllowedTemplateValue() as $info) {
|
foreach (Epc::widgetAllowedTemplateValue() as $info) {
|
||||||
$ns = 'content' . $info['id'];
|
$ns = 'content' . $info['id'];
|
||||||
if ($w->$ns && is_callable($info['cb'])) {
|
if ($w->__get($ns) && is_callable($info['cb'])) {
|
||||||
$content .= call_user_func(
|
$content .= call_user_func(
|
||||||
$info['cb'],
|
$info['cb'],
|
||||||
$w
|
$w
|
||||||
|
@ -117,7 +117,7 @@ class Widgets
|
||||||
|
|
||||||
# Filter
|
# Filter
|
||||||
$list = new ArrayObject();
|
$list = new ArrayObject();
|
||||||
$filter = Epc::getFilters()->get($w->type);
|
$filter = Epc::getFilters()->get($w->__get('type'));
|
||||||
|
|
||||||
if (!is_null($filter)) {
|
if (!is_null($filter)) {
|
||||||
$filter->widgetList($content, $w, $list);
|
$filter->widgetList($content, $w, $list);
|
||||||
|
@ -135,16 +135,16 @@ class Widgets
|
||||||
}
|
}
|
||||||
|
|
||||||
$res .= '<li>' . $line['replacement'] .
|
$res .= '<li>' . $line['replacement'] .
|
||||||
($w->show_total ? ' (' . $line['total'] . ')' : '') .
|
($w->__get('show_total') ? ' (' . $line['total'] . ')' : '') .
|
||||||
'</li>';
|
'</li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return empty($res) ? '' : $w->renderDiv(
|
return empty($res) ? '' : $w->renderDiv(
|
||||||
(bool) $w->content_only,
|
(bool) $w->__get('content_only'),
|
||||||
$w->class,
|
$w->__get('class'),
|
||||||
'id="epc_' . $w->type . '"',
|
'id="epc_' . $w->__get('type') . '"',
|
||||||
($w->title ? $w->renderTitle(Html::escapeHTML($w->title)) : '') .
|
($w->__get('title') ? $w->renderTitle(Html::escapeHTML($w->__get('title'))) : '') .
|
||||||
($w->text ? '<p>' . Html::escapeHTML($w->text) . '</p>' : '') .
|
($w->__get('text') ? '<p>' . Html::escapeHTML($w->__get('text')) . '</p>' : '') .
|
||||||
'<ul>' . $res . '</ul>'
|
'<ul>' . $res . '</ul>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue