29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-07-12 15:03:39 +00:00

[4.0] Codestyle fixes for new CMS codestyle Batch 16/16 (#25471)

This commit is contained in:
Hannes Papenberg 2019-07-12 00:39:23 +02:00 committed by George Wilson
parent 03ff591b1b
commit bff17dfdbf
33 changed files with 187 additions and 79 deletions

View File

@ -132,7 +132,8 @@ class FiltersField extends FormField
$html[] = ' ' . LayoutHelper::render('joomla.html.treeprefix', array('level' => $group->level + 1)) . $group->text;
$html[] = ' </td>';
$html[] = ' <td>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_type" class="sr-only">' . Text::_('JGLOBAL_FILTER_TYPE_LABEL') . '</label>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_type" class="sr-only">'
. Text::_('JGLOBAL_FILTER_TYPE_LABEL') . '</label>';
$html[] = ' <select'
. ' name="' . $this->name . '[' . $group->value . '][filter_type]"'
. ' id="' . $this->id . $group->value . '_filter_type"'
@ -153,7 +154,8 @@ class FiltersField extends FormField
$html[] = ' </select>';
$html[] = ' </td>';
$html[] = ' <td>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_tags" class="sr-only">' . Text::_('JGLOBAL_FILTER_TAGS_LABEL') . '</label>';
$html[] = ' <label for="' . $this->id . $group->value . '_filter_tags" class="sr-only">'
. Text::_('JGLOBAL_FILTER_TAGS_LABEL') . '</label>';
$html[] = ' <input'
. ' name="' . $this->name . '[' . $group->value . '][filter_tags]"'
. ' type="text"'

View File

@ -335,7 +335,10 @@ class ApplicationModel extends FormModel
try
{
Log::add(
Text::sprintf('COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', $data['session_filesystem_path']),
Text::sprintf(
'COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT',
$data['session_filesystem_path']
),
Log::WARNING,
'jerror'
);
@ -343,7 +346,10 @@ class ApplicationModel extends FormModel
catch (\RuntimeException $logException)
{
$app->enqueueMessage(
Text::sprintf('COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT', $data['session_filesystem_path']),
Text::sprintf(
'COM_CONFIG_ERROR_CUSTOM_SESSION_FILESYSTEM_PATH_NOTWRITABLE_USING_DEFAULT',
$data['session_filesystem_path']
),
'warning'
);
}

View File

@ -103,7 +103,11 @@ class CompareModel extends ListModel
{
if (array_key_exists($dateProperty, $object->data) && $object->data->$dateProperty->value != $nullDate)
{
$object->data->$dateProperty->value = HTMLHelper::_('date', $object->data->$dateProperty->value, Text::_('DATE_FORMAT_LC6'));
$object->data->$dateProperty->value = HTMLHelper::_(
'date',
$object->data->$dateProperty->value,
Text::_('DATE_FORMAT_LC6')
);
}
}

View File

@ -177,7 +177,10 @@ class LoginModel extends BaseDatabaseModel
}
catch (ExecutionFailureException $databaseException)
{
Factory::getApplication()->enqueueMessage(Text::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $databaseException->getMessage()), 'error');
Factory::getApplication()->enqueueMessage(
Text::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $databaseException->getMessage()),
'error'
);
return array();
}

View File

