Skip to content

Commit

Permalink
Merge branch '4.0-dev' into media_web_service
Browse files Browse the repository at this point in the history
  • Loading branch information
pjdevries committed Jun 10, 2021
2 parents 26cdde7 + 44934f7 commit 4b9245e
Show file tree
Hide file tree
Showing 24 changed files with 153 additions and 120 deletions.
8 changes: 4 additions & 4 deletions administrator/components/com_admin/tmpl/help/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
</button>
<div class="sidebar-nav" id="help-index">
<ul class="nav flex-column">
<li><?php echo HTMLHelper::_('link', Help::createUrl('JHELP_START_HERE'), Text::_('COM_ADMIN_START_HERE'), ['target' => 'helpFrame']); ?></li>
<li><?php echo HTMLHelper::_('link', 'https://www.gnu.org/licenses/gpl-2.0.html', Text::_('COM_ADMIN_LICENSE'), ['target' => 'helpFrame']); ?></li>
<li><?php echo HTMLHelper::_('link', Help::createUrl('JHELP_GLOSSARY'), Text::_('COM_ADMIN_GLOSSARY'), ['target' => 'helpFrame']); ?></li>
<li class="item"><?php echo HTMLHelper::_('link', Help::createUrl('JHELP_START_HERE'), Text::_('COM_ADMIN_START_HERE'), ['target' => 'helpFrame']); ?></li>
<li class="item"><?php echo HTMLHelper::_('link', 'https://www.gnu.org/licenses/gpl-2.0.html', Text::_('COM_ADMIN_LICENSE'), ['target' => 'helpFrame']); ?></li>
<li class="item"><?php echo HTMLHelper::_('link', Help::createUrl('JHELP_GLOSSARY'), Text::_('COM_ADMIN_GLOSSARY'), ['target' => 'helpFrame']); ?></li>
<li class="divider"></li>
<li class="nav-header"><?php echo Text::_('COM_ADMIN_ALPHABETICAL_INDEX'); ?></li>
<?php foreach ($this->toc as $k => $v) : ?>
<li>
<li class="item">
<?php $url = Help::createUrl('JHELP_' . strtoupper($k)); ?>
<?php echo HTMLHelper::_('link', $url, $v, ['target' => 'helpFrame']); ?>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function getInput()
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">'
. Text::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>',
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>',
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@

\defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Finder\Administrator\Helper\FinderHelper;

/**
* Base controller class for Finder.
Expand Down Expand Up @@ -46,6 +49,23 @@ public function display($cachable = false, $urlparams = array())
$layout = $this->input->get('layout', 'index', 'word');
$filterId = $this->input->get('filter_id', null, 'int');

if ($view === 'index')
{
$pluginEnabled = PluginHelper::isEnabled('content', 'finder');

if (!$pluginEnabled)
{
$finderPluginId = FinderHelper::getFinderPluginId();
$link = HTMLHelper::_(
'link',
'#plugin' . $finderPluginId . 'Modal',
Text::_('COM_FINDER_CONTENT_PLUGIN'),
'class="alert-link" data-bs-toggle="modal" id="title-' . $finderPluginId . '"'
);
$this->app->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK', $link), 'warning');
}
}

// Check for edit form.
if ($view === 'filter' && $layout === 'edit' && !$this->checkEditId('com_finder.edit.filter', $filterId))
{
Expand Down
24 changes: 12 additions & 12 deletions administrator/components/com_finder/src/View/Index/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@

\defined('_JEXEC') or die;

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\Router\Route;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Finder\Administrator\Helper\FinderHelper;
Expand Down Expand Up @@ -57,6 +56,14 @@ class HtmlView extends BaseHtmlView
*/
protected $pluginState;

/**
* The id of the content - finder plugin in mysql
*
* @var integer
* @since __DEPLOY_VERSION__
*/
protected $finderPluginId = 0;

