[wp-trac] Re: [WordPress Trac] #3715: admin_footer doesn't work in
post-new.php
WordPress Trac
wp-trac at lists.automattic.com
Mon Jan 29 19:27:26 GMT 2007
#3715: admin_footer doesn't work in post-new.php
----------------------------+-----------------------------------------------
Reporter: ajay | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.1.1
Component: Administration | Version: 2.1
Severity: normal | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Comment (by ajay):
The code being used is:
{{{
add_filter('admin_footer', 'callback_iimagebrowser');
function callback_iimagebrowser()
{
if(strpos($_SERVER['REQUEST_URI'], 'post.php') ||
strpos($_SERVER['REQUEST_URI'], 'comment.php') ||
strpos($_SERVER['REQUEST_URI'], 'page.php') ||
strpos($_SERVER['REQUEST_URI'], 'post-new.php') ||
strpos($_SERVER['REQUEST_URI'], 'page-new.php') ||
strpos($_SERVER['REQUEST_URI'], 'bookmarklet.php'))
{
?>
<script language="JavaScript" type="text/javascript"><!--
var toolbar = document.getElementById("ed_toolbar");
<?php
edit_insert_button("IImage Browser", "iimagebrowser",
"IImage Browser");
?>
function iimagebrowser()
{
window.open("../wp-admin/iimage-browser.php", "IImageBrowser",
"width=700,height=600,scrollbars=yes");
}
//--></script>
<?php
}
}
if(!function_exists('edit_insert_button'))
{
//edit_insert_button: Inserts a button into the editor
function edit_insert_button($caption, $js_onclick, $title = '')
{
?>
if(toolbar)
{
var theButton = document.createElement('input');
theButton.type = 'button';
theButton.value = '<?php echo $caption; ?>';
theButton.onclick = <?php echo $js_onclick; ?>;
theButton.className = 'ed_button';
theButton.title = "<?php echo $title; ?>";
theButton.id = "<?php echo "ed_{$caption}"; ?>";
toolbar.appendChild(theButton);
}
<?php
}
}
}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/3715#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list