Exemple #1
0
function WysiwygForm($caption, $name, $value, $width = '100%', $height = '400px', $formtype)
{
    global $xoopsModuleConfig;
    $editor = false;
    switch ($formtype) {
        //compact no html
        case "1":
            $editor = new XoopsFormTextArea($caption, $name, $value, 15, 85);
            break;
            //dhtml
        //dhtml
        case "2":
        default:
            $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 15, 85);
            break;
            //htmlarea
        //htmlarea
        case "3":
            if (is_readable(XOOPS_ROOT_PATH . "/class/htmlarea/formhtmlarea.php")) {
                include_once XOOPS_ROOT_PATH . "/class/htmlarea/formhtmlarea.php";
                $editor = new XoopsFormHtmlarea($caption, $name, $value, $width, $height);
                $isWysiwyg = true;
                $dohtml = 1;
            } else {
                $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 15, 85);
            }
            break;
            //koivi
        //koivi
        case "4":
            if (is_readable(XOOPS_ROOT_PATH . "/class/wysiwyg/formwysiwygtextarea.php")) {
                include_once XOOPS_ROOT_PATH . '/class/wysiwyg/formwysiwygtextarea.php';
                $wysiwyg_text_area_01 = new XoopsFormWysiwygTextArea($caption, $name, $value, '100%', '400px', '');
                $wysiwyg_text_area_01->setUrl("/class/wysiwyg");
                $wysiwyg_text_area_01->setSkin("default");
                $editor = $wysiwyg_text_area_01;
                $isWysiwyg = true;
                $dohtml = 1;
            } else {
                $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 15, 85);
            }
            break;
            //tinieditor
        //tinieditor
        case "5":
            if (is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/tinyeditor/formtinyeditortextarea.php")) {
                include_once XOOPS_ROOT_PATH . '/class/xoopseditor/tinyeditor/formtinyeditortextarea.php';
                $editor = new XoopsFormTinyeditorTextArea(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '400px'), false);
                $isWysiwyg = true;
                $dohtml = 1;
            } else {
                $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 15, 85);
            }
            break;
            //inbetween
        //inbetween
        case "6":
            if (is_readable(XOOPS_ROOT_PATH . "/class/xoopseditor/inbetween/forminbetweentextarea.php")) {
                include_once XOOPS_ROOT_PATH . '/class/xoopseditor/inbetween/forminbetweentextarea.php';
                $editor = new XoopsFormInbetweenTextArea(array('caption' => $caption, 'name' => $name, 'value' => $value, 'width' => '100%', 'height' => '400px'), false);
                $isWysiwyg = true;
                $dohtml = 1;
            } else {
                $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 15, 85);
            }
            break;
            //spaw
        //spaw
        case "7":
            if (is_readable(XOOPS_ROOT_PATH . "/class/spaw/formspaw.php")) {
                include_once XOOPS_ROOT_PATH . "/class/spaw/formspaw.php";
                $editor = new XoopsFormSpaw($caption, $name, $value, 15, 85);
                $isWysiwyg = true;
                $dohtml = 1;
            } else {
                $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 15, 85);
            }
            break;
            //FCK
        //FCK
        case "8":
            if (is_readable(XOOPS_ROOT_PATH . "/class/fckeditor/formfckeditor.php")) {
                include_once XOOPS_ROOT_PATH . "/class/fckeditor/formfckeditor.php";
                $editor = new XoopsFormFckeditor($caption, $name, $value, 15, 85);
                $isWysiwyg = true;
                $dohtml = 1;
            } else {
                $editor = new XoopsFormDhtmlTextArea($caption, $name, $value, 15, 85);
            }
            break;
    }
    return $editor;
}
}
if ($use_spaw) {
    include_once "spaw/spaw_control.class.php";
    $trans_tbl = get_html_translation_table(HTML_SPECIALCHARS);
    $trans_tbl = array_flip($trans_tbl);
    $content = strtr($content, $trans_tbl);
    $sw = new SPAW_Wysiwyg('wp_content', $content, _LANGCODE, 'full', 'default', '70%', '400px');
    $spaw_form = $sw->getHtml();
} else {
    if ($use_koivi) {
        include XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
        include_once ABSPATH . "wp-admin/wysiwyg/formwysiwygtextarea.php";
        $trans_tbl = get_html_translation_table(HTML_SPECIALCHARS);
        $trans_tbl = array_flip($trans_tbl);
        $content = strtr($content, $trans_tbl);
        $wysiwyg_text_area = new XoopsFormWysiwygTextArea($caption, 'wp_content', $content, '100%', '400px', '');
        $wysiwyg_text_area->setUrl(ABSBASE . "wp-admin/wysiwyg");
        $spaw_form = $wysiwyg_text_area->render();
    } else {
        $spaw_form = "";
    }
}
$allowed_users = explode(" ", trim(get_settings('fileupload_allowedusers')));
$can_upload = get_settings('use_fileupload') && $user_level >= get_settings('fileupload_minlevel') && (in_array($user_login, $allowed_users) || trim(get_settings('fileupload_allowedusers')) == "");
$use_pingback = get_settings('use_pingback');
if ($post_pingback) {
    $ping_checked = 'checked="checked"';
} else {
    $ping_checked = '';
}
$use_trackback = get_settings('use_trackback');