REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 2.82 KB
Close
/home/jambtst2015/9jahookups.com/libraries/src/Toolbar/ContainerAwareToolbarFactory.php
Text
Base64
<?php /** * Joomla! Content Management System * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Toolbar; \defined('_JEXEC') or die; use Joomla\CMS\Filesystem\Path; use Joomla\CMS\Filter\InputFilter; use Joomla\CMS\Language\Text; use Joomla\CMS\Log\Log; use Joomla\DI\ContainerAwareInterface; use Joomla\DI\ContainerAwareTrait; /** * Default factory for creating toolbar objects * * @since 4.0.0 */ class ContainerAwareToolbarFactory implements ToolbarFactoryInterface, ContainerAwareInterface { use ContainerAwareTrait; /** * Creates a new toolbar button. * * @param Toolbar $toolbar The Toolbar instance to attach to the button * @param string $type Button Type * * @return ToolbarButton * * @since 3.8.0 * @throws \InvalidArgumentException */ public function createButton(Toolbar $toolbar, string $type): ToolbarButton { $normalisedType = ucfirst($type); $buttonClass = $this->loadButtonClass($normalisedType); if (!$buttonClass) { $dirs = $toolbar->getButtonPath(); $file = InputFilter::getInstance()->clean(str_replace('_', DIRECTORY_SEPARATOR, strtolower($type)) . '.php', 'path'); if ($buttonFile = Path::find($dirs, $file)) { include_once $buttonFile; } else { Log::add(Text::sprintf('JLIB_HTML_BUTTON_NO_LOAD', $buttonClass, $buttonFile), Log::WARNING, 'jerror'); throw new \InvalidArgumentException(Text::sprintf('JLIB_HTML_BUTTON_NO_LOAD', $buttonClass, $buttonFile)); } } if (!class_exists($buttonClass)) { throw new \InvalidArgumentException(sprintf('Class `%1$s` does not exist, could not create a toolbar button.', $buttonClass)); } // Check for a possible service from the container otherwise manually instantiate the class if ($this->getContainer()->has($buttonClass)) { return $this->getContainer()->get($buttonClass); } /** @var ToolbarButton $button */ $button = new $buttonClass($normalisedType); return $button->setParent($toolbar); } /** * Creates a new Toolbar object. * * @param string $name The toolbar name. * * @return Toolbar * * @since 4.0.0 */ public function createToolbar(string $name = 'toolbar'): Toolbar { return new Toolbar($name, $this); } /** * Load the button class including the deprecated ones. * * @param string $type Button Type (normalized) * * @return string|null * * @since 4.0.0 */ private function loadButtonClass(string $type) { $buttonClasses = [ 'Joomla\\CMS\\Toolbar\\Button\\' . $type . 'Button', // @deprecated 5.0 'JToolbarButton' . $type, ]; foreach ($buttonClasses as $buttonClass) { if (!class_exists($buttonClass)) { continue; } return $buttonClass; } return null; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Button
DIR
-
drwxr-xr-x
2021-08-23 19:07:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ContainerAwareToolbarFactory.php
2.82 KB
lrw-r--r--
2021-08-23 19:07:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CoreButtonsTrait.php
13.17 KB
lrw-r--r--
2021-08-23 19:07:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Toolbar.php
10.65 KB
lrw-r--r--
2021-08-23 19:07:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ToolbarButton.php
9.97 KB
lrw-r--r--
2021-08-23 19:07:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ToolbarFactoryInterface.php
925 B
lrw-r--r--
2021-08-23 19:07:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ToolbarHelper.php
19.29 KB
lrw-r--r--
2021-08-23 19:07:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).