Skip to content

Commit

Permalink
Merge branch '4.0-dev' into 4.0_module-xtd_js
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy committed Jan 15, 2020
2 parents e7ef6f5 + fa106c2 commit 535e333
Show file tree
Hide file tree
Showing 87 changed files with 3,607 additions and 512 deletions.
74 changes: 52 additions & 22 deletions administrator/components/com_config/tmpl/component/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,16 @@
<?php // End Sidebar ?>

<div class="col-md-9" id="config">
<?php if ($this->fieldsets): ?>
<?php if ($this->fieldsets) : ?>
<?php $opentab = 0; ?>

<?php echo HTMLHelper::_('uitab.startTabSet', 'configTabs'); ?>

<?php foreach ($this->fieldsets as $name => $fieldSet) : ?>

<?php
// Only show first level fieldsets as tabs
if ($xml->xpath('//fieldset/fieldset[@name="' . $name . '"]')) :
continue;
endif;
$hasChildren = $xml->xpath('//fieldset[@name="' . $name . '"]/fieldset');
$hasParent = $xml->xpath('//fieldset/fieldset[@name="' . $name . '"]');
$isGrandchild = $xml->xpath('//fieldset/fieldset/fieldset[@name="' . $name . '"]');
?>

<?php $dataShowOn = ''; ?>
Expand All @@ -74,34 +73,65 @@
<?php endif; ?>

<?php $label = empty($fieldSet->label) ? 'COM_CONFIG_' . $name . '_FIELDSET_LABEL' : $fieldSet->label; ?>
<?php $hasChildren = $xml->xpath('//fieldset[@name="' . $name . '"]/fieldset'); ?>

<?php echo HTMLHelper::_('uitab.addTab', 'configTabs', $name, Text::_($label)); ?>

<?php if (!$isGrandchild && $hasParent) : ?>
<fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-grid-form options-grid-form-full options-menu">
<legend><?php echo Text::_($fieldSet->label); ?></legend>
<div>
<?php elseif (!$hasParent) : ?>
<?php if ($opentab) : ?>

<fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-grid-form options-grid-form-full options-menu">
<legend><?php echo Text::_($fieldSet->label); ?></legend>
<div>
<?php if (!empty($fieldSet->description)) : ?>
<div class="tab-description alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_($fieldSet->description); ?>
<?php if ($opentab > 1) : ?>
</div>
</fieldset>
<?php endif; ?>

<?php if (!$hasChildren) : ?>
<?php echo $this->form->renderFieldset($name, $name === 'permissions' ? ['hiddenLabel' => true, 'class' => 'revert-controls'] : []); ?>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>

<?php endif; ?>

<?php echo HTMLHelper::_('uitab.addTab', 'configTabs', $name, Text::_($label)); ?>

<?php $opentab = 1; ?>

<?php if (!$hasChildren) : ?>

<fieldset id="fieldset-<?php echo $this->escape($name); ?>" class="options-grid-form options-grid-form-full options-menu">
<legend><?php echo Text::_($fieldSet->label); ?></legend>
<div>
<?php $opentab = 2; ?>
<?php endif; ?>
<?php endif; ?>

<?php if (!empty($fieldSet->description)) : ?>
<div class="tab-description alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_($fieldSet->description); ?>
</div>
</fieldset>
<?php endif; ?>

<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php if (!$hasChildren) : ?>
<?php echo $this->form->renderFieldset($name, $name === 'permissions' ? ['hiddenLabel' => true, 'class' => 'revert-controls'] : []); ?>
<?php endif; ?>

<?php if (!$isGrandchild && $hasParent) : ?>
</div>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>

<?php if ($opentab) : ?>

<?php if ($opentab > 1) : ?>
</div>
</fieldset>
<?php endif; ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>

<?php echo HTMLHelper::_('uitab.endTabSet'); ?>

<?php else: ?>
<?php else : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('COM_CONFIG_COMPONENT_NO_CONFIG_FIELDS_MESSAGE'); ?>
Expand Down
5 changes: 2 additions & 3 deletions administrator/components/com_contact/tmpl/contacts/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\Component\Contact\Site\Helper\RouteHelper;

$app = Factory::getApplication();

Expand All @@ -24,8 +25,6 @@
Session::checkToken('get') or die(Text::_('JINVALID_TOKEN'));
}

