Esempio n. 1
0
function plugin_guiedit_preview()
{
    global $vars;
    // global $_title_preview, $_msg_preview, $_msg_preview_delete;
    global $note_hr, $foot_explain;
    global $guiedit_use_fck;
    //FIXME
    $_msg_preview = _('To confirm the changes, click the button at the bottom of the page');
    $_msg_preview_delete = _('(The contents of the page are empty. Updating deletes this page.)');
    if ($guiedit_use_fck) {
        $postdata = Xhtml2WikiFactory::factory($vars['msg']);
    }
    if ($postdata) {
        $postdata = make_str_rules($postdata);
        $postdata = explode("\n", $postdata);
        $postdata = drop_submit(RendererFactory::factory($postdata, true));
    }
    //	テキスト編集の場合
    if (!$guiedit_use_fck) {
        $body = $_msg_preview . '<br />' . "\n";
        if ($postdata == '') {
            $body .= '<strong>' . $_msg_preview_delete . '</strong><br />' . "\n";
        } else {
            $body .= '<br />' . "\n";
            $body .= '<div id="preview">' . $postdata . '</div>' . "\n";
        }
        $body .= plugin_guiedit_edit_form($vars['page'], $vars['msg'], $vars['digest'], FALSE);
        return array('msg' => $_title['preview'], 'body' => $body);
    }
    //	注釈
    ksort($foot_explain, SORT_NUMERIC);
    $postdata .= !empty($foot_explain) ? $note_hr . join("\n", $foot_explain) : '';
    //	通常の編集フォーム
    if (DEBUG) {
        $postdata .= '<hr />' . Utility::editForm($vars['page'], $vars['msg']);
    }
    plugin_guiedit_send_ajax($postdata);
}
Esempio n. 2
0
function plugin_guiedit_preview()
{
    global $vars;
    // global $_title_preview, $_msg_preview, $_msg_preview_delete;
    global $note_hr, $foot_explain;
    global $guiedit_use_fck;
    //FIXME
    $_msg_preview = _('To confirm the changes, click the button at the bottom of the page');
    $_msg_preview_delete = _('(The contents of the page are empty. Updating deletes this page.)');
    if ($guiedit_use_fck) {
        //	構文の変換
        require_once GUIEDIT_LIB_PATH . 'xhtml2wiki.php';
        // $source = $vars['msg'];
        $vars['msg'] = xhtml2wiki($vars['msg']);
    }
    $postdata = $vars['msg'];
    if ($postdata) {
        $postdata = make_str_rules($postdata);
        $postdata = explode("\n", $postdata);
        $postdata = drop_submit(convert_html($postdata));
    }
    //	テキスト編集の場合
    if (!$guiedit_use_fck) {
        $body = $_msg_preview . '<br />' . "\n";
        if ($postdata == '') {
            $body .= '<strong>' . $_msg_preview_delete . '</strong><br />' . "\n";
        } else {
            $body .= '<br />' . "\n";
            $body .= '<div id="preview">' . $postdata . '</div>' . "\n";
        }
        $body .= plugin_guiedit_edit_form($vars['page'], $vars['msg'], $vars['digest'], FALSE);
        return array('msg' => $_title['preview'], 'body' => $body);
    }
    //	注釈
    ksort($foot_explain, SORT_NUMERIC);
    $postdata .= !empty($foot_explain) ? $note_hr . join("\n", $foot_explain) : '';
    //	通常の編集フォーム
    if (GUIEDIT_DEBUG) {
        global $hr;
        $postdata .= $hr . edit_form($vars['page'], $vars['msg']);
    }
    plugin_guiedit_send_xml($postdata);
}