WordPress.org

Plugin Directory

Changeset 773588


Ignore:
Timestamp:
09/16/13 20:20:10 (7 months ago)
Author:
joedolson
Message:

Commit dev version.

Location:
my-content-management/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • my-content-management/trunk/mcm-custom-posts.php

    r766567 r773588  
    22if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 
    33 
    4 global $mcm_types,$mcm_fields,$mcm_extras,$mcm_enabled,$mcm_templates, 
    5 $default_mcm_types,$default_mcm_fields,$default_mcm_extras; 
     4global $mcm_types,$mcm_fields,$mcm_extras,$mcm_enabled,$mcm_templates,$default_mcm_types,$default_mcm_fields,$default_mcm_extras; 
    65 
    76function mcm_posttypes() { 
    87    global $mcm_types, $mcm_enabled; 
    98    $types = $mcm_types; $enabled = $mcm_enabled; 
     9    $i = 0; 
    1010    if ( is_array( $enabled ) ) { 
    1111        foreach ( $enabled as $key ) { 
     
    2626            $raw = $value[4]; 
    2727            $slug = ( !isset($raw['slug']) || $raw['slug'] == '' )?$key:$raw['slug']; 
     28            $icon = ($raw['menu_icon']==null)?plugins_url('images',__FILE__)."/$key.png":$raw['menu_icon']; 
    2829            $args = array( 
    2930                'labels' => $labels, 
     
    3435                'show_in_menu' => $raw['show_in_menu'], 
    3536                'show_ui' => $raw['show_ui'],  
    36                 'menu_icon' => ($raw['menu_icon']==null)?plugins_url('images',__FILE__)."/$key.png":$raw['menu_icon'], 
     37                'menu_icon' => ($icon=='')?plugins_url('images',__FILE__)."/mcm_resources.png":$icon, 
    3738                'query_var' => true, 
    3839                'rewrite' => array('slug'=>$slug,'with_front'=>false), 
    3940                'hierarchical' => $raw['hierarchical'], 
    40                 'menu_position' => 15, 
     41                'menu_position' => 25+$i, 
    4142                'has_archive' => true, 
    4243                'supports' => $raw['supports'], 
     
    4647            );  
    4748            register_post_type($key,$args); 
     49            $i++; 
    4850        } 
    4951    } 
     
    134136        $nonce_flag = true; 
    135137    } 
    136     mcm_echo_hidden($fields['args'][$id]);   
     138    mcm_echo_hidden($fields['args'][$id], $id );     
    137139    // Generate box contents 
    138140    $i = 0; 
     
    225227    if ( isset( $args[4] ) && $args[4] == 'true' ) {  $single = false; }  
    226228    $args[2] = get_post_meta($post->ID, $args[0], $single ); 
     229    $attr = array( 'height' => 80, 'width'=> 80 ); 
    227230    if(!empty($args[2]) && $args[2] != '0') { 
    228231        if ( $single ) { 
    229232            $download = wp_get_attachment_url( $args[2] ); 
    230             $img = wp_get_attachment_image( $args[2], 'thumbnail' ); 
     233            $img = wp_get_attachment_image( $args[2], array( 80, 80 ), true, $attr ); 
    231234            $download = '<a href="'.$download.'">'.$img.'</a>'; 
    232235            $copy = __('Change Media','my-content-management'); 
     
    235238            foreach ( $args[2] as $attachment ) { 
    236239                $url = wp_get_attachment_url( $attachment ); 
    237                 $img = wp_get_attachment_image( $attachment, array(80,80) ); 
     240                $img = wp_get_attachment_image( $attachment, array( 80, 80 ), true, $attr ); 
    238241                $download .= '<div class="mcm-chooser-image"><a href="'.$url.'">'.$img.'</a><span class="mcm-delete"><input type="checkbox" id="del-'.$args[0].$i.'" name="mcm_delete['.$args[0].'][]" value="'.$attachment.'" /> <label for="del-'.$args[0].$i.'">'.__('Delete','my-content-management').'</label></span></div> '; 
    239242                $i++; 
     
    245248    } 
    246249    $label_format = 
    247         '<div class="mcm_text_field mcm_field field-holder"><label for="%1$s"><strong>%2$s</strong></label> '. 
    248         '<input type="hidden" name="%1$s" value="" class="textfield" id="%1$s" /> <a href="#" class="button textfield-field">'.$copy.'</a><br />'; 
     250        '<div class="mcm_chooser_field mcm_field field-holder"><label for="%1$s"><strong>%2$s</strong></label> '. 
     251        '<input type="hidden" name="%1$s" value="%3$d" class="textfield" id="%1$s" /> <a href="#" class="button textfield-field">'.$copy.'</a><br />'; 
    249252        $label_format .= '<br /><div class="selected">'.$description.'</div>'; 
    250253        if ( $download != '' ) { $label_format .= $download; } 
     
    390393            } 
    391394        }    
    392         foreach ( $fields as $field ) { 
     395        foreach ( $fields as $set => $field ) { 
    393396            foreach ( $field as $key=>$value ) { 
    394                 if ( in_array( $value[0], $these_fields ) ) { 
     397                if ( in_array( $value[0], $these_fields ) && in_array( $set, $_POST['mcm_fieldsets'] ) ) { 
    395398                    if ( isset( $_POST[$value[0]] ) && ( !isset($value[4]) || $value[4] != 'true' ) ) { 
    396399                        update_post_meta( $post->ID, $value[0], $_POST[$value[0]] ); 
     
    487490} 
    488491 
    489 function mcm_echo_hidden($fields) { 
     492function mcm_echo_hidden($fields, $id ) { 
    490493    // finish when I add hidden fields. 
     494    echo '<input type="hidden" name="mcm_fieldsets[]" value="'.$id.'" />';   
    491495    if ( is_array( $fields ) ) { 
    492496        foreach ( $fields as $field ) { 
  • my-content-management/trunk/mcm-view-custom-posts.php

    r766567 r773588  
    169169                } 
    170170            // use this filter to insert any additional custom template tags required        
    171             $p = apply_filters('mcm_extend_posts', $p, $p, $custom ); 
     171            $p = apply_filters('mcm_extend_posts', $p, $custom ); 
    172172            // This filter is used to insert alphabetical headings. You can probably find another use for it. 
    173173            $return = apply_filters('mcm_filter_posts',$return, $p, $last_term, $elem, $type, $first, $last_post, $custom ); 
     
    233233                $p[$key] = $cfield; 
    234234            } 
    235             $p = apply_filters('mcm_extend_posts', $p, $p, $custom ); 
     235            $p = apply_filters('mcm_extend_posts', $p, $custom ); 
    236236            $this_post = mcm_run_template( $p, $display, $column, $wrapper ); 
    237237            $return .= apply_filters('mcm_filter_post',$this_post, $p, $custom ); 
  • my-content-management/trunk/my-content-management.php

    r766567 r773588  
    4242    if ($plugins) return true; 
    4343    return false; 
    44 } 
    45 if ( isset($_GET['ignore']) && $_GET['ignore'] == 'glossary' ) { 
    46     update_option( 'mcm_glossary_ignore', 'true' ); 
    47 } 
    48 if ( ! ( mcm_is_plugin_installed('/my-content-glossary') ) && get_option( 'mcm_glossary_ignore' ) != 'true' ) { 
    49     function mcm_glossary_notice() { 
    50         if ( current_user_can( 'install_plugins' ) ) { 
    51             $install = admin_url('plugin-install.php?tab=search&s=my+content+glossary'); 
    52             $ignore = admin_url('options-general.php?page=my-content-management/my-content-management.php&ignore=glossary'); 
    53             echo "<div class='error'><p>The My Content Management Glossary Filter is now an independent plug-in and must be installed separately. <a href='$install'>Install My Content Glossary</a>. <a href='$ignore'>Ignore</a></p></div>"; 
    54         } 
    55     } 
    56     add_action('admin_notices', 'mcm_glossary_notice' ); 
    5744} 
    5845 
     
    441428 
    442429function mcm_settings_page() { 
    443 global $mcm_enabled; 
    444 $enabled = $mcm_enabled; 
    445 $enabled = (isset($_POST['mcm_enabler']))?$_POST['mcm_posttypes']:$enabled; 
    446 ?> 
     430    global $mcm_enabled; 
     431    $enabled = $mcm_enabled; 
     432    $enabled = ( isset( $_POST['mcm_enabler'] ) ) ? $_POST['mcm_posttypes'] : $enabled; 
     433    ?> 
    447434    <div class='wrap mcm-settings'> 
    448435    <div id="icon-index" class="icon32"><br /></div> 
     
    494481        </div> 
    495482        </div> 
    496         </div>   
     483        </div> 
     484        <div class="metabox-holder"> 
     485        <div class="mcm-settings ui-sortable meta-box-sortables">    
     486        <div class="mcm-template-guide postbox" id="mcm-companions"> 
     487        <h3><?php _e('Companion Plug-ins','my-content-management'); ?></h3> 
     488            <div class="inside"> 
     489                <ul> 
     490                    <li><a href="http://wordpress.org/plugins/my-content-glossary/"><?php _e( 'My Content Glossary','my-content-management' ); ?></a> -- <?php _e( 'Additional functions to use with the Glossary custom post type','my-content-management'); ?> 
     491                </ul> 
     492            </div> 
     493        </div> 
     494        </div> 
     495        </div>       
    497496        <div class="metabox-holder"> 
    498497        <div class="mcm-settings ui-sortable meta-box-sortables">    
     
    575574        $option['enabled'] = $enable; 
    576575        update_option('mcm_options',$option); 
     576        flush_rewrite_rules();       
    577577        echo "<div class='updated fade'><p>".__('Enabled post types updated','my-content-management')."</p></div>"; 
    578578    } 
     
    841841            $show_fields 
    842842            $extension 
     843            <p>".__('Example shortcode:','my-content-management')."<br /><code>[my_content type='$display_value' display='full' taxonomy='mcm_category_$display_value' order='menu_order']</code></p>            
    843844            <form method='post' action='".admin_url('options-general.php?page=my-content-management/my-content-management.php')."'> 
    844845                <div><input type='hidden' name='_wpnonce' value='".wp_create_nonce('my-content-management-nonce')."' /></div> 
     
    847848                <fieldset> 
    848849                <legend>Full</legend> 
    849                 <p>".__('Example shortcode:','my-content-management')."<br /><code>[my_content type='$display_value' display='full' taxonomy='mcm_category_$display_value' order='menu_order']</code></p> 
    850850                <p class='wrappers'> 
    851                 <label for='mcm_full_list_wrapper_$value'>".__('List Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][list][full]' id='mcm_full_list_wrapper_$value'>".mcm_option_list( $list, $template['wrapper']['list']['full'] )."</select><br /> 
    852                 <label for='mcm_full_item_wrapper_$value'>".__('Item Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][item][full]' id='mcm_full_itemwrapper_$value'>".mcm_option_list( $item, $template['wrapper']['item']['full'] )."</select> 
     851                    <label for='mcm_full_list_wrapper_$value'>".__('List Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][list][full]' id='mcm_full_list_wrapper_$value'>".mcm_option_list( $list, $template['wrapper']['list']['full'] )."</select><br /> 
     852                    <label for='mcm_full_item_wrapper_$value'>".__('Item Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][item][full]' id='mcm_full_itemwrapper_$value'>".mcm_option_list( $item, $template['wrapper']['item']['full'] )."</select> 
    853853                </p> 
    854854                <p> 
    855                 <label for='mcm_full_wrapper_$value'>".__('Full Template','my-content-management')."</label><br /> <textarea name='templates[$value][full]' id='mcm_full_wrapper_$value' rows='8' cols='60'>".stripslashes(htmlentities($template['full']))."</textarea> 
     855                    <label for='mcm_full_wrapper_$value'>".__('Full Template','my-content-management')."</label><br /> <textarea name='templates[$value][full]' id='mcm_full_wrapper_$value' rows='7' cols='60'>".stripslashes(htmlentities($template['full']))."</textarea> 
    856856                </p> 
    857857                </fieldset> 
     
    859859                <legend>Excerpt</legend> 
    860860                <p class='wrappers'> 
    861                 <label for='mcm_excerpt_list_wrapper_$value'>".__('List Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][list][excerpt]' id='mcm_excerpt_list_wrapper_$value'>".mcm_option_list( $list, $template['wrapper']['list']['excerpt'] )."</select><br /> 
    862                 <label for='mcm_excerpt_item_wrapper_$value'>".__('Item Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][item][excerpt]' id='mcm_excerpt_item_wrapper_$value'>".mcm_option_list( $item, $template['wrapper']['item']['excerpt'] )."</select> 
     861                    <label for='mcm_excerpt_list_wrapper_$value'>".__('List Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][list][excerpt]' id='mcm_excerpt_list_wrapper_$value'>".mcm_option_list( $list, $template['wrapper']['list']['excerpt'] )."</select><br /> 
     862                    <label for='mcm_excerpt_item_wrapper_$value'>".__('Item Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][item][excerpt]' id='mcm_excerpt_item_wrapper_$value'>".mcm_option_list( $item, $template['wrapper']['item']['excerpt'] )."</select> 
    863863                </p> 
    864864                <p> 
    865                 <label for='mcm_excerpt_wrapper_$value'>".__('Excerpt Template','my-content-management')."</label><br /> <textarea name='templates[$value][excerpt]' id='mcm_excerpt_wrapper_$value' rows='4' cols='60'>".stripslashes(htmlentities($template['excerpt']))."</textarea> 
     865                    <label for='mcm_excerpt_wrapper_$value'>".__('Excerpt Template','my-content-management')."</label><br /> <textarea name='templates[$value][excerpt]' id='mcm_excerpt_wrapper_$value' rows='3' cols='60'>".stripslashes(htmlentities($template['excerpt']))."</textarea> 
    866866                </p> 
    867867                </fieldset> 
     
    869869                <legend>List</legend> 
    870870                <p class='wrappers'> 
    871                 <label for='mcm_list_list_wrapper_$value'>".__('List Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][list][list]' id='mcm_list_list_wrapper_$value'>".mcm_option_list( $list, $template['wrapper']['list']['list'] )."</select><br /> 
    872                 <label for='mcm_list_item_wrapper_$value'>".__('Item Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][item][list]' id='mcm_list_item_wrapper_$value'>".mcm_option_list( $item, $template['wrapper']['item']['list'] )."</select> 
     871                    <label for='mcm_list_list_wrapper_$value'>".__('List Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][list][list]' id='mcm_list_list_wrapper_$value'>".mcm_option_list( $list, $template['wrapper']['list']['list'] )."</select><br /> 
     872                    <label for='mcm_list_item_wrapper_$value'>".__('Item Wrapper','my-content-management')."</label> <select name='templates[$value][wrapper][item][list]' id='mcm_list_item_wrapper_$value'>".mcm_option_list( $item, $template['wrapper']['item']['list'] )."</select> 
    873873                </p> 
    874874                <p> 
    875                 <label for='mcm_list_wrapper_$value'>".__('List Template','my-content-management')."</label><br /> <textarea name='templates[$value][list]' id='mcm_list_wrapper_$value' rows='2' cols='60'>".stripslashes(htmlentities($template['list']))."</textarea> 
     875                    <label for='mcm_list_wrapper_$value'>".__('List Template','my-content-management')."</label><br /> <textarea name='templates[$value][list]' id='mcm_list_wrapper_$value' rows='1' cols='60'>".stripslashes(htmlentities($template['list']))."</textarea> 
    876876                </p> 
    877877                </fieldset> 
    878878                <p> 
    879                         <input type='submit' value='".sprintf( __('Save %s Templates','my-content-manager'), $label[2] )."' name='mcm_save_templates' class='button-primary' /> 
     879                    <input type='submit' value='".sprintf( __('Update %s Templates','my-content-manager'), $label[2] )."' name='mcm_save_templates' class='button-primary' /> 
    880880                </p> 
    881881                </div> 
    882882                </form> 
    883883                <h4>".__('Naming for theme templates','my-content-management')."</h4> 
    884                 <p>".__('Theme template for this taxonomy:','my-content-management')." <code>taxonomy-mcm_category_$display_value.php</code></p> 
    885                 <p>".__('Theme template for this custom post type:','my-content-management')." <code>single-mcm_$display_value.php</code></p> 
    886                 <p>".__('Theme template for archive pages with this post type:','my-content-management')." <code>archive-mcm_$display_value.php</code></p> 
     884                <ul> 
     885                    <li>".__('Theme template for this taxonomy:','my-content-management')." <code>taxonomy-mcm_category_$display_value.php</code></li> 
     886                    <li>".__('Theme template for this custom post type:','my-content-management')." <code>single-mcm_$display_value.php</code></li> 
     887                    <li>".__('Theme template for archive pages with this post type:','my-content-management')." <code>archive-mcm_$display_value.php</code></li>         
     888                </ul> 
    887889            </div> 
    888890                "; 
     
    922924        </p>         
    923925        <ul> 
    924         <li><strong><a href="#get-support" rel="external"><?php _e("Get Support",'my-content-management'); ?></a></strong> &bull; <a href="http://www.joedolson.com/articles/bugs/"><?php _e("Report a bug",'my-content-management'); ?></a></li>    
    925926            <li><form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
    926927            <div> 
     
    933934            </li> 
    934935            <li><a href="http://profiles.wordpress.org/users/joedolson/"><?php _e('Check out my other plug-ins','my-content-management'); ?></a></li> 
    935             <li><a href="http://wordpress.org/extend/plugins/my-content-management/"><?php _e('Rate this plug-in','my-content-management'); ?></a></li> 
     936            <li><a href="http://wordpress.org/support/view/plugin-reviews/my-content-management"><?php _e('Review this plug-in','my-content-management'); ?></a></li> 
    936937            <li><a href='http://translate.joedolson.com/projects/my-content-management'><?php _e('Help translate this plug-in','my-content-management'); ?></a></li> 
     938            <li><strong><a href="#get-support" rel="external"><?php _e("Get Support",'my-content-management'); ?></a></strong></li>          
    937939        </ul> 
    938940        </div> 
  • my-content-management/trunk/readme.txt

    r766567 r773588  
    44Tags: custom post types, post types, faq, testimonials, staff, glossary, sidebars, content management 
    55Requires at least: 3.2.1 
    6 Tested up to: 3.6.0 
     6Tested up to: 3.6.1 
    77License: GPLv2 or later 
    88Stable tag: 1.3.4 
     
    7474* Added fallback content parameter to mcm_custom_field function. 
    7575* If taxonomy not specified, fall back to MCM created taxonomy when generating terms. 
     76* Add support for post_tag taxonomy on all MCM created post types. 
    7677* Added media chooser option for input. 
    7778* Added rich text editor option for input. 
Note: See TracChangeset for help on using the changeset viewer.