BakerMan

Untitled

May 22nd, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.32 KB | None | 0 0
  1. <?php
  2.  
  3. // Don't load directly
  4. if ( !defined( 'ABSPATH' ) ) {
  5.     die('-1');
  6. }
  7.  
  8. /**
  9.  * The Venue Meta Box
  10.  * You can customize this view by putting a replacement file of the same name (delete.php) in the events/community/ directory of your theme.
  11.  *
  12.  * @package TribeCommunityEvents
  13.  * @since  1.0
  14.  * @author Modern Tribe Inc.
  15.  */
  16.  
  17.  
  18. ?>
  19.  
  20. <tr class="venue">
  21.     <td><?php _e( 'Country:', 'tribe-events-community' ); ?></td>
  22.     <td>
  23.         <select class="chosen" tabindex="<?php $this->tabIndex(); ?>" name='venue[Country]' id="EventCountry">
  24.             <?php
  25.             $countries = TribeEventsViewHelpers::constructCountries( $postId );
  26.             $defaultCountry = tribe_get_option('defaultCountry');
  27.             if ( isset( $_VenueCountry ) && $_VenueCountry ) {
  28.                 $current = $_VenueCountry;
  29.             } elseif ( isset( $defaultCountry[1] ) && tribe_get_option( 'defaultValueReplace' ) ) {
  30.                 $current = $defaultCountry[1];
  31.             } else {
  32.                 $current = null;
  33.             }
  34.  
  35.             foreach ( $countries as $abbr => $fullname ) {
  36.                 echo '<option value="' . esc_attr( $fullname ) . '" ';
  37.  
  38.                 if($abbr == '')
  39.                     echo "disabled='disabled' ";
  40.  
  41.                 selected( $current == $fullname );
  42.                 echo '>' . esc_html( $fullname ) . '</option>';
  43.             }
  44.             ?>
  45.         </select>
  46.     </td>
  47. </tr>
  48. <tr class="venue">
  49.     <?php
  50.     if ( tribe_get_option( 'defaultValueReplace' ) ) {
  51.         $_VenueState = tribe_get_option( 'eventsDefaultState' );
  52.         $_VenueProvince = tribe_get_option( 'eventsDefaultProvince' );
  53.     }
  54.     ?>
  55.     <?php if ( !isset( $_VenueStateProvince ) || $_VenueStateProvince == '' ) $_VenueStateProvince = -1; ?>
  56.     <td><?php _e('State or Province:','tribe-events-calendar'); ?></td>
  57.     <td><input tabindex="<?php $this->tabIndex(); ?>" id="StateProvinceText" name="venue[Province]" type='text' size='25' value='<?php echo ( isset($_VenueProvince) && $_VenueProvince != '' && $_VenueProvince != -1 ) ? esc_attr($_VenueProvince) : esc_attr(''); ?>' />
  58.     <select class="chosen" tabindex="<?php $this->tabIndex(); ?>" id="StateProvinceSelect" name="venue[State]">
  59.         <option value=""><?php _e( 'Select a State:', 'tribe-events-community' ); ?></option>
  60.         <?php
  61.             foreach ( TribeEventsViewHelpers::loadStates() as $abbr => $fullname ) {
  62.                 echo '<option value="' . $abbr .'" ';
  63.                     selected( $_VenueState == $abbr );
  64.                 echo '>' . esc_html( $fullname ) . '</option>' . "\n";
  65.             }
  66.         ?>
  67.     </select>
  68.  
  69.     </td>
  70. </tr>
Advertisement
Add Comment
Please, Sign In to add comment