Hello!
Thank you for the fast reaction.
De browsers I am using are FF2 IE7 and IE6
I want to use it in the EE publish area.
Thanks for the help! I think this is a solution for the what i think is the biggest downside of EE! Fantastic work!
The hyrachy is as follows.
system
_extensions
__ext.tiny_mce.php
ajaxfilemanager
_tiny_mce
__plugins
___ajaxfilemanager
____inc
_____config.base.php
_uploaded
_tinymce_test.php
I will add the ext.tiny_mce in this post because te Attach files to this post link is not responding….
<?php
if ( ! defined('EXT'))
{
exit('Invalid file request');
}
class Tiny_mce
{
var $settings = array();
var $name = 'Tiny MCE Extension for EE';
var $version = '1.0.1';
var $description = 'Converts Textareas in Publish area into WYSIWYG editors';
var $settings_exist = 'y';
var $docs_url = 'http://tinymce.moxiecode.com/documentation.php';
// -------------------------------
// Constructor - Extensions use this for settings
// -------------------------------
function Tiny_mce($settings='')
{
$this->settings = $settings;
}
// END
// -------------------------------
// Add JavaScript Header
// -------------------------------
function add_header()
{
global $PREFS, $EXT;
$r = ($EXT->last_call !== FALSE) ? $EXT->last_call : '';
$settings_parts = implode("\n\t\t", preg_split("/(\r\n|\n|\r)/", trim($this->settings['configuration'])));
$r .= '
settings['script_url']).'">
//<![CDATA[
tinyMCE.init(
{
'.
$settings_parts.
'
}
);
//]]>
';
return $r;
}
// END
// --------------------------------
// Activate Extension
// --------------------------------
function activate_extension()
{
global $DB, $PREFS;
$default_settings = serialize(array('script_url' => $PREFS->ini('site_url', TRUE).'tinymce/jscripts/tiny_mce/tiny_mce.js',
'configuration' => 'mode : "textareas"'));
$DB->query($DB->insert_string('exp_extensions',
array('extension_id' => '',
'class' => "Tiny_mce",
'method' => "add_header",
'hook' => "publish_form_headers",
'settings' => $default_settings,
'priority' => 10,
'version' => $this->version,
'enabled' => "y"
)
)
);
}
// END
// --------------------------------
// Update Extension
// --------------------------------
function update_extension($current='')
{
global $DB;
if ($current == '' OR $current == $this->version)
{
return FALSE;
}
if ($current > '1.0.0')
{
// Update queries for next version 1.0.1
}
$DB->query("UPDATE exp_extensions
SET version = '".$DB->escape_str($this->version)."'
WHERE class = 'Publish_form'");
}
// END
// --------------------------------
// Settings
// --------------------------------
function settings()
{
global $PREFS;
$settings = array();
$settings['script_url'] = $PREFS->ini('site_url', TRUE).'tinymce/jscripts/tiny_mce/tiny_mce.js';
$settings['configuration'] = array('t', "");
// Complex:
// [variable_name] => array(type, values, default)
// variable_name => short name for setting and used as the key for language file
// type: t - textarea, r - radio buttons, s - select, ms - multiselect, f - function calls
// values: can be array (r, s, ms), string (t), function name (f)
// default: name of array member, string, nothing
//
// Simple:
// [variable_name] => 'Butter'
// Text input, with 'Butter' as the default.
return $settings;
}
// END
}
// END Class
?>