From c6a75f407db0ab68a562442483b0f6402e34c0da Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 24 Apr 2015 11:36:49 +0200 Subject: webpages layout fixes --- mod/layouts.php | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'mod/layouts.php') diff --git a/mod/layouts.php b/mod/layouts.php index 04d81f91e..e0021c35d 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -88,6 +88,9 @@ function layouts_content(&$a) { return; } + //This feature is not exposed in redbasic ui since it is not clear why one would want to + //download a json encoded pdl file - we dont have a possibility to import it. + //Use the buildin share/install feature instead. if((argc() > 3) && (argv(2) === 'share') && (argv(3))) { $r = q("select sid, service, mimetype, title, body from item_id left join item on item.id = item_id.iid @@ -103,18 +106,6 @@ function layouts_content(&$a) { } } - $tabs = array( - array( - 'label' => t('Layout Help'), - 'url' => 'help/Comanche', - 'sel' => '', - 'title' => t('Help with this feature'), - 'id' => 'layout-help-tab', - )); - - //$o .= replace_macros(get_markup_template('common_tabs.tpl'),array('$tabs' => $tabs)); - - // 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 owners. // This lets you post pages at other people's channels. @@ -123,8 +114,6 @@ function layouts_content(&$a) { 'webpage' => ITEM_PDL, 'is_owner' => true, 'nickname' => $a->profile['channel_address'], - //do we need that at this place? - //'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), 'bang' => '', 'showacl' => false, 'visitor' => false, @@ -141,11 +130,10 @@ function layouts_content(&$a) { if($_REQUEST['pagetitle']) $x['pagetitle'] = $_REQUEST['pagetitle']; - $editor = status_editor($a,$x); - $r = q("select iid, sid, mid from item_id left join item on item.id = item_id.iid - where item_id.uid = %d and service = 'PDL' order by sid asc", + $r = q("select iid, sid, mid, body, created, edited from item_id left join item on item_id.iid = item.id + where item_id.uid = %d and service = 'PDL' order by item.created desc", intval($owner) ); @@ -154,10 +142,22 @@ function layouts_content(&$a) { if($r) { $pages = array(); foreach($r as $rr) { + $element_arr = array( + 'type' => 'block', + 'body' => $rr['body'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'mimetype' => $rr['mimetype'], + 'pagetitle' => $rr['sid'], + 'mid' => $rr['mid'] + ); $pages[$rr['iid']][] = array( 'url' => $rr['iid'], 'title' => $rr['sid'], - 'mid' => $rr['mid'] + 'mid' => $rr['mid'], + 'created' => $rr['created'], + 'edited' => $rr['edited'], + 'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]' ); } } @@ -171,8 +171,12 @@ function layouts_content(&$a) { '$help' => array('text' => t('Help'), 'url' => 'help/Comanche', 'title' => t('Comanche page description language help')), '$editor' => $editor, '$baseurl' => $url, + '$name' => t('Layout Name'), + '$created' => t('Created'), + '$edited' => t('Edited'), '$edit' => t('Edit'), '$share' => t('Share'), + '$download' => t('Download PDL file'), '$pages' => $pages, '$channel' => $which, '$view' => t('View'), -- cgit v1.2.3 From 9894a7b2d05a2300255814e1e77a96bf6ac2058a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 24 Apr 2015 12:37:13 +0200 Subject: copy/paste typo --- mod/layouts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/layouts.php') diff --git a/mod/layouts.php b/mod/layouts.php index e0021c35d..f11554364 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -143,7 +143,7 @@ function layouts_content(&$a) { $pages = array(); foreach($r as $rr) { $element_arr = array( - 'type' => 'block', + 'type' => 'layout', 'body' => $rr['body'], 'created' => $rr['created'], 'edited' => $rr['edited'], -- cgit v1.2.3 From 2583cab469561cc910001196fbbbbafc5c1920ef Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 24 Apr 2015 14:14:33 +0200 Subject: add title to element array --- mod/layouts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod/layouts.php') diff --git a/mod/layouts.php b/mod/layouts.php index f11554364..57300777a 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -132,7 +132,7 @@ function layouts_content(&$a) { $editor = status_editor($a,$x); - $r = q("select iid, sid, mid, body, created, edited from item_id left join item on item_id.iid = item.id + $r = q("select iid, sid, mid, title, body, mimetype, created, edited from item_id left join item on item_id.iid = item.id where item_id.uid = %d and service = 'PDL' order by item.created desc", intval($owner) ); @@ -144,6 +144,7 @@ function layouts_content(&$a) { foreach($r as $rr) { $element_arr = array( 'type' => 'layout', + 'title' => $rr['title'], 'body' => $rr['body'], 'created' => $rr['created'], 'edited' => $rr['edited'], -- cgit v1.2.3 From 31b5b06e42415ffaf98ca09ca8641ae64e67280f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 25 Apr 2015 22:35:24 +0200 Subject: Provide webpage layout description --- mod/layouts.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mod/layouts.php') diff --git a/mod/layouts.php b/mod/layouts.php index 57300777a..b1e4cd345 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -120,7 +120,8 @@ function layouts_content(&$a) { 'nopreview' => 1, 'ptlabel' => t('Layout Name'), 'profile_uid' => intval($owner), - 'expanded' => true + 'expanded' => true, + 'placeholdertitle' => t('Layout Description') ); if($_REQUEST['title']) @@ -154,7 +155,8 @@ function layouts_content(&$a) { ); $pages[$rr['iid']][] = array( 'url' => $rr['iid'], - 'title' => $rr['sid'], + 'title' => $rr['sid'], + 'descr' => $rr['title'], 'mid' => $rr['mid'], 'created' => $rr['created'], 'edited' => $rr['edited'], @@ -173,6 +175,7 @@ function layouts_content(&$a) { '$editor' => $editor, '$baseurl' => $url, '$name' => t('Layout Name'), + '$descr' => t('Layout Description'), '$created' => t('Created'), '$edited' => t('Edited'), '$edit' => t('Edit'), -- cgit v1.2.3 From f987fc3e6fcd4cda0bfe2a92d7b4b04e79159e89 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 29 Apr 2015 16:33:03 +0200 Subject: adjust placeholder naming --- mod/layouts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/layouts.php') diff --git a/mod/layouts.php b/mod/layouts.php index b1e4cd345..1d33ba845 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -121,7 +121,7 @@ function layouts_content(&$a) { 'ptlabel' => t('Layout Name'), 'profile_uid' => intval($owner), 'expanded' => true, - 'placeholdertitle' => t('Layout Description') + 'placeholdertitle' => t('Layout Description (Optional)') ); if($_REQUEST['title']) -- cgit v1.2.3 From 310d1229010c14487eaeaa70541f9bf96c60627a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 29 Apr 2015 21:36:53 +0200 Subject: disable voting in blocks, layouts and webpages --- mod/layouts.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod/layouts.php') diff --git a/mod/layouts.php b/mod/layouts.php index 1d33ba845..2e45362ba 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -121,7 +121,8 @@ function layouts_content(&$a) { 'ptlabel' => t('Layout Name'), 'profile_uid' => intval($owner), 'expanded' => true, - 'placeholdertitle' => t('Layout Description (Optional)') + 'placeholdertitle' => t('Layout Description (Optional)'), + 'novoting' => true ); if($_REQUEST['title']) -- cgit v1.2.3