public static function archives($prefix, $name) { $html = ""; if (count(JDeveloperArchive::getVersions($prefix, $name))) { foreach (JDeveloperArchive::getVersions($prefix, $name) as $file) { $download = JDeveloperArchive::getArchiveDir(true) . "/{$file}"; $html .= '<a href="' . $download . '" class="hasTooltip" title="' . JText::_('COM_JDEVELOPER_COMPONENT_DOWNLOAD') . '">' . $file . '</a> - <span style="color:#999999;">' . date("Y.m.d H:i", filemtime(JDeveloperArchive::getArchiveDir() . "/{$file}")) . '</span><br>'; } } else { $html .= '<i class="icon-unpublish"></i>'; } return $html; }
/** * Delete ZIP files of modules */ public function deletezip() { require_once JDeveloperLIB . "/archive.php"; // Check access $user = JFactory::getUser(); $this->setRedirect(JRoute::_('index.php?option=com_jdeveloper&view=module', false)); if (!$user->authorise('modules.deletezip', 'com_jdeveloper')) { $this->setMessage(JText::_('COM_JDEVELOPER_ACTION_NOT_ALLOWED'), 'warning'); return; } $app = JFactory::getApplication(); $ids = $app->input->get('cid', array(), 'array'); foreach ($ids as $id) { $module = $this->getModel()->getItem($id); $files = JDeveloperArchive::getVersions("mod_", $module->name); foreach ($files as $file) { JFile::delete($module->createDir . ".zip"); } } $this->setMessage(JText::sprintf('COM_JDEVELOPER_MODULE_MESSAGE_ZIP_DELETED', count($ids))); }
/** * Delete ZIP files of component */ public function deletezip() { // Check access $user = JFactory::getUser(); $this->setRedirect(JRoute::_('index.php?option=com_jdeveloper&view=component', false)); if (!$user->authorise('components.deletezip', 'com_jdeveloper')) { $this->setMessage(JText::_('COM_JDEVELOPER_ACTION_NOT_ALLOWED'), 'warning'); return; } $app = JFactory::getApplication(); $ids = $app->input->get('cid', array(), 'array'); foreach ($ids as $id) { $component = $this->getModel()->getItem($id); $files = JDeveloperArchive::getVersions("com_", $component->name); foreach ($files as $file) { JFile::delete(JDeveloperArchive::getArchiveDir() . "/" . $file); } } $this->setMessage(JText::sprintf('COM_JDEVELOPER_COMPONENT_ZIP_DELETED', count($ids))); }