home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Blogs / wordpress2.6.exe / wordpress2.6 / wp-admin / edit-category-form.php < prev    next >
Encoding:
PHP Script  |  2008-06-17  |  3.0 KB  |  54 lines

  1. <?php
  2. if ( ! empty($cat_ID) ) {
  3.     $heading = __('Edit Category');
  4.     $submit_text = __('Edit Category');
  5.     $form = '<form name="editcat" id="editcat" method="post" action="categories.php" class="validate">';
  6.     $action = 'editedcat';
  7.     $nonce_action = 'update-category_' . $cat_ID;
  8.     do_action('edit_category_form_pre', $category);
  9. } else {
  10.     $heading = __('Add Category');
  11.     $submit_text = __('Add Category');
  12.     $form = '<form name="addcat" id="addcat" method="post" action="categories.php" class="add:the-list: validate">';
  13.     $action = 'addcat';
  14.     $nonce_action = 'add-category';
  15.     do_action('add_category_form_pre', $category);
  16. }
  17. ?>
  18.  
  19. <div class="wrap">
  20. <h2><?php echo $heading ?></h2>
  21. <div id="ajax-response"></div>
  22. <?php echo $form ?>
  23. <input type="hidden" name="action" value="<?php echo $action ?>" />
  24. <input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
  25. <?php wp_nonce_field($nonce_action); ?>
  26.     <table class="form-table">
  27.         <tr class="form-field form-required">
  28.             <th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
  29.             <td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" aria-required="true" /><br />
  30.             <?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></td>
  31.         </tr>
  32.         <tr class="form-field">
  33.             <th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
  34.             <td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
  35.             <?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
  36.         </tr>
  37.         <tr class="form-field">
  38.             <th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th>
  39.             <td>
  40.                   <?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
  41.                 <?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?>
  42.               </td>
  43.         </tr>
  44.         <tr class="form-field">
  45.             <th scope="row" valign="top"><label for="category_description"><?php _e('Description') ?></label></th>
  46.             <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->description); ?></textarea><br />
  47.             <?php _e('The description is not prominent by default, however some themes may show it.'); ?></td>
  48.         </tr>
  49.     </table>
  50. <p class="submit"><input type="submit" class="button" name="submit" value="<?php echo $submit_text ?>" /></p>
  51. <?php do_action('edit_category_form', $category); ?>
  52. </form>
  53. </div>
  54.