From 1f9024763d9224c4cd9a181bac27e6b9f12ad672 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Wed, 18 Sep 2024 14:14:53 -0400 Subject: refactor --- src/web/_model/main.php | 110 ------------------------------------------------ 1 file changed, 110 deletions(-) delete mode 100644 src/web/_model/main.php (limited to 'src/web/_model/main.php') diff --git a/src/web/_model/main.php b/src/web/_model/main.php deleted file mode 100644 index cbcf498..0000000 --- a/src/web/_model/main.php +++ /dev/null @@ -1,110 +0,0 @@ -\d+)/i', @$_SERVER['HTTP_USER_AGENT'], $B)) { - return $B['v']; - } else { - return PHP_INT_MAX; - } - } - - /** - * Gets the full url including the http scheme and host part - * Needed for IE 6 & 7 need. - * @param string $path - * @param bool $timestamp - */ - public function get_url_full(string $path, bool $timestamp = FALSE): string { - $host = $_SERVER['HTTP_HOST']; - $base = lang('base_path'); - - $url = "http://{$host}{$base}{$path}"; - if ($timestamp) { - $time = @filemtime($GLOBALS['rootroot'] . '/' . $path); - $url .= "?timestamp={$time}"; - } - return $url; - } - - /** - * Gets a full path url from a relative path - * @param string $path - * @param bool $timestamp - */ - public function get_url(string $path, bool $timestamp = FALSE): string { - if ($this->get_ie_version() <= 7) { - return $this->get_url_full($path, $timestamp); - } - $base = lang('base_path'); - $url = "{$base}{$path}"; - if ($timestamp) { - $time = @filemtime($GLOBALS['rootroot'] . '/' . $path); - $url .= "?timestamp={$time}"; - } - return $url; - } - - /** - * Loads a css html link - * @param string $path - the path to the css file - */ - public function link_css(string $path): string { - $stamp = $this->asset_stamp($path); - $href = $this->get_url("public/{$path}?stamp={$stamp}"); - return ''; - } - - /** - * Loads a css html link - * @param string $path - the path to the css file - */ - public function embed_css(string $path): string { - $file = $GLOBALS['publicroot'] . '/' . $path; - if (file_exists($file)) { - $text = file_get_contents($file); - return ""; - } else { - return ""; - } - } - - /** - * Formats a ISO date - * @param $iso_date the ISO date - */ - public function format_date(string $iso_date): string { - return date("Y-m-d D H:m", strtotime($iso_date)); - } -} - -?> -- cgit v1.2.3-freya