Still work in progress, but here's a teaser:
- The Soderlind CSS Editor will be ready when it's done (that is, I don't have a release date)
- Prerequisites:
- WordPress and WordPress MU 2.8.4 or newer
- PHP 5.x
- The Sandbox theme
- It will use HTML Purifier to validate the CSS code before it's saved.
Here's a peek at the code:
[sourcecode language='php']
class ps_sandbox_editor {
private $url = "";
private $urlpath = "";
function __construct($urlpath,$url) {
$this->urlpath = $urlpath;
$this->url = $url;
if (!is_admin()) {
add_filter('stylesheet_uri',array(&$this,'ps_sandbox_stylesheet_uri'),10,2);
} else {
add_action('init',array(&$this,'ps_sandbox_editor_load_l10n'));
add_action('admin_menu',array(&$this,'ps_sandbox_editor_add_admin_subpanel'));
add_filter('attachment_fields_to_edit', array(&$this,'ps_sandbox_editor_modify_media_form'), 11, 2);
add_filter('media_send_to_editor', array(&$this,'ps_sandbox_editor_media_send_to_editor'), 11, 3);
if ($_GET['page'] == 'ps_sandbox_editor.php') {
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_enqueue_script('media-upload');
}
}
}
function ps_sandbox_editor_add_admin_subpanel() {
get_currentuserinfo();
if (is_site_admin()) {
add_submenu_page('wpmu-admin.php',__('CSS Editor Settings','ps_sandbox_editor'),__('CSS Editor Settings','ps_sandbox_editor'), 'administrator', basename(__FILE__), 'ps_sandbox_editor_adminpage');
}
if( 'Sandbox'==get_option('current_theme') ) {
$themehook = add_theme_page( __('CSS Editor','ps_sandbox_editor'),__('CSS Editor','ps_sandbox_editor'), 'administrator', basename(__FILE__), array(&$this,'ps_sandbox_editor_themepage'));
add_action( "admin_print_scripts-$themehook", array(&$this,'ps_sandbox_editor_enqueue_scripts') );
}
}
.
.
.
[/sourcecode]