aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Notes.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2018-09-28 15:46:14 +0200
committerMax Kostikov <max@kostikov.co>2018-09-28 15:46:14 +0200
commit4a904fa3a8af1c101ede76657249fb7eb47faf60 (patch)
tree544509813fb68579ef2b556ce879a971d183269a /Zotlabs/Module/Notes.php
parentf5f6ec3d71acb3e0488386819d5060e59331ec23 (diff)
parentc13d7e29ef9676b0f0e4ae23aa52e203f4ad8895 (diff)
downloadvolse-hubzilla-4a904fa3a8af1c101ede76657249fb7eb47faf60.tar.gz
volse-hubzilla-4a904fa3a8af1c101ede76657249fb7eb47faf60.tar.bz2
volse-hubzilla-4a904fa3a8af1c101ede76657249fb7eb47faf60.zip
Merge branch 'patch-29' into 'dev'
Patch 29 See merge request Kostikov/core!3
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..2916925e2 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 (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);
+
}
}