예제 #1
0
 public static function em_object_get_default_search($defaults, $array, $super_defaults)
 {
     if (!empty($defaults['location'])) {
         //check that this location ID is the original one, given that all events of any language will refer to the location_id of the original
         $EM_Location = em_get_location($defaults['location']);
         if (!EM_ML::is_original($EM_Location)) {
             $defaults['location'] = EM_ML::get_original_location($EM_Location)->location_id;
         }
     }
     return $defaults;
 }
예제 #2
0
 /**
  * Hooks into em_location_get_post_meta and assigns location info from original translation so other translations don't manage location-specific info.
  * @param boolean $result
  * @param EM_Location $EM_Location
  * @param string $validate
  * @return boolean
  */
 public static function location_get_post_meta($result, $EM_Location, $validate = true)
 {
     //check if this is a master location, if not then we need to get the relevant master location info and populate this object with it so it passes validation and saves correctly.
     if (!EM_ML::is_original($EM_Location)) {
         //get original location object
         $location = EM_ML::get_original_location($EM_Location);
         self::location_merge_original_meta($EM_Location, $location);
         if ($validate) {
             $result = $EM_Location->validate();
         }
     }
     return $result;
 }
예제 #3
0
 public static function location_meta_box_attributes()
 {
     global $EM_Location;
     //get original location for attributes
     $location = EM_ML::get_original_location($EM_Location);
     EM_ML_IO::location_merge_original_attributes($EM_Location, $location);
     em_locate_template('forms/location/attributes.php', true);
 }