[wp-cvs] wordpress/wp-admin admin-functions.php, 1.64, 1.65 admin-header.php, 1.37, 1.38 edit-page-form.php, 1.13, 1.14 wp-admin.css, 1.72, 1.73

Matthew Mullenweg saxmatt at users.sourceforge.net
Thu Dec 9 04:12:22 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15153/wp-admin

Modified Files:
	admin-functions.php admin-header.php edit-page-form.php 
	wp-admin.css 
Log Message:
Support for hidden custom fields (custom fields that start with _)

Index: wp-admin.css
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/wp-admin.css,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** wp-admin.css	7 Dec 2004 20:44:28 -0000	1.72
--- wp-admin.css	9 Dec 2004 04:12:20 -0000	1.73
***************
*** 154,157 ****
--- 154,161 ----
  }
  
+ .hidden {
+ 	display: none;
+ }
+ 
  .post-categories {
  	display: inline;

Index: edit-page-form.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit-page-form.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** edit-page-form.php	9 Dec 2004 02:57:41 -0000	1.13
--- edit-page-form.php	9 Dec 2004 04:12:20 -0000	1.14
***************
*** 123,127 ****
  
  <fieldset id="postcustom">
! <legend><?php _e('Custom Fields') ?></legend>
  <div id="postcustomstuff">
  <?php 
--- 123,127 ----
  
  <fieldset id="postcustom">
! <legend><?php _e('Custom Fields') ?> <script type="text/javascript">customToggleLink();</script></legend>
  <div id="postcustomstuff">
  <?php 

Index: admin-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin-functions.php,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** admin-functions.php	9 Dec 2004 00:44:05 -0000	1.64
--- admin-functions.php	9 Dec 2004 04:12:19 -0000	1.65
***************
*** 259,263 ****
  	global $post_ID;	
  	// Exit if no meta
! 	if (!$meta) return;	
  ?>
  <table id='meta-list' cellpadding="3">
--- 259,264 ----
  	global $post_ID;	
  	// Exit if no meta
! 	if (!$meta) return;
! 	$count = 0;
  ?>
  <table id='meta-list' cellpadding="3">
***************
*** 270,276 ****
  		
  	foreach ($meta as $entry) {
! 		$style = ('class="alternate"' == $style) ? '' : 'class="alternate"';
  		echo "
! 	<tr $style>
  		<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>
  		<td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>
--- 271,280 ----
  		
  	foreach ($meta as $entry) {
! 		++$count;
! 		if ( $count % 2 ) $style = 'alternate';
! 		else $style = '';
! 		if ( '_' == $entry['meta_key']{0} ) $style .= ' hidden';
  		echo "
! 	<tr class='$style'>
  		<td valign='top'><input name='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>
  		<td><textarea name='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>
***************
*** 327,335 ****
  </td>
  <td><input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" /></td>
! 		<td><textarea id="metavalue" name="metavalue" rows="3" cols="25" tabindex="7"></textarea></td>
  	</tr>
  
  </table>
! <p class="submit"><input type="submit" name="updatemeta" tabindex="7" value="<?php _e('Add Custom Field &raquo;') ?>" /></p>
  <?php
  }
--- 331,339 ----
  </td>
  <td><input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" /></td>
! 		<td><textarea id="metavalue" name="metavalue" rows="3" cols="25" tabindex="8"></textarea></td>
  	</tr>
  
  </table>
! <p class="submit"><input type="submit" name="updatemeta" tabindex="9" value="<?php _e('Add Custom Field &raquo;') ?>" /></p>
  <?php
  }
***************
*** 802,828 ****
  }
  
