- md5
- 49a341464de1da4fcff83ffed1fc2d36
- sha1
- ded87b4e858d7d255e29c880e3224d521a46a4c1
- sha256
- 062d08b64c5ac7b06fbca3705582c2d604452ea380a1466842ba549e83edc996
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
<?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Plugin\Editors\TinyMCE\PluginTraits;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use RuntimeException;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Gets the active Site template style.
*
* @since 4.1.0
*/
trait ActiveSiteTemplate
{
/**
* Helper function to get the active Site template style.
*
* @return object
*
* @since 4.1.0
*/
protected function getActiveSiteTemplate()
{
$db = $this->getDatabase();
$query = $db->getQuery(true)
->select('*')
->from($db->quoteName('#__template_styles'))
->where(
[
$db->quoteName('client_id') . ' = 0',
$db->quoteName('home') . ' = ' . $db->quote('1'),
]
);
$db->setQuery($query);
try {
return $db->loadObject();
} catch (RuntimeException $e) {
$this->getApplication()->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return new \stdClass();
}
}
}
The same content is in 5 releases, Joomla 4.3.0-alpha3 to 4.3.0-beta4. See them all, or every version of this file.