400,
'name' => __('Abbreviation'),
'description' => __('Explain some abbreviation. First term of the list is the abbreviation and second term the explanation.'),
'has_list' => true,
'ignore' => ['pre','code','a'],
'class' => ['abbr.epc-abbr'],
'replace' => '%s',
'widget' => '%s',
];
}
protected function initSettings(): array
{
return [
'style' => ['font-weight: bold;'],
'notag' => ['acronym','abbr','dfn','h1','h2','h3'],
'template' => ['EntryContent'],
'page' => ['post.html'],
];
}
public function publicContent(string $tag, array $args): void
{
while ($this->records()->fetch()) {
$args[0] = Epc::replaceString(
$this->records()->f('epc_key'),
sprintf($this->replace, __($this->records()->f('epc_value')), '\\1'),
$args[0],
$this
);
}
}
public function widgetList(string $content, WidgetsElement $w, ArrayObject $list): void
{
while ($this->records()->fetch()) {
$list[] = Epc::matchString(
$this->records()->f('epc_key'),
sprintf($this->widget, __($this->records()->f('epc_value')), '\\1'),
$content,
$this
);
}
}
}