Skip to content

Commit

Permalink
Merge branch '5.1-dev' into 5.1/patch/note-config-sef
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Feb 20, 2024
2 parents e8f9963 + bd1f055 commit ce6e7f6
Show file tree
Hide file tree
Showing 88 changed files with 834 additions and 284 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE `#__guidedtour_steps` ADD COLUMN `params` text NULL /** CAN FAIL **/;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "#__guidedtour_steps" ADD COLUMN "params" text NULL /** CAN FAIL **/;
3 changes: 3 additions & 0 deletions administrator/components/com_banners/forms/banner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@
<field
name="imageurl"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_BANNERS_FIELD_IMAGE_LABEL"
directory="banners"
hide_none="1"
Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_categories/forms/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@
<field
name="image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CATEGORIES_FIELD_IMAGE_LABEL"
/>

Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_config/forms/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,9 @@
<field
name="offline_image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONFIG_FIELD_OFFLINE_IMAGE_LABEL"
showon="offline:1"
/>
Expand Down
24 changes: 24 additions & 0 deletions administrator/components/com_contact/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@
<field
name="image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_PARAMS_IMAGE_LABEL"
default=""
showon="show_info:1[AND]show_image:1"
Expand Down Expand Up @@ -410,6 +413,9 @@
<field
name="icon_address"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_ADDRESS_LABEL"
hide_none="1"
default=""
Expand All @@ -419,6 +425,9 @@
<field
name="icon_email"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_EMAIL_LABEL"
hide_none="1"
default=""
Expand All @@ -428,6 +437,9 @@
<field
name="icon_telephone"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_TELEPHONE_LABEL"
hide_none="1"
default=""
Expand All @@ -437,6 +449,9 @@
<field
name="icon_mobile"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_MOBILE_LABEL"
hide_none="1"
default=""
Expand All @@ -446,6 +461,9 @@
<field
name="icon_fax"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_FAX_LABEL"
hide_none="1"
default=""
Expand All @@ -455,6 +473,9 @@
<field
name="icon_webpage"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_WEBPAGE_LABEL"
hide_none="1"
default=""
Expand All @@ -464,6 +485,9 @@
<field
name="icon_misc"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_MISC_LABEL"
hide_none="1"
default=""
Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_contact/forms/contact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@
<field
name="image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_PARAMS_IMAGE_LABEL"
hide_none="1"
/>
Expand Down
6 changes: 6 additions & 0 deletions administrator/components/com_content/forms/article.xml
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,9 @@
name="image_intro"
type="media"
label="COM_CONTENT_FIELD_INTRO_LABEL"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
/>

<field
Expand Down Expand Up @@ -759,6 +762,9 @@
<field
name="image_fulltext"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTENT_FIELD_FULL_LABEL"
/>

Expand Down
45 changes: 45 additions & 0 deletions administrator/components/com_guidedtours/forms/step.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
>
<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="5">COM_GUIDEDTOURS_FIELD_VALUE_INTERACTIVESTEP_TYPE_CHECKBOX_RADIO_FIELD</option>
<option value="6">COM_GUIDEDTOURS_FIELD_VALUE_INTERACTIVESTEP_TYPE_SELECT_LIST</option>
<option value="4">COM_GUIDEDTOURS_FIELD_VALUE_INTERACTIVESTEP_TYPE_BUTTON</option>
<option value="3">COM_GUIDEDTOURS_FIELD_VALUE_INTERACTIVESTEP_TYPE_OTHER</option>
</field>
Expand Down Expand Up @@ -189,4 +191,47 @@
maxlength="255"
/>

<fields name="params">

<fieldset name="options">

<fieldset name="targetvalues" label="COM_GUIDEDTOURS_STEP_TARGETVALUES_HEADING">
<field
name="notetarget"
type="note"
class="alert alert-info"
description="COM_GUIDEDTOURS_STEP_TARGETNOTE_MESSAGE"
showon=".type!:2[OR].interactive_type!:2,5,6" />

<field
name="required"
type="radio"
label="COM_GUIDEDTOURS_TYPE_INPUT_REQUIRED_LABEL"
description="COM_GUIDEDTOURS_TYPE_INPUT_REQUIRED_DESC"
showon=".type:2[AND].interactive_type:2,5,6"
layout="joomla.form.field.radio.switcher"
filter="integer"
validate="options"
default="1"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="requiredvalue"
type="textarea"
label="COM_GUIDEDTOURS_TYPE_INPUT_REQUIREDVALUE_LABEL"
description="COM_GUIDEDTOURS_TYPE_INPUT_REQUIREDVALUE_DESC"
showon=".type:2[AND].interactive_type:2,6[AND]required:1"
filter="safehtml"
cols="80"
rows="3"
default=""
/>

