From cbab62c95efdd3ab306736a430698313b6b2a320 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 1 Sep 2013 18:22:31 -0700 Subject: add layouts and editlayout and rework the page logic in mod/item --- 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 fb133eccf..f3e1cd2f7 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -45,7 +45,7 @@ function webpages_content(&$a) { // Nickname is set to the observers xchan, and profile_uid to the owners. This lets you post pages at other people's channels. require_once ('include/conversation.php'); $x = array( - 'webpage' => 1, + 'webpage' => ITEM_WEBPAGE, 'is_owner' => true, 'nickname' => $a->profile['channel_address'], 'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), -- cgit v1.2.3 From 8b7757e033c4483da24700722c186057bb431164 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 01:38:17 -0700 Subject: webpage content-type -- needs cleaning up and a security check once all the important bits are in place. --- mod/webpages.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index f3e1cd2f7..081297eb9 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -52,10 +52,13 @@ require_once ('include/conversation.php'); 'bang' => (($group || $cid) ? '!' : ''), 'visitor' => 'block', 'profile_uid' => intval($owner), + 'plaintext' => 1, + 'mimeselect' => 1, ); $o .= 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. //TODO - this should be replaced with pagelist_widget -- cgit v1.2.3 From f44274bfca6137795ee878a076d5aeed0b330f64 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 13:31:59 -0700 Subject: allow a channel owner to define a default mimetype on webpages (otherwise default to "choose") - also fix the selector w/r/t php code. There is no ui for setting either at the moment, but for instance with wiki pages we probably don't want to have multiple choice of the mimetype. Keep it simple. --- 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 081297eb9..559b176fc 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -41,6 +41,10 @@ function webpages_content(&$a) { return; } + $mimetype = get_config('system','page_mimetype'); + if(! $mimetype) + $mimetype = '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 owners. This lets you post pages at other people's channels. require_once ('include/conversation.php'); @@ -52,8 +56,7 @@ require_once ('include/conversation.php'); 'bang' => (($group || $cid) ? '!' : ''), 'visitor' => 'block', 'profile_uid' => intval($owner), - 'plaintext' => 1, - 'mimeselect' => 1, + 'mimetype' => $mimetype, ); $o .= status_editor($a,$x); -- cgit v1.2.3 From 615bf237330519f0d21fccfe6a8f69b5bb4c0f69 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 2 Sep 2013 20:25:33 -0700 Subject: add a layout selector --- mod/webpages.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index 559b176fc..d87bd4a86 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -45,6 +45,11 @@ function webpages_content(&$a) { if(! $mimetype) $mimetype = 'choose'; + $layout = get_config('system','page_layout'); + 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 owners. This lets you post pages at other people's channels. require_once ('include/conversation.php'); @@ -57,6 +62,7 @@ require_once ('include/conversation.php'); 'visitor' => 'block', 'profile_uid' => intval($owner), 'mimetype' => $mimetype, + 'layout' => $layout, ); $o .= status_editor($a,$x); -- cgit v1.2.3 From ab1c9dc9c9ecc1f382b6c7512b014c11f08b6e5e Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 3 Sep 2013 19:55:26 -0700 Subject: add design tool menu to appropriate pages --- mod/webpages.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mod/webpages.php') diff --git a/mod/webpages.php b/mod/webpages.php index d87bd4a86..04c2e07c5 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -41,6 +41,11 @@ function webpages_content(&$a) { return; } + if(local_user() && local_user() == $owner) { + $a->set_widget('design',design_tools()); + } + + $mimetype = get_config('system','page_mimetype'); if(! $mimetype) $mimetype = 'choose'; -- cgit v1.2.3