From f85cba10eb3d976d715c7a80fe69fe15d9dc468c Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 9 Dec 2013 15:27:46 -0800 Subject: notes widget --- include/widgets.php | 14 ++++++++++++++ mod/network.php | 2 +- mod/notes.php | 16 ++++++++++++++++ view/theme/redbasic/css/style.css | 9 ++++++++- view/tpl/notes.tpl | 13 +++++++++++++ 5 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 mod/notes.php create mode 100644 view/tpl/notes.tpl diff --git a/include/widgets.php b/include/widgets.php index 632f85436..2e8169bd7 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -135,3 +135,17 @@ function widget_follow($args) { )); } + + +function widget_notes($arr) { + if(! local_user()) + return ''; + $text = htmlspecialchars(get_pconfig(local_user(),'notes','text')); + + $o = replace_macros(get_markup_template('notes.tpl'), array( + '$banner' => t('Notes'), + '$text' => $text, + '$save' => t('Save'), + )); + return $o; +} diff --git a/mod/network.php b/mod/network.php index efb3116ae..13092d47d 100644 --- a/mod/network.php +++ b/mod/network.php @@ -54,7 +54,7 @@ function network_init(&$a) { $a->set_widget('suggestions',widget_suggestions(array())); $a->set_widget('savedsearch',saved_searches($search)); $a->set_widget('filer',fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''))); - + $a->set_widget('notes',widget_notes(array())); if($search) { if(strpos($search,'@') === 0) { diff --git a/mod/notes.php b/mod/notes.php new file mode 100644 index 000000000..ce3460aa4 --- /dev/null +++ b/mod/notes.php @@ -0,0 +1,16 @@ + true); + if($_REQUEST['note_text']) { + $body = escape_tags($_REQUEST['note_text']); + set_pconfig(local_user(),'notes','text',$body); + } + logger('notes saved.'); + json_return_and_die($ret); + +} \ No newline at end of file diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 14a708e55..31aa45995 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -2985,4 +2985,11 @@ img.mail-list-sender-photo { .comment-edit-text-full { color: black; } -.suggest-widget-more { margin-top: 10px; } \ No newline at end of file +.suggest-widget-more { margin-top: 10px; } + +#note-text { + width: 190px; + max-width: 190px; + height: 150px; +} +#note-save { margin-top: 10px; } \ No newline at end of file diff --git a/view/tpl/notes.tpl b/view/tpl/notes.tpl new file mode 100644 index 000000000..7300779f4 --- /dev/null +++ b/view/tpl/notes.tpl @@ -0,0 +1,13 @@ +
+ + +

{{$banner}}

+ + +
+
-- cgit v1.2.3