Some renames

git-svn-id: https://develop.svn.wordpress.org/trunk@3999 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2006-07-06 04:27:45 +00:00
parent c3ce93fbb4
commit 4ec0249ac2
9 changed files with 73 additions and 34 deletions

View File

@ -638,6 +638,50 @@ function dropdown_categories($default = 0) {
write_nested_categories(get_nested_categories($default));
}
function return_link_categories_list($parent = 0) {
global $wpdb;
return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent AND link_count > 0");
}
function get_nested_link_categories( $default = 0, $parent = 0 ) {
global $post_ID, $link_id, $mode, $wpdb;
if ($link_id) {
$checked_categories = $wpdb->get_col("
SELECT category_id
FROM $wpdb->categories, $wpdb->link2cat
WHERE $wpdb->link2cat.category_id = cat_ID AND $wpdb->link2cat.link_id = '$link_id'
");
if (count($checked_categories) == 0) {
// No selected categories, strange
$checked_categories[] = $default;
}
} else {
$checked_categories[] = $default;
}
$cats = return_link_categories_list($parent);
$result = array ();
if (is_array($cats)) {
foreach ($cats as $cat) {
$result[$cat]['children'] = get_nested_link_categories($default, $cat);
$result[$cat]['cat_ID'] = $cat;
$result[$cat]['checked'] = in_array($cat, $checked_categories);
$result[$cat]['cat_name'] = get_the_category_by_ID($cat);
}
}
usort($result, 'sort_cats');
return $result;
}
function dropdown_link_categories($default = 0) {
write_nested_categories(get_nested_link_categories($default));
}
// Dandy new recursive multiple category stuff.
function cat_rows($parent = 0, $level = 0, $categories = 0) {
global $wpdb, $class;
@ -771,11 +815,6 @@ function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $lev
}
}
function return_link_categories_list($parent = 0) {
global $wpdb;
return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY link_count DESC");
}
function wp_create_thumbnail($file, $max_side, $effect = '') {
// 1 = GIF, 2 = JPEG, 3 = PNG

View File

@ -30,7 +30,7 @@ function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}el
<div id="wphead">
<h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site &raquo;') ?></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 Profile'); ?></a>] </p></div>
<?php
require(ABSPATH . '/wp-admin/menu-header.php');

View File

@ -89,7 +89,7 @@ addLoadEvent(focusit);
</fieldset>
<fieldset id="passworddiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3>
<h3 class="dbx-handle"><?php _e('Post Password') ?></h3>
<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
</fieldset>

View File

