Fixed changelog direction so newest changes is listed at top of the file. Finished the init function of super powers. Adds rest function inside super power. Adds super powers to all templates. Updates many helper class methods to now use the utility classes. Adds the method to the component entry file (as-well). Moved most methods from the compiler fields class to powers. #955 Refactored many new builder classes from the registry class. Converted the Content class to two builder classes. Adds option to add additional templates to a module. Resolves #1002 by adding STRING instead of WORD. Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof Changed all CSS and JS to use instead of in compiler code. Adds option to turn jQuery off if UIKIT 3 is added. Adds option to auto write injection boilerplate code in Powers area. Adds option to auto write service provider boilerplate code in the Powers area. Improved the method and all banner locations to fetch from https://git.vdm.dev/joomla/jcb-external/ instead. Major stability improvements all over the new powers complier classes. New [base Registry class](https://git.vdm.dev/joomla/super-powers/src/branch/master/src/7e822c03-1b20-41d1-9427-f5b8d5836af7) has been created specially for JCB. Remember to update all plug-ins with this version update (use the package).

This commit is contained in:
2023-10-18 09:26:30 +02:00
parent a77eac9adf
commit e99899f6f1
632 changed files with 30604 additions and 16888 deletions

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\ArrayHelper;
$edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit";
@@ -72,7 +73,7 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
</div>
<?php
// setup the buttons
if (!isset($_buttons) || !ComponentbuilderHelper::checkArray($_buttons))
if (!isset($_buttons) || !ArrayHelper::check($_buttons))
{
$_buttons = array(
array(

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewAdmin_views extends HtmlView
$this->canState = $this->canDo->get('admin_view.edit.state');
$this->canCreate = $this->canDo->get('admin_view.create');
$this->canDelete = $this->canDo->get('admin_view.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('admin_view.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
$this->canState = $this->canDo->get('admin_custom_tabs.edit.state');
$this->canCreate = $this->canDo->get('admin_custom_tabs.create');
$this->canDelete = $this->canDo->get('admin_custom_tabs.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('admin_custom_tabs.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
$this->canState = $this->canDo->get('admin_fields.edit.state');
$this->canCreate = $this->canDo->get('admin_fields.create');
$this->canDelete = $this->canDo->get('admin_fields.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('admin_fields.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
$this->canState = $this->canDo->get('admin_fields_conditions.edit.state');
$this->canCreate = $this->canDo->get('admin_fields_conditions.create');
$this->canDelete = $this->canDo->get('admin_fields_conditions.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('admin_fields_conditions.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
$this->canState = $this->canDo->get('admin_fields_relations.edit.state');
$this->canCreate = $this->canDo->get('admin_fields_relations.create');
$this->canDelete = $this->canDo->get('admin_fields_relations.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('admin_fields_relations.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView
$this->canState = $this->canDo->get('class_extends.edit.state');
$this->canCreate = $this->canDo->get('class_extends.create');
$this->canDelete = $this->canDo->get('class_extends.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('class_extends.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewClass_methods extends HtmlView
$this->canState = $this->canDo->get('class_method.edit.state');
$this->canCreate = $this->canDo->get('class_method.create');
$this->canDelete = $this->canDo->get('class_method.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('class_method.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\StringHelper;
$edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_property.edit";
@@ -73,7 +74,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
<?php echo JText::_($item->visibility); ?>
</td>
<td class="hidden-phone">
<div><?php if (isset($item->joomla_plugin_group) && ComponentbuilderHelper::checkString($item->joomla_plugin_group)): ?>
<div><?php if (isset($item->joomla_plugin_group) && StringHelper::check($item->joomla_plugin_group)): ?>
<?php echo JText::_($item->extension_type); ?> <?php echo JText::_('COM_COMPONENTBUILDER_GROUP'); ?>: <b>
<?php echo $this->escape($item->joomla_plugin_group_name); ?></b>

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewClass_properties extends HtmlView
$this->canState = $this->canDo->get('class_property.edit.state');
$this->canCreate = $this->canDo->get('class_property.create');
$this->canDelete = $this->canDo->get('class_property.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('class_property.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -15,6 +15,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Form\Form;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Componentbuilder Html View class for the Compiler
@@ -64,10 +65,17 @@ class ComponentbuilderViewCompiler extends HtmlView
// we count of all the files are already there
else
{
$directory_path = JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/builder-gif";
// get all the gif files in the gif folder
$all_gifs = scandir(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/builder-gif");
$all_gifs = null;
if (is_dir($directory_path) && is_readable($directory_path))
{
$all_gifs = scandir($directory_path);
}
// check if we have any values
if (ComponentbuilderHelper::checkArray($all_gifs))
if ($all_gifs !== null && ArrayHelper::check($all_gifs))
{
// count number of files but remove the 2 dot values
$num_gifs = count($all_gifs) - 2;
@@ -113,7 +121,7 @@ class ComponentbuilderViewCompiler extends HtmlView
*/
public function getDynamicForm(): ?Form
{
if(ComponentbuilderHelper::checkArray($this->Components))
if(ArrayHelper::check($this->Components))
{
// start the form
$form = new Form('Builder');
@@ -545,8 +553,11 @@ class ComponentbuilderViewCompiler extends HtmlView
protected function setDocument()
{
// always make sure jquery is loaded.
JHtml::_('jquery.framework');
// Only load jQuery if needed. (default is true)
if ($this->params->get('add_jquery_framework', 1) == 1)
{
JHtml::_('jquery.framework');
}
// Load the header checker class.
require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );
// Initialize the header checker.
@@ -621,7 +632,7 @@ class ComponentbuilderViewCompiler extends HtmlView
// add marked library
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/custom/marked.js");
// add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/compiler.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/compiler.css', ['version' => 'auto']);
// Set the Custom JS script to view
$this->document->addScriptDeclaration("
function getComponentDetails_server(id){

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_admin_views extends HtmlView
$this->canState = $this->canDo->get('component_admin_views.edit.state');
$this->canCreate = $this->canDo->get('component_admin_views.create');
$this->canDelete = $this->canDo->get('component_admin_views.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_admin_views.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_config extends HtmlView
$this->canState = $this->canDo->get('component_config.edit.state');
$this->canCreate = $this->canDo->get('component_config.create');
$this->canDelete = $this->canDo->get('component_config.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_config.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_custom_admin_menus extends HtmlView
$this->canState = $this->canDo->get('component_custom_admin_menus.edit.state');
$this->canCreate = $this->canDo->get('component_custom_admin_menus.create');
$this->canDelete = $this->canDo->get('component_custom_admin_menus.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_custom_admin_menus.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_custom_admin_views extends HtmlView
$this->canState = $this->canDo->get('component_custom_admin_views.edit.state');
$this->canCreate = $this->canDo->get('component_custom_admin_views.create');
$this->canDelete = $this->canDo->get('component_custom_admin_views.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_custom_admin_views.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_dashboard extends HtmlView
$this->canState = $this->canDo->get('component_dashboard.edit.state');
$this->canCreate = $this->canDo->get('component_dashboard.create');
$this->canDelete = $this->canDo->get('component_dashboard.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_dashboard.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_files_folders extends HtmlView
$this->canState = $this->canDo->get('component_files_folders.edit.state');
$this->canCreate = $this->canDo->get('component_files_folders.create');
$this->canDelete = $this->canDo->get('component_files_folders.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_files_folders.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_modules extends HtmlView
$this->canState = $this->canDo->get('component_modules.edit.state');
$this->canCreate = $this->canDo->get('component_modules.create');
$this->canDelete = $this->canDo->get('component_modules.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_modules.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_mysql_tweaks extends HtmlView
$this->canState = $this->canDo->get('component_mysql_tweaks.edit.state');
$this->canCreate = $this->canDo->get('component_mysql_tweaks.create');
$this->canDelete = $this->canDo->get('component_mysql_tweaks.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_mysql_tweaks.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_placeholders extends HtmlView
$this->canState = $this->canDo->get('component_placeholders.edit.state');
$this->canCreate = $this->canDo->get('component_placeholders.create');
$this->canDelete = $this->canDo->get('component_placeholders.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_placeholders.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_plugins extends HtmlView
$this->canState = $this->canDo->get('component_plugins.edit.state');
$this->canCreate = $this->canDo->get('component_plugins.create');
$this->canDelete = $this->canDo->get('component_plugins.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_plugins.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_site_views extends HtmlView
$this->canState = $this->canDo->get('component_site_views.edit.state');
$this->canCreate = $this->canDo->get('component_site_views.create');
$this->canDelete = $this->canDo->get('component_site_views.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_site_views.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewComponents_updates extends HtmlView
$this->canState = $this->canDo->get('component_updates.edit.state');
$this->canCreate = $this->canDo->get('component_updates.create');
$this->canDelete = $this->canDo->get('component_updates.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('component_updates.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\StringHelper;
$edit = "index.php?option=com_componentbuilder&view=custom_admin_views&task=custom_admin_view.edit";
@@ -74,7 +75,7 @@ $edit = "index.php?option=com_componentbuilder&view=custom_admin_views&task=cust
<?php echo $this->escape($item->name); ?></b><br />
<?php echo JText::_('COM_COMPONENTBUILDER_CODE'); ?>: <b>
<?php echo $this->escape($item->codename); ?></b><br />
<?php if (ComponentbuilderHelper::checkString($item->context)): ?>
<?php if (StringHelper::check($item->context)): ?>
<?php echo JText::_('COM_COMPONENTBUILDER_CONTEXT'); ?>: <b>
<?php echo $this->escape($item->context); ?></b>
<?php endif; ?>

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewCustom_admin_views extends HtmlView
$this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('custom_admin_view.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewCustom_codes extends HtmlView
$this->canState = $this->canDo->get('custom_code.edit.state');
$this->canCreate = $this->canDo->get('custom_code.create');
$this->canDelete = $this->canDo->get('custom_code.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('custom_code.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewDynamic_gets extends HtmlView
$this->canState = $this->canDo->get('dynamic_get.edit.state');
$this->canCreate = $this->canDo->get('dynamic_get.create');
$this->canDelete = $this->canDo->get('dynamic_get.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('dynamic_get.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewFields extends HtmlView
$this->canState = $this->canDo->get('field.edit.state');
$this->canCreate = $this->canDo->get('field.create');
$this->canDelete = $this->canDo->get('field.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('field.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewFieldtypes extends HtmlView
$this->canState = $this->canDo->get('fieldtype.edit.state');
$this->canCreate = $this->canDo->get('fieldtype.create');
$this->canDelete = $this->canDo->get('fieldtype.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('fieldtype.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -14,6 +14,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Filesystem\File;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Get_snippets
@@ -59,15 +61,18 @@ class ComponentbuilderViewGet_snippets extends HtmlView
protected function setDocument()
{
// always make sure jquery is loaded.
JHtml::_('jquery.framework');
// Only load jQuery if needed. (default is true)
if ($this->params->get('add_jquery_framework', 1) == 1)
{
JHtml::_('jquery.framework');
}
// Load the header checker class.
require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );
// Initialize the header checker.
$HeaderCheck = new componentbuilderHeaderCheck;
// Add View JavaScript File
$this->document->addScript(JURI::root(true) . "/administrator/components/com_componentbuilder/assets/js/get_snippets.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
JHtml::_('script', "administrator/components/com_componentbuilder/assets/js/get_snippets.js", ['version' => 'auto']);
// Load uikit options.
$uikit = $this->params->get('uikit_load');
@@ -121,12 +126,12 @@ class ComponentbuilderViewGet_snippets extends HtmlView
}
}
// load the local snippets
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
$local_snippets = array();
foreach ($this->items as $item)
{
$path = ComponentbuilderHelper::safeString($item->library . ' - (' . $item->type . ') ' . $item->name, 'filename', '', false). '.json';
$path = StringHelper::safe($item->library . ' - (' . $item->type . ') ' . $item->name, 'filename', '', false). '.json';
$local_snippets[$path] = $item;
}
}
@@ -236,13 +241,13 @@ class ComponentbuilderViewGet_snippets extends HtmlView
}
");
// load the local snippets
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
// Set the local snippets array
$this->document->addScriptDeclaration("var local_snippets = ". json_encode($local_snippets).";");
}
// add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/get_snippets.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/get_snippets.css', ['version' => 'auto']);
}
/**

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewHelp_documents extends HtmlView
$this->canState = $this->canDo->get('help_document.edit.state');
$this->canCreate = $this->canDo->get('help_document.create');
$this->canDelete = $this->canDo->get('help_document.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('help_document.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\ArrayHelper;
JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
@@ -171,7 +172,7 @@ jQuery('<div id="loading"></div>')
<div id="installer-import">
<?php if (isset($this->hasPackage) && $this->hasPackage && $this->dataType === 'smart_package') : ?>
<?php
if (isset($this->packageInfo['name']) && ComponentbuilderHelper::checkArray($this->packageInfo['name']))
if (isset($this->packageInfo['name']) && ArrayHelper::check($this->packageInfo['name']))
{
$cAmount = count($this->packageInfo['name']);
$comP = ($cAmount == 1) ? 'Component' : 'Components';
@@ -181,7 +182,7 @@ jQuery('<div id="loading"></div>')
$cAmount = 1;
$comP = 'Component';
}
$hasOwner = (isset($this->packageInfo['getKeyFrom']) && ComponentbuilderHelper::checkArray($this->packageInfo['getKeyFrom'])) ? true:false;
$hasOwner = (isset($this->packageInfo['getKeyFrom']) && ArrayHelper::check($this->packageInfo['getKeyFrom'])) ? true:false;
$class1 = ($hasOwner) ? 'span6' : 'span12';
?>
<h3 style="color: #1F73BA;"><?php echo JText::_('COM_COMPONENTBUILDER_CONFIRMATION_STEP_BEFORE_IMPORTING'); ?></h3>
@@ -218,7 +219,7 @@ jQuery('<div id="loading"></div>')
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if (isset($this->packageInfo['name']) && ComponentbuilderHelper::checkArray($this->packageInfo['name'])) : ?>
<?php if (isset($this->packageInfo['name']) && ArrayHelper::check($this->packageInfo['name'])) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'jcbImportTab', 'info', JText::sprintf('COM_COMPONENTBUILDER_S_BEING_IMPORTED', $comP)); ?>
<?php echo \VDM\Joomla\Componentbuilder\Package\Factory::_('Display.Details')->components($this->packageInfo); ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
@@ -278,7 +279,7 @@ jQuery('<div id="loading"></div>')
</fieldset>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php if (isset($this->vdmPackages) && ComponentbuilderHelper::checkArray($this->vdmPackages)): ?>
<?php if (isset($this->vdmPackages) && ArrayHelper::check($this->vdmPackages)): ?>
<?php echo JHtml::_('bootstrap.addTab', 'jcbImportTab', 'url_vdm', JText::_('COM_COMPONENTBUILDER_VDM_PACKAGES', true)); ?>
<div class="span12" id="vdm_packages_installer">
<div class="alert alert-success">
@@ -309,7 +310,7 @@ jQuery('<div id="loading"></div>')
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if (isset($this->jcbPackages) && ComponentbuilderHelper::checkArray($this->jcbPackages)) : ?>
<?php if (isset($this->jcbPackages) && ArrayHelper::check($this->jcbPackages)) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'jcbImportTab', 'url_jcb', JText::_('COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES', true)); ?>
<div class="span12" id="jcb_packages_installer">
<div class="alert alert-success">
@@ -350,12 +351,12 @@ jQuery('<div id="loading"></div>')
</form>
</div>
<script type="text/javascript">
<?php if ((isset($this->vdmPackages) && $this->vdmPackages && ComponentbuilderHelper::checkArray($this->vdmPackages)) || (isset($this->jcbPackages) && $this->jcbPackages && ComponentbuilderHelper::checkArray($this->jcbPackages))): ?>
<?php if ((isset($this->vdmPackages) && $this->vdmPackages && ArrayHelper::check($this->vdmPackages)) || (isset($this->jcbPackages) && $this->jcbPackages && ArrayHelper::check($this->jcbPackages))): ?>
// set packages that are on the page
var packages = {};
jQuery(document).ready(function($)
{
<?php if (isset($this->jcbPackages) && $this->jcbPackages && ComponentbuilderHelper::checkArray($this->jcbPackages)): ?>
<?php if (isset($this->jcbPackages) && $this->jcbPackages && ArrayHelper::check($this->jcbPackages)): ?>
// get all jcb packages
jQuery("#jcb_package option").each(function()
{
@@ -363,7 +364,7 @@ jQuery(document).ready(function($)
packages[package] = 'jcb';
});
<?php endif; ?>
<?php if (isset($this->vdmPackages) && $this->vdmPackages && ComponentbuilderHelper::checkArray($this->vdmPackages)): ?>
<?php if (isset($this->vdmPackages) && $this->vdmPackages && ArrayHelper::check($this->vdmPackages)): ?>
// get all vdm packages
jQuery("#vdm_package option").each(function()
{

View File

@@ -13,6 +13,8 @@
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Import_joomla_components Html View
@@ -342,7 +344,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView
}
elseif ('vdm_package' === $type && in_array('vdm', $this->directories) && $vdmListObjects = ComponentbuilderHelper::getGithubRepoFileList('vdmGithubPackages', ComponentbuilderHelper::$vdmGithubPackagesUrl))
{
if (ComponentbuilderHelper::checkArray($vdmListObjects))
if (ArrayHelper::check($vdmListObjects))
{
// get the vdm_package list field
$vdm_package = JFormHelper::loadFieldType('list',true);
@@ -386,7 +388,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView
}
elseif ('jcb_package' === $type && in_array('jcb', $this->directories) && $jcbListObjects = ComponentbuilderHelper::getGithubRepoFileList('communityGithubPackages', ComponentbuilderHelper::$jcbGithubPackagesUrl))
{
if (ComponentbuilderHelper::checkArray($jcbListObjects))
if (ArrayHelper::check($jcbListObjects))
{
// get the jcb_package list field
$jcb_package = JFormHelper::loadFieldType('list',true);
@@ -434,7 +436,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView
public function setPackageName($name)
{
// return the name
return ComponentbuilderHelper::safeString( preg_replace('/(?<!^)([A-Z])/', '-\ \1', str_replace(array('.zip', 'JCB_'), '', $name)), 'W');
return StringHelper::safe( preg_replace('/(?<!^)([A-Z])/', '-\ \1', str_replace(array('.zip', 'JCB_'), '', $name)), 'W');
}
/**

View File

@@ -11,6 +11,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
@@ -76,7 +78,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
}
// setup the buttons
if (!isset($_buttons) || !ComponentbuilderHelper::checkArray($_buttons))
if (!isset($_buttons) || !ArrayHelper::check($_buttons))
{
$_buttons = array();
$_buttons[0] = array(
@@ -187,16 +189,16 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
</td>
<td class="hidden-phone">
<div><b><?php echo $this->escape($item->companyname); ?></b><br />
<?php if (ComponentbuilderHelper::checkString($item->author)) : ?>
<?php if (StringHelper::check($item->author)) : ?>
<em><?php echo $this->escape($item->author); ?><em><br />
<?php endif; ?>
<?php if (ComponentbuilderHelper::checkString($item->email) && ComponentbuilderHelper::checkString($item->author)) : ?>
<?php if (StringHelper::check($item->email) && StringHelper::check($item->author)) : ?>
<a href="mailto:<?php echo $this->escape($item->email); ?>" title="<?php echo JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $item->author); ?>" target="_blank">
<?php echo $this->escape($item->email); ?>
</a>
<br />
<?php endif; ?>
<?php if (ComponentbuilderHelper::checkString($item->website) && ComponentbuilderHelper::checkString($item->author)) : ?>
<?php if (StringHelper::check($item->website) && StringHelper::check($item->author)) : ?>
<a href="<?php echo $this->escape($item->website); ?>" title="<?php echo JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_OF_S', $item->companyname); ?>" target="_blank">
<?php echo $this->escape($item->website); ?>
</a>

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewJoomla_components extends HtmlView
$this->canState = $this->canDo->get('joomla_component.edit.state');
$this->canCreate = $this->canDo->get('joomla_component.create');
$this->canDelete = $this->canDo->get('joomla_component.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('joomla_component.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\ArrayHelper;
$edit = "index.php?option=com_componentbuilder&view=joomla_modules&task=joomla_module.edit";
@@ -71,7 +72,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_modules&task=joomla_m
</div>
<?php
// setup the buttons
if (!isset($_buttons) || !ComponentbuilderHelper::checkArray($_buttons))
if (!isset($_buttons) || !ArrayHelper::check($_buttons))
{
$_buttons = array();
$_buttons[0] = array(

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewJoomla_modules extends HtmlView
$this->canState = $this->canDo->get('joomla_module.edit.state');
$this->canCreate = $this->canDo->get('joomla_module.create');
$this->canDelete = $this->canDo->get('joomla_module.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('joomla_module.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewJoomla_modules_files_folders_urls extends HtmlView
$this->canState = $this->canDo->get('joomla_module_files_folders_urls.edit.state');
$this->canCreate = $this->canDo->get('joomla_module_files_folders_urls.create');
$this->canDelete = $this->canDo->get('joomla_module_files_folders_urls.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('joomla_module_files_folders_urls.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView
$this->canState = $this->canDo->get('joomla_module_updates.edit.state');
$this->canCreate = $this->canDo->get('joomla_module_updates.create');
$this->canDelete = $this->canDo->get('joomla_module_updates.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('joomla_module_updates.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -13,6 +13,7 @@
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Joomla_plugin Html View class
@@ -255,7 +256,7 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
// add a few field options via PHP
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
$tmp_ = JFormHelper::loadFieldType('joomlaplugingroups')->options;
if (ComponentbuilderHelper::checkArray($tmp_))
if (ArrayHelper::check($tmp_))
{
$_tmp = array();
foreach ($tmp_ as $item)
@@ -266,7 +267,7 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
$this->document->addScriptDeclaration("selectionArray['joomla_plugin_group'] = ". json_encode($_tmp) . ";");
}
$tmp_ = JFormHelper::loadFieldType('pluginsclassproperties')->options;
if (ComponentbuilderHelper::checkArray($tmp_))
if (ArrayHelper::check($tmp_))
{
$_tmp = array();
foreach ($tmp_ as $item)
@@ -277,7 +278,7 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
$this->document->addScriptDeclaration("selectionArray['property'] = ". json_encode($_tmp) . ";");
}
$tmp_ = JFormHelper::loadFieldType('pluginsclassmethods')->options;
if (ComponentbuilderHelper::checkArray($tmp_))
if (ArrayHelper::check($tmp_))
{
$_tmp = array();
foreach ($tmp_ as $item)

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewJoomla_plugin_groups extends HtmlView
$this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('joomla_plugin_group.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\ArrayHelper;
$edit = "index.php?option=com_componentbuilder&view=joomla_plugins&task=joomla_plugin.edit";
@@ -71,7 +72,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_plugins&task=joomla_p
</div>
<?php
// setup the buttons
if (!isset($_buttons) || !ComponentbuilderHelper::checkArray($_buttons))
if (!isset($_buttons) || !ArrayHelper::check($_buttons))
{
$_buttons = array();
$_buttons[0] = array(

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewJoomla_plugins extends HtmlView
$this->canState = $this->canDo->get('joomla_plugin.edit.state');
$this->canCreate = $this->canDo->get('joomla_plugin.create');
$this->canDelete = $this->canDo->get('joomla_plugin.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('joomla_plugin.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewJoomla_plugins_files_folders_urls extends HtmlView
$this->canState = $this->canDo->get('joomla_plugin_files_folders_urls.edit.state');
$this->canCreate = $this->canDo->get('joomla_plugin_files_folders_urls.create');
$this->canDelete = $this->canDo->get('joomla_plugin_files_folders_urls.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('joomla_plugin_files_folders_urls.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewJoomla_plugins_updates extends HtmlView
$this->canState = $this->canDo->get('joomla_plugin_updates.edit.state');
$this->canCreate = $this->canDo->get('joomla_plugin_updates.create');
$this->canDelete = $this->canDo->get('joomla_plugin_updates.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('joomla_plugin_updates.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,9 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
$edit = "index.php?option=com_componentbuilder&view=language_translations&task=language_translation.edit";
@@ -69,15 +72,15 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
<?php endif; ?>
<?php
$langBucket = array();
if (ComponentbuilderHelper::checkJson($item->translation))
if (JsonHelper::check($item->translation))
{
$translations = json_decode($item->translation, true);
if (ComponentbuilderHelper::checkArray($translations))
if (ArrayHelper::check($translations))
{
foreach ($translations as $language)
{
if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation'])
&& isset($language['language']) && ComponentbuilderHelper::checkString($language['language']))
if (isset($language['translation']) && StringHelper::check($language['translation'])
&& isset($language['language']) && StringHelper::check($language['language']))
{
$langBucket[$language['language']] = $language['language'];
}
@@ -87,11 +90,11 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
// start how many usedin's
$counterUsedin = array();
// set how many components use this string
if (ComponentbuilderHelper::checkJson($item->components))
if (JsonHelper::check($item->components))
{
$item->components = json_decode($item->components, true);
}
if (($number = ComponentbuilderHelper::checkArray($item->components)) !== false)
if (($number = ArrayHelper::check($item->components)) !== false)
{
if ($number == 1)
{
@@ -103,11 +106,11 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
}
}
// set how many modules use this string
if (ComponentbuilderHelper::checkJson($item->modules))
if (JsonHelper::check($item->modules))
{
$item->modules = json_decode($item->modules, true);
}
if (($number = ComponentbuilderHelper::checkArray($item->modules)) !== false)
if (($number = ArrayHelper::check($item->modules)) !== false)
{
if ($number == 1)
{
@@ -119,11 +122,11 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
}
}
// set how many plugins use this string
if (ComponentbuilderHelper::checkJson($item->plugins))
if (JsonHelper::check($item->plugins))
{
$item->plugins = json_decode($item->plugins, true);
}
if (($number = ComponentbuilderHelper::checkArray($item->plugins)) !== false)
if (($number = ArrayHelper::check($item->plugins)) !== false)
{
if ($number == 1)
{
@@ -136,12 +139,12 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
}
// build the numbers
$numbersUsedin = '';
if (ComponentbuilderHelper::checkArray($counterUsedin))
if (ArrayHelper::check($counterUsedin))
{
$numbersUsedin = '<br />' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . implode('<br />', $counterUsedin);
}
// load the languages to the string
if (ComponentbuilderHelper::checkArray($langBucket))
if (ArrayHelper::check($langBucket))
{
echo '<br /><small>' . JText::_('COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO') . ' <em>(' . implode(', ', $langBucket) . ')</em>' . $numbersUsedin . '</small>';
}

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewLanguage_translations extends HtmlView
$this->canState = $this->canDo->get('language_translation.edit.state');
$this->canCreate = $this->canDo->get('language_translation.create');
$this->canDelete = $this->canDo->get('language_translation.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('language_translation.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewLanguages extends HtmlView
$this->canState = $this->canDo->get('language.edit.state');
$this->canCreate = $this->canDo->get('language.create');
$this->canDelete = $this->canDo->get('language.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('language.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\StringHelper;
$edit = "index.php?option=com_componentbuilder&view=layouts&task=layout.edit";
@@ -67,7 +68,7 @@ $edit = "index.php?option=com_componentbuilder&view=layouts&task=layout.edit";
<?php else: ?>
<?php echo $this->escape($item->name); ?>
<?php endif; ?><br />
<code>&lt;?php echo JLayoutHelper::render('<?php echo ComponentbuilderHelper::safeString($item->alias); ?>', [?]); ?&gt;</code>
<code>&lt;?php echo JLayoutHelper::render('<?php echo StringHelper::safe($item->alias); ?>', [?]); ?&gt;</code>
</div>
</td>
<td class="hidden-phone">

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewLayouts extends HtmlView
$this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('layout.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\ArrayHelper;
$edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit";
@@ -74,7 +75,7 @@ $edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit"
$returnpath = urlencode(base64_encode((string) JUri::getInstance()));
}
// setup the buttons
if (!isset($_buttons) || !ComponentbuilderHelper::checkArray($_buttons))
if (!isset($_buttons) || !ArrayHelper::check($_buttons))
{
$_buttons = array(
array(

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewLibraries extends HtmlView
$this->canState = $this->canDo->get('library.edit.state');
$this->canCreate = $this->canDo->get('library.create');
$this->canDelete = $this->canDo->get('library.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('library.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewLibraries_config extends HtmlView
$this->canState = $this->canDo->get('library_config.edit.state');
$this->canCreate = $this->canDo->get('library_config.create');
$this->canDelete = $this->canDo->get('library_config.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('library_config.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewLibraries_files_folders_urls extends HtmlView
$this->canState = $this->canDo->get('library_files_folders_urls.edit.state');
$this->canCreate = $this->canDo->get('library_files_folders_urls.create');
$this->canDelete = $this->canDo->get('library_files_folders_urls.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('library_files_folders_urls.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewPlaceholders extends HtmlView
$this->canState = $this->canDo->get('placeholder.edit.state');
$this->canCreate = $this->canDo->get('placeholder.create');
$this->canDelete = $this->canDo->get('placeholder.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('placeholder.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -146,11 +146,6 @@ class ComponentbuilderViewPower extends HtmlView
{
JToolBarHelper::custom('power.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if ($this->canDo->get('power.sync'))
{
// add Sync button.
JToolBarHelper::custom('power.syncPowers', 'loop custom-button-syncpowers', '', 'COM_COMPONENTBUILDER_SYNC', false);
}
if ($this->canDo->get('power.reset'))
{
// add Reset button.

View File

@@ -84,8 +84,10 @@ jQuery('<div id="loading"></div>')
.css("display", "none")
.appendTo(outerDiv);
// when the build button is clicked
jQuery('#toolbar').on('click',"button.button-joomla", function(e){
jQuery('#toolbar').on('click',"button.custom-button-initpowers", function(e){
jQuery('#loading').show();
});
jQuery('#toolbar').on('click',"button.custom-button-resetpowers", function(e){
jQuery('#loading').show();
});
</script>

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewPowers extends HtmlView
$this->canState = $this->canDo->get('power.edit.state');
$this->canCreate = $this->canDo->get('power.create');
$this->canDelete = $this->canDo->get('power.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('power.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')
@@ -146,11 +146,6 @@ class ComponentbuilderViewPowers extends HtmlView
// add Init button.
JToolBarHelper::custom('powers.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
}
if ($this->user->authorise('power.sync', 'com_componentbuilder'))
{
// add Sync button.
JToolBarHelper::custom('powers.syncPowers', 'loop custom-button-syncpowers', '', 'COM_COMPONENTBUILDER_SYNC', false);
}
if ($this->user->authorise('power.reset', 'com_componentbuilder'))
{
// add Reset button.

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\ArrayHelper;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
@@ -144,7 +145,7 @@ $search_value = $this->form->getField('search_value');
</form>
<?php endif; ?>
</div>
<?php if (isset($this->item['tables']) && ComponentbuilderHelper::checkArray($this->item['tables'])) : ?>
<?php if (isset($this->item['tables']) && ArrayHelper::check($this->item['tables'])) : ?>
<script>
// To class="uk-autoload uk-progress" UIkit.notify

View File

@@ -16,6 +16,7 @@ use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Filesystem\File;
use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
use Joomla\CMS\Form\Form;
use VDM\Joomla\Utilities\ArrayHelper;
/**
* Componentbuilder Html View class for the Search
@@ -110,9 +111,9 @@ class ComponentbuilderViewSearch extends HtmlView
*/
public function getDynamicForm(): ?Form
{
if(ComponentbuilderHelper::checkArray($this->item) &&
ComponentbuilderHelper::checkArray($this->item['tables']) &&
ComponentbuilderHelper::checkArray($this->item['components']))
if(ArrayHelper::check($this->item) &&
ArrayHelper::check($this->item['tables']) &&
ArrayHelper::check($this->item['components']))
{
// start the form
$form = new Form('Search');
@@ -208,7 +209,7 @@ class ComponentbuilderViewSearch extends HtmlView
'name' => 'search_behaviour',
'label' => 'COM_COMPONENTBUILDER_BEHAVIOUR',
'description' => 'COM_COMPONENTBUILDER_SET_THE_SEARCH_BEHAVIOUR_HERE'];
if (ComponentbuilderHelper::checkArray($default))
if (ArrayHelper::check($default))
{
$attributes['default'] = implode(',', $default);
}
@@ -307,21 +308,24 @@ class ComponentbuilderViewSearch extends HtmlView
protected function setDocument()
{
// always make sure jquery is loaded.
JHtml::_('jquery.framework');
// Only load jQuery if needed. (default is true)
if ($this->params->get('add_jquery_framework', 1) == 1)
{
JHtml::_('jquery.framework');
}
// Load the header checker class.
require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );
// Initialize the header checker.
$HeaderCheck = new componentbuilderHeaderCheck;
// always load these files.
$this->document->addStyleSheet(JURI::root(true) . "/media/com_componentbuilder/datatable/css/datatables.min.css", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/pdfmake.min.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/vfs_fonts.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/datatables.min.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
JHtml::_('stylesheet', "media/com_componentbuilder/datatable/css/datatables.min.css", ['version' => 'auto']);
JHtml::_('script', "media/com_componentbuilder/datatable/js/pdfmake.min.js", ['version' => 'auto']);
JHtml::_('script', "media/com_componentbuilder/datatable/js/vfs_fonts.js", ['version' => 'auto']);
JHtml::_('script', "media/com_componentbuilder/datatable/js/datatables.min.js", ['version' => 'auto']);
// Add View JavaScript File
$this->document->addScript(JURI::root(true) . "/administrator/components/com_componentbuilder/assets/js/search.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
JHtml::_('script', "administrator/components/com_componentbuilder/assets/js/search.js", ['version' => 'auto']);
// Load uikit options.
$uikit = $this->params->get('uikit_load');
@@ -376,7 +380,7 @@ class ComponentbuilderViewSearch extends HtmlView
}
}
// add the document default css file
$this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/search.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/search.css', ['version' => 'auto']);
}
/**

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewServers extends HtmlView
$this->canState = $this->canDo->get('server.edit.state');
$this->canCreate = $this->canDo->get('server.create');
$this->canDelete = $this->canDo->get('server.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('server.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\StringHelper;
$edit = "index.php?option=com_componentbuilder&view=site_views&task=site_view.edit";
@@ -74,7 +75,7 @@ $edit = "index.php?option=com_componentbuilder&view=site_views&task=site_view.ed
<?php echo $this->escape($item->name); ?></b><br />
<?php echo JText::_('COM_COMPONENTBUILDER_CODE'); ?>: <b>
<?php echo $this->escape($item->codename); ?></b><br />
<?php if (ComponentbuilderHelper::checkString($item->context)): ?>
<?php if (StringHelper::check($item->context)): ?>
<?php echo JText::_('COM_COMPONENTBUILDER_CONTEXT'); ?>: <b>
<?php echo $this->escape($item->context); ?></b>
<?php endif; ?>

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewSite_views extends HtmlView
$this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('site_view.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewSnippet_types extends HtmlView
$this->canState = $this->canDo->get('snippet_type.edit.state');
$this->canCreate = $this->canDo->get('snippet_type.create');
$this->canDelete = $this->canDo->get('snippet_type.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('snippet_type.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewSnippets extends HtmlView
$this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('snippet.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\StringHelper;
$edit = "index.php?option=com_componentbuilder&view=templates&task=template.edit";
@@ -67,7 +68,7 @@ $edit = "index.php?option=com_componentbuilder&view=templates&task=template.edit
<?php else: ?>
<?php echo $this->escape($item->name); ?>
<?php endif; ?><br />
<code>&lt;?php echo $this->loadTemplate('<?php echo ComponentbuilderHelper::safeString($item->alias); ?>'); ?&gt;</code>
<code>&lt;?php echo $this->loadTemplate('<?php echo StringHelper::safe($item->alias); ?>'); ?&gt;</code>
</div>
</td>
<td class="hidden-phone">

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewTemplates extends HtmlView
$this->canState = $this->canDo->get('core.edit.state');
$this->canCreate = $this->canDo->get('core.create');
$this->canDelete = $this->canDo->get('core.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('template.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')

View File

@@ -52,7 +52,7 @@ class ComponentbuilderViewValidation_rules extends HtmlView
$this->canState = $this->canDo->get('validation_rule.edit.state');
$this->canCreate = $this->canDo->get('validation_rule.create');
$this->canDelete = $this->canDo->get('validation_rule.delete');
$this->canBatch = $this->canDo->get('core.batch');
$this->canBatch = ($this->canDo->get('validation_rule.batch') && $this->canDo->get('core.batch'));
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')