From f17018962bfc6cc38a0b2ccc5f40a939f5fe49fa Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Tue, 10 Aug 2021 19:16:48 +1000 Subject: Use relative URLs instead of hardcoding domain --- .../Application/Controllers/WikiController.php | 2 +- h-source/Library/Helper/List.php | 2 +- h-source/Library/Helper/Menu.php | 2 +- h-source/Library/Helper/Popup.php | 4 +- h-source/Library/Theme.php | 6 +- h-source/Library/Url.php | 4 +- h-source/admin/Application/Include/myFunctions.php | 12 ++-- h-source/admin/Library/Helper/Popup.php | 4 +- h-source/admin/Library/Theme.php | 4 +- h-source/admin/Library/Url.php | 2 +- h-source/config.xml | 78 +++++++++++----------- 11 files changed, 58 insertions(+), 62 deletions(-) (limited to 'h-source') diff --git a/h-source/Application/Controllers/WikiController.php b/h-source/Application/Controllers/WikiController.php index 5dc05b8..f3da19f 100644 --- a/h-source/Application/Controllers/WikiController.php +++ b/h-source/Application/Controllers/WikiController.php @@ -496,7 +496,7 @@ class WikiController extends BaseController // if ($this->m['WikitalkModel']->queryResult) // { -// header('Refresh: 0;url=http://'.DOMAIN_NAME.$_SERVER['REQUEST_URI']); +// header('Refresh: 0;url='.$_SERVER['REQUEST_URI']); // die(); // } } diff --git a/h-source/Library/Helper/List.php b/h-source/Library/Helper/List.php index ba59643..57aeeff 100755 --- a/h-source/Library/Helper/List.php +++ b/h-source/Library/Helper/List.php @@ -73,7 +73,7 @@ class Helper_List extends Helper_Html { //get the generic language class $this->strings = Factory_Strings::generic(Params::$language); - $baseUrl = 'http://'.DOMAIN_NAME.'/Public/Img/Icons/elementary_2_5/'; + $baseUrl = '/Public/Img/Icons/elementary_2_5/'; //set the files of the images $this->submitImages = array( diff --git a/h-source/Library/Helper/Menu.php b/h-source/Library/Helper/Menu.php index 8fd4bf4..86ee24a 100755 --- a/h-source/Library/Helper/Menu.php +++ b/h-source/Library/Helper/Menu.php @@ -36,7 +36,7 @@ class Helper_Menu extends Helper_Html public function __construct() { - $baseUrl = "http://".DOMAIN_NAME.'/Public/Img/Icons/elementary_2_5/'; + $baseUrl = '/Public/Img/Icons/elementary_2_5/'; //get the generic language class $this->strings = Factory_Strings::generic(Params::$language); diff --git a/h-source/Library/Helper/Popup.php b/h-source/Library/Helper/Popup.php index 18bb00d..43140fe 100755 --- a/h-source/Library/Helper/Popup.php +++ b/h-source/Library/Helper/Popup.php @@ -133,10 +133,10 @@ class Helper_Popup extends Helper_Html { $returnString .= "\n"; } if (count($this->popupArray)>0) { - $returnString .= "\n"; + $returnString .= "\n"; } } return $returnString; } -} \ No newline at end of file +} diff --git a/h-source/Library/Theme.php b/h-source/Library/Theme.php index 10c0fce..fe938ee 100755 --- a/h-source/Library/Theme.php +++ b/h-source/Library/Theme.php @@ -39,11 +39,9 @@ class Theme { function __construct($controller) { - $protocol = Params::$useHttps ? "https" : "http"; - $this->controller = $controller; - $this->baseUrl = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME : "$protocol://" . DOMAIN_NAME . '/index.php'; - $this->baseUrlSrc = "$protocol://" . DOMAIN_NAME; + $this->baseUrl = MOD_REWRITE_MODULE === true ? '': '/index.php'; + $this->baseUrlSrc = ''; } diff --git a/h-source/Library/Url.php b/h-source/Library/Url.php index efb8e6e..5124047 100755 --- a/h-source/Library/Url.php +++ b/h-source/Library/Url.php @@ -27,9 +27,7 @@ class Url { //get the url starting from the root folder public static function getRoot($pathFromRootFolder = null) { - $protocol = Params::$useHttps ? "https" : "http"; - - $url = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME . '/' . $pathFromRootFolder : "$protocol://" . DOMAIN_NAME . '/index.php/' . $pathFromRootFolder; + $url = MOD_REWRITE_MODULE === true ? '/' . $pathFromRootFolder : '/index.php/' . $pathFromRootFolder; return $url; } diff --git a/h-source/admin/Application/Include/myFunctions.php b/h-source/admin/Application/Include/myFunctions.php index ab32bbf..355c181 100644 --- a/h-source/admin/Application/Include/myFunctions.php +++ b/h-source/admin/Application/Include/myFunctions.php @@ -166,7 +166,7 @@ function getLinkToUser($user) } else { - return "$user"; + return "$user"; } } @@ -271,7 +271,7 @@ function linkToNotebook($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/notebooks/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = "/notebooks/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } @@ -281,7 +281,7 @@ function linkToWifi($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/wifi/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = "/wifi/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } @@ -291,7 +291,7 @@ function linkToVideocard($match) $hardware = new HardwareModel(); $clean['id_hard'] = (int)$match[2]; $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - $href = "HTTP://".DOMAIN_NAME."/videocards/view/".Lang::$current."/".$clean['id_hard']."/$name"; + $href = "/videocards/view/".Lang::$current."/".$clean['id_hard']."/$name"; return (strcmp($name,'') !== 0) ? "".$name."" : $match[0]; } @@ -309,10 +309,10 @@ function getMotivation($row,$controller) $clean['id_hard'] = (int)$row['deletion']['id_duplicate']; $hardware = new HardwareModel(); $name = encodeUrl($hardware->getTheModelName($clean['id_hard'])); - return "duplication of the model having id ".$clean['id_hard'].""; + return "duplication of the model having id ".$clean['id_hard'].""; } else { return "".$row['deletion']['object'].""; } -} \ No newline at end of file +} diff --git a/h-source/admin/Library/Helper/Popup.php b/h-source/admin/Library/Helper/Popup.php index 9ceac72..17ba908 100755 --- a/h-source/admin/Library/Helper/Popup.php +++ b/h-source/admin/Library/Helper/Popup.php @@ -78,10 +78,10 @@ class Helper_Popup extends Helper_Html { $this->viewArgs[$field] = $tempArg; } if (count($this->popupArray)>0) { - $returnString .= "\n"; + $returnString .= "\n"; } } return $returnString; } -} \ No newline at end of file +} diff --git a/h-source/admin/Library/Theme.php b/h-source/admin/Library/Theme.php index 692697e..afa3660 100755 --- a/h-source/admin/Library/Theme.php +++ b/h-source/admin/Library/Theme.php @@ -22,8 +22,8 @@ class Theme { function __construct($controller) { $this->controller = $controller; - $this->baseUrl = MOD_REWRITE_MODULE === true ? 'http://' . DOMAIN_NAME : 'http://' . DOMAIN_NAME . '/index.php'; - $this->baseUrlSrc = 'http://' . DOMAIN_NAME; + $this->baseUrl = MOD_REWRITE_MODULE === true ? '/admin' : '/admin/index.php'; + $this->baseUrlSrc = '/admin'; } diff --git a/h-source/admin/Library/Url.php b/h-source/admin/Library/Url.php index 4e2ca5e..54d6e3e 100755 --- a/h-source/admin/Library/Url.php +++ b/h-source/admin/Library/Url.php @@ -9,7 +9,7 @@ class Url { //get the url starting from the root folder public static function getRoot($pathFromRootFolder = null) { - $url = MOD_REWRITE_MODULE === true ? 'http://' . DOMAIN_NAME . '/' . $pathFromRootFolder : 'http://' . DOMAIN_NAME . '/index.php/' . $pathFromRootFolder; + $url = MOD_REWRITE_MODULE === true ? '/admin/' . $pathFromRootFolder : '/admin/index.php/' . $pathFromRootFolder; return $url; } diff --git a/h-source/config.xml b/h-source/config.xml index 30b0dd5..0ac72f1 100644 --- a/h-source/config.xml +++ b/h-source/config.xml @@ -5,35 +5,35 @@ TopLink Help - + TopLink Aiuto - + TopLink Ayuda - + TopLink Télécharger - + TopLink Βοήθεια - + @@ -42,35 +42,35 @@ TopLink FAQ - + TopLink FAQ - + TopLink FAQ - + TopLink FAQ - + TopLink FAQ - + @@ -128,7 +128,7 @@ raw
discover_hardware
+ ]]> @@ -155,7 +155,7 @@ subscribe to our
- +
]]>
@@ -166,7 +166,7 @@ raw client for h-node -
Please help in the development of the client for h-node (h-client project). See here and here +
Please help in the development of the client for h-node (h-client project). See here and here
]]> @@ -177,7 +177,7 @@ raw related projects
-
Please help in the development of the IsMyHWOK software, a different h-node client +
Please help in the development of the IsMyHWOK software, a different h-node client
]]> @@ -189,7 +189,7 @@ download the source code
- +
]]>
@@ -280,7 +280,7 @@ iscriviti alla nostra
- +
]]>
@@ -291,7 +291,7 @@ raw client per h-node -
Puoi aiutare nello sviluppo del client per h-node (progetto h-client). Leggi qui e qui +
Puoi aiutare nello sviluppo del client per h-node (progetto h-client). Leggi qui e qui
]]> @@ -302,7 +302,7 @@ raw progetti correlati
-
Puoi aiutare nello sviluppo del software IsMyHWOK, un diverso client per h-node +
Puoi aiutare nello sviluppo del software IsMyHWOK, un diverso client per h-node
]]> @@ -314,7 +314,7 @@ scarica il codice sorgente
- +
]]>
@@ -405,7 +405,7 @@ suscríbase a nuestra
- +
]]>
@@ -416,7 +416,7 @@ raw cliente para h-node -
Por favor ayude en el desarrollo del cliente de h-node (proyecto h-client). Vea aquí y aquí +
Por favor ayude en el desarrollo del cliente de h-node (proyecto h-client). Vea aquí y aquí
]]> @@ -427,7 +427,7 @@ raw proyectos relacionados
-
Por favor ayuda en el desarrollo del programa IsMyHWOK, un cliente diferente para h-node +
Por favor ayuda en el desarrollo del programa IsMyHWOK, un cliente diferente para h-node
]]> @@ -439,7 +439,7 @@ descargue el código fuente
- +
]]>
@@ -516,13 +516,13 @@ raw - guidelines on how to compile a hardware device page ]]> + guidelines on how to compile a hardware device page ]]> raw - guida su come compilare una pagina di hardware ]]> + guida su come compilare una pagina di hardware ]]> @@ -530,19 +530,19 @@ raw - learn how to find it ]]> + learn how to find it ]]> raw - scopri come individuarlo ]]> + scopri come individuarlo ]]> raw - aprenda como encontrarlo ]]> + aprenda como encontrarlo ]]> @@ -550,37 +550,37 @@ raw - discover all the wiki tags ]]> + discover all the wiki tags ]]> raw - scopri tutti i tag della wiki ]]> + scopri tutti i tag della wiki ]]> raw - mostrar todas las etiquetas del wiki ]]> + mostrar todas las etiquetas del wiki ]]> raw - voir tous les tags wiki ]]> + voir tous les tags wiki ]]> raw - Wiki-Elemente ]]> + Wiki-Elemente ]]> raw - Wiki-Elemente ]]> + Wiki-Elemente ]]> @@ -665,19 +665,19 @@ raw - learn how to find it ]]> + learn how to find it ]]> raw - scopri come individuarlo ]]> + scopri come individuarlo ]]> raw - aprenda como encontrarlo ]]> + aprenda como encontrarlo ]]> @@ -689,13 +689,13 @@ raw - learn how to fill this entry ]]> + learn how to fill this entry ]]> raw - guida su come scegliere questo campo ]]> + guida su come scegliere questo campo ]]> -- cgit v1.2.3