* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 * @category Stud.IP */ class DocumentController extends StudipController { function download_action($file_ref_id, $disposition = 'attachment') { $file_ref = FileRef::find($file_ref_id); if ($file_ref) { $this->redirect($file_ref->getDownloadURL($disposition === 'inline' ? 'normal' : 'force')); } else { throw new Trails\Exception(404); } } }