Changeset 3422 for trunk/wp-admin/admin-header.php
- Timestamp:
- 01/10/2006 05:16:17 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/admin-header.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r3383 r3422 1 1 <?php 2 2 @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 3 if (!isset($_GET["page"])) require_once('admin.php'); ?> 3 if (!isset($_GET["page"])) require_once('admin.php'); 4 if ( $list_js || $cat_js ) 5 $sack_js = true; 6 if ( $editing ) { 7 $dbx_js = true; 8 $cat_js = true; 9 } 10 ?> 4 11 <?php get_admin_page_title(); ?> 5 12 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 6 13 <html xmlns="http://www.w3.org/1999/xhtml"> 7 14 <head> 15 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" /> 8 16 <title><?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress</title> 9 17 <link rel="stylesheet" href="<?php echo get_settings('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" /> 10 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />11 12 18 <script type="text/javascript"> 13 19 //<![CDATA[ 14 15 function addLoadEvent(func) { 16 if ( typeof wpOnload != 'function' ) { 17 wpOnload = func; 18 } else { 19 var oldonload = wpOnload; 20 wpOnload = function() { 21 oldonload(); 22 func(); 23 } 24 } 25 } 26 27 <?php if ( isset($xfn) ) : ?> 28 29 function GetElementsWithClassName(elementName, className) { 30 var allElements = document.getElementsByTagName(elementName); 31 var elemColl = new Array(); 32 for (i = 0; i < allElements.length; i++) { 33 if (allElements[i].className == className) { 34 elemColl[elemColl.length] = allElements[i]; 35 } 36 } 37 return elemColl; 38 } 39 40 function meChecked() { 41 var undefined; 42 var eMe = document.getElementById('me'); 43 if (eMe == undefined) return false; 44 else return eMe.checked; 45 } 46 47 function upit() { 48 var isMe = meChecked(); //document.getElementById('me').checked; 49 var inputColl = GetElementsWithClassName('input', 'valinp'); 50 var results = document.getElementById('link_rel'); 51 var linkText, linkUrl, inputs = ''; 52 for (i = 0; i < inputColl.length; i++) { 53 inputColl[i].disabled = isMe; 54 inputColl[i].parentNode.className = isMe ? 'disabled' : ''; 55 if (!isMe && inputColl[i].checked && inputColl[i].value != '') { 56 inputs += inputColl[i].value + ' '; 57 } 58 } 59 inputs = inputs.substr(0,inputs.length - 1); 60 if (isMe) inputs='me'; 61 results.value = inputs; 62 } 63 64 function blurry() { 65 if (!document.getElementById) return; 66 67 var aInputs = document.getElementsByTagName('input'); 68 69 for (var i = 0; i < aInputs.length; i++) { 70 aInputs[i].onclick = aInputs[i].onkeyup = upit; 71 } 72 } 73 74 addLoadEvent(blurry); 75 <?php endif; ?> 20 function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}} 76 21 //]]> 77 22 </script> 78 23 <script type="text/javascript" src="../wp-includes/js/fat.js"></script> 24 <?php if ( $xfn_js ) { ?> 25 <script type="text/javascript" src="xfn.js"></script> 26 <?php } ?> 27 <?php if ( $sack_js ) { ?> 79 28 <script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script> 29 <?php } ?> 30 <?php if ( $list_js ) { ?> 80 31 <script type="text/javascript" src="list-manipulation.js"></script> 81 <?php if ( isset( $editing ) ) : ?> 82 <?php if ( $editing && user_can_richedit() ) : ?> 83 <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script> 84 <?php endif; ?> 32 <?php } ?> 33 <?php if ( $dbx_js ) { ?> 85 34 <script type="text/javascript" src="../wp-includes/js/dbx.js"></script> 86 35 <script type="text/javascript"> 87 36 //<![CDATA[ 88 addLoadEvent( function() {37 addLoadEvent( function() { 89 38 <?php switch ( $pagenow ) : case 'post.php' : ?> 90 var manager = new dbxManager('postmeta'); //session ID [/-_a-zA-Z0-9/] 39 var manager = new dbxManager('postmeta'); 91 40 <?php break; case 'page-new.php' : ?> 92 var manager = new dbxManager('pagemeta'); //session ID [/-_a-zA-Z0-9/] 41 var manager = new dbxManager('pagemeta'); 93 42 <?php break; endswitch; ?> 94 });43 }); 95 44 //]]> 96 45 </script> 97 46 <script type="text/javascript" src="../wp-includes/js/dbx-key.js"></script> 98 99 <?php if ( current_user_can('manage_categories') ) : ?> 100 <style type="text/css"> 101 #newcat { width: 120px; margin-right: 5px; } 102 input#catadd { background: #a4a4a4; 103 border-bottom: 1px solid #898989; 104 border-left: 1px solid #bcbcbc; 105 border-right: 1px solid #898989; 106 border-top: 1px solid #bcbcbc; 107 color: #fff; 108 font-size: 10px; 109 padding: 0; 110 margin: 0; 111 font-weight: bold; 112 height: 20px; 113 margin-bottom: 2px; 114 text-align: center; 115 width: 37px; } 116 #howto { 117 font-size: 11px; 118 margin: 0 5px; 119 display: block; 120 } 121 #jaxcat { 122 margin: 0; 123 padding: 0; 124 } 125 </style> 126 <script type="text/javascript"> 127 //<![CDATA[ 128 var ajaxCat = new sack(); 129 var newcat; 130 131 function newCatAddIn() { 132 if ( !document.getElementById('jaxcat') ) return false; 133 var ajaxcat = document.createElement('span'); 134 ajaxcat.id = 'ajaxcat'; 135 136 newcat = document.createElement('input'); 137 newcat.type = 'text'; 138 newcat.name = 'newcat'; 139 newcat.id = 'newcat'; 140 newcat.size = '16'; 141 newcat.setAttribute('autocomplete', 'off'); 142 newcat.onkeypress = ajaxNewCatKeyPress; 143 144 var newcatSub = document.createElement('input'); 145 newcatSub.type = 'button'; 146 newcatSub.name = 'Button'; 147 newcatSub.id = 'catadd'; 148 newcatSub.value = '<?php echo addslashes(__('Add')); ?>'; 149 newcatSub.onclick = ajaxNewCat; 150 151 ajaxcat.appendChild(newcat); 152 ajaxcat.appendChild(newcatSub); 153 document.getElementById('jaxcat').appendChild(ajaxcat); 154 155 howto = document.createElement('span'); 156 howto.innerHTML = '<?php echo addslashes(__('Separate multiple categories with commas.')); ?>'; 157 howto.id = 'howto'; 158 ajaxcat.appendChild(howto); 159 } 160 161 addLoadEvent(newCatAddIn); 162 163 function getResponseElement() { 164 var p = document.getElementById('ajaxcatresponse'); 165 if (!p) { 166 p = document.createElement('span'); 167 document.getElementById('jaxcat').appendChild(p); 168 p.id = 'ajaxcatresponse'; 169 } 170 return p; 171 } 172 173 function newCatLoading() { 174 var p = getResponseElement(); 175 p.innerHTML = '<?php echo addslashes(__('Sending Data...')); ?>'; 176 } 177 178 function newCatLoaded() { 179 var p = getResponseElement(); 180 p.innerHTML = '<?php echo addslashes(__('Data Sent...')); ?>'; 181 } 182 183 function newCatInteractive() { 184 var p = getResponseElement(); 185 p.innerHTML = '<?php echo addslashes(__('Processing Request...')); ?>'; 186 } 187 188 function newCatCompletion() { 189 var p = getResponseElement(); 190 var id = 0; 191 var ids = new Array(); 192 var names = new Array(); 193 194 ids = myPload( ajaxCat.response ); 195 names = myPload( newcat.value ); 196 for ( i = 0; i < ids.length; i++ ) { 197 id = ids[i].replace(/[\n\r]+/g, ""); 198 if ( id == '-1' ) { 199 p.innerHTML = "<?php echo addslashes(__("You don't have permission to do that.")); ?>"; 200 return; 201 } 202 if ( id == '0' ) { 203 p.innerHTML = "<?php echo addslashes(__('That category name is invalid. Try something else.')); ?>"; 204 return; 205 } 206 207 var exists = document.getElementById('category-' + id); 208 209 if (exists) { 210 var moveIt = exists.parentNode; 211 var container = moveIt.parentNode; 212 container.removeChild(moveIt); 213 container.insertBefore(moveIt, container.firstChild); 214 moveIt.id = 'new-category-' + id; 215 exists.checked = 'checked'; 216 var nowClass = moveIt.className; 217 moveIt.className = nowClass + ' fade'; 218 Fat.fade_all(); 219 moveIt.className = nowClass; 220 } else { 221 var catDiv = document.getElementById('categorychecklist'); 222 var newLabel = document.createElement('label'); 223 newLabel.setAttribute('for', 'category-' + id); 224 newLabel.id = 'new-category-' + id; 225 newLabel.className = 'selectit fade'; 226 227 var newCheck = document.createElement('input'); 228 newCheck.type = 'checkbox'; 229 newCheck.value = id; 230 newCheck.name = 'post_category[]'; 231 newCheck.id = 'category-' + id; 232 newLabel.appendChild(newCheck); 233 234 var newLabelText = document.createTextNode(' ' + names[i]); 235 newLabel.appendChild(newLabelText); 236 237 catDiv.insertBefore(newLabel, catDiv.firstChild); 238 newCheck.checked = 'checked'; 239 240 Fat.fade_all(); 241 newLabel.className = 'selectit'; 242 } 243 newcat.value = ''; 244 } 245 p.parentNode.removeChild(p); 246 // var id = parseInt(ajaxCat.response, 10); 247 } 248 249 function ajaxNewCatKeyPress(e) { 250 if (!e) { 251 if (window.event) { 252 e = window.event; 253 } else { 254 return; 255 } 256 } 257 if (e.keyCode == 13) { 258 ajaxNewCat(); 259 e.returnValue = false; 260 e.cancelBubble = true; 261 return false; 262 } 263 } 264 265 function ajaxNewCat() { 266 var newcat = document.getElementById('newcat'); 267 var split_cats = new Array(1); 268 var catString = ''; 269 270 catString = 'ajaxnewcat=' + encodeURIComponent(newcat.value); 271 ajaxCat.requestFile = 'edit-form-ajax-cat.php'; 272 ajaxCat.method = 'GET'; 273 ajaxCat.onLoading = newCatLoading; 274 ajaxCat.onLoaded = newCatLoaded; 275 ajaxCat.onInteractive = newCatInteractive; 276 ajaxCat.onCompletion = newCatCompletion; 277 ajaxCat.runAJAX(catString); 278 } 279 280 function myPload( str ) { 281 var fixedExplode = new Array(); 282 var comma = new String(','); 283 var count = 0; 284 var currentElement = ''; 285 286 for( x=0; x < str.length; x++) { 287 andy = str.charAt(x); 288 if ( comma.indexOf(andy) != -1 ) { 289 currentElement = currentElement.replace(new RegExp('^\\s*(.*?)\\s*$', ''), '$1'); // trim 290 fixedExplode[count] = currentElement; 291 currentElement = ""; 292 count++; 293 } else { 294 currentElement += andy; 295 } 296 } 297 298 if ( currentElement != "" ) 299 fixedExplode[count] = currentElement; 300 return fixedExplode; 301 } 302 //]]> 303 </script> 304 <?php endif; ?> 305 306 <?php endif; ?> 307 47 <?php } ?> 48 <?php if ( $editing && user_can_richedit() ) { ?> 49 <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script> 50 <?php } ?> 51 <?php if ( $cat_js ) { ?> 52 <script type="text/javascript" src="cat-js.php"></script> 53 <?php } ?> 308 54 <?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') ) : ?> 309 55 <style type="text/css">* html { overflow-x: hidden; }</style> 310 56 <?php endif; ?> 311 312 57 <?php do_action('admin_head'); ?> 313 58 </head> 314 59 <body> 315 316 60 <div id="wphead"> 317 61 <h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site') ?> »</a>)</span></h1> 318 62 </div> 319 320 <div id="user_info"><p><?php printf(__('Howdy, <strong>%s</strong>.'), $user_identity) ?> [<a href="<?php echo get_settings('siteurl') 321 ?>/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> 63 <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> 322 64 323 65 <?php
Note: See TracChangeset
for help on using the changeset viewer.