WordPress.org

Plugin Directory

Changeset 1694715


Ignore:
Timestamp:
07/11/17 18:28:05 (5 months ago)
Author:
netweblogic
Message:

5.7.3.1 (dev)

Location:
events-manager/trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • events-manager/trunk/admin/em-bookings.php

    r1677796 r1694715  
    8585    ?> 
    8686    <div class='wrap'> 
    87         <?php if( is_admin() ): ?><h1><?php else: ?><h2><?php endif; ?>      
     87        <?php if( is_admin() ): ?><h1 class="wp-heading-inline"><?php else: ?><h2><?php endif; ?>        
    8888            <?php echo sprintf(__('Manage %s Bookings', 'events-manager'), "'{$EM_Event->event_name}'"); ?> 
     89        <?php if( is_admin() ): ?></h1><?php endif; ?> 
    8990            <a href="<?php echo $EM_Event->get_permalink(); ?>" class="<?php echo $header_button_classes; ?>"><?php echo sprintf(__('View %s','events-manager'), __('Event', 'events-manager')) ?></a> 
    9091            <a href="<?php echo $EM_Event->get_edit_url(); ?>" class="<?php echo $header_button_classes; ?>"><?php echo sprintf(__('Edit %s','events-manager'), __('Event', 'events-manager')) ?></a> 
     
    9394            <?php endif; ?> 
    9495            <?php do_action('em_admin_event_booking_options_buttons'); ?> 
    95         <?php if( !is_admin() ): ?></h2><?php else: ?></h1><?php endif; ?> 
     96        <?php if( !is_admin() ): ?></h2><?php else: ?><hr class="wp-header-end" /><?php endif; ?> 
    9697        <?php if( !is_admin() ) echo $EM_Notices; ?>   
    9798        <div> 
     
    142143    ?> 
    143144    <div class='wrap'> 
    144         <?php if( is_admin() ): ?><h1><?php else: ?><h2><?php endif; ?> 
     145        <?php if( is_admin() ): ?><h1 class="wp-heading-inline"><?php else: ?><h2><?php endif; ?> 
    145146            <?php echo sprintf(__('Ticket for %s', 'events-manager'), "'{$EM_Event->name}'"); ?> 
     147        <?php if( is_admin() ): ?></h1><?php endif; ?> 
    146148            <a href="<?php echo $EM_Event->get_edit_url(); ?>" class="<?php echo $header_button_classes; ?>"><?php esc_html_e('View/Edit Event','events-manager') ?></a> 
    147149            <a href="<?php echo $EM_Event->get_bookings_url(); ?>" class="<?php echo $header_button_classes; ?>"><?php esc_html_e('View Event Bookings','events-manager') ?></a> 
    148150         
    149         <?php if( !is_admin() ): ?></h2><?php else: ?></h1><?php endif; ?> 
     151        <?php if( !is_admin() ): ?></h2><?php else: ?><hr class="wp-header-end" /><?php endif; ?> 
    150152        <?php if( !is_admin() ) echo $EM_Notices; ?> 
    151153        <div> 
     
    509511    ?> 
    510512    <div class='wrap'> 
    511         <?php if( is_admin() ): ?><h1><?php else: ?><h2><?php endif; ?> 
     513        <?php if( is_admin() ): ?><h1 class="wp-heading-inline"><?php else: ?><h2><?php endif; ?> 
    512514            <?php esc_html_e('Manage Person\'s Booking', 'events-manager'); ?> 
     515        <?php if( is_admin() ): ?></h1><?php endif; ?> 
    513516            <?php if( current_user_can('edit_users') ) : ?> 
    514517            <a href="<?php echo admin_url('user-edit.php?user_id='.$EM_Person->ID); ?>" class="<?php echo $header_button_classes; ?>"><?php esc_html_e('Edit User','events-manager') ?></a> 
     
    517520            <a href="<?php echo wp_nonce_url( admin_url("users.php?action=delete&amp;user=$EM_Person->ID"), 'bulk-users' ); ?>" class="<?php echo $header_button_classes; ?>"><?php esc_html_e('Delete User','events-manager') ?></a> 
    518521            <?php endif; ?> 
    519         <?php if( !is_admin() ): ?></h2><?php else: ?></h1><?php endif; ?> 
     522        <?php if( !is_admin() ): ?></h2><?php else: ?><hr class="wp-header-end" /><?php endif; ?> 
    520523        <?php if( !is_admin() ) echo $EM_Notices; ?> 
    521524        <?php do_action('em_bookings_person_header'); ?> 
  • events-manager/trunk/admin/em-docs.php

    r1651260 r1694715  
    150150                            '#_EVENTPRICERANGE' => array( 'desc' => 'Shows a "maximum - minimum" price range for available tickets at the time of display, or a single price if there is no range. Once bookings are closed this will show a 0 value, if you have enabled \'Show unavailable tickets\' in your booking settings these will be included. Price is formatted according to currency formatting in your settings page.' ), 
    151151                            '#_EVENTPRICERANGEALL' => array( 'desc' => 'Like #_EVENTPRICERANGE but shows all tickets price range whether or not bookings or individual tickets are available.' ), 
    152                             '#_EVENTPRICEMIN' => array( 'desc' => 'Shows the lowest ticket price for this event.' ), 
    153                             '#_EVENTPRICEMAX' => array( 'desc' => 'Shows the highest ticket price for this event.' ),                                
     152                            '#_EVENTPRICEMIN' => array( 'desc' => 'Shows the lowest available ticket price for this event. Will display a value of 0 if no ticket is available.' ), 
     153                            '#_EVENTPRICEMAX' => array( 'desc' => 'Shows the highest available ticket price for this event. Will display a value of 0 if no ticket is avaialble.' ), 
     154                            '#_EVENTPRICEMINALL' => array( 'desc' => 'Shows the lowest ticket price for this event, whether available or not.' ), 
     155                            '#_EVENTPRICEMAXALL' => array( 'desc' => 'Shows the highest ticket price for this event, whether available or not.' ), 
    154156                        ) 
    155157                    ), 
     
    185187                            '#_CATEGORYID' => array( 'desc' => 'Shows the category ID.' ), 
    186188                            '#_CATEGORYSLUG' => array( 'desc' => 'Shows the category slug.' ), 
    187                             '#_CATEGORYCOLOR' => array( 'desc' => 'Shows the category color (useful for inline styling), in hex format, if no color is defined #FFFFFF (white) will be used.' ), 
     189                            '#_CATEGORYCOLOR' => array( 'desc' => 'Shows the category color (useful for inline styling), in hex format, if no color is defined the default category color from your settings page will be used.' ), 
    188190                            '#_CATEGORYIMAGE' => array( 'desc' => 'Shows the category image, if available.' ), 
    189191                            '#_CATEGORYIMAGE{x,y}' => array( 'desc' => 'Shows the category image thumbnail if available, x and y are width and height respectively, both being numbers e.g. <code>#_CATEGORYIMAGE{100,100}</code>. If 0 is used for either width or height, the corresponding dimension will be proportionally sized.' ), 
     
    217219                            '#_TAGID' => array( 'desc' => 'Shows the tag ID.' ), 
    218220                            '#_TAGSLUG' => array( 'desc' => 'Shows the tag slug.' ), 
    219                             '#_TAGNOTES' => array( 'desc' => 'Shows the tag description.' ) 
     221                            '#_TAGNOTES' => array( 'desc' => 'Shows the tag description.' ), 
     222                            '#_TAGCOLOR' => array( 'desc' => 'Shows the tag color (useful for inline styling), in hex format, if no color is defined the default tag color from your settings page will be used.' ), 
     223                            '#_TAGIMAGE' => array( 'desc' => 'Shows the tag image, if available.' ), 
     224                            '#_TAGIMAGE{x,y}' => array( 'desc' => 'Shows the tag image thumbnail if available, x and y are width and height respectively, both being numbers e.g. <code>#_TAGIMAGE{100,100}</code>. If 0 is used for either width or height, the corresponding dimension will be proportionally sized.' ), 
     225                            '#_TAGIMAGEURL' => array( 'desc' => 'Shows the tag image url, if available.' ), 
    220226                        ) 
    221227                    ),           
     
    257263                            '#_LOCATIONEXCERPT' => array( 'desc' => 'If an excerpt has been added to the location, it will be used. If you added a <a href="http://en.support.wordpress.com/splitting-content/more-tag/">more tag</a> to your location description, only the content before this tag will show.' ), 
    258264                            '#_LOCATIONEXCERPT{words, ...}' => array( 'desc' => 'If an excerpt has not been added to the location, only a specific length is shown, e.g. <code>#_EVENTEXCERPT{10,...}</code> where 10 is the number of words to show and ... is what is used at the cut-off point.' ), 
     265                            '#_LOCATIONEXCERPTCUT' => array( 'desc' => 'Same as <code>#_LOCATIONEXCERPT</code> (and also accepts the <code>{words,...}</code> arguments) but will also cut excerpts as well as post content. Default word limit is 55 and cut-off is <code>[...]</code>' ), 
    259266                            '#_LOCATIONIMAGE' => array( 'desc' => 'Shows the location image.' ), 
    260267                            '#_LOCATIONIMAGE{x,y}' => array( 'desc' => 'Shows the location image thumbnail, x and y are width and height respectively, both being numbers e.g. <code>#_LOCATIONIMAGE{100,100}</code>. If 0 is used for either width or height, the corresponding dimension will be proportionally sized.' ), 
  • events-manager/trunk/admin/em-options.php

    r1677796 r1694715  
    1818                if( in_array($postKey,$numeric_options) && !is_numeric($postValue) ){ 
    1919                    //Do nothing, keep old setting. 
    20                 }elseif( $postKey == 'dbem_category_default_color' && !preg_match("/^#([abcdef0-9]{3}){1,2}?$/i",$postValue)){ 
     20                }elseif( ($postKey == 'dbem_category_default_color' || $postKey == 'dbem_tag_default_color') && !preg_match("/^#([abcdef0-9]{3}){1,2}?$/i",$postValue)){ 
    2121                    $EM_Notices->add_error( sprintf(esc_html_x('Colors must be in a valid %s format, such as #FF00EE.', 'hex format', 'events-manager'), '<a href="http://en.wikipedia.org/wiki/Web_colors">hex</a>').' '. esc_html__('This setting was not changed.', 'events-manager'), true);                     
    2222                }else{ 
  • events-manager/trunk/admin/settings/tabs/formats.php

    r1657109 r1694715  
    335335    <div class="inside"> 
    336336        <table class="form-table"> 
     337            <?php 
     338            em_options_input_text(sprintf(esc_html__('Default %s color','events-manager'), esc_html__('tag','events-manager')), 'dbem_tag_default_color', sprintf(esc_html_x('Colors must be in a valid %s format, such as #FF00EE.', 'hex format', 'events-manager'), '<a href="http://en.wikipedia.org/wiki/Web_colors">hex</a>')); 
     339            ?> 
    337340            <tr class="em-header"><td colspan="2"><h4><?php echo sprintf(__('%s Page','events-manager'),__('Tags','events-manager')); ?></h4></td></tr> 
    338341            <?php 
  • events-manager/trunk/classes/em-calendar.php

    r1651260 r1694715  
    159159        
    160160        $days_initials_array = array(); 
    161         foreach($weekdays as $weekday) { 
    162             $days_initials_array[] = esc_html(self::translate_and_trim($weekday, $day_initials_length)); 
    163         }  
     161        //translate day names, some languages may have special circumstances 
     162        if( $day_initials_length == 1 && in_array(EM_ML::$current_language, array('zh_CN', 'zh_TW')) ){ 
     163            //Chinese single initial day names are different 
     164            $days_initials_array = array('日','一','二','三','四','五','六'); 
     165        }else{ 
     166            //all other languages 
     167            foreach($weekdays as $weekday) { 
     168                $days_initials_array[] = esc_html(self::translate_and_trim($weekday, $day_initials_length)); 
     169            } 
     170        } 
    164171         
    165172        $calendar_array['links'] = array( 'previous_url'=>$previous_url, 'next_url'=>$next_url); 
  • events-manager/trunk/classes/em-categories-taxonomy.php

    r1677796 r1694715  
    11<?php 
    2 class EM_Categories_Taxonomy{ 
     2/** 
     3 * This class extends the EM_Taxonomy_Admin and adds category images and colors to the admin area. 
     4 *  
     5 * Currently, all functions here serve the purpose of getting around lack of late static binding in PHP < 5.3.  
     6 * Eventually only certain class properties need to be defined for use in the parent class via static::  
     7 * 
     8 */ 
     9class EM_Categories_Taxonomy extends EM_Taxonomy_Admin{ 
     10     
     11    public static $taxonomy_name; 
     12    public static $this_class = 'EM_Categories_Taxonomy'; //needed until 5.3 minimum is enforced for late static binding 
     13    public static $tax_class = 'EM_Category'; 
     14    public static $option_name = 'category'; 
     15    public static $name_singular = 'category'; 
     16    public static $name_plural = 'categories'; 
     17    public static $placeholder_image = '#_CATEGORYIMAGE'; 
     18    public static $placeholder_color = '#_CATEGORYCOLOR'; 
     19     
    320    public static function init(){ 
    4         add_action( EM_TAXONOMY_CATEGORY.'_edit_form_fields', array('EM_Categories_Taxonomy','form'), 10, 1); 
    5         add_action( EM_TAXONOMY_CATEGORY.'_add_form_fields', array('EM_Categories_Taxonomy','form'), 10, 1); 
    6         add_action( 'edited_'.EM_TAXONOMY_CATEGORY, array('EM_Categories_Taxonomy','save'), 10, 2); 
    7         add_action( 'create_'.EM_TAXONOMY_CATEGORY, array('EM_Categories_Taxonomy','save'), 10, 2); 
    8         add_action( 'delete_'.EM_TAXONOMY_CATEGORY, array('EM_Categories_Taxonomy','delete'), 10, 2); 
    9          
    10         add_filter('manage_edit-'.EM_TAXONOMY_CATEGORY.'_columns' , array('EM_Categories_Taxonomy','columns_add')); 
    11         add_filter('manage_'.EM_TAXONOMY_CATEGORY.'_custom_column' , array('EM_Categories_Taxonomy','columns_output'),10,3); 
    12          
    13         self::admin_init(); 
    14     } 
    15  
    16      
    17     public static function columns_add($columns) { 
    18         //prepend ID after checkbox 
    19         $columns['cat-id'] = __('ID','events-manager'); 
    20         return $columns; 
     21        self::$taxonomy_name = EM_TAXONOMY_CATEGORY; 
     22        self::static_binding(); 
     23        parent::init(); 
    2124    } 
    2225     
    23     public static function columns_output( $val, $column, $term_id ) { 
    24         switch ( $column ) { 
    25             case 'cat-id': 
    26                 return $term_id; 
    27                 break; 
    28         } 
    29         return $val; 
     26    public static function form_edit($tag){ 
     27        self::static_binding(); 
     28        parent::form_edit(); 
    3029    } 
    3130     
    32     public static function admin_init(){ 
    33         global $pagenow; 
    34         if( ($pagenow == 'edit-tags.php' || $pagenow == 'term.php') && !empty($_GET['taxonomy']) && $_GET['taxonomy'] == EM_TAXONOMY_CATEGORY){ 
    35             wp_enqueue_media(); 
    36             wp_enqueue_script( 'em-categories-admin', plugins_url().'/events-manager/includes/js/categories-admin.js', array( 'jquery','media-upload','thickbox','farbtastic' ) ); 
    37         } 
    38     } 
    39      
    40     public static function form($tag){  
    41         $category_color = '#FFFFFF'; 
    42         $category_image = $category_image_id = ''; 
    43         if( $tag != EM_TAXONOMY_CATEGORY ){ //not an add new tag form 
    44             $EM_Category = new EM_Category($tag); 
    45             $category_color = $EM_Category->get_color(); 
    46             $category_image = $EM_Category->get_image_url(); 
    47             $category_image_id = $EM_Category->get_image_id(); 
    48         } 
    49         ?> 
    50         <tr class="form-field"> 
    51             <th scope="row" valign="top"><label for="category-bgcolor"><?php esc_html_e('Color','events-manager'); ?></label></th> 
    52             <td> 
    53                 <input type="text" name="category_bgcolor" id="category-bgcolor" class="colorwell" value="<?php echo esc_attr($category_color); ?>" style="width:100px;"/><br /> 
    54                 <p class="description"><?php echo sprintf(__('Choose a color for your category. You can access this using the %s placeholder.','events-manager'),'<code>#_CATEGORYCOLOR</code>'); ?></p> 
    55                 <div id="picker" style="position:absolute; display:none; background:#DEDEDE"></div> 
    56             </td> 
    57         </tr> 
    58         <tr class="form-field"> 
    59             <th scope="row" valign="top"><label for="category-image"><?php esc_html_e('Image','events-manager'); ?></label></th> 
    60             <td id="event-tax-image"> 
    61                 <div class="img-container"> 
    62                     <?php if( !empty($category_image) ): ?> 
    63                     <img src="<?php echo $category_image; ?>" /> 
    64                     <?php endif; ?> 
    65                 </div> 
    66                 <input type="text" name="category_image" id="category-image" class="img-url" value="<?php echo esc_attr($category_image); ?>" /> 
    67                 <input type="hidden" name="category_image_id" id="category-image-id" class="img-id" value="<?php echo esc_attr($category_image_id); ?>" /> 
    68                 <p class="hide-if-no-js"> 
    69                     <input id="upload_image_button" type="button" value="<?php _e('Choose/Upload Image','events-manager'); ?>" class="upload-img-button button-secondary" /> 
    70                     <input id="delete_image_button" type="button" value="<?php _e('Remove Image','events-manager'); ?>" class="delete-img-button button-secondary" <?php if( empty($category_image) ) echo 'style="display:none;"'; ?> /> 
    71                 </p> 
    72                 <br /> 
    73                 <p class="description"><?php echo sprintf(__('Choose an image for your category, which can be displayed using the %s placeholder.','events-manager'),'<code>#_CATEGORYIMAGE</code>'); ?></p> 
    74             </td> 
    75         </tr> 
    76         <?php 
    77     } 
    78      
    79     public static function save($term_id, $tt_id){ 
    80         global $wpdb; 
    81         if (!$term_id) return; 
    82         if( !empty($_POST['category_bgcolor']) && preg_match('/^#[a-zA-Z0-9]{6}$/', $_POST['category_bgcolor']) ){ 
    83             //get results and save/update 
    84             $prev_settings = $wpdb->get_results('SELECT meta_value FROM '.EM_META_TABLE." WHERE object_id='{$term_id}' AND meta_key='category-bgcolor'"); 
    85             if( count($prev_settings) > 0 ){ 
    86                 $wpdb->update(EM_META_TABLE, array('object_id'=>$term_id,'meta_value'=>$_POST['category_bgcolor']), array('object_id'=>$term_id,'meta_key'=>'category-bgcolor')); 
    87             }else{ 
    88                 $wpdb->insert(EM_META_TABLE, array('object_id'=>$term_id,'meta_key'=>'category-bgcolor','meta_value'=>$_POST['category_bgcolor'])); 
    89             } 
    90         } 
    91         if( !empty($_POST['category_image']) ){ 
    92             //get results and save/update 
    93             $prev_settings = $wpdb->get_results('SELECT meta_value FROM '.EM_META_TABLE." WHERE object_id='{$term_id}' AND meta_key='category-image'"); 
    94             if( count($prev_settings) > 0 ){ 
    95                 $wpdb->update(EM_META_TABLE, array('object_id'=>$term_id,'meta_value'=>$_POST['category_image']), array('object_id'=>$term_id,'meta_key'=>'category-image')); 
    96             }else{ 
    97                 $wpdb->insert(EM_META_TABLE, array('object_id'=>$term_id,'meta_key'=>'category-image','meta_value'=>$_POST['category_image'])); 
    98             } 
    99             if( !empty($_POST['category_image_id']) && is_numeric($_POST['category_image_id']) ){ 
    100                 //get results and save/update 
    101                 $prev_settings = $wpdb->get_results('SELECT meta_value FROM '.EM_META_TABLE." WHERE object_id='{$term_id}' AND meta_key='category-image-id'"); 
    102                 if( count($prev_settings) > 0 ){ 
    103                     $wpdb->update(EM_META_TABLE, array('object_id'=>$term_id,'meta_value'=>$_POST['category_image_id']), array('object_id'=>$term_id,'meta_key'=>'category-image-id')); 
    104                 }else{ 
    105                     $wpdb->insert(EM_META_TABLE, array('object_id'=>$term_id,'meta_key'=>'category-image-id','meta_value'=>$_POST['category_image_id'])); 
    106                 } 
    107             } 
    108         }else{ 
    109             //check if an image exists, if so remove association 
    110             $prev_settings = $wpdb->get_results('SELECT meta_value FROM '.EM_META_TABLE." WHERE object_id='{$term_id}' AND meta_key='category-image'"); 
    111             if( count($prev_settings) > 0 ){ 
    112                 $wpdb->delete(EM_META_TABLE, array('object_id'=>$term_id,'meta_key'=>'category-image')); 
    113                 $wpdb->delete(EM_META_TABLE, array('object_id'=>$term_id,'meta_key'=>'category-image-id')); 
    114             } 
    115         } 
     31    public static function save( $term_id, $tt_id ){ 
     32        self::static_binding(); 
     33        self::save( $term_id, $tt_id ); 
    11634    } 
    11735     
    11836    public static function delete( $term_id ){ 
    119         global $wpdb; 
    120         //delete category image and color 
    121         $wpdb->query('DELETE FROM '.EM_META_TABLE." WHERE object_id='$term_id' AND (meta_key='category-image' OR meta_key='category-bgcolor')"); 
    122         //delete all events category relations 
    123         $wpdb->query('DELETE FROM '.EM_META_TABLE." WHERE meta_value='{$term_id}' AND meta_key='event-category'"); 
     37        self::static_binding(); 
     38        self::delete( $term_id ); 
     39    } 
     40     
     41    /** 
     42     * Temporary function until WP requires PHP 5.3, so that we can make use of late static binding.  
     43     * Until then, all functions needing LST should run this function before calling the parent. If all extending classes do this we shouldn't have a problem.   
     44     */ 
     45    public static function static_binding(){ 
     46        EM_Taxonomy_Admin::$taxonomy_name = self::$taxonomy_name;  
     47        EM_Taxonomy_Admin::$tax_class = self::$tax_class; 
     48        EM_Taxonomy_Admin::$option_name = self::$option_name; 
     49        EM_Taxonomy_Admin::$name_singular = self::$name_singular; 
     50        EM_Taxonomy_Admin::$name_plural = self::$name_plural; 
     51        EM_Taxonomy_Admin::$placeholder_image = self::$placeholder_image; 
     52        EM_Taxonomy_Admin::$placeholder_color = self::$placeholder_color; 
    12453    } 
    12554} 
  • events-manager/trunk/classes/em-category.php

    r1311743 r1694715  
    2121    } 
    2222} 
    23 class EM_Category extends EM_Object {    
    24     //Taxonomy Fields 
    25     var $id = ''; 
    26     var $term_id; 
    27     var $name; 
    28     var $slug; 
    29     var $term_group; 
    30     var $term_taxonomy_id; 
    31     var $taxonomy; 
    32     var $description = ''; 
    33     var $parent = 0; 
    34     var $count; 
    35     //extra attributes imposed by EM_Category 
    36     var $image_url = ''; 
    37     var $color; 
     23class EM_Category extends EM_Taxonomy { 
     24     
     25    public $option_name = 'category'; 
    3826     
    3927    /** 
     
    7058    } 
    7159     
    72     function get_color(){ 
    73         if( empty($this->color) ){ 
    74             global $wpdb; 
    75             $color = $wpdb->get_var('SELECT meta_value FROM '.EM_META_TABLE." WHERE object_id='{$this->term_id}' AND meta_key='category-bgcolor' LIMIT 1"); 
    76             $this->color = ($color != '') ? $color:get_option('dbem_category_default_color', '#FFFFFF'); 
    77         } 
    78         return $this->color; 
    79     } 
    80      
    81     function get_image_url( $size = 'full' ){ 
    82         if( empty($this->image_url) ){ 
    83             global $wpdb; 
    84             $image_url = $wpdb->get_var('SELECT meta_value FROM '.EM_META_TABLE." WHERE object_id='{$this->term_id}' AND meta_key='category-image' LIMIT 1"); 
    85             $this->image_url = ($image_url != '') ? $image_url:''; 
    86         } 
    87         return $this->image_url; 
    88     } 
    89      
    90     function get_image_id(){ 
    91         if( empty($this->image_id) ){ 
    92             global $wpdb; 
    93             $image_id = $wpdb->get_var('SELECT meta_value FROM '.EM_META_TABLE." WHERE object_id='{$this->term_id}' AND meta_key='category-image-id' LIMIT 1"); 
    94             $this->image_id = ($image_id != '') ? $image_id:''; 
    95         } 
    96         return $this->image_id; 
    97     } 
    98      
    9960    function get_url(){ 
    10061        if( empty($this->link) ){ 
     
    166127                    $replace = $this->description; 
    167128                    break; 
     129                case '#_CATEGORYIMAGEURL': 
     130                    $replace = esc_url($this->get_image_url()); 
     131                    break; 
    168132                case '#_CATEGORYIMAGE': 
    169                 case '#_CATEGORYIMAGEURL': 
    170                     if( $this->get_image_url() != ''){ 
    171                         $image_url = esc_url($this->get_image_url()); 
    172                         if($result == '#_CATEGORYIMAGEURL'){ 
    173                             $replace =  $image_url; 
    174                         }else{ 
    175                             if( empty($placeholders[3][$key]) ){ 
    176                                 $replace = "<img src='".esc_url($this->get_image_url())."' alt='".esc_attr($this->name)."'/>"; 
    177                             }else{ 
    178                                 $image_size = explode(',', $placeholders[3][$key]); 
    179                                 if( self::array_is_numeric($image_size) && count($image_size) > 1 ){ 
    180                                     if( $this->get_image_id() ){ 
    181                                         //get a thumbnail 
    182                                         if( get_option('dbem_disable_thumbnails') ){ 
    183                                             $image_attr = ''; 
    184                                             $image_args = array(); 
    185                                             if( empty($image_size[1]) && !empty($image_size[0]) ){     
    186                                                 $image_attr = 'width="'.$image_size[0].'"'; 
    187                                                 $image_args['w'] = $image_size[0]; 
    188                                             }elseif( empty($image_size[0]) && !empty($image_size[1]) ){ 
    189                                                 $image_attr = 'height="'.$image_size[1].'"'; 
    190                                                 $image_args['h'] = $image_size[1]; 
    191                                             }elseif( !empty($image_size[0]) && !empty($image_size[1]) ){ 
    192                                                 $image_attr = 'width="'.$image_size[0].'" height="'.$image_size[1].'"'; 
    193                                                 $image_args = array('w'=>$image_size[0], 'h'=>$image_size[1]); 
    194                                             } 
    195                                             $replace = "<img src='".esc_url(em_add_get_params($image_url, $image_args))."' alt='".esc_attr($this->name)."' $image_attr />"; 
    196                                         }else{ 
    197                                             //since we previously didn't store image ids along with the url to the image (since taxonomies don't allow normal featured images), sometimes we won't be able to do this, which is why we check there's a valid image id first 
    198                                             self::ms_global_switch(); 
    199                                             $replace = wp_get_attachment_image($this->get_image_id(), $image_size); 
    200                                             self::ms_global_switch_back(); 
    201                                         } 
    202                                     } 
    203                                 }else{ 
    204                                     $replace = "<img src='".esc_url($this->get_image_url())."' alt='".esc_attr($this->name)."'/>"; 
    205                                 } 
    206                             } 
    207                         } 
    208                     } 
     133                    $replace = $this->placeholder_image($replace, $placeholders, $key); 
    209134                    break; 
    210135                case '#_CATEGORYCOLOR': 
  • events-manager/trunk/classes/em-event-post.php

    r1655537 r1694715  
    331331            if( is_admin() ){ 
    332332                //admin areas don't need special ordering, so make it simple 
    333                 $wp_query->query_vars['orderby'] = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby']:'meta_value_num'; 
    334                 $wp_query->query_vars['meta_key'] = '_start_ts';  
     333                $wp_query->query_vars['orderby'] = (!empty($_REQUEST['orderby']) && $_REQUEST['orderby'] != 'date-time') ? $_REQUEST['orderby']:'meta_value_num'; 
     334                $wp_query->query_vars['meta_key'] = '_start_ts'; 
    335335                $wp_query->query_vars['order'] = (!empty($_REQUEST['order'])) ? $_REQUEST['order']:'ASC'; 
    336336            }else{ 
  • events-manager/trunk/classes/em-event-posts-admin.php

    r1651260 r1694715  
    2626            add_filter('manage_edit-'.EM_POST_TYPE_EVENT.'_columns' , array('EM_Event_Posts_Admin','columns_add')); 
    2727            add_filter('manage_'.EM_POST_TYPE_EVENT.'_posts_custom_column' , array('EM_Event_Posts_Admin','columns_output'),10,2 ); 
     28            add_filter('manage_edit-'.EM_POST_TYPE_EVENT.'_sortable_columns', array('EM_Event_Posts_Admin','sortable_columns') ); 
     29             
     30            if( empty($_GET['orderby']) ) $_GET['orderby'] = 'date-time'; 
     31            if( empty($_GET['order']) ) $_GET['order'] = 'asc'; 
    2832        } 
    2933        //clean up the views in the admin selection area - WIP 
     
    266270        return $actions; 
    267271    } 
     272     
     273    public static function sortable_columns( $columns ){ 
     274        $columns['date-time'] = 'date-time'; 
     275        return $columns; 
     276    } 
     277     
    268278} 
    269279add_action('admin_init', array('EM_Event_Posts_Admin','init')); 
     
    290300            add_filter('manage_posts_custom_column' , array('EM_Event_Recurring_Posts_Admin','columns_output'),10,1 ); 
    291301            add_action('restrict_manage_posts', array('EM_Event_Posts_Admin','restrict_manage_posts')); 
     302            add_filter( 'manage_edit-event-recurring_sortable_columns', array('EM_Event_Posts_Admin','sortable_columns') ); 
    292303            //actions 
    293304            $row_action_type = is_post_type_hierarchical( EM_POST_TYPE_EVENT ) ? 'page_row_actions' : 'post_row_actions'; 
  • events-manager/trunk/classes/em-event.php

    r1677796 r1694715  
    103103        'event_status' => array( 'name'=>'status', 'type'=>'%d', 'null'=>true ), 
    104104        'event_private' => array( 'name'=>'status', 'type'=>'%d', 'null'=>true ), 
    105         'event_attributes' => array( 'name'=>'attributes', 'type'=>'%s', 'null'=>true ), 
    106105        'blog_id' => array( 'name'=>'blog_id', 'type'=>'%d', 'null'=>true ), 
    107106        'group_id' => array( 'name'=>'group_id', 'type'=>'%d', 'null'=>true ), 
     
    307306            if( $event_post->post_status != 'auto-draft' ){ 
    308307                $event_meta = $this->get_event_meta($search_by); 
     308                $atts = em_get_attributes(); 
    309309                //Get custom fields and post meta 
    310310                foreach($event_meta as $event_meta_key => $event_meta_val){ 
    311311                    $field_name = substr($event_meta_key, 1); 
    312312                    if($event_meta_key[0] != '_'){ 
    313                         $this->event_attributes[$event_meta_key] = ( count($event_meta_val) > 1 ) ? $event_meta_val:$event_meta_val[0];                  
     313                        $this->event_attributes[$event_meta_key] = ( is_array($event_meta_val) ) ? $event_meta_val[0]:$event_meta_val;                   
    314314                    }elseif( is_string($field_name) && !in_array($field_name, $this->post_fields) ){ 
    315315                        if( array_key_exists($field_name, $this->fields) ){ 
     
    841841            } 
    842842            //Update Post Meta 
    843             foreach($this->fields as $key => $field_info){ 
     843            foreach( $this->fields as $key => $field_info ){ 
    844844                if( !in_array($key, $this->post_fields) && $key != 'event_attributes' ){ 
    845845                    update_post_meta($this->post_id, '_'.$key, $this->$key); 
    846                 }elseif($key == 'event_attributes'){ 
    847                     //attributes get saved as individual keys 
    848                     $this->event_attributes = maybe_unserialize($this->event_attributes); 
    849                     foreach($this->event_attributes as $event_attribute_key => $event_attribute){ 
    850                         if( !empty($event_attribute) ){ 
    851                             update_post_meta($this->post_id, $event_attribute_key, $event_attribute); 
    852                         }else{ 
    853                             delete_post_meta($this->post_id, $event_attribute_key); 
    854                         } 
     846                } 
     847            } 
     848            if( get_option('dbem_attributes_enabled') ){ 
     849                //attributes get saved as individual keys 
     850                $atts = em_get_attributes(); //get available attributes that EM manages 
     851                $this->event_attributes = maybe_unserialize($this->event_attributes); 
     852                foreach( $atts['names'] as $event_attribute_key ){ 
     853                    if( !empty($this->event_attributes[$event_attribute_key]) ){ 
     854                        update_post_meta($this->post_id, $event_attribute_key, $this->event_attributes[$event_attribute_key]); 
     855                    }else{ 
     856                        delete_post_meta($this->post_id, $event_attribute_key); 
    855857                    } 
    856858                } 
     
    868870            //decide whether or not event is private at this point 
    869871            $event_array['event_private'] = ( $this->post_status == 'private' ) ? 1:0; 
    870             //save event_attributes just in case 
    871             $event_array['event_attributes'] = serialize($this->event_attributes); 
    872872            //check if event truly exists, meaning the event_id is actually a valid event id 
    873873            if( !empty($this->event_id) ){ 
     
    10011001                //Get custom fields and post meta - adapted from $this->load_post_meta() 
    10021002                foreach($event_meta as $event_meta_key => $event_meta_vals){ 
     1003                    if( $event_meta_key == '_wpas_' ) continue; //allow JetPack Publicize to detect this as a new post when published 
    10031004                    if($event_meta_key[0] == '_' && is_array($event_meta_vals)){ 
    10041005                        $field_name = substr($event_meta_key, 1); 
     
    14601461        //First let's do some conditional placeholder removals 
    14611462        for ($i = 0 ; $i < EM_CONDITIONAL_RECURSIONS; $i++){ //you can add nested recursions by modifying this setting in your wp_options table 
    1462             preg_match_all('/\{([a-zA-Z0-9_\-]+)\}(.+?)\{\/\1\}/s', $event_string, $conditionals); 
     1463            preg_match_all('/\{([a-zA-Z0-9_\-,]+)\}(.+?)\{\/\1\}/s', $event_string, $conditionals); 
    14631464            if( count($conditionals[0]) > 0 ){ 
    14641465                //Check if the language we want exists, if not we take the first language there 
     
    15731574                            } 
    15741575                        } 
    1575                     }elseif ( preg_match('/^has_category_([a-zA-Z0-9_\-]+)$/', $condition, $category_match)){ 
     1576                    }elseif ( preg_match('/^has_category_([a-zA-Z0-9_\-,]+)$/', $condition, $category_match)){ 
    15761577                        //event is in this category 
    1577                         $show_condition = has_term($category_match[1], EM_TAXONOMY_CATEGORY, $this->post_id); 
    1578                     }elseif ( preg_match('/^no_category_([a-zA-Z0-9_\-]+)$/', $condition, $category_match)){ 
     1578                        $show_condition = has_term(explode(',', $category_match[1]), EM_TAXONOMY_CATEGORY, $this->post_id); 
     1579                    }elseif ( preg_match('/^no_category_([a-zA-Z0-9_\-,]+)$/', $condition, $category_match)){ 
    15791580                        //event is NOT in this category 
    1580                         $show_condition = !has_term($category_match[1], EM_TAXONOMY_CATEGORY, $this->post_id); 
    1581                     }elseif ( preg_match('/^has_tag_([a-zA-Z0-9_\-]+)$/', $condition, $tag_match)){ 
     1581                        $show_condition = !has_term(explode(',', $category_match[1]), EM_TAXONOMY_CATEGORY, $this->post_id); 
     1582                    }elseif ( preg_match('/^has_tag_([a-zA-Z0-9_\-,]+)$/', $condition, $tag_match)){ 
    15821583                        //event has this tag 
    1583                         $show_condition = has_term($tag_match[1], EM_TAXONOMY_TAG, $this->post_id); 
    1584                     }elseif ( preg_match('/^no_tag_([a-zA-Z0-9_\-]+)$/', $condition, $tag_match)){ 
     1584                        $show_condition = has_term(explode(',', $tag_match[1]), EM_TAXONOMY_TAG, $this->post_id); 
     1585                    }elseif ( preg_match('/^no_tag_([a-zA-Z0-9_\-,]+)$/', $condition, $tag_match)){ 
    15851586                       //event doesn't have this tag 
    1586                         $show_condition = !has_term($tag_match[1], EM_TAXONOMY_TAG, $this->post_id); 
     1587                        $show_condition = !has_term(explode(',', $tag_match[1]), EM_TAXONOMY_TAG, $this->post_id); 
    15871588                    } 
    15881589                    //other potential ones - has_attribute_... no_attribute_... has_categories_... 
     
    16191620                    break; 
    16201621                case '#_NOTES': //deprecated 
     1622                case '#_EVENTNOTES': 
     1623                    $replace = $this->post_content; 
     1624                    break; 
    16211625                case '#_EXCERPT': //deprecated 
    1622                 case '#_EVENTNOTES': 
    16231626                case '#_EVENTEXCERPT': 
    16241627                case '#_EVENTEXCERPTCUT': 
    1625                     $replace = $this->post_content; 
    1626                     if($result == "#_EXCERPT" || $result == "#_EVENTEXCERPT" || $result == "#_EVENTEXCERPTCUT" ){ 
    1627                         if( !empty($this->post_excerpt) && $result != "#_EVENTEXCERPTCUT" ){ 
    1628                             $replace = $this->post_excerpt; 
    1629                         }else{ 
    1630                             $excerpt_length = 55; 
    1631                             $excerpt_more = apply_filters('em_excerpt_more', ' ' . '[...]'); 
    1632                             if( !empty($placeholders[3][$key]) ){ 
    1633                                 $trim = true; 
    1634                                 $ph_args = explode(',', $placeholders[3][$key]); 
    1635                                 if( is_numeric($ph_args[0]) ) $excerpt_length = $ph_args[0]; 
    1636                                 if( !empty($ph_args[1]) ) $excerpt_more = $ph_args[1]; 
    1637                             } 
    1638                             $replace = $this->output_excerpt($excerpt_length, $excerpt_more); 
     1628                    if( !empty($this->post_excerpt) && $result != "#_EVENTEXCERPTCUT" ){ 
     1629                        $replace = $this->post_excerpt; 
     1630                    }else{ 
     1631                        $excerpt_length = ( $result == "#_EVENTEXCERPTCUT" ) ? 55:false; 
     1632                        $excerpt_more = apply_filters('em_excerpt_more', ' ' . '[...]'); 
     1633                        if( !empty($placeholders[3][$key]) ){ 
     1634                            $ph_args = explode(',', $placeholders[3][$key]); 
     1635                            if( is_numeric($ph_args[0]) || empty($ph_args[0]) ) $excerpt_length = $ph_args[0]; 
     1636                            if( !empty($ph_args[1]) ) $excerpt_more = $ph_args[1]; 
    16391637                        } 
     1638                        $replace = $this->output_excerpt($excerpt_length, $excerpt_more, $result == "#_EVENTEXCERPTCUT"); 
    16401639                    } 
    16411640                    break; 
     
    17741773                    break; 
    17751774                case '#_EVENTPRICEMIN': 
     1775                case '#_EVENTPRICEMINALL': 
    17761776                    //get the range of prices 
    17771777                    $min = false; 
    17781778                    foreach( $this->get_tickets()->tickets as $EM_Ticket ){ 
    17791779                        /* @var $EM_Ticket EM_Ticket */ 
    1780                         if( $EM_Ticket->is_available()|| get_option('dbem_bookings_tickets_show_unavailable') ){ 
     1780                        if( $EM_Ticket->is_available() || $result == '#_EVENTPRICEMINALL'){ 
    17811781                            if( $EM_Ticket->get_price() < $min || $min === false){ 
    17821782                                $min = $EM_Ticket->get_price(); 
     
    17881788                    break; 
    17891789                case '#_EVENTPRICEMAX': 
     1790                case '#_EVENTPRICEMAXALL': 
    17901791                    //get the range of prices 
    17911792                    $max = 0; 
    17921793                    foreach( $this->get_tickets()->tickets as $EM_Ticket ){ 
    17931794                        /* @var $EM_Ticket EM_Ticket */ 
    1794                         if( $EM_Ticket->is_available()|| get_option('dbem_bookings_tickets_show_unavailable') ){ 
     1795                        if( $EM_Ticket->is_available() || $result == '#_EVENTPRICEMAXALL'){ 
    17951796                            if( $EM_Ticket->get_price() > $max ){ 
    17961797                                $max = $EM_Ticket->get_price(); 
     
    20702071        }else{ 
    20712072            $replace = date_i18n($date_format, $this->start); 
    2072         } 
    2073         return $replace; 
    2074     } 
    2075      
    2076     function output_excerpt($excerpt_length = 55, $excerpt_more = '[...]', $cut_excerpt = true){ 
    2077         if( !empty($this->post_excerpt) ){ 
    2078             $replace = $this->post_excerpt; 
    2079         }else{ 
    2080             $replace = $this->post_content; 
    2081         } 
    2082         if( empty($this->post_excerpt) || $cut_excerpt ){ 
    2083             if ( preg_match('/<!--more(.*?)?-->/', $replace, $matches) ) { 
    2084                 $content = explode($matches[0], $replace, 2); 
    2085                 $replace = force_balance_tags($content[0]); 
    2086             } 
    2087             if( !empty($excerpt_length) ){ 
    2088                 //shorten content by supplied number - copied from wp_trim_excerpt 
    2089                 $replace = strip_shortcodes( $replace ); 
    2090                 $replace = str_replace(']]>', ']]&gt;', $replace); 
    2091                 $replace = wp_trim_words( $replace, $excerpt_length, $excerpt_more ); 
    2092             } 
    20932073        } 
    20942074        return $replace; 
  • events-manager/trunk/classes/em-location.php

    r1657109 r1694715  
    170170                    } 
    171171                    if(!$found && $location_meta_key[0] != '_'){ 
    172                         $this->location_attributes[$location_meta_key] = ( count($location_meta_val) > 1 ) ? $location_meta_val:$location_meta_val[0];                   
     172                        $this->location_attributes[$location_meta_key] = ( is_array($location_meta_val) ) ? $location_meta_val[0]:$location_meta_val; 
    173173                    } 
    174174                }    
     
    371371                } 
    372372            } 
    373             //Update Post Attributes 
    374             foreach($this->location_attributes as $location_attribute_key => $location_attribute){ 
    375                 update_post_meta($this->post_id, $location_attribute_key, $location_attribute); 
     373            //Update Post Custom Fields and attributes 
     374            if( get_option('dbem_location_attributes_enabled') ){ 
     375                //attributes get saved as individual keys or deleted if non-existent anymore 
     376                $atts = em_get_attributes( true ); //get available attributes that EM manages 
     377                $this->location_attributes= maybe_unserialize($this->location_attributes); 
     378                foreach( $atts['names'] as $location_attribute_key ){ 
     379                    if( !empty($this->location_attributes[$location_attribute_key]) ){ 
     380                        update_post_meta($this->post_id, $location_attribute_key, $this->location_attributes[$location_attribute_key]); 
     381                    }else{ 
     382                        delete_post_meta($this->post_id, $location_attribute_key); 
     383                    } 
     384                } 
    376385            } 
    377386            $this->get_status(); 
     
    800809                    $replace = $this->location_latitude; 
    801810                    break; 
    802                 case '#_DESCRIPTION':  //Depricated 
    803                 case '#_EXCERPT': //Depricated 
     811                case '#_DESCRIPTION':  //Deprecated 
    804812                case '#_LOCATIONNOTES': 
    805                 case '#_LOCATIONEXCERPT':    
    806813                    $replace = $this->post_content; 
    807                     if($result == "#_EXCERPT" || $result == "#_LOCATIONEXCERPT"){ 
    808                         if( !empty($this->post_excerpt) ){ 
    809                             $replace = $this->post_excerpt; 
    810                         }else{ 
    811                             $excerpt_length = 55; 
    812                             $excerpt_more = apply_filters('em_excerpt_more', ' ' . '[...]'); 
    813                             if( !empty($placeholders[3][$key]) ){ 
    814                                 $trim = true; 
    815                                 $ph_args = explode(',', $placeholders[3][$key]); 
    816                                 if( is_numeric($ph_args[0]) ) $excerpt_length = $ph_args[0]; 
    817                                 if( !empty($ph_args[1]) ) $excerpt_more = $ph_args[1]; 
    818                             } 
    819                             if ( preg_match('/<!--more(.*?)?-->/', $replace, $matches) ) { 
    820                                 $content = explode($matches[0], $replace, 2); 
    821                                 $replace = force_balance_tags($content[0]); 
    822                             } 
    823                             if( !empty($trim) ){ 
    824                                 //shorten content by supplied number - copied from wp_trim_excerpt 
    825                                 $replace = strip_shortcodes( $replace ); 
    826                                 $replace = str_replace(']]>', ']]&gt;', $replace); 
    827                                 $replace = wp_trim_words( $replace, $excerpt_length, $excerpt_more ); 
    828                             } 
     814                    break; 
     815                case '#_EXCERPT': //Deprecated 
     816                case '#_LOCATIONEXCERPT': 
     817                case '#_LOCATIONEXCERPTCUT': 
     818                    if( !empty($this->post_excerpt) && $result != "#_LOCATIONEXCERPTCUT" ){ 
     819                        $replace = $this->post_excerpt; 
     820                    }else{ 
     821                        $excerpt_length = ( $result == "#_LOCATIONEXCERPTCUT" ) ? 55 : false; 
     822                        $excerpt_more = apply_filters('em_excerpt_more', ' ' . '[...]'); 
     823                        if( !empty($placeholders[3][$key]) ){ 
     824                            $ph_args = explode(',', $placeholders[3][$key]); 
     825                            if( is_numeric($ph_args[0]) || empty($ph_args[0]) ) $excerpt_length = $ph_args[0]; 
     826                            if( !empty($ph_args[1]) ) $excerpt_more = $ph_args[1]; 
    829827                        } 
     828                        $replace = $this->output_excerpt($excerpt_length, $excerpt_more, $result == "#_LOCATIONEXCERPTCUT"); 
    830829                    } 
    831830                    break; 
  • events-manager/trunk/classes/em-object.php

    r1651260 r1694715  
    14961496     * END IMAGE UPlOAD FUNCTIONS 
    14971497     */ 
     1498     
     1499    function output_excerpt($excerpt_length = 55, $excerpt_more = '[...]', $cut_excerpt = true){ 
     1500        if( !empty($this->post_excerpt) ){ 
     1501            $replace = $this->post_excerpt; 
     1502        }else{ 
     1503            $replace = $this->post_content; 
     1504        } 
     1505        if( empty($this->post_excerpt) || $cut_excerpt ){ 
     1506            if ( preg_match('/<!--more(.*?)?-->/', $replace, $matches) ) { 
     1507                $content = explode($matches[0], $replace, 2); 
     1508                $replace = force_balance_tags($content[0]); 
     1509            } 
     1510            if( !empty($excerpt_length) ){ 
     1511                //shorten content by supplied number - copied from wp_trim_excerpt 
     1512                $replace = strip_shortcodes( $replace ); 
     1513                $replace = str_replace(']]>', ']]&gt;', $replace); 
     1514                $replace = wp_trim_words( $replace, $excerpt_length, $excerpt_more ); 
     1515            } 
     1516        } 
     1517        return $replace; 
     1518    } 
    14981519 
    14991520    function sanitize_time( $time ){ 
  • events-manager/trunk/classes/em-tag.php

    r1450218 r1694715  
    2121    } 
    2222} 
    23 class EM_Tag extends EM_Object {     
    24     //Taxonomy Fields 
    25     var $id = ''; 
    26     var $term_id; 
    27     var $name; 
    28     var $slug; 
    29     var $term_group; 
    30     var $term_taxonomy_id; 
    31     var $taxonomy; 
    32     var $description = ''; 
    33     var $parent = 0; 
    34     var $count; 
     23class EM_Tag extends EM_Taxonomy { 
     24     
     25    public $option_name = 'tag'; 
    3526     
    3627    /** 
     
    143134                    } 
    144135                    break; 
     136                case '#_TAGIMAGEURL': 
     137                    $replace = esc_url($this->get_image_url()); 
     138                    break; 
     139                case '#_TAGIMAGE': 
     140                    $replace = $this->placeholder_image($replace, $placeholders, $key); 
     141                    break; 
     142                case '#_TAGCOLOR': 
     143                    $replace = $this->get_color();  
     144                    break; 
    145145                case '#_TAGNOTES': 
    146146                    $replace = $this->description; 
  • events-manager/trunk/classes/em-tickets.php

    r1651260 r1694715  
    129129        //Build Event Array 
    130130        do_action('em_tickets_get_post_pre', $this); 
     131        $current_tickets = $this->tickets; //save previous tickets so things like ticket_meta doesn't get overwritten 
    131132        $this->tickets = array(); //clean current tickets out 
    132133        if( !empty($_POST['em_tickets']) && is_array($_POST['em_tickets']) ){ 
     
    135136            foreach($_POST['em_tickets'] as $row => $ticket_data){ 
    136137                if( $row > 0 ){ 
    137                     $EM_Ticket = new EM_Ticket(); 
     138                    if( !empty($ticket_data['ticket_id']) && !empty($current_tickets[$ticket_data['ticket_id']]) ){ 
     139                        $EM_Ticket = $current_tickets[$ticket_data['ticket_id']]; 
     140                    }else{ 
     141                        $EM_Ticket = new EM_Ticket(); 
     142                    } 
    138143                    $ticket_data['event_id'] = $this->event_id; 
    139144                    $EM_Ticket->get_post($ticket_data); 
  • events-manager/trunk/em-functions.php

    r1651260 r1694715  
    303303 
    304304function em_get_attributes($lattributes = false){ 
     305    $attributes = array('names'=>array(), 'values'=>array()); 
     306    if( !$lattributes && !get_option('dbem_attributes_enabled') ) return $attributes; 
     307    if( $lattributes && !get_option('dbem_location_attributes_enabled') ) return $attributes; 
    305308    //We also get a list of attribute names and create a ddm list (since placeholders are fixed) 
    306309    $formats = 
     
    325328    } 
    326329    //Now grab all the unique attributes we can use in our event. 
    327     $attributes = array('names'=>array(), 'values'=>array()); 
    328330    foreach($matches[1] as $key => $attribute) { 
    329331        if( !in_array($attribute, $attributes['names']) ){ 
  • events-manager/trunk/em-install.php

    r1651260 r1694715  
    151151        recurrence_id bigint(20) unsigned NULL DEFAULT NULL, 
    152152        event_category_id bigint(20) unsigned NULL DEFAULT NULL, 
    153         event_attributes text NULL DEFAULT NULL, 
    154153        event_date_created datetime NULL DEFAULT NULL, 
    155154        event_date_modified datetime NULL DEFAULT NULL, 
     
    592591        'dbem_tag_no_event_message' => __('No events with this tag', 'events-manager'), 
    593592        'dbem_tag_event_list_limit' => 20, 
     593        'dbem_tag_default_color' => '#a8d145', 
    594594        //RSS Stuff 
    595595        'dbem_rss_limit' => 0, 
  • events-manager/trunk/events-manager.php

    r1677796 r1694715  
    22/* 
    33Plugin Name: Events Manager 
    4 Version: 5.7.3 
     4Version: 5.7.3.1 
    55Plugin URI: http://wp-events-plugin.com 
    66Description: Event registration and booking management for WordPress. Recurring events, locations, google maps, rss, ical, booking registration and more! 
     
    2929 
    3030// Setting constants 
    31 define('EM_VERSION', 5.7); //self expanatory 
     31define('EM_VERSION', 5.731); //self expanatory 
    3232define('EM_PRO_MIN_VERSION', 2.392); //self expanatory 
    3333define('EM_PRO_MIN_VERSION_CRITICAL', 2.377); //self expanatory 
     
    6666 
    6767// INCLUDES 
    68 include('classes/em-object.php'); //Base object, any files below may depend on this 
    69 include("em-posts.php"); //set up events as posts 
     68//Base classes 
     69include('classes/em-object.php'); 
     70include('classes/em-taxonomy.php'); 
     71//set up events as posts 
     72include("em-posts.php"); 
    7073//Template Tags & Template Logic 
    7174include("em-actions.php"); 
     
    124127    include('classes/em-location-post-admin.php'); 
    125128    include('classes/em-location-posts-admin.php'); 
     129    include('classes/em-taxonomy-admin.php'); 
    126130    include('classes/em-categories-taxonomy.php'); 
     131    include('classes/em-tags-taxonomy.php'); 
    127132    //bookings folder 
    128133        include('admin/bookings/em-cancelled.php'); 
     
    220225                $script_deps['jquery'] = 'jquery'; 
    221226            } 
    222             if( (!empty($pages['events']) && is_page($pages['events']) &&  get_option('dbem_events_page_search_form')) || get_option('dbem_js_limit_search') === '0' || in_array($obj_id, explode(',', get_option('dbem_js_limit_search'))) ){  
     227            if( (!empty($pages['events']) && is_page($pages['events']) && ( get_option('dbem_events_page_search_form') || (EM_MS_GLOBAL && !get_site_option('dbem_ms_global_events_links', true)) )) || get_option('dbem_js_limit_search') === '0' || in_array($obj_id, explode(',', get_option('dbem_js_limit_search'))) ){  
    223228                //events page only needs datepickers 
    224229                $script_deps['jquery-ui-core'] = 'jquery-ui-core'; 
     
    264269                'jquery-ui-dialog'=>'jquery-ui-dialog' 
    265270            ); 
    266         }                        
     271        } 
    267272        $script_deps = apply_filters('em_public_script_deps', $script_deps); 
    268273        if( !empty($script_deps) ){ //given we depend on jQuery, there must be at least a jQuery dep for our file to be loaded 
     
    294299    public static function admin_enqueue( $hook_suffix = false ){ 
    295300        if( $hook_suffix == 'post.php' || (!empty($_GET['page']) && substr($_GET['page'],0,14) == 'events-manager') || (!empty($_GET['post_type']) && in_array($_GET['post_type'], array(EM_POST_TYPE_EVENT,EM_POST_TYPE_LOCATION,'event-recurring'))) ){ 
    296             wp_enqueue_script('events-manager', plugins_url('includes/js/events-manager.js',__FILE__), array('jquery', 'jquery-ui-core','jquery-ui-widget','jquery-ui-position','jquery-ui-sortable','jquery-ui-datepicker','jquery-ui-autocomplete','jquery-ui-dialog'), EM_VERSION); 
     301            wp_enqueue_style( 'wp-color-picker' ); 
     302            wp_enqueue_script('events-manager', plugins_url('includes/js/events-manager.js',__FILE__), array('jquery', 'jquery-ui-core','jquery-ui-widget','jquery-ui-position','jquery-ui-sortable','jquery-ui-datepicker','jquery-ui-autocomplete','jquery-ui-dialog','wp-color-picker'), EM_VERSION); 
    297303            do_action('em_enqueue_admin_scripts'); 
    298304            wp_enqueue_style('events-manager-admin', plugins_url('includes/css/events_manager_admin.css',__FILE__), array(), EM_VERSION); 
  • events-manager/trunk/includes/js/admin-settings.js

    r1658866 r1694715  
    115115        } 
    116116    }); 
     117    //color pickers 
     118    $('#dbem_category_default_color, #dbem_tag_default_color').wpColorPicker(); 
    117119}); 
  • events-manager/trunk/multilingual/em-ml-admin.php

    r1311743 r1694715  
    33     
    44    public static function init(){ 
    5         add_action('add_meta_boxes', 'EM_ML_Admin::meta_boxes',100); 
     5        add_action('add_meta_boxes_'.EM_POST_TYPE_EVENT, 'EM_ML_Admin::meta_boxes',100); 
     6        add_action('add_meta_boxes_event-recurring', 'EM_ML_Admin::meta_boxes', 100, 1); 
     7        add_action('add_meta_boxes_'.EM_POST_TYPE_LOCATION, 'EM_ML_Admin::meta_boxes', 100, 1); 
    68        if( !defined('EM_SETTINGS_TABS') && count(EM_ML::$langs) > 3 ) define('EM_SETTINGS_TABS',true); 
    79    } 
  • events-manager/trunk/multilingual/em-ml-bookings.php

    r1234828 r1694715  
    3030                $EM_Bookings->event_id = $event->event_id; 
    3131                $EM_Bookings->translated = true; 
    32                 //go through tickets and translate to appropriate language 
    33                 $event_lang = EM_ML::get_the_language($EM_Event); 
    34                 foreach($EM_Bookings->get_tickets()->tickets as $EM_Ticket){ /* @var $EM_Ticket EM_Ticket */ 
    35                     if( !empty($EM_Ticket->ticket_meta['langs'][$event_lang]['ticket_name']) ){ 
    36                         $EM_Ticket->ticket_name = $EM_Ticket->ticket_meta['langs'][$event_lang]['ticket_name']; 
    37                     } 
    38                     if( !empty($EM_Ticket->ticket_meta['langs'][$event_lang]['ticket_description']) ){ 
    39                         $EM_Ticket->ticket_description = $EM_Ticket->ticket_meta['langs'][$event_lang]['ticket_description']; 
    40                     } 
     32                //go through tickets and translate to appropriate language if we're not in a saving loop 
     33                global $EM_EVENT_SAVE_POST, $EM_SAVING_EVENT; 
     34                if( empty($EM_SAVING_EVENT) && empty($EM_EVENT_SAVE_POST) ){ 
     35                    $event_lang = EM_ML::get_the_language($EM_Event); 
     36                    foreach($EM_Bookings->get_tickets()->tickets as $EM_Ticket){ /* @var $EM_Ticket EM_Ticket */ 
     37                        if( !empty($EM_Ticket->ticket_meta['langs'][$event_lang]['ticket_name']) ){ 
     38                            $EM_Ticket->ticket_name = $EM_Ticket->ticket_meta['langs'][$event_lang]['ticket_name']; 
     39                        } 
     40                        if( !empty($EM_Ticket->ticket_meta['langs'][$event_lang]['ticket_description']) ){ 
     41                            $EM_Ticket->ticket_description = $EM_Ticket->ticket_meta['langs'][$event_lang]['ticket_description']; 
     42                        } 
     43                    } 
    4144                } 
    4245            } 
  • events-manager/trunk/readme.txt

    r1677796 r1694715  
    100100 
    101101== Changelog == 
     102= (dev) 5.7.3.1 = 
     103* fixed category color picker and image uploader problems 
     104* created base classes for EM taxonomies to make adding custom EM taxonomies even easier in the future, 
     105* added tag image and color settings/data 
     106* added sortable option for date columns of events and recurring events in the admin area 
     107* fixed saving an event recreating ticket_meta and wiping out ML settings 
     108* fixed multilingual translations of event in WPML not hiding/showing right meta boxes 
     109* fixed saving multilingual translation of event overwriting original language ticket names 
     110* changed admin headers to use new and accessible WP inline HTML structure 
     111* fixed serialization problems for deprecated event/location attributes and attributes with multiple post meta entries for one post 
     112* removed deprecated attributes editor from admin area as this is confusing and error prone when combined with other plugins manipulating custom fields 
     113* fixed #_EVENTEXCERPT without arguments stripping HTML since 5.7 
     114* added ability to list multiple categories/tags in conditional placeholders e.g. {has_tag_123,1234,tagname}... 
     115* added #_EVENTPRICEMINALL and #_EVENTPRICEMAXALL to show prices of unavailable tickets as well 
     116* fixed JS issues with MS Global mode and JS file limiting when displaying subsite single event pages on main blog 
     117* fixed single initial abbreviation issues in Chinese calendars 
     118* fixed duplicate events not being published to social networks via jetpack publicize (kudos @gnaag) 
     119 
    102120= 5.7.3 = 
    103121* fixed previous meta not getting deleted from recurrences resulting in non-saved information such as a changed featured image or location 
  • events-manager/trunk/templates/forms/event/attributes.php

    r1311743 r1694715  
    4747            </tbody> 
    4848        </table> 
    49         <?php if( count(array_diff(array_keys($EM_Event->event_attributes), $attributes['names'])) > 0 ): ?> 
    50         <p><strong><?php _e('Deprecated Attributes', 'events-manager')?></strong></p> 
    51         <p><em><?php _e("If you see any attributes under here, that means they're not used in Events Manager formats. To add them, you need to add the custom attribute again to a formatting option in the settings page. To remove any of these deprecated attributes, give it a blank value and save.",'events-manager') ?></em></p> 
    52         <table class="form-table"> 
    53             <thead> 
    54                 <tr valign="top"> 
    55                     <td><strong>Attribute Name</strong></td> 
    56                     <td><strong>Value</strong></td> 
    57                 </tr> 
    58             </thead>  
    59             <tbody id="mtm_body"> 
    60                 <?php 
    61                 if( is_array($EM_Event->event_attributes) and count($EM_Event->event_attributes) > 0){ 
    62                     foreach( $EM_Event->event_attributes as $name => $value){ 
    63                         if( is_array($value) ) $value = serialize($value); 
    64                         if( !in_array($name, $attributes['names']) ){ 
    65                             ?> 
    66                             <tr valign="top" id="em_attribute_<?php echo $count ?>"> 
    67                                 <td scope="row"><?php echo $name ?></td> 
    68                                 <td> 
    69                                     <input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo esc_attr($value, ENT_QUOTES); ?>" /> 
    70                                 </td> 
    71                             </tr> 
    72                             <?php 
    73                             $count++; 
    74                         } 
    75                     } 
    76                 } 
    77                 ?> 
    78             </tbody> 
    79         </table> 
    80         <?php endif; ?> 
    8149    <?php else : ?> 
    8250        <p> 
  • events-manager/trunk/templates/forms/location/attributes.php

    r1311743 r1694715  
    4747            </tbody> 
    4848        </table> 
    49         <?php if( count(array_diff(array_keys($EM_Location->location_attributes), $attributes['names'])) > 0 ): ?> 
    50         <p><strong><?php _e('Deprecated Attributes', 'events-manager')?></strong></p> 
    51         <p><em><?php _e("If you see any attributes under here, that means they're not used in Locations Manager formats. To add them, you need to add the custom attribute again to a formatting option in the settings page. To remove any of these deprecated attributes, give it a blank value and save.",'events-manager') ?></em></p> 
    52         <table class="form-table"> 
    53             <thead> 
    54                 <tr valign="top"> 
    55                     <td><strong>Attribute Name</strong></td> 
    56                     <td><strong>Value</strong></td> 
    57                 </tr> 
    58             </thead>  
    59             <tbody id="mtm_body"> 
    60                 <?php 
    61                 if( is_array($EM_Location->location_attributes) and count($EM_Location->location_attributes) > 0){ 
    62                     foreach( $EM_Location->location_attributes as $name => $value){ 
    63                         if( is_array($value) ) $value = serialize($value); 
    64                         if( !in_array($name, $attributes['names']) ){ 
    65                             ?> 
    66                             <tr valign="top" id="em_attribute_<?php echo $count ?>"> 
    67                                 <td scope="row"><?php echo $name ?></td> 
    68                                 <td> 
    69                                     <input type="text" name="em_attributes[<?php echo $name ?>]" value="<?php echo esc_attr($value, ENT_QUOTES); ?>" /> 
    70                                 </td> 
    71                             </tr> 
    72                             <?php 
    73                             $count++; 
    74                         } 
    75                     } 
    76                 } 
    77                 ?> 
    78             </tbody> 
    79         </table> 
    80         <?php endif; ?> 
    8149    <?php else : ?> 
    8250        <p> 
Note: See TracChangeset for help on using the changeset viewer.