! $wp_file_descriptions = array('index.php' => __('Main Template'),
! 															'wp-layout.css' => __('Stylesheet'),
! 															'style.css' => __('Stylesheet'),
! 															'wp-comments.php' => __('Comments Template'),
! 															'comments.php' => __('Comments Template'),
! 															'wp-comments-popup.php' => __('Popup Comments Template'),
! 															'comments-popup.php' => __('Popup Comments Template'),
! 															'wp-footer.php' => __('Footer Template'),
! 															'footer.php' => __('Footer Template'),
! 															'wp-header.php' => __('Header Template'),
! 															'header.php' => __('Header Template'),
! 															'wp-sidebar.php' => __('Sidebar Template'),
! 															'sidebar.php' => __('Sidebar Template'),
! 															'archive.php' => __('Archive Template'),
! 															'category.php' => __('Category Template'),
! 															'page.php' => __('Page Template'),
! 															'search.php' => __('Search Template'),
! 															'single.php' => __('Post Template'),
! 															'404.php' => __('404 Template'),
! 															'my-hacks.php' => __('my-hacks.php (legacy hacks support)'),
! 															
! 															'.htaccess' => __('.htaccess (for rewrite rules)')
! 															);
  
  function get_file_description($file) {
--- 806,833 ----
  }
  
! $wp_file_descriptions = 
! 	array(
! 	'index.php' => __('Main Template'),
! 	'wp-layout.css' => __('Stylesheet'),
! 	'style.css' => __('Stylesheet'),
! 	'wp-comments.php' => __('Comments Template'),
! 	'comments.php' => __('Comments Template'),
! 	'wp-comments-popup.php' => __('Popup Comments Template'),
! 	'comments-popup.php' => __('Popup Comments Template'),
! 	'wp-footer.php' => __('Footer Template'),
! 	'footer.php' => __('Footer Template'),
! 	'wp-header.php' => __('Header Template'),
! 	'header.php' => __('Header Template'),
! 	'wp-sidebar.php' => __('Sidebar Template'),
! 	'sidebar.php' => __('Sidebar Template'),
! 	'archive.php' => __('Archive Template'),
! 	'category.php' => __('Category Template'),
! 	'page.php' => __('Page Template'),
! 	'search.php' => __('Search Template'),
! 	'single.php' => __('Post Template'),
! 	'404.php' => __('404 Template'),
! 	'my-hacks.php' => __('my-hacks.php (legacy hacks support)'),
! 	'.htaccess' => __('.htaccess (for rewrite rules)')
! 	);
  
  function get_file_description($file) {

Index: admin-header.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/admin-header.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** admin-header.php	25 Nov 2004 15:45:16 -0000	1.37
--- admin-header.php	9 Dec 2004 04:12:19 -0000	1.38
***************
*** 9,22 ****
  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
  
- <?php if ( isset($xfn) ) : ?>
  <script type="text/javascript">
  //<![CDATA[
  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;
--- 9,40 ----
  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_settings('blog_charset'); ?>" />
  
  <script type="text/javascript">
  //<![CDATA[
+ 
+ function customToggleLink() {
+ 	// TODO: Only show link if there's a hidden row
+ 	document.write('<small>(<a href="javascript:;" id="customtoggle" onclick="toggleHidden()"><?php _e('Show hidden'); ?></a>)</small>');
+ 	// TODO: Rotate link to say "show" or "hide"
+ 	// TODO: Use DOM
+ }
+ 
+ function toggleHidden() {
+ 	var allElements = document.getElementsByTagName('tr');
+ 	for (i = 0; i < allElements.length; i++) {
+ 		if ( allElements[i].className.indexOf('hidden') != -1 ) {
+ 			 allElements[i].className = allElements[i].className.replace('hidden', '');
+ 		}
+ 	}
+ }
+ 
+ <?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;
***************
*** 58,64 ****
  
  window.onload = blurry;
  //]]>
  </script>
- <?php endif; ?>
  
  <?php do_action('admin_head', ''); ?>
--- 76,83 ----
  
  window.onload = blurry;
+ <?php endif; ?>
+ 
  //]]>
  </script>
  
  <?php do_action('admin_head', ''); ?>




More information about the cvs mailing list