renamed all 'btn_prefs_' buttons strings to 'btn_'
[brisk.git] / web / index.php
index 7ed58e6..a3be749 100644 (file)
@@ -71,12 +71,14 @@ $mlang_room = array( 'userpassuse'  => array('it' => 'Il tuo nickname è g
                                              'en' => 'back to tables'),
                      'btn_exit'     => array('it' => 'Esco.',
                                              'en' => 'Exit.'),
-                     'btn_prefs_save' => array('it' => 'Salva.',
+                     'btn_save' => array('it' => 'Salva.',
                                              'en' => 'Save.'),
-                     'btn_prefs_reset' => array('it' => 'Annulla.',
+                     'btn_reset' => array('it' => 'Annulla.',
                                              'en' => 'Reset.'),
-                     'btn_prefs_close' => array('it' => 'Chiudi.',
+                     'btn_close' => array('it' => 'Chiudi.',
                                              'en' => 'Close.'),
+                     'btn_send'  => array('it' => 'Invia.',
+                                             'en' => 'Send.'),
                      'tit_tabl'     => array('it' => 'Tavolo ',
                                              'en' => 'Table '),
                      'tit_stat'     => array('it' => 'imposta lo stato del tuo utente',
@@ -226,10 +228,6 @@ $mlang_room = array( 'userpassuse'  => array('it' => 'Il tuo nickname è g
                                              'en' => 'Send a message to the administrator:'),
                      'mesgtoadm_sub'=> array('it' => 'soggetto:',
                                              'en' => 'subject:'),
-                     'btn_send'     => array('it' => 'Invia.',
-                                             'en' => 'Send.'),
-                     'btn_close'    => array('it' => 'Chiudi.',
-                                             'en' => 'Close.')
                      );
 
 require_once("briskin5/Obj/briskin5.phh");
@@ -338,6 +336,9 @@ function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_f
         $sess = "";
     if (($name = gpcs_var('name', $get, $post, $cookie)) === FALSE)
         unset($name);
+    else
+        log_step("LOGIN: $name");
+
     if (($pass_private = gpcs_var('pass_private', $get, $post, $cookie)) === FALSE)
         unset ($pass_private);
     if (($table_idx = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
@@ -345,8 +346,6 @@ function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_f
     if (($table_token = gpcs_var('table_idx', $get, $post, $cookie)) === FALSE)
         unset ($table_token);
 
-    log_step("LOGIN: $name");
-
     // default values
     $_cookie_law_3party = 'true';
     if (isset($cookie['_cookie_law_3party']))
@@ -1108,29 +1107,25 @@ window.onload = function() {
 
     <?php echo $mlang_room['passwarn'][$G_lang];?><br><br>
 
-         <button onclick="$('apprentice_div').style.display = 'inline-block';">Vuoi ottenere un accesso da apprendista ?</button><br><br>
+         <button onclick="$('apprentice_div').style.display = ($('apprentice_div').style.display == 'none' ? 'inline-block' : 'none');">Vuoi ottenere un accesso da apprendista ?</button><br><br>
              <div id="apprentice_div" style="display: none; background-color: #ffd780; border: 1px solid #ffae00; padding: 8px;">
          <br>
          Inserisci il tuo nickname e il tuo indirizzo e-mail.<br>
-         Il tuo nickname non può essere più lungo di 12 caratteri, <br>deve essere composto soltanto da lettere non accentate e numeri,<br>senza ripetere lo stesso carattere per più di 3 volte consecutive.<br><br>
+         Il tuo nickname non può essere più lungo di 12 caratteri,<br>deve essere composto soltanto da lettere non accentate e numeri,<br>senza ripetere lo stesso carattere per più di 3 volte consecutive.<br><br>
     <form accept-charset="utf-8" method="post" action="" onsubmit="return j_new_apprentice(this);">
-    <input type="hidden" name="new_apprentice" value="666">
+    <input type="hidden" name="realsub" value="666">
     <table class="login">
     <tr><td>nickname:</td>
     <td><input id="nameid" class="input_text" name="cli_name" type="text" size="24" maxlength="12" value=""></td></tr>
     <tr><td>e-mail:</td>
     <td><input id="emailid" class="input_text" name="cli_email" type="text" size="24" maxlength="512" value=""></td></tr>
-    <tr><td colspan="2"><input id="sub" value="<?php echo $mlang_room['btn_send'][$G_lang];?>" type="submit" class="button"></td></tr>
+                                                                          <tr><td colspan="2"><table style="margin: auto;"><tr><td><input id="send" onclick="submit_click(this);" value="<?php echo $mlang_room['btn_send'][$G_lang];?>" type="submit" class="button"></td>
+        <td><input id="close" onclick="submit_click(this);" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button"></td></tr></table></td></tr>
     </table>
     </form></div>
          <br><br>
 <?php echo $mlang_room['browwarn'][$G_lang];?><br>
     </div>
-    <br><br><br><br>
-    <br><br><br><br>
-    <br><br><br><br>
-    <br><br><br><br>
-    <br><br><br><br>
 
     <div id="imgct"></div>
     <div id="logz"></div>
@@ -1348,8 +1343,8 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi
 <tr><td><img title="messaggio" class="nobo" src="img/mesgtoadm_mesg<?php echo $G_lng;?>.png"></td>
 <td><textarea id="mesgid" class="input_text" name="mesg" cols="40" rows="8" wrap="soft"></textarea></td></tr>
 <tr><td colspan="2" style="text-align: center;">
-       <input id="subid" name="sub" value="<?php echo $mlang_room['btn_send'][$G_lang];?>" type="submit" onclick="this.form.elements['realsub'].value = 'invia';" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-<input id="cloid" name="clo" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chiudi';"></td></tr>
+       <input id="subid" name="sub" value="<?php echo $mlang_room['btn_send'][$G_lang];?>" type="submit" onclick="submit_click(this);" class="button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+<input id="cloid" name="clo" value="<?php echo $mlang_room['btn_close'][$G_lang];?>" type="submit" class="button" onclick="submit_click(this);"></td></tr>
 </table>
     </form>
     </div>
@@ -1466,9 +1461,9 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi
 </div>
 </div>
 <div class="notify_clo">
-<input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('preferences').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_prefs_close'][$G_lang]; ?>"/>
-<input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_reset();" value="<?php echo $mlang_room['btn_prefs_reset'][$G_lang]; ?>"/>
-<input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_save();" value="<?php echo $mlang_room['btn_prefs_save'][$G_lang]; ?>"/>
+<input type="submit" class="input_sub" style="bottom: 4px;" onclick="$('preferences').style.visibility = 'hidden';" value="<?php echo $mlang_room['btn_close'][$G_lang]; ?>"/>
+<input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_reset();" value="<?php echo $mlang_room['btn_reset'][$G_lang]; ?>"/>
+<input type="submit" class="input_sub" style="bottom: 4px;" onclick="prefs_save();" value="<?php echo $mlang_room['btn_save'][$G_lang]; ?>"/>
 </div>
 </div>
 <script language="JavaScript">