diff --git a/README.MD b/README.MD index 4fea888..fb29d59 100755 --- a/README.MD +++ b/README.MD @@ -100,7 +100,7 @@ Phoca Download is download manager for Joomla! CMS. It includes component, modul ## Version (Joomla! 5.x) -5.0.2 +5.0.3 diff --git a/admin/controllers/phocadownloadmanager.php b/admin/controllers/phocadownloadmanager.php new file mode 100644 index 0000000..5eb24db --- /dev/null +++ b/admin/controllers/phocadownloadmanager.php @@ -0,0 +1,109 @@ +layout = 'edit'; + } + + protected function allowAdd($data = array()) { + $user = Factory::getUser(); + $allow = null; + $allow = $user->authorise('core.create', 'com_phocadownload'); + if ($allow === null) { + return parent::allowAdd($data); + } else { + return $allow; + } + } + + protected function allowEdit($data = array(), $key = 'id') { + $user = Factory::getUser(); + $allow = null; + $allow = $user->authorise('core.edit', 'com_phocadownload'); + if ($allow === null) { + return parent::allowEdit($data, $key); + } else { + return $allow; + } + } + + function edit($key = NULL, $urlVar = NULL) { + $this->setRedirect(Route::_('index.php?option='.$this->option.'&view='.$this->view_list.'&layout='.$this->layout.'&manager=filemultiple', false)); + } + + function cancel($key = NULL) { + $this->setRedirect( 'index.php?option=com_phocadownload&view=phocadownloadfiles' ); + } + + function delete($key = null, $urlVar = null) { + + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + $cid = Factory::getApplication()->input->get('cid', array(), '', 'array'); + $returnUrl = Factory::getApplication()->input->get( 'return-url', null, 'post', 'base64' );//includes field + + if ($cid[0] != '') { + + $filePath = PhocaDownloadPath::getPathSet('file'); + $fileToRemove = $filePath['orig_abs_ds']. $cid[0]; + + if (File::exists($fileToRemove)) { + + $db = Factory::getDBO(); + + $query = 'SELECT a.filename' + .' FROM #__phocadownload AS a' + .' WHERE a.filename = '.$db->quote($cid[0]) + .' ORDER BY a.id'; + $db->setQuery($query, 0, 1); + $filename = $db->loadObject(); + + if (isset($filename->filename) && $filename->filename != '') { + $this->app->enqueueMessage(Text::_('COM_PHOCADOWNLOAD_WARNING_FILE_EXISTS_IN_SYSTEM'), 'warning'); + $this->setRedirect(Route::_(base64_decode($returnUrl), false)); + return false; + } + + if (File::delete($fileToRemove)) { + + $this->app->enqueueMessage(Text::_('COM_PHOCADOWNLOAD_FILE_SUCCESSFULLY_DELETED'), 'success'); + } else { + $this->app->enqueueMessage(Text::_('COM_PHOCADOWNLOAD_FILE_SUCCESSFULLY_DELETED'), 'error'); + } + + } + + } + + $this->setRedirect(Route::_(base64_decode($returnUrl), false)); + return true; + + } +} +?> diff --git a/admin/language/en-GB/en-GB.com_phocadownload.ini b/admin/language/en-GB/en-GB.com_phocadownload.ini index ced2d84..188cd59 100755 --- a/admin/language/en-GB/en-GB.com_phocadownload.ini +++ b/admin/language/en-GB/en-GB.com_phocadownload.ini @@ -9,6 +9,12 @@ ; @test utf-8 ä, ö, ü ; +;[5.0.3] +COM_PHOCADOWNLOAD_WARNING_FILE_EXISTS_IN_SYSTEM="This file is assigned to Phoca Download entry in the system. First delete the entry with this file, then you will be able to delete this file from the server." +COM_PHOCADOWNLOAD_ERROR_WHILE_DELETING_FILE="Error while deleting file" +COM_PHOCADOWNLOAD_FILE_SUCCESSFULLY_DELETED="File was successfully deleted" +COM_PHOCADOWNLOAD_DELETE_FILE_SERVER_WARNING="Are you really sure that you want to delete this file completely from the server and that this file is not used by any other part of the system?" + ;[4.0.5] COM_PHOCADOWNLOAD_SEF_NOIDS_LABEL="Remove IDs from URLs" COM_PHOCADOWNLOAD_SEF_NOIDS_DESC="Remove the IDs from the URLs. Be aware, this is an experimental setting. If you set Yes, you must check all Phoca Download links on your page." diff --git a/admin/libraries/phocadownload/file/file.php b/admin/libraries/phocadownload/file/file.php index 0948ac3..18e9f21 100755 --- a/admin/libraries/phocadownload/file/file.php +++ b/admin/libraries/phocadownload/file/file.php @@ -23,6 +23,8 @@ class PhocaDownloadFile */ public static function getFileSizeReadable ($size, $retstring = null, $onlyMB = false) { + $size = (int)$size; + if ($onlyMB) { $sizes = array('B', 'kB', 'MB'); } else { diff --git a/admin/models/fields/phocadownloadcategory.php b/admin/models/fields/phocadownloadcategory.php index 502d901..6790fc0 100755 --- a/admin/models/fields/phocadownloadcategory.php +++ b/admin/models/fields/phocadownloadcategory.php @@ -108,7 +108,10 @@ protected function getInput() { } } else { // in filter we need zero value for canceling the filter - if ($typeMethod == 'filter') { + + if ($typeMethod == 'menulink') { + // Required for menu link, + } else if ($typeMethod == 'filter') { $options[] = HTMLHelper::_('select.option', '', '- ' . Text::_('COM_PHOCADOWNLOAD_SELECT_CATEGORY') . ' -', 'value', 'text'); } else { $options[] = HTMLHelper::_('select.option', '0', '- '.Text::_('COM_PHOCADOWNLOAD_SELECT_CATEGORY').' -', 'value', 'text'); diff --git a/admin/views/phocadownloadmanager/tmpl/default.php b/admin/views/phocadownloadmanager/tmpl/default.php index e91c68d..5b478ee 100755 --- a/admin/views/phocadownloadmanager/tmpl/default.php +++ b/admin/views/phocadownloadmanager/tmpl/default.php @@ -152,6 +152,7 @@ echo ''. "\n"; echo ''. "\n"; echo ''. "\n"; + echo ''; echo HTMLHelper::_('form.token'); echo $r->endForm(); diff --git a/admin/views/phocadownloadmanager/tmpl/default_file.php b/admin/views/phocadownloadmanager/tmpl/default_file.php index ab0e770..df2adb8 100755 --- a/admin/views/phocadownloadmanager/tmpl/default_file.php +++ b/admin/views/phocadownloadmanager/tmpl/default_file.php @@ -20,15 +20,31 @@ $checked = HTMLHelper::_('grid.id', $this->filei + count($this->folders), $this->files[$this->filei]->path_with_name_relative_no ); $icon = PhocaDownloadFile::getMimeTypeIcon($this->_tmp_file->name); + + //$fileNameEncode = urlencode($this->_tmp_file->path_with_name_relative_no); + //$deleteCode = ''; + + $deleteCode = ''; + + + + echo '' .' '. $checked .'' .' ' . $icon .'' - .' ' . $this->_tmp_file->name . '' + .' ' + .'
' + .'
' . $this->_tmp_file->name . '
' + .'
' . $deleteCode . '
' + . '' .''; } else { + + + if (($group['i'] == 1) && ($ext == 'png' || $ext == 'jpg' || $ext == 'gif' || $ext == 'jpeg') ) { echo '' diff --git a/admin/views/phocadownloadmanager/view.html.php b/admin/views/phocadownloadmanager/view.html.php index ebe9d5c..0f523e2 100755 --- a/admin/views/phocadownloadmanager/view.html.php +++ b/admin/views/phocadownloadmanager/view.html.php @@ -33,6 +33,7 @@ class PhocaDownloadCpViewPhocaDownloadManager extends HtmlView protected $currentFolder; protected $t; protected $r; + protected $returnUrl; public function display($tpl = null) { @@ -40,10 +41,7 @@ public function display($tpl = null) { $this->r = new PhocaDownloadRenderAdminView(); $this->field = Factory::getApplication()->input->get('field'); $this->fce = 'phocaSelectFileName_'.$this->field; - - - - + $this->returnUrl = base64_encode(Uri::getInstance()->toString()); $this->folderstate = $this->get('FolderState'); $this->files = $this->get('Files'); $this->folders = $this->get('Folders'); @@ -51,7 +49,6 @@ public function display($tpl = null) { $this->manager = Factory::getApplication()->input->get( 'manager', '', 'file' ); - if ($this->manager == 'filemultiple') { $this->form = $this->get('Form'); } diff --git a/checksum.json b/checksum.json index f335357..6ae6b72 100644 --- a/checksum.json +++ b/checksum.json @@ -1 +1 @@ -{"com_phocadownload_v5.0.0Beta.zip":{"key":"com_phocadownload_v5.0.0Beta.zip","extname":"com_phocadownload","version":"5.0.0Beta","checksum":"60224eaec714795c831ccf2145be6272561bf62cb831a5f28ce2b738d894e3d9d24c2e3805e2d769e36d50cdb21ead28572a76f80de58271a2ad31cd9915c43d"},"com_phocadownload_v4.0.7.zip":{"key":"com_phocadownload_v4.0.7.zip","extname":"com_phocadownload","version":"4.0.7","checksum":"85092b0c0de78f23abb348f1083bd6de10e46f0cecfa50aa984fd84a67a9a2255cd6fcc30467b75a3ea545d81959520a9d11d86299c5f0a306ace8821d8c8e50"},"com_phocadownload_v5.0.0Beta2.zip":{"key":"com_phocadownload_v5.0.0Beta2.zip","extname":"com_phocadownload","version":"5.0.0Beta2","checksum":"833044110c7d55ca3fb245611868ba985c5ff4eae8b06355be4aef08072f9a76a3f8ff14af5c7fdbbebcb201dd7ddb48df6b54714f805393ff2bf8b629c560cd"},"com_phocadownload_v4.0.8.zip":{"key":"com_phocadownload_v4.0.8.zip","extname":"com_phocadownload","version":"4.0.8","checksum":"64fef93f6b61078f5c0e6596c02d6f30d0164a9eb849b112663619c53953ccb424977a00bbfb80e1648370e52c39640902f462ce214c24337d1c8a1cd73f8e56"},"com_phocadownload_v5.0.0Beta3.zip":{"key":"com_phocadownload_v5.0.0Beta3.zip","extname":"com_phocadownload","version":"5.0.0Beta3","checksum":"7dc10421dac2b7d282ca7bbca8bf84f6edf8c181969658b854e921205b434bf13c7b100c6b95146107134d2c3c3c7b7699d6514c36122a403e134ce7b8bfe1d9"},"com_phocadownload_v4.0.9.zip":{"key":"com_phocadownload_v4.0.9.zip","extname":"com_phocadownload","version":"4.0.9","checksum":"505a376b9508fcde09202ef2541d3a01da2cc596de9a0464f0acf5f35fe8fa00fc3348ccfffa03f56e5ba17f9bb5c7e91661816d5a1a4fdd58403a8dce4d2d49"},"com_phocadownload_v5.0.0Beta4.zip":{"key":"com_phocadownload_v5.0.0Beta4.zip","extname":"com_phocadownload","version":"5.0.0Beta4","checksum":"47b180bd30190f062658f5db7cabe7e4d6cda9a087ae154c91a109b14c4edfd9699c9dc40265725f0f466cc014e7590625a1f36807faf395befe06e361c3daab"},"com_phocadownload_v5.0.0Beta5.zip":{"key":"com_phocadownload_v5.0.0Beta5.zip","extname":"com_phocadownload","version":"5.0.0Beta5","checksum":"f64596ead1ef5edeca9360fd30d0ad005b008d7c12b059aeeef63e0e85c98303ca37ea090137e17442a4bb426d52c554aac391396ce03607cf027c4d0bf61cd8"},"com_phocadownload_v5.0.0Beta6.zip":{"key":"com_phocadownload_v5.0.0Beta6.zip","extname":"com_phocadownload","version":"5.0.0Beta6","checksum":"613bff446c16ddb3348a087f7ca34dd9f9d6280200b5a6a839f05375d14d115d6ee7b30486bea9d0938d19d6252503cd1767e504f0f4688d24d9114b7675e3b7"},"com_phocadownload_v4.0.10Beta.zip":{"key":"com_phocadownload_v4.0.10Beta.zip","extname":"com_phocadownload","version":"4.0.10Beta","checksum":"1049b5b2b9cd00d5ac5fa9ff1d00380c2fec8abdd33100205023c0c8d05746c157b140351f5f28ca2ad2a58a585a86384335388cea94d09dc58fe9f5aeca3e19"},"com_phocadownload_v5.0.0Beta7.zip":{"key":"com_phocadownload_v5.0.0Beta7.zip","extname":"com_phocadownload","version":"5.0.0Beta7","checksum":"bb7c0a28286b520d3d6896065d64dab11a2fecdd45050b1bb50b6867614bccab08f73cf5dba6c91228b36d0c5abaa11fbe8f23cbebad3c22661e38d00553e40c"},"com_phocadownload_v5.0.0.zip":{"key":"com_phocadownload_v5.0.0.zip","extname":"com_phocadownload","version":"5.0.0","checksum":"7495f79d9bb0711aa03f1f48ad835472451b2829070a94ed0b844df924ca26573c9d8bca34e9cdc9703168ac1f0b93b8a0529f814ecc4f8eb4c1f5de67b4553d"},"com_phocadownload_v5.0.1.zip":{"key":"com_phocadownload_v5.0.1.zip","extname":"com_phocadownload","version":"5.0.1","checksum":"db3921291c66ae5a2969eda7ec5cdb31c4453953928581282614efec15b30b7f55343bbb2163d34778279264e68f31b9946fc300522ca0dec58477ff000dcc7c"},"com_phocadownload_v5.0.2.zip":{"key":"com_phocadownload_v5.0.2.zip","extname":"com_phocadownload","version":"5.0.2","checksum":"ff00e0114a1f2fa83f0f3699bb2e23bee2011d9fb38aa690f20b0d6e07bb0cf7def82e33ea6ac3038bee635befad0cf7cdf80d20d6f2a6de41e20a693869e95a"}} \ No newline at end of file +{"com_phocadownload_v5.0.0Beta.zip":{"key":"com_phocadownload_v5.0.0Beta.zip","extname":"com_phocadownload","version":"5.0.0Beta","checksum":"60224eaec714795c831ccf2145be6272561bf62cb831a5f28ce2b738d894e3d9d24c2e3805e2d769e36d50cdb21ead28572a76f80de58271a2ad31cd9915c43d"},"com_phocadownload_v4.0.7.zip":{"key":"com_phocadownload_v4.0.7.zip","extname":"com_phocadownload","version":"4.0.7","checksum":"85092b0c0de78f23abb348f1083bd6de10e46f0cecfa50aa984fd84a67a9a2255cd6fcc30467b75a3ea545d81959520a9d11d86299c5f0a306ace8821d8c8e50"},"com_phocadownload_v5.0.0Beta2.zip":{"key":"com_phocadownload_v5.0.0Beta2.zip","extname":"com_phocadownload","version":"5.0.0Beta2","checksum":"833044110c7d55ca3fb245611868ba985c5ff4eae8b06355be4aef08072f9a76a3f8ff14af5c7fdbbebcb201dd7ddb48df6b54714f805393ff2bf8b629c560cd"},"com_phocadownload_v4.0.8.zip":{"key":"com_phocadownload_v4.0.8.zip","extname":"com_phocadownload","version":"4.0.8","checksum":"64fef93f6b61078f5c0e6596c02d6f30d0164a9eb849b112663619c53953ccb424977a00bbfb80e1648370e52c39640902f462ce214c24337d1c8a1cd73f8e56"},"com_phocadownload_v5.0.0Beta3.zip":{"key":"com_phocadownload_v5.0.0Beta3.zip","extname":"com_phocadownload","version":"5.0.0Beta3","checksum":"7dc10421dac2b7d282ca7bbca8bf84f6edf8c181969658b854e921205b434bf13c7b100c6b95146107134d2c3c3c7b7699d6514c36122a403e134ce7b8bfe1d9"},"com_phocadownload_v4.0.9.zip":{"key":"com_phocadownload_v4.0.9.zip","extname":"com_phocadownload","version":"4.0.9","checksum":"505a376b9508fcde09202ef2541d3a01da2cc596de9a0464f0acf5f35fe8fa00fc3348ccfffa03f56e5ba17f9bb5c7e91661816d5a1a4fdd58403a8dce4d2d49"},"com_phocadownload_v5.0.0Beta4.zip":{"key":"com_phocadownload_v5.0.0Beta4.zip","extname":"com_phocadownload","version":"5.0.0Beta4","checksum":"47b180bd30190f062658f5db7cabe7e4d6cda9a087ae154c91a109b14c4edfd9699c9dc40265725f0f466cc014e7590625a1f36807faf395befe06e361c3daab"},"com_phocadownload_v5.0.0Beta5.zip":{"key":"com_phocadownload_v5.0.0Beta5.zip","extname":"com_phocadownload","version":"5.0.0Beta5","checksum":"f64596ead1ef5edeca9360fd30d0ad005b008d7c12b059aeeef63e0e85c98303ca37ea090137e17442a4bb426d52c554aac391396ce03607cf027c4d0bf61cd8"},"com_phocadownload_v5.0.0Beta6.zip":{"key":"com_phocadownload_v5.0.0Beta6.zip","extname":"com_phocadownload","version":"5.0.0Beta6","checksum":"613bff446c16ddb3348a087f7ca34dd9f9d6280200b5a6a839f05375d14d115d6ee7b30486bea9d0938d19d6252503cd1767e504f0f4688d24d9114b7675e3b7"},"com_phocadownload_v4.0.10Beta.zip":{"key":"com_phocadownload_v4.0.10Beta.zip","extname":"com_phocadownload","version":"4.0.10Beta","checksum":"1049b5b2b9cd00d5ac5fa9ff1d00380c2fec8abdd33100205023c0c8d05746c157b140351f5f28ca2ad2a58a585a86384335388cea94d09dc58fe9f5aeca3e19"},"com_phocadownload_v5.0.0Beta7.zip":{"key":"com_phocadownload_v5.0.0Beta7.zip","extname":"com_phocadownload","version":"5.0.0Beta7","checksum":"bb7c0a28286b520d3d6896065d64dab11a2fecdd45050b1bb50b6867614bccab08f73cf5dba6c91228b36d0c5abaa11fbe8f23cbebad3c22661e38d00553e40c"},"com_phocadownload_v5.0.0.zip":{"key":"com_phocadownload_v5.0.0.zip","extname":"com_phocadownload","version":"5.0.0","checksum":"7495f79d9bb0711aa03f1f48ad835472451b2829070a94ed0b844df924ca26573c9d8bca34e9cdc9703168ac1f0b93b8a0529f814ecc4f8eb4c1f5de67b4553d"},"com_phocadownload_v5.0.1.zip":{"key":"com_phocadownload_v5.0.1.zip","extname":"com_phocadownload","version":"5.0.1","checksum":"db3921291c66ae5a2969eda7ec5cdb31c4453953928581282614efec15b30b7f55343bbb2163d34778279264e68f31b9946fc300522ca0dec58477ff000dcc7c"},"com_phocadownload_v5.0.2.zip":{"key":"com_phocadownload_v5.0.2.zip","extname":"com_phocadownload","version":"5.0.2","checksum":"ff00e0114a1f2fa83f0f3699bb2e23bee2011d9fb38aa690f20b0d6e07bb0cf7def82e33ea6ac3038bee635befad0cf7cdf80d20d6f2a6de41e20a693869e95a"},"com_phocadownload_v5.0.3.zip":{"key":"com_phocadownload_v5.0.3.zip","extname":"com_phocadownload","version":"5.0.3","checksum":"8d9af7089d335c0caba5c3ff99f146908c893af8d91bdceb5a0f2583bb946cb222e66de89a6cc7bb35ae27adccbfadff180a3bfb7ca11841294fe13901070554"}} \ No newline at end of file diff --git a/manifest.xml b/manifest.xml index 934fad4..154a72d 100755 --- a/manifest.xml +++ b/manifest.xml @@ -44,12 +44,12 @@ com_phocadownload component - 5.0.2 - http://www.phoca.cz/version/index.php?phocadownload=5.0.2 + 5.0.3 + http://www.phoca.cz/version/index.php?phocadownload=5.0.3 - https://github.com/PhocaCz/PhocaDownload/releases/download/5.0.2/com_phocadownload_v5.0.2.zip + https://github.com/PhocaCz/PhocaDownload/releases/download/5.0.3/com_phocadownload_v5.0.3.zip - ff00e0114a1f2fa83f0f3699bb2e23bee2011d9fb38aa690f20b0d6e07bb0cf7def82e33ea6ac3038bee635befad0cf7cdf80d20d6f2a6de41e20a693869e95a + 8d9af7089d335c0caba5c3ff99f146908c893af8d91bdceb5a0f2583bb946cb222e66de89a6cc7bb35ae27adccbfadff180a3bfb7ca11841294fe13901070554 stable diff --git a/media/css/administrator/phocadownload.css b/media/css/administrator/phocadownload.css index db1e28c..9ae8d24 100755 --- a/media/css/administrator/phocadownload.css +++ b/media/css/administrator/phocadownload.css @@ -1163,4 +1163,18 @@ li.plupload_droptext:before { .ph-intendation { display: inline-block; -} \ No newline at end of file +} + +.duotone.icon-purge:after, +.duotone.icon-purge:before { + color: #CC1020; +} + +.ph-icon-leftm { + margin-left: 2em; +} + +.ph-files-row { + display: flex; + justify-content:space-between; +} diff --git a/media/css/main/phocadownload.css b/media/css/main/phocadownload.css index d3d6c94..28f9767 100755 --- a/media/css/main/phocadownload.css +++ b/media/css/main/phocadownload.css @@ -54,8 +54,8 @@ #phoca-dl-download-box .pd-file h3.pd-ctitle{ margin: 0; padding: 5px; - background: #fafafa; - border: 1px solid #e9e9e9; + /*background: #fafafa; + border: 1px solid #e9e9e9;*/ margin-bottom: 7px; } diff --git a/media/js/main.js b/media/js/main.js index e881911..254c1e2 100755 --- a/media/js/main.js +++ b/media/js/main.js @@ -18,7 +18,7 @@ document.addEventListener("DOMContentLoaded", () => { anchor.addEventListener('click', event => { // `this` refers to the anchor tag that's been clicked event.preventDefault(); - console.log(this.getAttribute('href')); + console .log(this.getAttribute('href')); }, true); };*/ @@ -37,7 +37,7 @@ document.addEventListener("DOMContentLoaded", () => { //let height = this.getAttribute('data-bs-height-dialog'); //let width = this.getAttribute('data-bs-width-dialog'); - + let modalItem = document.getElementById('pdCategoryModal') let modalIframe = document.getElementById('pdCategoryModalIframe'); diff --git a/phocadownload-release-news.png b/phocadownload-release-news.png index 98c85fb..c48c1ca 100644 Binary files a/phocadownload-release-news.png and b/phocadownload-release-news.png differ diff --git a/phocadownload-release-news.svg b/phocadownload-release-news.svg index ce5ccf8..09616a2 100644 --- a/phocadownload-release-news.svg +++ b/phocadownload-release-news.svg @@ -21,7 +21,7 @@ WWW.PHOCA.CZ/NEWS - Phoca Downloadversion 5.0.2 + Phoca Downloadversion 5.0.3 has been released diff --git a/phocadownload-release.png b/phocadownload-release.png index 0799aa3..d6209dc 100755 Binary files a/phocadownload-release.png and b/phocadownload-release.png differ diff --git a/phocadownload-release.svg b/phocadownload-release.svg index b80a0df..4d75754 100644 --- a/phocadownload-release.svg +++ b/phocadownload-release.svg @@ -132,7 +132,7 @@ x="255.99997" y="242.20009" id="tspan1992" - style="font-size:34.6667px;text-align:center;text-anchor:middle">version 5.0.2 + style="font-size:34.6667px;text-align:center;text-anchor:middle">version 5.0.3 com_phocadownload Jan Pavelka (www.phoca.cz) - 29/03/2024 + 20/06/2024 https://www.phoca.cz Jan Pavelka GNU/GPL - 5.0.2 + 5.0.3 COM_PHOCADOWNLOAD_XML_DESCRIPTION script.php PhocaDownload diff --git a/site/views/category/tmpl/default.xml b/site/views/category/tmpl/default.xml index 93b4612..71d8830 100755 --- a/site/views/category/tmpl/default.xml +++ b/site/views/category/tmpl/default.xml @@ -10,7 +10,7 @@
- +