Stable release of v3.2.0-beta1
Move beta to main repo. Fix #1053 so that the right and left tabs display correctly in Joomla 4&5.
This commit is contained in:
@ -12,7 +12,14 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Component\ComponentHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||
use Joomla\CMS\Layout\FileLayout;
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use VDM\Joomla\Utilities\ArrayHelper;
|
||||
use VDM\Joomla\Utilities\StringHelper;
|
||||
@ -26,11 +33,11 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
function display($tpl = null)
|
||||
{
|
||||
// get component params
|
||||
$this->params = JComponentHelper::getParams('com_componentbuilder');
|
||||
$this->params = ComponentHelper::getParams('com_componentbuilder');
|
||||
// get the application
|
||||
$this->app = JFactory::getApplication();
|
||||
$this->app = Factory::getApplication();
|
||||
// get the user object
|
||||
$this->user = JFactory::getUser();
|
||||
$this->user = Factory::getUser();
|
||||
// get global action permissions
|
||||
$this->canDo = ComponentbuilderHelper::getActions('get_snippets');
|
||||
// Initialise variables.
|
||||
@ -49,7 +56,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode(PHP_EOL, $errors), 500);
|
||||
throw new \Exception(implode(PHP_EOL, $errors), 500);
|
||||
}
|
||||
|
||||
parent::display($tpl);
|
||||
@ -64,15 +71,15 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
// Only load jQuery if needed. (default is true)
|
||||
if ($this->params->get('add_jquery_framework', 1) == 1)
|
||||
{
|
||||
JHtml::_('jquery.framework');
|
||||
Html::_('jquery.framework');
|
||||
}
|
||||
// Load the header checker class.
|
||||
require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );
|
||||
// Initialize the header checker.
|
||||
$HeaderCheck = new componentbuilderHeaderCheck;
|
||||
$HeaderCheck = new componentbuilderHeaderCheck();
|
||||
|
||||
// Add View JavaScript File
|
||||
JHtml::_('script', "administrator/components/com_componentbuilder/assets/js/get_snippets.js", ['version' => 'auto']);
|
||||
Html::_('script', "administrator/components/com_componentbuilder/assets/js/get_snippets.js", ['version' => 'auto']);
|
||||
|
||||
// Load uikit options.
|
||||
$uikit = $this->params->get('uikit_load');
|
||||
@ -84,27 +91,25 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
// The uikit css.
|
||||
if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
|
||||
{
|
||||
JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']);
|
||||
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']);
|
||||
}
|
||||
// The uikit js.
|
||||
if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
|
||||
{
|
||||
JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
|
||||
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
|
||||
}
|
||||
|
||||
// Load the script to find all uikit components needed.
|
||||
if ($uikit != 2)
|
||||
{
|
||||
// Set the default uikit components in this view.
|
||||
$uikitComp = array();
|
||||
$uikitComp = [];
|
||||
$uikitComp[] = 'data-uk-grid';
|
||||
}
|
||||
|
||||
// Load the needed uikit components in this view.
|
||||
if ($uikit != 2 && isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp))
|
||||
if ($uikit != 2 && isset($uikitComp) && ArrayHelper::check($uikitComp))
|
||||
{
|
||||
// load just in case.
|
||||
jimport('joomla.filesystem.file');
|
||||
// loading...
|
||||
foreach ($uikitComp as $class)
|
||||
{
|
||||
@ -114,13 +119,13 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
|
||||
{
|
||||
// load the css.
|
||||
JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
||||
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
||||
}
|
||||
// check if the JavaScript file exists.
|
||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
|
||||
{
|
||||
// load the js.
|
||||
JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
||||
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -137,9 +142,9 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
}
|
||||
|
||||
// Add the JavaScript for JStore
|
||||
$this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jquery.json.min.js');
|
||||
$this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jstorage.min.js');
|
||||
$this->document->addScript(JURI::root() .'media/com_componentbuilder/js/strtotime.js');
|
||||
Html::_('script', 'media/com_componentbuilder/js/jquery.json.min.js', ['version' => 'auto']);
|
||||
Html::_('script', 'media/com_componentbuilder/js/jstorage.min.js', ['version' => 'auto']);
|
||||
Html::_('script', 'media/com_componentbuilder/js/strtotime.js', ['version' => 'auto']);
|
||||
// check if we should use browser storage
|
||||
$setBrowserStorage = $this->params->get('set_browser_storage', null);
|
||||
if ($setBrowserStorage)
|
||||
@ -149,7 +154,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
if ('global' == $storageTimeToLive)
|
||||
{
|
||||
// use the global session time
|
||||
$session = JFactory::getSession();
|
||||
$session = Factory::getSession();
|
||||
// must have itin milliseconds
|
||||
$expire = ($session->getExpire()*60)* 1000;
|
||||
}
|
||||
@ -183,59 +188,59 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
$this->document->addScriptDeclaration("bulkItems.ahead = [];");
|
||||
$this->document->addScriptDeclaration("bulkItems.behind = [];");
|
||||
// set an error message if needed
|
||||
$this->document->addScriptDeclaration("var returnError = '<div class=\"uk-alert uk-alert-warning\"><h1>".JText::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."!</h1><p>".JText::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".</p></div>';");
|
||||
$this->document->addScriptDeclaration("var returnError = '<div class=\"uk-alert uk-alert-warning\"><h1>".Text::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."!</h1><p>".Text::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".</p></div>';");
|
||||
// need to add some language strings
|
||||
JText::script('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS');
|
||||
JText::script('COM_COMPONENTBUILDER_SNIPPETS');
|
||||
JText::script('COM_COMPONENTBUILDER_SNIPPET');
|
||||
JText::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION');
|
||||
JText::script('COM_COMPONENTBUILDER_GET_SNIPPET');
|
||||
JText::script('COM_COMPONENTBUILDER_LOCAL_SNIPPET');
|
||||
JText::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION');
|
||||
JText::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY');
|
||||
JText::script('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION');
|
||||
JText::script('COM_COMPONENTBUILDER_USAGE');
|
||||
JText::script('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION');
|
||||
JText::script('COM_COMPONENTBUILDER_DESCRIPTION');
|
||||
JText::script('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION');
|
||||
JText::script('COM_COMPONENTBUILDER_VIEW_BLAME');
|
||||
JText::script('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET');
|
||||
JText::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL');
|
||||
JText::script('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED');
|
||||
JText::script('COM_COMPONENTBUILDER_SNIPPETS_COULD_NOT_BE_UPDATEDSAVED');
|
||||
JText::script('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR');
|
||||
JText::script('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS');
|
||||
JText::script('COM_COMPONENTBUILDER_JCB_COMMUNITY');
|
||||
JText::script('COM_COMPONENTBUILDER_COMPANY_NAME');
|
||||
JText::script('COM_COMPONENTBUILDER_AUTHOR_NAME');
|
||||
JText::script('COM_COMPONENTBUILDER_AUTHOR_EMAIL');
|
||||
JText::script('COM_COMPONENTBUILDER_AUTHOR_WEBSITE');
|
||||
JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME');
|
||||
JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME');
|
||||
JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME');
|
||||
JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME');
|
||||
JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME');
|
||||
JText::script('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES');
|
||||
JText::script('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS');
|
||||
Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS');
|
||||
Text::script('COM_COMPONENTBUILDER_SNIPPETS');
|
||||
Text::script('COM_COMPONENTBUILDER_SNIPPET');
|
||||
Text::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION');
|
||||
Text::script('COM_COMPONENTBUILDER_GET_SNIPPET');
|
||||
Text::script('COM_COMPONENTBUILDER_LOCAL_SNIPPET');
|
||||
Text::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION');
|
||||
Text::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY');
|
||||
Text::script('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION');
|
||||
Text::script('COM_COMPONENTBUILDER_USAGE');
|
||||
Text::script('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION');
|
||||
Text::script('COM_COMPONENTBUILDER_DESCRIPTION');
|
||||
Text::script('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION');
|
||||
Text::script('COM_COMPONENTBUILDER_VIEW_BLAME');
|
||||
Text::script('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET');
|
||||
Text::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL');
|
||||
Text::script('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED');
|
||||
Text::script('COM_COMPONENTBUILDER_SNIPPETS_COULD_NOT_BE_UPDATEDSAVED');
|
||||
Text::script('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR');
|
||||
Text::script('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS');
|
||||
Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY');
|
||||
Text::script('COM_COMPONENTBUILDER_COMPANY_NAME');
|
||||
Text::script('COM_COMPONENTBUILDER_AUTHOR_NAME');
|
||||
Text::script('COM_COMPONENTBUILDER_AUTHOR_EMAIL');
|
||||
Text::script('COM_COMPONENTBUILDER_AUTHOR_WEBSITE');
|
||||
Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME');
|
||||
Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME');
|
||||
Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME');
|
||||
Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME');
|
||||
Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME');
|
||||
Text::script('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES');
|
||||
Text::script('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS');
|
||||
// add some lang verfy messages
|
||||
$this->document->addScriptDeclaration("
|
||||
// set the snippet from gitHub
|
||||
function getConfirmUpdate(status) {
|
||||
switch(status) {
|
||||
case 'new':
|
||||
return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_ADD_THIS_NEW_JCB_COMMUNITY_SNIPPET_TO_YOUR_LOCAL_SNIPPETS')."';
|
||||
return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_ADD_THIS_NEW_JCB_COMMUNITY_SNIPPET_TO_YOUR_LOCAL_SNIPPETS')."';
|
||||
break;
|
||||
case 'behind':
|
||||
return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET')."';
|
||||
return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET')."';
|
||||
break;
|
||||
case 'ahead':
|
||||
return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET')."';
|
||||
return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET')."';
|
||||
break;
|
||||
case 'diverged':
|
||||
return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET')."';
|
||||
return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET')."';
|
||||
break;
|
||||
default:
|
||||
return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE')."';
|
||||
return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE')."';
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -247,7 +252,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
$this->document->addScriptDeclaration("var local_snippets = ". json_encode($local_snippets).";");
|
||||
}
|
||||
// add the document default css file
|
||||
JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/get_snippets.css', ['version' => 'auto']);
|
||||
Html::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/get_snippets.css', ['version' => 'auto']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -258,51 +263,51 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
// hide the main menu
|
||||
$this->app->input->set('hidemainmenu', true);
|
||||
// add title to the page
|
||||
JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_GET_SNIPPETS'),'search');
|
||||
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_GET_SNIPPETS'),'search');
|
||||
// add cpanel button
|
||||
JToolBarHelper::custom('get_snippets.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false);
|
||||
ToolbarHelper::custom('get_snippets.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false);
|
||||
if ($this->canDo->get('get_snippets.custom_admin_views'))
|
||||
{
|
||||
// add Custom Admin Views button.
|
||||
JToolBarHelper::custom('get_snippets.openCustomAdminViews', 'screen custom-button-opencustomadminviews', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false);
|
||||
ToolbarHelper::custom('get_snippets.openCustomAdminViews', 'screen custom-button-opencustomadminviews', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false);
|
||||
}
|
||||
if ($this->canDo->get('get_snippets.site_views'))
|
||||
{
|
||||
// add Site Views button.
|
||||
JToolBarHelper::custom('get_snippets.openSiteViews', 'palette custom-button-opensiteviews', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false);
|
||||
ToolbarHelper::custom('get_snippets.openSiteViews', 'palette custom-button-opensiteviews', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false);
|
||||
}
|
||||
if ($this->canDo->get('get_snippets.templates'))
|
||||
{
|
||||
// add Templates button.
|
||||
JToolBarHelper::custom('get_snippets.openTemplates', 'brush custom-button-opentemplates', '', 'COM_COMPONENTBUILDER_TEMPLATES', false);
|
||||
ToolbarHelper::custom('get_snippets.openTemplates', 'brush custom-button-opentemplates', '', 'COM_COMPONENTBUILDER_TEMPLATES', false);
|
||||
}
|
||||
if ($this->canDo->get('get_snippets.layouts'))
|
||||
{
|
||||
// add Layouts button.
|
||||
JToolBarHelper::custom('get_snippets.openLayouts', 'brush custom-button-openlayouts', '', 'COM_COMPONENTBUILDER_LAYOUTS', false);
|
||||
ToolbarHelper::custom('get_snippets.openLayouts', 'brush custom-button-openlayouts', '', 'COM_COMPONENTBUILDER_LAYOUTS', false);
|
||||
}
|
||||
if ($this->canDo->get('get_snippets.snippets'))
|
||||
{
|
||||
// add Snippets button.
|
||||
JToolBarHelper::custom('get_snippets.openSnippets', 'pin custom-button-opensnippets', '', 'COM_COMPONENTBUILDER_SNIPPETS', false);
|
||||
ToolbarHelper::custom('get_snippets.openSnippets', 'pin custom-button-opensnippets', '', 'COM_COMPONENTBUILDER_SNIPPETS', false);
|
||||
}
|
||||
if ($this->canDo->get('get_snippets.libraries'))
|
||||
{
|
||||
// add Libraries button.
|
||||
JToolBarHelper::custom('get_snippets.openLibraries', 'puzzle custom-button-openlibraries', '', 'COM_COMPONENTBUILDER_LIBRARIES', false);
|
||||
ToolbarHelper::custom('get_snippets.openLibraries', 'puzzle custom-button-openlibraries', '', 'COM_COMPONENTBUILDER_LIBRARIES', false);
|
||||
}
|
||||
|
||||
// set help url for this view if found
|
||||
$this->help_url = ComponentbuilderHelper::getHelpUrl('get_snippets');
|
||||
if (ComponentbuilderHelper::checkString($this->help_url))
|
||||
if (StringHelper::check($this->help_url))
|
||||
{
|
||||
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
|
||||
ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
|
||||
}
|
||||
|
||||
// add the options comp button
|
||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_componentbuilder');
|
||||
ToolbarHelper::preferences('com_componentbuilder');
|
||||
}
|
||||
}
|
||||
|
||||
@ -316,6 +321,16 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
||||
public function escape($var)
|
||||
{
|
||||
// use the helper htmlEscape method instead.
|
||||
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
|
||||
return StringHelper::html($var, $this->_charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Document (helper method toward Joomla 4 and 5)
|
||||
*/
|
||||
public function getDocument()
|
||||
{
|
||||
$this->document ??= JFactory::getDocument();
|
||||
|
||||
return $this->document;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user