/** * increase access count * * @param Filemanager_Model_DownloadLink $download */ public function increaseAccessCount(Filemanager_Model_DownloadLink $download) { $db = method_exists($this->_backend, 'getAdapter') ? $this->_backend->getAdapter() : Tinebase_Core::getDb(); $transactionId = Tinebase_TransactionManager::getInstance()->startTransaction($db); $currentRecord = $this->_backend->get($download->getId()); $currentRecord->access_count++; // yes, no history etc. $this->_backend->update($currentRecord); Tinebase_TransactionManager::getInstance()->commitTransaction($transactionId); }
/** * generate file overview * * @param Filemanager_Model_DownloadLink $download * @param Tinebase_Model_Tree_Node $node * @param array $path */ protected function _displayFile(Filemanager_Model_DownloadLink $download, Tinebase_Model_Tree_Node $node, $path) { $view = new Zend_View(); $view->setScriptPath('Filemanager/views'); $view->path = '/' . implode('/', $path); $view->file = $node; $view->file->path = '/download/get/' . $download->getId() . '/' . implode('/', $path); header('Content-Type: text/html; charset=utf-8'); die($view->render('file.phtml')); }
/** * generate file overview * * @param Filemanager_Model_DownloadLink $download * @param Tinebase_Model_Tree_Node $node * @param array $path */ protected function _displayFile(Filemanager_Model_DownloadLink $download, Tinebase_Model_Tree_Node $node, $path) { $view = $this->_getView($path, $node); $view->file = $node; $view->file->path = $download->getDownloadUrl('get') . '/' . implode('/', $path); header('Content-Type: text/html; charset=utf-8'); die($view->render('file.phtml')); }