@ -1,12 +1,12 @@
<?php
if ( ! empty($link_id) ) {
$heading = __('Edit Bookmark');
$heading = __('Edit Link');
$submit_text = __('Save Changes &raquo;');
$form = '<form name="editlink" id="editlink" method="post" action="link.php">';
$nonce_action = 'update-bookmark_' . $link_id;
} else {
$heading = __('Create Bookmark');
$submit_text = __('Add Bookmark &raquo;');
$heading = __('Add Link');
$submit_text = __('Add Link &raquo;');
$form = '<form name="addlink" id="addlink" method="post" action="link.php">';
$nonce_action = 'add-bookmark';
}
@ -43,7 +43,7 @@ function xfn_check($class, $value = '', $type = 'check') {
<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
<div class="dbx-content">
<p id="jaxcat"></p>
<ul id="categorychecklist"><?php dropdown_categories(get_settings('default_link_category')); ?></ul>
<ul id="categorychecklist"><?php dropdown_link_categories(get_settings('default_link_category')); ?></ul>
</div>
</fieldset>
@ -79,14 +79,14 @@ function xfn_check($class, $value = '', $type = 'check') {
<table class="editform" width="100%" cellspacing="2" cellpadding="5">
<tr>
<th width="20%" scope="row" valign="top"><label for="link_url"><?php _e('URI:') ?></label></th>
<td width="80%"><input type="text" name="link_url" value="<?php echo $link->link_url; ?>" style="width: 95%" /></td>
</tr>
<tr>
<th scope="row" valign="top"><label for="link_name"><?php _e('Name:') ?></label></th>
<td><input type="text" name="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td>
</tr>
<tr>
<th width="20%" scope="row" valign="top"><label for="link_url"><?php _e('Address:') ?></label></th>
<td width="80%"><input type="text" name="link_url" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td>
</tr>
<tr>
<th scope="row" valign="top"><label for="link_description"><?php _e('Description:') ?></label></th>
<td><input type="text" name="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
</tr>
@ -216,11 +216,11 @@ function xfn_check($class, $value = '', $type = 'check') {
<div class="dbx-content">
<table class="editform" width="100%" cellspacing="2" cellpadding="5">
<tr>
<th width="20%" scope="row"><?php _e('Image URI:') ?></th>
<th width="20%" scope="row"><?php _e('Image Address:') ?></th>
<td width="80%"><input type="text" name="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
</tr>
<tr>
<th scope="row"><?php _e('RSS URI:') ?> </th>
<th scope="row"><?php _e('RSS Address:') ?> </th>
<td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
</tr>
<tr>

View File

@ -69,7 +69,7 @@ addLoadEvent(focusit);
</fieldset>
<fieldset id="passworddiv" class="dbx-box">
<h3 class="dbx-handle"><?php _e('Password-Protect Page') ?></h3>
<h3 class="dbx-handle"><?php _e('Page Password') ?></h3>
<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
</fieldset>

View File

@ -18,7 +18,7 @@ require('admin-header.php');
?>
<?php if ($_GET['added']) : ?>
<div id="message" class="updated fade"><p><?php _e('Bookmark added.'); ?></p></div>
<div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div>
<?php endif; ?>
<?php
@ -27,7 +27,7 @@ require('admin-header.php');
?>
<div class="wrap">
<?php printf(__('<p>You can drag <a href="%s" title="Bookmark add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you&#8217;re on to your bookmarks! Right now this only works on Mozilla or Netscape, but we&#8217;re working on it.</p>'), "javascript:void(linkmanpopup=window.open('" . get_settings('siteurl') . "/wp-admin/link-add.php?action=popup&amp;linkurl='+escape(location.href)+'&amp;name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?>
<?php printf(__('<p>You can drag <a href="%s" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you&#8217;re on to your bookmarks! Right now this only works on Mozilla or Netscape, but we&#8217;re working on it.</p>'), "javascript:void(linkmanpopup=window.open('" . get_settings('siteurl') . "/wp-admin/link-add.php?action=popup&amp;linkurl='+escape(location.href)+'&amp;name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?>
</div>
<?php

View File

@ -73,7 +73,7 @@ if ( isset($_GET['deleted']) ) {
<div class="wrap">
<h2><?php _e('Bookmark Management'); ?></h2>
<h2><?php _e('Blogroll Management'); ?></h2>
<p><?php _e('Here you add links to sites that you visit often and share them on your blog. When you have a list of links in your sidebar to other blogs, it&#8217;s called a &#8220;blogroll.&#8221;'); ?></p>
<form id="cats" method="get" action="">
<p>Currently showing
@ -85,11 +85,11 @@ if ( isset($_GET['deleted']) ) {
</option>
<?php endforeach; ?>
</select>
bookmarks ordered by
links ordered by
<select name="order_by">
<option value="order_id" <?php if ($order_by == 'order_id') echo " selected='selected'";?>><?php _e('Bookmark ID') ?></option>
<option value="order_name" <?php if ($order_by == 'order_name') echo " selected='selected'";?>><?php _e('Name') ?></option>
<option value="order_url" <?php if ($order_by == 'order_url') echo " selected='selected'";?>><?php _e('URI') ?></option>
<option value="order_url" <?php if ($order_by == 'order_url') echo " selected='selected'";?>><?php _e('Address') ?></option>
</select>
<input type="submit" name="action" value="<?php _e('Update &raquo;') ?>" /></p>
</form>

View File

@ -15,7 +15,7 @@ if ( strstr($_SERVER['REQUEST_URI'], 'page-new.php') )
else
$menu[10] = array(__('Manage'), 'edit_posts', 'edit.php');
$menu[20] = array(__('Bookmarks'), 'manage_links', 'link-manager.php');
$menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php');
$menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php');
$menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
if ( current_user_can('edit_users') )
@ -38,9 +38,9 @@ $submenu['edit.php'][30] = array(__('Files'), 'edit_files', 'templates.php');
$submenu['edit.php'][35] = array(__('Import'), 'import', 'import.php');
$submenu['edit.php'][40] = array(__('Export'), 'import', 'export.php');
$submenu['link-manager.php'][5] = array(__('Manage Bookmarks'), 'manage_links', 'link-manager.php');
$submenu['link-manager.php'][10] = array(__('Add Bookmark'), 'manage_links', 'link-add.php');
$submenu['link-manager.php'][20] = array(__('Import Bookmarks'), 'manage_links', 'link-import.php');
$submenu['link-manager.php'][5] = array(__('Manage Blogroll'), 'manage_links', 'link-manager.php');
$submenu['link-manager.php'][10] = array(__('Add Link'), 'manage_links', 'link-add.php');
$submenu['link-manager.php'][20] = array(__('Import Links'), 'manage_links', 'link-import.php');
if ( current_user_can('edit_users') ) {
$submenu['users.php'][5] = array(__('Authors &amp; Users'), 'edit_users', 'users.php');

View File

@ -28,6 +28,13 @@ $bookmarklet_height= 440;
<input type="hidden" name="checkuser_id" value="<?php echo $user_ID ?>" />
</p>
<h3><?php _e('Personal Options'); ?></h3>
<p><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_user_option('rich_editing')); ?> />
<?php _e('Use the visual editor when writing') ?></label></p>
<?php do_action('profile_personal_options'); ?>
<fieldset>
<legend><?php _e('Name'); ?></legend>
<p><label><?php _e('Username: (no editing)'); ?><br />
@ -110,13 +117,6 @@ if ( $show_password_fields ) :
<br clear="all" />
<h3><?php _e('Personal Options'); ?></h3>
<p><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_user_option('rich_editing')); ?> />
<?php _e('Use the visual rich editor when writing') ?></label></p>
<?php do_action('profile_personal_options'); ?>
<table width="99%" border="0" cellspacing="2" cellpadding="3" class="editform">
<?php
if(count($profileuser->caps) > count($profileuser->roles)):