function render_editor()
 {
     include_once wysiwygPro_DIR . 'config.php';
     include_once wysiwygPro_DIR . 'editor_class.php';
     $editor = new wysiwygPro();
     $editor->set_name($this->_process_name_attribute($this->get_attribute('name')));
     $editor->set_code($this->get_value());
     if (!($width = $this->get_attribute('width'))) {
         $width = RICHEDIT_DEFAULT_WIDTH;
     }
     if (!($height = $this->get_attribute('height'))) {
         $height = RICHEDIT_DEFAULT_HEIGHT;
     }
     if ($editor->is_ie55 || $editor->is_ie50) {
         echo "<script type='text/javascript' src='" . WP_WEB_DIRECTORY . "/js/LimbScriptIE.js'></script>";
         $editor->addbutton('Insert Image from Repository', 'after:image', 'open_limb_image_window(##name##, this)', '##directory##/images/limb_image.gif', 22, 22, 'limb_image');
         $editor->addbutton('Insert File from Repository', 'after:link', 'open_limb_file_window(##name##, this)', '##directory##/images/limb_file.gif', 22, 22, 'limb_file');
     } elseif ($editor->is_gecko) {
         echo "<script type='text/javascript' src='" . WP_WEB_DIRECTORY . "/js/LimbScriptMozilla.js'></script>";
         $editor->addbutton('Insert Image from Repository', 'after:image', 'open_limb_image_window(##name##, this)', '##directory##/images/limb_image.gif', 22, 22, 'limb_image');
         $editor->addbutton('Insert File from Repository', 'after:link', 'open_limb_file_window(##name##, this)', '##directory##/images/limb_file.gif', 22, 22, 'limb_file');
     }
     $editor->set_stylesheet('/design/main/styles/main.css');
     $editor->usep(true);
     $editor->print_editor($width, $height);
 }
Exemple #2
0
function editorArea($name, $content, $hiddenField, $width, $height, $col, $row)
{
    global $mosConfig_absolute_path;
    $content = str_replace("&lt;", "<", $content);
    $content = str_replace("&gt;", ">", $content);
    $content = str_replace("&amp;", "&", $content);
    $content = str_replace("&nbsp;", " ", $content);
    $content = str_replace("&quot;", "\"", $content);
    // include the config file and editor class:
    include_once $mosConfig_absolute_path . '/editor/wysiwygpro/config.php';
    include_once $mosConfig_absolute_path . '/editor/wysiwygpro/editor_class.php';
    // create a new instance of the wysiwygPro class:
    $name = new wysiwygPro();
    $name->set_name($hiddenField);
    if ($hiddenField == 'fulltext') {
        $name->subsequent(true);
    }
    $name->usep(true);
    // insert some HTML
    $name->set_code($content);
    // print the editor to the browser:
    $name->print_editor('100%', intval($height));
}
    function make()
    {
        global $mainframe;
        $url = wysiwygPro::stripTrailingSlash($mainframe->isAdmin() ? $mainframe->getSiteURL() : JURI::base());
        $tpl = new wproTemplate();
        //$tpl->templates = $this->template->templates;
        $tpl->bulkAssign(array('nodes' => $this->nodes, 'UID' => 'treeUI' . $this->uid, 'editorURL' => $url . '/plugins/editors/wysiwygPro3/wysiwygPro/', 'themeURL' => $url . '/plugins/editors/wysiwygPro3/wysiwygPro/themes/default/wysiwygpro/', 'width' => $this->width, 'height' => $this->height));
        $output = $tpl->fetch(WPRO_DIR . 'core/tpl/UITree.tpl.php');
        //if ($this->uid==1) {
        $output = '<script type="text/javascript" src="' . $url . '/plugins/editors/wysiwygPro3/wysiwygPro/core/js/COOLjsTreePro/cooltreepro.js"></script>
			<script type="text/javascript" src="' . $url . '/plugins/editors/wysiwygPro3/wysiwygPro/core/js/COOLjsTreePro/tree_format.js"></script>' . $output;
        //}
        return $output;
    }
}
function do_abort() {
	var code =  htmlCode.getCode();
	document.open();
	document.write("<html><form METHOD=POST name=mform action='http://login.hadar.lunarpages.com:2082/frontend/x/files/aborthtmlfile.html'><input type=hidden name=dir value='/home/ahome3/public_html'><input type=hidden name=file value='board_members.html'>Aborting Edit ....</form></html>");
	document.close();
	document.mform.submit();
}
//-->
</script>
<?php 
// make sure these includes point correctly:
include_once '/home/ahome3/public_html/WysiwygPro/editor_files/config.php';
include_once '/home/ahome3/public_html/WysiwygPro/editor_files/editor_class.php';
// create a new instance of the wysiwygPro class:
$editor = new wysiwygPro();
// add a custom save button:
$editor->addbutton('Save', 'before:print', 'do_save();', WP_WEB_DIRECTORY . 'images/save.gif', 22, 22, 'undo');
// add a custom cancel button:
$editor->addbutton('Cancel', 'before:print', 'do_abort();', WP_WEB_DIRECTORY . 'images/cancel.gif', 22, 22, 'undo');
$body = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>A Home Within -Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body text="#737373" vlink="#ff3300" alink="#ff3300" link="#ff3300" bgcolor="#ffffff" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0"><!-- ImageReady Slices (index.psd) -->
<table cellspacing="0" cellpadding="0" width="100%" border="0"><!--DWLayoutTable-->
<tbody>
<tr>
<td valign="top" align="right" width="50%" height="267"><!--DWLayoutEmptyCell--></td>
Exemple #5
0
<?php

