split in two
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 19 Feb 2009 18:41:19 +0000 (18:41 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 19 Feb 2009 18:41:19 +0000 (18:41 +0000)
60 files changed:
Makefile
modules/planetlab.module
planetlab/common/about.php [moved from planetlab/about.php with 100% similarity]
planetlab/common/actions.php [moved from planetlab/actions.php with 100% similarity]
planetlab/common/adminsearch.php [moved from planetlab/adminsearch.php with 99% similarity]
planetlab/common/login.php [moved from planetlab/login.php with 100% similarity]
planetlab/common/logout.php [moved from planetlab/logout.php with 100% similarity]
planetlab/common/sulogout.php [moved from planetlab/sulogout.php with 100% similarity]
planetlab/css/demo.css [deleted file]
planetlab/events/events.php
planetlab/events/events_choser.php
planetlab/includes/plc_functions.php
planetlab/includes/plc_functions_trash.php [deleted file]
planetlab/includes/prototype.php [deleted file]
planetlab/nodes/interface.php
planetlab/nodes/node.php
planetlab/nodes/nodes.php
planetlab/peers/peer.php
planetlab/peers/peers.php
planetlab/persons/person.php
planetlab/persons/persons.php
planetlab/sites/site.php
planetlab/sites/site_form.js [moved from planetlab/js/plc_functions.js with 100% similarity]
planetlab/sites/site_form.php
planetlab/sites/sites.php
planetlab/slices/index.php
planetlab/tags/nodegroup.php
planetlab/tags/nodegroups.php
planetlab/tags/tag.php
planetlab/tags/tag_set.php
planetlab/tags/tags.php
plekit/datepicker/URL [moved from planetlab/datepicker/URL with 100% similarity]
plekit/datepicker/datepicker.css [moved from planetlab/datepicker/datepicker.css with 100% similarity]
plekit/datepicker/datepicker.js [moved from planetlab/datepicker/datepicker.js with 100% similarity]
plekit/details/details.css [moved from planetlab/css/plc_details.css with 100% similarity]
plekit/linetabs/URL [moved from planetlab/minitabs/URL with 100% similarity]
plekit/linetabs/linetabs.css [moved from planetlab/minitabs/minitabs.css with 100% similarity]
plekit/linetabs/linetabs.js [moved from planetlab/minitabs/minitabs.js with 100% similarity]
plekit/linetabs/minitabs.css [new file with mode: 0644]
plekit/linetabs/minitabs.js [new file with mode: 0644]
plekit/php/datepicker.php [moved from planetlab/includes/plc_datepicker.php with 88% similarity]
plekit/php/details.php [moved from planetlab/includes/plc_details.php with 98% similarity]
plekit/php/form.php [moved from planetlab/includes/plc_forms.php with 98% similarity]
plekit/php/linetabs.php [moved from planetlab/includes/plc_minitabs.php with 94% similarity]
plekit/php/plekit-utils.php [new file with mode: 0644]
plekit/php/prototype.php [new file with mode: 0644]
plekit/php/table.php [moved from planetlab/includes/plc_tables.php with 95% similarity]
plekit/php/toggle.php [moved from planetlab/includes/plc_toggles.php with 96% similarity]
plekit/prototype/URL [moved from planetlab/prototype/URL with 100% similarity]
plekit/prototype/prototype-1.6.0.3.js [moved from planetlab/prototype/prototype-1.6.0.3.js with 100% similarity]
plekit/prototype/prototype.js [moved from planetlab/prototype/prototype.js with 100% similarity]
plekit/table/table.css [moved from planetlab/css/plc_tables.css with 100% similarity]
plekit/table/table.js [moved from planetlab/js/plc_tables.js with 97% similarity]
plekit/tablesort/URL [moved from planetlab/tablesort/URL with 100% similarity]
plekit/tablesort/customsort.js [moved from planetlab/tablesort/customsort.js with 100% similarity]
plekit/tablesort/paginate.js [moved from planetlab/tablesort/paginate.js with 100% similarity]
plekit/tablesort/tablesort.js [moved from planetlab/tablesort/tablesort.js with 100% similarity]
plekit/toggle/toggle.css [moved from planetlab/css/plc_toggles.css with 100% similarity]
plekit/toggle/toggle.js [moved from planetlab/js/plc_toggles.js with 100% similarity]
plewww.spec [moved from PLCWWW.spec with 91% similarity]

index d1c2f44..6f15a95 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ ifeq (,$(SSHURL))
        @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
index ae5497b..857ebd6 100644 (file)
@@ -34,7 +34,7 @@ function planetlab_menu($may_cache) {
 
   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,
similarity index 99%
rename from planetlab/adminsearch.php
rename to planetlab/common/adminsearch.php
index c3c32d9..45a1c61 100644 (file)
@@ -165,7 +165,7 @@ $_roles= $_person['role_ids'];
 
 
 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'] ) {
diff --git a/planetlab/css/demo.css b/planetlab/css/demo.css
deleted file mode 100644 (file)
index c6907ea..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-   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;
-        }
index 685370a..ccd6444 100644 (file)
@@ -14,9 +14,9 @@ include 'plc_header.php';
 
 // 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");
index 8d1d272..6463185 100644 (file)
@@ -14,9 +14,9 @@ include 'plc_header.php';
 
 // 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');
index 636da7a..5e8fcc2 100644 (file)
@@ -10,23 +10,6 @@ function my_is_int ($x) {
     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;
@@ -64,7 +47,7 @@ function href ($url,$text) { return "<a href='" . $url . "'>" . $text . "</a>";
 // 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"; }
 
@@ -108,7 +91,7 @@ function l_person_obj ($person)              { return l_person_t($person['person_id'],$perso
 
 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"; }
@@ -124,14 +107,14 @@ function l_peer_t($peer_id,$text) { return href(l_peer($peer_id),$text); }
 
 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"; }
diff --git a/planetlab/includes/plc_functions_trash.php b/planetlab/includes/plc_functions_trash.php
deleted file mode 100644 (file)
index 95d2839..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-<?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> &nbsp; ";
-        $echo.= " <a href=\"". $_SERVER['REQUEST_URI'] ."&page=$pageprev\">PREV ".$limit."</a> &nbsp; ";
-      }
-      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.= " &nbsp; <a href=\"". $_SERVER['REQUEST_URI'] ."&page=$pagenext\">NEXT ".$limit."</a> &nbsp; ";
-    }
-    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>";
-}
-
-?>
diff --git a/planetlab/includes/prototype.php b/planetlab/includes/prototype.php
deleted file mode 100644 (file)
index 667bef1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-drupal_set_html_head('
-<script type="text/javascript" src="/planetlab/prototype/prototype.js"></script>
-');
-
-?>
index 0822143..70afd19 100644 (file)
@@ -9,10 +9,10 @@ global $plc, $api;
 
 // 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';
index c6e26f0..bf475ec 100644 (file)
@@ -16,11 +16,11 @@ 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';
 
 // -------------------- 
index 16f8ef6..90a3b3a 100644 (file)
@@ -16,8 +16,8 @@ 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 'linetabs.php';
+require_once 'table.php';
 
 // -------------------- 
 // recognized URL arguments
index c424d8f..f0736cc 100644 (file)
@@ -13,8 +13,8 @@ include 'plc_header.php';
 
 // 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();
index 7e346fb..96f6dff 100644 (file)
@@ -13,8 +13,8 @@ include 'plc_header.php';
 
 // 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');
 
index fc20c1c..5fac9b2 100644 (file)
@@ -16,11 +16,11 @@ 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';
 
 // -------------------- 
 // recognized URL arguments
@@ -294,7 +294,7 @@ $toggle->end();
 
 //////////////////// roles
 $toggle=new PlcToggle ('roles','Roles',array('trigger-tagname'=>'h2'));
-$togle->start();
+$toggle->start();
 
 if (! $roles) plc_warning ("This user has no role !");
 
index 79366a8..d1d46d8 100644 (file)
@@ -16,8 +16,8 @@ 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 'linetabs.php';
+require_once 'table.php';
 
 //fix the memory limit for this page
 ini_set("memory_limit","48M");
index 7f75d79..b56e62e 100644 (file)
@@ -16,11 +16,11 @@ 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';
 
 // -------------------- 
 // recognized URL arguments
index a5105e5..7304e95 100644 (file)
@@ -57,7 +57,7 @@ function build_site_form ($register_mode) {
 
   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");
index dbab8ba..d37a348 100644 (file)
@@ -16,8 +16,8 @@ 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 'linetabs.php';
+require_once 'table.php';
 
 // -------------------- 
 // recognized URL arguments
index 5e90139..67b7b62 100644 (file)
@@ -48,6 +48,7 @@ if( !$_GET['id'] ) {
   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>');
index 08da358..30a6d51 100644 (file)
@@ -15,10 +15,10 @@ include 'plc_header.php';
 
 // 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
index 23259a5..8531125 100644 (file)
@@ -15,8 +15,8 @@ include 'plc_header.php';
 
 // 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
@@ -32,7 +32,7 @@ $node_filter=array();
 
 
 // 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) {
@@ -68,7 +68,8 @@ $table->start();
 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();
index da0a6c8..2eabae6 100644 (file)
@@ -15,11 +15,11 @@ include 'plc_header.php';
 
 // 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
index afb66ce..1d3313b 100644 (file)
@@ -15,8 +15,8 @@ include 'plc_header.php';
 
 // 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;
index b210cb2..d222f14 100644 (file)
@@ -15,9 +15,9 @@ include 'plc_header.php';
 
 // 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
@@ -27,7 +27,6 @@ $pattern=$_GET['pattern'];
 $title="Tag Types";
 $tabs=array();
 $tabs []= tab_tags();
-$tabs []= tab_nodes();
 $tabs []= tab_nodes_local();
 $tabs []= tab_slices();
 
similarity index 100%
rename from planetlab/minitabs/URL
rename to plekit/linetabs/URL
diff --git a/plekit/linetabs/minitabs.css b/plekit/linetabs/minitabs.css
new file mode 100644 (file)
index 0000000..fe364ae
--- /dev/null
@@ -0,0 +1,69 @@
+/* $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;
+}
+
diff --git a/plekit/linetabs/minitabs.js b/plekit/linetabs/minitabs.js
new file mode 100644 (file)
index 0000000..5e89f0f
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+  $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;
similarity index 88%
rename from planetlab/includes/plc_datepicker.php
rename to plekit/php/datepicker.php
index db1f09d..54de9bf 100644 (file)
@@ -5,8 +5,8 @@
   // 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
similarity index 98%
rename from planetlab/includes/plc_details.php
rename to plekit/php/details.php
index 684adf5..ccf1c4a 100644 (file)
@@ -3,10 +3,10 @@
 // $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" />
 ');
 
 
similarity index 98%
rename from planetlab/includes/plc_forms.php
rename to plekit/php/form.php
index d054097..c4b1fba 100644 (file)
@@ -2,7 +2,7 @@
 
 // $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
@@ -20,7 +20,7 @@ class PlcForm {
     // 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'];
similarity index 94%
rename from planetlab/includes/plc_minitabs.php
rename to plekit/php/linetabs.php
index 20a9efa..b26dffc 100644 (file)
@@ -1,11 +1,12 @@
 <?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" />
 ');
 
 
@@ -62,7 +63,7 @@ function plc_tabs ($array, $id=NULL) {
     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'];
 
diff --git a/plekit/php/plekit-utils.php b/plekit/php/plekit-utils.php
new file mode 100644 (file)
index 0000000..e6184c2
--- /dev/null
@@ -0,0 +1,19 @@
+<?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);
+}
+
+?>
diff --git a/plekit/php/prototype.php b/plekit/php/prototype.php
new file mode 100644 (file)
index 0000000..c0c6c99
--- /dev/null
@@ -0,0 +1,7 @@
+<?php
+
+drupal_set_html_head('
+<script type="text/javascript" src="/plekit/prototype/prototype.js"></script>
+');
+
+?>
similarity index 95%
rename from planetlab/includes/plc_tables.php
rename to plekit/php/table.php
index 5d7f379..e7837a7 100644 (file)
@@ -3,11 +3,11 @@
   // $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" />
 ');
 
 ////////////////////////////////////////
similarity index 96%
rename from planetlab/includes/plc_toggles.php
rename to plekit/php/toggle.php
index 7700401..f8d6051 100644 (file)
@@ -5,8 +5,8 @@
 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
similarity index 100%
rename from planetlab/prototype/URL
rename to plekit/prototype/URL
similarity index 97%
rename from planetlab/js/plc_tables.js
rename to plekit/table/table.js
index afd4238..6fa8ca1 100644 (file)
@@ -118,9 +118,10 @@ function plc_table_filter (table_id,pattern_id,and_id) {
   // 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++) {
similarity index 100%
rename from planetlab/tablesort/URL
rename to plekit/tablesort/URL
similarity index 91%
rename from PLCWWW.spec
rename to plewww.spec
index ba4aa86..7cc1133 100644 (file)
@@ -3,8 +3,8 @@
 #
 
 # 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
@@ -32,14 +32,22 @@ Requires: php >= 5.0
 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
@@ -100,9 +108,15 @@ rm -rf $RPM_BUILD_ROOT
 
 %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