JLoader::register('ContactHelperRoute', JPATH_ROOT . '/components/com_contact/helpers/route.php');

HTMLHelper::_('behavior.core');
HTMLHelper::_('script', 'com_contact/admin-contacts-modal.min.js', array('version' => 'auto', 'relative' => true));

Expand Down Expand Up @@ -115,7 +114,7 @@
<span class="<?php echo $iconStates[$this->escape($item->published)]; ?>" aria-hidden="true"></span>
</td>
<th scope="row">
<a class="select-link" href="javascript:void(0)" data-function="<?php echo $this->escape($onclick); ?>" data-id="<?php echo $item->id; ?>" data-title="<?php echo $this->escape($item->name); ?>" data-uri="<?php echo $this->escape(ContactHelperRoute::getContactRoute($item->id, $item->catid, $item->language)); ?>" data-language="<?php echo $this->escape($lang); ?>">
<a class="select-link" href="javascript:void(0)" data-function="<?php echo $this->escape($onclick); ?>" data-id="<?php echo $item->id; ?>" data-title="<?php echo $this->escape($item->name); ?>" data-uri="<?php echo $this->escape(RouteHelper::getContactRoute($item->id, $item->catid, $item->language)); ?>" data-language="<?php echo $this->escape($lang); ?>">
<?php echo $this->escape($item->name); ?>
</a>
<div class="small">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
HTMLHelper::_('script', 'vendor/diff/diff.min.js', array('version' => 'auto', 'relative' => true));
HTMLHelper::_('script', 'com_contenthistory/admin-compare-compare.min.js', array('version' => 'auto', 'relative' => true));
?>
<fieldset>

<h2 class="mb-3"><?php echo Text::_('COM_CONTENTHISTORY_COMPARE_TITLE'); ?></h2>
<div role="main">
<h1 class="mb-3"><?php echo Text::_('COM_CONTENTHISTORY_COMPARE_TITLE'); ?></h1>

<table id="diff" class="table">
<caption id="captionTable" class="sr-only">
Expand All @@ -42,20 +41,18 @@
<tbody>
<?php foreach ($object1 as $name => $value) : ?>
<?php if ($value->value != $object2->$name->value) : ?>
<tr>
<?php if (is_object($value->value)) : ?>
<td>
<strong><?php echo $value->label; ?></strong>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<tr>
<td colspan="4">
<strong><?php echo $value->label; ?></strong>
</td>
</tr>
<?php foreach ($value->value as $subName => $subValue) : ?>
<?php $newSubValue = $object2->$name->value->$subName->value ?? ''; ?>
<?php if ($subValue->value || $newSubValue) : ?>
<?php if ($subValue->value != $newSubValue) : ?>
<tr>
<td><em>&nbsp;&nbsp;<?php echo $subValue->label; ?></em></td>
<th scope="row"><em>&nbsp;&nbsp;<?php echo $subValue->label; ?></em></th>
<td class="original"><?php echo htmlspecialchars($subValue->value, ENT_COMPAT, 'UTF-8'); ?></td>
<td class="changed" ><?php echo htmlspecialchars($newSubValue, ENT_COMPAT, 'UTF-8'); ?></td>
<td class="diff">&nbsp;</td>
Expand All @@ -64,18 +61,18 @@
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<th scope="row">
<?php echo $value->label; ?>
</th>
<td class="original"><?php echo htmlspecialchars($value->value); ?></td>
<?php $object2->$name->value = is_object($object2->$name->value) ? json_encode($object2->$name->value) : $object2->$name->value; ?>
<td class="changed"><?php echo htmlspecialchars($object2->$name->value, ENT_COMPAT, 'UTF-8'); ?></td>
<td class="diff">&nbsp;</td>
<tr>
<th scope="row">
<?php echo $value->label; ?>
</th>
<td class="original"><?php echo htmlspecialchars($value->value); ?></td>
<?php $object2->$name->value = is_object($object2->$name->value) ? json_encode($object2->$name->value) : $object2->$name->value; ?>
<td class="changed"><?php echo htmlspecialchars($object2->$name->value, ENT_COMPAT, 'UTF-8'); ?></td>
<td class="diff">&nbsp;</td>
</tr>
<?php endif; ?>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>

