From 754ac2cff72b0d9d5d9b389740cc8946ed1e40b2 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Mon, 6 Apr 2015 23:51:30 +0200 Subject: Fix Design Tool navigation for sys channel. Fix creating menu for sys channel. --- mod/webpages.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index 6aff72a5e..a2a0ebf7b 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -71,7 +71,7 @@ function webpages_content(&$a) { if(feature_enabled($owner,'expert')) { $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); if(! $mimetype) - $mimetype = 'choose'; + $mimetype = 'choose'; } else { $mimetype = 'text/bbcode'; @@ -129,7 +129,7 @@ function webpages_content(&$a) { // 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. - //TODO - this should be replaced with pagelist_widget + /** @TODO - this should be replaced with pagelist_widget */ $r = q("select * from item_id left join item on item_id.iid = item.id where item_id.uid = %d and service = 'WEBPAGE' order by item.created desc", @@ -157,7 +157,7 @@ function webpages_content(&$a) { $url = z_root() . '/editwebpage/' . $which; $o .= replace_macros(get_markup_template('webpagelist.tpl'), array( - '$listtitle' => t('Webpages'), + '$listtitle' => t('Webpages'), '$baseurl' => $url, '$edit' => t('Edit'), '$pages' => $pages, @@ -169,9 +169,7 @@ function webpages_content(&$a) { '$title_txt' => t('Title'), '$created_txt' => t('Created'), '$edited_txt' => t('Edited') - )); return $o; - } -- cgit v1.2.3 From 7bec4b313a7a553e6df3e24289cf894f3d70a94e Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 8 Apr 2015 23:05:36 -0700 Subject: system channel always has allow_code privileges --- mod/webpages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index a2a0ebf7b..c5fdda89b 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -68,7 +68,7 @@ function webpages_content(&$a) { return; } - if(feature_enabled($owner,'expert')) { + if(feature_enabled($owner,'expert') || $a->is_sys) { $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); if(! $mimetype) $mimetype = 'choose'; -- cgit v1.2.3 From 2619b60721c328aacbf7bd30d47476a68ce9b203 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 9 Apr 2015 15:45:08 -0700 Subject: make sure we redirect to a sane place after deleting a webpage element --- mod/webpages.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index c5fdda89b..a9cf61dd1 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -32,6 +32,8 @@ function webpages_content(&$a) { } $which = argv(1); + + $_SESSION['return_url'] = $a->query_string; $uid = local_channel(); $owner = 0; -- cgit v1.2.3 From 865b602cf8b4eff5e7da00362df95e52e2fe4f77 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 13 Apr 2015 23:38:36 +0200 Subject: webpages appearence --- mod/webpages.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index a9cf61dd1..b4c4e6e4e 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -127,7 +127,7 @@ function webpages_content(&$a) { if($_REQUEST['pagetitle']) $x['pagetitle'] = $_REQUEST['pagetitle']; - $o .= 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. @@ -161,14 +161,17 @@ function webpages_content(&$a) { $o .= replace_macros(get_markup_template('webpagelist.tpl'), array( '$listtitle' => t('Webpages'), '$baseurl' => $url, + '$create' => t('Create'), '$edit' => t('Edit'), + '$delete' => t('Delete'), '$pages' => $pages, '$channel' => $which, + '$editor' => $editor, '$view' => t('View'), '$preview' => t('Preview'), '$actions_txt' => t('Actions'), '$pagelink_txt' => t('Page Link'), - '$title_txt' => t('Title'), + '$title_txt' => t('Page Title'), '$created_txt' => t('Created'), '$edited_txt' => t('Edited') )); -- 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/webpages.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index b4c4e6e4e..2b284813a 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -70,10 +70,10 @@ function webpages_content(&$a) { return; } - if(feature_enabled($owner,'expert') || $a->is_sys) { - $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); - if(! $mimetype) - $mimetype = 'choose'; + $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype')); + + if(! $mimetype) { + $mimetype = 'choose'; } else { $mimetype = 'text/bbcode'; -- cgit v1.2.3 From 953819e7da8152f959f04c733ce617cc34cf8c7d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 14 Apr 2015 12:52:31 +0200 Subject: css fixes and remove expert mode for block page content type --- mod/webpages.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index 2b284813a..e2b5eb3a4 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -75,9 +75,6 @@ function webpages_content(&$a) { if(! $mimetype) { $mimetype = 'choose'; } - else { - $mimetype = 'text/bbcode'; - } $layout = (($_REQUEST['layout']) ? $_REQUEST['layout'] : get_pconfig($owner,'system','page_layout')); if(! $layout) -- 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/webpages.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'mod/webpages.php') 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/webpages.php') 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 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/webpages.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index 5013d803a..b303b8652 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -115,6 +115,7 @@ function webpages_content(&$a) { 'profile_uid' => intval($owner), 'mimetype' => $mimetype, 'layout' => $layout, + 'expanded' => true ); if($_REQUEST['title']) -- cgit v1.2.3 From e58e8f3f75ce2119698fb59bda55a5fbea9dda2a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 21 Apr 2015 23:08:54 +0200 Subject: bring lockstate to webpages --- mod/webpages.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index b303b8652..615969d78 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -142,6 +142,9 @@ function webpages_content(&$a) { $pages = array(); foreach($r as $rr) { unobscure($rr); + + $lockstate = (($rr['allow_cid'] || $rr['allow_gid'] || $rr['deny_cid'] || $rr['deny_gid']) ? 'lock' : 'unlock'); + $element_arr = array( 'type' => 'webpage', 'title' => $rr['title'], @@ -159,7 +162,8 @@ function webpages_content(&$a) { '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]' + 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]', + 'lockstate' => $lockstate ); } } -- 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/webpages.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index 615969d78..44b4ee561 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -131,8 +131,10 @@ function webpages_content(&$a) { // so just list titles and an edit link. /** @TODO - this should be replaced with pagelist_widget */ + $sql_extra = item_permissions_sql($owner); + $r = q("select * from item_id left join item on item_id.iid = item.id - where item_id.uid = %d and service = 'WEBPAGE' order by item.created desc", + where item_id.uid = %d and service = 'WEBPAGE' $sql_extra order by item.created desc", intval($owner) ); -- cgit v1.2.3 From dfc88a41df427bbf6b0b2d41105131aee15b09c5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 22 Apr 2015 12:21:33 +0200 Subject: fix webpages profile_tabs --- mod/webpages.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index 44b4ee561..e39e6764b 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -80,13 +80,10 @@ function webpages_content(&$a) { if(! $layout) $layout = 'choose'; - // Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages // Nickname is set to the observers xchan, and profile_uid to the owner's. // This lets you post pages at other people's channels. - - if((! $channel) && ($uid) && ($uid == $a->profile_uid)) { $channel = $a->get_channel(); } @@ -101,8 +98,8 @@ function webpages_content(&$a) { else $channel_acl = array(); - - $o = profile_tabs($a,true); + $_is_owner = (local_channel() && (local_channel() == $owner)); + $o = profile_tabs($a,$_is_owner, $a->profile['channel_address']); $x = array( 'webpage' => ITEM_WEBPAGE, -- cgit v1.2.3 From 29061b3ee3bddcc4718e05a421435b875e97c29e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 22 Apr 2015 12:31:30 +0200 Subject: do not show acl button if not owner --- mod/webpages.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index e39e6764b..121971b12 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -98,8 +98,8 @@ function webpages_content(&$a) { else $channel_acl = array(); - $_is_owner = (local_channel() && (local_channel() == $owner)); - $o = profile_tabs($a,$_is_owner, $a->profile['channel_address']); + $is_owner = ($uid && $uid == $owner); + $o = profile_tabs($a, $is_owner, $a->profile['channel_address']); $x = array( 'webpage' => ITEM_WEBPAGE, @@ -107,7 +107,8 @@ function webpages_content(&$a) { 'nickname' => $a->profile['channel_address'], 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'bang' => '', - 'acl' => (($uid && $uid == $owner) ? populate_acl($channel_acl,false) : ''), + 'acl' => (($is_owner) ? populate_acl($channel_acl,false) : ''), + 'showacl' => (($is_owner) ? true : false), 'visitor' => true, 'profile_uid' => intval($owner), 'mimetype' => $mimetype, -- cgit v1.2.3