{␊ |
$prj = $request->project;␊ |
$upload = Pluf_Shortcuts_GetObjectOr404('IDF_Upload', $match[2]);␊ |
if ($upload->project != $prj->id) {␊ |
throw new Pluf_HTTP_Error404();␊ |
}␊ |
$title = sprintf(__('Download %s'), $upload->summary);␊ |
$form = false;␊ |
if ($request->method == 'POST' and␊ |
|
}␊ |
␊ |
/**␊ |
* Download a file.␊ |
*/␊ |
public function download($request, $match)␊ |
{␊ |
$prj = $request->project;␊ |
$upload = Pluf_Shortcuts_GetObjectOr404('IDF_Upload', $match[2]);␊ |
if ($upload->project != $prj->id) {␊ |
throw new Pluf_HTTP_Error404();␊ |
}␊ |
$upload->downloads += 1;␊ |
$upload->update();␊ |
return new Pluf_HTTP_Response_Redirect($upload->getAbsoluteUrl($prj));␊ |
}␊ |
␊ |
/**␊ |
* Submit a new file for download.␊ |
*/␊ |
public $submit_precond = array('IDF_Precondition::projectMemberOrOwner');␊ |