Exemplo n.º 1
0
 /**
  * Build URLs for global use throughout the application
  * @return 	array
  */
 protected static function buildRelevantUrls()
 {
     if (!self::$urls) {
         $http = strpos(ICMS_URL, "https://") === false ? "http://" : "https://";
         $phpself = $_SERVER['SCRIPT_NAME'];
         $httphost = $_SERVER['HTTP_HOST'];
         $querystring = $_SERVER['QUERY_STRING'];
         if ($querystring != '') {
             $querystring = '?' . $querystring;
         }
         $currenturl = $http . $httphost . $phpself . $querystring;
         self::$urls = array();
         self::$urls['http'] = $http;
         self::$urls['httphost'] = $httphost;
         self::$urls['phpself'] = $phpself;
         self::$urls['querystring'] = $querystring;
         self::$urls['full_phpself'] = $http . $httphost . $phpself;
         self::$urls['full'] = $currenturl;
         $previouspage = '';
         if (array_key_exists('HTTP_REFERER', $_SERVER) && isset($_SERVER['HTTP_REFERER'])) {
             self::$urls['previouspage'] = $_SERVER['HTTP_REFERER'];
         }
         //self::$urls['isHomePage'] = (ICMS_URL . "/index.php") == ($http . $httphost . $phpself);
     }
     return self::$urls;
 }