Changeset 10476 for trunk/wp-admin/includes/template.php
- Timestamp:
- 02/01/2009 09:45:24 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r10451 r10476 1817 1817 $numposts = get_usernumposts( $user_object->ID ); 1818 1818 $checkbox = ''; 1819 // Check if the user for this row is editable 1819 // Check if the user for this row is editable 1820 1820 if ( current_user_can( 'edit_user', $user_object->ID ) ) { 1821 // Set up the user editing link 1821 // Set up the user editing link 1822 1822 // TODO: make profile/user-edit determination a seperate function 1823 1823 if ($current_user->ID == $user_object->ID) { … … 1827 1827 } 1828 1828 $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />"; 1829 1829 1830 1830 // Set up the hover actions for this user 1831 1831 $actions = array(); … … 1842 1842 } 1843 1843 $edit .= '</div>'; 1844 1844 1845 1845 // Set up the checkbox (because the user is editable, otherwise its empty) 1846 1846 $checkbox = "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />"; 1847 1847 1848 1848 } else { 1849 1849 $edit = '<strong>' . $user_object->user_login . '</strong>'; … … 1923 1923 $count = wp_count_comments(); 1924 1924 $index = ''; 1925 1925 1926 1926 if ( 'moderated' == $status ) { 1927 1927 $approved = "comment_approved = '0'"; … … 2616 2616 } 2617 2617 2618 2618 2619 2619 /** 2620 2620 * Print out <option> html elements for role selectors based on $wp_roles … … 2631 2631 $p = ''; 2632 2632 $r = ''; 2633 2633 2634 2634 $editable_roles = get_editable_roles(); 2635 2635 2636 2636 foreach( $editable_roles as $role => $details ) { 2637 2637 $name = translate_with_context($details['name']); … … 3403 3403 * and sets an option with the result. Has no effect when the current user 3404 3404 * is not an administrator. To run the test again the option 'can_compress_scripts' 3405 * has to be deleted. 3405 * has to be deleted. 3406 3406 * 3407 3407 * @since 2.8.0 … … 3409 3409 function compression_test() { 3410 3410 ?> 3411 <script type="text/javascript" src="load-scripts.php?test=1<?php echo ( defined('ENFORCE_GZIP') && ENFORCE_GZIP ) ? '&c=gzip' : ''; ?>"></script>3412 3411 <script type="text/javascript"> 3413 3412 /* <![CDATA[ */ 3414 (function() { 3415 var x, test = typeof wpCompressionTest == 'undefined' ? 0 : 1; 3416 if ( window.XMLHttpRequest ) { 3417 x = new XMLHttpRequest(); 3418 } else { 3419 try{x=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{x=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){};} 3413 var testCompression = { 3414 get : function(test) { 3415 var x; 3416 if ( window.XMLHttpRequest ) { 3417 x = new XMLHttpRequest(); 3418 } else { 3419 try{x=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{x=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){};} 3420 } 3421 3422 if (x) { 3423 x.onreadystatechange = function() { 3424 var r, h; 3425 if ( x.readyState == 4 ) { 3426 r = x.responseText.substr(0, 18); 3427 h = x.getResponseHeader('Content-Encoding'); 3428 testCompression.check(r, h, test); 3429 } 3430 } 3431 3432 x.open('GET', 'admin-ajax.php?action=wp-compression-test&test='+test+'&'+(new Date()).getTime(), true); 3433 x.send(''); 3434 } 3435 }, 3436 3437 check : function(r, h, test) { 3438 if ( ! r && ! test ) 3439 this.get(1); 3440 3441 if ( 1 == test ) { 3442 if ( h && ( h.match(/deflate/i) || h.match(/gzip/i) ) ) 3443 this.get('no'); 3444 else 3445 this.get(2); 3446 3447 return; 3448 } 3449 3450 if ( 2 == test ) { 3451 if ( '"wpCompressionTest' == r ) 3452 this.get('yes'); 3453 else 3454 this.get('no'); 3455 } 3420 3456 } 3421 3422 if (x) { 3423 x.open('GET', 'admin-ajax.php?action=wp-compression-test&tested='+test+'&'+(new Date()).getTime(), true); 3424 x.send(''); 3425 } 3426 })(); 3457 }; 3458 testCompression.check(); 3427 3459 /* ]]> */ 3428 3460 </script>
Note: See TracChangeset
for help on using the changeset viewer.