@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if (!defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | |
3 | 5 | /** |
4 | 6 | * Sekati CodeIgniter Asset Helper |
@@ -52,8 +54,7 @@ discard block |
||
52 | 54 | */ |
53 | 55 | |
54 | 56 | if (!function_exists('asset_url')) { |
55 | - function asset_url() |
|
56 | - { |
|
57 | + function asset_url() { |
|
57 | 58 | //get an instance of CI so we can access our configuration |
58 | 59 | $CI =& get_instance(); |
59 | 60 | |
@@ -69,8 +70,7 @@ discard block |
||
69 | 70 | * @return string |
70 | 71 | */ |
71 | 72 | if (!function_exists('css_url')) { |
72 | - function css_url() |
|
73 | - { |
|
73 | + function css_url() { |
|
74 | 74 | $CI =& get_instance(); |
75 | 75 | |
76 | 76 | return $CI->config->slash_item('static_url') . $CI->config->item('css_path'); |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | * @return string |
85 | 85 | */ |
86 | 86 | if (!function_exists('less_url')) { |
87 | - function less_url() |
|
88 | - { |
|
87 | + function less_url() { |
|
89 | 88 | $CI =& get_instance(); |
90 | 89 | |
91 | 90 | return $CI->config->slash_item('static_url') . $CI->config->item('less_path'); |
@@ -99,8 +98,7 @@ discard block |
||
99 | 98 | * @return string |
100 | 99 | */ |
101 | 100 | if (!function_exists('js_url')) { |
102 | - function js_url() |
|
103 | - { |
|
101 | + function js_url() { |
|
104 | 102 | $CI =& get_instance(); |
105 | 103 | |
106 | 104 | return $CI->config->slash_item('static_url') . $CI->config->item('js_path'); |
@@ -114,8 +112,7 @@ discard block |
||
114 | 112 | * @return string |
115 | 113 | */ |
116 | 114 | if (!function_exists('img_url')) { |
117 | - function img_url() |
|
118 | - { |
|
115 | + function img_url() { |
|
119 | 116 | $CI =& get_instance(); |
120 | 117 | |
121 | 118 | return $CI->config->slash_item('static_url') . $CI->config->item('img_path'); |
@@ -129,8 +126,7 @@ discard block |
||
129 | 126 | * @return string |
130 | 127 | */ |
131 | 128 | if (!function_exists('swf_url')) { |
132 | - function swf_url() |
|
133 | - { |
|
129 | + function swf_url() { |
|
134 | 130 | $CI =& get_instance(); |
135 | 131 | |
136 | 132 | return $CI->config->slash_item('static_url') . $CI->config->item('swf_path'); |
@@ -144,8 +140,7 @@ discard block |
||
144 | 140 | * @return string |
145 | 141 | */ |
146 | 142 | if (!function_exists('upload_url')) { |
147 | - function upload_url() |
|
148 | - { |
|
143 | + function upload_url() { |
|
149 | 144 | $CI =& get_instance(); |
150 | 145 | |
151 | 146 | return base_url() . $CI->config->item('upload_path'); |
@@ -159,8 +154,7 @@ discard block |
||
159 | 154 | * @return string |
160 | 155 | */ |
161 | 156 | if (!function_exists('download_url')) { |
162 | - function download_url() |
|
163 | - { |
|
157 | + function download_url() { |
|
164 | 158 | $CI =& get_instance(); |
165 | 159 | |
166 | 160 | return base_url() . $CI->config->item('download_path'); |
@@ -174,8 +168,7 @@ discard block |
||
174 | 168 | * @return string |
175 | 169 | */ |
176 | 170 | if (!function_exists('xml_url')) { |
177 | - function xml_url() |
|
178 | - { |
|
171 | + function xml_url() { |
|
179 | 172 | $CI =& get_instance(); |
180 | 173 | |
181 | 174 | return base_url() . $CI->config->item('xml_path'); |
@@ -193,8 +186,7 @@ discard block |
||
193 | 186 | * @return string |
194 | 187 | */ |
195 | 188 | if (!function_exists('asset_path')) { |
196 | - function asset_path() |
|
197 | - { |
|
189 | + function asset_path() { |
|
198 | 190 | //get an instance of CI so we can access our configuration |
199 | 191 | $CI =& get_instance(); |
200 | 192 | |
@@ -209,8 +201,7 @@ discard block |
||
209 | 201 | * @return string |
210 | 202 | */ |
211 | 203 | if (!function_exists('css_path')) { |
212 | - function css_path() |
|
213 | - { |
|
204 | + function css_path() { |
|
214 | 205 | //get an instance of CI so we can access our configuration |
215 | 206 | $CI =& get_instance(); |
216 | 207 | |
@@ -225,8 +216,7 @@ discard block |
||
225 | 216 | * @return string |
226 | 217 | */ |
227 | 218 | if (!function_exists('less_path')) { |
228 | - function less_path() |
|
229 | - { |
|
219 | + function less_path() { |
|
230 | 220 | //get an instance of CI so we can access our configuration |
231 | 221 | $CI =& get_instance(); |
232 | 222 | |
@@ -241,8 +231,7 @@ discard block |
||
241 | 231 | * @return string |
242 | 232 | */ |
243 | 233 | if (!function_exists('js_path')) { |
244 | - function js_path() |
|
245 | - { |
|
234 | + function js_path() { |
|
246 | 235 | //get an instance of CI so we can access our configuration |
247 | 236 | $CI =& get_instance(); |
248 | 237 | |
@@ -257,8 +246,7 @@ discard block |
||
257 | 246 | * @return string |
258 | 247 | */ |
259 | 248 | if (!function_exists('img_path')) { |
260 | - function img_path() |
|
261 | - { |
|
249 | + function img_path() { |
|
262 | 250 | //get an instance of CI so we can access our configuration |
263 | 251 | $CI =& get_instance(); |
264 | 252 | |
@@ -273,8 +261,7 @@ discard block |
||
273 | 261 | * @return string |
274 | 262 | */ |
275 | 263 | if (!function_exists('swf_path')) { |
276 | - function swf_path() |
|
277 | - { |
|
264 | + function swf_path() { |
|
278 | 265 | $CI =& get_instance(); |
279 | 266 | |
280 | 267 | return FCPATH . $CI->config->item('swf_path'); |
@@ -288,8 +275,7 @@ discard block |
||
288 | 275 | * @return string |
289 | 276 | */ |
290 | 277 | if (!function_exists('xml_path')) { |
291 | - function xml_path() |
|
292 | - { |
|
278 | + function xml_path() { |
|
293 | 279 | $CI =& get_instance(); |
294 | 280 | |
295 | 281 | return FCPATH . $CI->config->item('xml_path'); |
@@ -303,8 +289,7 @@ discard block |
||
303 | 289 | * @return string |
304 | 290 | */ |
305 | 291 | if (!function_exists('upload_path')) { |
306 | - function upload_path() |
|
307 | - { |
|
292 | + function upload_path() { |
|
308 | 293 | $CI =& get_instance(); |
309 | 294 | |
310 | 295 | return FCPATH . $CI->config->item('upload_path'); |
@@ -318,8 +303,7 @@ discard block |
||
318 | 303 | * @return string |
319 | 304 | */ |
320 | 305 | if (!function_exists('upload_path_relative')) { |
321 | - function upload_path_relative() |
|
322 | - { |
|
306 | + function upload_path_relative() { |
|
323 | 307 | $CI =& get_instance(); |
324 | 308 | |
325 | 309 | return './' . $CI->config->item('upload_path'); |
@@ -333,8 +317,7 @@ discard block |
||
333 | 317 | * @return string |
334 | 318 | */ |
335 | 319 | if (!function_exists('download_path')) { |
336 | - function download_path() |
|
337 | - { |
|
320 | + function download_path() { |
|
338 | 321 | $CI =& get_instance(); |
339 | 322 | |
340 | 323 | return FCPATH . $CI->config->item('download_path'); |
@@ -348,8 +331,7 @@ discard block |
||
348 | 331 | * @return string |
349 | 332 | */ |
350 | 333 | if (!function_exists('download_path_relative')) { |
351 | - function download_path_relative() |
|
352 | - { |
|
334 | + function download_path_relative() { |
|
353 | 335 | $CI =& get_instance(); |
354 | 336 | |
355 | 337 | return './' . $CI->config->item('download_path'); |
@@ -370,8 +352,7 @@ discard block |
||
370 | 352 | * @return string |
371 | 353 | */ |
372 | 354 | if (!function_exists('css')) { |
373 | - function css($file, $media = 'all') |
|
374 | - { |
|
355 | + function css($file, $media = 'all') { |
|
375 | 356 | return '<link rel="stylesheet" type="text/css" href="' . css_url() . $file . '" media="' . $media . '">' . "\n"; |
376 | 357 | } |
377 | 358 | } |
@@ -386,8 +367,7 @@ discard block |
||
386 | 367 | * @return string |
387 | 368 | */ |
388 | 369 | if (!function_exists('less')) { |
389 | - function less($file) |
|
390 | - { |
|
370 | + function less($file) { |
|
391 | 371 | return '<link rel="stylesheet/less" type="text/css" href="' . less_url() . $file . '">' . "\n"; |
392 | 372 | } |
393 | 373 | } |
@@ -403,12 +383,12 @@ discard block |
||
403 | 383 | * @return string |
404 | 384 | */ |
405 | 385 | if (!function_exists('js')) { |
406 | - function js($file, $atts = array()) |
|
407 | - { |
|
386 | + function js($file, $atts = array()) { |
|
408 | 387 | $element = '<script type="text/javascript" src="' . js_url() . $file . '"'; |
409 | 388 | |
410 | - foreach ($atts as $key => $val) |
|
411 | - $element .= ' ' . $key . '="' . $val . '"'; |
|
389 | + foreach ($atts as $key => $val) { |
|
390 | + $element .= ' ' . $key . '="' . $val . '"'; |
|
391 | + } |
|
412 | 392 | $element .= '></script>' . "\n"; |
413 | 393 | |
414 | 394 | return $element; |
@@ -426,11 +406,11 @@ discard block |
||
426 | 406 | * @return string |
427 | 407 | */ |
428 | 408 | if (!function_exists('img')) { |
429 | - function img($file, $atts = array()) |
|
430 | - { |
|
409 | + function img($file, $atts = array()) { |
|
431 | 410 | $url = '<img src="' . img_url() . $file . '"'; |
432 | - foreach ($atts as $key => $val) |
|
433 | - $url .= ' ' . $key . '="' . $val . '"'; |
|
411 | + foreach ($atts as $key => $val) { |
|
412 | + $url .= ' ' . $key . '="' . $val . '"'; |
|
413 | + } |
|
434 | 414 | $url .= " />\n"; |
435 | 415 | |
436 | 416 | return $url; |
@@ -447,8 +427,7 @@ discard block |
||
447 | 427 | * @return string |
448 | 428 | */ |
449 | 429 | if (!function_exists('jquery')) { |
450 | - function jquery($version = '') |
|
451 | - { |
|
430 | + function jquery($version = '') { |
|
452 | 431 | // Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline |
453 | 432 | $out = '<script src="//ajax.googleapis.com/ajax/libs/jquery/' . $version . '/jquery.min.js"></script>' . "\n"; |
454 | 433 | $out .= '<script>window.jQuery || document.write(\'<script src="' . js_url() . 'jquery-' . $version . '.min.js"><\/script>\')</script>' . "\n"; |
@@ -467,8 +446,7 @@ discard block |
||
467 | 446 | * @return string |
468 | 447 | */ |
469 | 448 | if (!function_exists('google_analytics')) { |
470 | - function google_analytics($ua = '') |
|
471 | - { |
|
449 | + function google_analytics($ua = '') { |
|
472 | 450 | // Change UA-XXXXX-X to be your site's ID |
473 | 451 | $out = "<!-- Google Webmaster Tools & Analytics -->\n"; |
474 | 452 | $out .= '<script type="text/javascript">'; |
@@ -367,12 +367,10 @@ discard block |
||
367 | 367 | * |
368 | 368 | * @deprecated |
369 | 369 | */ |
370 | - public function set_email($email) |
|
371 | - { |
|
370 | + public function set_email($email) { |
|
372 | 371 | $email = trim(strtolower($email)); |
373 | 372 | |
374 | - if ( ! filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) |
|
375 | - { |
|
373 | + if ( ! filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) { |
|
376 | 374 | return md5($email); |
377 | 375 | } |
378 | 376 | |
@@ -393,12 +391,10 @@ discard block |
||
393 | 391 | * |
394 | 392 | * @deprecated |
395 | 393 | */ |
396 | - public function get_gravatar($email, $rating = NULL, $size = NULL, $default_image = NULL, $secure = NULL) |
|
397 | - { |
|
394 | + public function get_gravatar($email, $rating = NULL, $size = NULL, $default_image = NULL, $secure = NULL) { |
|
398 | 395 | $hash = $this->set_email($email); |
399 | 396 | |
400 | - if ($hash === NULL) |
|
401 | - { |
|
397 | + if ($hash === NULL) { |
|
402 | 398 | // $hash has to be set to a value so the gravatar site can return a default image |
403 | 399 | $hash = 'invalid_email'; |
404 | 400 | } |
@@ -406,32 +402,25 @@ discard block |
||
406 | 402 | $query_string = NULL; |
407 | 403 | $options = array(); |
408 | 404 | |
409 | - if ($rating !== NULL) |
|
410 | - { |
|
405 | + if ($rating !== NULL) { |
|
411 | 406 | $options['r'] = $rating; |
412 | 407 | } |
413 | 408 | |
414 | - if ($size !== NULL) |
|
415 | - { |
|
409 | + if ($size !== NULL) { |
|
416 | 410 | $options['s'] = $size; |
417 | 411 | } |
418 | 412 | |
419 | - if ($default_image !== NULL) |
|
420 | - { |
|
413 | + if ($default_image !== NULL) { |
|
421 | 414 | $options['d'] = urlencode($default_image); |
422 | 415 | } |
423 | 416 | |
424 | - if (count($options) > 0) |
|
425 | - { |
|
417 | + if (count($options) > 0) { |
|
426 | 418 | $query_string = '?'. http_build_query($options); |
427 | 419 | } |
428 | 420 | |
429 | - if ($secure !== NULL) |
|
430 | - { |
|
421 | + if ($secure !== NULL) { |
|
431 | 422 | $base = $this->gravatar_secure_base_url; |
432 | - } |
|
433 | - else |
|
434 | - { |
|
423 | + } else { |
|
435 | 424 | $base = $this->gravatar_base_url; |
436 | 425 | } |
437 | 426 | |
@@ -448,32 +437,26 @@ discard block |
||
448 | 437 | * |
449 | 438 | * @deprecated |
450 | 439 | */ |
451 | - public function get_profile($email, $fetch_method = 'file') |
|
452 | - { |
|
440 | + public function get_profile($email, $fetch_method = 'file') { |
|
453 | 441 | $hash = $this->set_email($email); |
454 | 442 | |
455 | - if ($hash === NULL) |
|
456 | - { |
|
443 | + if ($hash === NULL) { |
|
457 | 444 | // A hash value of NULL will return no xml so the method returns NULL |
458 | 445 | return NULL; |
459 | 446 | } |
460 | 447 | |
461 | 448 | libxml_use_internal_errors(TRUE); |
462 | 449 | |
463 | - if ($fetch_method === 'file') |
|
464 | - { |
|
465 | - if (ini_get('allow_url_fopen') == FALSE) |
|
466 | - { |
|
450 | + if ($fetch_method === 'file') { |
|
451 | + if (ini_get('allow_url_fopen') == FALSE) { |
|
467 | 452 | return NULL; |
468 | 453 | } |
469 | 454 | |
470 | 455 | $str = file_get_contents($this->gravatar_base_url . $hash .'.xml'); |
471 | 456 | } |
472 | 457 | |
473 | - if ($fetch_method === 'curl') |
|
474 | - { |
|
475 | - if ( ! function_exists('curl_init')) |
|
476 | - { |
|
458 | + if ($fetch_method === 'curl') { |
|
459 | + if ( ! function_exists('curl_init')) { |
|
477 | 460 | return NULL; |
478 | 461 | } |
479 | 462 | |
@@ -490,18 +473,14 @@ discard block |
||
490 | 473 | |
491 | 474 | $xml = simplexml_load_string($str); |
492 | 475 | |
493 | - if ($xml === FALSE) |
|
494 | - { |
|
476 | + if ($xml === FALSE) { |
|
495 | 477 | $errors = array(); |
496 | - foreach(libxml_get_errors() as $error) |
|
497 | - { |
|
478 | + foreach(libxml_get_errors() as $error) { |
|
498 | 479 | $errors[] = $error->message.'\n'; |
499 | 480 | } |
500 | 481 | $error_string = implode('\n', $errors); |
501 | 482 | throw new Exception('Failed loading XML\n'. $error_string); |
502 | - } |
|
503 | - else |
|
504 | - { |
|
483 | + } else { |
|
505 | 484 | return $xml->entry; |
506 | 485 | } |
507 | 486 | } |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Name: Auth Lang - English |
4 | 6 | * |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Name: Auth Lang - English |
4 | 6 | * |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Name: Auth Lang - English |
4 | 6 | * |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Name: Auth Lang - Slovenian |
4 | 6 | * |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Name: Auth Lang - English |
4 | 6 | * |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Name: Auth Lang - English |
4 | 6 | * |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Name: Auth Lang - English |
4 | 6 | * |