[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 10/12: Add function linkTo for URL
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 10/12: Add function linkTo for URL |
Date: |
Sat, 17 Sep 2022 08:40:58 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit b680ec6572b00759e215f63ce0f4af1b34d07b8b
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Fri Sep 16 15:03:49 2022 +0200
Add function linkTo for URL
---
include/lib/ac_common.php | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index 2398f8fcd..3b6eb3237 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -1672,4 +1672,13 @@ function FaxTo($p_tel) {
return $r;
}
return false;
+}
+function linkTo($p_url)
+{
+ if (empty($p_url) ) return "";
+ if (filter_var(trim($p_url,FILTER_VALIDATE_URL)) ) {
+ return sprintf('<a href="%s" target="_blank">%s</a>',$p_url,$p_url);
+ } else {
+ return $p_url;
+ }
}
\ No newline at end of file
- [Noalyss-commit] [noalyss] 04/12: Task #0002125: Contact , devrait être refait sur le modèle de Fiche->résumé, (continued)
- [Noalyss-commit] [noalyss] 04/12: Task #0002125: Contact , devrait être refait sur le modèle de Fiche->résumé, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 08/12: Task #0002125: type , missed phoneTo for mobile , phone and faxTo, several emails separated by a comma, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 01/12: Fix Bug : accounting history was not shown when dble clicked, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 06/12: SQL If nothing is loaded return false, otherwise true, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 02/12: New #0002193: Possibilité d'ajouter directement une note aux opérations Cosmetic : change icon for enlarging operation label, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 09/12: Improve PHPUNIT, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 11/12: New #2195 0002195: Création catégorie : ordre des attributs, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 03/12: Improve autoloader, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 05/12: New function mailto and tel, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 12/12: Improve #0002196: Comptes Alphanumériques calculés trop longs, Dany De Bontridder, 2022/09/17
- [Noalyss-commit] [noalyss] 10/12: Add function linkTo for URL,
Dany De Bontridder <=