Ejemplo n.º 1
0
     }
     break;
 case "getExperimentVideos":
     if (isset($_REQUEST['experiment'])) {
         $id = safeString($_REQUEST['experiment']);
         $dataset = getVideosForExperiment($id);
         if ($dataset) {
             $data = $dataset;
             $status = 200;
         }
     }
     break;
 case "getExperimentImages":
     if (isset($_REQUEST['experiment'])) {
         $id = safeString($_REQUEST['experiment']);
         $dataset = getImagesForExperiment($id);
         if ($dataset) {
             $data = $dataset;
             $status = 200;
         }
     }
     break;
 case "sessiondata":
     if (isset($_REQUEST['sessions'])) {
         $sessionIds = split(" ", $_REQUEST['sessions']);
         $dataset = array();
         foreach ($sessionIds as $sid) {
             $eid = getSessionExperimentId($sid);
             $dataset[] = array('experimentId' => $eid, 'sessionId' => $sid, 'fields' => getFields($eid), 'meta' => array(getSession($sid)), 'data' => getData($eid, $sid));
         }
         $data = $dataset;
Ejemplo n.º 2
0
 $tags = array();
 $videos = array();
 $images = array();
 $sessions = array();
 $collabs = array();
 if ($is_activity) {
     $fields = getFields($meta['activity_for']);
     $tags = getTagsForExperiment($meta['activity_for']);
     $sessions = getSessionsForExperiment($id);
     $vises = getResponsesForActivity($id);
 } else {
     $fields = getFields($id);
     $vises = getVisByExperiment($id);
     $tags = getTagsForExperiment($id);
     $videos = getVideosForExperiment($id);
     $images = getImagesForExperiment($id);
     $collabs = getExperimentCollaborators($ownerid, $id);
     $sessions = getSessionsForExperiment($id);
 }
 // Process the images for display
 $image_urls = array();
 if ($images) {
     foreach ($images as $img) {
         array_push($image_urls, array('source' => $img['provider_url'], 'set_url' => $img['provider_url']));
     }
 }
 // Push data to smarty template
 $smarty->assign('meta', $meta);
 $smarty->assign('tags', $tags);
 $smarty->assign('vises', $vises);
 $smarty->assign('fields', $fields);