X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fincludes%2Fplc_functions.php;h=2de30852a2cd83bd7bca91040326e5e08ec07a5f;hb=5f334a97c63ea036cdb37f5455e1135120681a95;hp=678de2975cdadb4519d5fd3b01efb7a1bfc8784f;hpb=1ce86fd37ce8da9b475847a59394c0241a8dbbff;p=plewww.git diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index 678de29..2de3085 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -102,6 +102,7 @@ function l_sites_peer ($peer_id) { return "/db/sites/index.php?peerscope=$peer_i function l_site ($site_id) { return "/db/sites/index.php?id=$site_id"; } function l_site_t ($site_id,$text) { return href (l_site($site_id),$text); } function l_site_obj($site) { return href (l_site($site['site_id']),$site['name']); } +function l_site_tags ($site_id) { return "/db/sites/site.php?id=$site_id&show_tags=1"; } function l_slices () { return "/db/slices/index.php"; } function l_slices_peer ($peer_id) { return "/db/slices/index.php?peerscope=$peer_id"; } @@ -128,6 +129,7 @@ function l_person_t ($person_id,$text) { return href (l_person($person_id),$text function l_persons_site ($site_id) { return "/db/persons/index.php?site_id=$site_id"; } function l_persons_slice ($slice_id) { return "/db/persons/index.php?slice_id=$slice_id"; } function l_person_obj ($person) { return l_person_t($person['person_id'],$person['email']); } +function l_person_tags ($person_id) { return "/db/persons/person.php?id=$person_id&show_tags=1"; } function l_tags () { return "/db/tags/index.php"; } function l_tag ($tag_type_id) { return "/db/tags/index.php?id=$tag_type_id"; } @@ -599,5 +601,35 @@ function count_english_warning ($objs, $name) { function reservable_mark () { return "-R-";} function reservable_legend () { return "reservable nodes are marked with " . reservable_mark (); } +//////////////////// Vicci simplified portal support +function plc_advanced() { + global $plc, $api; + + if ((!$plc) || (!$api)) { + return FALSE; + } + + $person_id = $plc->person['person_id']; + $tags = $api->GetPersonTags(array("person_id" => $person_id, "tagname" => "advanced")); + if (!$tags) { + return FALSE; + } + return (bool) $tags[0]['value']; +} + +function plc_set_advanced($value) { + global $plc, $api; + + $person_id = $plc->person['person_id']; + $tags = $api->GetPersonTags(array("person_id" => $person_id, "tagname" => "advanced")); + if ($tags) { + $result = $api->UpdatePersonTag($tags[0]["person_tag_id"], $value); + //print "update " . $tags[0]["person_tag_id"] . " " . $value . " " . $result . "
"; + } else { + $api->AddPersonTag($person_id, "advanced", $value); + //print "add"; + } +} + ?>