</fieldset>
</div>
52 changes: 28 additions & 24 deletions administrator/components/com_contenthistory/tmpl/history/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,36 @@
HTMLHelper::_('script', 'com_contenthistory/admin-history-modal.min.js', array('version' => 'auto', 'relative' => true));
?>
<div class="container-popup">

<div class="btn-group float-right mb-3">
<button id="toolbar-load" type="submit" class="btn btn-secondary" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_LOAD_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_LOAD_DESC'); ?>" data-url="<?php echo Route::_($loadUrl); ?>">
<span class="icon-upload" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_LOAD'); ?></span>
</button>
<button id="toolbar-preview" type="button" class="btn btn-secondary" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW_DESC'); ?>" data-url="<?php echo Route::_('index.php?option=com_contenthistory&view=preview&layout=preview&tmpl=component&' . Session::getFormToken() . '=1'); ?>">
<span class="icon-search" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW'); ?></span>
</button>
<button id="toolbar-compare" type="button" class="btn btn-secondary" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_COMPARE_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_COMPARE_DESC'); ?>" data-url="<?php echo Route::_('index.php?option=com_contenthistory&view=compare&layout=compare&tmpl=component&' . Session::getFormToken() . '=1'); ?>">
<span class="icon-zoom-in" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_COMPARE'); ?></span>
</button>
<button onclick="if (document.adminForm.boxchecked.value==0){<?php echo $deleteMessage; ?>}else{ Joomla.submitbutton('history.keep')}" class="btn btn-secondary pointer" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_KEEP_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_KEEP_DESC'); ?>">
<span class="icon-lock" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_KEEP'); ?></span>
</button>
<button onclick="if (document.adminForm.boxchecked.value==0){<?php echo $deleteMessage; ?>}else{ Joomla.submitbutton('history.delete')}" class="btn btn-secondary pointer" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_DELETE_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_DELETE_DESC'); ?>">
<span class="icon-delete" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_DELETE'); ?></span>
</button>
</div>
<nav aria-label="toolbar">
<div class="btn-group float-right mb-3">
<button id="toolbar-load" type="submit" class="btn btn-secondary" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_LOAD_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_LOAD_DESC'); ?>" data-url="<?php echo Route::_($loadUrl); ?>">
<span class="icon-upload" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_LOAD'); ?></span>
</button>
<button id="toolbar-preview" type="button" class="btn btn-secondary" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW_DESC'); ?>" data-url="<?php echo Route::_('index.php?option=com_contenthistory&view=preview&layout=preview&tmpl=component&' . Session::getFormToken() . '=1'); ?>">
<span class="icon-search" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW'); ?></span>
</button>
<button id="toolbar-compare" type="button" class="btn btn-secondary" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_COMPARE_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_COMPARE_DESC'); ?>" data-url="<?php echo Route::_('index.php?option=com_contenthistory&view=compare&layout=compare&tmpl=component&' . Session::getFormToken() . '=1'); ?>">
<span class="icon-zoom-in" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_COMPARE'); ?></span>
</button>
<button onclick="if (document.adminForm.boxchecked.value==0){<?php echo $deleteMessage; ?>}else{ Joomla.submitbutton('history.keep')}" class="btn btn-secondary pointer" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_KEEP_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_KEEP_DESC'); ?>">
<span class="icon-lock" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_KEEP'); ?></span>
</button>
<button onclick="if (document.adminForm.boxchecked.value==0){<?php echo $deleteMessage; ?>}else{ Joomla.submitbutton('history.delete')}" class="btn btn-secondary pointer" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_DELETE_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_DELETE_DESC'); ?>">
<span class="icon-delete" aria-hidden="true"></span>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_DELETE'); ?></span>
</button>
</div>
</nav>

<form action="<?php echo Route::_($formUrl); ?>" method="post" name="adminForm" id="adminForm">
<table class="table table-sm">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_CONTENTHISTORY_VERSION_CAPTION'); ?>
</caption>
<thead>
<tr>
<td style="width:1%" class="text-center">
Expand Down Expand Up @@ -103,7 +107,7 @@
<?php echo HTMLHelper::_('date', $item->save_date, Text::_('DATE_FORMAT_LC6')); ?>
</a>
<?php if ($item->sha1_hash == $hash) : ?>
<span class="icon-featured" aria-hidden="true"><span class="sr-only"><?php echo Text::_('JFEATURED'); ?></span></span>&nbsp;
<span class="icon-featured" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('JCURRENT'); ?></span>
<?php endif; ?>
</th>
<td class="d-none d-md-table-cell">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,49 @@
Session::checkToken('get') or die(Text::_('JINVALID_TOKEN'));

