* @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; use VDM\Joomla\Componentbuilder\Compiler\Factory as CompilerFactory; use VDM\Joomla\Utilities\ArrayHelper; use Joomla\CMS\Uri\Uri; use Joomla\CMS\Router\Route; use Joomla\CMS\Version; // No direct access to this file defined('JPATH_BASE') or die; function computeZipUrls(): array { $componentUrl = null; $moduleUrls = []; $pluginUrls = []; // Component URL $componentPath = CompilerFactory::_('FilePaths')->get('component', ''); if ($componentPath !== '' && ($pos = strpos($componentPath, '/tmp/')) !== false) { $componentUrl = Uri::root() . substr($componentPath, $pos + 1); } // Module URLs $modules = CompilerFactory::_('FilePaths')->get('modules'); if (!empty($modules) && is_array($modules)) { foreach ($modules as $moduleId => $modulePath) { $path = (string) $modulePath; if ($path !== '' && ($pos = strpos($path, '/tmp/')) !== false) { $moduleUrls[(int) $moduleId] = Uri::root() . substr($path, $pos + 1); } } } // Plugin URLs $plugins = CompilerFactory::_('FilePaths')->get('plugins'); if (!empty($plugins) && is_array($plugins)) { foreach ($plugins as $pluginId => $pluginPath) { $path = (string) $pluginPath; if ($path !== '' && ($pos = strpos($path, '/tmp/')) !== false) { $pluginUrls[(int) $pluginId] = Uri::root() . substr($path, $pos + 1); } } } return [ 'componentUrl' => $componentUrl, 'moduleUrls' => $moduleUrls, 'pluginUrls' => $pluginUrls, ]; } $urls = computeZipUrls(); $hasPlugins = ArrayHelper::check($urls['pluginUrls'] ?? [], true); $hasModules = ArrayHelper::check($urls['moduleUrls'] ?? [], true); $multi = ($hasPlugins || $hasModules); $componentFolder = CompilerFactory::_('FilePaths')->get('component-folder', ''); $redirect = Route::_('index.php?option=com_componentbuilder&view=compiler', false); $allowInstall = ((int) (CompilerFactory::_('Config')->joomla_version ?? 0) === (int) Version::MAJOR_VERSION); // LayoutHelper::render('jcbbuildersuccessmessagecli', []); // so its loaded for the CLI ?>

$hasModules, 'has_plugins' => $hasPlugins, 'multi' => $multi]); ?> $urls]); ?> $urls['componentUrl'] ?? null]); ?>

.