@ -241,7 +241,13 @@ class HtmlView extends BaseHtmlView
default :
if ($item->params->get('icon_address'))
{
$image1 = HTMLHelper::_('image', $item->params->get('icon_address', 'con_address.png'), Text::_('COM_CONTACT_ADDRESS'), null, false);
$image1 = HTMLHelper::_(
'image',
$item->params->get('icon_address', 'con_address.png'),
Text::_('COM_CONTACT_ADDRESS'),
null,
false
);
}
else
{
@ -255,16 +261,34 @@ class HtmlView extends BaseHtmlView
if ($item->params->get('icon_email'))
{
$image2 = HTMLHelper::_('image', $item->params->get('icon_email', 'emailButton.png'), Text::_('JGLOBAL_EMAIL'), null, false);
$image2 = HTMLHelper::_(
'image',
$item->params->get('icon_email', 'emailButton.png'),
Text::_('JGLOBAL_EMAIL'),
null,
false
);
}
else
{
$image2 = HTMLHelper::_('image', 'contacts/' . $item->params->get('icon_email', 'emailButton.png'), Text::_('JGLOBAL_EMAIL'), null, true);
$image2 = HTMLHelper::_(
'image',
'contacts/' . $item->params->get('icon_email', 'emailButton.png'),
Text::_('JGLOBAL_EMAIL'),
null,
true
);
}
if ($item->params->get('icon_telephone'))
{
$image3 = HTMLHelper::_('image', $item->params->get('icon_telephone', 'con_tel.png'), Text::_('COM_CONTACT_TELEPHONE'), null, false);
$image3 = HTMLHelper::_(
'image',
$item->params->get('icon_telephone', 'con_tel.png'),
Text::_('COM_CONTACT_TELEPHONE'),
null,
false
);
}
else
{
@ -283,12 +307,24 @@ class HtmlView extends BaseHtmlView
}
else
{
$image4 = HTMLHelper::_('image', 'contacts/' . $item->params->get('icon_fax', 'con_fax.png'), Text::_('COM_CONTACT_FAX'), null, true);
$image4 = HTMLHelper::_(
'image',
'contacts/' . $item->params->get('icon_fax', 'con_fax.png'),
Text::_('COM_CONTACT_FAX'),
null,
true
);
}
if ($item->params->get('icon_misc'))
{
$image5 = HTMLHelper::_('image', $item->params->get('icon_misc', 'con_info.png'), Text::_('COM_CONTACT_OTHER_INFORMATION'), null, false);
$image5 = HTMLHelper::_(
'image',
$item->params->get('icon_misc', 'con_info.png'),
Text::_('COM_CONTACT_OTHER_INFORMATION'),
null,
false
);
}
else
{
@ -468,7 +504,10 @@ class HtmlView extends BaseHtmlView
$path = array(array('title' => $this->item->name, 'link' => ''));
$category = Categories::getInstance('Contact')->get($this->item->catid);
while ($category && ($menu->query['option'] !== 'com_contact' || $menu->query['view'] === 'contact' || $id != $category->id) && $category->id > 1)
while ($category && ($menu->query['option'] !== 'com_contact'
|| $menu->query['view'] === 'contact'
|| $id != $category->id) && $category->id > 1
)
{
$path[] = array('title' => $category->title, 'link' => ContactHelperRoute::getCategoryRoute($category->id, $category->language));
$category = $category->getParent();

View File

@ -77,7 +77,16 @@ abstract class AssociationHelper extends CategoryAssociationHelper
$advClause[] = 'c2.state = 1';
}
$associations = Associations::getAssociations('com_content', '#__content', 'com_content.item', $id, 'id', 'alias', 'catid', $advClause);
$associations = Associations::getAssociations(
'com_content',
'#__content',
'com_content.item',
$id,
'id',
'alias',
'catid',
$advClause
);
$return = array();

View File

@ -144,7 +144,9 @@ class ArticleModel extends ItemModel
$query->select('ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count')
->join('LEFT', '#__content_rating AS v ON a.id = v.content_id');
if ((!$user->authorise('core.edit.state', 'com_content.article.' . $pk)) && (!$user->authorise('core.edit', 'com_content.article.' . $pk)))
if (!$user->authorise('core.edit.state', 'com_content.article.' . $pk)
&& !$user->authorise('core.edit', 'com_content.article.' . $pk)
)
{
// Filter by start and end dates.
$nullDate = $db->quote($db->getNullDate());
@ -322,7 +324,7 @@ class ArticleModel extends ItemModel
// Create the base insert statement.
$query->insert($db->quoteName('#__content_rating'))
->columns(array($db->quoteName('content_id'), $db->quoteName('lastip'), $db->quoteName('rating_sum'), $db->quoteName('rating_count')))
->columns([$db->quoteName('content_id'), $db->quoteName('lastip'), $db->quoteName('rating_sum'), $db->quoteName('rating_count')])
->values((int) $pk . ', ' . $db->quote($userIP) . ',' . (int) $rate . ', 1');
// Set the query and execute the insert.

View File

@ -300,7 +300,8 @@ class HtmlView extends BaseHtmlView
$path = array(array('title' => $this->item->title, 'link' => ''));
$category = Categories::getInstance('Content')->get($this->item->catid);
while ($category && ($menu->query['option'] !== 'com_content' || $menu->query['view'] === 'article' || $id != $category->id) && $category->id > 1)
while ($category
&& ($menu->query['option'] !== 'com_content' || $menu->query['view'] === 'article' || $id != $category->id) && $category->id > 1)
{
$path[] = array('title' => $category->title, 'link' => RouteHelper::getCategoryRoute($category->id, $category->language));
$category = $category->getParent();

View File

@ -65,7 +65,8 @@ class FeedView extends CategoryFeedView
// URL link to article
$link = Route::_(\ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language));
$item->description .= '<p class="feed-readmore"><a target="_blank" href ="' . $link . '">' . Text::_('COM_CONTENT_FEED_READMORE') . '</a></p>';
$item->description .= '<p class="feed-readmore"><a target="_blank" href ="' . $link . '">'
. Text::_('COM_CONTENT_FEED_READMORE') . '</a></p>';
}
$item->author = $item->created_by_alias ?: $item->author;

View File

@ -114,7 +114,8 @@ class FeedView extends AbstractView
// Add readmore link to description if introtext is shown, show_readmore is true and fulltext exists
if (!$params->get('feed_summary', 0) && $params->get('feed_show_readmore', 0) && $row->fulltext)
{
$description .= '<p class="feed-readmore"><a target="_blank" href ="' . $item->link . '">' . Text::_('COM_CONTENT_FEED_READMORE') . '</a></p>';
$description .= '<p class="feed-readmore"><a target="_blank" href ="' . $item->link . '">'
. Text::_('COM_CONTENT_FEED_READMORE') . '</a></p>';
}
// Load item description and add div

View File

@ -340,7 +340,9 @@ class HtmlView extends BaseHtmlView
// Check for OpenSearch
if ($this->params->get('opensearch', 1))
{
$ostitle = $this->params->get('opensearch_name', Text::_('COM_FINDER_OPENSEARCH_NAME') . ' ' . Factory::getApplication()->get('sitename'));
$ostitle = $this->params->get('opensearch_name',
Text::_('COM_FINDER_OPENSEARCH_NAME') . ' ' . Factory::getApplication()->get('sitename')
);
Factory::getDocument()->addHeadLink(
Uri::getInstance()->toString(array('scheme', 'host', 'port')) . Route::_('index.php?option=com_finder&view=search&format=opensearch'),
'search', 'rel', array('title' => $ostitle, 'type' => 'application/opensearchdescription+xml')

View File

@ -25,7 +25,8 @@ class DisplayController extends BaseController
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param mixed|boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}.
* @param mixed|boolean $urlparams An array of safe URL parameters and their
* variable types, for valid values see {@link \JFilterInput::clean()}.
*
* @return static This object to support chaining.
*

View File

@ -174,13 +174,19 @@ class HtmlView extends BaseHtmlView
Factory::getApplication()->triggerEvent('onContentPrepare', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]);
$results = Factory::getApplication()->triggerEvent('onContentAfterTitle', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]);
$results = Factory::getApplication()->triggerEvent('onContentAfterTitle',
['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]
);
$itemElement->event->afterDisplayTitle = trim(implode("\n", $results));
$results = Factory::getApplication()->triggerEvent('onContentBeforeDisplay', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]);
$results = Factory::getApplication()->triggerEvent('onContentBeforeDisplay',
['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]
);
$itemElement->event->beforeDisplayContent = trim(implode("\n", $results));
$results = Factory::getApplication()->triggerEvent('onContentAfterDisplay', ['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]);
$results = Factory::getApplication()->triggerEvent('onContentAfterDisplay',
['com_tags.tag', &$itemElement, &$itemElement->core_params, 0]
);
$itemElement->event->afterDisplayContent = trim(implode("\n", $results));
// Write the results back into the body

View File

@ -136,7 +136,11 @@ class RegistrationModel extends FormModel
$data['activation'] = ApplicationHelper::getHash(UserHelper::genRandomPassword());
$user->set('activation', $data['activation']);
$data['siteurl'] = Uri::base();
$data['activate'] = Route::link('site', 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false, $linkMode);
$data['activate'] = Route::link('site',
'index.php?option=com_users&task=registration.activate&token=' . $data['activation'],
false,
$linkMode
);
$data['fromname'] = $app->get('fromname');
$data['mailfrom'] = $app->get('mailfrom');
@ -525,7 +529,11 @@ class RegistrationModel extends FormModel
// Set the link to confirm the user email.
$linkMode = $app->get('force_ssl', 0) == 2 ? 1 : -1;
$data['activate'] = Route::link('site', 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false, $linkMode);
$data['activate'] = Route::link('site',
'index.php?option=com_users&task=registration.activate&token=' . $data['activation'],
false,
$linkMode
);
$emailSubject = Text::sprintf(
'COM_USERS_EMAIL_ACCOUNT_DETAILS',
@ -562,7 +570,11 @@ class RegistrationModel extends FormModel
// Set the link to activate the user account.
$linkMode = $app->get('force_ssl', 0) == 2 ? 1 : -1;
$data['activate'] = Route::link('site', 'index.php?option=com_users&task=registration.activate&token=' . $data['activation'], false, $linkMode);
$data['activate'] = Route::link('site',
'index.php?option=com_users&task=registration.activate&token=' . $data['activation'],
false,
$linkMode
);
$emailSubject = Text::sprintf(
'COM_USERS_EMAIL_ACCOUNT_DETAILS',

View File

@ -41,8 +41,9 @@ class SampleField extends RadioField
*/
protected function getOptions()
{
$options = array();
$type = $this->form->getValue('db_type');
$options = array();
$type = $this->form->getValue('db_type');
$language = Factory::getLanguage();
// Some database drivers share DDLs; point these drivers to the correct parent
if ($type === 'mysqli')
@ -71,7 +72,7 @@ class SampleField extends RadioField
{
foreach ($files as $file)
{
$options[] = HTMLHelper::_('select.option', $file, Factory::getLanguage()->hasKey($key = 'INSTL_' . ($file = File::stripExt($file)) . '_SET') ?
$options[] = HTMLHelper::_('select.option', $file, $language->hasKey($key = 'INSTL_' . ($file = File::stripExt($file)) . '_SET') ?
HTMLHelper::_('tooltip', Text::_('INSTL_' . strtoupper($file = File::stripExt($file)) . '_SET_DESC'), '', '',
Text::_('JYES')
) : $file

View File

@ -411,7 +411,9 @@ class DatabaseModel extends BaseInstallationModel
}
else
{
throw new \RuntimeException(Text::sprintf('INSTL_DATABASE_INVALID_' . strtoupper($type) . '_VERSION', $db->getMinimum(), $db_version));
throw new \RuntimeException(
Text::sprintf('INSTL_DATABASE_INVALID_' . strtoupper($type) . '_VERSION', $db->getMinimum(), $db_version)
);
}
}
@ -674,7 +676,10 @@ class DatabaseModel extends BaseInstallationModel
{
if (!$installer->refreshManifestCache($extension->extension_id))
{
Factory::getApplication()->enqueueMessage(Text::sprintf('INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE', $extension->name), 'error');
Factory::getApplication()->enqueueMessage(
Text::sprintf('INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE', $extension->name),
'error'
);
return false;
}

View File

@ -83,11 +83,13 @@ class MetasRenderer extends DocumentRenderer
{
if ($type == 'http-equiv' && !($this->_doc->isHtml5() && $name == 'content-type'))
{
$buffer .= $tab . '<meta http-equiv="' . $name . '" content="' . htmlspecialchars($contents, ENT_COMPAT, 'UTF-8') . '">' . $lnEnd;
$buffer .= $tab . '<meta http-equiv="' . $name . '" content="'
. htmlspecialchars($contents, ENT_COMPAT, 'UTF-8') . '">' . $lnEnd;
}
elseif ($type != 'http-equiv' && !empty($contents))
{
$buffer .= $tab . '<meta ' . $type . '="' . $name . '" content="' . htmlspecialchars($contents, ENT_COMPAT, 'UTF-8') . '">' . $lnEnd;
$buffer .= $tab . '<meta ' . $type . '="' . $name . '" content="'
. htmlspecialchars($contents, ENT_COMPAT, 'UTF-8') . '">' . $lnEnd;
}
}
}

View File

@ -1304,7 +1304,8 @@ class ComponentAdapter extends InstallerAdapter
->where('('
. $db->quoteName('link') . ' LIKE ' . $db->quote('index.php?option=' . $option) . ' OR '
. $db->quoteName('link') . ' LIKE ' . $db->quote($db->escape('index.php?option=' . $option . '&') . '%', false)
. ')');
. ')'
);
if (isset($clientId))
{

View File

@ -288,9 +288,9 @@ class LanguageAdapter extends InstallerAdapter
{
$this->parent
->setPath(
'source',
($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/language/' . $this->parent->extension->element
);
'source',
($this->parent->extension->client_id ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/language/' . $this->parent->extension->element
);
}
$this->setManifest($this->parent->getManifest());
@ -386,11 +386,11 @@ class LanguageAdapter extends InstallerAdapter
{
$this->parent
->abort(
Text::sprintf(
'JLIB_INSTALLER_ABORT',
Text::sprintf('JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED', $this->parent->getPath('extension_site'))
)
);
Text::sprintf(
'JLIB_INSTALLER_ABORT',
Text::sprintf('JLIB_INSTALLER_ERROR_CREATE_FOLDER_FAILED', $this->parent->getPath('extension_site'))
)
);
return false;
}

View File

@ -44,7 +44,9 @@ class LibraryAdapter extends InstallerAdapter
if ($this->parent->isOverwrite() || $this->parent->isUpgrade())
{
// We can upgrade, so uninstall the old one
$installer = new Installer; // we don't want to compromise this instance!
// We don't want to compromise this instance!
$installer = new Installer;
$installer->setPackageUninstall(true);
$installer->uninstall('library', $this->currentExtensionId);

View File

@ -2126,7 +2126,7 @@ class Installer extends \JAdapter
{
case 'folder':
// Add any folders to the list
$folders[] = (string) $file; // add any folders to the list
$folders[] = (string) $file;
break;
case 'file':
@ -2188,7 +2188,7 @@ class Installer extends \JAdapter
if (!in_array(dirname((string) $file), $folders))
{
// Look if the file is now potentially in a folder
$files_deleted[] = (string) $file; // not in a folder, doesn't exist, wipe it out!
$files_deleted[] = (string) $file;
}
}
break;

View File

@ -108,6 +108,7 @@ abstract class BaseDatabaseModel extends BaseModel implements DatabaseModelInter
if ($factory)
{
$this->setMVCFactory($factory);
return;
}

View File

@ -84,7 +84,7 @@ class SiteMenu extends AbstractMenu
$currentDate = Factory::getDate()->toSql();
$query = $this->db->getQuery(true)
->select('m.id, m.menutype, m.title, m.alias, m.note, m.path AS route, m.link, m.type, m.level, m.language')
->select($this->db->quoteName('m.browserNav') . ', m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id')
->select($this->db->qn('m.browserNav') . ', m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id')
->select('e.element as component')
->from('#__menu AS m')
->join('LEFT', '#__extensions AS e ON m.component_id = e.extension_id')
@ -104,7 +104,8 @@ class SiteMenu extends AbstractMenu
try
{
/** @var CallbackController $cache */
$cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController('callback', ['defaultgroup' => 'com_menus']);
$cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class)
->createCacheController('callback', ['defaultgroup' => 'com_menus']);
$this->items = $cache->get($loader, array(), md5(get_class($this)), false);
}

View File

@ -41,7 +41,7 @@ class MysqlChangeItem extends ChangeItem
{
// Initialize fields in case we can't create a check query
// change status to skipped
// Change status to skipped
$this->checkStatus = -1;
$result = null;

View File

@ -40,7 +40,7 @@ class PostgresqlChangeItem extends ChangeItem
{
// Initialize fields in case we can't create a check query
// change status to skipped
// Change status to skipped
$this->checkStatus = -1;
$result = null;

View File

@ -40,7 +40,7 @@ class SqlsrvChangeItem extends ChangeItem
{
// Initialize fields in case we can't create a check query
// change status to skipped
// Change status to skipped
$this->checkStatus = -1;
$result = null;

View File

@ -119,7 +119,8 @@ class Session extends BaseSession
if (!empty($args[2]))
{
Log::add(
'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. The namespace should be prepended to the name instead.',
'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. '
. 'The namespace should be prepended to the name instead.',
Log::WARNING,
'deprecated'
);
@ -151,7 +152,8 @@ class Session extends BaseSession
if (!empty($args[2]))
{
Log::add(
'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. The namespace should be prepended to the name instead.',
'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. '
. 'The namespace should be prepended to the name instead.',
Log::WARNING,
'deprecated'
);
@ -182,7 +184,8 @@ class Session extends BaseSession
if (!empty($args[1]))
{
Log::add(
'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. The namespace should be prepended to the name instead.',
'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. '
. 'The namespace should be prepended to the name instead.',
Log::WARNING,
'deprecated'
);
@ -222,7 +225,8 @@ class Session extends BaseSession
if (func_num_args() > 1 && !empty($args[1]))
{
Log::add(
'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. The namespace should be prepended to the name instead.',
'Passing a namespace as a parameter to ' . __METHOD__ . '() is deprecated. '
. 'The namespace should be prepended to the name instead.',
Log::WARNING,
'deprecated'
);

View File

@ -88,7 +88,7 @@ class DropdownButton extends AbstractGroupButton
/**
* Render button HTML.
*
* @param array &$options The button options.
* @param array $options The button options.
*
* @return string The button HTML.
*

View File

@ -44,7 +44,8 @@ class MenuHelper
$key = 'menu_items' . $params . implode(',', $levels) . '.' . $base->id;
/** @var OutputController $cache */
$cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class)->createCacheController('output', ['defaultgroup' => 'mod_menu']);
$cache = Factory::getContainer()->get(CacheControllerFactoryInterface::class)
->createCacheController('output', ['defaultgroup' => 'mod_menu']);
if ($cache->contains($key))
{

View File

@ -128,13 +128,14 @@ class PlgSystemRemember extends CMSPlugin
}
/*
* But now, we need to do something
* But now, we need to do something
* Delete all tokens for this user!
*/
$db = Factory::getDbo();
$query = $db->getQuery(true)
->delete('#__user_keys')
->where($db->quoteName('user_id') . ' = ' . $db->quote($user['username']));
try
{
$db->setQuery($query)->execute();

View File

@ -94,11 +94,11 @@ class PlgSystemUpdatenotification extends CMSPlugin
$this->params->set('lastrun', $now);
$query = $this->db->getQuery(true)
->update($this->db->quoteName('#__extensions'))
->set($this->db->quoteName('params') . ' = ' . $this->db->quote($this->params->toString('JSON')))
->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin'))
->where($this->db->quoteName('folder') . ' = ' . $this->db->quote('system'))
->where($this->db->quoteName('element') . ' = ' . $this->db->quote('updatenotification'));
->update($this->db->quoteName('#__extensions'))
->set($this->db->quoteName('params') . ' = ' . $this->db->quote($this->params->toString('JSON')))
->where($this->db->quoteName('type') . ' = ' . $this->db->quote('plugin'))
->where($this->db->quoteName('folder') . ' = ' . $this->db->quote('system'))
->where($this->db->quoteName('element') . ' = ' . $this->db->quote('updatenotification'));
try
{
@ -361,9 +361,9 @@ class PlgSystemUpdatenotification extends CMSPlugin
try
{
$query = $this->db->getQuery(true)
->select($this->db->quoteName('user_id'))
->from($this->db->quoteName('#__user_usergroup_map'))
->where($this->db->quoteName('group_id') . ' IN(' . implode(',', $groups) . ')');
->select($this->db->quoteName('user_id'))
->from($this->db->quoteName('#__user_usergroup_map'))
->where($this->db->quoteName('group_id') . ' IN(' . implode(',', $groups) . ')');
$this->db->setQuery($query);
$rawUserIDs = $this->db->loadColumn(0);
@ -388,16 +388,16 @@ class PlgSystemUpdatenotification extends CMSPlugin
try
{
$query = $this->db->getQuery(true)
->select(
array(
$this->db->quoteName('id'),
$this->db->quoteName('username'),
$this->db->quoteName('email'),
)
)->from($this->db->quoteName('#__users'))
->where($this->db->quoteName('id') . ' IN(' . implode(',', $userIDs) . ')')
->where($this->db->quoteName('block') . ' = 0')
->where($this->db->quoteName('sendEmail') . ' = ' . $this->db->quote('1'));
->select(
array(
$this->db->quoteName('id'),
$this->db->quoteName('username'),
$this->db->quoteName('email'),
)
)->from($this->db->quoteName('#__users'))
->where($this->db->quoteName('id') . ' IN(' . implode(',', $userIDs) . ')')
->where($this->db->quoteName('block') . ' = 0')
->where($this->db->quoteName('sendEmail') . ' = ' . $this->db->quote('1'));
if (!empty($emails))
{

View File

@ -167,7 +167,7 @@ class PlgUserTerms extends CMSPlugin
'accountlink' => 'index.php?option=com_users&task=user.edit&id=' . $userId,
);
/* @var ActionlogsModelActionlog $model */
/** @var ActionlogsModelActionlog $model */
$model = BaseDatabaseModel::getInstance('Actionlog', 'ActionlogsModel');
$model->addLog(array($message), 'PLG_USER_TERMS_LOGGING_CONSENT_TO_TERMS', 'plg_user_terms', $userId);
}

View File

@ -52,12 +52,12 @@ else
$hasClass = '';
if ($this->countModules('sidebar-left'))
if ($this->countModules('sidebar-left'))
{
$hasClass .= ' has-sidebar-left';
}
if ($this->countModules('sidebar-right'))
if ($this->countModules('sidebar-right'))
{
$hasClass .= ' has-sidebar-right';
}