Changeset 1546419
- Timestamp:
- 12/06/2016 11:38:40 AM (9 years ago)
- Location:
- tally-types/trunk
- Files:
-
- 11 added
- 10 edited
-
assets/css/tally-types-admin.css (modified) (3 diffs)
-
assets/images/carousel-icon.svg (added)
-
assets/images/gallery-icon.svg (added)
-
assets/images/grid-icon.svg (added)
-
assets/images/portfolio-icon.svg (added)
-
assets/images/services-icon.svg (added)
-
assets/images/slider-icon.svg (added)
-
assets/images/testimonials-icon.svg (added)
-
assets/images/vcard-icon.svg (added)
-
assets/images/video-icon.svg (added)
-
assets/js/tally-types-admin.js (modified) (1 diff)
-
includes/metabox-helper.php (modified) (13 diffs)
-
includes/settings-page.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
tally-types.php (modified) (4 diffs)
-
types/carousel.php (modified) (1 diff)
-
types/grid.php (added)
-
types/services.php (modified) (1 diff)
-
types/slider.php (added)
-
types/testimonials.php (modified) (1 diff)
-
types/vcard.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tally-types/trunk/assets/css/tally-types-admin.css
r1373491 r1546419 4 4 * Admin CSS Style of the plugin 5 5 **/ 6 7 #toplevel_page_tally-types .wp-menu-image img, 8 #menu-posts-tt_slider .wp-menu-image img, 9 #menu-posts-tt_vcard .wp-menu-image img, 10 #menu-posts-tt_testimonial .wp-menu-image img, 11 #menu-posts-tt_grid .wp-menu-image img, 12 #menu-posts-tt_service .wp-menu-image img, 13 #menu-posts-tt_carousel .wp-menu-image img{ 14 opacity:1; 15 } 16 17 6 18 .tallytypes_mb_field { 7 19 margin-bottom:20px; … … 27 39 } 28 40 .tallytypes_mb_field select{ 29 min-width:30 0px;41 min-width:30%; 30 42 } 31 43 … … 84 96 display:none; 85 97 } 98 99 100 101 .tallytypes_mb_field input[type="button"]{ 102 width: auto; 103 } -
tally-types/trunk/assets/js/tally-types-admin.js
r1373491 r1546419 6 6 7 7 jQuery(document).ready(function($){ 8 $( '.tt_color').wpColorPicker(); 9 8 10 //$('.tt-upload-btn').click(function(e) { 9 11 $('body').on('click', '.tt-upload-btn' ,function(e) { -
tally-types/trunk/includes/metabox-helper.php
r1373491 r1546419 25 25 ); 26 26 27 if($sanitize == 'wp_kses'){ 28 $value = $sanitize($value, $tags); 29 }else{ 30 $value = $sanitize($value); 27 if(function_exists($sanitize)){ 28 if($sanitize == 'wp_kses'){ 29 $value = $sanitize($value, $tags); 30 }else{ 31 $value = $sanitize($value); 32 } 31 33 } 32 34 … … 74 76 75 77 if ( isset( $_POST[$id] ) ){ 76 update_post_meta( $post_id, $id, tallytypes_mb_field_sanitize($sanitize, $_POST[$id]));78 update_post_meta( $post_id, $id, $_POST[$id] ); 77 79 78 80 } … … 90 92 tallytypes_mb_field_before($id, $title, $class); 91 93 echo '<input type="text" name="'.$name.'" id="'.$id.'" value="'.tallytypes_mb_field_sanitize($sanitize, $value).'">'; 94 tallytypes_mb_field_after($des); 95 } 96 97 98 /* Color 99 --------------------------------------*/ 100 function tallytypes_mb_field_color($arg){ 101 extract(array_merge( tallytypes_mb_field_default_arguments(), $arg )); 102 if($name == ''){ $name = $id; } 103 104 tallytypes_mb_field_before($id, $title, $class); 105 echo '<input type="text" name="'.$name.'" id="'.$id.'" value="'.tallytypes_mb_field_sanitize($sanitize, $value).'" class="tt_color">'; 92 106 tallytypes_mb_field_after($des); 93 107 } … … 154 168 echo '<div class="ttmbf_group" id="ttmbf_group_'.$id.'">'; 155 169 if(is_array($value)){ 156 foreach($value as $ valu){170 foreach($value as $key => $valu){ 157 171 echo '<div class="ttmbf_group_item">'; 158 172 echo '<div class="ttmbf_group_item_header">'; … … 165 179 tallytypes_mb_field_text(array( 166 180 'id' => $id.'title', 167 'name' => $id.' title[]',181 'name' => $id.'['.$key.'][title]', 168 182 'title' => "Title", 169 183 'value' => $valu['title'], … … 172 186 foreach($items as $item){ 173 187 $item['value'] = (isset($valu[$item['id']])) ? $valu[$item['id']] : ''; 174 $item['name'] = $id. $item['id'].'[]';175 $item['id'] = $id. $item['id'];188 $item['name'] = $id.'['.$key.']['.$item['id'].']'; 189 $item['id'] = $id.'-'.$key.'-'.$item['id']; 176 190 177 191 $field_function_name = 'tallytypes_mb_field_'.$item['type']; … … 200 214 tallytypes_mb_field_text(array( 201 215 'id' => $id.'title', 202 'name' => $id.' title[]',216 'name' => $id.'[__s__][title]', 203 217 'title' => "Title", 204 218 'value' => '', … … 206 220 )); 207 221 foreach($items as $item){ 208 $item['name'] = $id. $item['id'].'[]';209 $item['id'] = $id. $item['id'];222 $item['name'] = $id.'[__s__]['.$item['id'].']'; 223 $item['id'] = $id.'-__s__-'.$item['id']; 210 224 211 225 $field_function_name = 'tallytypes_mb_field_'.$item['type']; … … 215 229 216 230 } 217 echo '<input type="hidden" name="'.$id.' hidden[]" value="1">';231 echo '<input type="hidden" name="'.$id.'[__s__][hidden]" value="1">'; 218 232 echo '</div>'; 219 233 echo '</div>'; … … 224 238 <script type="text/javascript"> 225 239 jQuery(document).ready(function($){ 226 $(".ttmbf_group_sample :input").attr("disabled", true);227 228 $('#ttmbf_add_new_group_<?php echo $id; ?>').click(function(){ 240 $(".ttmbf_group_sample *").attr("disabled", true); 241 242 $('#ttmbf_add_new_group_<?php echo $id; ?>').click(function(){ 229 243 230 $('#ttmbf_group_sample_<?php echo $id; ?> .ttmbf_group_item').clone().appendTo("#ttmbf_group_temp_<?php echo $id; ?>");231 $("#ttmbf_group_temp_<?php echo $id; ?> :input").attr("disabled", false);232 233 $('#ttmbf_group_temp_<?php echo $id; ?> .ttmbf_group_item').clone().appendTo("#ttmbf_group_<?php echo $id; ?>");234 $( '#ttmbf_group_temp_<?php echo $id; ?> .ttmbf_group_item').remove();244 var ttmbf_section_count = $("#ttmbf_group_<?php echo $id; ?>").children().length+1; 245 var ttmbf_empty_section = $('#ttmbf_group_sample_<?php echo $id; ?> .ttmbf_group_item').prop('outerHTML'); 246 var ttmbf_filter_empty_section = ttmbf_empty_section.replace(/__s__/gi, ttmbf_section_count); 247 248 $("#ttmbf_group_<?php echo $id; ?>").append(ttmbf_filter_empty_section); 235 249 236 //$('#ttmbf_group_sample_<?php echo $id; ?> .ttmbf_group_item').clone().appendTo("#ttmbf_group_<?php echo $id; ?>");250 $("#ttmbf_group_<?php echo $id; ?> *").attr('disabled', false); 237 251 238 252 return false; … … 264 278 } 265 279 266 /* Save group267 --------------------------------------*/268 function tallytypes_mb_group_field_save($post_id, $arg){269 extract(array_merge( tallytypes_mb_field_default_arguments(), $arg ));270 271 $new_data = array();272 $count = count( $_POST[$id.'hidden'] );273 274 for ( $i = 0; $i < $count; $i++ ) {275 276 $get_form_data = $_POST[$id.'title'];277 $new_data[$i]['title'] = $get_form_data[$i];278 279 if(is_array($items)){280 foreach($items as $item){281 $get_form_data = $_POST[$id.$item['id']];282 $new_data[$i][$item['id']] = $get_form_data[$i];283 }284 }285 }286 287 update_post_meta( $post_id, $id, $new_data );288 289 }290 280 291 281 … … 355 345 }elseif($field['type'] == 'group'){ 356 346 tallytypes_mb_field_group($field); 347 }elseif($field['type'] == 'color'){ 348 tallytypes_mb_field_color($field); 357 349 } 358 350 } … … 369 361 if(is_array($fields)){ 370 362 foreach($fields as $field){ 371 if($field['type'] == 'group'){ 372 tallytypes_mb_group_field_save($post_id, $field); 373 }else{ 374 tallytypes_mb_field_save($post_id, $field); 375 } 363 tallytypes_mb_field_save($post_id, $field); 376 364 } 377 365 } -
tally-types/trunk/includes/settings-page.php
r1373491 r1546419 48 48 add_settings_field( 'testimonials', 'Enabal Testimonial', 'tallytypes_field_render_3', 'tallytypes', 'tallytypes_pluginPage_section'); 49 49 add_settings_field( 'vcard', 'Enabal vCard','tallytypes_field_render_4', 'tallytypes', 'tallytypes_pluginPage_section'); 50 add_settings_field( 'grid', 'Enabal Grid','tallytypes_field_render_5', 'tallytypes', 'tallytypes_pluginPage_section'); 51 add_settings_field( 'Slider', 'Enabal Slider','tallytypes_field_render_6', 'tallytypes', 'tallytypes_pluginPage_section'); 50 52 } 51 53 … … 101 103 echo '</select>'; 102 104 } 105 function tallytypes_field_render_5(){ 106 $id = 'grid'; 107 $options = get_option( TALLYTYPES_OPTION_NAME ); 108 $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_GRID; 109 $value = ($value == false) ? 0 : $value; 110 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; 111 echo '<option value="1" '.selected( $value, 1, false ).'>Yes</option>'; 112 echo '<option value="0" '.selected( $value, 0, false ).'>No</option>'; 113 echo '</select>'; 114 } 115 function tallytypes_field_render_6(){ 116 $id = 'slider'; 117 $options = get_option( TALLYTYPES_OPTION_NAME ); 118 $value = (isset($options[$id])) ? $options[$id] : TALLYTYPES_ENABLE_SLIDER; 119 $value = ($value == false) ? 0 : $value; 120 echo '<select name="'.TALLYTYPES_OPTION_NAME.'['.$id.']">'; 121 echo '<option value="1" '.selected( $value, 1, false ).'>Yes</option>'; 122 echo '<option value="0" '.selected( $value, 0, false ).'>No</option>'; 123 echo '</select>'; 124 } -
tally-types/trunk/readme.txt
r1373491 r1546419 3 3 Tags: tallythemes, posttype, post type, services, vcard, testimonials, carousel 4 4 Requires at least: 4.4 5 Tested up to: 4. 4.26 Stable tag: 1.05 Tested up to: 4.7 6 Stable tag: 2.0 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 26 26 == Frequently Asked Questions == 27 27 28 = What does Tally Types Setupdo? =28 = What does Tally Types do? = 29 29 It just register custom post types, taxonomies and metaboxes. 30 30 … … 37 37 38 38 == Changelog == 39 = 2.0 = 40 - Added new Post type Grid and Slider 41 - Added SVG icon for Admin acreen 39 42 40 43 = 1.0 = -
tally-types/trunk/tally-types.php
r1373491 r1546419 7 7 Plugin URI: http://tallythemes.com/ 8 8 Description: Provide Custom Post Types and Metaboxes 9 Version: 1.09 Version: 2.0 10 10 Author: TallyThemes 11 11 Author URI: http://tallythemes.com/ 12 12 License: GPLv2 or later 13 Text Domain: tally-t heme-setup13 Text Domain: tally-types 14 14 Prefix: tallytypes_ 15 15 */ … … 45 45 define( 'TALLYTYPES_ENABLE_TESTIMONIALS', apply_filters('tallytypes_enable_testimonials', true) ); 46 46 define( 'TALLYTYPES_ENABLE_VCARD', apply_filters('tallytypes_enable_vcard', true) ); 47 define( 'TALLYTYPES_ENABLE_GRID', apply_filters('tallytypes_enable_grid', true) ); 48 define( 'TALLYTYPES_ENABLE_SLIDER', apply_filters('tallytypes_enable_slider', true) ); 47 49 48 50 include('includes/metabox-helper.php'); … … 56 58 $tallytypes_is_testimonials = (isset($tallytypes_options['testimonials'])) ? $tallytypes_options['testimonials'] : TALLYTYPES_ENABLE_TESTIMONIALS; 57 59 $tallytypes_is_vcard = (isset($tallytypes_options['vcard'])) ? $tallytypes_options['vcard'] : TALLYTYPES_ENABLE_VCARD; 60 $tallytypes_is_grid = (isset($tallytypes_options['grid'])) ? $tallytypes_options['grid'] : TALLYTYPES_ENABLE_GRID; 61 $tallytypes_is_slider = (isset($tallytypes_options['slider'])) ? $tallytypes_options['slider'] : TALLYTYPES_ENABLE_SLIDER; 58 62 59 63 if($tallytypes_is_carousel == true){ … … 69 73 include('types/vcard.php'); 70 74 } 75 if($tallytypes_is_grid == true){ 76 include('types/grid.php'); 77 } 78 if($tallytypes_is_slider == true){ 79 include('types/slider.php'); 80 } -
tally-types/trunk/types/carousel.php
r1373491 r1546419 38 38 'hierarchical' => false, 39 39 'menu_position' => 101 , 40 'menu_icon' => TALLYTYPES_URL.'assets/images/carousel-icon. png',40 'menu_icon' => TALLYTYPES_URL.'assets/images/carousel-icon.svg', 41 41 'supports' => array( 'title') 42 42 ); -
tally-types/trunk/types/services.php
r1373491 r1546419 37 37 'hierarchical' => false, 38 38 'menu_position' => 101, 39 'menu_icon' => TALLYTYPES_URL.'assets/images/services-icon. png',39 'menu_icon' => TALLYTYPES_URL.'assets/images/services-icon.svg', 40 40 'supports' => array( 'title', 'editor', 'thumbnail' ) 41 41 ); -
tally-types/trunk/types/testimonials.php
r1373491 r1546419 37 37 'hierarchical' => false, 38 38 'menu_position' => 101, 39 'menu_icon' => TALLYTYPES_URL.'assets/images/testimonials-icon. png',39 'menu_icon' => TALLYTYPES_URL.'assets/images/testimonials-icon.svg', 40 40 'supports' => array( 'title', 'thumbnail' ) 41 41 ); -
tally-types/trunk/types/vcard.php
r1373491 r1546419 37 37 'hierarchical' => false, 38 38 'menu_position' => 101, 39 'menu_icon' => TALLYTYPES_URL.'assets/images/vcard-icon. png',39 'menu_icon' => TALLYTYPES_URL.'assets/images/vcard-icon.svg', 40 40 'supports' => array( 'title', 'editor', 'thumbnail' ) 41 41 );
Note: See TracChangeset
for help on using the changeset viewer.