$tabs=array();
$tabs['Clear events']=l_events();
-plc_tabs($tabs);
+plekit_linetabs($tabs);
list($from_string,$from_time) = parse_date ($from_date,false,$DAY,$EPOCH);
list($until_string,$until_time) = parse_date ($until_date,true,$DAY,$EPOCH);
"D"=>"none",
);
-$table = new PlcTable ("events",$headers,"0r");
+$table = new PlekitTable ("events",$headers,"0r");
$table->set_options (array ('max_pages'=>20));
$table->start ();
foreach ($events as $event) {
"Click the button in the D(etails) column to get more details")));
$table->end();
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
$tabs['Users']=l_persons();
$tabs['Nodes']=l_nodes();
$tabs['Slices']=l_slices();
-plc_tabs ($tabs);
+plekit_linetabs ($tabs);
// fill out dates from now if not specified
-$from_picker = new PlcDatepicker ('from_date','From (inclusive)',array('inline'=>true));
+$from_picker = new PlekitDatepicker ('from_date','From (inclusive)',array('inline'=>true));
$from_picker->today();
-$until_picker = new PlcDatepicker ('until_date','Until (inclusive)',array('inline'=>true));
+$until_picker = new PlekitDatepicker ('until_date','Until (inclusive)',array('inline'=>true));
$until_picker->today();
-$form=new PlcForm(l_events(),array(),'GET');
+$form=new PlekitForm(l_events(),array(),'GET');
$form->start();
-$details = new PlcDetails (true);
+$details = new PlekitDetails (true);
$details->start();
$details->tr ($form->submit_html('submit','Show Events'),'center');
$details->end();
$form->end();
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
$tabs=array();
$tabs[] = array('label'=>'Back to node', 'url'=>l_node($node_id),
'bubble'=>'Cancel pending changes');
-plc_tabs($tabs);
+plekit_linetabs($tabs);
$fields=array( 'method', 'type', 'ip', 'gateway', 'network', 'broadcast', 'netmask',
'dns1', 'dns2', 'hostname', 'mac', 'bwlimit', 'node_id' );
<script type="text/javascript" src="/planetlab/nodes/interface.js"></script>
');
-$details=new PlcDetails($can_update);
+$details=new PlekitDetails($can_update);
// xxx hardwire network type for now
$form_variables = array('node_id'=>$node_id,'type'=>"ipv4");
//////////////////////////////////////// tags
-$toggle=new PlcToggle ('tags','Tags',array('trigger-tagname'=>'h2'));
+$toggle=new PlekitToggle ('tags','Tags',array('trigger-tagname'=>'h2'));
$toggle->start();
-$form = new PlcForm (l_actions(),array('interface_id'=>$interface_id));
+$form = new PlekitForm (l_actions(),array('interface_id'=>$interface_id));
$form->start();
$tags=$api->GetInterfaceTags (array('interface_id'=>$interface_id));
if ($can_update) $headers[plc_delete_icon()]="none";
$table_options=array("notes_area"=>false,"pagesize_area"=>false,"search_width"=>10);
-$table=new PlcTable("interface_tags",$headers,0,$table_options);
+$table=new PlekitTable("interface_tags",$headers,0,$table_options);
$table->start();
if ($tags) foreach ($tags as $tag) {
$table->row_start();
$form->end();
$toggle->end();
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
'bubble'=>"Comon page about node $hostname"));
}
-plc_tabs($tabs);
+plekit_linetabs($tabs);
// show gray background on foreign objects : start a <div> with proper class
$peers->block_start ($peer_id);
-$details=new PlcDetails($privileges);
+$details=new PlekitDetails($privileges);
$details->start();
if ( ! $local_peer) {
$details->th_td("Peer",$peers->peer_link($peer_id));
$boot_value=$boot_state;
} else {
$boot_value="";
- $boot_form = new PlcForm (l_actions(), array("node_id"=>$node_id,
+ $boot_form = new PlekitForm (l_actions(), array("node_id"=>$node_id,
"action"=>"node-boot-state"));
$boot_value .= $boot_form->start_html();
$states = array( 'boot'=>'Boot', 'safeboot'=>'SafeBoot', 'failboot'=>'FailBoot',
if ( $local_peer && $privileges) {
$download_value="";
- $download_form = new PlcForm (l_actions_download(),array("node_id"=>$node_id));
+ $download_form = new PlekitForm (l_actions_download(),array("node_id"=>$node_id));
$download_value .= $download_form->start_html();
$selectors = array(
array("display"=>"-- All in one images --","disabled"=>true),
$details->end ();
-$form=new PlcForm (l_actions(), array('node_id'=>$node_id));
+$form=new PlekitForm (l_actions(), array('node_id'=>$node_id));
$form->start();
//////////////////////////////////////////////////////////// Tags
$tagnames = array_map ("get_tagname",$tags);
$nodegroups_hash=plc_nodegroup_global_hash($api,$tagnames);
- $toggle = new PlcToggle ('tags',"Tags",array('trigger-tagname'=>'h2',
+ $toggle = new PlekitToggle ('tags',"Tags",array('trigger-tagname'=>'h2',
'trigger-bubble'=>'Inspect and set tags on that node',
'start-visible'=>$show_tags));
$toggle->start();
if (plc_is_admin()) $headers[plc_delete_icon()]="none";
$table_options=array("notes_area"=>false,"pagesize_area"=>false,"search_width"=>10);
- $table=new PlcTable("node_tags",$headers,0,$table_options);
+ $table=new PlekitTable("node_tags",$headers,0,$table_options);
$table->start();
if ($tags) foreach ($tags as $tag) {
// does this match a nodegroup ?
//////////////////////////////////////////////////////////// interfaces
if ( $local_peer ) {
- $toggle=new PlcToggle ('interfaces',"Interfaces",array('trigger-tagname'=>'h2',
+ $toggle=new PlekitToggle ('interfaces',"Interfaces",array('trigger-tagname'=>'h2',
'trigger-bubble'=>'Inspect and tune interfaces on that node',
'start-hidden'=>true));
$toggle->start();
if ( $privileges ) $headers[plc_delete_icon()]='string';
$table_options=array('search_area'=>false,"pagesize_area"=>false,'notes_area'=>false);
- $table=new PlcTable("node_interfaces",$headers,2,$table_options);
+ $table=new PlekitTable("node_interfaces",$headers,2,$table_options);
$table->start();
foreach ( $interfaces as $interface ) {
if ($privileges) {
$table->tfoot_start();
$table->row_start();
- $add_button=new PlcFormButton (l_interface_add($node_id),"add_interface","Add interface","GET");
+ $add_button=new PlekitFormButton (l_interface_add($node_id),"add_interface","Add interface","GET");
// we should have 6 cols, use 3 for the left (new) and the rest for the right (remove)
$table->cell($add_button->html(), 3,"left");
$table->cell($form->submit_html("delete-interfaces","Remove Interfaces"), $table->columns()-3,"right");
// display slices
{
- $toggle=new PlcToggle ('slices',"Slices",array('trigger-tagname'=>'h2',
+ $toggle=new PlekitToggle ('slices',"Slices",array('trigger-tagname'=>'h2',
'trigger-bubble'=>'Review slices running on that node',
'start-hidden'=>true));
$toggle->start();
$table_options['search_area']=false;
$table_options['pagesize_area']=false;
}
- $table=new PlcTable("node_slices",$headers,1,$table_options);
+ $table=new PlekitTable("node_slices",$headers,1,$table_options);
$table->start();
foreach ($slices as $slice) {
////////////////////////////////////////////////////////////
$peers->block_end($peer_id);
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
// --------------------
drupal_set_title($title);
-plc_tabs($tabs);
+plekit_linetabs($tabs);
if ( ! $nodes ) {
drupal_set_message ('No node found');
);
# initial sort on hostnames
-$table=new PlcTable ("nodes",$headers,4);
+$table=new PlekitTable ("nodes",$headers,4);
$table->start();
$peers = new Peers ($api);
$table->end();
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
$tabs=array();
$tabs['Back to peers list']=l_peers();
-plc_tabs ($tabs);
+plekit_linetabs ($tabs);
// --------------------
// recognized URL arguments
drupal_set_title("Details for Peer " . $peername);
-$details=new PlcDetails(false);
+$details=new PlekitDetails(false);
$details->start();
$details->th_td("Peer name",$peer['peername']);
$details->th_td("Short name",$peer['shortname']);
$details->th_td("Number of slices",href(l_slices_peer($peer_id),"$nb slices"));
$details->end();
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
$tabs=array();
$tabs['Comon for all nodes']=l_comon("peer_id","0");
-plc_tabs($tabs);
+plekit_linetabs($tabs);
if ( empty($peers)) {
drupal_set_message ("You seem to be running a standalone deployment");
'Comon'=>'string');
$table_options=array('search_area'=>false, 'notes_area'=>false);
- $table = new PlcTable ("peers",$headers,1,$table_options);
+ $table = new PlekitTable ("peers",$headers,1,$table_options);
$table->start();
foreach ($peers as $peer) {
$table->row_start();
$table->end();
}
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
'bubble'=>"Events about $first_name $last_name",
'image'=>'/planetlab/icons/event.png','height'=>18);
-plc_tabs($tabs);
+plekit_linetabs($tabs);
$peers->block_start ($peer_id);
if ( ! $enabled ) $enabled_label = plc_warning_html("Disabled");
$can_update = (plc_is_admin() && $local_peer) || $is_my_account;
-$details = new PlcDetails($can_update);
+$details = new PlekitDetails($can_update);
$details->form_start(l_actions(),array("action"=>"update-person",
"person_id"=>$person_id));
$details->form_end();
//////////////////// slices
-$toggle=new PlcToggle ('slices','Slices',array('trigger-tagname'=>'h2'));
+$toggle=new PlekitToggle ('slices','Slices',array('trigger-tagname'=>'h2'));
$toggle->start();
if( ! $slices) {
$table_options['search_area']=false;
$table_options['pagesize_area']=false;
}
- $table=new PlcTable ("person_slices",$headers,1,$table_options);
+ $table=new PlekitTable ("person_slices",$headers,1,$table_options);
$table->start();
foreach( $slices as $slice ) {
$toggle->end();
// we don't set 'action', but use the submit button name instead
-$form=new PlcForm(l_actions(), array("person_id"=>$person_id));
+$form=new PlekitForm(l_actions(), array("person_id"=>$person_id));
$form->start();
//////////////////// keys
-$toggle=new PlcToggle ('keys',"Keys",array('trigger-tagname'=>'h2'));
+$toggle=new PlekitToggle ('keys',"Keys",array('trigger-tagname'=>'h2'));
$toggle->start();
$can_manage_keys = ( $local_peer && ( plc_is_admin() || $is_my_account) );
if ($can_manage_keys) $headers[plc_delete_icon()]="none";
// table overall options
$table_options=array('search_area'=>false,'pagesize_area'=>false,'notes_area'=>false);
-$table=new PlcTable("person_keys",$headers,"1",$table_options);
+$table=new PlekitTable("person_keys",$headers,"1",$table_options);
$table->start();
if ($keys) foreach ($keys as $key) {
$toggle->end();
//////////////////// sites
-$toggle=new PlcToggle('sites','Sites',array('trigger-tagname'=>'h2'));
+$toggle=new PlekitToggle('sites','Sites',array('trigger-tagname'=>'h2'));
$toggle->start();
if (empty( $sites ) ) {
$headers['Name']="string";
if ($can_manage_sites) $headers[plc_delete_icon()]="none";
$table_options = array('notes_area'=>false,'search_area'=>false, 'pagesize_area'=>false);
-$table=new PlcTable ("person_sites",$headers,0,$table_options);
+$table=new PlekitTable ("person_sites",$headers,0,$table_options);
$table->start();
foreach( $sites as $site ) {
$site_name= $site['name'];
$toggle->end();
//////////////////// roles
-$toggle=new PlcToggle ('roles','Roles',array('trigger-tagname'=>'h2'));
+$toggle=new PlekitToggle ('roles','Roles',array('trigger-tagname'=>'h2'));
$toggle->start();
if (! $roles) plc_warning ("This user has no role !");
if ($can_manage_roles) $headers [plc_delete_icon()]="none";
$table_options=array('search_area'=>false,'pagesize_area'=>false,'notes_area'=>false);
-$table=new PlcTable("person_roles",$headers,0,$table_options);
+$table=new PlekitTable("person_roles",$headers,0,$table_options);
$table->start();
// construct array of role objs
$form->end();
$peers->block_end($peer_id);
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
// --------------------
drupal_set_title($title);
-//plc_tabs($tabs);
+//plekit_linetabs($tabs);
if ( ! $persons ) {
drupal_set_message ('No account found');
);
// initial sort on email
-$table=new PlcTable("persons",$headers,4);
+$table=new PlekitTable("persons",$headers,4);
$table->start();
$peers=new Peers ($api);
$notes=array("The S column shows the number of slices for the given user");
$table->end(array('notes'=>$notes));
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
'bubble'=>'Review pending join requests');
}
-plc_tabs($tabs);
+plekit_linetabs($tabs);
// show gray background on foreign objects : start a <div> with proper class
$peers->block_start ($peer_id);
" to review pending applications.");
$can_update=(plc_is_admin () && $local_peer) || ( plc_in_site($site_id) && plc_is_pi());
-$details = new PlcDetails($can_update);
+$details = new PlekitDetails($can_update);
if ( ! $site['is_public'])
plc_warning("This site is not public!");
$nodes_title = plc_warning_html ($nodes_title);
$nodes_title .= href(l_nodes_site($site_id)," (See as nodes)");
- $toggle=new PlcToggle ('nodes',$nodes_title,array('trigger-tagname'=>'h2'));
+ $toggle=new PlekitToggle ('nodes',$nodes_title,array('trigger-tagname'=>'h2'));
$toggle->start();
$headers=array();
$headers['hostname']='string';
$headers['state']='string';
- $table = new PlcTable ('nodes',$headers,'0',array('search_area'=>false,
+ $table = new PlekitTable ('nodes',$headers,'0',array('search_area'=>false,
'notes_area'=>false,
'pagesize_area'=>false));
$table->start();
}
$table->tfoot_start();
$table->row_start();
- $button=new PlcFormButton (l_node_add(),"node_add","Add node","POST");
+ $button=new PlekitFormButton (l_node_add(),"node_add","Add node","POST");
$table->cell($button->html(),$table->columns(),"right");
$table->row_end();
$table->end();
$persons_title = plc_warning_html ($persons_title);
$persons_title .= href(l_persons_site($site_id)," (See as users)");
- $toggle=new PlcToggle ('persons',$persons_title,array('trigger-tagname'=>'h2'));
+ $toggle=new PlekitToggle ('persons',$persons_title,array('trigger-tagname'=>'h2'));
$toggle->start();
$headers = array ();
$headers['User']='string';
$headers["Tech"]='string';
if ($has_disabled_persons) $headers["Disabled"]='string';
- $table=new PlcTable('persons',$headers,'1r-3r-0',array('search_area'=>false,
+ $table=new PlekitTable('persons',$headers,'1r-3r-0',array('search_area'=>false,
'notes_area'=>false,
'pagesize_area'=>false));
$table->start();
//////////////////// Slices
// xxx to review after slices gets reworked
- $toggle=new PlcToggle ('slices',"Slices",array('trigger-tagname'=>'h2'));
+ $toggle=new PlekitToggle ('slices',"Slices",array('trigger-tagname'=>'h2'));
$toggle->start();
- $details=new PlcDetails (false);
+ $details=new PlekitDetails (false);
$details->start();
// summary on slices
$slice_label = count($slice_ids) . " running / " . $max_slices . " max";
$details->th_td("# Slices", href(l_slices_site($site_id),$slice_label));
if ($slices) foreach ($slices as $slice)
$details->th_td($slice['instantiation'],l_slice_obj($slice));
- $button=new PlcFormButton (l_slice_add(),"slice_add","Add slice","POST");
+ $button=new PlekitFormButton (l_slice_add(),"slice_add","Add slice","POST");
$details->tr($button->html(),"right");
$details->end();
$toggle->end();
// Addresses
- $toggle=new PlcToggle ('addresses',"Addresses",array('trigger-tagname'=>'h2',
+ $toggle=new PlekitToggle ('addresses',"Addresses",array('trigger-tagname'=>'h2',
'start-visible'=>false));
$toggle->start();
if ( ! $addresses) {
print "No known address for this site";
} else {
- $details=new PlcDetails (false);
+ $details=new PlekitDetails (false);
$details->start();
$details->th_td("Addresses","");
foreach ($addresses as $address) {
////////////////////////////////////////
$peers->block_end($peer_id);
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
'bubble'=>'Review pending join requests');
drupal_set_title($title);
-plc_tabs($tabs);
+plekit_linetabs($tabs);
// go
$sites= $api->GetSites( $site_filter , $site_columns);
$headers['?']="string";
}
-$table=new PlcTable("sites",$headers,2);
+$table=new PlekitTable("sites",$headers,2);
$table->start();
if ($sites) foreach ($sites as $site) {
$table->end(array('notes'=>$notes));
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
$tabs []= tab_nodes_local();
drupal_set_title("Details for node group " . $nodegroup['groupname']);
-plc_tabs($tabs);
+plekit_linetabs($tabs);
-$details=new PlcDetails(false);
+$details=new PlekitDetails(false);
$details->start();
$details->th_td ("Node group name",$nodegroup['groupname']);
$details->th_td ("Based on tag",href(l_tag($nodegroup['tag_type_id']),$tagname));
$details->end();
// xxx : add & delete buttons would make sense here too
-$toggle=new PlcToggle('nodes',"Nodes",array('trigger-tagname'=>'h2'));
+$toggle=new PlekitToggle('nodes',"Nodes",array('trigger-tagname'=>'h2'));
$toggle=>start();
$headers["Hostname"]="string";
-$table = new PlcTable("nodegroup_nodes",$headers,0,array('search_width'=>15));
+$table = new PlekitTable("nodegroup_nodes",$headers,0,array('search_width'=>15));
$table->start();
if ($nodes) foreach ($nodes as $node) {
$table->row_start ();
$table->end ();
$toggle->end();
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
// --------------------
drupal_set_title($title);
-plc_tabs($tabs);
+plekit_linetabs($tabs);
if ( ! $nodegroups ) {
drupal_set_message ('No node group found');
"Nodes"=>"int");
# initial sort on groupname
-$table=new PlcTable("nodegroups",$headers,0);
+$table=new PlekitTable("nodegroups",$headers,0);
$table->start();
foreach ($nodegroups as $nodegroup) {
$table->end();
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
$sliver_tags=$api->GetSliceTags(array_merge($filter,array("~node_id"=>array())));
drupal_set_title("Details for tag type $tagname");
-plc_tabs($tabs);
+plekit_linetabs($tabs);
// ----------
$can_update=plc_is_admin();
-$details=new PlcDetails ($can_update);
+$details=new PlekitDetails ($can_update);
$details->form_start(l_actions(),array("action"=>"update-tag-type",
"tag_type_id"=>$tag_type_id));
// xxx could outline values corresponding to a nodegroup
if (count ($node_tags)) {
- $toggle=new PlcToggle('tag_nodes',"Nodes",array('trigger-tagname'=>'h2'));
+ $toggle=new PlekitToggle('tag_nodes',"Nodes",array('trigger-tagname'=>'h2'));
$toggle->start();
- $table=new PlcTable ("tag_nodes",array("Hostname"=>"string","value"=>"string"),0,$table_options);
+ $table=new PlekitTable ("tag_nodes",array("Hostname"=>"string","value"=>"string"),0,$table_options);
$table->start();
foreach ($node_tags as $node_tag) {
$table->row_start();
}
if (count ($interface_tags)) {
- $toggle=new PlcToggle('tag_interfaces',"Interfaces",array('trigger-tagname'=>'h2'));
+ $toggle=new PlekitToggle('tag_interfaces',"Interfaces",array('trigger-tagname'=>'h2'));
$toggle->start();
- $table=new PlcTable ("tag_interfaces",array("IP"=>"IPAddress","value"=>"string"),0,$table_options);
+ $table=new PlekitTable ("tag_interfaces",array("IP"=>"IPAddress","value"=>"string"),0,$table_options);
$table->start();
foreach ($interface_tags as $interface_tag) {
$table->row_start();
// xxx don't show hostnames yet
$slice_tags = array_merge ($slice_tags,$sliver_tags);
if (count ($slice_tags)) {
- $toggle=new PlcToggle('tag_slices',"Slice and sliver tags",array('trigger-tagname'=>'h2'));
+ $toggle=new PlekitToggle('tag_slices',"Slice and sliver tags",array('trigger-tagname'=>'h2'));
$toggle->start();
- $table=new PlcTable ("tag_slices",array("Slice"=>"string","value"=>"string","Node id"=>"int"),0,$table_options);
+ $table=new PlekitTable ("tag_slices",array("Slice"=>"string","value"=>"string","Node id"=>"int"),0,$table_options);
$table->start();
foreach ($slice_tags as $slice_tag) {
$table->row_start();
$toggle->end();
}
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
// --------------------
drupal_set_title($title);
-plc_tabs($tabs);
+plekit_linetabs($tabs);
$tag_type_columns = array( "tag_type_id", "tagname", "category", "description", "min_role_id" );
$headers["Id"]="int";
if (plc_is_admin()) $headers[plc_delete_icon()]="none";
-$form=new PlcForm(l_actions(),NULL);
+$form=new PlekitForm(l_actions(),NULL);
$form->start();
-$table = new PlcTable("tags",$headers,0);
+$table = new PlekitTable("tags",$headers,0);
$table->start();
$roles_hash=plc_role_global_hash($api);
$table->end();
$form->end();
-//plc_tabs ($tabs,"bottom");
+//plekit_linetabs ($tabs,"bottom");
// Print footer
include 'plc_footer.php';
// (*) format (default 2010/Jan/01), php-equiv. Y/M/d, which in this paradigm translates into Y-sl-m-sl-d
// (*) value : the value to display initially - default ''
-class PlcDatepicker {
+class PlekitDatepicker {
var $id;
- function PlcDatepicker ($id,$display,$options=NULL) {
+ function PlekitDatepicker ($id,$display,$options=NULL) {
$datepicker_default_options =
array ('inline'=>true,
'format'=>'Y-sl-M-sl-d',
// th_th : special cases, display 2 <th>
// xxx todo : accept optional arguments as an options hash, rather than using the set_ methods which are ugly
-class PlcDetails {
+class PlekitDetails {
var $editable;
var $form;
var $height;
var $input_type;
- function PlcDetails ($editable) {
+ function PlekitDetails ($editable) {
$this->editable=$editable;
$this->form=NULL;
$this->width="";
}
// starts an inner form if the details are editable
- // accpets same args as PlcForm
+ // accpets same args as PlekitForm
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);
+ $this->form = new PlekitForm ($url,$values,$method);
return $this->form->start_html();
}
$html .= "<input type='$input_type' name='$form_varname' id='$form_varname' value='$value'";
if ($width) $html .= " size=$width";
// handle event callbacks
- $html .= PlcForm::attributes($options);
+ $html .= PlekitForm::attributes($options);
$html .= "/>";
}
$html .= "</td></tr>";
// the first functions that we had were actually printing the stuff instead of returning it
// so basically the foo (...) function should just do ``print (foo_html(...))''
-class PlcForm {
+class PlekitForm {
// mandatory
var $url;
var $values; // a hash var=>value - default is empty array
var $method; // default is POST
- function PlcForm ($full_url, $values, $method="POST") {
+ function PlekitForm ($full_url, $values, $method="POST") {
// so we can use the various l_* functions:
// we parse the url to extract var-values pairs,
// and add them to the 'values' argument if any
if ( ! $options) $options=array();
$html="<input";
$html="<input type='$type' name='$name' value='$value'";
- $html .= PlcForm::attributes ($options);
+ $html .= PlekitForm::attributes ($options);
$html .= "/>";
return $html;
}
- static function text_html ($name,$value, $options=NULL) { return PlcForm::input_html('text', $name, $value, $options); }
- static function hidden_html ($name,$value, $options=NULL) { return PlcForm::input_html('hidden', $name, $value, $options); }
- static function checkbox_html ($name,$value,$options=NULL) { return PlcForm::input_html('checkbox', $name, $value, $options); }
- static function submit_html ($name,$value,$options=NULL) { return PlcForm::input_html('submit', $name, $value, $options); }
- static function button_html ($name,$value,$options=NULL) { return PlcForm::input_html('button', $name, $value, $options); }
- static function radio_html ($name,$value,$options=NULL) { return PlcForm::input_html('radio', $name, $value, $options); }
- static function file_html ($name,$value,$options=NULL) { return PlcForm::input_html('file', $name, $value, $options); }
+ static function text_html ($name,$value, $options=NULL) { return PlekitForm::input_html('text', $name, $value, $options); }
+ static function hidden_html ($name,$value, $options=NULL) { return PlekitForm::input_html('hidden', $name, $value, $options); }
+ static function checkbox_html ($name,$value,$options=NULL) { return PlekitForm::input_html('checkbox', $name, $value, $options); }
+ static function submit_html ($name,$value,$options=NULL) { return PlekitForm::input_html('submit', $name, $value, $options); }
+ static function button_html ($name,$value,$options=NULL) { return PlekitForm::input_html('button', $name, $value, $options); }
+ static function radio_html ($name,$value,$options=NULL) { return PlekitForm::input_html('radio', $name, $value, $options); }
+ static function file_html ($name,$value,$options=NULL) { return PlekitForm::input_html('file', $name, $value, $options); }
static function label_html ($name,$display) {
return "<label for=$name>$display</label>";
$role_ids [] = $role['role_id'];
}
}
- return PlcForm::role_selectors($api,$role_ids,$current);
+ return PlekitForm::role_selectors($api,$role_ids,$current);
}
}
// a form with a single button
-class PlcFormButton extends PlcForm {
+class PlekitFormButton extends PlekitForm {
var $button_id;
var $button_text;
- function PlcFormButton ($full_url, $button_id, $button_text, $method="POST") {
- $this->PlcForm($full_url,array(),$method);
+ function PlekitFormButton ($full_url, $button_id, $button_text, $method="POST") {
+ $this->PlekitForm($full_url,array(),$method);
$this->button_id=$button_id;
$this->button_text=$button_text;
}
// $tabs['Simple Tab']="http://planet-lab.org";
// $tabs['Complex Tab']=array('url'=>'http://planet-lab.org/',
// 'bubble'=>'This text gets displayed when the mouse remains over for a while');
-// plc_tabs($tabs);
+// plekit_linetabs($tabs);
////////// Notes: limited support for images
// (*) for some reason, confirmation does not work with image tabs
// (the form gets submitted whatever the confirmation....)
// (*) you need to tune the image size, which is wrong, as the image should rather be bottom-aligned
-function plc_tabs ($array, $id=NULL) {
+function plekit_linetabs ($array, $id=NULL) {
// need id to pass to the onclick function attached to the input buttons
$id="minitabs";
if (! $id) $id .= '-' + $id;
// - pagesize_def: the page size when one clicks the pagesize reset button
// - max_pages: the max number of pages to display in the paginator
-class PlcTable {
+class PlekitTable {
// mandatory
var $table_id;
var $headers;
var $notes; // an array of additional notes
var $has_tfoot;
- function PlcTable ($table_id,$headers,$column_sort,$options=NULL) {
+ function PlekitTable ($table_id,$headers,$column_sort,$options=NULL) {
$this->table_id = $table_id;
$this->headers = $headers;
$this->column_sort = $column_sort;
// (*) area_end(): of returning it, we do not expect the code for the area to be passed
// so these methods can be used to delimit the area in question
-class PlcToggle {
+class PlekitToggle {
// mandatory
var $id;
- function PlcToggle ($id,$trigger,$options=NULL) {
+ function PlekitToggle ($id,$trigger,$options=NULL) {
$this->id = $id;
$this->trigger=$trigger;
if ( ! $options ) $options = array();
if ( ! $this->options['start-hidden']) { $x1=""; $x2=" style='display:none'"; }
else { $x2=""; $x1=" style='display:none'"; }
$image_id=$this->id_name('image-visible');
- $html .= "<img id=$image_id class='plc-toggle-visible' src='/planetlab/icons/toggle-visible.png'$x1>";
+ $html .= "<img id=$image_id class='plc-toggle-visible' src='/plekit/icons/toggle-visible.png'$x1>";
$image_id=$this->id_name('image-hidden');
- $html .= "<img id=$image_id class='plc-toggle-hidden' src='/planetlab/icons/toggle-hidden.png'$x2>";
+ $html .= "<img id=$image_id class='plc-toggle-hidden' src='/plekit/icons/toggle-hidden.png'$x2>";
return $html;
}
text-transform: uppercase;
text-align: left;
padding: 8px 12px 4px 12px;
- background: #CAE8EA url(/planetlab/icons/tablesort_header.jpg) no-repeat;
+ background: #CAE8EA url(/plekit/icons/tablesort-header.jpg) no-repeat;
vertical-align:middle;
}
table.plc_table>tbody>tr>td, table.plc_table textarea, table.plc_table input [type="text"] {
th.sortable-sortAlphaNumeric,
th.sortable-sortEnglishDateTime {
cursor:pointer;
- background: #CAE8EA url(/planetlab/icons/tablesort_header_sortable.jpg) no-repeat;
+ background: #CAE8EA url(/plekit/icons/tablesort-header-sortable.jpg) no-repeat;
padding: 8px 12px 4px 16px;
}
th.forwardSort {
- background:#CAE8EA url(/planetlab/icons/tablesort_header_down.jpg) no-repeat 0 0;
+ background:#CAE8EA url(/plekit/icons/tablesort-header-down.jpg) no-repeat 0 0;
}
th.reverseSort {
- background:#CAE8EA url(/planetlab/icons/tablesort_header_up.jpg) no-repeat 0 0;
+ background:#CAE8EA url(/plekit/icons/tablesort-header-up.jpg) no-repeat 0 0;
}
table thead th.forwardSort a,
table thead th.reverseSort a {
as it trys to download the image each and every time that it is used (which means a 1000 row table
will produce 1000 http requests for the image in question) */
tr[class="alt"]>td {
- background: #F5FAFA url(/planetlab/icons/tablesort_td_alt.jpg) no-repeat;
+ background: #F5FAFA url(/plekit/icons/tablesort-td-alt.jpg) no-repeat;
}
table.plc_table>tbody>tr>td [class~="alt"] {
- background: #edf3f3 url(/planetlab/icons/tablesort_col_alt.jpg) no-repeat !important;
+ background: #edf3f3 url(/plekit/icons/tablesort-col-alt.jpg) no-repeat !important;
}
/* Poor old Internet Explorer won't see the next two rules either as it doesn't get :first-child */
table.plc_table>tbody>tr.alt>td:first-child {
- background: #F5FAFA url(/planetlab/icons/tablesort_bullet2.gif) no-repeat;
+ background: #F5FAFA url(/plekit/icons/tablesort-bullet2.gif) no-repeat;
font-weight:bold;
}
table.plc_table>tbody>tr>td:first-child {
- background: #fff url(/planetlab/icons/tablesort_bullet1.gif) no-repeat;
+ background: #fff url(/plekit/icons/tablesort-bullet1.gif) no-repeat;
font-weight:bold;
}
display:block;
line-height:2em;
border:1px solid #fff;
- background:#fff url(/planetlab/icons/tablesort_gradient.gif) repeat-x 0 -20px;
+ background:#fff url(/plekit/icons/tablesort-gradient.gif) repeat-x 0 -20px;
}
ul.fdtablePaginater li a {
cursor:pointer;