@echo " or make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
@exit 1
else
- +$(RSYNC) planetlab modules $(SSHURL)/var/www/html/
+ +$(RSYNC) planetlab plekit modules $(SSHURL)/var/www/html/
endif
#################### convenience, for debugging only
if ($may_cache) {
$items[] = array(
- 'path' => 'planetlab/logout',
+ 'path' => 'planetlab/common/logout',
'title' => t('Log out of %s', array('%s' => variable_get('site_name', 'local'))),
'callback' => 'planetlab_logout',
'access' => TRUE,
echo "<div>\n
- <form method=post action='/db/adminsearch.php'>\n";
+ <form method=post action='/db/common/adminsearch.php'>\n";
if( $_POST['userquery'] or $_GET['userquery']) {
if ( $_POST['userquery'] ) {
+++ /dev/null
-/*
- Add the following to your CSS file should you wish the cursor to
- "wait" while the script is processing the sort
-*/
-
-body.sort-active *
- {
- cursor:wait;
- }
-
-body
- {
- padding:0;
- border:0;
- margin:0;
- text-align:center;
- font-size:12px;
- font-family: verdana,arial,sans-serif;
- color:#545454;
- min-width: 800px;
- }
-h2 span
- {
- font-variant:small-caps;
- }
-p a
- {
- font-weight:normal;
- outline:none;
- }
-p a:link,
-p a:visited
- {
- color:#333;
- text-decoration:underline;
- }
-p a:hover
- {
- color:#fff;
- text-decoration:none;
- background:#000;
- }
-p a:active
- {
- color:#000;
- text-decoration:underline;
- }
-code
- {
- font-family:'andale mono','lucida console','courier new',monospace;
- font-size:1em;
- }
-p
- {
- line-height:1.6em;
- margin:0 0 1em 0;
- }
-h1
- {
- font-weight:lighter;
- font-family:georgia, times new roman, times, georgia, palatino, serif;
- text-align:center;
- margin-top:0.6em;
- color:#000;
- font-size:2em;
- }
-h2
- {
- font-weight:lighter;
- font-family:verdana,arial,sans-serif;
- text-align:center;
- margin-top:1em;
- color:#333;
- text-transform:uppercase;
- letter-spacing:1px;
- font-size:1.2em;
- }
-h2 span
- {
- font-variant:small-caps;
- text-transform:none;
- }
-.cs1
- {
- width:30em;
- }
-.cs2
- {
- width:20em;
- }
-.cs1 td,
-.cs2 td,
-#scientificNotation
- {
- text-align:right;
- }
-caption
- {
- padding: 0 0 5px 0;
- margin:0 auto;
- width:auto;
- font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
- text-align: right;
- }
-td.total
- {
- border-top: 0;
- border-left: 0;
- border-right: 1px solid #C1DAD7;
- background: none;
- text-align:right;
- font-weight:bold;
- text-transform:uppercase;
- letter-spacing:1px;
- }
-/*
-These styles should be added when very long tables are expected
-th.sort-active
- {
- background:#CAE8EA url(../media/bg_header_sorting.jpg) no-repeat 0 0;
- cursor:wait;
- }
-th.sort-active a
- {
- color:#a80000 !important;
- cursor:wait;
- }
-*/
-th a
- {
- text-decoration:none;
- color: #4f6b72;
- background:transparent;
- }
-td a
- {
- text-decoration:none;
- color:#239;
- background:transparent;
- }
-td img
- {
- margin:0 auto;
- border:3px solid #ddd;
- }
-td a:hover
- {
- color:#a84444;
- border-bottom:1px dotted #a80000;
- background:transparent;
- }
-td.lft
- {
- text-align:left;
- }
-/* Image free rules for Internet Explorer < 7 */
-* html tr.alt td
- {
- background-color:#F5FAFA;
- }
-* html tr td.alt,
-* html tr.alt td.alt
- {
- background-color:#edf3f3;
- }
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_tables.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_datepicker.php';
+require_once 'table.php';
+require_once 'linetabs.php';
+require_once 'datepicker.php';
// needs much memory
ini_set("memory_limit","256M");
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_details.php';
-require_once 'plc_datepicker.php';
+require_once 'linetabs.php';
+require_once 'details.php';
+require_once 'datepicker.php';
//set default title
drupal_set_title('Events choser');
return (is_numeric($x) ? intval($x) == $x : false);
}
-//// belongs to plkit
-// returns array ['url' => path, 'values' => hash (key=>value)* ]
-function plkit_split_url ($full_url) {
- list($url,$args) = explode("?",$full_url);
- $values=array();
- if ($args) {
- $pairs=explode("&",$args);
- foreach ($pairs as $pair) {
- list ($name,$value) = explode("=",$pair);
- $values[$name]=$value;
- }
- }
- return array("url"=>$url,"values"=>$values);
-}
-
-
-
//////////////////////////////////////////////////////////// roles & other checks on global $plc
function plc_is_admin () {
global $plc;
// l_object_t($object_id,text) -> an <a> tag that shows text and links to the above
// l_object_add () -> the url to that object-afding page
-function l_actions () { return "/db/actions.php"; }
+function l_actions () { return "/db/common/actions.php"; }
// some complex node actions are kept separate, e.g. the ones related to getbootmedium
function l_actions_download () { return "/db/nodes/node_downloads.php"; }
function l_tags () { return "/db/tags/index.php"; }
function l_tag ($tag_type_id) { return "/db/tags/index.php?id=$tag_type_id"; }
-function l_tag_obj ($tag) { return href(l_tag($tag['tag-type_id']),$tag['tagname']); }
+function l_tag_obj ($tag) { return href(l_tag($tag['tag_type_id']),$tag['tagname']); }
function l_nodegroups () { return "/db/tags/nodegroups.php"; }
function l_nodegroup ($nodegroup_id) { return "/db/tags/nodegroup.php?id=$nodegroup_id"; }
function l_comon($id_name,$id_value) { return "/db/nodes/comon.php?$id_name=$id_value"; }
function l_sirius() { return "/db/sirius/index.php"; }
-function l_about() { return "/db/about.php"; }
+function l_about() { return "/db/common/about.php"; }
function l_doc_plcapi() { return "/db/doc/PLCAPI.php"; }
function l_doc_nmapi() { return "/db/doc/NMAPI.php"; }
-function l_admin() { return "/db/adminsearch.php"; }
+function l_admin() { return "/db/common/adminsearch.php"; }
-function l_login() { return "/db/login.php"; }
-function l_logout() { return "/planetlab/logout.php"; }
-function l_sulogout() { return "/planetlab/sulogout.php"; }
+function l_login() { return "/db/common/login.php"; }
+function l_logout() { return "/planetlab/common/logout.php"; }
+function l_sulogout() { return "/planetlab/common/sulogout.php"; }
function l_reset_password() { return "/db/persons/reset_password.php"; }
function l_person_register() { return "/db/persons/register.php"; }
function l_site_register() { return "/db/sites/register.php"; }
+++ /dev/null
-<?php
-
-// this will be trashed eventually
-
-// pagination function
-function paginate_trash ( $fn_array, $table_id, $caption, $limit, $main_field, $other_func= NULL, $fid= NULL ) {
- // get vars from call adjust them
- $dir= strtolower( $caption );
- $echo= "";
-
- $link_page= 'index.php';
-
- // check for page number
- if( empty( $_GET['page'] ) )
- $page= 1;
- else
- $page= $_GET['page'];
-
- // reorder array_chunk
- foreach( $fn_array as $arr1 ) {
- unset( $arr2 );
-
- foreach( $arr1 as $key => $val ) {
-// if( substr( $key, -3 ) == "_id" )
- if ( $key == $table_id ) {
- $id[$key]= $val;
- } else {
- $data[$key]= $val;
- }
- }
-
- foreach( $id as $key => $val )
- $arr2[$key]= $val;
-
- foreach( $data as $key => $val )
- $arr2[$key]= $val;
-
- $as_array[]= $arr2;
- }
-
- $totalrows= count( $as_array );
-
- // if array has no rows display msg
- if( $totalrows == 0 )
- return "Nothing to display";
-
- // set key and break up data struct
- $newkey= $page - 1;
- $newarray= array_chunk( $as_array, $limit );
-
- // start table output
- $echo.= "<table class='list_set' border=0 cellpadding=2>\n";
-
- // if there is a caption add it to table
- if( $caption )
- $echo.= "<caption class='list_set'>$caption</caption>\n";
-
- $echo.= "<thead><tr class='list_set'>";
-
- // go through keys of one array row for table headers
- foreach( $newarray[$newkey][0] as $key => $val ) {
-// if( substr( $key, -3 ) != "_id" )
- if ( $key != $table_id && $key != 'peer_id' )
- $echo.= "<th class='list_set'>". ucfirst( $key ) ."</th>";
- }
-
- if( $other_func == 'slivers' )
- $echo.= "<th>Slivers</th>";
-
- $echo.= "</tr></thead><tbody>\n";
-
- // go through array row by row to output table rows
- foreach( $newarray[$newkey] as $assoc ) {
-
- $extraclass="";
- if ($assoc['peer_id']) {
- $extraclass="plc-foreign";
- }
-
-
- $echo.= "<tr class='list_set'>";
-
- foreach( $assoc as $key => $val ) {
- // do not rely on keys order
- $id = $assoc[$table_id];
-// if( substr( $key, -3 ) == "_id" )
- if ($key == $table_id) {
-// $id= $val;
- continue;
- } elseif( $key == $main_field ) {
- $echo.= "<td class='list_set $extraclass'><a href='/db/$dir/$link_page?id=$id'>$val</a></td>";
- } elseif ($key != 'peer_id') {
- $echo.= "<td class='list_set $extraclass'>";
- if( is_array( $val ) ) {
- $count= 1;
- $tot= count( $val );
- foreach( $val as $k => $v ) {
- $echo.= $v;
- if( $count != $tot )
- $echo.= ", ";
- $count++;
- }
- }
- else
- $echo.= $val;
- $echo.= "</td>";
- }
-
- }
-
- if( $other_func == 'slivers' )
- $echo.= "<td><a href='slivers.php?node=$fid&slice=$id'>view</a></td>";
-
- $echo.= "</tr>\n";
- }
-
- // close table
- $echo.= "</tbody></table>\n";
- $echo.= "<hr />\n";
-
- // find total number of pages
- $numofpages = $totalrows / $limit;
-
- // start navigation links
- if( $numofpages > 1 ) {
- // if page is not 1 display first and prev links
- if( $page != 1 && $page ) {
- $pageprev= $page - 1;
- $echo.= "<a href=\"". $_SERVER['REQUEST_URI'] ."&page=1\">FIRST</a> ";
- $echo.= " <a href=\"". $_SERVER['REQUEST_URI'] ."&page=$pageprev\">PREV ".$limit."</a> ";
- }
- else
- $echo.= "PREV ". $limit ." ";
-
- // if less than 30 pages display all
- // otherwise show 30 pages but put ... inbetween
- if( $numofpages < 30 ) {
- $npages= $numofpages;
- $start= 1;
- }
- else {
- $npages= $page + 9;
- if( $npages > $numofpages )
- $npages= $numofpages;
- $start= $page - 10;
- if( $start < 1 )
- $start= 1;
- if( $page != 1 )
- $echo.= " ... ";
- }
-
- // display pages, no link if current page
- for( $i= $start; $i <= $npages; $i++ ) {
- if( $i == $page )
- $echo.= $i ." ";
- else
- $echo.= "<a href=\"". $_SERVER['REQUEST_URI'] ."&page=$i\">$i</a> ";
-
- }
-
- if( ( $totalrows % $limit ) != 0 ) {
- $last= $numofpages + 1;
- if( $i == $page )
- $echo.= $i ." ";
- else
- $echo.= "<a href=\"". $_SERVER['REQUEST_URI'] ."&page=$i\">$i</a> ";
- }
- else
- $last= $numofpages;
-
- if( $numofpages >= 30 ) {
- if( $page != $numofpages )
- $echo.= " ... ";
- }
-
- if( ( $totalrows - ($limit * $page) ) > 0 ) {
- $pagenext= $page + 1;
- $echo.= " <a href=\"". $_SERVER['REQUEST_URI'] ."&page=$pagenext\">NEXT ".$limit."</a> ";
- }
- else
- $echo.= "NEXT ". $limit;
-
- $echo.= " <a href=\"". $_SERVER['REQUEST_URI'] ."&page=". intval( $last ) ."\">LAST</a>\n";
-
- }
-
- return $echo;
-
-}
-
-// function for getting the diff of multi dimention array
-function arr_diff( $a1, $a2 ) {
- $diff= array();
- foreach( $a1 as $k=>$v ) {
- unset( $dv );
- for( $x= 0; $x < count( $a2 ); $x++ ) {
- if( is_int( $k ) ) {
- if( array_search( $v, $a2 ) === false )
- $dv=$v;
- else if( is_array( $v ) )
- $dv= arr_diff( $v, $a2[$x] );
- if( $dv && !in_array( $dv, $diff ) )
- $diff[]=$dv;
- }
- else {
-
- if( !$a2[$k] )
- $dv=$v;
- else if(is_array($v))
- $dv=arr_diff($v,$a2[$x]);
- if($dv)
- $diff[$x]=$dv;
- }
- }
- }
- return $diff;
-}
-
-// obsolete ?
-function plc_js_confirm($message) {
- return "onclick=\"javascript:return confirm('Are you sure you want to delete " . $message . " ?')\"";
-}
-
-function plc_delete_link($url,$delete_message,$visible) {
- return "<a href='" . $url . "' " . plc_js_confirm($delete_message) . ">" . $visible . "</a>";
-}
-
-function plc_delete_link_button($url,$delete_message,$width=15) {
- return "<a href='" . $url . "' " . plc_js_confirm($delete_message) . ">" .
- plc_delete_icon_bubble($width,"Delete this entry") .
- "</a>";
-}
-
-?>
+++ /dev/null
-<?php
-
-drupal_set_html_head('
-<script type="text/javascript" src="/planetlab/prototype/prototype.js"></script>
-');
-
-?>
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_details.php';
-require_once 'plc_tables.php';
-require_once 'plc_toggles.php';
+require_once 'linetabs.php';
+require_once 'details.php';
+require_once 'table.php';
+require_once 'toggle.php';
require_once 'plc_drupal.php';
include 'plc_header.php';
// Common functions
require_once 'plc_functions.php';
require_once 'plc_peers.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
-require_once 'plc_details.php';
-require_once 'plc_forms.php';
-require_once 'plc_toggles.php';
+require_once 'linetabs.php';
+require_once 'table.php';
+require_once 'details.php';
+require_once 'form.php';
+require_once 'toggle.php';
require_once 'plc_objects.php';
// --------------------
// Common functions
require_once 'plc_functions.php';
require_once 'plc_peers.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
+require_once 'linetabs.php';
+require_once 'table.php';
// --------------------
// recognized URL arguments
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_details.php';
-require_once 'plc_minitabs.php';
+require_once 'details.php';
+require_once 'linetabs.php';
$tabs=array();
$tabs['Back to peers list']=l_peers();
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_tables.php';
-require_once 'plc_minitabs.php';
+require_once 'table.php';
+require_once 'linetabs.php';
drupal_set_title('All Peers');
// Common functions
require_once 'plc_functions.php';
require_once 'plc_peers.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
-require_once 'plc_details.php';
-require_once 'plc_forms.php';
-require_once 'plc_toggles.php';
+require_once 'linetabs.php';
+require_once 'table.php';
+require_once 'details.php';
+require_once 'form.php';
+require_once 'toggle.php';
// --------------------
// recognized URL arguments
//////////////////// roles
$toggle=new PlcToggle ('roles','Roles',array('trigger-tagname'=>'h2'));
-$togle->start();
+$toggle->start();
if (! $roles) plc_warning ("This user has no role !");
// Common functions
require_once 'plc_functions.php';
require_once 'plc_peers.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
+require_once 'linetabs.php';
+require_once 'table.php';
//fix the memory limit for this page
ini_set("memory_limit","48M");
// Common functions
require_once 'plc_functions.php';
require_once 'plc_peers.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
-require_once 'plc_details.php';
-require_once 'plc_forms.php';
-require_once 'plc_toggles.php';
+require_once 'linetabs.php';
+require_once 'table.php';
+require_once 'details.php';
+require_once 'form.php';
+require_once 'toggle.php';
// --------------------
// recognized URL arguments
if ($register_mode) {
// required for the following code
- drupal_set_html_head('<script type="text/javascript" src="/planetlab/js/plc_functions.js"></script>');
+ drupal_set_html_head('<script type="text/javascript" src="/planetlab/sites/site_form.js"></script>');
$fill_from_pi_button = <<< EOF
<input type="button" value="Same as PI" onclick='copyValue("edit-pi:first_name","edit-tech:first_name");
// Common functions
require_once 'plc_functions.php';
require_once 'plc_peers.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
+require_once 'linetabs.php';
+require_once 'table.php';
// --------------------
// recognized URL arguments
if( in_array( 10, $_roles ) ) {
// auto complete box for finding a slice
+ // xxx dismantle this
drupal_set_html_head('<script type="text/javascript" src="/planetlab/bsn/bsn.Ajax.js"></script>
<script type="text/javascript" src="/planetlab/bsn/bsn.DOM.js"></script>
<script type="text/javascript" src="/planetlab/bsn/bsn.AutoSuggest.js"></script>');
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
-require_once 'plc_details.php';
-require_once 'plc_toggles.php';
+require_once 'linetabs.php';
+require_once 'table.php';
+require_once 'details.php';
+require_once 'toggle.php';
// --------------------
// recognized URL arguments
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
+require_once 'linetabs.php';
+require_once 'table.php';
// --------------------
// recognized URL arguments
// fetch objs
-$nodegroup_columns=array("nodegroup_id","groupname","tagname","value","node_ids");
+$nodegroup_columns=array("nodegroup_id","groupname","tagname","value","node_ids","tag_type_id");
// server-side filtering - set pattern in $_GET for filtering on hostname
if ($pattern) {
foreach ($nodegroups as $nodegroup) {
$table->row_start();
$table->cell (href(l_nodegroup($nodegroup['nodegroup_id']),$nodegroup['groupname']));
- $table->cell ($nodegroup['tagname']);
+ // yes, a nodegroup is not a tag, but knows enough for this to work
+ $table->cell (l_tag_obj($nodegroup));
$table->cell ($nodegroup['value']);
$table->cell (count($nodegroup['node_ids']));
$table->row_end();
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_details.php';
-require_once 'plc_tables.php';
-require_once 'plc_forms.php';
-require_once 'plc_toggles.php';
+require_once 'linetabs.php';
+require_once 'details.php';
+require_once 'table.php';
+require_once 'form.php';
+require_once 'toggle.php';
// --------------------
// recognized URL arguments
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
+require_once 'linetabs.php';
+require_once 'table.php';
drupal_set_message ("xxx tag_set.php is deprecated - use planetlab/actions.php instead");
return;
// Common functions
require_once 'plc_functions.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
-require_once 'plc_forms.php';
+require_once 'linetabs.php';
+require_once 'table.php';
+require_once 'form.php';
// --------------------
// recognized URL arguments
$title="Tag Types";
$tabs=array();
$tabs []= tab_tags();
-$tabs []= tab_nodes();
$tabs []= tab_nodes_local();
$tabs []= tab_slices();
--- /dev/null
+/* $Id$ */
+
+div.minitabs {
+ padding: 20px;
+ margin: 8px 0;
+ width:80%;
+ margin:8px auto;
+}
+div.minitabs>ul {
+ width: 100%;
+ float: left;
+ font-size: small; /* could be specified at a higher level */
+ margin: 0;
+ padding: 0 5px 0 5px;
+ /* thickness and color for the fixed thin horizontal bar */
+ border-bottom: 1px solid #696;
+ position:relative;
+ z-index:2;
+}
+
+input.minitabs-submit {
+ font-family: verdana, sans-serif;
+ font-size: 14px;
+ text-align: center;
+ font-style: oblique;
+ border: 0;
+ /* buttons are normally outlined */
+ background-color: transparent;
+ /*padding-bottom: 6px;*/
+ border-bottom: 0px;
+}
+div.minitabs>ul>li {
+ float: left;
+ margin: 0;
+ padding: 0 8px 0 8px;
+ display: inline;
+ list-style: none;
+ position:relative;
+}
+
+div.minitabs>ul>li input.minitabs-submit {
+ float: left;
+ font-size: 85%;
+ line-height: 20px;
+ font-weight: bold;
+ margin: 0 5px 0 5px;
+ text-decoration: none;
+ /* color when passive */
+ color: #9c9;
+}
+
+div.minitabs>ul>li input.active {
+ /* border-bottom: 4px solid #696; */
+ /* padding-bottom: 2px; */
+ /* color when mouse is on button */
+ color: #696;
+}
+
+#minitabs-sliding {
+ position: absolute;
+ z-index: 1;
+ font-size: 85%;
+ line-height: 20px;
+ padding-bottom: 2px;
+ /* color for the sliding bar */
+ border-bottom: 4px solid #696;
+ margin-bottom: 0px;
+}
+
--- /dev/null
+/*
+ $Id$
+
+ Animated miniTabs by frequency decoder (http://www.frequency-decoder.com/)
+
+ Based on an idea by Rob L Glazebrook (http://www.rootarcana.com/test/smartmini/) itself
+ derived from the original idea of Stephen Clark (http://www.sgclark.com/sandbox/minislide/)
+
+ Rewritten by Thierry Parmentelat -- INRIA
+ support http-POST
+ support multiple instances
+ uses prototype.js
+
+*/
+
+/* class */
+function minitabs () {
+ this.currentTab = 0;
+ this.activeTab = 0;
+ this.destX = 0;
+ this.destW = 0;
+ this.t = 0;
+ this.b = 0;
+ this.c = 0;
+ this.d = 20;
+ this.animInterval = null;
+ this.slideObj = null;
+ this.aHeight = 0;
+}
+
+minitabs.prototype.init = function (div) {
+ this.ul = div.down('ul');
+ /* the array of <li>'s */
+ this.li_s = this.ul.select('li');
+ /* the array of active <input>'s - without any hidden one */
+ this.input_s = this.ul.select('input.minitabs-submit');
+
+ /* attach event handlers */
+ this.li_s.each ( function (li) {
+ li.observe ('mouseover', function(event) {
+ var elem = event.element();
+ /* make sure we're on the 'li' element */
+ if ( ! elem.match('li') ) elem=elem.up('li');
+ /* determine current position */
+ var pos = 0;
+ while(elem.previousSibling) {
+ elem = elem.previousSibling;
+ if (elem.tagName && elem.tagName == "LI") pos++;
+ }
+ minitabs_namespace.the_minitabs(elem).initSlide(pos,true);
+ } )
+ } );
+
+ this.ul.observe('mouseout', function (event) {
+ var mt = minitabs_namespace.the_minitabs(event.element());
+ mt.initSlide(mt.currentTab,true);
+ mt.setActive (mt.activeTab,false);
+ });
+
+ /* set active and current, default is index 0, set 'active' class otherwise */
+ this.input_s.each ( function (input) {
+ if (input.hasClassName("active")) this.activeTab = this.currentTab = i;
+ });
+
+ /* create slice object */
+ this.slideObj = this.ul.parentNode.appendChild(document.createElement("div"));
+ this.slideObj.appendChild(document.createTextNode(String.fromCharCode(160)));
+ this.slideObj.id = "minitabs-sliding";
+
+ /* position it */
+ this.setSlidingTop();
+ this.slideObj.style.left = (this.ul.offsetLeft + this.li_s[this.activeTab].offsetLeft +
+ this.input_s[this.activeTab].offsetLeft) + "px";
+ this.slideObj.style.width = this.input_s[this.activeTab].offsetWidth + "px";
+ this.aHeight = (this.ul.offsetTop + this.li_s[this.activeTab].offsetTop +
+ this.input_s[this.activeTab].offsetTop);
+
+ this.initSlide(this.activeTab, true);
+
+};
+
+minitabs.prototype.initSlide = function (pos, force) {
+
+ if(!force && pos == this.activeTab) return;
+ this.setActive (this.activeTab,false);
+ this.activeTab = pos;
+ this.setActive (this.activeTab,true);
+ this.initAnim();
+};
+
+minitabs.prototype.setActive = function (pos,active) {
+ var input=this.li_s[pos].select('input.minitabs-submit')[0];
+ if (active)
+ input.addClassName('active');
+ else
+ input.removeClassName('active');
+};
+
+minitabs.prototype.setSlidingTop = function () {
+ var delta=0;
+ /* up 5px for firefox */
+ /*window.console.log('agent=' + navigator.userAgent);*/
+ if (navigator.userAgent.match(/Firefox/)) delta=-5;
+ this.slideObj.style.top = (this.ul.offsetTop + this.li_s[this.activeTab].offsetTop
+ + this.input_s[this.activeTab].offsetTop + delta ) + "px";
+};
+
+minitabs.prototype.initAnim = function() {
+ /* search for the input with type != hidden */
+ var input=this.li_s[this.activeTab].select('input.minitabs-submit')[0];
+ this.destX = parseInt(this.li_s[this.activeTab].offsetLeft + input.offsetLeft
+ + this.ul.offsetLeft);
+ this.destW = parseInt(input.offsetWidth);
+ this.t = 0;
+ this.b = this.slideObj.offsetLeft;
+ this.c = this.destX - this.b;
+
+ this.bW = this.slideObj.offsetWidth;
+ this.cW = this.destW - this.bW;
+
+ this.setSlidingTop();
+};
+
+minitabs.prototype.slideIt = function() {
+
+ // Has the browser text size changed?
+ var active_li = this.li_s[this.activeTab];
+ var active_input = this.input_s[this.activeTab];
+ if (this.aHeight != this.ul.offsetTop + active_li.offsetTop + active_input.offsetTop) {
+ this.initAnim();
+ this.aHeight = this.ul.offsetTop + active_li.offsetTop + active_input.offsetTop;
+ }
+
+
+ if (this.t++ < this.d) {
+ var x = this.animate(this.t,this.b,this.c,this.d);
+ var w = this.animate(this.t,this.bW,this.cW,this.d);
+
+ this.slideObj.style.left = parseInt(x) + "px";
+ this.slideObj.style.width = parseInt(w) + "px";
+ } else {
+ this.slideObj.style.left = this.destX + "px";
+ this.slideObj.style.width = this.destW +"px";
+ }
+};
+
+minitabs.prototype.animate = function(t,b,c,d) {
+ if ((t/=d/2) < 1) return c/2*t*t + b;
+ return -c/2 * ((--t)*(t-2) - 1) + b;
+};
+
+minitabs.prototype.submit = function (message) {
+ /* save activeTab before confirmation; some browsers - firefox - send mouseout during confirm .. */
+ var submitTab = this.activeTab;
+ /* ask for confirmation if message is not empty */
+ if (message && ! confirm (message) ) return;
+
+ /* get the form and trigger */
+ this.li_s[submitTab].down('form').submit();
+
+}
+
+// globals
+var minitabs_namespace = {
+ init: function () {
+ $$('div.minitabs').each (function (div) {
+ /* create instance and attach it to the <div> element */
+ div.minitabs = new minitabs ();
+ div.minitabs.init(div);
+ } ) ;
+
+ var intervalMethod = function () {
+ $$('div.minitabs').each (function (div) {
+ minitabs_namespace.the_minitabs(div).slideIt();
+ } ) ;
+ } ;
+ minitabs_namespace.animInterval = setInterval(intervalMethod,10);
+ },
+
+ cleanUp: function() {
+ clearInterval(minitabs_namespace.animInterval);
+ minitabs_namespace.animInterval = null;
+ },
+
+ resize: function (e) {
+ $$('div.minitabs').each ( function (div) {
+ var mt = div.minitabs;
+ mt.initSlide(mt.activeTab,true);
+ } );
+ },
+
+ submit: function (id,message) {
+ $(id).minitabs.submit(message);
+ },
+
+ // find the enclosing minitabs object
+ the_minitabs: function (elem) {
+ if (elem.match('div.minitabs'))
+ return elem.minitabs;
+ else
+ return elem.up('div.minitabs').minitabs;
+ }
+
+};
+
+window.onload = minitabs_namespace.init;
+window.onunload = minitabs_namespace.cleanUp;
+window.onresize = minitabs_namespace.resize;
// see the demo at http://www.frequency-decoder.com/demo/date-picker-v4/
drupal_set_html_head('
-<script type="text/javascript" src="/planetlab/datepicker/datepicker.js"></script>
-<link href="/planetlab/datepicker/datepicker.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="/plekit/datepicker/datepicker.js"></script>
+<link href="/plekit/datepicker/datepicker.css" rel="stylesheet" type="text/css" />
');
// supported options
// $Id$
require_once 'plc_functions.php';
-require_once 'plc_forms.php';
+require_once 'form.php';
drupal_set_html_head('
-<link href="/planetlab/css/plc_details.css" rel="stylesheet" type="text/css" />
+<link href="/plekit/details/details.css" rel="stylesheet" type="text/css" />
');
// $Id$
-require_once 'plc_functions.php';
+require_once 'plekit-utils.php';
// the rationale behind having function names with _html is that
// the first functions that we had were actually printing the stuff instead of returning it
// and add them to the 'values' argument if any
// extract var=value settings from url if any
- $split=plkit_split_url($full_url);
+ $split=plekit_split_url($full_url);
$this->url=$split['url'];
$url_values=$split['values'];
<?php
// $Id$
+require_once 'plekit-utils.php';
require_once 'prototype.php';
drupal_set_html_head('
-<script type="text/javascript" src="/planetlab/minitabs/minitabs.js"></script>
-<link href="/planetlab/minitabs/minitabs.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="/plekit/linetabs/linetabs.js"></script>
+<link href="/plekit/linetabs/linetabs.css" rel="stylesheet" type="text/css" />
');
if ( ! $todo['method'] ) $todo['method']='GET';
// extract var=value settings from url if any
$full_url=$todo['url'];
- $split=plkit_split_url($full_url);
+ $split=plekit_split_url($full_url);
$url=$split['url'];
$url_values=$split['values'];
--- /dev/null
+<?php
+
+// $Id: plc_functions.php 12096 2009-02-18 22:05:34Z thierry $
+
+// returns array ['url' => path, 'values' => hash (key=>value)* ]
+function plekit_split_url ($full_url) {
+ list($url,$args) = explode("?",$full_url);
+ $values=array();
+ if ($args) {
+ $pairs=explode("&",$args);
+ foreach ($pairs as $pair) {
+ list ($name,$value) = explode("=",$pair);
+ $values[$name]=$value;
+ }
+ }
+ return array("url"=>$url,"values"=>$values);
+}
+
+?>
--- /dev/null
+<?php
+
+drupal_set_html_head('
+<script type="text/javascript" src="/plekit/prototype/prototype.js"></script>
+');
+
+?>
// $Id$
drupal_set_html_head('
-<script type="text/javascript" src="/planetlab/tablesort/tablesort.js"></script>
-<script type="text/javascript" src="/planetlab/tablesort/customsort.js"></script>
-<script type="text/javascript" src="/planetlab/tablesort/paginate.js"></script>
-<script type="text/javascript" src="/planetlab/js/plc_tables.js"></script>
-<link href="/planetlab/css/plc_tables.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="/plekit/tablesort/tablesort.js"></script>
+<script type="text/javascript" src="/plekit/tablesort/customsort.js"></script>
+<script type="text/javascript" src="/plekit/tablesort/paginate.js"></script>
+<script type="text/javascript" src="/plekit/table/table.js"></script>
+<link href="/plekit/table/table.css" rel="stylesheet" type="text/css" />
');
////////////////////////////////////////
require_once 'prototype.php';
drupal_set_html_head('
-<script type="text/javascript" src="/planetlab/js/plc_toggles.js"></script>
-<link href="/planetlab/css/plc_toggles.css" rel="stylesheet" type="text/css" />
+<script type="text/javascript" src="/plekit/toggle/toggle.js"></script>
+<link href="/plekit/toggle/toggle.css" rel="stylesheet" type="text/css" />
');
// This is for creating an area that users can hide and show
// re compile all patterns - ignore case
var pattern_texts = pattern_text.split(" ");
var patterns=new Array();
- var i;
- for (i in pattern_texts)
+ for (var i=0; i < pattern_texts.length; i++) {
+ window.console.log ('compiled ' + i + '-th pattern = <' + pattern_texts[i] + '>');
patterns[i]=new RegExp(pattern_texts[i],"i");
+ }
// scan rows
for (row_index = 0; row=rows[row_index]; row_index++) {
#
# what the myplc rpm requires
-%define name PLCWWW
-%define version PLE.5.0
+%define name plewww
+%define version 5.0
%define taglevel 0
# no need to mention pldistro as this module differs in both distros
Requires: postgresql >= 8.0
Requires: PLCAPI >= 5.0
Requires: drupal = 4.7
+Requires: plewww-plekit
+
+# this is what MyPLC requires
+Provides: PLCWWW
# on centos5, when rebuilding the full monty, we get:
# Error: Missing Dependency: perl(GD) is needed by package PLCWWW
# and the perl-GD rpm is nowhere to be found
AutoReqProv: no
+%package plekit
+Summary: Utilities for building the plewww pages, for the benefit of other PL-related UI components.
+Group: Applications/Systems
+
%description
-The PLCWWW package is made of the web pages that run on top of the
+The plewww package is made of the web pages that run on top of the
PLCAPI component to provide the Web Interface to MyPLC users.
%prep
%files
%defattr(-,root,root,-)
-/var/www/html
+/var/www/html/modules
+/var/www/html/planetlab
+/var/www/html/googlemap
+/var/www/html/drupal-hacks
/etc/httpd/conf.d/plcwww.conf
+%files plekit
+/var/www/html/plekit
+
%changelog
* Fri Apr 25 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - PLCWWW-onelab.4.2-11
- everyone is welcome to add nodes