WordPress.org

Plugin Directory

Changeset 337613


Ignore:
Timestamp:
01/26/11 21:44:07 (3 years ago)
Author:
JustinSainton
Message:

More category page work...not done...but not breaking anything...gotta get past the permissions issue!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-e-commerce/branches/3.8-development/wpsc-admin/includes/save-data.functions.php

    r337351 r337613  
    4242add_action( 'wpsc_product_category_edit_form_fields', 'wpsc_admin_category_forms_edit' ); // After left-col 
    4343 
    44 //add_action("created_wpsc_product_category", $term_id, $tt_id); //After created 
    45 //add_action("edited_wpsc_product_category", $term_id, $tt_id); //After Saved 
     44add_action( 'created_wpsc_product_category', 'wpsc_save_category_set' ); //After created 
     45add_action( 'edited_wpsc_product_category', 'wpsc_save_category_set' ); //After saved 
    4646 
    4747/** 
     
    251251                                </td> 
    252252            </tr> 
    253             <?php   } 
    254              _e('Delete Image', 'wpsc'); ?><input type='checkbox' name='deleteimage' value='1' /><br/><br/> 
     253            <?php    
     254                            } 
     255                        ?> 
    255256        </div> 
    256257    </div> 
    257  
    258 <!--  SHORT CODE META BOX only display if product has been created --> 
    259  
    260 <?php if ( isset( $_GET["tag_ID"] ) ) {?> 
    261  
    262         <div id="poststuff" class="postbox"> 
    263             <h3 class="hndle"><?php _e('Shortcodes and Template Tags'); ?></h3> 
    264             <div class="inside"> 
    265                 <?php 
    266                 $output = ''; 
    267                 $product = get_term($_GET["category_id"], "wpsc_product_category" ); 
    268                 $output .= " <span class='wpscsmall description'>Template tags and Shortcodes are used to display a particular category or group within your theme / template or any wordpress page or post.</span>\n\r"; 
    269                 $output .="<div class='inside'>\n\r"; 
    270                 $output .="<div class='editing_this_group form_table'>"; 
    271                 $output .="<dl>\n\r"; 
    272                 $output .="<dt>Display Category Shortcode: </dt>\n\r"; 
    273                 $output .="<dd> [wpsc_products category_url_name='{$product->slug}']</dd>\n\r"; 
    274                 $output .="<dt>Display Category Template Tag: </dt>\n\r"; 
    275                 $output .="<dd> &lt;?php echo wpsc_display_products_page(array('category_url_name'=>'{$product->slug}')); ?&gt;</dd>\n\r"; 
    276                 $output .="</dl>\n\r"; 
    277                 $output .= "</div></div>"; 
    278             $output .= "</div>"; 
    279         $output .= "</div>"; 
    280         echo $output; 
    281 }?> 
    282258 
    283259<!-- START OF TARGET MARKET SELECTION --> 
     
    369345    <tr> 
    370346        <td> 
    371             <?php wp_nonce_field('edit-category', 'wpsc-edit-category'); ?> 
    372347            <input type='hidden' name='wpsc_admin_action' value='wpsc-category-set' /> 
    373348        </td> 
     
    603578    <tr> 
    604579        <td> 
    605             <?php wp_nonce_field('edit-category', 'wpsc-edit-category'); ?> 
    606580            <input type='hidden' name='wpsc_admin_action' value='wpsc-category-set' /> 
    607581        </td> 
     
    615589 * @return nothing 
    616590 */ 
    617 function wpsc_save_category_set() { 
     591function wpsc_save_category_set($term_id) { 
    618592    global $wpdb; 
    619      
    620     if(($_POST['submit_action'] == "add") || ($_POST['submit_action'] == "edit")) { 
    621         check_admin_referer('edit-category', 'wpsc-edit-category'); 
     593    if( !empty( $_POST ) ) { 
    622594        /* Image Processing Code*/ 
    623595        if(($_FILES['image'] != null) && preg_match("/\.(gif|jp(e)*g|png){1}$/i",$_FILES['image']['name'])) { 
     
    793765    } 
    794766} 
    795      
    796     $sendback = remove_query_arg(array( 
    797         'wpsc_admin_action', 
    798         'delete_category', 
    799         '_wpnonce', 
    800         'category_id' 
    801     )); 
    802     $sendback = add_query_arg('message', 1, $sendback); 
    803     wp_redirect($sendback); 
    804767} 
    805768 
Note: See TracChangeset for help on using the changeset viewer.