streams/Code/Widget/Notes.php

32 lines
566 B
PHP
Raw Normal View History

<?php
2022-02-16 04:08:28 +00:00
namespace Code\Widget;
2022-02-16 04:08:28 +00:00
use Code\Lib\Apps;
use Code\Render\Theme;
2022-02-12 20:43:29 +00:00
2019-06-25 00:35:12 +00:00
2021-12-02 23:02:31 +00:00
class Notes
{
2021-12-02 23:02:31 +00:00
public function widget($arr)
{
if (!local_channel()) {
return '';
}
if (!Apps::system_app_installed(local_channel(), 'Notes')) {
return '';
}
2021-12-02 23:02:31 +00:00
$text = get_pconfig(local_channel(), 'notes', 'text');
2022-02-12 20:43:29 +00:00
$o = replace_macros(Theme::get_template('notes.tpl'), [
2021-12-02 23:02:31 +00:00
'$banner' => t('Notes'),
'$text' => $text,
'$save' => t('Save'),
]);
2021-12-02 23:02:31 +00:00
return $o;
}
}