]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Adding starthtml and stophtml function
authorJean-Marc Pigeon <jmp@safe.c>
Sun, 7 Sep 2025 11:39:21 +0000 (07:39 -0400)
committerJean-Marc Pigeon <jmp@safe.c>
Sun, 7 Sep 2025 11:39:21 +0000 (07:39 -0400)
www/gesdis.php
www/lvllog.php
www/lvlmai.php
www/translations.js

index 2b6bd3bae131b6ea0bf9126f7ff74ec4e0266aba..f9f547fd85564410bd6b2ea906da996fd59b7c45 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+// vim: smarttab tabstop=8 shiftwidth=2 expandtab
 
 //==============================================================
 //                                                             
@@ -17,7 +18,7 @@ function topper($isadmin,$logname,$pageref)
 {
 global $userlang;
 
-$entete="";
+$entete=getenv("APPNAME");
 $click1="";
 $click2="";
 $click3="";
@@ -26,15 +27,13 @@ if ($isadmin==true)
   $admcolor="red";
 switch ($pageref) {
   case "lvllog"        :
-    $entete=gettranslate($userlang,"Authentication");
-    //$entete=gettranslate(lng::fra,"nuts");
     break;
   case "lvlmai"        :
     if ($isadmin==true) {
       $click1="<a href='/lvlusr.php'>Remotes</a>";
       $click2="<a href='/lvlusr.php'>Users</a>";
-      $click3="<a href='/lvllog.php'>logout</a>";
       }
+    $click3="<a href='/lvllog.php'>logout</a>";
     break;
   case "lvlusr"        :
     $entete="user management";
@@ -47,9 +46,9 @@ switch ($pageref) {
   }
 
 $STR = <<<EOT
-<CENTER><FONT SIZE=+2>
+<CENTER><STRONG><FONT SIZE=+2>
 $entete
-</FONT>
+</FONT></STRONG></CENTER>
 <table cellpadding="0" cellspacing="0" width="100%" border="0">
 <tr>
   <td width="70%">
@@ -117,4 +116,49 @@ EOT;
 return $STR;
 }
 
+//==============================================================
+//
+//     To generate the HTML starter
+//
+//==============================================================
+function starthtml($js)
+
+{
+if ($js!=NULL) {
+  $JSTR = <<<EOT
+  <script defer src="$js"></script>
+  EOT;
+  }
+
+$STR  = <<<EOT
+
+<!DOCTYPE html>
+<HTML>
+<HEAD>
+<TITLE>Mailleur WEB Interface</TITLE>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+$JSTR
+</HEAD>
+<BODY="white">
+EOT;
+
+return $STR;
+}
+
+//==============================================================
+//
+//     To generate the HTML end 
+//
+//==============================================================
+function endhtml()
+
+{
+$STR  = <<<EOT
+</BODY>
+</HTML>
+EOT;
+
+return $STR;
+}
+
 ?>
index 3e9b64d298002d971015fe4583699df6d46e7d69..e536cd5a354af647bd3ef2484f6a6f2a3ffc8cde 100644 (file)
@@ -25,7 +25,11 @@ $STR  = <<<EOT
     <tr>
       <td><img src="/reg-icons/login.gif" alt="" border="0" /></td>
     </tr>
-
+      <td align="center" nowrap="nowrap">
+      <FONT SIZE=+2><STRONG>
+      <span class="translatable" trkey="Authentication">Authentication</span>
+      </STRONG></FONT>
+      </td>
     <tr>
       <td align="center" bgcolor="#000000">
         <table width="100%" cellpadding="0" cellspacing="1" border="0">
@@ -97,28 +101,18 @@ function body()
 {
 global $isadmin;
 
+$start=starthtml("translations.js");
+$stop=endhtml();
 $top=topper($isadmin,NULL,"lvllog");
 $footer=footer("lvllog");
 $login=login();
 
 $STR  = <<<EOT
-<!DOCTYPE html>
-<HTML>    
-<HEAD>
-<TITLE>Starting</TITLE>
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
-<script defer src="translations.js">
-</script>
-</HEAD>
-<BODY="white">
-
-<CENTER><STRONG><FONT SIZE=+2>
+$start
 $top
-</FONT></STRONG></CENTER>
 $login
 $footer
-</BODY>
-</HTML>
+$stop
 EOT;
 
 return $STR;
index 249bb553133e503fe01072b65653598307cb7ce1..1ade263adaf0a5f6f88c61fbf3ef0b09e910c4c8 100644 (file)
@@ -30,6 +30,7 @@ $STR  = <<<EOT
 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
 </HEAD>
 <BODY="white">
+
 $top
 <CENTER><FONT SIZE=+2 color=red>
 Within mailleur
index ae1f66303261eb919b5636390606c40f90acc542..23cb16b8bdd0f83d294ac9ed3e5a88f695fe3f43 100644 (file)
@@ -3,16 +3,18 @@
 var translationMap = new Map();
 
 var translationEn = new Map();
+translationEn.set("Authentication","Authentication");
 translationEn.set("Email","Email");
+translationEn.set("Login","Login");
 translationEn.set("Password","Password");
 translationEn.set("Show","Show");
-translationEn.set("Login","Login");
 
 var translationFr = new Map();
-translationFr.set("Email", "Courriel");
+translationFr.set("Authentication","Authentification");
+translationFr.set("Email","Courriel");
+translationFr.set("Login","Connexion");
 translationFr.set("Password","Mot de passe");
 translationFr.set("Show","Afficher");
-translationFr.set("Login","Connexion");
 
 translationMap.set("fr", translationFr);
 translationMap.set("en", translationEn);