ajax.php
changeset 1112 679916c80599
parent 1108 c1be67a50d81
child 1161 9c0c519066ac
equal deleted inserted replaced
1111:8fae8fb3cbb1 1112:679916c80599
    58       {
    58       {
    59         $allowed = false;
    59         $allowed = false;
    60         $src = '';
    60         $src = '';
    61       }
    61       }
    62       
    62       
    63       $auth_edit = ( $session->get_permissions('edit_page') && ( $session->get_permissions('even_when_protected') || !$paths->page_protected ) );
    63       $auth_edit = ( $session->get_permissions('edit_page') && ( $session->get_permissions('even_when_protected') || !$page->ns->page_protected ) );
    64       $auth_wysiwyg = ( $session->get_permissions('edit_wysiwyg') );
    64       $auth_wysiwyg = ( $session->get_permissions('edit_wysiwyg') );
    65       
    65       
    66       $return = array(
    66       $return = array(
    67           'mode' => 'editor',
    67           'mode' => 'editor',
    68           'src' => $src,
    68           'src' => $src,
    73           'allow_wysiwyg' => $auth_wysiwyg,
    73           'allow_wysiwyg' => $auth_wysiwyg,
    74           'revid' => $revid,
    74           'revid' => $revid,
    75           'have_draft' => false
    75           'have_draft' => false
    76         );
    76         );
    77       
    77       
    78       $return['page_format'] = $paths->cpage['page_format'];
    78       $return['page_format'] = $page->ns->cdata['page_format'];
    79       if ( $return['page_format'] == 'xhtml' )
    79       if ( $return['page_format'] == 'xhtml' )
    80       {
    80       {
    81         // gently process headings to make tinymce format them correctly
    81         // gently process headings to make tinymce format them correctly
    82         if ( preg_match_all('/^ *?(={1,6}) *(.+?) *\\1 *$/m', $return['src'], $matches) )
    82         if ( preg_match_all('/^ *?(={1,6}) *(.+?) *\\1 *$/m', $return['src'], $matches) )
    83         {
    83         {
   489         break;
   489         break;
   490       }
   490       }
   491       switch($_GET['to'])
   491       switch($_GET['to'])
   492       {
   492       {
   493         case 'xhtml':
   493         case 'xhtml':
   494           $result = RenderMan::render($_POST['text'], RENDER_WIKI_DEFAULT | RENDER_BLOCKONLY);
   494           $result = RenderMan::render($_POST['text'], RENDER_BLOCK | RENDER_NOSMILIES, false);
   495           break;
   495           break;
   496         case 'wikitext':
   496         case 'wikitext':
   497           $result = RenderMan::reverse_render($_POST['text']);
   497           $result = RenderMan::reverse_render($_POST['text']);
   498           break;
   498           break;
   499         default:
   499         default: