m_cache = $cache;
$this->toggle_filter($status);
add_filter('admin_head', array(&$this, 'filter_admin_head'));
add_filter('admin_footer', array(&$this, 'filter_admin_footer'));
}
// ---------------------------------------------------------------------------
// filter
// ---------------------------------------------------------------------------
function filter_admin_head()
{
wp_print_scripts(array('sack'));
?>
m_cache->get_option();
$heading = __('Exec-PHP Error.', ExecPhp_PLUGIN_ID);
$text = sprintf(__('No necessary upgrade of the the Exec-PHP plugin could be performed. PHP code in your articles or widgets may be viewable to your blog readers. This is plugin version %1$s, previously there was version %2$s installed. Downgrading from a newer version to an older version of the plugin is not supported.', ExecPhp_PLUGIN_ID)
, ExecPhp_VERSION, $option->get_version());
$this->print_admin_message($heading, $text);
}
function filter_admin_footer_unknown()
{
$option =& $this->m_cache->get_option();
$heading = __('Exec-PHP Error.', ExecPhp_PLUGIN_ID);
$text = sprintf(__('An unknown error (%s) occured during execution of the Exec-PHP plugin. PHP code in your articles or widgets may be viewable to your blog readers. This error should never happen if you use the plugin with a compatible WordPress version and installed it as described in the documentation.', ExecPhp_PLUGIN_ID)
, $option->get_status());
$this->print_admin_message($heading, $text);
}
function toggle_filter($status)
{
if ($status == ExecPhp_STATUS_PLUGIN_VERSION_MISMATCH)
add_filter('admin_footer', array(&$this, 'filter_admin_footer_plugin_version'));
else
remove_filter('admin_footer', array(&$this, 'filter_admin_footer_plugin_version'));
if ($status != ExecPhp_STATUS_OKAY
&& $status != ExecPhp_STATUS_PLUGIN_VERSION_MISMATCH)
add_filter('admin_footer', array(&$this, 'filter_admin_footer_unknown'));
else
remove_filter('admin_footer', array(&$this, 'filter_admin_footer_unknown'));
}
// ---------------------------------------------------------------------------
// tools
// ---------------------------------------------------------------------------
function print_admin_message($heading, $text)
{
?>