ckp
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 10 Feb 2009 11:20:34 +0000 (11:20 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 10 Feb 2009 11:20:34 +0000 (11:20 +0000)
planetlab/datepicker/URL
planetlab/includes/plc_datepicker.php
planetlab/includes/plc_details.php
planetlab/includes/plc_forms.php
planetlab/includes/plc_functions.php
planetlab/minitabs/URL [new file with mode: 0644]
planetlab/nodes/node.php
planetlab/tablesort/URL
planetlab/tags/tags.php

index 6a63884..07944ba 100644 (file)
@@ -1 +1 @@
-http://www.frequency-decoder.com/
+http://www.frequency-decoder.com/demo/date-picker-v4/
index 229793b..db1f09d 100644 (file)
@@ -37,11 +37,11 @@ class PlcDatepicker {
 
     $html="";
     $html .= "<label for='$this->id'>$this->display</label>";
-    $html .= "<div><input type='text' class='";
-    $html .= " dateformat-$format";
+    $html .= "<input size=13 type='text'";
+    $html .= " class='dateformat-$format";
     $html .= " opacity-60";
     if ($inline) $html .= " display-inline";
-    $html .= "' id='$this->id' name='$this->id' value='$value' /></div>";
+    $html .= "' id='$this->id' name='$this->id' value='$value' />";
     return $html;
   }
 
index de77ebc..c8078bc 100644 (file)
@@ -48,7 +48,7 @@ class PlcDetails {
 
   // starts an inner form if the details are editable
   // accpets same args as PlcForm
-  function form_start ($url,$values,$method="POST") { print $this->form_start_html($url,$values,$method); }
+  function form_start ($url,$values,$method="POST") { print $this->form_start_html($url,$values,$method); return $this->form; }
   function form_start_html ($url,$values,$method="POST") {
     $this->form = new PlcForm ($url,$values,$method);
     return $this->form->start_html();
@@ -105,6 +105,11 @@ class PlcDetails {
     return $this->line_html($title,plc_vertical_table($list,"foo"));
   }
 
+  function line_th ($th1,$th2) {       print $this->line_th_html ($th1, $th2);}
+  function line_th_html ($th1, $th2) {
+    return "<tr><th>$th1</th><th>$th2</th></tr>";
+  }
+
   // 1 item, colspan=2
   function single($title,$align=NULL) { print $this->single_html($title,$align);}
   function single_html($title,$align=NULL) {
index 7b68f2e..9789bae 100644 (file)
@@ -59,8 +59,25 @@ class PlcForm {
   static function label_html ($name,$display) {
     return "<label for=$name>$display </label>";
   }
-  static function text_html ($name,$value,$size) {
-    return "<input type=text name='$name' size=$size value='$value'>";
+  static function radio_html  ($id, $name, $value, $checked) {
+    $html="<input type='radio' id='$id' name='$name' value='$value'";
+    if ($checked) $html .= " checked='checked'";
+    $html .="/>";
+    return $html;
+  }
+  static function text_html ($name,$value,$options=NULL) {
+    $default_options = array('width'=>20);
+    if ( ! $options) $options=array();
+    $options = array_merge($default_options,$options);
+    $html="<input type=text name='$name' value='$value'";
+    $html .= " size=" . $options['width'];
+    $cbs=array('onFocus','onSelect');
+    foreach ($cbs as $cb) {
+      if ($options[$cb])
+       $html .= " $cb='" . $options[$cb] . "'";
+    }
+    $html .= "/>";
+    return $html;
   }
   static function textarea_html ($name,$value,$cols,$rows) {
     return "<textarea name='$name' cols=$cols rows=$rows>$value</textarea>";
index 8ea281d..9a5eff5 100644 (file)
@@ -306,6 +306,12 @@ function truncate ($text,$numb,$etc = "...") {
   }
   return $text;
 }
+function html_div ($text,$class="") {
+  $html="<div";
+  if ($class) $html .= " class='$class'";
+  $html .= ">$text</div>";
+  return $html;
+}
 
 if (! function_exists ("drupal_set_error")) {
   function drupal_set_error ($text) {
diff --git a/planetlab/minitabs/URL b/planetlab/minitabs/URL
new file mode 100644 (file)
index 0000000..469fe82
--- /dev/null
@@ -0,0 +1,3 @@
+Originally published at
+http://www.frequency-decoder.com/2006/03/06/animated-minitabs
+Reworked by Thierry Parmentelat (INRIA) for supporting POST method, images, bubbles ...
index 8de39d7..4fbf56f 100644 (file)
@@ -263,7 +263,7 @@ if ( $local_peer ) {
     function tag_selector ($tag) { return array("display"=>$tag['tagname'],"value"=>$tag['tag_type_id']); }
     $selector=array_map("tag_selector",$all_tags);
     $table->cell($form->select_html("tag_type_id",$selector,"Choose"));
-    $table->cell($form->text_html("value","",8));
+    $table->cell($form->text_html("value","",array('width'=>8));
     $table->cell($form->submit_html("set-tag-on-node","Set Tag"),2,"left");
     $table->row_end();
   }
index 6a63884..17669d0 100644 (file)
@@ -1 +1,4 @@
-http://www.frequency-decoder.com/
+http://www.frequency-decoder.com/2006/09/16/unobtrusive-table-sort-script-revisited
+http://www.frequency-decoder.com/2007/10/19/client-side-table-pagination-script
+frequency-decoder also has a search widget but it's per-column;
+so our own search/pagesize widgets was rewritten by Thierry Parmentelat (INRIA)
index 58a0ace..4403f72 100644 (file)
@@ -96,9 +96,9 @@ if (plc_is_admin()) {
   $selectors=array_map("selector_argument",$relevant_roles);
   $role_input=$form->select_html("min_role_id",$selectors,"Role");
 
-  $table->cell($form->text_html('tagname','',''));
+  $table->cell($form->text_html('tagname',''));
   $table->cell($form->textarea_html('description','',$description_width,2));
-  $table->cell($form->text_html('category','',''));
+  $table->cell($form->text_html('category',''));
   $table->cell($role_input);
   $table->cell($form->submit_html("add-tag-type","Add Type"),2);
   $table->row_end();