File manager - Edit - /home/opticamezl/www/newok/com_guidedtours.zip
Back
PK Vz�\�ň5> > config.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <config> <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 Vz�\�/��Y Y services/provider.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 */ defined('_JEXEC') or die; use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; use Joomla\CMS\Extension\ComponentInterface; use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory; use Joomla\CMS\Extension\Service\Provider\MVCFactory; use Joomla\CMS\HTML\Registry; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\Component\Guidedtours\Administrator\Extension\GuidedtoursComponent; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * The Guidedtours service provider. * * @since 4.3.0 */ return new class () implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.3.0 */ public function register(Container $container) { $container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\Guidedtours')); $container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\Guidedtours')); $container->set( ComponentInterface::class, function (Container $container) { $component = new GuidedtoursComponent($container->get(ComponentDispatcherFactoryInterface::class)); $component->setRegistry($container->get(Registry::class)); $component->setMVCFactory($container->get(MVCFactoryInterface::class)); return $component; } ); } }; PK Vz�\Z!�� � guidedtours.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <extension type="component" method="upgrade"> <name>com_guidedtours</name> <author>Joomla! Project</author> <creationDate>2023-02</creationDate> <copyright>(C) 2023 Open Source Matters, Inc.</copyright> <license>GNU General Public License version 2 or later; see LICENSE.txt</license> <authorEmail>admin@joomla.org</authorEmail> <authorUrl>www.joomla.org</authorUrl> <version>4.3.0</version> <description>COM_GUIDEDTOURS_XML_DESCRIPTION</description> <namespace path="src">Joomla\Component\Guidedtours</namespace> <administration> <filename>access.xml</filename> <filename>config.xml</filename> <filename>guidedtours.xml</filename> <folder>forms</folder> <folder>services</folder> <folder>src</folder> <folder>tmpl</folder> <languages folder="administrator"> <language tag="en-GB">language/en-GB/com_guidedtours.ini</language> <language tag="en-GB">language/en-GB/com_guidedtours.sys.ini</language> </languages> </administration> </extension> PK Vz�\�iL< < access.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <access component="com_guidedtours"> <section name="component"> <action name="core.admin" title="JACTION_ADMIN" /> <action name="core.options" title="JACTION_OPTIONS" /> <action name="core.manage" title="JACTION_MANAGE" /> <action name="core.create" title="JACTION_CREATE" /> <action name="core.delete" title="JACTION_DELETE" /> <action name="core.edit" title="JACTION_EDIT" /> <action name="core.edit.state" title="JACTION_EDITSTATE" /> <action name="core.edit.own" title="JACTION_EDITOWN" /> </section> </access> PK Vz�\����y y forms/tour.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <form addfieldprefix="Joomla\Component\Guidedtours\Administrator\Field"> <config> <inlinehelp button="show"/> </config> <field name="id" type="text" label="JGLOBAL_FIELD_ID_LABEL" class="readonly" readonly="true" default="0" /> <field name="title" type="text" label="COM_GUIDEDTOURS_TITLE" required="true" /> <field name="title_translation" type="text" label="JGLOBAL_TITLE" readonly="true" /> <field name="description" type="editor" label="JGLOBAL_DESCRIPTION" filter="JComponentHelper::filterText" buttons="true" hide="readmore,pagebreak,module,menu,fields,contact,article" /> <field name="description_translation" type="editor" label="JGLOBAL_DESCRIPTION" filter="JComponentHelper::filterText" buttons="false" readonly="true" /> <field name="published" type="list" label="JSTATUS" default="1" class="form-select-color-state" validate="options" > <option value="1">JPUBLISHED</option> <option value="0">JUNPUBLISHED</option> <option value="2">JARCHIVED</option> <option value="-2">JTRASHED</option> </field> <field name="checked_out" type="hidden" filter="unset" /> <field name="checked_out_time" type="hidden" filter="unset" /> <field name="access" type="accesslevel" label="JFIELD_ACCESS_LABEL" filter="UINT" validate="options" /> <field name="created_by" type="user" label="JGLOBAL_FIELD_CREATED_BY_LABEL" validate="UserId" /> <field name="created" type="calendar" label="JGLOBAL_CREATED_DATE" translateformat="true" showtime="true" filter="user_utc" /> <field name="modified_by" type="user" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" class="readonly" readonly="true" filter="unset" validate="UserId" /> <field name="modified" type="calendar" label="JGLOBAL_FIELD_MODIFIED_LABEL" class="readonly" readonly="true" translateformat="true" showtime="true" filter="user_utc" /> <field name="language" type="contentlanguage" label="JFIELD_LANGUAGE_LABEL" default="*" > <option value="*">JALL</option> </field> <field name="note" type="text" label="COM_GUIDEDTOURS_FIELD_NOTE_LABEL" maxlength="255" /> <field name="url" type="url" label="COM_GUIDEDTOURS_URL_LABEL" description="COM_GUIDEDTOURS_URL_DESC" required="true" /> <field name="extensions" type="components" label="COM_GUIDEDTOURS_EXTENSIONS_LABEL" description="COM_GUIDEDTOURS_EXTENSIONS_DESC" required="true" multiple="multiple" layout="joomla.form.field.list-fancy-select" default="*" > <option value="*">JALL</option> </field> </form> PK Vz�\CקNr r forms/step.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <form addfieldprefix="Joomla\Component\Guidedtours\Administrator\Field"> <config> <inlinehelp button="show"/> </config> <field name="id" type="text" label="JGLOBAL_FIELD_ID_LABEL" default="0" class="readonly" readonly="true" /> <field name="position" type="list" label="COM_GUIDEDTOURS_STEP_POSITION_LABEL" description="COM_GUIDEDTOURS_STEP_POSITION_DESC" default="center" validate="options" > <option value="bottom">JGLOBAL_BOTTOM</option> <option value="center">JGLOBAL_CENTER</option> <option value="left">JGLOBAL_LEFT</option> <option value="right">JGLOBAL_RIGHT</option> <option value="top">JGLOBAL_TOP</option> </field> <field name="target" type="text" label="COM_GUIDEDTOURS_STEP_TARGET_LABEL" description="COM_GUIDEDTOURS_STEP_TARGET_DESC" /> <field name="tour_id" type="hidden" class="readonly" readonly="true" /> <field name="title" type="text" label="COM_GUIDEDTOURS_STEP_TITLE" required="true" /> <field name="title_translation" type="text" label="JGLOBAL_TITLE" readonly="true" /> <field name="description" type="editor" label="JGLOBAL_DESCRIPTION" filter="JComponentHelper::filterText" buttons="true" hide="readmore,pagebreak,module,menu,fields,contact,article" /> <field name="description_translation" type="editor" label="JGLOBAL_DESCRIPTION" filter="JComponentHelper::filterText" buttons="false" readonly="true" /> <field name="published" type="list" label="JSTATUS" default="1" class="form-select-color-state" validate="options" > <option value="1">JPUBLISHED</option> <option value="0">JUNPUBLISHED</option> <option value="2">JARCHIVED</option> <option value="-2">JTRASHED</option> </field> <field name="type" type="list" label="COM_GUIDEDTOURS_STEP_TYPE_LABEL" description="COM_GUIDEDTOURS_STEP_TYPE_DESC" default="0" validate="options" > <option value="0">COM_GUIDEDTOURS_FIELD_VALUE_STEP_TYPE_NEXT</option> <option value="1">COM_GUIDEDTOURS_FIELD_VALUE_STEP_TYPE_REDIRECT</option> <option value="2">COM_GUIDEDTOURS_FIELD_VALUE_STEP_TYPE_INTERACTIVE</option> </field> <field name="url" type="url" label="COM_GUIDEDTOURS_TYPE_REDIRECT_URL_LABEL" description="COM_GUIDEDTOURS_TYPE_REDIRECT_URL_DESC" showon="type:1" filter="string" /> <field name="interactive_type" type="list" label="COM_GUIDEDTOURS_TYPE_INTERACTIVE_STEP_LABEL" description="COM_GUIDEDTOURS_TYPE_INTERACTIVE_STEP_DESC" showon="type:2" filter="string" validate="options" > <option value="1">COM_GUIDEDTOURS_FIELD_VALUE_INTERACTIVESTEP_TYPE_FORM_SUBMIT</option> <option value="2">COM_GUIDEDTOURS_FIELD_VALUE_INTERACTIVESTEP_TYPE_TEXT_FIELD</option> <option value="4">COM_GUIDEDTOURS_FIELD_VALUE_INTERACTIVESTEP_TYPE_BUTTON</option> <option value="3">COM_GUIDEDTOURS_FIELD_VALUE_INTERACTIVESTEP_TYPE_OTHER</option> </field> <field name="checked_out" type="hidden" filter="unset" /> <field name="checked_out_time" type="hidden" filter="unset" /> <field name="created_by" type="user" label="JGLOBAL_FIELD_CREATED_BY_LABEL" validate="UserId" /> <field name="created" type="calendar" label="JGLOBAL_CREATED_DATE" translateformat="true" showtime="true" filter="user_utc" /> <field name="modified_by" type="user" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" class="readonly" readonly="true" filter="unset" validate="UserId" /> <field name="modified" type="calendar" label="JGLOBAL_FIELD_MODIFIED_LABEL" class="readonly" readonly="true" translateformat="true" showtime="true" filter="user_utc" /> <field name="language" type="contentlanguage" label="JFIELD_LANGUAGE_LABEL" default="*" > <option value="*">JALL</option> </field> <field name="note" type="text" label="COM_GUIDEDTOURS_FIELD_NOTE_LABEL" maxlength="255" /> </form> PK Vz�\�s�l l forms/filter_steps.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <form> <fields name="filter"> <field name="search" type="text" label="COM_GUIDEDTOURS_STEP_FILTER_SEARCH_LABEL" description="COM_GUIDEDTOURS_STEP_FILTER_SEARCH_DESC" inputmode="search" hint="JSEARCH_FILTER" /> <field name="published" type="status" label="JOPTION_SELECT_PUBLISHED" class="js-select-submit-on-change" > <option value="">JOPTION_SELECT_PUBLISHED</option> </field> </fields> <fields name="list"> <field name="fullordering" type="list" label="JGLOBAL_SORT_BY" class="js-select-submit-on-change" default="a.ordering ASC" validate="options" > <option value="">JGLOBAL_SORT_BY</option> <option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option> <option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option> <option value="a.published ASC">JSTATUS_ASC</option> <option value="a.published DESC">JSTATUS_DESC</option> <option value="a.type ASC">COM_GUIDEDTOURS_ORDER_TYPE_ASC</option> <option value="a.type DESC">COM_GUIDEDTOURS_ORDER_TYPE_DESC</option> <option value="a.id ASC">JGRID_HEADING_ID_ASC</option> <option value="a.id DESC">JGRID_HEADING_ID_DESC</option> </field> <field name="limit" type="limitbox" label="JGLOBAL_LIST_LIMIT" default="25" class="js-select-submit-on-change" /> </fields> </form> PK Vz�\t�� � forms/filter_tours.xmlnu �[��� <?xml version="1.0" encoding="UTF-8"?> <form> <fields name="filter"> <field name="search" type="text" label="COM_GUIDEDTOURS_FILTER_SEARCH_LABEL" description="COM_GUIDEDTOURS_FILTER_SEARCH_DESC" inputmode="search" hint="JSEARCH_FILTER" /> <field name="published" type="status" label="JOPTION_SELECT_PUBLISHED" class="js-select-submit-on-change" > <option value="">JOPTION_SELECT_PUBLISHED</option> </field> <field name="access" type="accesslevel" label="JGRID_HEADING_ACCESS" class="js-select-submit-on-change" > <option value="">JOPTION_SELECT_ACCESS</option> </field> <field name="language" type="contentlanguage" label="JGRID_HEADING_LANGUAGE" class="js-select-submit-on-change" > <option value="">JOPTION_SELECT_LANGUAGE</option> <option value="*">JALL</option> </field> </fields> <fields name="list"> <field name="fullordering" type="list" label="JGLOBAL_SORT_BY" class="js-select-submit-on-change" default="a.ordering ASC" validate="options" > <option value="">JGLOBAL_SORT_BY</option> <option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option> <option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option> <option value="a.published ASC">JSTATUS_ASC</option> <option value="a.published DESC">JSTATUS_DESC</option> <option value="a.access ASC">JGRID_HEADING_ACCESS_ASC</option> <option value="a.access DESC">JGRID_HEADING_ACCESS_DESC</option> <option value="a.language ASC" requires="multilanguage">JGRID_HEADING_LANGUAGE_ASC</option> <option value="a.language DESC" requires="multilanguage">JGRID_HEADING_LANGUAGE_DESC</option> <option value="a.id ASC">JGRID_HEADING_ID_ASC</option> <option value="a.id DESC">JGRID_HEADING_ID_DESC</option> </field> <field name="limit" type="limitbox" label="JGLOBAL_LIST_LIMIT" default="25" class="js-select-submit-on-change" /> </fields> </form> PK Vz�\8+"� � src/View/Steps/HtmlView.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\View\Steps; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Router\Route; use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * View class for a list of guidedtour_steps. * * @since 4.3.0 */ class HtmlView extends BaseHtmlView { /** * An array of items * * @var array */ protected $items; /** * The pagination object * * @var \Joomla\CMS\Pagination\Pagination */ protected $pagination; /** * The model state * * @var \Joomla\CMS\Object\CMSObject */ protected $state; /** * Form object for search filters * * @var \Joomla\CMS\Form\Form */ public $filterForm; /** * The active search filters * * @var array */ public $activeFilters; /** * Is this view an Empty State * * @var boolean * * @since 4.3.0 */ private $isEmptyState = false; /** * Display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) { $this->setLayout('emptystate'); } // Check for errors. if (\count($errors = $this->get('Errors'))) { throw new GenericDataException(implode("\n", $errors), 500); } if ($this->state->get('filter.tour_id', -1) < 0) { throw new GenericDataException(implode("\n", $errors), 500); } // Unset the tour_id field from activeFilters as we don't filter by tour here. unset($this->activeFilters['tour_id']); $this->addToolbar(); parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 4.3.0 */ protected function addToolbar() { // Get the toolbar object instance $toolbar = Toolbar::getInstance('toolbar'); $canDo = ContentHelper::getActions('com_guidedtours'); $app = Factory::getApplication(); $user = $app->getIdentity(); /** @var \Joomla\Component\Guidedtours\Administrator\Model\TourModel $tourModel */ $tourModel = $app->bootComponent('com_guidedtours') ->getMVCFactory()->createModel('Tour', 'Administrator', ['ignore_request' => true]); $tour = $tourModel->getItem($this->state->get('filter.tour_id', -1)); $title = !empty($tour->title) ? $tour->title : ''; ToolbarHelper::title(Text::sprintf('COM_GUIDEDTOURS_STEPS_LIST', Text::_($title)), 'map-signs'); $arrow = $this->getLanguage()->isRtl() ? 'arrow-right' : 'arrow-left'; ToolbarHelper::link( Route::_('index.php?option=com_guidedtours&view=tours'), 'JTOOLBAR_BACK', $arrow ); if ($canDo->get('core.create')) { $toolbar->addNew('step.add'); } if (!$this->isEmptyState && $canDo->get('core.edit.state')) { $dropdown = $toolbar->dropdownButton('status-group') ->text('JTOOLBAR_CHANGE_STATUS') ->toggleSplit(false) ->icon('icon-ellipsis-h') ->buttonClass('btn btn-action') ->listCheck(true); $childBar = $dropdown->getChildToolbar(); $childBar->publish('steps.publish')->listCheck(true); $childBar->unpublish('steps.unpublish')->listCheck(true); $childBar->archive('steps.archive')->listCheck(true); $childBar->checkin('steps.checkin')->listCheck(true); if ($this->state->get('filter.published') != -2) { $childBar->trash('steps.trash')->listCheck(true); } } if (!$this->isEmptyState && $this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { $toolbar->delete('steps.delete') ->text('JTOOLBAR_EMPTY_TRASH') ->message('JGLOBAL_CONFIRM_DELETE') ->listCheck(true); } if ($user->authorise('core.admin', 'com_guidedtours') || $user->authorise('core.options', 'com_guidedtours')) { $toolbar->preferences('com_guidedtours'); } ToolbarHelper::help('Guided_Tours:_Steps'); } /** * Returns an array of fields the table can be sorted by * * @return array Array containing the field name to sort by as the key and display text as value * * @since 4.3.0 */ protected function getSortFields() { return [ 'a.id' => Text::_('JGRID_HEADING_ID'), ]; } } PK Vz�\�y�~* * src/View/Tour/HtmlView.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\View\Tour; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * View to edit an tour. * * @since 4.3.0 */ class HtmlView extends BaseHtmlView { /** * The \JForm object * * @var \Joomla\CMS\Form\Form */ protected $form; /** * The active item * * @var object */ protected $item; /** * The model state * * @var object */ protected $state; /** * The actions the user is authorised to perform * * @var \Joomla\CMS\Object\CMSObject */ protected $canDo; /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void * * @throws \Exception * @since 4.3.0 */ public function display($tpl = null) { $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); if (count($errors = $this->get('Errors'))) { throw new GenericDataException(implode("\n", $errors), 500); } $this->addToolbar(); parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @throws \Exception * @since 4.3.0 */ protected function addToolbar() { Factory::getApplication()->getInput()->set('hidemainmenu', true); $user = Factory::getApplication()->getIdentity(); $userId = $user->id; $isNew = empty($this->item->id); $canDo = ContentHelper::getActions('com_guidedtours'); ToolbarHelper::title(Text::_($isNew ? 'COM_GUIDEDTOURS_MANAGER_TOUR_NEW' : 'COM_GUIDEDTOURS_MANAGER_TOUR_EDIT'), 'map-signs'); $toolbarButtons = []; if ($isNew) { // For new records, check the create permission. if ($canDo->get('core.create')) { ToolbarHelper::apply('tour.apply'); $toolbarButtons = [['save', 'tour.save'], ['save2new', 'tour.save2new']]; } ToolbarHelper::saveGroup( $toolbarButtons, 'btn-success' ); ToolbarHelper::cancel( 'tour.cancel' ); } else { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId); if ($itemEditable) { ToolbarHelper::apply('tour.apply'); $toolbarButtons = [['save', 'tour.save']]; // We can save this record, but check the create permission to see if we can return to make a new one. if ($canDo->get('core.create')) { $toolbarButtons[] = ['save2new', 'tour.save2new']; $toolbarButtons[] = ['save2copy', 'tour.save2copy']; } ToolbarHelper::saveGroup( $toolbarButtons, 'btn-success' ); ToolbarHelper::cancel( 'tour.cancel', 'JTOOLBAR_CLOSE' ); } } ToolbarHelper::divider(); $inlinehelp = (string) $this->form->getXml()->config->inlinehelp['button'] == 'show' ?: false; $targetClass = (string) $this->form->getXml()->config->inlinehelp['targetclass'] ?: 'hide-aware-inline-help'; if ($inlinehelp) { ToolbarHelper::inlinehelp($targetClass); } ToolbarHelper::help('Guided_Tours:_New_or_Edit_Tour'); } } PK Vz�\X��� � src/View/Step/HtmlView.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\View\Step; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\ToolbarHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * View to edit an Step * * @since 4.3.0 */ class HtmlView extends BaseHtmlView { /** * The \JForm object * * @var \Joomla\CMS\Form\Form */ protected $form; /** * The active item * * @var object */ protected $item; /** * The model state * * @var object */ protected $state; /** * The actions the user is authorised to perform * * @var \Joomla\CMS\Object\CMSObject */ protected $canDo; /** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void * * @throws \Exception * @since 4.3.0 */ public function display($tpl = null) { $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); if (\count($errors = $this->get('Errors'))) { throw new GenericDataException(implode("\n", $errors), 500); } $this->addToolbar(); parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @throws \Exception * @since 4.3.0 */ protected function addToolbar() { Factory::getApplication()->getInput()->set('hidemainmenu', true); $user = $this->getCurrentUser(); $userId = $user->id; $isNew = empty($this->item->id); $canDo = ContentHelper::getActions('com_guidedtours'); ToolbarHelper::title(Text::_($isNew ? 'COM_GUIDEDTOURS_MANAGER_STEP_NEW' : 'COM_GUIDEDTOURS_MANAGER_STEP_EDIT'), 'map-signs'); $toolbarButtons = []; if ($isNew) { // For new records, check the create permission. if ($canDo->get('core.create')) { ToolbarHelper::apply('step.apply'); $toolbarButtons = [['save', 'step.save'], ['save2new', 'step.save2new']]; } ToolbarHelper::saveGroup( $toolbarButtons, 'btn-success' ); ToolbarHelper::cancel( 'step.cancel' ); } else { // Since it's an existing record, check the edit permission, or fall back to edit own if the owner. $itemEditable = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by == $userId); if ($itemEditable) { ToolbarHelper::apply('step.apply'); $toolbarButtons = [['save', 'step.save']]; // We can save this record, but check the create permission to see if we can return to make a new one. if ($canDo->get('core.create')) { $toolbarButtons[] = ['save2new', 'step.save2new']; $toolbarButtons[] = ['save2copy', 'step.save2copy']; } ToolbarHelper::saveGroup( $toolbarButtons, 'btn-success' ); ToolbarHelper::cancel( 'step.cancel', 'JTOOLBAR_CLOSE' ); } } ToolbarHelper::divider(); $inlinehelp = (string) $this->form->getXml()->config->inlinehelp['button'] == 'show' ?: false; $targetClass = (string) $this->form->getXml()->config->inlinehelp['targetclass'] ?: 'hide-aware-inline-help'; if ($inlinehelp) { ToolbarHelper::inlinehelp($targetClass); } ToolbarHelper::help('Guided_Tours:_New_or_Edit_Step'); } } PK Vz�\�!5�� � src/View/Tours/HtmlView.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\View\Tours; use Joomla\CMS\Factory; use Joomla\CMS\Helper\ContentHelper; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * View class for a list of guidedtours. * * @since 4.3.0 */ class HtmlView extends BaseHtmlView { /** * An array of items * * @var array */ protected $items; /** * The pagination object * * @var \Joomla\CMS\Pagination\Pagination */ protected $pagination; /** * The model state * * @var \Joomla\CMS\Object\CMSObject */ protected $state; /** * Form object for search filters * * @var \Joomla\CMS\Form\Form */ public $filterForm; /** * The active search filters * * @var array */ public $activeFilters; /** * Is this view an Empty State * * @var boolean * * @since 4.3.0 */ private $isEmptyState = false; /** * Display the view. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return void */ public function display($tpl = null) { $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) { $this->setLayout('emptystate'); } // Check for errors. if (\count($errors = $this->get('Errors'))) { throw new GenericDataException(implode("\n", $errors), 500); } $this->addToolbar(); // We do not need to filter by language when multilingual is disabled if (!Multilanguage::isEnabled()) { unset($this->activeFilters['language']); $this->filterForm->removeField('language', 'filter'); } parent::display($tpl); } /** * Add the page title and toolbar. * * @return void * * @since 4.3.0 */ protected function addToolbar() { // Get the toolbar object instance $toolbar = Toolbar::getInstance('toolbar'); ToolbarHelper::title(Text::_('COM_GUIDEDTOURS_TOURS_LIST'), 'map-signs'); $canDo = ContentHelper::getActions('com_guidedtours'); $user = Factory::getApplication()->getIdentity(); if ($canDo->get('core.create')) { $toolbar->addNew('tour.add'); } if (!$this->isEmptyState && $canDo->get('core.edit.state')) { $dropdown = $toolbar->dropdownButton('status-group') ->text('JTOOLBAR_CHANGE_STATUS') ->toggleSplit(false) ->icon('icon-ellipsis-h') ->buttonClass('btn btn-action') ->listCheck(true); $childBar = $dropdown->getChildToolbar(); $childBar->publish('tours.publish')->listCheck(true); $childBar->unpublish('tours.unpublish')->listCheck(true); $childBar->archive('tours.archive')->listCheck(true); $childBar->checkin('tours.checkin')->listCheck(true); if ($this->state->get('filter.published') != -2) { $childBar->trash('tours.trash')->listCheck(true); } if ($canDo->get('core.create')) { $childBar->standardButton('copy') ->text('JTOOLBAR_DUPLICATE') ->task('tours.duplicate') ->listCheck(true); } } if (!$this->isEmptyState && $this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { $toolbar->delete('tours.delete') ->text('JTOOLBAR_EMPTY_TRASH') ->message('JGLOBAL_CONFIRM_DELETE') ->listCheck(true); } if ($user->authorise('core.admin', 'com_guidedtours') || $user->authorise('core.options', 'com_guidedtours')) { $toolbar->preferences('com_guidedtours'); } ToolbarHelper::help('Guided_Tours'); } } PK Vz�\�B B ! src/Controller/TourController.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\Controller; use Joomla\CMS\MVC\Controller\FormController; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Controller for a single Tour * * @since 4.3.0 */ class TourController extends FormController { } PK Vz�\��^ ^ $ src/Controller/DisplayController.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\Controller; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Router\Route; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Component Controller * * @since 4.3.0 */ class DisplayController extends BaseController { /** * The default view. * * @var string * @since 4.3.0 */ protected $default_view = 'tours'; /** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached * @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}. * * @return static |boolean This object to support chaining. False on failure. * * @since 4.3.0 */ public function display($cachable = false, $urlparams = []) { $view = $this->input->get('view', $this->default_view); $layout = $this->input->get('layout', 'default'); $id = $this->input->getInt('id'); // Show messages about the disabled plugin if ($view === 'tours' && !PluginHelper::isEnabled('system', 'guidedtours')) { $this->app->enqueueMessage(Text::_('COM_GUIDEDTOURS_PLUGIN_DISABLED'), 'error'); } if ($view === 'tour' && $layout === 'edit' && !$this->checkEditId('com_guidedtours.edit.tour', $id)) { $this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error'); $this->setRedirect(Route::_('index.php?option=com_guidedtours&view=tours', false)); return false; } if ($view === 'step' && $layout === 'edit' && !$this->checkEditId('com_guidedtours.edit.step', $id)) { $this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error'); $this->setRedirect(Route::_('index.php?option=com_guidedtours&view=steps', false)); return false; } return parent::display(); } } PK Vz�\�]�JB B ! src/Controller/StepController.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\Controller; use Joomla\CMS\MVC\Controller\FormController; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects /** * Controller for a single step * * @since 4.3.0 */ class StepController extends FormController { } PK Vz�\��? ? "