00001 <?php
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 require_once dirname(__FILE__) . '/FastFrame/Registry.php';
00028
00029
00030
00031
00045
00046 class FastFrame {
00047
00048
00059 function url($in_url, $in_vars = array(), $in_full = false, $in_ssl = false)
00060 {
00061 static $s_webRoot, $b_useSSL, $s_hostname, $b_sessAppend, $s_argSep;
00062
00063 if (!isset($s_webRoot)) {
00064 $o_registry =& FF_Registry::singleton();
00065 $s_webRoot = $o_registry->getConfigParam('webserver/web_root');
00066 $b_useSSL = $o_registry->getConfigParam('webserver/use_ssl');
00067 $s_hostname = $o_registry->getConfigParam('webserver/hostname');
00068 $b_sessAppend = $o_registry->getConfigParam('session/append');
00069 $s_argSep = ini_get('arg_separator.output');
00070 }
00071
00072 if (strpos($in_url, 'javascript:') === 0) {
00073 return $in_url;
00074 }
00075
00076
00077 if (strpos($in_url, '/') !== 0 && !preg_match(':^https?\:
00078 $in_url = $s_webRoot . '/' . $in_url;
00079 }
00080
00081
00082
00083 $b_ssl = ($in_ssl || $b_useSSL);
00084 if (($in_full || $b_ssl) && !preg_match(':^https?\:
00085 $in_url = ($b_ssl ? 'https' : 'http') . ':
00086 }
00087
00088
00089 $s_sessName = session_name();
00090 if (!isset($in_vars[$s_sessName]) &&
00091 (!isset($_COOKIE[$s_sessName]) || $b_sessAppend)) {
00092
00093 if (!FastFrame::isEmpty(session_id())) {
00094 $in_vars[$s_sessName] = session_id();
00095 }
00096 elseif (!empty($_REQUEST[$s_sessName])) {
00097 $in_vars[$s_sessName] = urlencode($_REQUEST[$s_sessName]);
00098 }
00099 }
00100
00101
00102 if (isset($in_vars[$s_sessName]) && $in_vars[$s_sessName] === false) {
00103 unset($in_vars[$s_sessName]);
00104 }
00105
00106 foreach($in_vars as $k => $v) {
00107 $in_vars[$k] = urlencode($k) . '=' . urlencode($v);
00108 }
00109
00110 $queryString = implode($s_argSep, $in_vars);
00111 if (!empty($queryString)) {
00112 $in_url .= (strpos($in_url, '?') === false) ? '?' : $s_argSep;
00113 $in_url .= $queryString;
00114 }
00115
00116 return $in_url;
00117 }
00118
00119
00120
00121
00132 function selfURL($in_vars = array(), $in_full = false, $in_ssl = false)
00133 {
00134
00135 $o_actionHandler =& FF_ActionHandler::singleton();
00136 $in_vars['app'] = isset($in_vars['app']) ? $in_vars['app'] : $o_actionHandler->getAppId();
00137 $in_vars['module'] = isset($in_vars['module']) ? $in_vars['module'] : $o_actionHandler->getModuleId();
00138 $in_vars['actionId'] = isset($in_vars['actionId']) ? $in_vars['actionId'] : $o_actionHandler->getActionId();
00139
00140 if (FF_Request::getParam('isPopup', 'gp', false) && !isset($in_vars['isPopup'])) {
00141 $in_vars['isPopup'] = 1;
00142 }
00143
00144
00145 return FastFrame::url($_SERVER['PHP_SELF'], $in_vars, $in_full, $in_ssl);
00146 }
00147
00148
00149
00150
00165 function redirect($in_url, $in_htmlRedirect = false)
00166 {
00167 if ($in_htmlRedirect) {
00168 echo '<html><head>
00169 <script type="text/javascript">document.location.replace("' . $in_url . '"); window.onload = function() { document.body.style.display = "none"; }</script>
00170 <noscript><meta http-equiv="Refresh" content="0; url=' . $in_url . '"></noscript>
00171 </head><body>
00172 ' . _('If you are seeing this page, your browser settings prevent you from automatically redirecting to a new URL.') . '<br /><br />
00173 ' . sprintf(_('Please <a href="%s">click here</a> to continue.'), $in_url) . '
00174 </body</html>';
00175 }
00176 else {
00177 header('Location: ' . $in_url, true);
00178 }
00179
00180 exit;
00181 }
00182
00183
00184
00185
00198 function isEmpty($in_var)
00199 {
00200 return (empty($in_var) && strlen($in_var) == 0);
00201 }
00202
00203
00204
00205
00212 function checkBrowser()
00213 {
00214 require_once 'Net/UserAgent/Detect.php';
00215 if (!IS_AJAX && Net_UserAgent_Detect::getBrowser(array('belowie6', 'belowns6', 'firefox0.x', 'belowopera8'))) {
00216 header('Location: notsupported.php');
00217 exit;
00218 }
00219 }
00220
00221
00222 }
00223
00224
00225 if (!defined('E_STRICT')) {
00226 define('E_STRICT', 2048);
00227 }
00228
00229
00230
00238 if (version_compare(phpversion(), '5.0') === -1) {
00239
00240 eval('
00241 function clone($obj)
00242 {
00243 return $obj;
00244 }
00245 ');
00246 }
00247
00248
00249
00250 ?>