diff --git a/Controller/WikiFileViewController.php b/Controller/WikiFileViewController.php index 5776b1c..247c0d7 100644 --- a/Controller/WikiFileViewController.php +++ b/Controller/WikiFileViewController.php @@ -5,12 +5,7 @@ use Kanboard\Core\ObjectStorage\ObjectStorageException; use Kanboard\Controller\BaseController; -/** - * File Viewer Controller - * - * @package Kanbaord\Controller - * @author Frederic Guillot - */ + class WikiFileViewController extends BaseController { /** @@ -66,7 +61,7 @@ protected function renderFileWithCache(array $file, $mimetype) */ public function show() { - $file = $file = $this->wikiFile->getById($this->request->getIntegerParam('fid')); + $file = $this->wikiFile->getById($this->request->getIntegerParam('fid')); $type = $this->helper->file->getPreviewType($file['name']); $params = array('file_id' => $file['id'], 'project_id' => $this->request->getIntegerParam('project_id')); @@ -89,7 +84,7 @@ public function show() */ public function image() { - $file = $this->wikiFile->getById($this->request->getIntegerParam('fid')); + $file = $this->wikiFile->getById($this->request->getIntegerParam('file_id')); $this->renderFileWithCache($file, $this->helper->file->getImageMimeType($file['name'])); } @@ -111,7 +106,7 @@ public function browser() */ public function thumbnail() { - $file = $this->wikiFile->getById($this->request->getIntegerParam('fid')); + $file = $this->wikiFile->getById($this->request->getIntegerParam('file_id')); $model = 'wikiFile'; $filename = $this->$model->getThumbnailPath($file['path']); $etag = md5($filename); @@ -147,7 +142,7 @@ public function thumbnail() public function download() { try { - $file = $this->wikiFile->getById($this->request->getIntegerParam('fid')); + $file = $this->wikiFile->getById($this->request->getIntegerParam('file_id')); $file['model'] = 'wikiFile'; $this->response->withFileDownload($file['name']); $this->response->send(); diff --git a/Model/WikiFile.php b/Model/WikiFile.php index 79f5012..5a67e6f 100644 --- a/Model/WikiFile.php +++ b/Model/WikiFile.php @@ -106,4 +106,8 @@ protected function fireCreationEvent($file_id) return null; } + protected function fireDestructionEvent($file_id) + { + return null; + } } diff --git a/Plugin.php b/Plugin.php index df0a189..47813e6 100755 --- a/Plugin.php +++ b/Plugin.php @@ -38,6 +38,8 @@ public function initialize() $this->template->hook->attach('template:project-list:menu:after', 'wiki:wiki_list/menu'); $this->template->hook->attach('template:header:dropdown', 'wiki:header/dropdown'); + + $this->template->setTemplateOverride('file_viewer/show', 'wiki:file_viewer/show'); $this->hook->on('template:layout:css', array('template' => 'plugins/Wiki/Asset/css/wiki.css')); $this->hook->on('template:layout:js', array('template' => 'plugins/Wiki/Asset/Javascript/wiki.js')); diff --git a/Template/file_viewer/show.php b/Template/file_viewer/show.php new file mode 100644 index 0000000..05c9eb3 --- /dev/null +++ b/Template/file_viewer/show.php @@ -0,0 +1,14 @@ +
= $content ?>+ +