This isn't optimal, but on the short term we'll clone the page editor to use as a block editor, and probably a layout editor as well. Eventually, these should all probably just be switches onto a single editor instance. Decided to put the layout_mid into the item table directory rather than re-use resource_id, so that we can still have pages attached to different resources like photos and events and stuff. The block editor is far from finished, at this point I've only cloned it and changed the name and type of item it looks for.

This commit is contained in:
friendica
2013-09-01 17:07:55 -07:00
parent 00622779f3
commit de3345f5f3
7 changed files with 248 additions and 7 deletions

View File

@@ -495,6 +495,9 @@ function item_post(&$a) {
if($buildblock)
$item_restrict = $item_restrict | ITEM_BUILDBLOCK;
if($pdl)
$item_restrict = $item_restrict | ITEM_PDL;
if(! strlen($verb))
@@ -764,7 +767,16 @@ function item_post(&$a) {
intval($parent)
);
if($webpage) {
$page_type = '';
if($webpage)
$page_type = 'WEBPAGE';
elseif($buildblock)
$page_type = 'BUILDBLOCK';
elseif($ptemplate)
$page_type = 'PDL';
if($page_type) {
// store page info as an alternate message_id so we can access it via
// https://sitename/page/$channelname/$pagetitle
@@ -773,11 +785,12 @@ function item_post(&$a) {
// as the entire mid. If it were the post_id the link would be less portable.
// We should have the ability to edit this and arrange pages into menus via the pages module
q("insert into item_id ( iid, uid, sid, service ) values ( %d, %d, '%s','%s' )",
intval($post_id),
intval($channel['channel_id']),
dbesc(($pagetitle) ? $pagetitle : substr($mid,0,16)),
dbesc('WEBPAGE')
dbesc($page_type)
);
}