?>
<h3>
<?php echo Text::sprintf('COM_CONTENTHISTORY_PREVIEW_SUBTITLE_DATE', $this->item->save_date); ?>
<?php if ($this->item->version_note) : ?>
&nbsp;&nbsp;<?php echo Text::sprintf('COM_CONTENTHISTORY_PREVIEW_SUBTITLE', $this->item->version_note); ?>
<?php endif; ?>
</h3>
<table class="table">
<thead>
<tr>
<th style="width:25%"><?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_FIELD'); ?></th>
<th><?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_VALUE'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->item->data as $name => $value) : ?>
<tr>
<?php if (is_object($value->value)) : ?>
<td><strong><?php echo $value->label; ?></strong></td>
<td>&nbsp;</td>
<?php foreach ($value->value as $subName => $subValue) : ?>
<?php if ($subValue) : ?>
<tr>
<td><em>&nbsp;&nbsp;<?php echo $subValue->label; ?></em></td>
<td><?php echo $subValue->value; ?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<td><strong><?php echo $value->label; ?></strong></td>
<td><?php echo $value->value; ?></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div role="main">
<h1>
<?php echo Text::sprintf('COM_CONTENTHISTORY_PREVIEW_SUBTITLE_DATE', $this->item->save_date); ?>
</h1>
<?php if ($this->item->version_note) : ?>
<h2>
<?php echo Text::sprintf('COM_CONTENTHISTORY_PREVIEW_SUBTITLE', $this->item->version_note); ?>
</h2>
<?php endif; ?>

<table class="table">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_CAPTION'); ?>
</caption>
<thead>
<tr>
<th style="width:25%"><?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_FIELD'); ?></th>
<th><?php echo Text::_('COM_CONTENTHISTORY_PREVIEW_VALUE'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->item->data as $name => $value) : ?>
<?php if (is_object($value->value)) : ?>
<tr>
<td colspan="2">
<?php echo $value->label; ?>
</td>
</tr>
<?php foreach ($value->value as $subName => $subValue) : ?>
<?php if ($subValue) : ?>
<tr>
<th scope="row"><em>&nbsp;&nbsp;<?php echo $subValue->label; ?></em></th>
<td><?php echo $subValue->value; ?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<tr>
<th scope="row"><?php echo $value->label; ?></th>
<td><?php echo $value->value; ?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
4 changes: 2 additions & 2 deletions administrator/components/com_cpanel/tmpl/cpanel/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
</div>
<div class="row">
<div class="col-md-6">
<a href="#moduleEditModal" data-toggle="modal" data-target="#moduleDashboardAddModal" role="button" class="cpanel-add-module text-center py-5 w-100 d-block">
<button type="button" data-toggle="modal" data-target="#moduleDashboardAddModal" class="cpanel-add-module text-center py-5 w-100 d-block">
<div class="cpanel-add-module-icon text-center">
<span class="fa fa-plus-square text-light mt-2"></span>
</div>
<span><?php echo Text::_('COM_CPANEL_ADD_DASHBOARD_MODULE'); ?></span>
</a>
</button>
</div>
<?php endif; ?>
</div>
4 changes: 2 additions & 2 deletions administrator/components/com_finder/View/Index/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected function addToolbar()

$toolbar->appendButton(
'Popup', 'archive', 'COM_FINDER_INDEX', 'index.php?option=com_finder&view=indexer&tmpl=component', 500, 210, 0, 0,
'window.parent.location.reload()', 'COM_FINDER_HEADING_INDEXER'
'window.parent.location.reload()', Text::_('COM_FINDER_HEADING_INDEXER')
);

if ($canDo->get('core.edit.state'))
Expand All @@ -185,7 +185,7 @@ protected function addToolbar()
$childBar->unpublish('index.unpublish')->listCheck(true);
}

$toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350, '', '', '', 'COM_FINDER_STATISTICS_TITLE');
$toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350, '', '', '', Text::_('COM_FINDER_STATISTICS_TITLE'));

if ($canDo->get('core.delete'))
{
Expand Down

0 comments on commit 535e333

Please sign in to comment.