WordPress.org

Plugin Directory

Changeset 568697


Ignore:
Timestamp:
07/07/12 16:23:32 (22 months ago)
Author:
wpsmith
Message:

Custom Taxonomy added to list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shopp-importer/trunk/settings.php

    r568696 r568697  
    260260                    $output .= "<option value='weight' ".('weight'==$catskin_importer_type?'selected="selected"':'').">Weight [Text]</option>"; 
    261261                     
    262                     $taxonomies = get_object_taxonomies(Product::$posttype, 'names');                
     262                    $taxonomies = get_object_taxonomies( Product::$posttype, 'names' );              
    263263                    if ( ! empty( $taxonomies ) ) { 
    264264                        $output .= "<option value='custom_tax' ".('custom_tax'==$catskin_importer_type?'selected="selected"':'').">Custom Taxonomy</option>"; 
     
    266266                    $output .= "</select>";      
    267267                    $output .= "<input type='text' class='catskin_variation_group_editor' id='catskin_importer_column_map_group_{$column_number}' name='settings[catskin_importer_column_map][{$column_number}][group]' value='".$existing_map[$column_number]['group']."'  style='display:none;'  onchange='javascript:update_required();'/><label for='settings[catskin_importer_column_map][{$column_number}][group]' style='display:none;'>Variation Group</label>"; 
    268                     $output .= "<input type='text' class='catskin_variation_label_editor' id='catskin_importer_column_map_label_{$column_number}' name='settings[catskin_importer_column_map][{$column_number}][label]' value='".$existing_map[$column_number]['label']."'  style='display:none;'  onchange='javascript:update_required();'/><label for='settings[catskin_importer_column_map][{$column_number}][label]' style='display:none;'>Variation Name</label>";      
     268                    $output .= "<input type='text' class='catskin_variation_label_editor' id='catskin_importer_column_map_label_{$column_number}' name='settings[catskin_importer_column_map][{$column_number}][label]' value='".$existing_map[$column_number]['label']."'  style='display:none;'  onchange='javascript:update_required();'/><label for='settings[catskin_importer_column_map][{$column_number}][label]' style='display:none;'>Variation Name</label>"; 
     269                    if ( ! empty( $taxonomies ) ) { 
     270                        $output .= "<select class='field-type-selector' name='settings[catskin_importer_column_map][{$column_number}][custom_tax]' >"; 
     271                            $output .= "<option value='' ".('custom_tax'==$existing_map[$column_number]['custom_tax']?'selected="selected"':'').">" . __( 'Select', 'spi' ) . "</option>"; 
     272                        foreach( $taxonomies as $taxonomy ) { 
     273                            if ( 'shopp_category' == $taxonomy || 'shopp_tag' == $taxonomy ) continue; 
     274                            $t = get_taxonomy( $taxonomy ); 
     275                            $output .= "<option value='{$t->name}' ".('custom_tax'==$existing_map[$column_number]['custom_tax']?'selected="selected"':'').">{$t->label}</option>"; 
     276                        } 
     277                        $output .= "</select>"; 
     278                    } 
    269279                    return $output; 
    270280                } 
Note: See TracChangeset for help on using the changeset viewer.