A new version of the column configuration interface including
[plewww.git] / plekit / php / updateConfiguration.php
index 9a0340b..e48f80e 100644 (file)
@@ -14,14 +14,21 @@ require_once 'plc_drupal.php';
 require_once 'plc_functions.php';
 
 $value=$_GET["value"];
-$person_id=$_GET["person_id"];
+$person_id=intval($_GET["person_id"]);
 $slice_id=$_GET["slice_id"];
 $tag_id=intval($_GET["tag_id"]);
+$tag_name=$_GET["tag_name"];
 
-$api->UpdatePersonTag( $tag_id, $value );
+#$res = $api->UpdatePersonTag( $tag_id, $value );
+if ($tag_name == "columnconf")
+$res = $api->SetPersonColumnconf( $person_id, $value );
+else if ($tag_name == "showconf")
+$res = $api->SetPersonShowconf( $person_id, $value );
 
 $myFile = "/var/log/myslice.log";
-$fh = fopen($myFile, 'a') or die("can't open file");
+if (file_exists($myFile))
+       $fh = fopen($myFile, 'a') or die("can't open file");
+
 $stringData = "\n".date('Ymd-H:i')."|".$person_id.":".$slice_id.":".$value;
 fwrite($fh, $stringData);
 fclose($fh);