make blocks, webpages, and layouts postable (pre-filled forms if supplied from elsewhere). The only serious issue is with ordering - you have to process and save a named layout before you can save a webpage that uses that layout name. Otherwise it will get unset during the save.

This commit is contained in:
friendica 2014-08-28 01:08:42 -07:00
parent a4f734e37c
commit ed4896def1
4 changed files with 31 additions and 10 deletions

View File

@ -45,14 +45,10 @@ function blocks_content(&$a) {
return; return;
} }
// if(local_user() && local_user() == $owner) {
// $a->set_widget('design',design_tools());
// }
// Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages // 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. // 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'); require_once ('include/conversation.php');
$x = array( $x = array(
'webpage' => ITEM_BUILDBLOCK, 'webpage' => ITEM_BUILDBLOCK,
@ -67,6 +63,15 @@ require_once ('include/conversation.php');
'profile_uid' => intval($owner), 'profile_uid' => intval($owner),
); );
if($_REQUEST['title'])
$x['title'] = $_REQUEST['title'];
if($_REQUEST['body'])
$x['body'] = $_REQUEST['body'];
if($_REQUEST['pagetitle'])
$x['pagetitle'] = $_REQUEST['pagetitle'];
$o .= status_editor($a,$x); $o .= status_editor($a,$x);
//Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link. //Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link.

View File

@ -68,7 +68,8 @@ function layouts_content(&$a) {
// Create a status editor (for now - we'll need a WYSIWYG eventually) to create pages // 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. // 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'); require_once ('include/conversation.php');
@ -85,6 +86,14 @@ function layouts_content(&$a) {
'profile_uid' => intval($owner), 'profile_uid' => intval($owner),
); );
if($_REQUEST['title'])
$x['title'] = $_REQUEST['title'];
if($_REQUEST['body'])
$x['body'] = $_REQUEST['body'];
if($_REQUEST['pagetitle'])
$x['pagetitle'] = $_REQUEST['pagetitle'];
$o .= status_editor($a,$x); $o .= status_editor($a,$x);
// Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link. // Get a list of blocks. We can't display all them because endless scroll makes that unusable, so just list titles and an edit link.

View File

@ -46,11 +46,11 @@ function webpages_content(&$a) {
// } // }
$mimetype = get_config('system','page_mimetype'); $mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_config('system','page_mimetype'));
if(! $mimetype) if(! $mimetype)
$mimetype = 'choose'; $mimetype = 'choose';
$layout = get_config('system','page_layout'); $layout = (($_REQUEST['layout']) ? $_REQUEST['layout'] : get_config('system','page_layout'));
if(! $layout) if(! $layout)
$layout = 'choose'; $layout = 'choose';
@ -91,6 +91,13 @@ function webpages_content(&$a) {
'layout' => $layout, 'layout' => $layout,
); );
if($_REQUEST['title'])
$x['title'] = $_REQUEST['title'];
if($_REQUEST['body'])
$x['body'] = $_REQUEST['body'];
if($_REQUEST['pagetitle'])
$x['pagetitle'] = $_REQUEST['pagetitle'];
$o .= status_editor($a,$x); $o .= status_editor($a,$x);

View File

@ -1 +1 @@
2014-08-27.780 2014-08-28.781