From 86ac9c0d6b56651cb79c60a616f8340524d1573e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Apr 2015 10:43:14 +0200 Subject: move share webpage element from editwebpage to webpages and make it shareable with rpost --- mod/editwebpage.php | 15 --------------- mod/webpages.php | 19 ++++++++++++++++--- 2 files changed, 16 insertions(+), 18 deletions(-) (limited to 'mod') diff --git a/mod/editwebpage.php b/mod/editwebpage.php index e30a33171..55cd3b4ef 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -221,21 +221,6 @@ logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos if(($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) $o .= '

' . t('Delete Webpage') . '
'; - - $x = array( - 'type' => 'webpage', - 'title' => $itm[0]['title'], - 'body' => $itm[0]['body'], - 'term' => $itm[0]['term'], - 'created' => $itm[0]['created'], - 'edited' => $itm[0]['edited'], - 'mimetype' => $itm[0]['mimetype'], - 'pagetitle' => $page_title, - 'mid' => $itm[0]['mid'] - ); - - $o .= EOL . EOL . t('Share') . EOL . '' . EOL . EOL; - return $o; } diff --git a/mod/webpages.php b/mod/webpages.php index e2b5eb3a4..75803e908 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -124,7 +124,7 @@ function webpages_content(&$a) { if($_REQUEST['pagetitle']) $x['pagetitle'] = $_REQUEST['pagetitle']; - $editor .= status_editor($a,$x); + $editor = status_editor($a,$x); // Get a list of webpages. We can't display all them because endless scroll makes that unusable, // so just list titles and an edit link. @@ -141,12 +141,24 @@ function webpages_content(&$a) { $pages = array(); foreach($r as $rr) { unobscure($rr); + $element_arr = array( + 'type' => 'webpage', + 'title' => $rr['title'], + 'body' => $rr['body'], + 'term' => $rr['term'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'mimetype' => $rr['mimetype'], + 'pagetitle' => $rr['sid'], + 'mid' => $rr['mid'] + ); $pages[$rr['iid']][] = array( 'url' => $rr['iid'], 'pagetitle' => $rr['sid'], 'title' => $rr['title'], 'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']), - 'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']) + 'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']), + 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]' ); } } @@ -158,8 +170,9 @@ function webpages_content(&$a) { $o .= replace_macros(get_markup_template('webpagelist.tpl'), array( '$listtitle' => t('Webpages'), '$baseurl' => $url, - '$create' => t('Create'), + '$create' => t('Create'), '$edit' => t('Edit'), + '$share' => t('Share'), '$delete' => t('Delete'), '$pages' => $pages, '$channel' => $which, -- cgit v1.2.3 From b42bb09635c6040945bcc65e7b7e6218870b92ea Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Apr 2015 10:46:59 +0200 Subject: whitespace --- mod/webpages.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'mod') diff --git a/mod/webpages.php b/mod/webpages.php index 75803e908..5013d803a 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -142,23 +142,23 @@ function webpages_content(&$a) { foreach($r as $rr) { unobscure($rr); $element_arr = array( - 'type' => 'webpage', - 'title' => $rr['title'], - 'body' => $rr['body'], - 'term' => $rr['term'], - 'created' => $rr['created'], - 'edited' => $rr['edited'], - 'mimetype' => $rr['mimetype'], - 'pagetitle' => $rr['sid'], - 'mid' => $rr['mid'] + 'type' => 'webpage', + 'title' => $rr['title'], + 'body' => $rr['body'], + 'term' => $rr['term'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'mimetype' => $rr['mimetype'], + 'pagetitle' => $rr['sid'], + 'mid' => $rr['mid'] ); $pages[$rr['iid']][] = array( - 'url' => $rr['iid'], - 'pagetitle' => $rr['sid'], - 'title' => $rr['title'], - 'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']), - 'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']), - 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]' + 'url' => $rr['iid'], + 'pagetitle' => $rr['sid'], + 'title' => $rr['title'], + 'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']), + 'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']), + 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]' ); } } -- cgit v1.2.3 From 90d3a6c02dd12317c72ad790a1b6810f885f638c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Apr 2015 11:15:04 +0200 Subject: make rpost respect default post permissions --- mod/rpost.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/rpost.php b/mod/rpost.php index 10ae6b8ab..1bde121e4 100644 --- a/mod/rpost.php +++ b/mod/rpost.php @@ -94,6 +94,13 @@ function rpost_content(&$a) { $channel = $a->get_channel(); + $channel_acl = array( + 'allow_cid' => $channel['channel_allow_cid'], + 'allow_gid' => $channel['channel_allow_gid'], + 'deny_cid' => $channel['channel_deny_cid'], + 'deny_gid' => $channel['channel_deny_gid'] + ); + $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit post') )); @@ -111,7 +118,7 @@ function rpost_content(&$a) { 'nickname' => $channel['channel_address'], 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), - 'acl' => populate_acl($channel), + 'acl' => populate_acl($channel_acl), 'bang' => '', 'visitor' => true, 'profile_uid' => local_channel(), -- cgit v1.2.3 From 9addc4581edf594996151eaf514927d271f04da5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Apr 2015 23:26:11 +0200 Subject: provide a separate input field for rpost attachments --- mod/item.php | 2 +- mod/rpost.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/item.php b/mod/item.php index 53064132c..d80241f2d 100644 --- a/mod/item.php +++ b/mod/item.php @@ -22,7 +22,6 @@ require_once('include/attach.php'); function item_post(&$a) { - // This will change. Figure out who the observer is and whether or not // they have permission to post here. Else ignore the post. @@ -399,6 +398,7 @@ function item_post(&$a) { $verb = notags(trim($_REQUEST['verb'])); $title = escape_tags(trim($_REQUEST['title'])); $body = trim($_REQUEST['body']); + $body .= trim($_REQUEST['attachment']); $postopts = ''; $private = ( diff --git a/mod/rpost.php b/mod/rpost.php index 1bde121e4..737d705f6 100644 --- a/mod/rpost.php +++ b/mod/rpost.php @@ -124,6 +124,7 @@ function rpost_content(&$a) { 'profile_uid' => local_channel(), 'title' => $_REQUEST['title'], 'body' => $_REQUEST['body'], + 'attachment' => $_REQUEST['attachment'], 'source' => ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : ''), 'return_path' => 'rpost/return' ); -- cgit v1.2.3 From 10cc643f650b5ff0954ff988fbf768ea5e061571 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 16 Apr 2015 23:46:12 +0200 Subject: wording and css fixes --- mod/filestorage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/filestorage.php b/mod/filestorage.php index 0421641e2..8b52c086b 100644 --- a/mod/filestorage.php +++ b/mod/filestorage.php @@ -154,7 +154,7 @@ function filestorage_content(&$a) { '$cpdesc' => t('Copy/paste this code to attach file to a post'), '$cpldesc' => t('Copy/paste this URL to link file from a web page'), '$submit' => t('Submit'), - '$attach_btn_title' => t('Attach this file to a new post'), + '$attach_btn_title' => t('Share this file'), '$link_btn_title' => t('Show URL to this file'), '$notify' => array('notify', t('Notify your contacts about this file'), 0, '', array(t('No'), t('Yes'))) )); -- cgit v1.2.3