Exemplo n.º 1
1
function show_wysiwyg_editor($name, $id, $content, $width = '100%', $height = '350px')
{
    // create new CKeditor instance
    include_once WB_PATH . '/modules/ckeditor/ckeditor/ckeditor.php';
    $ckeditor = new CKEditor($name);
    $ckeditor->basePath = WB_URL . '/modules/ckeditor/ckeditor/';
    $ckeditor->config['height'] = $height;
    $ckeditor->config['width'] = $width;
    // obtain template name of current page for editor.css (if empty, no editor.css files exists)
    $css_template_name = get_css_template_name();
    if (file_exists(WB_PATH . '/modules/ckeditor/wb_config/custom/editor.css')) {
        $ck_editor_files = WB_URL . '/modules/ckeditor/wb_config/custom/editor.css';
    } else {
        $ck_editor_files = WB_URL . '/modules/ckeditor/wb_config/default/editor.css';
    }
    $ckeditor->config['contentsCss'] = $css_template_name == 'none' ? $ck_editor_files : $css_template_name;
    // obtain template name of current page for editor.styles.js (if empty, no editor.styles.js files exists)
    $styles_template_name = get_styles_template_name();
    // editor.styles.js file exists in default template folder, or template folder of current page
    if (file_exists(WB_PATH . '/modules/ckeditor/wb_config/custom/editor.styles.js')) {
        $ck_styles_files = WB_URL . '/modules/ckeditor/wb_config/custom/editor.styles.js';
    } else {
        $ck_styles_files = WB_URL . '/modules/ckeditor/wb_config/default/editor.styles.js';
    }
    $styles_url = $styles_template_name == "none" ? $ck_styles_files : $styles_template_name;
    // The Styles dropdown in the editor. The styles_set needs to be set in each editor.styles.js!
    $ckeditor->config['stylesSet'] = 'wb:' . $styles_url;
    // The Templates list ("presets" like two columns with a picture) in the editor.
    // The templates definition set to use. It accepts a comma separated list.
    $ckeditor->config['templates'] = 'default';
    // The list of templates definition files to load.
    if (file_exists(WB_PATH . '/modules/ckeditor/wb_config/custom/editor.templates.js')) {
        $ck_templates_files[] = WB_URL . '/modules/ckeditor/wb_config/custom/editor.templates.js';
    } else {
        $ck_templates_files[] = WB_URL . '/modules/ckeditor/wb_config/default/editor.templates.js';
    }
    $ckeditor->config['templates_files'] = $ck_templates_files;
    // The filebrowser are called in the include, because later on we can make switches, use WB_URL and so on
    $connectorPath = $ckeditor->basePath . 'filemanager/connectors/php/connector.php';
    $ckeditor->config['filebrowserBrowseUrl'] = $ckeditor->basePath . 'filemanager/browser/default/browser.html?Connector=' . $connectorPath;
    $ckeditor->config['filebrowserImageBrowseUrl'] = $ckeditor->basePath . 'filemanager/browser/default/browser.html?Type=Image&Connector=' . $connectorPath;
    $ckeditor->config['filebrowserFlashBrowseUrl'] = $ckeditor->basePath . 'filemanager/browser/default/browser.html?Type=Flash&Connector=' . $connectorPath;
    // The Uploader has to be called, too.
    $uploadPath = $ckeditor->basePath . 'filemanager/connectors/php/upload.php?Type=';
    $ckeditor->config['filebrowserUploadUrl'] = $uploadPath . 'File';
    $ckeditor->config['filebrowserImageUploadUrl'] = $uploadPath . 'Image';
    $ckeditor->config['filebrowserFlashUploadUrl'] = $uploadPath . 'Flash';
    // Setup the CKE language
    $ckeditor->config['language'] = strtolower(LANGUAGE);
    // Get the config file
    if (file_exists(WB_PATH . '/modules/ckeditor/wb_config/custom/wb_ckconfig.js')) {
        $ckeditor->config['customConfig'] = WB_URL . '/modules/ckeditor/wb_config/custom/wb_ckconfig.js';
    } else {
        $ckeditor->config['customConfig'] = WB_URL . '/modules/ckeditor/wb_config/default/wb_ckconfig.js';
    }
    $ckeditor->editor($name, reverse_htmlentities($content));
}
Exemplo n.º 2
0
  <p></p>
  <script language="Javascript">
  // some debugging stuff to see what happens
  function checkForm() {
    return true;
    for (var i=0;i<document.sendmessageform.elements.length;i++) {
      alert(document.sendmessageform.elements[i].name+" "+document.sendmessageform.elements[i].value);
    }
    return true;
  }

  // detection of unsaved changes,
  var browser = navigator.appName.substring ( 0, 9 );
  var changed = 0; function haschanged() {changed = 1; }
  function savechanges() { if (changed) { if (confirm("<?php 
    echo str_replace('"', '&quot', reverse_htmlentities($GLOBALS['I18N']->get("unsavedchanges")));
    ?>
")) return true; else return false; return false;}}
  //'
  var event_number = 0;if (browser=="Microsoft") {  document.onkeydown=haschanged;  document.onchange=haschanged;} else if (browser=="Netscape") {  document.captureEvents(Event.KEYDOWN);  document.captureEvents(Event.CHANGE); document.onkeydown=haschanged;document.onchange=haschanged;}
  function submitform() { document.sendmessageform.submit() }
  </script>
  <?php 
    print formStart($enctype . ' name="sendmessageform"');
    #print '<form method="post" enctype="multipart/form-data" name="sendmessageform" onSubmit="return checkForm()">';
    print '<input type=hidden name="workaround_fck_bug" value="1">';
    if ($_GET["page"] == "preparemessage") {
        print Help("preparemessage", $GLOBALS['I18N']->get("whatisprepare"));
    }
    if (!defined("IN_WEBBLER")) {
        if (!$from && is_object($GLOBALS["admin_auth"]) && $GLOBALS['require_login']) {
Exemplo n.º 3
0
function process_avatarurl($url)
{
    global $vbulletin;
    if ($url == '') {
        return;
    }
    if (stripos($url, 'http:') !== false) {
        return reverse_htmlentities(normalize_url($url));
    } else {
        if (is_vb()) {
            if (strpos($url, '/') === 0) {
                $host = parse_url($vbulletin->options['bburl']);
                return normalize_url($host['scheme'] . '://' . $host['host'] . reverse_htmlentities($url));
            } else {
                return normalize_url($vbulletin->options['bburl'] . '/' . reverse_htmlentities($url));
            }
        } else {
            if (is_phpbb()) {
                return normalize_url(fr_get_phpbb_bburl() . reverse_htmlentities($url));
            } else {
                if (is_xen()) {
                    return normalize_url(fr_get_xenforo_bburl() . '/' . reverse_htmlentities($url));
                }
            }
        }
    }
}