示例#1
0
 public function getEntries($proxy_id = NULL)
 {
     $entries = Models_Eportfolio_Entry::fetchAll($this->pfartifact_id, $proxy_id);
     return $entries;
 }
         if ($folder_artifact) {
             $fa_data = $folder_artifact->toArray();
             echo json_encode(array("status" => "success", "data" => $fa_data));
         } else {
             echo json_encode(array("status" => "error", "data" => "No artifacts attached to this portfolio folder ID."));
         }
     } else {
         echo json_encode(array("status" => "error", "data" => "No portfolio folder artifact ID or invalid portfolio folder artifact ID."));
     }
     break;
 case "get-artifact-entries":
     if (isset(${$request_var}["pfartifact_id"]) && ($tmp_input = clean_input(${$request_var}["pfartifact_id"], "int"))) {
         $PROCESSED["pfartifact_id"] = $tmp_input;
     }
     if ($PROCESSED["pfartifact_id"]) {
         $artifact_entries = Models_Eportfolio_Entry::fetchAll($PROCESSED["pfartifact_id"], isset($proxy_id) ? $proxy_id : NULL);
         if ($artifact_entries) {
             $ae_data = array();
             $i = 0;
             foreach ($artifact_entries as $artifact_entry) {
                 $ae_data[$i]["entry"] = $artifact_entry->toArray();
                 $comments = $artifact_entry->getComments();
                 if ($comments) {
                     $j = 0;
                     foreach ($comments as $comment) {
                         $commentor = User::get($comment->getProxyID());
                         $comments_array[$j] = $comment->toArray();
                         $comments_array[$j]["submitted_date"] = date("Y-m-d H:i", $comments_array[$j]["submitted_date"]);
                         $comments_array[$j]["commentor"] = $commentor->getFullname(false);
                         $j++;
                     }