$i++; } echo json_encode(array("status" => "success", "data" => $ae_data)); } else { echo json_encode(array("status" => "error", "data" => "No entries attached to this artifact.")); } } else { echo json_encode(array("status" => "error", "data" => "No artifact ID or invalid artifact ID.")); } break; case "get-entry": if (isset(${$request_var}["pentry_id"]) && ($tmp_input = clean_input(${$request_var}["pentry_id"], "int"))) { $PROCESSED["pentry_id"] = $tmp_input; } if ($PROCESSED["pentry_id"]) { $entry = Models_Eportfolio_Entry::fetchRow($PROCESSED["pentry_id"]); if ($entry) { $e_data = $entry->toArray(); echo json_encode(array("status" => "success", "data" => $e_data)); } else { echo json_encode(array("status" => "error", "data" => "No entry found with this ID.")); } } else { echo json_encode(array("status" => "error", "data" => "No entry ID or invalid entry ID.")); } break; case "get-advisor-students": if (isset(${$request_var}["padvisor_proxy_id"]) && ($tmp_input = clean_input(${$request_var}["padvisor_proxy_id"], "int"))) { $PROCESSED["padvisor_proxy_id"] = $tmp_input; } if ($PROCESSED["padvisor_proxy_id"]) {
public function getEntry() { $entry = Models_Eportfolio_Entry::fetchRow($this->pentry_id); return $entry; }
* @author Organisation: Queen's University * @author Unit: School of Medicine * @author Developer: Matt Simpson <*****@*****.**> * @copyright Copyright 2010 Queen's University. All Rights Reserved. * * @version $Id: serve-polls.php 1171 2010-05-01 14:39:27Z ad29 $ * */ @set_include_path(implode(PATH_SEPARATOR, array(dirname(__FILE__) . "/core", dirname(__FILE__) . "/core/includes", dirname(__FILE__) . "/core/library", get_include_path()))); /** * Include the Entrada init code. */ require_once "init.inc.php"; if (isset($_SESSION["isAuthorized"]) && $_SESSION["isAuthorized"]) { $pentry_id = clean_input($_GET["entry_id"], "int"); $pentry = Models_Eportfolio_Entry::fetchRow($pentry_id); $pfartifact = $pentry->getPfartifact(); $pfolder = $pfartifact->getFolder(); $portfolio = $pfolder->getPortfolio(); $file_realpath = EPORTFOLIO_STORAGE_PATH . "/portfolio-" . $portfolio->getID() . "/folder-" . $pfolder->getID() . "/artifact-" . $pfartifact->getID() . "/user-" . $pentry->getProxyID() . "/" . $pentry->getID(); if (file_exists($file_realpath)) { $finfo = $finfo = new finfo(FILEINFO_MIME); $edata = $pentry->getEdataDecoded(); $filename = preg_replace('/[^a-zA-Z0-9-_\\.]/', '', str_replace(" ", "-", trim($edata["filename"]))); header('Content-Description: File Transfer'); header('Content-Type: ' . $finfo->file($file_realpath)); header('Content-Disposition: attachment; filename=' . strtolower($filename)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public');