Rearranging scripts to reduce the hassle of updating local application whenever scrip...
[akelos.git] / lib / AkHeaders / AkLocation.php
blob9559369adb9cc7a473e79fccb0422b685e2f3789
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4 // +----------------------------------------------------------------------+
5 // | Akelos Framework - http://www.akelos.org |
6 // +----------------------------------------------------------------------+
7 // | Copyright (c) 2002-2006, Akelos Media, S.L. & Bermi Ferrer Martinez |
8 // | Released under the GNU Lesser General Public License, see LICENSE.txt|
9 // +----------------------------------------------------------------------+
11 /**
12 * @package ActionController
13 * @subpackage Response
14 * @author Bermi Ferrer <bermi a.t akelos c.om>
15 * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
16 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
19 require_once(AK_LIB_DIR.DS.'Ak.php');
21 class AkLocation
23 function redirect($url)
25 if (!headers_sent($file_name, $line_number)) {
26 header("Location: $url");
27 exit;
28 } else {
29 trigger_error(Ak::t('Headers already sent in %file_name on line %line_number',array('%file_name'=>$file_name,'%line_number'=>$line_number)), E_NOTICE);
30 echo "<meta http-equiv=\"refresh\" content=\"0;url=$url\">";
31 echo Ak::t('Cannot redirect, for now please click this <a href="%url">link</a> instead',array('%url'=>$url));
32 exit;