File manager - Edit - /home/opticamezl/www/newok/Joomla.zip
Back
PK �\�8�w w Extension/AbstractPlugin.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Extension; use Alledia\Framework\Factory; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Version; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects abstract class AbstractPlugin extends CMSPlugin { /** * Alledia Extension instance * * @var Licensed */ protected $extension; /** * Library namespace * * @var string */ protected $namespace; /** * Method used to load the extension data. It is not on the constructor * because this way we can avoid loading the data if the plugin * will not be used. * * @return void */ protected function init() { $this->loadExtension(); // Load the libraries, if existent $this->extension->loadLibrary(); $this->loadLanguage(); } /** * Method to load the language files * * @return void */ public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR) { parent::loadLanguage($extension, $basePath); $systemStrings = 'plg_' . $this->_type . '_' . $this->_name . '.sys'; parent::loadLanguage($systemStrings, $basePath); } /** * Method to load the extension data * * @return void */ protected function loadExtension() { if (!isset($this->extension)) { $this->extension = Factory::getExtension($this->namespace, 'plugin', $this->_type); } } /** * Check if this extension is licensed as pro * * @return bool True for pro version */ protected function isPro() { return $this->extension->isPro(); } } PK �\��8f f Extension/AbstractComponent.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Extension; // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects.FoundWithSymbols use Alledia\Framework\Factory; use Alledia\Framework\Joomla\AbstractTable; use Alledia\Framework\Joomla\Controller\AbstractBase; use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\CMS\Table\Table; abstract class AbstractComponent extends Licensed { /** * @var self */ protected static $instance = null; /** * @var ?AbstractBase */ protected $controller = null; /** * @inheritDoc */ public function __construct($namespace) { parent::__construct($namespace, 'component'); BaseDatabaseModel::addIncludePath(JPATH_COMPONENT . '/models'); Table::addIncludePath(JPATH_COMPONENT . '/tables'); $this->loadLibrary(); } /** * @param string $namespace * * @return self */ public static function getInstance($namespace = null) { if (static::$instance === null) { static::$instance = new static($namespace); } return static::$instance; } /** * @return void * @throws \Exception */ public function init() { $this->loadController(); $this->executeRedirectTask(); } /** * @return void * @throws \Exception */ public function loadController() { if ($this->controller === null) { $app = Factory::getApplication(); $client = $app->isClient('administrator') ? 'Admin' : 'Site'; require JPATH_COMPONENT . '/controller.php'; $callable = [ '\\Alledia\\' . $this->namespace . '\\' . ucfirst($this->license) . '\\Joomla\\Controller\\' . $client, 'getInstance', ]; $this->controller = is_callable($callable) ? call_user_func($callable, $this->namespace) : null; } } /** * @return void * @throws \Exception */ public function executeRedirectTask() { $app = Factory::getApplication(); if ($this->controller) { $task = $app->input->getCmd('task'); $this->controller->execute($task); $this->controller->redirect(); } else { $referer = $app->input->getCmd('referer'); $app->redirect($referer); } } /** * @param string $type * * @return ?BaseDatabaseModel */ public function getModel(string $type): ?BaseDatabaseModel { $class = sprintf( 'Alledia\\%s\\%s\\Joomla\\Model\\%s', $this->namespace, $this->isPro() ? 'Pro' : 'Free', $type ); if (class_exists($class)) { return new $class(); } return BaseDatabaseModel::getInstance($type, $this->namespace . 'Model'); } /** * @param string $type * * @return ?Table */ public function getTable(string $type): ?Table { $class = sprintf( 'Alledia\\%s\\%s\\Joomla\\Table\\%s', $this->namespace, $this->isPro() ? 'Pro' : 'Free', $type ); if (class_exists($class)) { $db = Factory::getDatabase(); return new $class($db); } return AbstractTable::getInstance($type, $this->namespace . 'Table'); } } PK �\�B> > $ Extension/AbstractFlexibleModule.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Extension; defined('_JEXEC') or die(); use Joomla\CMS\Helper\ModuleHelper; use Joomla\Registry\Registry; abstract class AbstractFlexibleModule extends Licensed { /** * @var string */ public $title = null; /** * @var */ public $module = null; /** * @var */ public $position = null; /** * @var string */ public $content = null; /** * @var bool */ public $showtitle = null; /** * @var int */ public $menuid = null; /** * @var string */ public $style = null; /** * @inheritDoc */ public function __construct($namespace, $module = null) { parent::__construct($namespace, 'module'); $this->loadLibrary(); if (is_object($module)) { $properties = [ 'id', 'title', 'module', 'position', 'content', 'showtitle', 'menuid', 'name', 'style', 'params' ]; foreach ($properties as $property) { if (isset($module->{$property})) { $this->{$property} = $module->{$property}; } } if (!$this->params instanceof Registry) { $this->params = new Registry($this->params); } } } /** * Method to initialize the module */ public function init() { require ModuleHelper::getLayoutPath('mod_' . $this->element, $this->params->get('layout', 'default')); } } PK �\�~_3 _3 Extension/Generic.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Extension; use Alledia\Framework\Factory; use JFormFieldCustomFooter; use Joomla\Registry\Registry; use SimpleXMLElement; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects class Generic { /** * The extension namespace * * @var string */ public $namespace = null; /** * The extension type * * @var string */ public $type = null; /** * The extension id * * @var int */ public $id = null; /** * The extension name * * @var string */ public $name = null; /** * The extension params * * @var Registry */ public $params = null; /** * The extension enable state * * @var bool */ protected $enabled; /** * The element of the extension * * @var string */ protected $element; /** * @var string */ protected $folder = null; /** * Base path * * @var string */ protected $basePath; /** * The manifest information * * @var object */ public $manifest = null; /** * The manifest information as SimpleXMLElement * * @var SimpleXMLElement */ public $manifestXml = null; /** * The config information * * @var SimpleXMLElement */ public $config = null; /** * Class constructor, set the extension type. * * @param string $namespace The element of the extension * @param string $type The type of extension * @param string $folder The folder for plugins (only) */ public function __construct($namespace, $type, $folder = '', $basePath = JPATH_SITE) { $this->type = $type; $this->element = strtolower($namespace); $this->folder = $folder; $this->basePath = rtrim($basePath, '/\\'); $this->namespace = $namespace; $this->getManifest(); $this->getDataFromDatabase(); } /** * Get information about this extension from the database * * @return void */ protected function getDataFromDatabase() { $element = $this->getElementToDb(); // Load the extension info from database $db = Factory::getDatabase(); $query = $db->getQuery(true) ->select([ $db->quoteName('extension_id'), $db->quoteName('name'), $db->quoteName('enabled'), $db->quoteName('params'), ]) ->from('#__extensions') ->where($db->quoteName('type') . ' = ' . $db->quote($this->type)) ->where($db->quoteName('element') . ' = ' . $db->quote($element)); if ($this->type === 'plugin') { $query->where($db->quoteName('folder') . ' = ' . $db->quote($this->folder)); } $db->setQuery($query); $row = $db->loadObject(); if (is_object($row)) { $this->id = $row->extension_id; $this->name = $row->name; $this->enabled = (bool)$row->enabled; $this->params = new Registry($row->params); } else { $this->id = null; $this->name = null; $this->enabled = false; $this->params = new Registry(); } } /** * Check if the extension is enabled * * @return bool */ public function isEnabled() { return $this->enabled; } /** * Get the path for the extension * * @return string The path */ public function getExtensionPath() { $folders = [ 'component' => 'administrator/components/', 'plugin' => 'plugins/', 'template' => 'templates/', 'library' => 'libraries/', 'cli' => 'cli/', 'module' => 'modules/', ]; $basePath = $this->basePath . '/' . $folders[$this->type]; switch ($this->type) { case 'plugin': $basePath .= $this->folder . '/'; break; case 'module': if (!preg_match('/^mod_/', $this->element)) { $basePath .= 'mod_'; } break; case 'component': if (!preg_match('/^com_/', $this->element)) { $basePath .= 'com_'; } break; } $basePath .= $this->element; return $basePath; } /** * Get the full element * * @return string The full element */ public function getFullElement() { return Helper::getFullElementFromInfo($this->type, $this->element, $this->folder); } /** * Get the element to match the database records. * Only components and modules have the prefix. * * @return string The element */ public function getElementToDb() { $prefixes = [ 'component' => 'com_', 'module' => 'mod_', ]; $fullElement = ''; if (array_key_exists($this->type, $prefixes)) { if (!preg_match('/^' . $prefixes[$this->type] . '/', $this->element)) { $fullElement = $prefixes[$this->type]; } } $fullElement .= $this->element; return $fullElement; } /** * Get manifest path for this extension * * @return string */ public function getManifestPath() { $extensionPath = $this->getExtensionPath(); // Templates or extension? if ($this->type === 'template') { $fileName = 'templateDetails.xml'; } else { $fileName = $this->element . '.xml'; } $path = $extensionPath . "/{$fileName}"; if (!is_file($path)) { $path = $extensionPath . "/{$this->getElementToDb()}.xml"; } return $path; } /** * Get extension manifest as SimpleXMLElement * * @param bool $force If true, force to load the manifest, ignoring the cached one * * @return SimpleXMLElement */ public function getManifestAsSimpleXML($force = false) { if (!isset($this->manifestXml) || $force) { $path = $this->getManifestPath(); if (is_file($path)) { $this->manifestXml = simplexml_load_file($path); } else { $this->manifestXml = false; } } return $this->manifestXml; } /** * Get extension information * * @param bool $force If true, force to load the manifest, ignoring the cached one * * @return object */ public function getManifest($force = false) { if (!isset($this->manifest) || $force) { $xml = $this->getManifestAsSimpleXML($force); if (!empty($xml)) { $this->manifest = (object)json_decode(json_encode($xml)); } else { $this->manifest = false; } } return $this->manifest; } /** * Get extension config file * * @param bool $force Force to reload the config file * * @return SimpleXMLElement */ public function getConfig($force = false) { if (!isset($this->config) || $force) { $this->config = null; $path = $this->getExtensionPath() . '/config.xml'; if (file_exists($path)) { $this->config = simplexml_load_file($path); } } return $this->config; } /** * Returns the update URL from database * * @return string */ public function getUpdateURL() { $db = Factory::getDatabase(); $query = $db->getQuery(true) ->select('sites.location') ->from('#__update_sites AS sites') ->leftJoin('#__update_sites_extensions AS extensions ON (sites.update_site_id = extensions.update_site_id)') ->where('extensions.extension_id = ' . $this->id); return $db->setQuery($query)->loadResult(); } /** * Set the update URL * * @param string $url */ public function setUpdateURL($url) { $db = Factory::getDatabase(); // Get the update site id $join = $db->quoteName('#__update_sites_extensions') . ' AS extensions ' . 'ON (sites.update_site_id = extensions.update_site_id)'; $query = $db->getQuery(true) ->select('sites.update_site_id') ->from($db->quoteName('#__update_sites') . ' AS sites') ->leftJoin($join) ->where('extensions.extension_id = ' . $this->id); $siteId = (int)$db->setQuery($query)->loadResult(); if (!empty($siteId)) { $query = $db->getQuery(true) ->update($db->quoteName('#__update_sites')) ->set($db->quoteName('location') . ' = ' . $db->quote($url)) ->where($db->quoteName('update_site_id') . ' = ' . $siteId); $db->setQuery($query)->execute(); } } /** * Store the params on the database * * @return void */ public function storeParams() { $db = Factory::getDatabase(); $updateObject = (object)[ 'params' => $this->params->toString(), 'extension_id' => $this->id, ]; $db->updateObject('#__extensions', $updateObject, ['extension_id']); } /** * Get extension name * * @return string */ public function getName() { return $this->name; } /** * Get extension id * * @return int */ public function getId() { return (int)$this->id; } /** * @return string * @throws \Throwable */ public function getFooterMarkup() { $manifest = $this->getManifestAsSimpleXML(); if ($manifest->alledia) { $configPath = $this->getExtensionPath() . '/config.xml'; if (is_file($configPath)) { $config = $this->getConfig(); if (is_object($config)) { $footerElement = $config->xpath('//field[@type="customfooter"]'); $footerElement = reset($footerElement); } } if (empty($footerElement)) { if (is_object($manifest)) { if ($footerElement = $manifest->xpath('//field[@type="customfooter"]')) { $footerElement = reset($footerElement); } elseif ($media = (string)$manifest->media['destination']) { $customField = sprintf( '<field type="customfooter" name="customfooter" media="%s"/>', $media ); $footerElement = new SimpleXMLElement($customField); } } } if (empty($footerElement) == false) { if (class_exists('JFormFieldCustomFooter') === false) { $classPath = $this->getExtensionPath() . '/form/fields/customfooter.php'; if (is_file($classPath)) { require_once $classPath; } } if (class_exists('JFormFieldCustomFooter')) { $field = new JFormFieldCustomFooter(); $field->fromInstaller = true; return $field->getInputUsingCustomElement($footerElement); } } } return ''; } /** * Returns the extension's version collected from the manifest file * * @return string The extension's version */ public function getVersion() { if (!empty($this->manifest->version)) { return $this->manifest->version; } return null; } } PK �\��\} } Extension/Licensed.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Extension; use Alledia\Framework\AutoLoader; defined('_JEXEC') or die(); /** * Licensed class, for extensions with Free and Pro versions */ class Licensed extends Generic { /** * License type: free or pro * * @var string */ protected $license = null; /** * The path for the pro library * * @var string */ protected $proLibraryPath = null; /** * The path for the free library * * @var string */ protected $libraryPath = null; /** * @inheritDoc */ public function __construct($namespace, $type, $folder = '', $basePath = JPATH_SITE) { parent::__construct($namespace, $type, $folder, $basePath); $this->license = strtolower($this->manifest->alledia->license ?? ''); $this->namespace = $this->manifest->alledia->namespace ?? ''; $this->getLibraryPath(); $this->getProLibraryPath(); } /** * Check if the license is pro * * @return bool */ public function isPro(): bool { return $this->license === 'pro'; } /** * Check if the license is free * * @return bool */ public function isFree(): bool { return !$this->isPro(); } /** * Get the include path for the free library, based on the extension type * * @return string The path for pro */ public function getLibraryPath() { if ($this->libraryPath === null) { $basePath = $this->getExtensionPath(); $this->libraryPath = $basePath . '/library'; } return $this->libraryPath; } /** * Get the include path the pro library, based on the extension type * * @return string The path for pro */ public function getProLibraryPath() { if (empty($this->proLibraryPath)) { $basePath = $this->getLibraryPath(); $this->proLibraryPath = $basePath . '/Pro'; } return $this->proLibraryPath; } /** * Loads the library, if existent (including the Pro Library) * * @return bool */ public function loadLibrary() { if ($this->namespace) { $libraryPath = $this->getLibraryPath(); if (is_dir($libraryPath)) { AutoLoader::register('Alledia\\' . $this->namespace, $libraryPath); return true; } } return false; } } PK �\��v*� � Extension/Component.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Extension; defined('_JEXEC') or die(); use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; class Component extends Licensed { /** * @var BaseController */ protected $controller; /** * @inheritDoc */ public function __construct($namespace) { parent::__construct($namespace, 'component'); $this->loadLibrary(); } /** * Load the main controller * * @return void * @throws \Exception */ public function loadController() { if (!isset($this->controller)) { jimport('legacy.controller.legacy'); $this->controller = BaseController::getInstance($this->namespace); } } /** * @return void * @throws \Exception */ public function executeTask() { $task = Factory::getApplication()->input->getCmd('task'); $this->controller->execute($task); $this->controller->redirect(); } } PK �\}��4 4 Extension/Helper.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Extension; use Alledia\Framework\Factory; defined('_JEXEC') or die(); /** * Generic extension helper class */ abstract class Helper { /** * @var array[] */ protected static $extensionInfo = []; protected static $extensionTypes = [ 'com' => 'component', 'plg' => 'plugin', 'mod' => 'module', 'lib' => 'library', 'tpl' => 'template', 'cli' => 'cli' ]; /** * Build a string representing the element * * @param string $type * @param string $element * @param string $folder * * @return string */ public static function getFullElementFromInfo($type, $element, $folder = null) { $prefix = array_search($type, static::$extensionTypes); if ($prefix) { if (strpos($element, $prefix) === 0) { $shortElement = substr($element, strlen($prefix) + 1); } $parts = [ $prefix, $type == 'plugin' ? $folder : null, $shortElement ?? $element ]; return join('_', array_filter($parts)); } return null; } /** * @param ?string $element * * @return ?array */ public static function getExtensionInfoFromElement(?string $element): ?array { if (isset(static::$extensionInfo[$element]) == false) { static::$extensionInfo[$element] = false; $parts = explode('_', $element, 3); if (count($parts) > 1) { $prefix = $parts[0]; $name = $parts[2] ?? $parts[1]; $group = empty($parts[2]) ? null : $parts[1]; $types = [ 'com' => 'component', 'plg' => 'plugin', 'mod' => 'module', 'lib' => 'library', 'tpl' => 'template', 'cli' => 'cli' ]; if (array_key_exists($prefix, $types)) { $result = [ 'prefix' => $prefix, 'type' => $types[$prefix], 'name' => $name, 'group' => $group, 'namespace' => preg_replace_callback( '/^(os[a-z])(.*)/i', function ($matches) { return strtoupper($matches[1]) . $matches[2]; }, $name ) ]; } static::$extensionInfo[$element] = $result; } } return static::$extensionInfo[$element] ?: null; } /** * @param string $element * * @return bool */ public static function loadLibrary($element) { $extension = static::getExtensionForElement($element); if (is_object($extension)) { return $extension->loadLibrary(); } return false; } /** * @param string $element * * @return string */ public static function getFooterMarkup($element) { if (is_string($element)) { $extension = static::getExtensionForElement($element); } elseif (is_object($element)) { $extension = $element; } if (!empty($extension)) { return $extension->getFooterMarkup(); } return ''; } /** * @param string $element * * @return Licensed */ public static function getExtensionForElement($element) { $info = static::getExtensionInfoFromElement($element); if (!empty($info['type']) && !empty($info['namespace'])) { return Factory::getExtension($info['namespace'], $info['type'], $info['group']); } return null; } } PK �\��$� � Toolbar/ToolbarHelper.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2022-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Toolbar; use Alledia\Framework\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Utility\Utility; use Joomla\CMS\Version; defined('_JEXEC') or die(); abstract class ToolbarHelper extends \Joomla\CMS\Toolbar\ToolbarHelper { /** * @var bool */ protected static $exportLoaded = false; /** * Create a button that links to an external page * * @param string $url * @param string $title * @param ?string $icon * @param ?mixed $attributes * * @return void */ public static function externalLink(string $url, string $title, ?string $icon = null, $attributes = []) { if (is_string($attributes)) { $attributes = Utility::parseAttributes($attributes); } $icon = $icon ?: 'link'; $attributes['target'] = $attributes['target'] ?? '_blank'; $attributes['class'] = join( ' ', array_filter( array_merge( explode(' ', $attributes['class'] ?? ''), [ 'btn', 'btn-small' ] ) ) ); $button = HTMLHelper::_( 'link', $url, sprintf('<span class="icon-%s"></span> %s', $icon, $title), $attributes ); if (Version::MAJOR_VERSION > 3) { $button = sprintf('<joomla-toolbar-button>%s</joomla-toolbar-button>', $button); } $bar = Toolbar::getInstance(); $bar->appendButton('Custom', $button, $icon); } /** * Create a button that links to documentation * * @param string $url * @param string $title * * @return void */ public static function shackDocumentation(string $url, string $title) { static::externalLink($url, $title, 'support', ['class' => 'btn-info', 'target' => 'shackdocs']); } /** * Export button that ensures the task input field is cleared if * the export does not return to refresh the page * * @param string $task * @param string $alt * @param string $icon * * @return void * @throws \Exception */ public static function exportView(string $task, string $alt, string $icon = 'download') { static::custom($task, $icon, null, $alt, false); if (static::$exportLoaded == false) { Factory::getApplication()->getDocument()->addScriptDeclaration(<<<JSCRIPT Joomla.submitbutton = function(task) { Joomla.submitform(task); let taskInput = document.querySelector('input[name="task"]'); if (taskInput) { taskInput.value = ''; } }; JSCRIPT ); static::$exportLoaded = true; } } } PK �\�-�J� � Model/AbstractListModel.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2025 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Model; // phpcs:disable PSR1.Files.SideEffects use Joomla\CMS\MVC\Model\ListModel; defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects abstract class AbstractListModel extends ListModel { use TraitModel; } PK �\f��1� � # Model/AbstractBaseDatabaseModel.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2025 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Model; use Joomla\CMS\MVC\Model\BaseDatabaseModel; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects abstract class AbstractBaseDatabaseModel extends BaseDatabaseModel { use TraitModel; } PK �\�A�d� � Model/AbstractAdminModel.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2025 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Model; use Joomla\CMS\MVC\Model\AdminModel; use Joomla\CMS\Object\CMSObject; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects abstract class AbstractAdminModel extends AdminModel { use TraitModel; /** * @inheritDoc */ public function getItem($pk = null) { $item = parent::getItem($pk); if ($item instanceof CMSObject) { $item = (new Registry($item->getProperties()))->toObject(); } return $item; } } PK �\\�;p" " Model/TraitModel.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2017-2025 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Model; use Alledia\Framework\Factory; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\User\User; use Joomla\Database\DatabaseInterface; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects trait TraitModel { /** * @var CMSApplication */ protected $app = null; /** * @var string[] */ protected $accessList = []; /** * @return void * @throws \Exception */ protected function setup() { $this->app = Factory::getApplication(); } /** * Create a where clause of OR conditions for a text search * across one or more fields. Optionally accepts a text * search like 'id: #' if $idField is specified * * @param string $text * @param string|string[] $fields * @param ?string $idField * * @return string */ public function whereTextSearch(string $text, $fields, ?string $idField = null): string { $text = trim($text); if ($idField && stripos($text, 'id:') === 0) { $id = (int)substr($text, 3); return $idField . ' = ' . $id; } if (is_string($fields)) { $fields = [$fields]; } $searchText = Factory::getDatabase()->quote('%' . $text . '%'); $ors = []; foreach ($fields as $field) { $ors[] = $field . ' LIKE ' . $searchText; } if (count($ors) > 1) { return sprintf('(%s)', join(' OR ', $ors)); } return array_pop($ors); } /** * Provide a generic access search for selected field * * @param string $field * @param ?User $user * * @return string */ public function whereAccess(string $field, ?User $user = null): string { $user = $user ?: Factory::getUser(); if ($user->authorise('core.manage') == false) { $userId = $user->id; if (isset($this->accessList[$userId]) == false) { $this->accessList[$userId] = join(', ', array_unique($user->getAuthorisedViewLevels())); } if ($this->accessList[$userId]) { return sprintf($field . ' IN (%s)', $this->accessList[$userId]); } } return 'TRUE'; } /** * @param string $source * @param string|string[] $relations * * @return void */ protected function garbageCollect(string $source, $relations) { $sourceParts = explode('.', $source); $sourceField = array_pop($sourceParts); $sourceTable = array_pop($sourceParts); if ($sourceTable && $sourceField) { $db = Factory::getDatabase(); if (is_string($relations)) { $relations = [$relations]; } foreach ($relations as $target) { $targetParts = explode('.', $target); $targetField = array_pop($targetParts); $targetTable = array_pop($targetParts); if ($targetTable && $targetField) { $query = $db->getQuery(true) ->delete($db->quoteName('#__oscampus_' . $targetTable)) ->where( sprintf( '%s NOT IN (SELECT %s FROM %s)', $db->quoteName($targetField), $db->quoteName($sourceField), $db->quoteName('#__oscampus_' . $sourceTable) ) ); } try { $db->setQuery($query)->execute(); } catch (\Throwable $error) { $this->app->enqueueMessage($error->getMessage() . '<br>' . $query, 'error'); } } } } /** * @return DatabaseInterface|\JDatabaseDriver */ public function getDbo() { if (method_exists($this, 'getDatabase')) { return $this->getDatabase(); } return parent::getDbo(); } } PK �\q��}� � TraitAllediaView.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla; use Alledia\Framework\Extension; use Alledia\Framework\Factory; use Alledia\Framework\Joomla\Extension\Helper as ExtensionHelper; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Version; use Joomla\Filesystem\Path; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects trait TraitAllediaView { /** * @var CMSApplication */ protected $app = null; /** * @var Extension */ protected $extension = null; /** * @var bool */ protected $initSuccess = null; /** * To be called before class constructor method by inheriting classes * * @return void */ protected function setup() { try { $this->app = Factory::getApplication(); $this->document = Factory::getDocument(); $this->option = $this->app->input->get('option'); $info = ExtensionHelper::getExtensionInfoFromElement($this->option); $this->extension = Factory::getExtension($info['namespace'], $info['type']); $this->extension->loadLibrary(); $this->initSuccess = true; } catch (\Throwable $error) { if ($this->app) { $this->app->enqueueMessage($error->getMessage(), 'error'); } else { echo '<p>' . $error->getMessage() . '</p>'; } $this->initSuccess = false; } } /** * Look for a valid layout file based on Joomla version * * @param string $layout * * @return string * @throws \Exception */ protected function getVersionedLayoutName(string $layout): string { if (is_callable([$this, '_createFileName'])) { $file = $layout; if (Version::MAJOR_VERSION < 4) { $file .= '.j' . Version::MAJOR_VERSION; } if ($file != $layout || $file == 'emptystate') { // Verify layout file exists $fileName = $this->_createFileName('template', ['name' => $file]); $path = Path::find($this->_path['template'], $fileName); if ($path) { $layout = $file; } else { $layout = ($file == 'emptystate') ? 'default' : $layout; } } return $layout; } throw new \Exception('TraitAllediaView must apply to a Joomla view', 500); } } PK �\��ZT T View/Admin/AbstractBase.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\View\Admin; use Alledia\Framework\Extension; use Alledia\Framework\Joomla\AbstractView; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects class AbstractBase extends AbstractView { /** * @inheritDoc * @throws \Throwable */ protected function displayFooter(?Extension $extension = null) { parent::displayFooter(); echo $this->displayAdminFooter($extension); } /** * @param ?Extension $extension * * @return string * @throws \Throwable */ protected function displayAdminFooter(?Extension $extension = null): string { $extension = $extension ?: ($this->extension ?? null); if ($extension) { $output = $extension->getFooterMarkup(); if (empty($output)) { // Use alternative if no custom footer field $layoutPath = $extension->getExtensionPath() . '/views/footer/tmpl/default.php'; if (is_file($layoutPath) == false) { $layoutPath = $extension->getExtensionPath() . '/alledia_views/footer/tmpl/default.php'; } if (is_file($layoutPath)) { ob_start(); include $layoutPath; $output = ob_get_contents(); ob_end_clean(); } } } return $output ?? ''; } /** * @inheritDoc * @throws \Exception */ public function setLayout($layout) { $layout = $this->getVersionedLayoutName($layout); return parent::setLayout($layout); } } PK �\���� View/Admin/AbstractForm.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\View\Admin; use Joomla\CMS\Form\Form; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\MVC\Model\AdminModel; use Joomla\CMS\Version; defined('_JEXEC') or die(); class AbstractForm extends AbstractBase { /** * @var Form */ protected $form = null; /** * @var bool */ protected $useCoreUI = true; /** * @inheritDoc */ protected function setup() { parent::setup(); if (Version::MAJOR_VERSION < 4) { HTMLHelper::_('behavior.tabstate'); } } /** * @inheritDoc * */ public function setModel($model, $default = false) { $model = parent::setModel($model, $default); if ($model instanceof AdminModel && $default) { $this->form = $model->getForm(); } return $model; } } PK �\�y� � View/Admin/AbstractList.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\View\Admin; defined('_JEXEC') or die(); use Joomla\CMS\Form\Form; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Pagination\Pagination; use Joomla\CMS\Version; abstract class AbstractList extends AbstractBase { /** * @var object[] */ protected $items = null; /** * @var string */ protected $sidebar = null; /** * @var Pagination */ protected $pagination = null; /** * @var Form */ public $filterForm = null; /** * @var string[] */ public $activeFilters = null; /** * @var bool */ protected $isEmptyState = null; public function display($tpl = null) { // Add default admin CSS HTMLHelper::_('stylesheet', $this->option . '/admin-default.css', ['relative' => true]); if ( Version::MAJOR_VERSION > 3 && empty($this->items) && ($this->isEmptyState = $this->get('IsEmptyState')) ) { $this->setLayout('emptystate'); } parent::display($tpl); } } PK �\�k�R� � View/Site/AbstractBase.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\View\Site; use Alledia\Framework\Joomla\AbstractView; use Joomla\Registry\Registry; defined('_JEXEC') or die(); class AbstractBase extends AbstractView { /** * @var Registry */ protected $params = null; /** * @inheritDoc */ public function setModel($model, $default = false) { $model = parent::setModel($model, $default); $this->setParams(); return $model; } /** * @return void */ protected function setParams() { $this->params = new Registry(); // Load component parameters first $this->params->merge($this->extension->params); if ($activeMenu = $this->app->getMenu()->getActive()) { // We're on a menu - add/override its parameters $this->params->merge($activeMenu->getParams()); $this->params->def('page_heading', $this->params->get('page_title') ?: $activeMenu->title); } } } PK �\����z z View/Site/AbstractList.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\View\Site; defined('_JEXEC') or die(); use Joomla\CMS\Form\Form; use Joomla\CMS\Pagination\Pagination; abstract class AbstractList extends AbstractBase { /** * @var object[] */ protected $items = null; /** * @var Pagination */ protected $pagination = null; /** * @var Form */ public $filterForm = null; /** * @var string[] */ public $activeFilters = null; } PK �\��wK K Controller/AbstractJson.phpnu �[��� <?php /** * @package OSCampus * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2015-2023 Joomlashack.com. All rights reserved * @license http://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of OSCampus. * * OSCampus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * OSCampus is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OSCampus. If not, see <http://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Joomla\CMS\Language\Text; use Joomla\CMS\Response\JsonResponse; // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects.FoundWithSymbols abstract class AbstractJson extends AbstractBase { /** * @inheritDoc * @throws \Exception` */ public function checkToken($method = 'post', $redirect = false) { $valid = parent::checkToken($method, $redirect); if (!$valid) { throw new \Exception(Text::_('JINVALID_TOKEN'), 403); } return true; } /** * Sends a json package to output. All php processing ended to prevent any * plugin processing that might slow things down or waste memory. * * @param ?string|\Throwable $message * * @return void */ protected function returnJson($message = null) { $result = new JsonResponse(); if ($message) { if ($message instanceof \Throwable) { $result->success = false; $result->message = $message->getMessage(); $result->data = [ 'file' => $message->getFile(), 'line' => $message->getLine(), ]; } else { $result->message = $message; } } header('Content-Type: application/json'); echo $result; jexit(); } } PK �\9��"� � Controller/AbstractAdmin.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\Input\Input; // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects.FoundWithSymbols abstract class AbstractAdmin extends AdminController { use TraitController; /** * @inheritDoc */ public function __construct( $config = [], MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null ) { parent::__construct($config, $factory, $app, $input); $this->customInit(); } } PK �\� \� � Controller/Json.phpnu �[��� <?php /** * @package OSCampus * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2015-2023 Joomlashack.com. All rights reserved * @license http://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of OSCampus. * * OSCampus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * OSCampus is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OSCampus. If not, see <http://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Joomla\CMS\Language\Text; use Joomla\CMS\Response\JsonResponse; defined('_JEXEC') or die(); /** * @deprecated v3.8.1 */ abstract class Json extends Base { /** * @inheritDoc * @throws \Exception` */ public function checkToken($method = 'post', $redirect = false) { $valid = parent::checkToken($method, $redirect); if (!$valid) { throw new \Exception(Text::_('JINVALID_TOKEN'), 403); } return true; } /** * Sends a json package to output. All php processing ended to prevent any * plugin processing that might slow things down or waste memory. * * @param ?string|\Throwable $message * * @return void */ protected function returnJson($message = null) { $result = new JsonResponse(); if ($message) { if ($message instanceof \Throwable) { $result->success = false; $result->message = $message->getMessage(); $result->data = [ 'file' => $message->getFile(), 'line' => $message->getLine() ]; } else { $result->message = $message; } } header('Content-Type: application/json'); echo $result; jexit(); } } PK �\]m� � Controller/TraitController.phpnu �[��� <?php /** * @package OSCampus * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of OSCampus. * * OSCampus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * OSCampus is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OSCampus. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Alledia\Framework\Factory; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; use Joomla\String\Inflector; defined('_JEXEC') or die(); trait TraitController { /** * For consistency between Joomla 3 & 4 * * @var CMSApplication * @since Joomla v4 */ protected $app = null; /** * Standard return to calling url. In order: * - Looks for base64 encoded 'return' URL variable * - Uses current 'Itemid' URL variable * - Uses current 'option', 'view', 'layout' URL variables * - Goes to site default page * * @param ?array|string $message The message to queue up * @param ?string $type message|notice|error * @param ?string $return (optional) base64 encoded url for redirect * * @return void */ protected function callerReturn($message = null, ?string $type = null, ?string $return = null) { $url = $return ?: $this->app->input->getBase64('return'); if ($url) { $url = base64_decode($url); } else { $url = new Uri('index.php'); if ($itemId = $this->app->input->getInt('Itemid')) { $url->setVar('Itemid', $itemId); } elseif ($option = $this->app->input->getCmd('option')) { $url->setVar('option', $option); } if ($view = $this->app->input->getCmd('view')) { $url->setVar('view', $view); if ($layout = $this->app->input->getCmd('layout')) { $url->setVar('layout', $layout); } } } if (is_array($message)) { $message = join('<br>', $message); } $this->setRedirect(Route::_((string)$url), $message, $type); } /** * Return to referrer if internal, home page if external * * @param string $message * @param string $type * * @return void */ protected function errorReturn(string $message, string $type = 'error') { $referrer = $this->input->server->getString('HTTP_REFERER'); if (Uri::isInternal($referrer) == false) { $referrer = 'index.php'; } $this->app->enqueueMessage($message, $type); $this->app->redirect($referrer); } /** * Provide consistency between Joomla 3/Joomla 4 among other possibilities * * @return void */ protected function customInit() { if (empty($this->app)) { $this->app = Factory::getApplication(); } } /** * @return Inflector */ protected function getStringInflector(): Inflector { return Inflector::getInstance(); } } PK �\}��>� � Controller/AbstractForm.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\MVC\Controller\FormController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\Router\Route; use Joomla\Input\Input; // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects.FoundWithSymbols abstract class AbstractForm extends FormController { use TraitController; /** * @inheritDoc */ public function __construct( $config = [], MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null ) { parent::__construct($config, $factory, $app, $input); $this->customInit(); } /** * @inheritDoc * @throws \Exception */ public function batch($model = null) { $this->checkToken(); $inflector = $this->getStringInflector(); $view = $this->app->input->getCmd('view', $this->default_view); if ($inflector->isPlural($view)) { $modelName = $inflector->toSingular($view); $model = $this->getModel($modelName, '', []); $linkQuery = http_build_query([ 'option' => $this->app->input->getCmd('option'), 'view' => $view, ]); $this->setRedirect(Route::_('index.php?' . $linkQuery . $this->getRedirectToListAppend(), false)); return parent::batch($model); } return null; } } PK �\�@�d� � Controller/Admin.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\Input\Input; defined('_JEXEC') or die(); /** * @deprecated v3.8.1 */ class Admin extends AbstractAdmin { use TraitController; /** * @inheritDoc */ public function __construct( $config = [], MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null ) { parent::__construct($config, $factory, $app, $input); $this->customInit(); } } PK �\��I� � Controller/AbstractBase.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols defined('_JEXEC') or die(); // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols abstract class AbstractBase extends BaseController { use TraitController; /** * @inheritDoc */ public function __construct($config = [], MVCFactoryInterface $factory = null) { parent::__construct($config, $factory); $this->customInit(); } } PK �\UX�� Controller/Form.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\Router\Route; use Joomla\Input\Input; defined('_JEXEC') or die(); /** * @deprecated v3.8.1 */ class Form extends AbstractForm { use TraitController; /** * @inheritDoc */ public function __construct( $config = [], MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null ) { parent::__construct($config, $factory, $app, $input); $this->customInit(); } /** * @inheritDoc * @throws \Exception */ public function batch($model = null) { $this->checkToken(); $inflector = $this->getStringInflector(); $view = $this->app->input->getCmd('view', $this->default_view); if ($inflector->isPlural($view)) { $modelName = $inflector->toSingular($view); $model = $this->getModel($modelName, '', []); $linkQuery = http_build_query([ 'option' => $this->app->input->getCmd('option'), 'view' => $view, ]); $this->setRedirect(Route::_('index.php?' . $linkQuery . $this->getRedirectToListAppend(), false)); return parent::batch($model); } return null; } } PK �\�h��z z Controller/Base.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Controller; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; defined('_JEXEC') or die(); /** * @deprecated v3.8.1 */ class Base extends AbstractBase { use TraitController; /** * @inheritDoc */ public function __construct($config = [], MVCFactoryInterface $factory = null) { parent::__construct($config, $factory); $this->customInit(); } } PK �\^�IB B Events/TraitObservable.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2022-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Events; use Alledia\Framework\Factory; use Joomla\Event\AbstractEvent; use Joomla\Event\Dispatcher; defined('_JEXEC') or die(); trait TraitObservable { /** * @var \JEventDispatcher|Dispatcher */ protected static $coreDispatcher = null; /** * @var bool */ protected static $legacyDispatch = null; /** * @return \JEventDispatcher|Dispatcher */ public function getDispatcher() { if (static::$coreDispatcher === null) { static::$coreDispatcher = Factory::getDispatcher(); static::$legacyDispatch = is_callable([static::$coreDispatcher, 'register']); } return static::$coreDispatcher; } /** * $events is accepted in these forms: * * ['handler1', 'handler2',...]: array of specific methods to register * 'handler' : a single method to register * 'prefix*' : all public methods in $observable that begin with 'prefix' * '*string' : all public methods in $observable that contain 'string' * * @param string|string[] $events * @param ?object $observable * @param ?bool $legacyListeners * * @return void */ public function registerEvents($events, object $observable = null, bool $legacyListeners = true): void { $observable = $observable ?: $this; if (is_string($events) && strpos($events, '*') !== false) { $startsWith = strpos($events, '*') !== 0; $event = preg_replace('/[^a-z\d_]/i', '', $events); // Look for methods that match the wildcarded name $observableInfo = new \ReflectionClass($observable); $methods = $observableInfo->getMethods(\ReflectionMethod::IS_PUBLIC); $events = []; foreach ($methods as $method) { $position = strpos($method->name, $event); if ( ($startsWith && $position === 0) || ($startsWith == false && $position > 0) ) { $events[] = $method->name; } } } elseif (is_string($events)) { $events = [$events]; } if ($events && is_array($events)) { $dispatcher = Factory::getDispatcher(); foreach ($events as $event) { $handler = [$observable, $event]; if (is_callable([$dispatcher, 'register'])) { $dispatcher->register($event, $handler); } elseif (is_callable([$dispatcher, 'addListener'])) { if ($legacyListeners) { $dispatcher->addListener($event, $this->createLegacyHandler($handler)); } else { $dispatcher->addListener($event, $handler); } } } } } /** * @param callable $handler * * @return callable */ final protected function createLegacyHandler(callable $handler): callable { return function (AbstractEvent $event) use ($handler) { $arguments = $event->getArguments(); // Extract any old results; they must not be part of the method call. $allResults = []; if (isset($arguments['result'])) { $allResults = $arguments['result']; unset($arguments['result']); } // Convert to indexed array for unpacking. $arguments = \array_values($arguments); $result = $handler(...$arguments); // Ignore null results if ($result === null) { return; } // Restore the old results and add the new result from our method call $allResults[] = $result; $event['result'] = $allResults; }; } } PK �\���1 1 AbstractTable.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2016-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla; use Alledia\Framework\Factory; use Joomla\CMS\Table\Table; use Joomla\CMS\Version; // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects.FoundWithSymbols abstract class AbstractTable extends Table { /** * Joomla version agnostic loading of other component tables * * @param string $component * @param string $name * @param string $prefix * * @return ?Table */ public static function getComponentInstance($component, $name, $prefix): ?Table { if (Version::MAJOR_VERSION < 4) { Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/' . $component . '/tables'); $table = Table::getInstance($name, $prefix); } else { try { $table = Factory::getApplication() ->bootComponent($component) ->getMVCFactory() ->createTable($name, 'Administrator'); } catch (\Throwable $error) { // Ignore } } return $table ?? null; } } PK �\��� � Form/Field/ListField.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Form\Field; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Version; // phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols defined('_JEXEC') or die(); if (Version::MAJOR_VERSION < 4) { FormHelper::loadFieldClass('List'); class_alias(\JFormFieldList::class, \Joomla\CMS\Form\Field\ListField::class); } // phpcs:enable PSR1.Files.SideEffects.FoundWithSymbols class ListField extends \Joomla\CMS\Form\Field\ListField { use TraitLayouts; /** * Set list field layout based on Joomla version */ public function setup(\SimpleXMLElement $element, $value, $group = null) { if (Version::MAJOR_VERSION >= 4) { $this->layout = 'joomla.form.field.list-fancy-select'; } return parent::setup($element, $value, $group); } } PK �\#�� � Form/Field/RadioField.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2025 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Form\Field; use Joomla\CMS\Form\FormHelper; use Joomla\CMS\Version; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); if (Version::MAJOR_VERSION < 4) { FormHelper::loadFieldClass('radio'); class_alias(\JFormFieldRadio::class, \Joomla\CMS\Form\Field\RadioField::class); } // phpcs:enable PSR1.Files.SideEffects // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace class RadioField extends \Joomla\CMS\Form\Field\RadioField { } PK �\�.�4� � Form/Field/TraitLayouts.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla\Form\Field; use Joomla\CMS\Version; use Joomla\Filesystem\Path; // phpcs:disable PSR1.Files.SideEffects defined('_JEXEC') or die(); // phpcs:enable PSR1.Files.SideEffects /** * Intended for use by form field classes to * implement Joomla version targeted layout files */ trait TraitLayouts { /** * @inheritDoc */ protected function getLayoutPaths() { if (is_callable(parent::class . '::getLayoutPaths')) { $paths = parent::getLayoutPaths(); $fieldClass = (new \ReflectionClass($this)); $baseDirectory = dirname($fieldClass->getFileName()); array_unshift($paths, $baseDirectory . '/layouts'); return $paths; } return []; } /** * @inheritDoc */ protected function getRenderer($layoutId = 'default') { if (is_callable(parent::class . '::getRenderer')) { $paths = $this->getLayoutPaths(); if (Version::MAJOR_VERSION < 4) { if (Path::find($paths, str_replace('.', '/', $layoutId) . '_j3.php')) { $layoutId .= '_j3'; } } $renderer = parent::getRenderer($layoutId); $renderer->setIncludePaths($paths); return $renderer; } return null; } } PK �\�}Pk k AbstractView.phpnu �[��� <?php /** * @package AllediaFramework * @contact www.joomlashack.com, help@joomlashack.com * @copyright 2021-2023 Joomlashack.com. All rights reserved * @license https://www.gnu.org/licenses/gpl.html GNU/GPL * * This file is part of AllediaFramework. * * AllediaFramework is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * AllediaFramework is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AllediaFramework. If not, see <https://www.gnu.org/licenses/>. */ namespace Alledia\Framework\Joomla; use Joomla\CMS\Form\Form; use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\CMS\MVC\View\HtmlView; use Joomla\CMS\Object\CMSObject; defined('_JEXEC') or die(); abstract class AbstractView extends HtmlView { use TraitAllediaView; /** * @var BaseDatabaseModel */ protected $model = null; /** * Formally declare this since Joomla core does not * * @var Form */ protected $form = null; /** * @var CMSObject */ protected $state = null; /** * @inheritDoc * @throws \Exception */ public function __construct($config = []) { $this->setup(); parent::__construct($config); } /** * @inheritDoc */ public function setModel($model, $default = false) { $model = parent::setModel($model, $default); if ($model && $default) { $this->model = $model; $this->state = $this->model->getState(); } return $model; } /** * @inheritDoc */ public function display($tpl = null) { if ($this->initSuccess) { $this->displayHeader(); parent::display($tpl); $this->displayFooter(); } } /** * For use by subclasses * * @return void */ protected function displayHeader() { // Display custom text } /** * For use by subclasses * * @return void */ protected function displayFooter() { // Display custom text } /** * @param string $name * @param string $layout * * @return string * @throws \Exception */ public function loadDefaultTemplate(string $name, ?string $layout = 'default'): string { $currentLayout = $this->setLayout($layout); $output = $this->loadTemplate($name); $this->setLayout($currentLayout); return $output; } } PK �\�8�w w Extension/AbstractPlugin.phpnu �[��� PK �\��8f f � Extension/AbstractComponent.phpnu �[��� PK �\�B> > $ x Extension/AbstractFlexibleModule.phpnu �[��� PK �\�~_3 _3 '