</fieldset>
</fieldset>
</fields>

</form>
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ class GuidedtoursComponent extends MVCComponent implements BootableExtensionInte
*/
public const STEP_INTERACTIVETYPE_OTHER = 3;

/**
* An interactive step for checkbox/radio fields
*
* @since 5.1.0
*/
public const STEP_INTERACTIVETYPE_CHECKBOX_RADIO = 5;

/**
* An interactive step for select element fields
*
* @since 5.1.0
*/
public const STEP_INTERACTIVETYPE_SELECT = 6;

/**
* Booting the extension. This is the function to set up the environment of the extension like
* registering new class loaders, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Joomla\Component\Guidedtours\Administrator\Helper\GuidedtoursHelper;
use Joomla\Database\DatabaseQuery;
use Joomla\Database\ParameterType;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -248,6 +249,13 @@ public function getItems()

$item->title = Text::_($item->title);
$item->description = Text::_($item->description);

if (isset($item->params)) {
$params = new Registry($item->params);
if (!empty($item->params->requiredvalue)) {
$item->params->requiredvalue = Text::_($item->params->requiredvalue);
}
}
}

return $items;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ public function duplicate(&$pks)
'checked_out_time',
'checked_out',
'language',
'params',
'note',
]
)
Expand Down Expand Up @@ -400,6 +401,7 @@ public function duplicate(&$pks)
$db->quoteName('modified'),
$db->quoteName('modified_by'),
$db->quoteName('language'),
$db->quoteName('params'),
$db->quoteName('note'),
]
);
Expand All @@ -421,6 +423,7 @@ public function duplicate(&$pks)
ParameterType::INTEGER,
ParameterType::STRING,
ParameterType::STRING,
ParameterType::STRING,
];

$query->values(
Expand All @@ -442,6 +445,7 @@ public function duplicate(&$pks)
$date,
$user->id,
$step->language,
$step->params,
$step->note,
],
$dataTypes
Expand Down
23 changes: 23 additions & 0 deletions administrator/components/com_guidedtours/src/Table/StepTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\Database\DatabaseDriver;
use Joomla\Event\DispatcherInterface;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -51,6 +52,28 @@ public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher
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.
*
Expand Down
9 changes: 7 additions & 2 deletions administrator/components/com_guidedtours/tmpl/step/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate');
->useScript('form.validate')
->useScript('com_guidedtours.tour-edit');

if (empty($this->item->tour_id)) {
throw new GenericDataException("\nThe Tour id was not set!\n", 500);
}

$lang = $this->getLanguage()->getTag();

$this->useCoreUI = true;
?>

<form action="<?php echo Route::_('index.php?option=com_guidedtours&view=step&layout=edit&id=' .
Expand Down Expand Up @@ -79,14 +82,16 @@
</div>
<?php echo HTMLHelper::_('uitab.endTab'); ?>

<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>

<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'publishing', Text::_('JGLOBAL_FIELDSET_PUBLISHING')); ?>
<div class="row">
<div class="col-12 col-lg-8">
<fieldset id="fieldset-publishingdata" class="options-form">
<legend><?php echo Text::_('JGLOBAL_FIELDSET_PUBLISHING'); ?></legend>
<div>
<?php
$this->fields = [];
$this->fields = [];
$this->hidden_fields = [];
echo LayoutHelper::render('joomla.edit.publishingdata', $this); ?>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function loadChangelog()
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
public function loadChangelogRaw()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<?php echo $this->escape($row->author); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo PunycodeHelper::emailToUTF8($this->escape($row->authorEmail)); ?>
<?php echo $this->escape(PunycodeHelper::emailToUTF8($row->authorEmail)); ?>
</td>
<td class="d-none d-md-table-cell text-center">
<?php echo $this->escape($row->extension_id); ?>
Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_menus/forms/item_alias.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
<field
name="menu_image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_MENUS_ITEM_FIELD_MENU_IMAGE_LABEL"
/>

Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_menus/forms/item_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<field
name="menu_image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_MENUS_ITEM_FIELD_MENU_IMAGE_LABEL"
/>

Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_menus/forms/item_heading.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<field
name="menu_image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_MENUS_ITEM_FIELD_MENU_IMAGE_LABEL"
/>

Expand Down

0 comments on commit ce6e7f6

Please sign in to comment.