diff --git a/include/conversation.php b/include/conversation.php index 43de9fc8d..45a744dd8 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1023,7 +1023,18 @@ function status_editor($a,$x,$popup=false) { else $mimeselect = ''; } + + $layoutselect = ''; + if(array_key_exists('layout',$x) && $x['layout']) { + if($x['layout'] === 'choose') { + $layoutselect = layout_select($x['profile_uid']); + } + else + $layoutselect = ''; + } + + $webpage = ((x($x,'webpage')) ? $x['webpage'] : ''); $tpl = get_markup_template('jot-header.tpl'); @@ -1094,6 +1105,7 @@ function status_editor($a,$x,$popup=false) { '$lockstate' => $x['lockstate'], '$acl' => $x['acl'], '$mimeselect' => $mimeselect, + '$layoutselect' => $layoutselect, '$showacl' => ((array_key_exists('showacl',$x)) ? $x['showacl'] : 'yes'), '$bang' => $x['bang'], '$profile_uid' => $x['profile_uid'], diff --git a/include/text.php b/include/text.php index bbd538f15..004efc08d 100755 --- a/include/text.php +++ b/include/text.php @@ -1321,6 +1321,29 @@ function unamp($s) { return str_replace('&', '&', $s); } +function layout_select($channel_id, $current = '') { + $r = q("select mid,sid from item left join item_id on iid = item.id where service = 'PDL' and item.uid = item_id.uid and item_id.uid = %d and (item_restrict & %d)", + intval($channel_id), + intval(ITEM_PDL) + ); + if($r) { + $o = t('Select a page layout: '); + $o .= ''; + } + + return $o; +} + + + + function mimetype_select($channel_id, $current = 'text/bbcode') { 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); diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index e67caf3d2..9a93e5291 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -11,6 +11,7 @@ {{$mimeselect}} + {{$layoutselect}}
{{if $catsenabled}}