priority = 30; $this->enabled = true; parent::__construct($container); } /** * Echoes any HTML to show before the view template * * @param string $view The current view * @param string $task The current task * * @return void */ function preRender(string $view, string $task): void { $input = $this->container->input; $platform = $this->container->platform; $format = $input->getCmd('format', 'html'); if (empty($format)) { $format = 'html'; } if ($format != 'html') { return; } if ($platform->isCli()) { return; } HTMLHelper::_('behavior.core'); HTMLHelper::_('jquery.framework', true); // Wrap output in various classes $versionParts = explode('.', JVERSION); $minorVersion = $versionParts[0] . $versionParts[1]; $majorVersion = $versionParts[0]; $classes = []; if ($platform->isBackend()) { $area = $platform->isBackend() ? 'admin' : 'site'; $option = $input->getCmd('option', ''); $viewForCssClass = $input->getCmd('view', ''); $layout = $input->getCmd('layout', ''); $taskForCssClass = $input->getCmd('task', ''); $classes = [ 'joomla-version-' . $majorVersion, 'joomla-version-' . $minorVersion, $area, $option, 'view-' . $view, 'view-' . $viewForCssClass, 'layout-' . $layout, 'task-' . $task, 'task-' . $taskForCssClass, // We have a floating sidebar, they said. It looks great, they said. They must've been blind, I say! 'j-toggle-main', 'j-toggle-transition', 'row-fluid', ]; $classes = array_unique($classes); } $this->openPageWrapper($classes); // Render the submenu and toolbar if ($input->getBool('render_toolbar', true)) { $this->renderButtons($view, $task); $this->renderLinkbar($view, $task); } parent::preRender($view, $task); } /** * Echoes any HTML to show after the view template * * @param string $view The current view * @param string $task The current task * * @return void */ function postRender(string $view, string $task): void { $input = $this->container->input; $platform = $this->container->platform; $format = $input->getCmd('format', 'html'); if (empty($format)) { $format = 'html'; } if ($format != 'html') { return; } // Closing tag only if we're not in CLI if ($platform->isCli()) { return; } // Closes akeeba-renderjoomla div $this->closePageWrapper(); } /** * Renders the submenu (link bar) * * @param string $view The active view name * @param string $task The current task * * @return void */ protected function renderLinkbar(string $view, string $task): void { $style = $this->getOption('linkbar_style', 'joomla'); switch ($style) { case 'joomla': $this->renderLinkbar_joomla($view, $task); break; case 'classic': default: $this->renderLinkbar_classic($view, $task); break; } } /** * Renders the submenu (link bar) in F0F's classic style, using a Bootstrapped * tab bar. * * @param string $view The active view name * @param string $task The current task * * @return void */ protected function renderLinkbar_classic(string $view, string $task): void { $platform = $this->container->platform; if ($platform->isCli()) { return; } $isJoomla4 = version_compare(JVERSION, '3.99999.99999', 'gt'); $isJoomla3 = !$isJoomla4 && version_compare(JVERSION, '3.0.0', 'ge'); // Do not render a submenu unless we are in the the admin area $toolbar = $this->container->toolbar; $renderFrontendSubmenu = $toolbar->getRenderFrontendSubmenu(); if (!$platform->isBackend() && !$renderFrontendSubmenu) { return; } $links = $toolbar->getLinks(); if (!empty($links)) { echo "