Index: /trunk/ippMonitor/raw/ipp.php
===================================================================
--- /trunk/ippMonitor/raw/ipp.php	(revision 28431)
+++ /trunk/ippMonitor/raw/ipp.php	(revision 28432)
@@ -564,6 +564,41 @@
 }
 
+// 
+function button_restrict_checkbox ($key, $line) {
+  $htmlkey = preg_replace ('|\.|', '_', $key);
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  if ($value != "") {
+    if ($line) {
+      $line = $line . "&$htmlkey=$value";
+    } else {
+      $line = "$htmlkey=$value";
+    }
+  }
+  return $line;
+}
+
+// 
+function button_restrict_radio ($key, $line) {
+  $htmlkey = preg_replace ('|\.|', '_', $key);
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  if ($value != "") {
+    if ($line) {
+      $line = $line . "&$htmlkey=$value";
+    } else {
+      $line = "$htmlkey=$value";
+    }
+  }
+  return $line;
+}
+
 function write_header_cell ($class, $name) {
-
   echo "<th class=\"$class\">$name</th>\n";
 }
@@ -637,6 +672,45 @@
   if ($value != "") { 
     echo "value=\"$value\">";
-  } 
+  } else {
+    echo ">";
+  }
   echo "</td>\n";
+}
+
+// checkbox
+function write_query_checkbox ($key, $comment) {
+  $htmlkey = preg_replace ('|\.|', '_', $key);
+
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  echo "<td> <input type=\"checkbox\" name=\"$htmlkey\"";
+  if ($value == "on") { 
+    echo " checked>";
+  } else {
+    echo ">";
+  }
+  echo "$comment ($htmlkey/$value)</td>\n";
+}
+
+// checkbox
+function write_query_radio ($value, $key) {
+  $htmlkey = preg_replace ('| |', '_', $key);
+  $htmlvalue = preg_replace ('|\.|', '_', $value);
+
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$htmlkey]; 
+  } else {
+    $value = $_POST[$htmlkey];
+  }
+  if ($htmlvalue == get_value_from_key($htmlkey, TRUE)) {
+    $checked = "checked";
+  } else {
+    $checked = "";
+  }
+  echo "<td> <input type=\"radio\" name=\"$htmlkey\" value=\"$htmlvalue\" $checked/>";
+  echo "$key ($htmlkey/$htmlvalue)</td>\n";
 }
 
@@ -778,3 +852,22 @@
 // $myPage = $_SERVER[SCRIPT_NAME] . "?pass=$pass";
 
+//////////////////////////////////////////////////////////////////////////
+// Return the value associated to the key (GET or POST method)
+// If convertKeyToHtmlkey is true, the key is converted to a 
+// so-called HTML, i.e. the key where '.' are replaced by '_'
+// (e.g. the conversion of 'f.o.o.b_a_r' is 'f_o_o_b_a_r'.
+//
+function get_value_from_key ($key, $convertKeyToHtmlkey) {
+  if ($convertKeyToHtmlkey) {
+    $htmlkey = preg_replace ('|\.|', '_', $key);
+  } else {
+    $htmlkey = $key;
+  }
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    return $_GET[$htmlkey]; 
+  } else {
+    return $_POST[$htmlkey]; 
+  }
+}
+
 ?>
