svn:keywords
[plewww.git] / planetlab / nodes / setting_action.php
index 8dbe20c..498068d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-// $Id: setting_action.php 1159 2008-01-24 18:51:36Z thierry $
+// $Id$
 
 // Require login
 require_once 'plc_login.php';
@@ -27,16 +27,16 @@ $_roles= $_person['role_ids'];
 //plc_debug('GET',$_GET);
 //plc_debug('POST',$_POST);
 
-// attribute type updates
+// tag type updates
 if( $_POST['edit_type'] ) {
-  $setting_type_id= intval( $_POST['interface_setting_type_id'] );
+  $setting_type_id= intval( $_POST['interface_tag_type_id'] );
   $setting_type = array ('category' => $_POST['category'],
                         'name' => $_POST['name'],
                         'min_role_id' => intval( $_POST['min_role_id'] ),
                         'description' => $_POST['description']);
   
   // Update it!
-  $api->UpdateInterfaceSettingType( $setting_type_id, $setting_type );
+  $api->UpdateTagType( $setting_type_id, $setting_type );
   $api_error=$api->error();
   if (!empty($api_error)) {
     print "<div class='plc-error'>" . $api_error . "</div>";
@@ -46,51 +46,51 @@ if( $_POST['edit_type'] ) {
   exit();
 }
 
-// attribute type adds
+// tag type adds
 if( $_POST['add_type'] ) {
   $setting_type = array ('category' => $_POST['category'],
                         'name' => $_POST['name'],
                         'min_role_id' => intval( $_POST['min_role_id'] ),
                         'description' => $_POST['description']);
   // add it!!
-  $api->AddInterfaceSettingType( $setting_type );
+  $api->AddTagType( $setting_type );
 
   header( "location: settings.php" );
   exit();
 }
   
 
-// attribute deletion
+// tag deletion
 if( $_GET['rem_id'] ) {
-  // get the id of the attrib to remove from GET
+  // get the id of the tag to remove from GET
   $setting_id= intval( $_GET['rem_id'] );
 
   // get interface_id 
-  $setting= $api->GetInterfaceSettings( array( $setting_id ), array( "interface_id" ) );
+  $setting= $api->GetInterfaceTags( array( $setting_id ), array( "interface_id" ) );
   $interface_id= $setting[0]['interface_id'];
   
-  // delete the attribute
-  $api->DeleteInterfaceSetting( $setting_id );
+  // delete the tag
+  $api->DeleteInterfaceTag( $setting_id );
 
-  header( "location: node_networks.php?id=$interface_id" );
+  header( "location: interfaces.php?id=$interface_id" );
   exit();
 }
 
-// attribute adds
+// tag adds
 if( $_POST['add_setting'] ) {
-  // get the interface_id, attribute_type_id, and value from POST
+  // get the interface_id, tag_type_id, and value from POST
   $interface_id= intval( $_POST['interface_id'] );
-  $interface_setting_type_id= intval( $_POST['interface_setting_type_id'] );
+  $interface_tag_type_id= intval( $_POST['interface_tag_type_id'] );
   $value= $_POST['value'];
 
   // add it!
-  $api->AddInterfaceSetting( $interface_id, $interface_setting_type_id, $value );
+  $api->AddInterfaceTag( $interface_id, $interface_tag_type_id, $value );
 
-  header( "location: node_networks.php?id=$interface_id" );
+  header( "location: interfaces.php?id=$interface_id" );
   exit();
 }
 
-// attribute updates
+// tag updates
 if( $_POST['edit_setting'] ) {
   // get the id of the setting to update and the value from POST
   $setting_id= intval( $_POST['setting_id'] );
@@ -98,30 +98,27 @@ if( $_POST['edit_setting'] ) {
   $interface_id= $_POST['interface_id'];
 
   // update it!
-  $api->UpdateInterfaceSetting($setting_id, $value );
+  $api->UpdateInterfaceTag($setting_id, $value );
 
-  header( "location: node_networks.php?id=$interface_id" );
+  header( "location: interfaces.php?id=$interface_id" );
   exit();
 }
 
-// down here is some codqe from attrib_action.php that was not converted yet
 // Settings -------------------------------------------------
 
-// ATTRIBUTE TYPES ---------------------------------------------------
+// TAG TYPES ---------------------------------------------------
   
-// delete attribute types
+// delete tag types
 if( $_GET['del_type'] ) {
   // get vars
   $type_id= intval( $_GET['del_type'] );
 
   // delete it!
-  $api->DeleteInterfaceSettingType( $type_id );
+  $api->DeleteTagType( $type_id );
   
   header( "location: settings.php" );
   exit();
 }
-
-  
   
 /*
 // Print footer