rename nodes to slivers
[raven.git] / apps / gacksadmin / user_image.php
1 <?php
2
3 // this must occur before linetabs.php, or linetabs won't work. I have no idea why.
4 drupal_add_js("misc/popup.js");
5
6 // Require login
7 require_once 'plc_login.php';
8
9 // Get session and API handles
10 require_once 'plc_session.php';
11 global $plc, $api, $adm;
12
13 // Common functions
14 require_once 'plc_functions.php';
15 require_once 'plc_peers.php';
16 require_once 'gacks_functions.php';
17 require_once 'gacksclient.php';
18 require_once 'linetabs.php';
19 require_once 'table.php';
20 require_once 'details.php';
21 require_once 'toggle.php';
22 require_once 'form.php';
23 require_once 'nifty.php';
24
25 // find person roles
26 $_person= $plc->person;
27 $_person_id = $plc->person['person_id'];
28 $_roles= $_person['role_ids'];
29
30 // Print header
31 require_once 'plc_drupal.php';
32 drupal_set_title('Manage Slivers: Select Image');
33 include 'plc_header.php';
34
35 $tabs = manage_slivers_tabs();
36 $_GET['active_line_tab'] = "Select Image";
37 plekit_linetabs($tabs);
38
39 $nifty=new PlekitNifty ('sliceimage','objects-list','big');
40 $nifty->start();
41 print '<div style="width: 640px; margin-left: auto; margin-right: auto;">';
42
43 //print "<br>";
44 $account_name = get_account_name($api, $_person_id);
45
46 if ($account_name != NULL) {
47     $gacksapi = new GACKSAPI();
48
49     $image = get_slice_image($api, $account_name);
50     if (!$image) {
51         $image = "";
52     }
53
54     $image_selectors = array();
55     $image_selectors []= array("display"=>"Default PlanetLab image", "value"=>"");
56     $image_selectors []= array("display"=>"Hadoop", "value"=>"hadoop");
57     $image_selectors []= array("display"=>"MPI", "value"=>"mpi");
58     if (!in_array($image, array("", "hadoop", "mpi"))) {
59         $image_selectors []= array("display"=> $image, "value"=> $image);
60     }
61     select_selector($image, $image_selectors);
62
63     $form = new PlekitForm(l_gacks_actions(), array("action"=>"set-image",
64                                                     "account_name"=> $account_name));
65     $form->start();
66
67     print "<br><br>Select a preconfigured image for your slice:<br>";
68     print $form->select_html("image", $image_selectors);
69     print "<br><br>";
70     print $form->submit_html("submit", "submit");
71
72     $form->end();
73 }
74
75 print "</div>";
76 $nifty->end();
77
78 include 'plc_footer.php';
79
80 ?>
81
82