Skip to content

Commit

Permalink
[4.3] Guided Tours disabled plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
brianteeman committed Apr 21, 2023
1 parent 853d324 commit 86c6c36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

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
Expand Down Expand Up @@ -49,6 +50,11 @@ public function display($cachable = false, $urlparams = [])
$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));
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/com_guidedtours.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ COM_GUIDEDTOURS_N_ITEMS_UNPUBLISHED="%d items unpublished."
COM_GUIDEDTOURS_NEW_TOUR="New Tour"
COM_GUIDEDTOURS_ORDER_TYPE_ASC="Type ascending"
COM_GUIDEDTOURS_ORDER_TYPE_DESC="Type descending"
COM_GUIDEDTOURS_PLUGIN_DISABLED="The Guided Tours System Plugin is disabled. The Guided Tours module will not be displayed if this is not enabled."
COM_GUIDEDTOURS_STEP_DESCRIPTION_TRANSLATION="Description (%s)"
COM_GUIDEDTOURS_STEP_EDIT_STEP="Edit Step"
COM_GUIDEDTOURS_STEP_FILTER_SEARCH_DESC="Search in title. Prefix with ID: to search for a step ID or DESCRIPTION: to search in description."
Expand Down

0 comments on commit 86c6c36

Please sign in to comment.