mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:55:19 +00:00
allow pdl content
This commit is contained in:
parent
22a650ade8
commit
888bf76e4b
4 changed files with 23 additions and 1 deletions
5
boot.php
5
boot.php
|
@ -2056,6 +2056,10 @@ function construct_page(&$a) {
|
|||
|
||||
$a->build_pagehead();
|
||||
|
||||
if($a->page['pdl_content']) {
|
||||
$a->page['content'] = comanche_region($a,$a->page['content']);
|
||||
}
|
||||
|
||||
// Let's say we have a comanche declaration '[region=nav][/region][region=content]$nav $content[/region]'.
|
||||
// The text 'region=' identifies a section of the layout by that name. So what we want to do here is leave
|
||||
// $a->page['nav'] empty and put the default content from $a->page['nav'] and $a->page['section']
|
||||
|
@ -2070,6 +2074,7 @@ function construct_page(&$a) {
|
|||
call_hooks('construct_page', $arr);
|
||||
$a->layout = $arr['layout'];
|
||||
|
||||
|
||||
foreach($a->layout as $k => $v) {
|
||||
if((strpos($k, 'region_') === 0) && strlen($v)) {
|
||||
if(strpos($v, '$region_') !== false) {
|
||||
|
|
|
@ -1089,6 +1089,11 @@ function format_like($cnt, $arr, $type, $id) {
|
|||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is our general purpose content editor.
|
||||
* It was once nicknamed "jot" and you may see references to "jot" littered throughout the code.
|
||||
* They are referring to the content editor or components thereof.
|
||||
*/
|
||||
|
||||
function status_editor($a, $x, $popup = false) {
|
||||
|
||||
|
|
|
@ -94,6 +94,8 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') {
|
|||
return escape_tags($s);
|
||||
if($type == 'text/plain')
|
||||
return escape_tags($s);
|
||||
if($type == 'application/x-pdl')
|
||||
return escape_tags($s);
|
||||
|
||||
$a = get_app();
|
||||
if($a->is_sys) {
|
||||
|
@ -1517,6 +1519,11 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) {
|
|||
$s = Markdown($text);
|
||||
break;
|
||||
|
||||
|
||||
case 'application/x-pdl';
|
||||
$s = escape_tags($text);
|
||||
break;
|
||||
|
||||
// No security checking is done here at display time - so we need to verify
|
||||
// that the author is allowed to use PHP before storing. We also cannot allow
|
||||
// importation of PHP text bodies from other sites. Therefore this content
|
||||
|
@ -1681,7 +1688,8 @@ function mimetype_select($channel_id, $current = 'text/bbcode') {
|
|||
'text/bbcode',
|
||||
'text/html',
|
||||
'text/markdown',
|
||||
'text/plain'
|
||||
'text/plain',
|
||||
'application/x-pdl'
|
||||
);
|
||||
|
||||
$a = get_app();
|
||||
|
|
|
@ -131,6 +131,10 @@ function page_content(&$a) {
|
|||
|
||||
xchan_query($r);
|
||||
$r = fetch_post_tags($r,true);
|
||||
|
||||
if($r[0]['mimetype'] === 'application/x-pdl')
|
||||
$a->page['pdl_content'] = true;
|
||||
|
||||
$o .= prepare_page($r[0]);
|
||||
return $o;
|
||||
|
||||
|
|
Loading…
Reference in a new issue