aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Notes.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-10-04 19:20:10 -0700
committerzotlabs <mike@macgirvin.com>2018-10-04 19:20:10 -0700
commit3a0a611f15f2789099acf57c6ca93828f5edae46 (patch)
treed928cd86bc856ae80a95a9738fc8a96b8fa23e5b /Zotlabs/Module/Notes.php
parentd33c331abd3ae500fc7cdac206ea647c4c71905e (diff)
parent1eaf6df842184743ee20ec69931be1ff7136f34e (diff)
downloadvolse-hubzilla-3a0a611f15f2789099acf57c6ca93828f5edae46.tar.gz
volse-hubzilla-3a0a611f15f2789099acf57c6ca93828f5edae46.tar.bz2
volse-hubzilla-3a0a611f15f2789099acf57c6ca93828f5edae46.zip
Merge branch 'dev'
Diffstat (limited to 'Zotlabs/Module/Notes.php')
-rw-r--r--Zotlabs/Module/Notes.php41
1 files changed, 34 insertions, 7 deletions
diff --git a/Zotlabs/Module/Notes.php b/Zotlabs/Module/Notes.php
index e530e6ff4..178a6bce0 100644
--- a/Zotlabs/Module/Notes.php
+++ b/Zotlabs/Module/Notes.php
@@ -1,13 +1,19 @@
<?php
namespace Zotlabs\Module; /** @file */
+use App;
+use Zotlabs\Web\Controller;
+use Zotlabs\Lib\Apps;
-class Notes extends \Zotlabs\Web\Controller {
+class Notes extends Controller {
- function init() {
+ function post() {
if(! local_channel())
- return;
+ return EMPTY_STR;
+
+ if(! Apps::system_app_installed(local_channel(), 'Notes'))
+ return EMPTY_STR;
$ret = array('success' => true);
if(array_key_exists('note_text',$_REQUEST)) {
@@ -24,17 +30,38 @@ class Notes extends \Zotlabs\Web\Controller {
}
set_pconfig(local_channel(),'notes','text',$body);
}
-
+
// push updates to channel clones
-
+
if((argc() > 1) && (argv(1) === 'sync')) {
require_once('include/zot.php');
build_sync_packet();
}
-
+
logger('notes saved.', LOGGER_DEBUG);
json_return_and_die($ret);
-
+
+ }
+
+ function get() {
+
+ if(! local_channel())
+ return EMPTY_STR;
+
+ if(! Apps::system_app_installed(local_channel(), 'Notes')) {
+ //Do not display any associated widgets at this point
+ App::$pdl = EMPTY_STR;
+
+ $o = '<b>' . t('Notes App') . ' (' . t('Not Installed') . '):</b><br>';
+ $o .= t('A simple notes app with a widget (note: notes are not encrypted)');
+ return $o;
+ }
+
+ $w = new \Zotlabs\Widget\Notes;
+ $arr = ['app' => true];
+
+ return $w->widget($arr);
+
}
}