X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fcommon%2Factions.php;h=ba6010493bb723631bacc1ffe70bf2ff0c78d9e9;hb=d694eb9fdfe0a7bcb9d8fc7b571751475f4227be;hp=0b4353db4d2040abeb8bf00fda320ef1be11cac6;hpb=8a604a89bd644528059bd8abcecff883085532f0;p=plewww.git diff --git a/planetlab/common/actions.php b/planetlab/common/actions.php index 0b4353d..ba60104 100644 --- a/planetlab/common/actions.php +++ b/planetlab/common/actions.php @@ -99,6 +99,10 @@ $known_actions []= "add-tag-type"; // expects: tag_type_id & tagname & description & category & min_role_id $known_actions []= "delete-tag-types"; // expects: tag_type_ids +$known_actions []= "remove-roles-from-tag-type"; +// expects: tag_type_id & role_ids +$known_actions []= "add-role-to-tag-type"; +// expects: tag_type_id_id & id //////////////////////////////////////// tags $known_actions []= "set-tag-on-node"; @@ -815,6 +819,30 @@ Our support team will be glad to answer any question that you might have. break; } + case 'remove-roles-from-tag-type' : { + $tag_type_id=$_POST['tag_type_id']; + $role_ids=$_POST['role_ids']; + if ( ! $role_ids) { + drupal_set_error("You have not selected role(s) to remove"); + } else { + foreach( $role_ids as $role_id) + if ( $api->DeleteRoleFromTagType( intval( $role_id ), intval( $tag_type_id ) ) != 1 ) + drupal_set_error ("Could not remove role $role_id from tag type $tag_type_id"); + } + plc_redirect (l_tag_roles($tag_type_id)); + } + + case 'add-role-to-tag-type' : { + $tag_type_id=$_POST['tag_type_id']; + $role_id=$_POST['role_id']; + if ( ! $role_id) { + drupal_set_error ("You have not selected a role to add"); + } else if ($api->AddRoleToTagType( intval( $role_id ), intval( $tag_type_id ) ) != 1) { + drupal_set_error("Could not add role $role_id to tag $tag_type_id"); + } + plc_redirect (l_tag_roles($tag_type_id)); + } + //////////////////////////////////////// tags case 'set-tag-on-node': case 'set-tag-on-interface': {