Changeset 1685658
- Timestamp:
- 06/26/2017 05:08:47 PM (9 years ago)
- Location:
- redi-restaurant-reservation/trunk
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
redi-restaurant-reservation.php (modified) (4 diffs)
-
redi.php (modified) (1 diff)
-
templates/admin.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
redi-restaurant-reservation/trunk
- Property svn:mergeinfo changed
/redi-restaurant-reservation/branches/custom_fields_API merged: 1684737,1684774,1685636
- Property svn:mergeinfo changed
-
redi-restaurant-reservation/trunk/redi-restaurant-reservation.php
r1654604 r1685658 460 460 $this->options[ 'customfields_save_to' ] = CustomFieldsSaveTo::API; 461 461 462 for ( $i = 1; $i != CUSTOM_FIELDS; $i++ ) {462 for ( $i = 0; $i != CUSTOM_FIELDS; $i++ ) { 463 463 $field_id = 'field_' . $i . '_id'; 464 464 $field_name = 'field_' . $i . '_name'; … … 630 630 // Get custom fields from wordpress options 631 631 $custom_fields = array(); 632 for ( $i = 1; $i != CUSTOM_FIELDS; $i ++ ) {632 for ( $i = 0; $i != CUSTOM_FIELDS; $i ++ ) { 633 633 $field_name = 'field_' . $i . '_name'; 634 634 $field_type = 'field_' . $i . '_type'; … … 1058 1058 // Get custom fields from wordpress options 1059 1059 $custom_fields = array(); 1060 for ( $i = 1; $i != CUSTOM_FIELDS; $i ++ ) {1060 for ( $i = 0; $i != CUSTOM_FIELDS; $i ++ ) { 1061 1061 $field_name = 'field_' . $i . '_name'; 1062 1062 $field_type = 'field_' . $i . '_type'; … … 1485 1485 $comment = ''; 1486 1486 $parameters = array(); 1487 for ( $i = 1; $i != CUSTOM_FIELDS; $i++ ) {1487 for ( $i = 0; $i != CUSTOM_FIELDS; $i++ ) { 1488 1488 if ( isset( $_POST[ 'field_' . $i ] ) ) { 1489 1489 -
redi-restaurant-reservation/trunk/redi.php
r1654604 r1685658 61 61 private $ApiKey; 62 62 63 public function __construct( $ApiKey ) { 64 $this->ApiKey = $ApiKey; 65 } 63 66 public function Redi( $ApiKey ) { 64 67 $this->ApiKey = $ApiKey; -
redi-restaurant-reservation/trunk/templates/admin.php
r1654604 r1685658 57 57 } 58 58 } 59 jQuery(function () {60 jQuery('#add_field').on('click', function(){61 alert(1);62 });63 });64 65 59 </script> 66 60 <?php $admin_slug = 'redi-restaurant-reservation-settings' ?> … … 402 396 </label> 403 397 </th> 398 <th> 399 400 </th> 404 401 </tr> 405 402 </thead> 406 <?php //foreach($custom_fields as $i => $custom_field):?> 407 <?php for ( $i = 1; $i != CUSTOM_FIELDS; $i++ ):403 404 <?php for ( $i = 0; $i != CUSTOM_FIELDS; $i++ ): 408 405 if ( ! isset( $custom_fields[ $i ] ) ) { 409 406 $custom_fields[ $i ] = (object) array( … … 418 415 ?> 419 416 <?php $field_id = ('field_'.$i.'_id');?> 420 <input type="hidden" id="<?php echo $field_id;?>" name="<?php echo $field_id;?>" value="<?php echo $custom_field->Id ?>" /> 417 421 418 <tr> 422 419 <td> 420 <input type="hidden" id="<?php echo $field_id;?>" name="<?php echo $field_id;?>" value="<?php echo $custom_field->Id ?>" /> 423 421 <?php $field_name=('field_'.$i.'_name'); ?> 424 422 <input type="text" id="<?php echo $field_name; ?>" name="<?php echo $field_name; ?>" value="<?php echo $custom_field->Name; ?>"/> … … 426 424 <td style="vertical-align: top;"> 427 425 <?php $field_type=('field_'.$i.'_type'); ?> 428 <select onchange="set_name('<?php echo $field_name; ?>',this.options[this.selectedIndex].value);" class="field_type" name="<?php echo $field_type; ?>" >426 <select onchange="set_name('<?php echo $field_name; ?>',this.options[this.selectedIndex].value);" class="field_type" name="<?php echo $field_type; ?>" id="<?php echo $field_type; ?>"> 429 427 <option value="text" <?php if ($custom_field->Type === 'text'):?>selected="selected"<?php endif?>><?php _e('Text field', 'redi-restaurant-reservation'); ?></option> 430 428 <option value="checkbox" <?php if ($custom_field->Type === 'checkbox'):?>selected="selected"<?php endif?>><?php _e('Check box', 'redi-restaurant-reservation'); ?></option> … … 436 434 <td> 437 435 <?php $field_required=('field_'.$i.'_required'); ?> 438 <input type="checkbox" name="<?php echo $field_required; ?>" <?php if ($custom_field->Required): ?>checked="checked"<?php endif?>>436 <input type="checkbox" id="<?php echo $field_required; ?>" name="<?php echo $field_required; ?>" <?php if ($custom_field->Required): ?>checked="checked"<?php endif?>> 439 437 </td> 440 438 <td> 441 439 <?php $field_message=('field_'.$i.'_message'); ?> 442 <input type="text" name="<?php echo $field_message;?>" value="<?php echo $custom_field->Message ?>" style="width:250px;"> 443 </td> 444 </tr> 445 446 <?php endfor; // endforeach; ?> 440 <input type="text" id="<?php echo $field_message;?>" name="<?php echo $field_message;?>" value="<?php echo $custom_field->Message ?>" style="width:250px;"> 441 </td> 442 <td> 443 <a onclick="jQuery('#<?php echo $field_name; ?>').val(''); jQuery('#<?php echo $field_message; ?>').val(''); jQuery('#<?php echo $field_type; ?>').val('text'); jQuery('#<?php echo $field_required; ?>').attr('checked', false);">clear</a> 444 </td> 445 </tr> 446 447 <?php endfor; ?> 447 448 </table> 448 <!-- <a href="#" id="add_field" >add another field</a>-->449 449 <!-- /custom fields--> 450 450 <p class="description">
Note: See TracChangeset
for help on using the changeset viewer.