Skip to content

Commit

Permalink
Misc fixes (joomla#59)
Browse files Browse the repository at this point in the history
* CategoriesList is wrongly named

* Added buttons for options
Removed return for display

* Replaced generic icon for page
Removed return for display

* Better comments signatures

* Full list of buttons to remove in editor 'hide'

* Fix to show images properly

* Fix to show images properly
Removed useless publish function

* Removed scrap class

* Format of title column tag to fix tooltip oddity

* URL is required

* Missing JEXEC or die

* Added column selection

* Removed break word on title

* Sanitized the description (removed html and truncation)

* Review of some key translations

* Rename of keys

* Add/edit step/tour are not using language keys

* Removed toolbar instance

* Missing search label

* Removed image path replacement

* Added image path replacement to ensure images show in the tour

* Steps should show only if published

* New/Edit tabs are not properly translated

* Changed the name of the com_guidedtours asset

* Changed translation to N_ITEMS

* How to create smart search filters

* Update step.xml

use VALUE rather than OPTION

* Update step.xml
  • Loading branch information
obuisard authored Feb 13, 2023
1 parent eb9786b commit a62712e
Show file tree
Hide file tree
Showing 32 changed files with 226 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<field
name="search"
type="text"
label="SEARCH"
label="COM_GUIDEDTOURS_STEP_FILTER_SEARCH_LABEL"
description="COM_GUIDEDTOURS_STEP_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
/>
<field
name="published"
type="status"
label="JOPTION_SELECT_PUBLISHED"
label="JSTATUS"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
Expand Down
28 changes: 14 additions & 14 deletions administrator/components/com_guidedtours/forms/step.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
<field
name="position"
type="list"
label="COM_GUIDEDTOURS_POSITION_LABEL"
description="COM_GUIDEDTOURS_POSITION_DESC"
label="COM_GUIDEDTOURS_STEP_POSITION_LABEL"
description="COM_GUIDEDTOURS_STEP_POSITION_DESC"
validate="options"
>
<option value="bottom">COM_GUIDEDTOURS_FIELD_OPTION_BOTTOM</option>
<option value="center">COM_GUIDEDTOURS_FIELD_OPTION_CENTER</option>
<option value="left">COM_GUIDEDTOURS_FIELD_OPTION_LEFT</option>
<option value="right">COM_GUIDEDTOURS_FIELD_OPTION_RIGHT</option>
<option value="top">COM_GUIDEDTOURS_FIELD_OPTION_TOP</option>
>
<option value="bottom">COM_GUIDEDTOURS_FIELD_VALUE_BOTTOM</option>
<option value="center">COM_GUIDEDTOURS_FIELD_VALUE_CENTER</option>
<option value="left">COM_GUIDEDTOURS_FIELD_VALUE_LEFT</option>
<option value="right">COM_GUIDEDTOURS_FIELD_VALUE_RIGHT</option>
<option value="top">COM_GUIDEDTOURS_FIELD_VALUE_TOP</option>
</field>

<field
name="target"
type="text"
label="COM_GUIDEDTOURS_TARGET_LABEL"
description="COM_GUIDEDTOURS_TARGET_DESC"
label="COM_GUIDEDTOURS_STEP_TARGET_LABEL"
description="COM_GUIDEDTOURS_STEP_TARGET_DESC"
/>

<field
Expand Down Expand Up @@ -61,7 +61,7 @@
label="JGLOBAL_DESCRIPTION"
filter="JComponentHelper::filterText"
buttons="true"
hide="readmore,pagebreak"
hide="readmore,pagebreak,module,menu,fields,contact,article"
/>

<field
Expand All @@ -81,9 +81,9 @@
<field
name="type"
type="list"
label="COM_GUIDEDTOURS_TYPE_LABEL"
label="COM_GUIDEDTOURS_STEP_TYPE_LABEL"
default="0"
description="COM_GUIDEDTOURS_TYPE_DESC"
description="COM_GUIDEDTOURS_STEP_TYPE_DESC"
validate="options"
>
<option value="0">COM_GUIDEDTOURS_FIELD_VALUE_NEXT_STEP</option>
Expand Down Expand Up @@ -111,7 +111,7 @@
>
<option value="1">COM_GUIDEDTOURS_TYPE_INTERACTIVE_STEP_BUTTON_LABEL</option>
<option value="2">COM_GUIDEDTOURS_TYPE_INTERACTIVE_STEP_TEXT_FIELD_LABEL</option>
<option value="3">COM_GUIDEDTOURS_TYPE_INTERACTIVE_STEP_OTHERS_LABEL</option>
<option value="3">COM_GUIDEDTOURS_TYPE_INTERACTIVE_STEP_OTHER_LABEL</option>
</field>

<field
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_guidedtours/forms/tour.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
label="JGLOBAL_DESCRIPTION"
filter="JComponentHelper::filterText"
buttons="true"
hide="readmore,pagebreak"
hide="readmore,pagebreak,module,menu,fields,contact,article"
/>

<field
Expand Down Expand Up @@ -121,6 +121,7 @@
type="url"
label="COM_GUIDEDTOURS_URL_LABEL"
description="COM_GUIDEDTOURS_URL_DESC"
required="true"
/>

<field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

use Joomla\CMS\MVC\Controller\BaseController;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Component Controller
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@

namespace Joomla\Component\Guidedtours\Administrator\Controller;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\CMS\Router\Route;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Component Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

use Joomla\CMS\MVC\Controller\AdminController;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Guidedtours list controller class.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Psr\Container\ContainerInterface;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Component class for com_guidedtours
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

use Joomla\CMS\Factory;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* guidedtours component helper.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ContentHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* @since __DEPLOY_VERSION__
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Joomla\Component\Guidedtours\Administrator\Model;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Object\CMSObject;
Expand All @@ -20,6 +19,10 @@
use Joomla\Component\Guidedtours\Administrator\Helper\StepHelper;
use Joomla\String\StringHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Item Model for a single tour.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
use Joomla\Database\ParameterType;
use Joomla\Utilities\ArrayHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Methods supporting a list of steps records.
*
Expand Down
37 changes: 4 additions & 33 deletions administrator/components/com_guidedtours/src/Model/TourModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
namespace Joomla\Component\Guidedtours\Administrator\Model;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Object\CMSObject;
use Joomla\String\StringHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Model class for tour
*
Expand Down Expand Up @@ -284,38 +287,6 @@ protected function canEditState($record)
return parent::canEditState($record);
}

/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param integer $value The value of the published state.
*
* @return boolean True on success.
*
* @since __DEPLOY_VERSION__
*/
public function publish(&$pks, $value = 1)
{
$table = $this->getTable();
$pks = (array) $pks;

$date = Factory::getDate()->toSql();

// Clean the cache.
$this->cleanCache();

// Ensure that previous checks don't empty the array.
if (empty($pks)) {
return true;
}

$table->load($pk);
$table->modified = $date;
$table->store();

return parent::publish($pks, $value);
}

/**
* Method to get a single record.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
use Joomla\Database\DatabaseQuery;
use Joomla\Database\ParameterType;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Model class for Tours
*
Expand Down
Loading

0 comments on commit a62712e

Please sign in to comment.