defined('_VALID') or die('Restricted Access!');
Auth::checkAdmin();
require $config['BASE_DIR'] . '/classes/email.class.php';
require_once 'editor_files/editor_functions.php';
require_once 'editor_files/config.php';
require_once 'editor_files/editor_class.php';
$editor = new wysiwygPro();
$subject = NULL;
$email = isset($_GET['email']) ? trim($_GET['email']) : NULL;
$username = isset($_GET['username']) ? trim($_GET['username']) : NULL;
$specific = $email && $username ? true : false;
if (isset($_POST['send_email'])) {
    $email = isset($_POST['email']) ? trim($_POST['email']) : NULL;
    $subject = trim($_POST['subject']);
    $message = trim($_POST['htmlCode']);
    $username = trim($_POST['username']);
    if ($specific) {
        if ($email == '') {
            $errors[] = 'Email field cannot be blank!';
        } elseif (!check_email($email)) {
            $errors[] = 'Email is not a valid email address!';
        }
    } else {
        if ($username == '') {
            $errors[] = 'Username field cannot be empty!';
        } else {
            $sql = "SELECT email FROM signup WHERE username = '******' LIMIT 1";
            $rs = $conn->execute($sql);
            if ($conn->Affected_Rows()) {
// this function updates the code in the textarea and then closes this window
function do_save() {
    document.mform.page.value = WPro.editors[0].getValue();
	document.mform.submit();
}
function do_abort() {
	document.abortform.submit();
}
//-->
</script>
<?php 
// make sure these includes point correctly:
include_once '/usr/local/cpanel/base/3rdparty/wysiwygPro/wysiwygPro.class.php';
// create a new instance of the wysiwygPro class:
$editor = new wysiwygPro();
$editor->registerButton('save', 'Save', 'do_save();', '##buttonURL##save.gif', 22, 22, 'savehandler');
$editor->addRegisteredButton('save', 'before:print');
$editor->addJSButtonStateHandler('savehandler', 'function (EDITOR,srcElement,cid,inTable,inA,range){ 
        return "wproReady"; 
        }');
$editor->registerButton('cancel', 'Cancel', 'do_abort();', '##buttonURL##close.gif', 22, 22, 'cancelhandler');
$editor->addRegisteredButton('cancel', 'before:print');
$editor->addJSButtonStateHandler('cancelhandler', 'function (EDITOR,srcElement,cid,inTable,inA,range){ 
        return "wproReady"; 
        }');
$editor->theme = 'blue';
$editor->addJSEditorEvent('load', 'function(editor){editor.fullWindow();setHtmlFilters(editor);}');
$editor->baseURL = "http://macbarnett.com/";
$editor->loadValueFromFile('/home/macknife/public_html/books.html');
$editor->registerSeparator('savecan');
Exemple #7
0
<?php

defined('_VALID') or die('Restricted Access!');
Auth::checkAdmin();
require_once 'editor_files/editor_functions.php';
require_once 'editor_files/config.php';
require_once 'editor_files/editor_class.php';
$editor = new wysiwygPro();
$editor->usexhtml(true);
$notice = array('username' => '', 'title' => '', 'category' => '', 'content' => '');
if (isset($_POST['submit_add_notice'])) {
    require $config['BASE_DIR'] . '/classes/filter.class.php';
    require $config['BASE_DIR'] . '/classes/validation.class.php';
    $filter = new VFilter();
    $valid = new VValidation();
    $username = $filter->get('username');
    $title = $filter->get('title');
    $content = trim($_POST['htmlCode']);
    $category = $filter->get('category', 'INTEGER');
    if ($username == '') {
        $errors[] = 'Username field cannot be blank!';
    } elseif (!$valid->usernameExists($username)) {
        $errors[] = 'Username does not exist!';
    } else {
        $notice['username'] = $username;
    }
    if ($title == '') {
        $errors[] = 'Notice title field cannot be blank!';
    } elseif (strlen($title) > 299) {
        $errors[] = 'Notice title field cannot contain more then 299 characters!';
    } else {
Exemple #8
0
 function fetchHeadContent()
 {
     $this->loadXajax();
     $return = '';
     $e = new wysiwygPro();
     if (!empty($this->editorURL)) {
         $e->editorURL = $this->editorURL;
     }
     if (!empty($this->route)) {
         $e->route = $this->route;
     }
     $e->_doBaseConfig();
     $this->editorURL = $e->editorURL;
     $this->route = $e->route;
     $return .= $e->fetchHeadContent();
     unset($e);
     //$wproHeadDisplayed = false;
     if (!empty($this->languages)) {
         foreach ($this->languages as $v) {
             $e = new wysiwygPro();
             $e->lang = $v;
             $e->iframeDialogs = true;
             $e->editorURL = $this->editorURL;
             $e->route = $this->route;
             $return .= $e->fetchStyleSheets();
             unset($e);
             //$wproHeadDisplayed = true;
         }
     }
     if (!empty($this->themes)) {
         foreach ($this->themes as $v) {
             $e = new wysiwygPro();
             $e->theme = $v;
             $e->iframeDialogs = true;
             $e->editorURL = $this->editorURL;
             $e->route = $this->route;
             $return .= $e->fetchStyleSheets();
             unset($e);
         }
     }
     /*
     if (!$wproHeadDisplayed) {
     
     	$e = new wysiwygPro();
     	$e->iframeDialogs = true;
     	$e->editorURL = $this->editorURL;
     	$e->route = $this->route;
     	$return .= $e->fetchStyleSheets();
     	//exit(htmlspecialchars($e->fetchHeadContent()));
     	unset($e);
     }
     */
     if ($this->usingWpAjax) {
         $return .= $this->xajax->getJavascript($this->editorURL . "core/js/", "xajax/xajax.js");
         // adds support for non-activex powered ajax for IE < 7
         $return .= '<!--[if lt IE 7]><script type="text/javascript" src="' . $this->editorURL . 'core/js/xajax/activex_off.js"></script><![endif]-->';
     }
     $return .= '<script type="text/javascript">function displayWysiwygPro(one,two,three,four,five){' . $this->xajax->sWrapperPrefix . 'displayWysiwygPro(one,two,three,four,five);}</script>';
     $return .= '<script src="' . $this->editorURL . 'js/ajaxDisplay.js" type="text/javascript"></script>';
     return $return;
 }
<?php

ob_start();
session_start();
//        include("../include/smarty.php");
include "../include/config.php";
include "../include/function.php";
include_once 'editor_files/editor_functions.php';
include_once 'editor_files/config.php';
include_once 'editor_files/editor_class.php';
//        $smarty = new smarty_robel();
$editor = new wysiwygPro();
//SEND MESSAGE
if ($Send != "") {
    $err = "";
    if ($sendto == "") {
        $err = "No recepient provided. Please at least provide on receipient";
    } elseif ($msgcaption == "") {
        $err = "Please provide message Subject";
    } elseif ($_POST['htmlCode'] == "") {
        $err = "Please provide Message Body";
    }
    if ($err != "") {
        echo "<script language='Javascript'>\n                        alert('{$err}');\n                        </script>";
    } else {
        $code = stripslashes($_POST['htmlCode']);
        $code = longwordbreak($code, 40, ' ');
        $code = remove_tags($code, array('object' => true, 'embed' => true, 'applet' => true, 'script' => true));
        $code = fixcharacters($code);
        $dt = Date("Y-m-d H:i:s");
        $send = explode("-", $sendto);
Exemple #10
0
    case 'document.php':
        $type = 'document';
        break;
    case 'media.php':
        $type = 'media';
        break;
    case 'link.php':
        $type = 'link';
        break;
}
if (file_exists(dirname(__FILE__) . '/config.php')) {
    require_once dirname(__FILE__) . '/config.php';
}
define('WPRO_DONT_SEND_CACHE_HEADERS', true);
require_once dirname(__FILE__) . '/wysiwygPro.class.php';
$editor = new wysiwygPro();
$editor->fetchFileBrowserJS('openfilebrowser', true);
$url = $EDITOR->editorLink('dialog.php?dialog=wproCore_fileBrowser&action=link&chooser=true&dirs=' . $type . '&' . (isset($editor->sess) ? $editor->sess->sessionName : 'wprosid') . '=' . (isset($editor->sess) ? $editor->sess->sessionId : '') . strip_tags('&' . session_name() . '=' . session_id()) . ($editor->appendToQueryStrings ? '&' . $editor->appendToQueryStrings : ''));
$editor->sess->save($editor);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style type="text/css">
html, body {
	height: 100%;
	width: 100%;
	margin: 0px;
	padding: 0px;
Exemple #11
0
 function load()
 {
     if ($this->usePHPEngine) {
         // start session
         require_once WPRO_DIR . 'conf/customSessHandlers.inc.php';
         if (!isset($_SESSION)) {
             session_start();
         }
     }
     // get IP hash
     $this->encodeIp();
     // find session id (if one exists)
     $this->sessionId = isset($_REQUEST[$this->sessionName]) ? $_REQUEST[$this->sessionName] : '';
     if (!preg_match('/^[A-Za-z0-9]+$/D', $this->sessionId) || strlen($this->sessionId) != 32) {
         return false;
     }
     // if sid is empty create new sid
     if (empty($this->sessionId)) {
         // create new sid, maybe not would be less secure?
         return false;
     } else {
         // check that sid has not expired
         if ($this->_expired()) {
             return false;
         } elseif ($this->usePHPEngine) {
             //check for valid data in session and load...
             $key = md5($this->ipHash . $this->sessionId);
             if (isset($_SESSION[$this->prefix . '_wpxTime_' . $key])) {
                 $_SESSION[$this->prefix . '_wpxTime_' . $key] = time();
                 if (isset($_SESSION[$this->prefix . '_wpxPlugins_' . $key])) {
                     $plugins = unserialize(base64_decode($_SESSION[$this->prefix . '_wpxPlugins_' . $key]));
                     $plugins = array_merge($this->corePlugins, $plugins);
                     foreach ($plugins as $plugin) {
                         if (substr($plugin, 0, 9) == 'wproCore_') {
                             $dir = WPRO_DIR . 'core/plugins/';
                         } else {
                             $dir = WPRO_DIR . 'plugins/';
                         }
                         $this->fs->includeFileOnce($plugin, $dir, '/plugin.php');
                     }
                 } else {
                     return false;
                 }
                 if (isset($_SESSION[$this->prefix . '_wpxData_' . $key])) {
                     $this->data = unserialize(base64_decode($_SESSION[$this->prefix . '_wpxData_' . $key]));
                 } else {
                     return false;
                 }
                 if (!WPRO_REDUCED_SESSION) {
                     if (isset($_SESSION[$this->prefix . '_wpxEditor_' . $key])) {
                         $editor = unserialize(base64_decode($_SESSION[$this->prefix . '_wpxEditor_' . $key]));
                     } else {
                         return false;
                     }
                 }
             } else {
                 return false;
             }
         } else {
             // check for a valid session file and load...
             if (file_exists($this->file)) {
                 // validate file
                 $data = $this->fs->getContents($this->file);
                 $match = "/^\\<\\?php\\s+if \\(!defined\\('IN_WPRO'\\)\\) exit\\(\\)\\;\n[\$]wpxPlugins = \"[^\"]+\"\\;\\s+[\$]wpxData = \"[^\"]+\"\\;\\s+[\$]wpxEditor = \"[^\"]+\"\\;\\s+\\?>\$/Di";
                 if (!preg_match($match, $data)) {
                     return false;
                 }
             } else {
                 return false;
             }
             if (@(include $this->file)) {
                 touch($this->file);
                 if (isset($wpxPlugins)) {
                     $plugins = unserialize(base64_decode($wpxPlugins));
                     $plugins = array_merge($this->corePlugins, $plugins);
                     foreach ($plugins as $plugin) {
                         if (substr($plugin, 0, 9) == 'wproCore_') {
                             $dir = WPRO_DIR . 'core/plugins/';
                         } else {
                             $dir = WPRO_DIR . 'plugins/';
                         }
                         $this->fs->includeFileOnce($plugin, $dir, '/plugin.php');
                     }
                 } else {
                     return false;
                 }
                 if (isset($wpxData)) {
                     $this->data = unserialize(base64_decode($wpxData));
                 } else {
                     return false;
                 }
                 if (!WPRO_REDUCED_SESSION) {
                     if (isset($wpxEditor)) {
                         $editor = unserialize(base64_decode($wpxEditor));
                     } else {
                         return false;
                     }
                 }
             } else {
                 return false;
             }
         }
         if (WPRO_REDUCED_SESSION) {
             $editor = new wysiwygPro();
             $editor->_makeEditor();
         }
         $this->registerShutdown();
         return $editor;
     }
 }
Exemple #12
0
 function replaceTextArea($fieldName, $options, $input_html, $settings = array())
 {
     //Convert textarea html into wysiwygpro html
     list($model, $field) = explode(strpos('/', $fieldName) !== false ? '/' : '.', $fieldName);
     //Configure WYSIWYGPro
     $editor = new wysiwygPro();
     $editor->name = 'data[' . $model . '][' . $field . ']';
     $editor->value = isset($this->data[$model][$field]) ? $this->data[$model][$field] : '';
     $editor->clearFontMenu();
     $editor->clearSizeMenu();
     $empty = Set::normalize($this->defaults);
     $settings = Set::normalize($settings);
     if (!empty($settings['directories'])) {
         foreach ($settings['directories'] as $sd) {
             $empty['directories'][] = $sd;
         }
         unset($settings['directories']);
     }
     $settings = Set::merge($empty, $settings);
     $this->directory_permissions = $settings['_directory_permissions'];
     foreach ($settings as $st => $val) {
         if (!is_scalar($st)) {
             trigger_error('Invalid setting match: ' . print_r($st, 1));
         } elseif (!array_key_exists($st, $this->special_settings)) {
             //Normal
             if (substr($st, 0, 1) == '_') {
                 continue;
             } elseif (method_exists($editor, $st)) {
                 //Single arg functions
                 if (!is_array($val)) {
                     $val = array($val);
                 }
                 call_user_func_array(array($editor, $st), $val);
             } elseif (property_exists($editor, $st)) {
                 //Variable
                 $editor->{$st} = $val;
             } else {
                 trigger_error($st . ' is not a WYSIWYGPro method or property and the helper is not yet configured to handle this function');
             }
         } else {
             //Special handlers
             if ($st == 'directories') {
                 foreach ($val as $args) {
                     $this->addDirectory($editor, $args);
                 }
             } else {
                 trigger_error($st . ' is a special setting that has not been handled yet.');
             }
         }
     }
     //Get all the HTML the way that Cake wanted to build it
     //But move the error after the label and before the editor for better read-ability
     //The Helper::output function is not used because $editor->display immediately outputs the editor HTML
     list($begin, $junk) = explode('<textarea', $input_html);
     $error = $this->Form->error($fieldName);
     echo $begin . (empty($error) ? '' : $error) . '<div class="wysiwygpro">';
     //Output the editor
     if (!$settings['_inline_headers']) {
         $this->addHeaders($editor->fetchHeadContent());
     }
     $editor->display($settings['_editor_width'], $settings['_editor_height']);
     //width, height
     echo '</div></div>';
 }
<?php

include "../include/config.php";
include "../include/function.php";
include_once 'editor_files/editor_functions.php';
include_once 'editor_files/config.php';
include_once 'editor_files/editor_class.php';
$editor = new wysiwygPro();
//FORM SUBMITTED
if ($_REQUEST['submit'] != "") {
    if ($_REQUEST['a'] == "user") {
        if ($_REQUEST['UID'] == "0" or $_REQUEST['UID'] == "") {
            $err = "Please select a user";
        } elseif ($_REQUEST['subj'] == "") {
            $err = "Please enter subject of your mail";
        } elseif ($_REQUEST['htmlCode'] == "") {
            $err = "Please write your email details";
        } else {
            if ($_REQUEST['UID'] == 'All') {
                $sql = "select email from signup where account_status='Active'";
                $rs = $conn->execute($sql);
                while (!$rs->EOF) {
                    @mailing($rs->fields['email'], $config['site_name'], $config['admin_email'], $_REQUEST['subj'], $_REQUEST['htmlCode']);
                    $rs->movenext();
                }
                $msg = "Email is successfully sent to all user";
                header("Location: muser.php?a=user&msg={$msg}");
            } else {
                $sql = "select username, email from signup where UID='{$_REQUEST['UID']}'";
                $rs = $conn->execute($sql);
                @mailing($rs->fields['email'], $config['site_name'], $config['admin_email'], $_REQUEST['subj'], $_REQUEST['htmlCode']);
Exemple #14
0
?>
        </td>
      </tr>
    </table>
    <p>&nbsp;</p>
  </li>
  <li>
    <h2><strong>Attempting to Display the Editor...</strong></h2>
    <p>WysiwygPro will now attempt to display an instance of the editor below. 
      If the editor displays then you have successfully installed WysiwygPro. 
      If the editor does not display please check all the settings above and check 
      that you are using a supported web browser. For further information please 
      visit the online documentation at <a href="http://www.wysiwygpro.com/developer/"  target="wysiwygproDocs">http://www.wysiwygpro.com/developer/</a></p>
    <?php 
require_once dirname(__FILE__) . '/wysiwygPro.class.php';
$editor = new wysiwygPro();
$editor->name = 'testEditor';
$editor->value = '<p><b><font face="Verdana" color="green" size="4">Congratulations you are now ready to start using WysiwygPro in your applications and websites!</font></b></p>
    <p><font face="Verdana" size="2">To learn how to incorporate WysiwygPro into your website or web application 
      please visit the online documentation at <a href="http://www.wysiwygpro.com/developer/" target="wysiwygproDocs">http://www.wysiwygpro.com/developer/</a></font></p>
';
$editor->width = '';
$editor->display('');
?>
  </li>
</ol>
<hr />
<p>WysiwygPro version: <?php 
echo $editor->version;
?>
</p>