Changeset 1869229
- Timestamp:
- 05/05/2018 05:45:39 PM (8 years ago)
- Location:
- pods/trunk
- Files:
-
- 10 edited
-
classes/fields/datetime.php (modified) (8 diffs)
-
classes/widgets/PodsWidgetField.php (modified) (1 diff)
-
classes/widgets/PodsWidgetForm.php (modified) (1 diff)
-
classes/widgets/PodsWidgetList.php (modified) (1 diff)
-
classes/widgets/PodsWidgetSingle.php (modified) (1 diff)
-
classes/widgets/PodsWidgetView.php (modified) (1 diff)
-
init.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
ui/fields/slider.php (modified) (2 diffs)
-
ui/front/form.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pods/trunk/classes/fields/datetime.php
r1868313 r1869229 401 401 // Try default storage format. 402 402 $date = $this->createFromFormat( static::$storage_format, (string) $value ); 403 403 404 // Try field format. 404 405 $date_local = $this->createFromFormat( $format, (string) $value ); … … 497 498 case '12': 498 499 $time_format = $this->get_time_formats( $js ); 499 $format = $time_format[ pods_v( static::$type . '_time_format', $options, 'hh_mm', true ) ]; 500 501 $format = $time_format[ pods_v( static::$type . '_time_format', $options, 'hh_mm', true ) ]; 502 500 503 break; 501 504 case '24': 502 505 $time_format_24 = $this->get_time_formats_24( $js ); 503 $format = $time_format_24[ pods_v( static::$type . '_time_format_24', $options, 'hh_mm', true ) ]; 506 507 $format = $time_format_24[ pods_v( static::$type . '_time_format_24', $options, 'hh_mm', true ) ]; 508 504 509 break; 505 510 case 'custom': … … 508 513 } else { 509 514 $format = pods_v( static::$type . '_time_format_custom_js', $options, '' ); 515 510 516 if ( empty( $format ) ) { 511 517 $format = pods_v( static::$type . '_time_format_custom', $options, '' ); … … 513 519 } 514 520 } 521 515 522 break; 516 523 default: 517 524 $format = get_option( 'time_format' ); 525 518 526 if ( $js ) { 519 527 $format = $this->convert_format( $format, array( 'source' => 'php' ) ); 520 528 } 529 521 530 break; 522 531 }//end switch … … 552 561 'y' => 'Y', 553 562 ); 554 $filter = 'pods_form_ui_field_date_formats'; 563 564 $filter = 'pods_form_ui_field_date_formats'; 565 555 566 if ( $js ) { 556 567 // @todo Method parameters? (Not supported by array_map) 557 568 $date_format = array_map( array( $this, 'convert_format' ), $date_format ); 558 $filter = 'pods_form_ui_field_date_js_formats'; 569 570 $filter = 'pods_form_ui_field_date_js_formats'; 559 571 } 560 572 … … 585 597 'hh_mm_ss' => 'h:i:s', 586 598 ); 587 $filter = 'pods_form_ui_field_time_formats'; 599 600 $filter = 'pods_form_ui_field_time_formats'; 601 588 602 if ( $js ) { 589 603 // @todo Method parameters? (Not supported by array_map) 590 604 $time_format = array_map( array( $this, 'convert_format' ), $time_format ); 591 $filter = 'pods_form_ui_field_time_js_formats'; 605 606 $filter = 'pods_form_ui_field_time_js_formats'; 592 607 } 593 608 … … 610 625 'hh_mm_ss' => 'H:i:s', 611 626 ); 612 $filter = 'pods_form_ui_field_time_formats_24'; 627 628 $filter = 'pods_form_ui_field_time_formats_24'; 629 613 630 if ( $js ) { 614 631 // @todo Method parameters? (Not supported by array_map) 615 632 $time_format_24 = array_map( array( $this, 'convert_format' ), $time_format_24 ); 633 616 634 $filter = 'pods_form_ui_field_time_js_formats_24'; 617 635 } … … 633 651 $datetime = null; 634 652 635 if ( method_exists( 'DateTime', 'createFromFormat' ) ) { 636 $timezone = get_option( 'timezone_string' ); 637 638 if ( empty( $timezone ) ) { 639 $timezone = timezone_name_from_abbr( '', get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, 0 ); 653 try { 654 if ( method_exists( 'DateTime', 'createFromFormat' ) ) { 655 $timezone = get_option( 'timezone_string' ); 656 657 if ( empty( $timezone ) ) { 658 $timezone = timezone_name_from_abbr( '', get_option( 'gmt_offset' ) * HOUR_IN_SECONDS, 0 ); 659 } 660 661 if ( ! empty( $timezone ) ) { 662 $datetimezone = new DateTimeZone( $timezone ); 663 664 $datetime = DateTime::createFromFormat( $format, (string) $date, $datetimezone ); 665 666 if ( false === $datetime ) { 667 $datetime = DateTime::createFromFormat( static::$storage_format, (string) $date, $datetimezone ); 668 } 669 670 if ( false !== $datetime && $return_timestamp ) { 671 return $datetime; 672 } 673 } 674 }//end if 675 676 if ( in_array( $datetime, array( null, false ), true ) ) { 677 if ( empty( $date ) ) { 678 $timestamp = time(); 679 } else { 680 $timestamp = strtotime( (string) $date ); 681 682 if ( $return_timestamp ) { 683 return $timestamp; 684 } 685 } 686 687 if ( $timestamp ) { 688 $datetime = new DateTime( date_i18n( static::$storage_format, $timestamp ) ); 689 } 640 690 } 641 642 if ( ! empty( $timezone ) ) { 643 $datetimezone = new DateTimeZone( $timezone ); 644 645 $datetime = DateTime::createFromFormat( $format, (string) $date, $datetimezone ); 646 647 if ( false === $datetime ) { 648 $datetime = DateTime::createFromFormat( static::$storage_format, (string) $date, $datetimezone ); 649 } 650 651 if ( false !== $datetime && $return_timestamp ) { 652 return $datetime; 653 } 654 } 655 }//end if 656 657 if ( in_array( $datetime, array( null, false ), true ) ) { 658 if ( empty( $date ) ) { 659 $timestamp = time(); 660 } else { 661 $timestamp = strtotime( (string) $date ); 662 663 if ( $return_timestamp ) { 664 return $timestamp; 665 } 666 } 667 if ( $timestamp ) { 668 $datetime = new DateTime( date_i18n( static::$storage_format, $timestamp ) ); 669 } 691 } catch ( Exception $e ) { 692 // There is no saving this time value, it's an exception to the rule. 670 693 } 671 694 -
pods/trunk/classes/widgets/PodsWidgetField.php
r1868313 r1869229 24 24 25 25 // Setup basic widget parameters. 26 $before_widget = pods_v( 'before_widget', $ instance);27 $after_widget = pods_v( 'after_widget', $ instance);28 $before_title = pods_v( 'before_title', $ instance);26 $before_widget = pods_v( 'before_widget', $args ); 27 $after_widget = pods_v( 'after_widget', $args ); 28 $before_title = pods_v( 'before_title', $args ); 29 29 $title = apply_filters( 'widget_title', pods_v( 'title', $instance ) ); 30 $after_title = pods_v( 'after_title', $ instance);31 $before_content = pods_v( 'before_content', $ instance);32 $after_content = pods_v( 'after_content', $ instance);30 $after_title = pods_v( 'after_title', $args ); 31 $before_content = pods_v( 'before_content', $args ); 32 $after_content = pods_v( 'after_content', $args ); 33 33 34 34 $args = array( -
pods/trunk/classes/widgets/PodsWidgetForm.php
r1868313 r1869229 24 24 25 25 // Setup basic widget parameters. 26 $before_widget = pods_v( 'before_widget', $ instance);27 $after_widget = pods_v( 'after_widget', $ instance);28 $before_title = pods_v( 'before_title', $ instance);26 $before_widget = pods_v( 'before_widget', $args ); 27 $after_widget = pods_v( 'after_widget', $args ); 28 $before_title = pods_v( 'before_title', $args ); 29 29 $title = apply_filters( 'widget_title', pods_v( 'title', $instance ) ); 30 $after_title = pods_v( 'after_title', $ instance);31 $before_content = pods_v( 'before_content', $ instance);32 $after_content = pods_v( 'after_content', $ instance);30 $after_title = pods_v( 'after_title', $args ); 31 $before_content = pods_v( 'before_content', $args ); 32 $after_content = pods_v( 'after_content', $args ); 33 33 34 34 $args = array( -
pods/trunk/classes/widgets/PodsWidgetList.php
r1868313 r1869229 24 24 25 25 // Setup basic widget parameters. 26 $before_widget = pods_v( 'before_widget', $ instance);27 $after_widget = pods_v( 'after_widget', $ instance);28 $before_title = pods_v( 'before_title', $ instance);26 $before_widget = pods_v( 'before_widget', $args ); 27 $after_widget = pods_v( 'after_widget', $args ); 28 $before_title = pods_v( 'before_title', $args ); 29 29 $title = apply_filters( 'widget_title', pods_v( 'title', $instance ) ); 30 $after_title = pods_v( 'after_title', $ instance);31 $before_content = pods_v( 'before_content', $ instance);32 $after_content = pods_v( 'after_content', $ instance);30 $after_title = pods_v( 'after_title', $args ); 31 $before_content = pods_v( 'before_content', $args ); 32 $after_content = pods_v( 'after_content', $args ); 33 33 34 34 $args = array( -
pods/trunk/classes/widgets/PodsWidgetSingle.php
r1868313 r1869229 23 23 24 24 // Setup basic widget parameters. 25 $before_widget = pods_v( 'before_widget', $ instance);26 $after_widget = pods_v( 'after_widget', $ instance);27 $before_title = pods_v( 'before_title', $ instance);25 $before_widget = pods_v( 'before_widget', $args ); 26 $after_widget = pods_v( 'after_widget', $args ); 27 $before_title = pods_v( 'before_title', $args ); 28 28 $title = apply_filters( 'widget_title', pods_v( 'title', $instance ) ); 29 $after_title = pods_v( 'after_title', $ instance);30 $before_content = pods_v( 'before_content', $ instance);31 $after_content = pods_v( 'after_content', $ instance);29 $after_title = pods_v( 'after_title', $args ); 30 $before_content = pods_v( 'before_content', $args ); 31 $after_content = pods_v( 'after_content', $args ); 32 32 33 33 $args = array( -
pods/trunk/classes/widgets/PodsWidgetView.php
r1868313 r1869229 24 24 25 25 // Setup basic widget parameters. 26 $before_widget = pods_v( 'before_widget', $ instance);27 $after_widget = pods_v( 'after_widget', $ instance);28 $before_title = pods_v( 'before_title', $ instance);26 $before_widget = pods_v( 'before_widget', $args ); 27 $after_widget = pods_v( 'after_widget', $args ); 28 $before_title = pods_v( 'before_title', $args ); 29 29 $title = apply_filters( 'widget_title', pods_v( 'title', $instance ) ); 30 $after_title = pods_v( 'after_title', $ instance);31 $before_content = pods_v( 'before_content', $ instance);32 $after_content = pods_v( 'after_content', $ instance);30 $after_title = pods_v( 'after_title', $args ); 31 $before_content = pods_v( 'before_content', $args ); 32 $after_content = pods_v( 'after_content', $args ); 33 33 34 34 $args = array( -
pods/trunk/init.php
r1868313 r1869229 4 4 Plugin URI: https://pods.io/ 5 5 Description: Pods is a framework for creating, managing, and deploying customized content types and fields 6 Version: 2.7.2 6 Version: 2.7.2.1 7 7 Author: Pods Framework Team 8 8 Author URI: https://pods.io/about/ … … 37 37 } else { 38 38 // Current version 39 define( 'PODS_VERSION', '2.7.2 ' );39 define( 'PODS_VERSION', '2.7.2.1' ); 40 40 41 41 // Version tracking between DB updates themselves -
pods/trunk/readme.txt
r1868338 r1869229 6 6 Requires PHP: 5.3 7 7 Tested up to: 4.9.5 8 Stable tag: 2.7.2 8 Stable tag: 2.7.2.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 180 180 181 181 == Changelog == 182 183 = 2.7.2.1 - May 5th 2018 = 184 185 **Developer and deployment enhancements** 186 187 * Added: .editorconfig file [http://editorconfig.org/](http://editorconfig.org/) #4571 (@JoryHogeveen) 188 * Updated: export-ignore list #4898 (@pglewis) 189 190 **Bug Fixes** 191 192 * Fixed: Pods Widget output #4891 (@pglewis) 193 * Fixed: Slider controls not showing #4895 (@pglewis) 194 * Fixed: Fatal exception attempting to parse Persian DateTime strings #4896 (@sc0ttkclark) 195 * Fixed: Array to string conversion notice in Pods form #4886 (@sc0ttkclark) 182 196 183 197 = 2.7.2 - May 3rd 2018 = -
pods/trunk/ui/fields/slider.php
r1868313 r1869229 34 34 <input<?php PodsForm::attributes( $attributes, $name, $form_field_type, $options ); ?> /> 35 35 36 <div class="pods-slider-field ">36 <div class="pods-slider-field pods-compat-container"> 37 37 <div id="<?php echo esc_js( $attributes['id'] ); ?>-range" class="pods-slider-range"></div> 38 38 <div id="<?php echo esc_js( $attributes['id'] ); ?>-amount-display" class="pods-slider-field-display"> … … 44 44 jQuery( function ( $ ) { 45 45 $( "#<?php echo esc_js( $attributes['id'] ); ?>-range" ).slider( { 46 orientation : '<?php echo esc_js( pods_v( $form_field_type . '_orientation', $options, 'horizontal' ) ); ?>',47 min : <?php echo esc_js( pods_v( $form_field_type . '_min', $options, 0 ) ); ?>,48 max : <?php echo esc_js( pods_v( $form_field_type . '_max', $options, 100 ) ); ?>,49 step : <?php echo esc_js( pods_v( $form_field_type . '_step', $options, 1 ) ); ?>,46 orientation : '<?php echo esc_js( pods_v( $form_field_type . '_orientation', $options, 'horizontal' ) ); ?>', 47 min : <?php echo esc_js( pods_v( $form_field_type . '_min', $options, 0 ) ); ?>, 48 max : <?php echo esc_js( pods_v( $form_field_type . '_max', $options, 100 ) ); ?>, 49 step : <?php echo esc_js( pods_v( $form_field_type . '_step', $options, 1 ) ); ?>, 50 50 51 <?php52 if ( 1 == pods_var( $form_field_type . '_range', $options, 0 ) ) {53 ?>54 range : true,55 values : [56 <?php echo esc_js( $values[0] ); ?>,57 <?php echo esc_js( $values[1] ); ?>58 ],59 slide : function ( event, ui ) {60 $( "#<?php echo esc_js( $attributes['id'] ); ?>" ).val( ui.values[0] + ',' + ui.values[1] );61 $( "#<?php echo esc_js( $attributes['id'] ); ?>-amount-display" ).html( ui.values[0] + ' - ' + ui.values[1] );62 }63 <?php64 } else {65 ?>66 range : false,67 value : <?php echo esc_js( $value ); ?>,68 slide : function ( event, ui ) {69 $( "#<?php echo esc_js( $attributes['id'] ); ?>" ).val( ui.value );70 $( "#<?php echo esc_js( $attributes['id'] ); ?>-amount-display" ).html( ui.value );71 }72 <?php73 }//end if74 ?>75 } );51 <?php 52 if ( 1 == pods_var( $form_field_type . '_range', $options, 0 ) ) { 53 ?> 54 range : true, 55 values : [ 56 <?php echo esc_js( $values[0] ); ?>, 57 <?php echo esc_js( $values[1] ); ?> 58 ], 59 slide : function ( event, ui ) { 60 $( "#<?php echo esc_js( $attributes['id'] ); ?>" ).val( ui.values[0] + ',' + ui.values[1] ); 61 $( "#<?php echo esc_js( $attributes['id'] ); ?>-amount-display" ).html( ui.values[0] + ' - ' + ui.values[1] ); 62 } 63 <?php 64 } else { 65 ?> 66 range : false, 67 value : <?php echo esc_js( $value ); ?>, 68 slide : function ( event, ui ) { 69 $( "#<?php echo esc_js( $attributes['id'] ); ?>" ).val( ui.value ); 70 $( "#<?php echo esc_js( $attributes['id'] ); ?>-amount-display" ).html( ui.value ); 71 } 72 <?php 73 }//end if 74 ?> 75 } ); 76 76 } ); 77 77 </script> -
pods/trunk/ui/front/form.php
r1868313 r1869229 109 109 * Runs before a field is outputted. 110 110 * 111 * @param sarray $field The current field.112 * @param sarray $fields All fields of the form.113 * @param sobject $pod The current Pod object.114 * @param sarray $params The form's parameters.111 * @param array $field The current field. 112 * @param array $fields All fields of the form. 113 * @param object $pod The current Pod object. 114 * @param array $params The form's parameters. 115 115 * 116 116 * @since 2.3.19 … … 119 119 120 120 $default_class = ' pods-form-ui-row-type-' . $field[ 'type' ] . ' pods-form-ui-row-name-' . PodsForm::clean( $field[ 'name' ] ); 121 $html_class = apply_filters( 'pods-field-html-class', $field ) . $default_class; 121 122 /** 123 * Filter the html class used on form field list item element. 124 * 125 * @param string $html_class The HTML class. 126 * @param array $field The current field. 127 * 128 * @since 2.7.2 129 */ 130 $html_class = apply_filters( 'pods_form_html_class', 'pods-field-html-class', $field ) . $default_class; 122 131 ?> 123 132 <li class="pods-field <?php echo esc_attr( $html_class, true ); ?>">
Note: See TracChangeset
for help on using the changeset viewer.