From 5f334a97c63ea036cdb37f5455e1135120681a95 Mon Sep 17 00:00:00 2001
From: smbaker <smbaker@fc8clean.lan>
Date: Wed, 3 Oct 2012 17:10:37 -0700
Subject: [PATCH] add support for checking advanced tag for person

---
 planetlab/includes/plc_functions.php | 30 ++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php
index 5db3d54..2de3085 100644
--- a/planetlab/includes/plc_functions.php
+++ b/planetlab/includes/plc_functions.php
@@ -601,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 . "<br>";
+    } else {
+        $api->AddPersonTag($person_id, "advanced", $value);
+        //print "add";
+    }
+}
+
 
 ?>
-- 
2.47.0