Esempio n. 1
0
 public static function self_url($assign = '')
 {
     $s = \cge_utils::ssl_request() ? "s" : "";
     $p = strpos($_SERVER['SERVER_PROTOCOL'], '/');
     $protocol = strtolower(substr($_SERVER['SERVER_PROTOCOL'], 0, $p)) . $s;
     $port = $_SERVER["SERVER_PORT"] == "80" ? "" : ":" . $_SERVER["SERVER_PORT"];
     $s = $protocol . "://" . $_SERVER['SERVER_NAME'] . $port;
     $txt = $s . $_SERVER['REQUEST_URI'];
     if (!empty($assign)) {
         $smarty = CmsApp::get_instance()->GetSmarty();
         $smarty->assign($assign, $txt);
         return;
     }
     return $txt;
 }