aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-06-17 07:43:32 +0000
committerMario <mario@mariovavti.com>2021-06-17 07:43:32 +0000
commit34ca2cddd4d70e08c6351ef0f72ea5e2a6c9b056 (patch)
tree158636ba0db7d9fe44502147e3a41dbf64793d3d
parentfa076efd3bd953863f01bcb474ddb4fc928507e7 (diff)
downloadvolse-hubzilla-34ca2cddd4d70e08c6351ef0f72ea5e2a6c9b056.tar.gz
volse-hubzilla-34ca2cddd4d70e08c6351ef0f72ea5e2a6c9b056.tar.bz2
volse-hubzilla-34ca2cddd4d70e08c6351ef0f72ea5e2a6c9b056.zip
only show notes if the app is enabled
-rw-r--r--Zotlabs/Widget/Hq_controls.php24
-rw-r--r--Zotlabs/Widget/Notes.php3
2 files changed, 17 insertions, 10 deletions
diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php
index 781e2a0bd..8c36b8d3a 100644
--- a/Zotlabs/Widget/Hq_controls.php
+++ b/Zotlabs/Widget/Hq_controls.php
@@ -2,6 +2,9 @@
namespace Zotlabs\Widget;
+use Zotlabs\Lib\Apps;
+
+
class Hq_controls {
function widget($arr) {
@@ -21,16 +24,17 @@ class Hq_controls {
]
];
-
- $entries['toggle_notes'] = [
- 'label' => t('Toggle personal notes'),
- 'id' => 'notes-toggle',
- 'href' => '#',
- 'class' => 'btn btn-outline-primary',
- 'type' => 'button',
- 'icon' => 'sticky-note-o',
- 'extra' => 'data-toggle="button"'
- ];
+ if(Apps::system_app_installed(local_channel(), 'Notes')) {
+ $entries['toggle_notes'] = [
+ 'label' => t('Toggle personal notes'),
+ 'id' => 'notes-toggle',
+ 'href' => '#',
+ 'class' => 'btn btn-outline-primary',
+ 'type' => 'button',
+ 'icon' => 'sticky-note-o',
+ 'extra' => 'data-toggle="button"'
+ ];
+ }
return replace_macros(get_markup_template('hq_controls.tpl'),
[
diff --git a/Zotlabs/Widget/Notes.php b/Zotlabs/Widget/Notes.php
index b2c8eda86..05c1a0292 100644
--- a/Zotlabs/Widget/Notes.php
+++ b/Zotlabs/Widget/Notes.php
@@ -10,6 +10,9 @@ class Notes {
if(! local_channel())
return EMPTY_STR;
+ if(! Apps::system_app_installed(local_channel(), 'Notes'))
+ return EMPTY_STR;
+
$text = get_pconfig(local_channel(),'notes','text');
$tpl = get_markup_template('notes.tpl');