/**
* The model state
*
Expand Down Expand Up @@ -138,17 +145,10 @@ public function display($tpl = null)
throw new GenericDataException(implode("\n", $errors), 500);
}

if (!$this->pluginState['plg_content_finder']->enabled)
// Check that the content - finder plugin is enabled
if (!PluginHelper::isEnabled('content', 'finder'))
{
if (Factory::getUser()->authorise('core.manage', 'com_plugin'))
{
$link = Route::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . FinderHelper::getFinderPluginId());
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK', $link), 'warning');
}
else
{
Factory::getApplication()->enqueueMessage(Text::_('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED'), 'warning');
}
$this->finderPluginId = FinderHelper::getFinderPluginId();
}

// Configure the toolbar.
Expand Down
25 changes: 25 additions & 0 deletions administrator/components/com_finder/tmpl/index/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,31 @@
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
<?php if ($this->finderPluginId) : ?>
<?php $link = Route::_('index.php?option=com_plugins&client_id=0&task=plugin.edit&extension_id=' . $this->finderPluginId . '&tmpl=component&layout=modal'); ?>
<?php echo HTMLHelper::_(
'bootstrap.renderModal',
'plugin' . $this->finderPluginId . 'Modal',
array(
'url' => $link,
'title' => Text::_('COM_FINDER_EDIT_PLUGIN_SETTINGS'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'closeButton' => false,
'backdrop' => 'static',
'keyboard' => false,
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"'
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->finderPluginId . 'Modal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary" data-bs-dismiss="modal" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->finderPluginId . 'Modal\', buttonSelector: \'#saveBtn\'})">'
. Text::_("JSAVE") . '</button>'
. '<button type="button" class="btn btn-success" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->finderPluginId . 'Modal\', buttonSelector: \'#applyBtn\'}); return false;">'
. Text::_("JAPPLY") . '</button>'
)
); ?>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_joomlaupdate/restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}

// fnmatch not available on non-POSIX systems
// Thanks to [email protected] for this usefull alternative function [http://gr2.php.net/fnmatch]
// Thanks to [email protected] for this useful alternative function [http://gr2.php.net/fnmatch]
if (!function_exists('fnmatch'))
{
function fnmatch($pattern, $string)
Expand Down Expand Up @@ -3111,7 +3111,7 @@ class AKText extends AKAbstractObject
'BTN_SITEFE' => 'Visit your site\'s frontend',
'BTN_SITEBE' => 'Visit your site\'s backend',
'WARNINGS' => 'Extraction Warnings',
'ERROR_OCCURED' => 'An error occurred',
'ERROR_OCCURRED' => 'An error occurred',
'STEALTH_MODE' => 'Stealth mode',
'STEALTH_URL' => 'HTML file to show to web visitors',
'ERR_NOT_A_JPS_FILE' => 'The file is not a JPA archive',
Expand Down Expand Up @@ -5292,7 +5292,7 @@ public function __toString()
switch ($task)
{
case 'ping':
// ping task - realy does nothing!
// ping task - really does nothing!
$timer = AKFactory::getTimer();
$timer->enforce_min_exec_time();
break;
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_redirect/tmpl/links/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary" data-bs-dismiss="modal" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#saveBtn\'})">'
. Text::_("JSAVE") . '</button>'
. Text::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#applyBtn\'}); return false;">'
. Text::_("JAPPLY") . '</button>'
. Text::_('JAPPLY') . '</button>'
)
); ?>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
. ' onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#closeBtn\'})">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
. '<button type="button" class="btn btn-primary" data-bs-dismiss="modal" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#saveBtn\'})">'
. Text::_("JSAVE") . '</button>'
. Text::_('JSAVE') . '</button>'
. '<button type="button" class="btn btn-success" onclick="Joomla.iframeButtonClick({iframeSelector: \'#plugin' . $this->redirectPluginId . 'Modal\', buttonSelector: \'#applyBtn\'}); return false;">'
. Text::_("JAPPLY") . '</button>'
. Text::_('JAPPLY') . '</button>'
)
); ?>
<?php endif; ?>
Expand Down
4 changes: 3 additions & 1 deletion administrator/language/en-GB/com_finder.ini
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ COM_FINDER_CONFIG_TUPLECOUNT_LABEL="Search for Phrases"
COM_FINDER_CONFIG_TUPLECOUNT_PHRASE_DISABLED="Disabled (Improved performance)"
COM_FINDER_CONFIG_TUPLECOUNT_PHRASE_ENABLED="Enabled (Improved search results)"
COM_FINDER_CONFIGURATION="Smart Search: Options"
COM_FINDER_CONTENT_PLUGIN="Smart Search Content Plugin"
COM_FINDER_CREATE_FILTER="Create a filter."
COM_FINDER_EDIT_FILTER="Edit Filter"
COM_FINDER_EDIT_PLUGIN_SETTINGS="Edit Plugin Settings"
COM_FINDER_EMPTYSTATE_BUTTON_ADD="Start the indexer"
COM_FINDER_EMPTYSTATE_CONTENT="No content has been indexed or you have deleted all your maps. Please visit the Smart Search Index page to reindex your content."
COM_FINDER_EMPTYSTATE_SEARCHES_CONTENT="There are no phrases used for site searching to view yet."
Expand Down Expand Up @@ -132,7 +134,7 @@ COM_FINDER_INDEX_HEADING_LINK_URL_DESC="Raw URL descending"
COM_FINDER_INDEX_NO_CONTENT="No content matches your search criteria."
COM_FINDER_INDEX_NO_DATA="No content has been indexed."
COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED="The Smart Search Content Plugin is disabled. Changes to content will not update the Smart Search index until the Plugin is enabled."
COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK="The <a href=\"%s\">Smart Search Content Plugin</a> is disabled. Changes to content will not update the Smart Search index if you do not enable this plugin."
COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED_LINK="The %s is disabled. Changes to content will not update the Smart Search index if you do not enable this plugin."
COM_FINDER_INDEX_PURGE_FAILED="Failed to delete selected items."
COM_FINDER_INDEX_PURGE_SUCCESS="All items have been deleted."
COM_FINDER_INDEX_SEARCH_DESC="Search in title, URL and last updated date."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function displayList()
{
$this->modelState->set('type_alias', $this->getTypeAliasFromInput());
$this->modelState->set('type_id', $this->getTypeIdFromInput());
$this->modelState->set('item_id', $this->getItemIdFromInput());
$this->modelState->set('item_id', $this->getTypeAliasFromInput() . '.' . $this->getItemIdFromInput());
$this->modelState->set('list.ordering', 'h.save_date');
$this->modelState->set('list.direction', 'DESC');

Expand Down
6 changes: 3 additions & 3 deletions build/media_source/com_joomlaupdate/js/default.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Joomla = window.Joomla || {};
PreUpdateChecker.showorangewarning = true;
break;
default:
// An error occured -> show unknown error note
// An error occurred -> show unknown error note
html = Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN');
}
}
Expand All @@ -375,7 +375,7 @@ Joomla = window.Joomla || {};
// Process Current Version Extension Compatibility
html = '';
if (extensionData.serverError) {
// An error occured -> show unknown error note
// An error occurred -> show unknown error note
html = Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_SERVER_ERROR');
} else {
// Switch the compatibility state
Expand All @@ -395,7 +395,7 @@ Joomla = window.Joomla || {};
html = Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_NO_COMPATIBILITY_INFORMATION');
break;
default:
// An error occured -> show unknown error note
// An error occurred -> show unknown error note
html = Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN');
}
}
Expand Down
2 changes: 1 addition & 1 deletion build/media_source/mod_menu/js/admin-menu.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if (sidebar && !sidebar.getAttribute('data-hidden')) {

// Set active class
allLinks.forEach((link) => {
if (currentUrl === link.href) {
if (currentUrl.indexOf(link.href) === 0) {
link.setAttribute('aria-current', 'page');
link.classList.add('mm-active');

Expand Down
2 changes: 1 addition & 1 deletion components/com_content/tmpl/article/default_links.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
'modalWidth' => '500',
'bodyHeight' => '500',
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
. \Joomla\CMS\Language\Text::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'
. \Joomla\CMS\Language\Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
)
);
break;
Expand Down
2 changes: 1 addition & 1 deletion layouts/joomla/editors/buttons/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
'bodyHeight' => array_key_exists('bodyHeight', $options) ? $options['bodyHeight'] : '70',
'modalWidth' => array_key_exists('modalWidth', $options) ? $options['modalWidth'] : '80',
'footer' => $confirm . '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">'
. Text::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
)
);
2 changes: 1 addition & 1 deletion layouts/joomla/form/field/contenthistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
'modalWidth' => '80',
'bodyHeight' => '60',
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
. Text::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
)
);

Expand Down
4 changes: 2 additions & 2 deletions layouts/joomla/form/field/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@
<div class="input-group">
<input type="text" name="<?php echo $name; ?>" id="<?php echo $id; ?>" value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>" readonly="readonly"<?php echo $attr; ?>>
<?php if ($disabled != true) : ?>
<button type="button" class="btn btn-success button-select"><?php echo Text::_("JLIB_FORM_BUTTON_SELECT"); ?></button>
<button type="button" class="btn btn-danger button-clear"><span class="icon-times" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_("JLIB_FORM_BUTTON_CLEAR"); ?></span></button>
<button type="button" class="btn btn-success button-select"><?php echo Text::_('JLIB_FORM_BUTTON_SELECT'); ?></button>
<button type="button" class="btn btn-danger button-clear"><span class="icon-times" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('JLIB_FORM_BUTTON_CLEAR'); ?></span></button>
<?php endif; ?>
</div>
</joomla-field-media>
2 changes: 1 addition & 1 deletion layouts/plugins/system/privacyconsent/label.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
'modalWidth' => '800',
'bodyHeight' => '500',
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
. Text::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>',
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>',
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion layouts/plugins/user/terms/label.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
'modalWidth' => '800',
'bodyHeight' => '500',
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
. Text::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>',
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>',
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Form/Field/ModulepositionField.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected function getInput()
'modalWidth' => '800',
'bodyHeight' => '450',
'footer' => '<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
. Text::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') . '</button>'
)
);
$html[] = '</div>';
Expand Down
4 changes: 2 additions & 2 deletions modules/mod_menu/tmpl/collapse-default.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
?>

<nav class="navbar navbar-expand-md">
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="<?php echo Text::_('MOD_MENU_TOGGLE'); ?>">
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" data-bs-target="#navbar<?php echo $module->id; ?>" aria-controls="navbar<?php echo $module->id; ?>" aria-expanded="false" aria-label="<?php echo Text::_('MOD_MENU_TOGGLE'); ?>">
<span class="icon-menu" aria-hidden="true"></span>
</button>
<div class="collapse navbar-collapse" id="navbar">
<div class="collapse navbar-collapse" id="navbar<?php echo $module->id; ?>">
<?php require __DIR__ . '/default.php'; ?>
</div>
</nav>
Loading

0 comments on commit 4b9245e

Please sign in to comment.