mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 07:35:14 +00:00
31 lines
613 B
PHP
31 lines
613 B
PHP
<?php
|
|
|
|
namespace Code\Widget;
|
|
|
|
use Code\Lib\Apps;
|
|
use Code\Render\Theme;
|
|
|
|
|
|
class Notes implements WidgetInterface
|
|
{
|
|
|
|
public function widget(array $arguments): string
|
|
{
|
|
if (!local_channel()) {
|
|
return '';
|
|
}
|
|
if (!Apps::system_app_installed(local_channel(), 'Notes')) {
|
|
return '';
|
|
}
|
|
|
|
$text = get_pconfig(local_channel(), 'notes', 'text');
|
|
|
|
$o = replace_macros(Theme::get_template('notes.tpl'), [
|
|
'$banner' => t('Notes'),
|
|
'$text' => $text,
|
|
'$save' => t('Save'),
|
|
]);
|
|
|
|
return $o;
|
|
}
|
|
}
|