From b3a9a6c802170a15cc58fd3af966b35f81c50818 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 11 Mar 2015 18:56:28 -0700 Subject: remove the now redundant audio/video buttons and label the editor text style buttons which didn't have them. Unused editor buttons were commented in case we need to bring them back. If things go smoothly we can remove them. Use the link icon going forward - for all links. --- mod/editwebpage.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mod/editwebpage.php') diff --git a/mod/editwebpage.php b/mod/editwebpage.php index c07efc7ee..3e0bd9ff4 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -172,6 +172,11 @@ function editwebpage_content(&$a) { '$action' => 'item', '$share' => t('Edit'), + '$bold' => t('Bold'), + '$italic' => t('Italic'), + '$underline' => t('Underline'), + '$quote' => t('Quote'), + '$code' => t('Code'), '$upload' => t('Upload photo'), '$attach' => t('Attach file'), '$weblink' => t('Insert web link'), -- cgit v1.2.3 From d3c064cc345ac66a0c3ce2c79d566740b090be8c Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 30 Mar 2015 19:41:42 -0700 Subject: title of preview button incorrect, fix ability to upload to webpages --- mod/editwebpage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod/editwebpage.php') diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 3e0bd9ff4..e81cde479 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -164,11 +164,13 @@ function editwebpage_content(&$a) { $rp = 'webpages/' . $which; +logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage'))); $o .= replace_macros($tpl,array( '$return_path' => $rp, '$webpage' => ITEM_WEBPAGE, '$placeholdpagetitle' => t('Page link title'), '$pagetitle' => $page_title, + '$writefiles' => (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage')), '$action' => 'item', '$share' => t('Edit'), @@ -207,7 +209,7 @@ function editwebpage_content(&$a) { 'lockstate' => (((strlen($itm[0]['allow_cid'])) || (strlen($itm[0]['allow_gid'])) || (strlen($itm[0]['deny_cid'])) || (strlen($itm[0]['deny_gid']))) ? 'lock' : 'unlock'), '$bang' => '', '$profile_uid' => (intval($owner)), - '$preview' => true, // ((feature_enabled($uid,'preview')) ? t('Preview') : ''), + '$preview' => t('Preview'), '$jotplugins' => $jotplugins, '$sourceapp' => $a->sourcename, '$defexpire' => '', -- cgit v1.2.3 From bf2a97147ecef7528e9adbed3cf4a1f3af03ad72 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Apr 2015 11:50:21 +0200 Subject: some more on webpages --- mod/editwebpage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/editwebpage.php') diff --git a/mod/editwebpage.php b/mod/editwebpage.php index e81cde479..e30a33171 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -126,7 +126,7 @@ function editwebpage_content(&$a) { $plaintext = true; if(get_config('system','page_mimetype')) - $mimeselect = ''; + $mimeselect = ''; else $mimeselect = mimetype_select($itm[0]['uid'],$mimetype); -- cgit v1.2.3 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 --------------- 1 file changed, 15 deletions(-) (limited to 'mod/editwebpage.php') 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; } -- cgit v1.2.3 From 61e4ee753dd0e823c47a5cf2e485f7f69fb4d125 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 17 Apr 2015 11:20:22 +0200 Subject: allow jot to be displayed expanded, remove deprected datetimepicker js and some random fixes --- mod/editwebpage.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'mod/editwebpage.php') diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 55cd3b4ef..a7564a126 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -135,12 +135,7 @@ function editwebpage_content(&$a) { $layoutselect = ''; else $layoutselect = layout_select($itm[0]['uid'],$itm[0]['layout_mid']); - - $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( - '$title' => t('Edit Webpage') - )); - $a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array( '$baseurl' => $a->get_baseurl(), '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), @@ -150,7 +145,6 @@ function editwebpage_content(&$a) { '$confirmdelete' => t('Delete webpage?') )); - $tpl = get_markup_template("jot.tpl"); $jotplugins = ''; @@ -164,8 +158,9 @@ function editwebpage_content(&$a) { $rp = 'webpages/' . $which; -logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage'))); - $o .= replace_macros($tpl,array( + logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage'))); + + $editor = replace_macros($tpl,array( '$return_path' => $rp, '$webpage' => ITEM_WEBPAGE, '$placeholdpagetitle' => t('Page link title'), @@ -218,8 +213,12 @@ 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') . '
'; + $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( + '$title' => t('Edit Webpage'), + '$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false), + '$editor' => $editor, + '$id' => $itm[0]['id'] + )); return $o; -- cgit v1.2.3 From 9e490d022b985f295a0547c8a115c610a77a3a24 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 22 Apr 2015 12:00:15 +0200 Subject: fix webpage perms --- mod/editwebpage.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mod/editwebpage.php') diff --git a/mod/editwebpage.php b/mod/editwebpage.php index a7564a126..a1918741b 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -90,11 +90,18 @@ function editwebpage_content(&$a) { // We've already figured out which item we want and whose copy we need, // so we don't need anything fancy here - $itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s LIMIT 1", + $sql_extra = item_permissions_sql($owner); + + $itm = q("SELECT * FROM `item` WHERE `id` = %d and uid = %s $sql_extra LIMIT 1", intval($post_id), intval($owner) ); + if(! $itm) { + notice( t('Permission denied.') . EOL); + return; + } + if($itm[0]['item_flags'] & ITEM_OBSCURED) { $key = get_config('system','prvkey'); if($itm[0]['title']) -- cgit v1.2.3