blob: 121b36b9729310950d680e28a98d7100ce904ebc [file] [log] [blame]
Derek Jones0b59f272008-05-13 04:22:33 +00001<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Derek Allard5811bf12007-02-20 01:26:08 +00002/**
Derek Allardd2df9bc2007-04-15 17:41:17 +00003 * CodeIgniter
Derek Allard5811bf12007-02-20 01:26:08 +00004 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
Derek Allard3d879d52008-01-18 19:41:32 +00008 * @author ExpressionEngine Dev Team
Rick Ellisdd1e3232008-09-12 23:33:20 +00009 * @copyright Copyright (c) 2008, EllisLab, Inc.
Derek Jones7a9193a2008-01-21 18:39:20 +000010 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
Derek Allard5811bf12007-02-20 01:26:08 +000012 * @since Version 1.0
13 * @filesource
14 */
15
16// ------------------------------------------------------------------------
17
18/**
Derek Allardd2df9bc2007-04-15 17:41:17 +000019 * CodeIgniter URL Helpers
Derek Allard5811bf12007-02-20 01:26:08 +000020 *
21 * @package CodeIgniter
22 * @subpackage Helpers
23 * @category Helpers
Derek Allard3d879d52008-01-18 19:41:32 +000024 * @author ExpressionEngine Dev Team
Derek Jones7a9193a2008-01-21 18:39:20 +000025 * @link http://codeigniter.com/user_guide/helpers/url_helper.html
Derek Allard5811bf12007-02-20 01:26:08 +000026 */
27
28// ------------------------------------------------------------------------
29
30/**
31 * Site URL
32 *
33 * Create a local URL based on your basepath. Segments can be passed via the
34 * first parameter either as a string or an array.
35 *
36 * @access public
37 * @param string
38 * @return string
39 */
Derek Jones0b59f272008-05-13 04:22:33 +000040if ( ! function_exists('site_url'))
Derek Allard5811bf12007-02-20 01:26:08 +000041{
Derek Jones269b9422008-01-28 21:00:20 +000042 function site_url($uri = '')
43 {
44 $CI =& get_instance();
45 return $CI->config->site_url($uri);
46 }
Derek Allard5811bf12007-02-20 01:26:08 +000047}
Rick Ellis9e2c04c2008-08-19 22:12:26 +000048
Derek Allard5811bf12007-02-20 01:26:08 +000049// ------------------------------------------------------------------------
50
51/**
52 * Base URL
53 *
54 * Returns the "base_url" item from your config file
55 *
56 * @access public
57 * @return string
58 */
Derek Jones0b59f272008-05-13 04:22:33 +000059if ( ! function_exists('base_url'))
Derek Allard5811bf12007-02-20 01:26:08 +000060{
Derek Jones269b9422008-01-28 21:00:20 +000061 function base_url()
62 {
63 $CI =& get_instance();
64 return $CI->config->slash_item('base_url');
65 }
Derek Allard5811bf12007-02-20 01:26:08 +000066}
Rick Ellis9e2c04c2008-08-19 22:12:26 +000067
68// ------------------------------------------------------------------------
69
70/**
71 * Current URL
72 *
73 * Returns the full URL (including segments) of the page where this
74 * function is placed
75 *
76 * @access public
77 * @return string
78 */
79if ( ! function_exists('current_url'))
80{
81 function current_url()
82 {
83 $CI =& get_instance();
84 return $CI->config->site_url($CI->uri->uri_string());
85 }
86}
87
88// ------------------------------------------------------------------------
89/**
90 * URL String
91 *
92 * Returns the URI segments.
93 *
94 * @access public
95 * @return string
96 */
97if ( ! function_exists('uri_string'))
98{
99 function uri_string()
100 {
101 $CI =& get_instance();
102 return $CI->uri->uri_string();
103 }
104}
105
Derek Allard5811bf12007-02-20 01:26:08 +0000106// ------------------------------------------------------------------------
107
108/**
109 * Index page
110 *
111 * Returns the "index_page" from your config file
112 *
113 * @access public
114 * @return string
115 */
Derek Jones0b59f272008-05-13 04:22:33 +0000116if ( ! function_exists('index_page'))
Derek Allard5811bf12007-02-20 01:26:08 +0000117{
Derek Jones269b9422008-01-28 21:00:20 +0000118 function index_page()
119 {
120 $CI =& get_instance();
121 return $CI->config->item('index_page');
122 }
Derek Allard5811bf12007-02-20 01:26:08 +0000123}
124
125// ------------------------------------------------------------------------
126
127/**
128 * Anchor Link
129 *
130 * Creates an anchor based on the local URL.
131 *
132 * @access public
133 * @param string the URL
134 * @param string the link title
135 * @param mixed any attributes
136 * @return string
137 */
Derek Jones0b59f272008-05-13 04:22:33 +0000138if ( ! function_exists('anchor'))
Derek Allard5811bf12007-02-20 01:26:08 +0000139{
Derek Jones269b9422008-01-28 21:00:20 +0000140 function anchor($uri = '', $title = '', $attributes = '')
141 {
142 $title = (string) $title;
Derek Jones1f2fd2d2007-07-11 21:59:12 +0000143
Derek Jones0b59f272008-05-13 04:22:33 +0000144 if ( ! is_array($uri))
Derek Jones269b9422008-01-28 21:00:20 +0000145 {
Derek Jones0b59f272008-05-13 04:22:33 +0000146 $site_url = ( ! preg_match('!^\w+://! i', $uri)) ? site_url($uri) : $uri;
Derek Jones269b9422008-01-28 21:00:20 +0000147 }
148 else
149 {
150 $site_url = site_url($uri);
151 }
Derek Allard5811bf12007-02-20 01:26:08 +0000152
Derek Jones269b9422008-01-28 21:00:20 +0000153 if ($title == '')
154 {
155 $title = $site_url;
156 }
Derek Allard5811bf12007-02-20 01:26:08 +0000157
Derek Jonescd6f9cd2008-05-07 17:31:03 +0000158 if ($attributes != '')
Derek Jones269b9422008-01-28 21:00:20 +0000159 {
160 $attributes = _parse_attributes($attributes);
161 }
Derek Allard5811bf12007-02-20 01:26:08 +0000162
Derek Jones269b9422008-01-28 21:00:20 +0000163 return '<a href="'.$site_url.'"'.$attributes.'>'.$title.'</a>';
164 }
Derek Allard5811bf12007-02-20 01:26:08 +0000165}
166
167// ------------------------------------------------------------------------
168
169/**
170 * Anchor Link - Pop-up version
171 *
172 * Creates an anchor based on the local URL. The link
173 * opens a new window based on the attributes specified.
174 *
175 * @access public
176 * @param string the URL
177 * @param string the link title
178 * @param mixed any attributes
179 * @return string
180 */
Derek Jones0b59f272008-05-13 04:22:33 +0000181if ( ! function_exists('anchor_popup'))
Derek Jones269b9422008-01-28 21:00:20 +0000182{
183 function anchor_popup($uri = '', $title = '', $attributes = FALSE)
184 {
185 $title = (string) $title;
Derek Jones1f2fd2d2007-07-11 21:59:12 +0000186
Derek Jones0b59f272008-05-13 04:22:33 +0000187 $site_url = ( ! preg_match('!^\w+://! i', $uri)) ? site_url($uri) : $uri;
Derek Allard5811bf12007-02-20 01:26:08 +0000188
Derek Jones269b9422008-01-28 21:00:20 +0000189 if ($title == '')
190 {
191 $title = $site_url;
192 }
Derek Allard5811bf12007-02-20 01:26:08 +0000193
Derek Jones269b9422008-01-28 21:00:20 +0000194 if ($attributes === FALSE)
195 {
196 return "<a href='javascript:void(0);' onclick=\"window.open('".$site_url."', '_blank');\">".$title."</a>";
197 }
Derek Allard5811bf12007-02-20 01:26:08 +0000198
Derek Jones0b59f272008-05-13 04:22:33 +0000199 if ( ! is_array($attributes))
Derek Jones269b9422008-01-28 21:00:20 +0000200 {
201 $attributes = array();
202 }
Derek Allard5811bf12007-02-20 01:26:08 +0000203
Derek Jones269b9422008-01-28 21:00:20 +0000204 foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0', ) as $key => $val)
205 {
Derek Jones0b59f272008-05-13 04:22:33 +0000206 $atts[$key] = ( ! isset($attributes[$key])) ? $val : $attributes[$key];
Derek Jones269b9422008-01-28 21:00:20 +0000207 }
Derek Allard5811bf12007-02-20 01:26:08 +0000208
Derek Jones269b9422008-01-28 21:00:20 +0000209 return "<a href='javascript:void(0);' onclick=\"window.open('".$site_url."', '_blank', '"._parse_attributes($atts, TRUE)."');\">".$title."</a>";
210 }
Derek Allard5811bf12007-02-20 01:26:08 +0000211}
212
213// ------------------------------------------------------------------------
214
215/**
216 * Mailto Link
217 *
218 * @access public
219 * @param string the email address
220 * @param string the link title
221 * @param mixed any attributes
222 * @return string
223 */
Derek Jones0b59f272008-05-13 04:22:33 +0000224if ( ! function_exists('mailto'))
Derek Allard5811bf12007-02-20 01:26:08 +0000225{
Derek Jones269b9422008-01-28 21:00:20 +0000226 function mailto($email, $title = '', $attributes = '')
Derek Allard5811bf12007-02-20 01:26:08 +0000227 {
Derek Jones269b9422008-01-28 21:00:20 +0000228 $title = (string) $title;
229
230 if ($title == "")
231 {
232 $title = $email;
233 }
234
235 $attributes = _parse_attributes($attributes);
236
237 return '<a href="mailto:'.$email.'"'.$attributes.'>'.$title.'</a>';
Derek Allard5811bf12007-02-20 01:26:08 +0000238 }
Derek Allard5811bf12007-02-20 01:26:08 +0000239}
240
241// ------------------------------------------------------------------------
242
243/**
244 * Encoded Mailto Link
245 *
246 * Create a spam-protected mailto link written in Javascript
247 *
248 * @access public
249 * @param string the email address
250 * @param string the link title
251 * @param mixed any attributes
252 * @return string
253 */
Derek Jones0b59f272008-05-13 04:22:33 +0000254if ( ! function_exists('safe_mailto'))
Derek Allard5811bf12007-02-20 01:26:08 +0000255{
Derek Jones269b9422008-01-28 21:00:20 +0000256 function safe_mailto($email, $title = '', $attributes = '')
Derek Allard5811bf12007-02-20 01:26:08 +0000257 {
Derek Jones269b9422008-01-28 21:00:20 +0000258 $title = (string) $title;
259
260 if ($title == "")
261 {
262 $title = $email;
263 }
Derek Allard5811bf12007-02-20 01:26:08 +0000264
Derek Jones269b9422008-01-28 21:00:20 +0000265 for ($i = 0; $i < 16; $i++)
Derek Allard5811bf12007-02-20 01:26:08 +0000266 {
Derek Jones269b9422008-01-28 21:00:20 +0000267 $x[] = substr('<a href="mailto:', $i, 1);
268 }
269
270 for ($i = 0; $i < strlen($email); $i++)
271 {
272 $x[] = "|".ord(substr($email, $i, 1));
273 }
274
275 $x[] = '"';
276
277 if ($attributes != '')
278 {
279 if (is_array($attributes))
Derek Allard5811bf12007-02-20 01:26:08 +0000280 {
Derek Jones269b9422008-01-28 21:00:20 +0000281 foreach ($attributes as $key => $val)
Derek Allard5811bf12007-02-20 01:26:08 +0000282 {
Derek Jones269b9422008-01-28 21:00:20 +0000283 $x[] = ' '.$key.'="';
284 for ($i = 0; $i < strlen($val); $i++)
285 {
286 $x[] = "|".ord(substr($val, $i, 1));
287 }
288 $x[] = '"';
Derek Allard5811bf12007-02-20 01:26:08 +0000289 }
Derek Allard5811bf12007-02-20 01:26:08 +0000290 }
Derek Jones269b9422008-01-28 21:00:20 +0000291 else
292 {
293 for ($i = 0; $i < strlen($attributes); $i++)
294 {
295 $x[] = substr($attributes, $i, 1);
296 }
Derek Allard5811bf12007-02-20 01:26:08 +0000297 }
Derek Jones269b9422008-01-28 21:00:20 +0000298 }
Derek Allard5811bf12007-02-20 01:26:08 +0000299
Derek Jones269b9422008-01-28 21:00:20 +0000300 $x[] = '>';
Derek Allard5811bf12007-02-20 01:26:08 +0000301
Derek Jones269b9422008-01-28 21:00:20 +0000302 $temp = array();
303 for ($i = 0; $i < strlen($title); $i++)
Derek Allard5811bf12007-02-20 01:26:08 +0000304 {
Derek Jones269b9422008-01-28 21:00:20 +0000305 $ordinal = ord($title[$i]);
306
307 if ($ordinal < 128)
Derek Allard5811bf12007-02-20 01:26:08 +0000308 {
Derek Jones269b9422008-01-28 21:00:20 +0000309 $x[] = "|".$ordinal;
Derek Allard5811bf12007-02-20 01:26:08 +0000310 }
Derek Jones269b9422008-01-28 21:00:20 +0000311 else
312 {
313 if (count($temp) == 0)
314 {
315 $count = ($ordinal < 224) ? 2 : 3;
316 }
Derek Allard5811bf12007-02-20 01:26:08 +0000317
Derek Jones269b9422008-01-28 21:00:20 +0000318 $temp[] = $ordinal;
319 if (count($temp) == $count)
320 {
321 $number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64);
322 $x[] = "|".$number;
323 $count = 1;
324 $temp = array();
325 }
Derek Allard5811bf12007-02-20 01:26:08 +0000326 }
327 }
Derek Jones269b9422008-01-28 21:00:20 +0000328
329 $x[] = '<'; $x[] = '/'; $x[] = 'a'; $x[] = '>';
330
331 $x = array_reverse($x);
332 ob_start();
333
334 ?><script type="text/javascript">
335 //<![CDATA[
336 var l=new Array();
337 <?php
338 $i = 0;
339 foreach ($x as $val){ ?>l[<?php echo $i++; ?>]='<?php echo $val; ?>';<?php } ?>
340
341 for (var i = l.length-1; i >= 0; i=i-1){
342 if (l[i].substring(0, 1) == '|') document.write("&#"+unescape(l[i].substring(1))+";");
343 else document.write(unescape(l[i]));}
344 //]]>
345 </script><?php
346
347 $buffer = ob_get_contents();
348 ob_end_clean();
349 return $buffer;
Derek Allard5811bf12007-02-20 01:26:08 +0000350 }
Derek Allard5811bf12007-02-20 01:26:08 +0000351}
352
353// ------------------------------------------------------------------------
354
355/**
356 * Auto-linker
357 *
358 * Automatically links URL and Email addresses.
359 * Note: There's a bit of extra code here to deal with
360 * URLs or emails that end in a period. We'll strip these
361 * off and add them after the link.
362 *
363 * @access public
364 * @param string the string
365 * @param string the type: email, url, or both
366 * @param bool whether to create pop-up links
367 * @return string
368 */
Derek Jones0b59f272008-05-13 04:22:33 +0000369if ( ! function_exists('auto_link'))
Derek Allard5811bf12007-02-20 01:26:08 +0000370{
Derek Jones269b9422008-01-28 21:00:20 +0000371 function auto_link($str, $type = 'both', $popup = FALSE)
372 {
373 if ($type != 'email')
374 {
375 if (preg_match_all("#(^|\s|\()((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches))
Derek Allard5811bf12007-02-20 01:26:08 +0000376 {
Derek Jones269b9422008-01-28 21:00:20 +0000377 $pop = ($popup == TRUE) ? " target=\"_blank\" " : "";
378
379 for ($i = 0; $i < sizeof($matches['0']); $i++)
Derek Allard5811bf12007-02-20 01:26:08 +0000380 {
Derek Jones269b9422008-01-28 21:00:20 +0000381 $period = '';
382 if (preg_match("|\.$|", $matches['6'][$i]))
383 {
384 $period = '.';
385 $matches['6'][$i] = substr($matches['6'][$i], 0, -1);
386 }
Derek Allard5811bf12007-02-20 01:26:08 +0000387
Derek Jones269b9422008-01-28 21:00:20 +0000388 $str = str_replace($matches['0'][$i],
389 $matches['1'][$i].'<a href="http'.
390 $matches['4'][$i].'://'.
391 $matches['5'][$i].
392 $matches['6'][$i].'"'.$pop.'>http'.
393 $matches['4'][$i].'://'.
394 $matches['5'][$i].
395 $matches['6'][$i].'</a>'.
396 $period, $str);
397 }
Derek Allard5811bf12007-02-20 01:26:08 +0000398 }
399 }
Derek Allard5811bf12007-02-20 01:26:08 +0000400
Derek Jones269b9422008-01-28 21:00:20 +0000401 if ($type != 'url')
402 {
403 if (preg_match_all("/([a-zA-Z0-9_\.\-]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)/i", $str, $matches))
Derek Allard5811bf12007-02-20 01:26:08 +0000404 {
Derek Jones269b9422008-01-28 21:00:20 +0000405 for ($i = 0; $i < sizeof($matches['0']); $i++)
Derek Allard5811bf12007-02-20 01:26:08 +0000406 {
Derek Jones269b9422008-01-28 21:00:20 +0000407 $period = '';
408 if (preg_match("|\.$|", $matches['3'][$i]))
409 {
410 $period = '.';
411 $matches['3'][$i] = substr($matches['3'][$i], 0, -1);
412 }
Derek Allard5811bf12007-02-20 01:26:08 +0000413
Derek Jones269b9422008-01-28 21:00:20 +0000414 $str = str_replace($matches['0'][$i], safe_mailto($matches['1'][$i].'@'.$matches['2'][$i].'.'.$matches['3'][$i]).$period, $str);
415 }
Derek Allard5811bf12007-02-20 01:26:08 +0000416
Derek Jones269b9422008-01-28 21:00:20 +0000417 }
Derek Allard5811bf12007-02-20 01:26:08 +0000418 }
Derek Jones269b9422008-01-28 21:00:20 +0000419 return $str;
Derek Allard5811bf12007-02-20 01:26:08 +0000420 }
Derek Allard5811bf12007-02-20 01:26:08 +0000421}
422
423// ------------------------------------------------------------------------
424
425/**
426 * Prep URL
427 *
428 * Simply adds the http:// part if missing
429 *
430 * @access public
431 * @param string the URL
432 * @return string
433 */
Derek Jones0b59f272008-05-13 04:22:33 +0000434if ( ! function_exists('prep_url'))
Derek Allard5811bf12007-02-20 01:26:08 +0000435{
Derek Jones269b9422008-01-28 21:00:20 +0000436 function prep_url($str = '')
Derek Allard5811bf12007-02-20 01:26:08 +0000437 {
Derek Jones269b9422008-01-28 21:00:20 +0000438 if ($str == 'http://' OR $str == '')
439 {
440 return '';
441 }
Derek Allard5811bf12007-02-20 01:26:08 +0000442
Derek Jones269b9422008-01-28 21:00:20 +0000443 if (substr($str, 0, 7) != 'http://' && substr($str, 0, 8) != 'https://')
444 {
445 $str = 'http://'.$str;
446 }
Derek Allard5811bf12007-02-20 01:26:08 +0000447
Derek Jones269b9422008-01-28 21:00:20 +0000448 return $str;
449 }
Derek Allard5811bf12007-02-20 01:26:08 +0000450}
451
452// ------------------------------------------------------------------------
453
454/**
455 * Create URL Title
456 *
457 * Takes a "title" string as input and creates a
458 * human-friendly URL string with either a dash
459 * or an underscore as the word separator.
460 *
461 * @access public
462 * @param string the string
463 * @param string the separator: dash, or underscore
464 * @return string
465 */
Derek Jones0b59f272008-05-13 04:22:33 +0000466if ( ! function_exists('url_title'))
Derek Allard5811bf12007-02-20 01:26:08 +0000467{
Derek Jones269b9422008-01-28 21:00:20 +0000468 function url_title($str, $separator = 'dash')
Derek Allard5811bf12007-02-20 01:26:08 +0000469 {
Derek Jones269b9422008-01-28 21:00:20 +0000470 if ($separator == 'dash')
471 {
472 $search = '_';
473 $replace = '-';
474 }
475 else
476 {
477 $search = '-';
478 $replace = '_';
479 }
Derek Allard5811bf12007-02-20 01:26:08 +0000480
Derek Jones269b9422008-01-28 21:00:20 +0000481 $trans = array(
482 $search => $replace,
483 "\s+" => $replace,
484 "[^a-z0-9".$replace."]" => '',
485 $replace."+" => $replace,
486 $replace."$" => '',
487 "^".$replace => ''
488 );
Derek Allard5811bf12007-02-20 01:26:08 +0000489
Derek Jones269b9422008-01-28 21:00:20 +0000490 $str = strip_tags(strtolower($str));
Derek Allard5811bf12007-02-20 01:26:08 +0000491
Derek Jones269b9422008-01-28 21:00:20 +0000492 foreach ($trans as $key => $val)
493 {
494 $str = preg_replace("#".$key."#", $val, $str);
495 }
496
497 return trim(stripslashes($str));
Derek Allard5811bf12007-02-20 01:26:08 +0000498 }
Derek Allard5811bf12007-02-20 01:26:08 +0000499}
500
501// ------------------------------------------------------------------------
502
503/**
504 * Header Redirect
505 *
506 * Header redirect in two flavors
Derek Allard05f830c2008-04-27 13:35:20 +0000507 * For very fine grained control over headers, you could use the Output
508 * Library's set_header() function.
Derek Allard5811bf12007-02-20 01:26:08 +0000509 *
510 * @access public
511 * @param string the URL
512 * @param string the method: location or redirect
513 * @return string
514 */
Derek Jones0b59f272008-05-13 04:22:33 +0000515if ( ! function_exists('redirect'))
Derek Allard5811bf12007-02-20 01:26:08 +0000516{
Derek Allard05f830c2008-04-27 13:35:20 +0000517 function redirect($uri = '', $method = 'location', $http_response_code = 302)
Derek Allard5811bf12007-02-20 01:26:08 +0000518 {
Derek Jones269b9422008-01-28 21:00:20 +0000519 switch($method)
520 {
521 case 'refresh' : header("Refresh:0;url=".site_url($uri));
522 break;
Derek Allard05f830c2008-04-27 13:35:20 +0000523 default : header("Location: ".site_url($uri), TRUE, $http_response_code);
Derek Jones269b9422008-01-28 21:00:20 +0000524 break;
525 }
526 exit;
Derek Allard5811bf12007-02-20 01:26:08 +0000527 }
Derek Allard5811bf12007-02-20 01:26:08 +0000528}
529
530// ------------------------------------------------------------------------
531
532/**
533 * Parse out the attributes
534 *
535 * Some of the functions use this
536 *
537 * @access private
538 * @param array
539 * @param bool
540 * @return string
541 */
Derek Jones0b59f272008-05-13 04:22:33 +0000542if ( ! function_exists('_parse_attributes'))
Derek Allard5811bf12007-02-20 01:26:08 +0000543{
Derek Jones269b9422008-01-28 21:00:20 +0000544 function _parse_attributes($attributes, $javascript = FALSE)
Derek Allard5811bf12007-02-20 01:26:08 +0000545 {
Derek Jones269b9422008-01-28 21:00:20 +0000546 if (is_string($attributes))
547 {
548 return ($attributes != '') ? ' '.$attributes : '';
549 }
Derek Allard5811bf12007-02-20 01:26:08 +0000550
Derek Jones269b9422008-01-28 21:00:20 +0000551 $att = '';
552 foreach ($attributes as $key => $val)
Derek Allard5811bf12007-02-20 01:26:08 +0000553 {
Derek Jones269b9422008-01-28 21:00:20 +0000554 if ($javascript == TRUE)
555 {
556 $att .= $key . '=' . $val . ',';
557 }
558 else
559 {
560 $att .= ' ' . $key . '="' . $val . '"';
561 }
Derek Allard5811bf12007-02-20 01:26:08 +0000562 }
Derek Jones269b9422008-01-28 21:00:20 +0000563
564 if ($javascript == TRUE AND $att != '')
Derek Allard5811bf12007-02-20 01:26:08 +0000565 {
Derek Jones269b9422008-01-28 21:00:20 +0000566 $att = substr($att, 0, -1);
Derek Allard5811bf12007-02-20 01:26:08 +0000567 }
Derek Allard5811bf12007-02-20 01:26:08 +0000568
Derek Jones269b9422008-01-28 21:00:20 +0000569 return $att;
Derek Allard5811bf12007-02-20 01:26:08 +0000570 }
Derek Allard5811bf12007-02-20 01:26:08 +0000571}
572
Derek Jones0b59f272008-05-13 04:22:33 +0000573
574/* End of file url_helper.php */
Derek Jonesa3ffbbb2008-05-11 18:18:29 +0000575/* Location: ./system/helpers/url_helper.php */