diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-01-10 13:17:40 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-01-10 13:17:40 +0000 |
| commit | 0cc51d943e5a8ffaa7bd7d8bf798f931ac794552 (patch) | |
| tree | e7b50b853bde70e193b22c0096a96f97503ff7f9 /wp-inst/wp-admin/admin-header.php | |
| parent | a50cf6f1689a7a4e509d379580e3bb15195992d8 (diff) | |
| download | wordpress-mu-0cc51d943e5a8ffaa7bd7d8bf798f931ac794552.tar.gz wordpress-mu-0cc51d943e5a8ffaa7bd7d8bf798f931ac794552.tar.xz wordpress-mu-0cc51d943e5a8ffaa7bd7d8bf798f931ac794552.zip | |
WP Merge.
Also fixes for kses that ate tags, and category js
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@497 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/admin-header.php')
| -rw-r--r-- | wp-inst/wp-admin/admin-header.php | 328 |
1 files changed, 30 insertions, 298 deletions
diff --git a/wp-inst/wp-admin/admin-header.php b/wp-inst/wp-admin/admin-header.php index c340b5d..ec05aa0 100644 --- a/wp-inst/wp-admin/admin-header.php +++ b/wp-inst/wp-admin/admin-header.php @@ -1,334 +1,66 @@ <?php @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); -if (!isset($_GET["page"])) require_once('admin.php'); ?> +if (!isset($_GET["page"])) require_once('admin.php'); +if ( $editing ) { + $dbx_js = true; + $cat_js = true; +} +if ( $list_js || $cat_js ) + $sack_js = true; +?> <?php get_admin_page_title(); ?> <!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="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> <title><?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress</title> <link rel="stylesheet" href="<?php echo get_settings('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" /> -<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> - <script type="text/javascript"> //<![CDATA[ - -function addLoadEvent(func) { - if ( typeof wpOnload != 'function' ) { - wpOnload = func; - } else { - var oldonload = wpOnload; - wpOnload = function() { - oldonload(); - func(); - } - } -} - -<?php if ( isset($xfn) ) : ?> - -function GetElementsWithClassName(elementName, className) { - var allElements = document.getElementsByTagName(elementName); - var elemColl = new Array(); - for (i = 0; i < allElements.length; i++) { - if (allElements[i].className == className) { - elemColl[elemColl.length] = allElements[i]; - } - } - return elemColl; -} - -function meChecked() { - var undefined; - var eMe = document.getElementById('me'); - if (eMe == undefined) return false; - else return eMe.checked; -} - -function upit() { - var isMe = meChecked(); //document.getElementById('me').checked; - var inputColl = GetElementsWithClassName('input', 'valinp'); - var results = document.getElementById('link_rel'); - var linkText, linkUrl, inputs = ''; - for (i = 0; i < inputColl.length; i++) { - inputColl[i].disabled = isMe; - inputColl[i].parentNode.className = isMe ? 'disabled' : ''; - if (!isMe && inputColl[i].checked && inputColl[i].value != '') { - inputs += inputColl[i].value + ' '; - } - } - inputs = inputs.substr(0,inputs.length - 1); - if (isMe) inputs='me'; - results.value = inputs; - } - -function blurry() { - if (!document.getElementById) return; - - var aInputs = document.getElementsByTagName('input'); - - for (var i = 0; i < aInputs.length; i++) { - aInputs[i].onclick = aInputs[i].onkeyup = upit; - } -} - -addLoadEvent(blurry); -<?php endif; ?> +function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}} //]]> </script> <script type="text/javascript" src="../wp-includes/js/fat.js"></script> +<?php if ( $xfn_js ) { ?> +<script type="text/javascript" src="xfn.js"></script> +<?php } ?> +<?php if ( $sack_js ) { ?> <script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script> +<?php } ?> +<?php if ( $list_js ) { ?> <script type="text/javascript" src="list-manipulation.js"></script> -<?php if ( isset( $editing ) ) : ?> -<?php if ( $editing && user_can_richedit() ) : ?> -<script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script> -<?php endif; ?> +<?php } ?> +<?php if ( $dbx_js ) { ?> <script type="text/javascript" src="../wp-includes/js/dbx.js"></script> <script type="text/javascript"> //<![CDATA[ - addLoadEvent( function() { +addLoadEvent( function() { <?php switch ( $pagenow ) : case 'post.php' : ?> - var manager = new dbxManager('postmeta'); //session ID [/-_a-zA-Z0-9/] +var manager = new dbxManager('postmeta'); <?php break; case 'page-new.php' : ?> - var manager = new dbxManager('pagemeta'); //session ID [/-_a-zA-Z0-9/] +var manager = new dbxManager('pagemeta'); <?php break; endswitch; ?> - }); +}); //]]> </script> <script type="text/javascript" src="../wp-includes/js/dbx-key.js"></script> - -<?php if ( current_user_can('manage_categories') ) : ?> -<style type="text/css"> -#newcat { width: 120px; margin-right: 5px; } -input#catadd { background: #a4a4a4; - border-bottom: 1px solid #898989; - border-left: 1px solid #bcbcbc; - border-right: 1px solid #898989; - border-top: 1px solid #bcbcbc; - color: #fff; - font-size: 10px; - padding: 0; - margin: 0; - font-weight: bold; - height: 20px; - margin-bottom: 2px; - text-align: center; - width: 37px; } -#howto { - font-size: 11px; - margin: 0 5px; - display: block; -} -#jaxcat { - margin: 0; - padding: 0; -} -</style> -<script type="text/javascript"> -//<![CDATA[ -var ajaxCat = new sack(); -var newcat; - -function newCatAddIn() { - if ( !document.getElementById('jaxcat') ) return false; - var ajaxcat = document.createElement('span'); - ajaxcat.id = 'ajaxcat'; - - newcat = document.createElement('input'); - newcat.type = 'text'; - newcat.name = 'newcat'; - newcat.id = 'newcat'; - newcat.size = '16'; - newcat.setAttribute('autocomplete', 'off'); - newcat.onkeypress = ajaxNewCatKeyPress; - - var newcatSub = document.createElement('input'); - newcatSub.type = 'button'; - newcatSub.name = 'Button'; - newcatSub.id = 'catadd'; - newcatSub.value = '<?php echo addslashes(__('Add')); ?>'; - newcatSub.onclick = ajaxNewCat; - - var searchResult = document.createElement( 'div' ); - searchResult.type = 'div'; - searchResult.name = 'searchresults'; - searchResult.id = 'searchresults'; - searchResult.style.display = 'none'; - searchResult.style.overflow = 'auto'; - searchResult.style.border = '1px solid #ccc'; - searchResult.style.background = '#eee'; - - ajaxcat.appendChild(newcat); - ajaxcat.appendChild(newcatSub); - ajaxcat.appendChild(searchResult); - document.getElementById('jaxcat').appendChild(ajaxcat); - - howto = document.createElement('span'); - howto.innerHTML = '<?php echo addslashes(__('Separate multiple categories with commas.')); ?>'; - howto.id = 'howto'; - ajaxcat.appendChild(howto); -} - -addLoadEvent(newCatAddIn); - -function getResponseElement() { - var p = document.getElementById('ajaxcatresponse'); - if (!p) { - p = document.createElement('span'); - document.getElementById('jaxcat').appendChild(p); - p.id = 'ajaxcatresponse'; - } - return p; -} - -function newCatLoading() { - var p = getResponseElement(); - p.innerHTML = '<?php echo addslashes(__('Sending Data...')); ?>'; -} - -function newCatLoaded() { - var p = getResponseElement(); - p.innerHTML = '<?php echo addslashes(__('Data Sent...')); ?>'; -} - -function newCatInteractive() { - var p = getResponseElement(); - p.innerHTML = '<?php echo addslashes(__('Processing Request...')); ?>'; -} - -function newCatCompletion() { - var p = getResponseElement(); - var id = 0; - var ids = new Array(); - var names = new Array(); - - ids = myPload( ajaxCat.response ); - names = myPload( newcat.value ); - for ( i = 0; i < ids.length; i++ ) { - id = ids[i].replace(/[\n\r]+/g, ""); - if ( id == '-1' ) { - p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>"; - return; - } - if ( id == '0' ) { - p.innerHTML = "<?php echo addslashes(__('That category name is invalid. Try something else.')); ?>"; - return; - } - - var exists = document.getElementById('category-' + id); - - if (exists) { - var moveIt = exists.parentNode; - var container = moveIt.parentNode; - container.removeChild(moveIt); - container.insertBefore(moveIt, container.firstChild); - moveIt.id = 'new-category-' + id; - exists.checked = 'checked'; - var nowClass = moveIt.className; - moveIt.className = nowClass + ' fade'; - Fat.fade_all(); - moveIt.className = nowClass; - } else { - var catDiv = document.getElementById('categorychecklist'); - var newLabel = document.createElement('label'); - newLabel.setAttribute('for', 'category-' + id); - newLabel.id = 'new-category-' + id; - newLabel.className = 'selectit fade'; - - var newCheck = document.createElement('input'); - newCheck.type = 'checkbox'; - newCheck.value = id; - newCheck.name = 'post_category[]'; - newCheck.id = 'category-' + id; - newLabel.appendChild(newCheck); - - var newLabelText = document.createTextNode(' ' + names[i]); - newLabel.appendChild(newLabelText); - - catDiv.insertBefore(newLabel, catDiv.firstChild); - newCheck.checked = 'checked'; - - Fat.fade_all(); - newLabel.className = 'selectit'; - } - newcat.value = ''; - } - p.parentNode.removeChild(p); -// var id = parseInt(ajaxCat.response, 10); -} - -function ajaxNewCatKeyPress(e) { - if (!e) { - if (window.event) { - e = window.event; - } else { - return; - } - } - if (e.keyCode == 13) { - ajaxNewCat(); - e.returnValue = false; - e.cancelBubble = true; - return false; - } -} - -function ajaxNewCat() { - var newcat = document.getElementById('newcat'); - var split_cats = new Array(1); - var catString = ''; - - catString = 'ajaxnewcat=' + encodeURIComponent(newcat.value); - ajaxCat.requestFile = 'edit-form-ajax-cat.php'; - ajaxCat.method = 'GET'; - ajaxCat.onLoading = newCatLoading; - ajaxCat.onLoaded = newCatLoaded; - ajaxCat.onInteractive = newCatInteractive; - ajaxCat.onCompletion = newCatCompletion; - ajaxCat.runAJAX(catString); -} - -function myPload( str ) { - var fixedExplode = new Array(); - var comma = new String(','); - var count = 0; - var currentElement = ''; - - for( x=0; x < str.length; x++) { - andy = str.charAt(x); - if ( comma.indexOf(andy) != -1 ) { - currentElement = currentElement.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // trim - fixedExplode[count] = currentElement; - currentElement = ""; - count++; - } else { - currentElement += andy; - } - } - - if ( currentElement != "" ) - fixedExplode[count] = currentElement; - return fixedExplode; -} -//]]> -</script> -<?php endif; ?> - -<?php endif; ?> - +<?php } ?> +<?php if ( $editing && user_can_richedit() ) { ?> +<script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script> +<?php } ?> +<?php if ( $cat_js ) { ?> +<script type="text/javascript" src="cat-js.php"></script> +<?php } ?> <?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?> <style type="text/css">* html { overflow-x: hidden; }</style> <?php endif; ?> - <?php do_action('admin_head'); ?> </head> <body> - <div id="wphead"> <h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site') ?> »</a>)</span></h1> </div> - -<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_settings('siteurl') - ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Account'); ?></a>] </p></div> +<div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_settings('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php _e('Sign Out'); ?></a>, <a href="profile.php"><?php _e('My Account'); ?></a>] </p></div> <?php require(ABSPATH . '/wp-admin/menu-header.php'); |
