-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlocations.php
More file actions
75 lines (64 loc) · 2.17 KB
/
locations.php
File metadata and controls
75 lines (64 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/*
* Currently these are template tags that refer to the main objects.
* Please replace calls to these with direct object methods when possible.
* These will be phased out unless they are specifically template tags for public use.
*/
function dbem_get_locations($eventful = false) {
$EM_Locations = EM_Locations::get(array('eventful'=>$eventful));
foreach ($EM_Locations as $key => $EM_Location){
$EM_Locations[$key] = $EM_Location->to_array();
}
}
function dbem_get_location($location_id) {
$EM_Location = new EM_Location($location_id);
return $EM_Location->to_array();
}
/**
* Find a location with same name, address and town as supplied array
* @param $location
* @return array
*/
function dbem_get_identical_location($location) {
$EM_Location = new EM_Location($location);
return $EM_Location->load_similar();
}
function dbem_validate_location($location) {
$EM_Location = new EM_Location($location);
if ( $EM_Location->validate() ){
return "OK";
}else{
return '<strong>'.__('Ach, some problems here:', 'dbem').'</strong><br /><br />'."\n".implode('<br />', $EM_Location->errors);
}
}
function dbem_update_location($location) {
$EM_Location = new EM_Location($location);
$EM_Location->update();
}
function dbem_insert_location($location) {
$EM_Location = new EM_Location($location);
$EM_Location->insert();
return $EM_Location->to_array();
}
function dbem_location_has_events($location_id) {
$EM_Location = new EM_Location($location_id);
return $EM_Location->has_events();
}
function dbem_upload_location_picture($location) {
$EM_Location = new EM_Location($location);
$EM_Location->image_upload();
}
function dbem_delete_image_files_for_location_id($location_id) {
$EM_Location = new EM_Location($location_id);
$EM_Location->image_delete();
}
function dbem_replace_locations_placeholders($format, $location, $target="html") {
$EM_Location = new EM_Location($location);
return $EM_Location->output($format, $target);
}
/*
Deleted these functions due to not being used (and unecessary):
function dbem_cache_location($event){}
function dbem_get_location_by_name($name) {}
function dbem_insert_location_from_event($event) {}
*/