test/post-test.php
author veltr
Fri, 20 Jul 2012 17:15:53 +0200
branchnew-model
changeset 928 5aadbc9f27cd
child 931 0fdce6e14748
permissions -rw-r--r--
First tests before allowing mashup annotation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
928
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     1
<?php
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     2
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     3
$data = json_decode($HTTP_RAW_POST_DATA);
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     4
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     5
if (!isset($data->annotations[0]->id)) {
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     6
    $data->annotations[0]->id = uniqid("annotation_");
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     7
}
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     8
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
     9
if (!isset($data->annotations[0]->type)) {
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
    10
    $data->annotations[0]->type = uniqid("annotationType_");
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
    11
}
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
    12
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
    13
print_r(json_encode($data));
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
    14
5aadbc9f27cd First tests before allowing mashup annotation
veltr
parents:
diff changeset
    15
?>