Changeset 2188087
- Timestamp:
- 11/07/2019 10:57:58 PM (6 years ago)
- Location:
- promissa/trunk
- Files:
-
- 3 added
- 1 edited
-
functions.php (modified) (7 diffs)
-
shortcodes/calendar.php (added)
-
shortcodes/css (added)
-
shortcodes/css/popper.css (added)
Legend:
- Unmodified
- Added
- Removed
-
promissa/trunk/functions.php
r2136288 r2188087 1 1 <?php 2 if (!function_exists('WithinNextWeek')) { 2 if (!function_exists('WithinNextWeek')) 3 { 3 4 function WithinNextWeek($val) 4 5 { … … 11 12 } 12 13 13 if (!function_exists('IsTomorrow')) { 14 if (!function_exists('IsTomorrow')) 15 { 14 16 function IsTomorrow($val) 15 17 { … … 23 25 } 24 26 } 25 if (!function_exists('ProMissaREST')) { 27 if (!function_exists('ProMissaREST')) 28 { 26 29 function ProMissaREST($page, $filter = '') 27 30 { 28 31 $promissa = get_option('promissa'); 29 $url = 'https://api.promissa.nl/v1. 0/records/' . $page . $filter;32 $url = 'https://api.promissa.nl/v1.1/records/' . $page . $filter; 30 33 31 34 $args = array( … … 42 45 } 43 46 44 if (!function_exists('kei_post_val')) { 47 if (!function_exists('kei_post_val')) 48 { 45 49 function kei_post_val($val) 46 50 { … … 52 56 } 53 57 54 if (!function_exists('callback')) { 55 function callback($buffer){ 58 if (!function_exists('callback')) 59 { 60 function callback($buffer) 61 { 56 62 return $buffer; 57 63 } 58 64 } 59 65 60 if (!function_exists('add_ob_start')) { 61 function add_ob_start(){ 66 if (!function_exists('add_ob_start')) 67 { 68 function add_ob_start() 69 { 62 70 ob_start("callback"); 63 71 } 64 72 } 65 73 66 if (!function_exists('flush_ob_end')) { 67 function flush_ob_end(){ 74 if (!function_exists('flush_ob_end')) 75 { 76 function flush_ob_end() 77 { 68 78 ob_end_flush(); 69 79 } 70 80 } 71 81 72 if (!function_exists('getDayOfWeek')) { 73 function getDayOfWeek($i) { 82 if (!function_exists('is_guid')) 83 { 84 function is_guid($guid) 85 { 86 return !empty($guid) && strlen($guid) == 36 && preg_match('/^\{?[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}\}?$/', $guid); 87 } 88 } 89 90 if (!function_exists('jsDateTime')) 91 { 92 function jsDateTime($datetime) 93 { 94 $DateTime = new DateTime($datetime); 95 return $DateTime->format('Y-m-d') . 'T' . $DateTime->format('H:i:s'); 96 } 97 } 98 99 if (!function_exists('jsEndDateTime')) 100 { 101 function jsEndDateTime($datetime, $duration) 102 { 103 if(empty($duration)) 104 { 105 $duration = 60; 106 } 107 $DateTime = new DateTime($datetime); 108 $DateTime->add(new DateInterval('PT' . $duration . 'M')); 109 return $DateTime->format('Y-m-d') . 'T' . $DateTime->format('H:i:s'); 110 } 111 } 112 113 if (!function_exists('HexTextColor')) 114 { 115 function HexTextColor($class) 116 { 117 switch($class) 118 { 119 case 'white': 120 return '#000'; 121 case 'yellow': 122 case 'gray': 123 return '#666'; 124 case 'black': 125 return '#ccc'; 126 default: 127 return '#fff'; 128 } 129 } 130 } 131 132 if (!function_exists('HexBorderColor')) 133 { 134 function HexBorderColor($class) 135 { 136 switch($class) 137 { 138 case 'green': 139 return '#29b765'; 140 case 'yellow': 141 return '#deb200'; 142 case 'orange': 143 return '#d67520'; 144 case 'red': 145 return '#cf4436'; 146 case 'white': 147 case 'gray': 148 return '#dfe8f1'; 149 case 'black': 150 return '#000'; 151 case 'blue': 152 case 'blue-alt': 153 return '#5388d1'; 154 case 'purple': 155 return '#7a3ecc'; 156 default: 157 return '#00b19b'; 158 } 159 } 160 } 161 162 if (!function_exists('HexBackgroundColor')) 163 { 164 function HexBackgroundColor($class) 165 { 166 switch($class) 167 { 168 case 'green': 169 return '#2ecc71'; 170 case 'yellow': 171 return '#fc0'; 172 case 'orange': 173 return '#e67e22'; 174 case 'red': 175 return '#e74c3c'; 176 case 'white': 177 return '#fff'; 178 case 'gray': 179 return '#efefef'; 180 case 'black': 181 return '#2d2d2d'; 182 case 'blue': 183 case 'blue-alt': 184 return '#65a6ff'; 185 case 'purple': 186 return '#984dff'; 187 case 'primary': 188 default: 189 return '#00bca4'; 190 } 191 } 192 } 193 194 if (!function_exists('Trim')) 195 { 196 function Trim($s, $max_length = 300) 197 { 198 if (strlen($s) > $max_length) : 199 $offset = ($max_length - 3) - strlen($s); 200 $s = substr($s, 0, strrpos($s, ' ', $offset)) . '...'; 201 endif; 202 return $s; 203 } 204 } 205 206 if (!function_exists('getDayOfWeek')) 207 { 208 function getDayOfWeek($i) 209 { 74 210 switch($i) { 75 211 case 1: … … 93 229 } 94 230 95 if (!function_exists('getDayOfWeekPlural')) { 96 function getDayOfWeekPlural($i) { 231 if (!function_exists('getDayOfWeekPlural')) 232 { 233 function getDayOfWeekPlural($i) 234 { 97 235 switch($i) { 98 236 case 1: … … 116 254 } 117 255 118 if (!function_exists('getTimeOfDayOfWeek')) { 119 function getTimeOfDayOfWeek($hour, $minutes) { 256 if (!function_exists('getTimeOfDayOfWeek')) 257 { 258 function getTimeOfDayOfWeek($hour, $minutes) 259 { 120 260 return sprintf('%02d:%02d', $hour, $minutes); 121 261 }
Note: See TracChangeset
for help on using the changeset viewer.