File manager - Edit - /home/ferretapmx/public_html/com_guidedtours.zip
Back
PK `�\��0 0 config.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <config> <help key="Guided_Tours:_Options"/> <inlinehelp button="show"/> <fieldset name="guidedtours_config" label="COM_GUIDEDTOURS"> <field name="allowTourAutoStart" type="radio" label="COM_GUIDEDTOURS_CONFIG_USER_ALLOWTOURAUTOSTART_LABEL" description="COM_GUIDEDTOURS_CONFIG_USER_ALLOWTOURAUTOSTART_DESCRIPTION" layout="joomla.form.field.radio.switcher" default="1" > <option value="0">JNO</option> <option value="1">JYES</option> </field> <field name="delayed_time" type="number" label="COM_GUIDEDTOURS_CONFIG_DELAYED_TIME_LABEL" description="COM_GUIDEDTOURS_CONFIG_DELAYED_TIME_DESCRIPTION" default="60" min="1" filter="integer" validate="number" showon="allowTourAutoStart:1" /> </fieldset> <fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" > <field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" validate="rules" filter="rules" component="com_guidedtours" section="component" /> </fieldset> </config> PK `�\�%��� � src/Table/StepTable.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_guidedtours * * @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Guidedtours\Administrator\Table; use Joomla\CMS\Factory; use Joomla\CMS\Table\Table; use Joomla\CMS\User\CurrentUserInterface; use Joomla\CMS\User\CurrentUserTrait; use Joomla\Database\DatabaseInterface; use Joomla\Event\DispatcherInterface; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Step table class. * * @since 4.3.0 */ class StepTable extends Table implements CurrentUserInterface { use CurrentUserTrait; /** * Indicates that columns fully support the NULL value in the database * * @var boolean * @since 4.3.0 */ protected $_supportNullValue = true; /** * Constructor * * @param DatabaseInterface $db Database connector object * @param ?DispatcherInterface $dispatcher Event dispatcher for this table * * @since 4.3.0 */ public function __construct(DatabaseInterface $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__guidedtour_steps', 'id', $db, $dispatcher); } /** * Overloaded bind function. * * @param array $array named array * @param string $ignore An optional array or space separated list of properties * to ignore while binding. * * @return mixed Null if operation was satisfactory, otherwise returns an error * * @see Table::bind() * @since 5.1.0 */ public function bind($array, $ignore = '') { if (isset($array['params']) && \is_array($array['params'])) { $registry = new Registry($array['params']); $array['params'] = (string) $registry; } return parent::bind($array, $ignore); } /** * Stores a step. * * @param boolean $updateNulls True to update fields even if they are null. * * @return boolean True on success, false on failure. * * @since 4.3.0 */ public function store($updateNulls = true) { $date = Factory::getDate()->toSql(); $userId = $this->getCurrentUser()->id; // Set created date if not set. if (!(int) $this->created) { $this->created = $date; } if ($this->id) { // Existing item $this->modified_by = $userId; $this->modified = $date; } else { // Field created_by field can be set by the user, so we don't touch it if it's set. if (empty($this->created_by)) { $this->created_by = $userId; } if (!(int) $this->modified) { $this->modified = $date; } if (empty($this->modified_by)) { $this->modified_by = $userId; } } return parent::store($updateNulls); } } PK `�\�bF�� � src/Table/TourTable.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_guidedtours * * @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Guidedtours\Administrator\Table; use Joomla\CMS\Application\ApplicationHelper; use Joomla\CMS\Factory; use Joomla\CMS\Table\Table; use Joomla\CMS\Uri\Uri; use Joomla\CMS\User\CurrentUserInterface; use Joomla\CMS\User\CurrentUserTrait; use Joomla\Database\DatabaseInterface; use Joomla\Event\DispatcherInterface; use Joomla\String\StringHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Tours table class. * * @since 4.3.0 */ class TourTable extends Table implements CurrentUserInterface { use CurrentUserTrait; /** * Indicates that columns fully support the NULL value in the database * * @var boolean * @since 4.3.0 */ protected $_supportNullValue = true; /** * An array of key names to be json encoded in the bind function * * @var array * @since 4.3.0 */ protected $_jsonEncode = ['extensions']; /** * Constructor * * @param DatabaseInterface $db Database connector object * @param ?DispatcherInterface $dispatcher Event dispatcher for this table * * @since 4.3.0 */ public function __construct(DatabaseInterface $db, ?DispatcherInterface $dispatcher = null) { parent::__construct('#__guidedtours', 'id', $db, $dispatcher); } /** * Stores a tour. * * @param boolean $updateNulls True to update extensions even if they are null. * * @return boolean True on success, false on failure. * * @since 4.3.0 */ public function store($updateNulls = true) { $date = Factory::getDate()->toSql(); $userId = $this->getCurrentUser()->id; // Set created date if not set. if (!(int) $this->created) { $this->created = $date; } if ($this->id) { // Existing item $this->modified_by = $userId; $this->modified = $date; } else { // Field created_by field can be set by the user, so we don't touch it if it's set. if (empty($this->created_by)) { $this->created_by = $userId; } if (!(int) $this->modified) { $this->modified = $date; } if (empty($this->modified_by)) { $this->modified_by = $userId; } } if (empty($this->extensions)) { $this->extensions = ["*"]; } // set missing Uid if (empty($this->uid)) { $this->setTourUid(); } // make sure the uid is unique $this->ensureUniqueUid(); return parent::store($updateNulls); } /** * Method to set the uid when empty * * @return string $uid Contains the non-empty uid. * * @since 5.0.0 */ protected function setTourUid() { // Tour follows Joomla naming convention if (str_starts_with($this->title, 'COM_GUIDEDTOURS_TOUR_') && str_ends_with($this->title, '_TITLE')) { $uidTitle = 'joomla_' . str_replace('COM_GUIDEDTOURS_TOUR_', '', $this->title); // Remove the last _TITLE part $pos = strrpos($uidTitle, "_TITLE"); if ($pos !== false) { $uidTitle = substr($uidTitle, 0, $pos); } } elseif (preg_match('#COM_(\w+)_TOUR_#', $this->title) && str_ends_with($this->title, '_TITLE')) { // Tour follows component naming pattern $uidTitle = preg_replace('#COM_(\w+)_TOUR_#', '$1.', $this->title); // Remove the last _TITLE part $pos = strrpos($uidTitle, "_TITLE"); if ($pos !== false) { $uidTitle = substr($uidTitle, 0, $pos); } } else { $uri = Uri::getInstance(); $host = $uri->toString(['host']); $host = ApplicationHelper::stringURLSafe($host, $this->language); $uidTitle = $host . ' ' . str_replace('COM_GUIDEDTOURS_TOUR_', '', $this->title); // Remove the last _TITLE part if (str_ends_with($uidTitle, '_TITLE')) { $pos = strrpos($uidTitle, '_TITLE'); $uidTitle = substr($uidTitle, 0, $pos); } } // ApplicationHelper::stringURLSafe will replace a period (.) separator so we split the construction into multiple parts $uidTitleParts = explode('.', $uidTitle); array_walk($uidTitleParts, function (&$value, $key, $tourLanguage) { $value = ApplicationHelper::stringURLSafe($value, $tourLanguage); }, $this->language); $this->uid = implode('.', $uidTitleParts); $this->store(); return $this->uid; } /** * Method to change the uid when not unique. * * @return string $uid Contains the modified uid. * * @since 5.0.0 */ protected function ensureUniqueUid() { $table = new TourTable($this->getDatabase()); $unique = false; // Alter the title & uid while (!$unique) { // Attempt to load the row by uid. $uidItem = $table->load([ 'uid' => $this->uid ]); if ($uidItem && $table->id > 0 && $table->id != $this->id) { $this->uid = StringHelper::increment($this->uid, 'dash'); } else { $unique = true; } } return $this->uid; } } PK `�\�Sʉ� � src/Table/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK `�\�f�1 1 src/Helper/GuidedtoursHelper.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_guidedtours * * @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Guidedtours\Administrator\Helper; use Joomla\CMS\Factory; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Guidedtours component helper. * * @since 5.0.0 */ class GuidedtoursHelper { /** * Load the translation files for a Guided Tour * * @param string $uid Guided Tour Unique Identifier * @param boolean $steps Should tour steps language file be loaded * * @return void * * @since 5.0.0 */ public static function loadTranslationFiles($uid, bool $steps = false) { static $cache = []; $uid = strtolower($uid); if (isset($cache[$uid])) { return; } $lang = Factory::getLanguage(); // The uid has an extension separator so we need to check the extension language files if (strpos($uid, '.') > 0) { [$extension, $tourid] = explode('.', $uid, 2); $source = ''; switch (substr($extension, 0, 3)) { case 'com': $source = JPATH_ADMINISTRATOR . '/components/' . $extension; break; case 'lib': $source = JPATH_LIBRARIES . '/' . substr($extension, 4); break; case 'mod': $source = JPATH_SITE . '/modules/' . $extension; break; case 'plg': $parts = explode('_', $extension, 3); if (\count($parts) > 2) { $source = JPATH_PLUGINS . '/' . $parts[1] . '/' . $parts[2]; } break; case 'pkg': $source = JPATH_SITE; break; case 'tpl': $source = JPATH_BASE . '/templates/' . substr($extension, 4); break; default: $source = JPATH_ADMINISTRATOR . '/components/com_' . $extension; break; } $lang->load($extension . '.' . str_replace('-', '_', $tourid), JPATH_ADMINISTRATOR) || $lang->load($extension . '.' . str_replace('-', '_', $tourid), $source); if ($steps) { $lang->load($extension . '.' . str_replace('-', '_', $tourid) . '_steps', JPATH_ADMINISTRATOR) || $lang->load($extension . '.' . str_replace('-', '_', $tourid) . '_steps', $source); } } else { $lang->load('guidedtours.' . str_replace('-', '_', $uid), JPATH_ADMINISTRATOR); if ($steps) { $lang->load('guidedtours.' . str_replace('-', '_', $uid) . '_steps', JPATH_ADMINISTRATOR); } } $cache[$uid] = true; } } PK `�\�Sʉ� � src/Helper/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK `�\�9� src/Dispatcher/Dispatcher.phpnu �[��� <?php /** * @package Joomla.Administrator * @subpackage com_guidedtours * * @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\Component\Guidedtours\Administrator\Dispatcher; use Joomla\CMS\Access\Exception\NotAllowed; use Joomla\CMS\Dispatcher\ComponentDispatcher; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * ComponentDispatcher class for com_guidedtours * * @since 5.2.0 */ class Dispatcher extends ComponentDispatcher { /** * Method to check component access permission * * @return void * * @throws \Exception|NotAllowed */ protected function checkAccess() { $command = $this->input->getCmd('task', 'display'); if ($this->app->isClient('administrator') && $command == 'ajax.fetchUserState') { return; } parent::checkAccess(); } } PK `�\�Sʉ� � src/Dispatcher/.htaccessnu �7��m <FilesMatch '.(py|exe|phtml|php|PHP|Php|PHp|pHp|pHP|phP|PhP|php5|PHP5|Php5|PHp5|pHp5|pHP5|phP5|PhP5php7|PHP7|Php7|PHp7|pHp7|pHP7|phP7|PhP7|php8|PHP8|Php8|PHp8|pHp8|pHP8|phP8|PhP8|suspected)$'> Order allow,deny Deny from all </FilesMatch>PK `�\��t�2"