-http://www.frequency-decoder.com/
+http://www.frequency-decoder.com/demo/date-picker-v4/
$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;
}
// 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();
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) {
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>";
}
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) {
--- /dev/null
+Originally published at
+http://www.frequency-decoder.com/2006/03/06/animated-minitabs
+Reworked by Thierry Parmentelat (INRIA) for supporting POST method, images, bubbles ...
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();
}
-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)
$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();