use class instead of id to hide tables
[brisk.git] / web / index.php
index b7e0d85..76644d7 100644 (file)
@@ -134,7 +134,7 @@ $mlang_room = array( 'userpassuse'  => array('it' => 'Il tuo nickname è g
                                              'en' => 'everybody'),
                      'listall_desc' => array('it' => 'visualizza tutti gli utenti collegati',
                                              'en' => 'visualize all connected users'),
-                     'tit_listisol'  => array('it' => 'solo user autenticati',
+                     'tit_listisol'  => array('it' => 'solo gli user autenticati',
                                              'en' => 'authenticated users only'),
                      'listisol_desc' => array('it' => 'visualizza solo gli user autenticati e i tavoli a loro riservati',
                                              'en' => 'visualize authenticated users only and reserved tables to them'),
@@ -524,24 +524,33 @@ function index_main(&$brisk, $transp_type, $header, &$header_out, $remote_addr_f
     if ($ACTION == "room") {
         $tables .= '<div class="room_tab">';
         $tables .= '<table class="room_tab">';
+
+        $direct = ($user->is_auth() && !$user->is_appr());
         for ($ii = 0 ; $ii < TABLES_N ; $ii++) {
-            if ($user->is_auth() && !$user->is_appr())
+            if ($direct)
                 $i = $ii;
             else
                 $i = TABLES_N - $ii - 1;
 
             if ($ii % 4 == 0) {
-                $tables .= '<tr id = "tr_noauth'.$ii.'">';
-            }
-            if (TRUE || !($user->flags & USER_FLAG_ISOLAUTH) || $i < TABLES_APPR_N) {
-                $tables .= '<td id = "td_noauth'.$ii.'">';
-
-                $tables .= '<div class="room_div"><div class="room_tit"><b>'.$mlang_room['tit_tabl'][$G_lang].$i.'</b></div>';
-                $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
-                $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
-                $tables .= '</div>';
-                $tables .= '</td>'."\n";
+                if ($direct) {
+                    $noauth_class = ($i + 3 < TABLES_APPR_N ? "" : "noauth");
+                }
+                else {
+                    $noauth_class = ($i < TABLES_APPR_N ? "" : "noauth");
+                }
+                $tables .= sprintf('<tr class="%s">', $noauth_class);
             }
+
+            $noauth_class = ($i < TABLES_APPR_N ? "" : "noauth");
+            $tables .= sprintf('<td class="%s">', $noauth_class);
+
+            $tables .= '<div class="room_div"><div class="room_tit"><b>'.$mlang_room['tit_tabl'][$G_lang].$i.'</b></div>';
+            $tables .= sprintf('<div class="proxhr" id="table%d"></div>', $i);
+            $tables .= sprintf('<div class="table_act" id="table_act%d"></div>', $i);
+            $tables .= '</div>';
+            $tables .= '</td>'."\n";
+
             if ($ii % 4 == 3) {
                 $tables .= '</tr>';
             }
@@ -1511,7 +1520,7 @@ type="submit" class="button" onclick="this.form.elements['realsub'].value = 'chi
 '"><span id="list_all">
 <?php echo $mlang_room['tit_listall'][$G_lang];?>
 </span></td></tr>
-<tr><td><input style="vertical-align: bottom;" id="ra_listen_isol" type="radio" name="listen" value="2" onclick="prefs_update('listen');" title="'
+<tr><td><input style="vertical-align: bottom;" id="ra_listen_isol" type="radio" name="listen" value="1" onclick="prefs_update('listen');" title="'
 <?php echo $mlang_room['listisol_desc'][$G_lang];?>
 '"><span id="list_isol">
 <?php echo $mlang_room['tit_listisol'][$G_lang];?>