2017-03-15 23:55:47 +00:00
|
|
|
<?php
|
|
|
|
|
2022-02-16 04:08:28 +00:00
|
|
|
namespace Code\Widget;
|
2017-03-15 23:55:47 +00:00
|
|
|
|
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
|
|
|
|
{
|
2017-03-15 23:55:47 +00:00
|
|
|
|
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 '';
|
|
|
|
}
|
2017-03-15 23:55:47 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
$text = get_pconfig(local_channel(), 'notes', 'text');
|
2017-03-15 23:55:47 +00:00
|
|
|
|
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'),
|
|
|
|
]);
|
2017-03-15 23:55:47 +00:00
|
|
|
|
2021-12-02 23:02:31 +00:00
|
|
|
return $o;
|
|
|
|
}
|
2017-03-15 23:55:47 +00:00
|
|
|
}
|