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:
2024-03-02 22:10:30 +02:00
parent 3c91a5cdbb
commit d1e1a56671
1786 changed files with 73608 additions and 37437 deletions

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,71 +12,70 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('admin_custom_tabs.tabs_above', $this); ?>
<?php echo LayoutHelper::render('admin_custom_tabs.tabs_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'admin_custom_tabsTab', array('active' => 'tabs')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'admin_custom_tabsTab', ['active' => 'tabs', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_custom_tabsTab', 'tabs', JText::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_TABS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_custom_tabsTab', 'tabs', Text::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_TABS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_custom_tabs.tabs_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_custom_tabs.tabs_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'admin_custom_tabsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_custom_tabs.edit.created_by') || $this->canDo->get('admin_custom_tabs.edit.created') || $this->canDo->get('admin_custom_tabs.edit.state') || ($this->canDo->get('admin_custom_tabs.delete') && $this->canDo->get('admin_custom_tabs.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_custom_tabsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_custom_tabsTab', 'publishing', Text::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_custom_tabs.publishing', $this); ?>
<?php echo LayoutHelper::render('admin_custom_tabs.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_custom_tabs.publlshing', $this); ?>
<?php echo LayoutHelper::render('admin_custom_tabs.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_custom_tabsTab', 'permissions', JText::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_custom_tabsTab', 'permissions', Text::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -91,14 +90,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="admin_custom_tabs.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Admin_custom_tabs Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_custom_tabs', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('admin_custom_tabs.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('admin_custom_tabs.edit'))
{
// We can save the record.
JToolBarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('admin_custom_tabs.create'))
{
JToolBarHelper::apply('admin_custom_tabs.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('admin_custom_tabs.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('admin_custom_tabs.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('admin_custom_tabs.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('admin_custom_tabs.edit'))
{
// We can save the new record
JToolBarHelper::apply('admin_custom_tabs.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('admin_custom_tabs.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_custom_tabs.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('admin_custom_tabs.create'))
{
JToolBarHelper::custom('admin_custom_tabs.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('admin_custom_tabs.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('admin_custom_tabs.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('admin_custom_tabs.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.admin_custom_tabs', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.admin_custom_tabs', $this->item->id);
}
if ($this->canDo->get('admin_custom_tabs.create'))
{
JToolBarHelper::custom('admin_custom_tabs.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('admin_custom_tabs.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_custom_tabs.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admin_custom_tabs');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,20 +196,26 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_custom_tabs.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_custom_tabs/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_custom_tabs.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/admin_custom_tabs/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,71 +12,70 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('admin_fields.fields_above', $this); ?>
<?php echo LayoutHelper::render('admin_fields.fields_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'admin_fieldsTab', array('active' => 'fields')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'admin_fieldsTab', ['active' => 'fields', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fieldsTab', 'fields', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELDS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fieldsTab', 'fields', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELDS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_fields.fields_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_fields.fields_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'admin_fieldsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_fields.edit.created_by') || $this->canDo->get('admin_fields.edit.created') || $this->canDo->get('admin_fields.edit.state') || ($this->canDo->get('admin_fields.delete') && $this->canDo->get('admin_fields.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fieldsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fieldsTab', 'publishing', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_fields.publishing', $this); ?>
<?php echo LayoutHelper::render('admin_fields.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_fields.publlshing', $this); ?>
<?php echo LayoutHelper::render('admin_fields.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fieldsTab', 'permissions', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fieldsTab', 'permissions', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -91,14 +90,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="admin_fields.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Admin_fields Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('admin_fields.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('admin_fields.edit'))
{
// We can save the record.
JToolBarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('admin_fields.create'))
{
JToolBarHelper::apply('admin_fields.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('admin_fields.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('admin_fields.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('admin_fields.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('admin_fields.edit'))
{
// We can save the new record
JToolBarHelper::apply('admin_fields.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('admin_fields.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_fields.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('admin_fields.create'))
{
JToolBarHelper::custom('admin_fields.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('admin_fields.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('admin_fields.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('admin_fields.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.admin_fields', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.admin_fields', $this->item->id);
}
if ($this->canDo->get('admin_fields.create'))
{
JToolBarHelper::custom('admin_fields.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('admin_fields.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_fields.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admin_fields');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,35 +196,41 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_fields.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_fields.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/admin_fields/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
// add the Uikit v2 extra style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 extra JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
JText::script('COM_COMPONENTBUILDER_THE_BNONE_DBB_OPTION_WILL_REMOVE_THIS_FIELD_FROM_BEING_SAVED_IN_THE_DATABASE');
JText::script('COM_COMPONENTBUILDER_ONLY_USE_THE_BNONE_DBB_OPTION_IF_YOU_ARE_PLANNING_ON_TARGETING_THIS_FIELD_WITH_JAVASCRIPTCUSTOM_PHP_TO_MOVE_ITS_VALUE_INTO_ANOTHER_FIELD_THAT_DOES_GET_SAVED_TO_THE_DATABASE');
JText::script('COM_COMPONENTBUILDER_THE_BSHOW_IN_ALL_LIST_VIEWSB_OPTION_WILL_ADD_THIS_FIELD_TO_ALL_LIST_VIEWS_ADMIN_AMP_LINKED');
JText::script('COM_COMPONENTBUILDER_THE_BONLY_IN_ADMIN_LIST_VIEWB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_ADMIN_LIST_VIEW_NOT_TO_ANY_LINKED_VIEWS');
JText::script('COM_COMPONENTBUILDER_THE_BONLY_IN_LINKED_LIST_VIEWSB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_LINKED_LIST_VIEW_IF_THIS_VIEW_GETS_LINKED_TO_OTHER_VIEW_NOT_TO_THIS_ADMIN_LIST_VIEW');
JText::script('COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_NOT_AVAILABLE_TO_THE_FIELD_IF_BNONE_DBB_OPTION_IS_SELECTED');
JText::script('COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_ONLY_AVAILABLE_TO_THE_FIELD_IF_BSHOW_IN_LIST_VIEWB_OPTION_IS_SELECTED');
JText::script('COM_COMPONENTBUILDER_THE_BMULTI_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_MORE_THEN_ONE_VALUE_IN_THIS_FILTERFIELD_PLEASE_NOTE_THAT_THIS_OPTION_BONLY_WORKSB_WITH_THE_BNEWB_FILTERS_THAT_LOAD_ABOVE_THE_ADMIN_LIST_VIEW_YOU_CAN_SELECT_THE_NEW_FILTER_OPTION_WHENWHERE_YOU_ADD_THE_VIEW_TO_THE_COMPONENT');
JText::script('COM_COMPONENTBUILDER_THE_BSINGLE_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_JUST_ONE_VALUE_IN_THIS_FILTERFIELD');
JText::script('view not acceptable. Error');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
Text::script('COM_COMPONENTBUILDER_THE_BNONE_DBB_OPTION_WILL_REMOVE_THIS_FIELD_FROM_BEING_SAVED_IN_THE_DATABASE');
Text::script('COM_COMPONENTBUILDER_ONLY_USE_THE_BNONE_DBB_OPTION_IF_YOU_ARE_PLANNING_ON_TARGETING_THIS_FIELD_WITH_JAVASCRIPTCUSTOM_PHP_TO_MOVE_ITS_VALUE_INTO_ANOTHER_FIELD_THAT_DOES_GET_SAVED_TO_THE_DATABASE');
Text::script('COM_COMPONENTBUILDER_THE_BSHOW_IN_ALL_LIST_VIEWSB_OPTION_WILL_ADD_THIS_FIELD_TO_ALL_LIST_VIEWS_ADMIN_AMP_LINKED');
Text::script('COM_COMPONENTBUILDER_THE_BONLY_IN_ADMIN_LIST_VIEWB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_ADMIN_LIST_VIEW_NOT_TO_ANY_LINKED_VIEWS');
Text::script('COM_COMPONENTBUILDER_THE_BONLY_IN_LINKED_LIST_VIEWSB_OPTION_WILL_ONLY_ADD_THIS_FIELD_TO_THE_LINKED_LIST_VIEW_IF_THIS_VIEW_GETS_LINKED_TO_OTHER_VIEW_NOT_TO_THIS_ADMIN_LIST_VIEW');
Text::script('COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_NOT_AVAILABLE_TO_THE_FIELD_IF_BNONE_DBB_OPTION_IS_SELECTED');
Text::script('COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_ONLY_AVAILABLE_TO_THE_FIELD_IF_BSHOW_IN_LIST_VIEWB_OPTION_IS_SELECTED');
Text::script('COM_COMPONENTBUILDER_THE_BMULTI_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_MORE_THEN_ONE_VALUE_IN_THIS_FILTERFIELD_PLEASE_NOTE_THAT_THIS_OPTION_BONLY_WORKSB_WITH_THE_BNEWB_FILTERS_THAT_LOAD_ABOVE_THE_ADMIN_LIST_VIEW_YOU_CAN_SELECT_THE_NEW_FILTER_OPTION_WHENWHERE_YOU_ADD_THE_VIEW_TO_THE_COMPONENT');
Text::script('COM_COMPONENTBUILDER_THE_BSINGLE_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_JUST_ONE_VALUE_IN_THIS_FILTERFIELD');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,71 +12,70 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('admin_fields_conditions.conditions_above', $this); ?>
<?php echo LayoutHelper::render('admin_fields_conditions.conditions_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'admin_fields_conditionsTab', array('active' => 'conditions')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'admin_fields_conditionsTab', ['active' => 'conditions', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_conditionsTab', 'conditions', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CONDITIONS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fields_conditionsTab', 'conditions', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CONDITIONS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_fields_conditions.conditions_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_fields_conditions.conditions_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'admin_fields_conditionsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_fields_conditions.edit.created_by') || $this->canDo->get('admin_fields_conditions.edit.created') || $this->canDo->get('admin_fields_conditions.edit.state') || ($this->canDo->get('admin_fields_conditions.delete') && $this->canDo->get('admin_fields_conditions.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_conditionsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fields_conditionsTab', 'publishing', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_fields_conditions.publishing', $this); ?>
<?php echo LayoutHelper::render('admin_fields_conditions.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_fields_conditions.publlshing', $this); ?>
<?php echo LayoutHelper::render('admin_fields_conditions.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_conditionsTab', 'permissions', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fields_conditionsTab', 'permissions', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -91,14 +90,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="admin_fields_conditions.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>
@ -132,13 +131,13 @@ jQuery(document).ready(function(){
});
<?php
$app = JFactory::getApplication();
$app = Factory::getApplication();
?>
function JRouter(link) {
<?php
if ($app->isClient('site'))
{
echo 'var url = "'.JURI::root().'";';
echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";';
}
else
{

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Admin_fields_conditions Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('admin_fields_conditions.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('admin_fields_conditions.edit'))
{
// We can save the record.
JToolBarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('admin_fields_conditions.create'))
{
JToolBarHelper::apply('admin_fields_conditions.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('admin_fields_conditions.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('admin_fields_conditions.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('admin_fields_conditions.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('admin_fields_conditions.edit'))
{
// We can save the new record
JToolBarHelper::apply('admin_fields_conditions.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('admin_fields_conditions.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_fields_conditions.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('admin_fields_conditions.create'))
{
JToolBarHelper::custom('admin_fields_conditions.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('admin_fields_conditions.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('admin_fields_conditions.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('admin_fields_conditions.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.admin_fields_conditions', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.admin_fields_conditions', $this->item->id);
}
if ($this->canDo->get('admin_fields_conditions.create'))
{
JToolBarHelper::custom('admin_fields_conditions.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('admin_fields_conditions.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_fields_conditions.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admin_fields_conditions');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,22 +196,28 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_fields_conditions.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_fields_conditions.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields_conditions/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/admin_fields_conditions/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,71 +12,70 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('admin_fields_relations.relations_above', $this); ?>
<?php echo LayoutHelper::render('admin_fields_relations.relations_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'admin_fields_relationsTab', array('active' => 'relations')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'admin_fields_relationsTab', ['active' => 'relations', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_relationsTab', 'relations', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_RELATIONS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fields_relationsTab', 'relations', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_RELATIONS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_fields_relations.relations_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_fields_relations.relations_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'admin_fields_relationsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_fields_relations.edit.created_by') || $this->canDo->get('admin_fields_relations.edit.created') || $this->canDo->get('admin_fields_relations.edit.state') || ($this->canDo->get('admin_fields_relations.delete') && $this->canDo->get('admin_fields_relations.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_relationsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fields_relationsTab', 'publishing', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_fields_relations.publishing', $this); ?>
<?php echo LayoutHelper::render('admin_fields_relations.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_fields_relations.publlshing', $this); ?>
<?php echo LayoutHelper::render('admin_fields_relations.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_fields_relationsTab', 'permissions', JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_fields_relationsTab', 'permissions', Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -91,14 +90,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="admin_fields_relations.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>
@ -110,13 +109,13 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php
$app = JFactory::getApplication();
$app = Factory::getApplication();
?>
function JRouter(link) {
<?php
if ($app->isClient('site'))
{
echo 'var url = "'.JURI::root().'";';
echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";';
}
else
{

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Admin_fields_relations Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('admin_fields_relations.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('admin_fields_relations.edit'))
{
// We can save the record.
JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('admin_fields_relations.create'))
{
JToolBarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('admin_fields_relations.edit'))
{
// We can save the new record
JToolBarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('admin_fields_relations.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_fields_relations.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('admin_fields_relations.create'))
{
JToolBarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('admin_fields_relations.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('admin_fields_relations.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('admin_fields_relations.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.admin_fields_relations', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.admin_fields_relations', $this->item->id);
}
if ($this->canDo->get('admin_fields_relations.create'))
{
JToolBarHelper::custom('admin_fields_relations.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('admin_fields_relations.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_fields_relations.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admin_fields_relations');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,26 +196,32 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_fields_relations.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_fields_relations.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_fields_relations/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/admin_fields_relations/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';");
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,169 +12,168 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('admin_view.details_above', $this); ?>
<?php echo LayoutHelper::render('admin_view.details_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'admin_viewTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'admin_viewTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'details', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_DETAILS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'details', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_view.details_left', $this); ?>
<?php echo LayoutHelper::render('admin_view.details_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_view.details_right', $this); ?>
<?php echo LayoutHelper::render('admin_view.details_right', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.details_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.details_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'settings', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SETTINGS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'settings', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SETTINGS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.settings_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.settings_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'fields', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'fields', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_FIELDS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_view.fields_left', $this); ?>
<?php echo LayoutHelper::render('admin_view.fields_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_view.fields_right', $this); ?>
<?php echo LayoutHelper::render('admin_view.fields_right', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.fields_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.fields_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'css', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_CSS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'css', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_CSS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.css_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.css_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'javascript', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_JAVASCRIPT', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'javascript', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_JAVASCRIPT', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.javascript_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.javascript_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'custom_buttons', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_CUSTOM_BUTTONS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'custom_buttons', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_CUSTOM_BUTTONS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.custom_buttons_left', $this); ?>
<?php echo LayoutHelper::render('admin_view.custom_buttons_left', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.custom_buttons_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.custom_buttons_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'php', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_PHP', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'php', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_PHP', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.php_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.php_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'mysql', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_MYSQL', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'mysql', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_MYSQL', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.mysql_left', $this); ?>
<?php echo LayoutHelper::render('admin_view.mysql_left', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.mysql_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.mysql_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'custom_import', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_CUSTOM_IMPORT', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'custom_import', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_CUSTOM_IMPORT', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('admin_view.custom_import_fullwidth', $this); ?>
<?php echo LayoutHelper::render('admin_view.custom_import_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'admin_viewTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('admin_view.edit.created_by') || $this->canDo->get('admin_view.edit.created') || $this->canDo->get('admin_view.edit.state') || ($this->canDo->get('admin_view.delete') && $this->canDo->get('admin_view.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'publishing', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'publishing', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('admin_view.publishing', $this); ?>
<?php echo LayoutHelper::render('admin_view.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('admin_view.publlshing', $this); ?>
<?php echo LayoutHelper::render('admin_view.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'admin_viewTab', 'permissions', JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'admin_viewTab', 'permissions', Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -189,19 +188,19 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="admin_view.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
<div class="clearfix"></div>
<?php echo JLayoutHelper::render('admin_view.details_under', $this); ?>
<?php echo LayoutHelper::render('admin_view.details_under', $this); ?>
</form>
</div>
@ -757,13 +756,13 @@ jQuery('#jform_add_custom_import').on('change',function() {
});
<?php
$app = JFactory::getApplication();
$app = Factory::getApplication();
?>
function JRouter(link) {
<?php
if ($app->isClient('site'))
{
echo 'var url = "'.JURI::root().'";';
echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";';
}
else
{
@ -773,17 +772,19 @@ function JRouter(link) {
return url+link;
}
// nice little dot trick :)
jQuery(document).ready( function($) {
var x=0;
setInterval(function() {
var dots = "";
x++;
for (var y=0; y < x%8; y++) {
dots+=".";
}
$(".loading-dots").text(dots);
} , 500);
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll(".loading-dots").forEach(function(loading_dots) {
let x = 0;
let intervalId = setInterval(function() {
if (!loading_dots.classList.contains("loading-dots")) {
clearInterval(intervalId);
return;
}
let dots = ".".repeat(x % 8);
loading_dots.textContent = dots;
x++;
}, 500);
});
});
jQuery(document).ready(function(){
jQuery(document).on('subform-row-add', function(event, row){

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Admin_view Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewAdmin_view extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewAdmin_view extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_view', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewAdmin_view extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewAdmin_view extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_VIEW_NEW' : 'COM_COMPONENTBUILDER_ADMIN_VIEW_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_VIEW_NEW' : 'COM_COMPONENTBUILDER_ADMIN_VIEW_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('admin_view.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('admin_view.edit'))
{
// We can save the record.
JToolBarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewAdmin_view extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('admin_view.create'))
{
JToolBarHelper::apply('admin_view.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('admin_view.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('admin_view.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('admin_view.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('admin_view.edit'))
{
// We can save the new record
JToolBarHelper::apply('admin_view.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('admin_view.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('admin_view.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('admin_view.create'))
{
JToolBarHelper::custom('admin_view.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('admin_view.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('admin_view.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('admin_view.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.admin_view', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.admin_view', $this->item->id);
}
if ($this->canDo->get('admin_view.create'))
{
JToolBarHelper::custom('admin_view.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('admin_view.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('admin_view.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admin_view');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewAdmin_view extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,32 +196,38 @@ class ComponentbuilderViewAdmin_view extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_VIEW_NEW' : 'COM_COMPONENTBUILDER_ADMIN_VIEW_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_view.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_VIEW_NEW' : 'COM_COMPONENTBUILDER_ADMIN_VIEW_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_view.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_view/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/admin_view/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
// add the Uikit v2 extra style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 extra JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';");
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,18 +12,25 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAdminviewsfiltertype', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_TYPE') . ' -'));
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
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\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleAdminviewsfiltertype', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_TYPE') . ' -']);
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admin_views.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'admin_viewList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
Html::_('sortablelist.sortable', 'admin_viewList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=admin_views'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=admin_views'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -34,13 +41,13 @@ if ($this->saveOrder)
<?php endif; ?>
<?php
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
echo LayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="admin_viewList">
@ -50,11 +57,11 @@ if ($this->saveOrder)
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
<?php echo Html::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_OPTIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
@ -64,27 +71,34 @@ if ($this->saveOrder)
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>
<script type="text/javascript">
// admin_views footer script
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
// get page body
var outerBodyDiv = document.querySelector('body');
// start loading spinner
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
// Set CSS properties individually
loadingDiv.style.background = "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat";
loadingDiv.style.top = (outerBodyDiv.getBoundingClientRect().top + window.pageYOffset) + "px";
loadingDiv.style.left = (outerBodyDiv.getBoundingClientRect().left + window.pageXOffset) + "px";
loadingDiv.style.width = outerBodyDiv.offsetWidth + "px";
loadingDiv.style.height = outerBodyDiv.offsetHeight + "px";
loadingDiv.style.position = 'fixed';
loadingDiv.style.opacity = '0.80';
loadingDiv.style.msFilter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
loadingDiv.style.filter = "alpha(opacity=80)";
loadingDiv.style.display = 'none';
// add to page body
outerBodyDiv.appendChild(loadingDiv);
// when the expand button is clicked
jQuery('#toolbar').on('click',"button.button-expand-2", function(e){
jQuery('#loading').show();
loadingDiv.style.display = 'block';
});
</script>

View File

@ -12,7 +12,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_TIP'); ?></p>
<p><?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_VIEWS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -12,12 +12,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('admin_view.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -11,7 +11,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
$edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit";
@ -19,7 +24,7 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$userChkOut = Factory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('admin_view',$item,'admin_views');
?>
<tr class="row<?php echo $i % 2; ?>">
@ -29,7 +34,7 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
@ -47,12 +52,12 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
<?php if ($canDo->get('admin_view.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
@ -63,13 +68,13 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
<?php if ($canDo->get('admin_view.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admin_views.', $canCheckin); ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admin_views.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->system_name); ?>
<?php endif; ?>
-
<?php echo JText::_($item->type); ?>
<?php echo Text::_($item->type); ?>
</div>
<?php
// setup the buttons
@ -79,29 +84,29 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
array(
'view' => 'admin_fields',
'views' => 'admins_fields',
'title' => JText::_('COM_COMPONENTBUILDER_THE_ADMIN_FIELDS'),
'title' => Text::_('COM_COMPONENTBUILDER_THE_ADMIN_FIELDS'),
'icon' => 'list'),
array(
'view' => 'admin_fields_relations',
'views' => 'admins_fields_relations',
'title' => JText::_('COM_COMPONENTBUILDER_THE_ADMIN_FIELDS_RELATIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_THE_ADMIN_FIELDS_RELATIONS'),
'icon' => 'tree-2'),
array(
'view' => 'admin_fields_conditions',
'views' => 'admins_fields_conditions',
'title' => JText::_('COM_COMPONENTBUILDER_THE_ADMIN_FIELDS_CONDITIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_THE_ADMIN_FIELDS_CONDITIONS'),
'icon' => 'shuffle'),
array(
'view' => 'admin_custom_tabs',
'views' => 'admins_custom_tabs',
'title' => JText::_('COM_COMPONENTBUILDER_THE_ADMIN_CUSTOM_TABS'),
'title' => Text::_('COM_COMPONENTBUILDER_THE_ADMIN_CUSTOM_TABS'),
'icon' => 'folder-plus')
);
}
?>
<div class="btn-group" style="margin: 5px 0 0 0;">
<?php foreach ($_buttons as $_button): ?>
<?php if ($canDo->get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'admin_view', 'id')) !== false): ?>
<?php if ($canDo->get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'admin_view', 'id')) !== false): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=<?php echo $_button['views'] ?>&task=<?php echo $_button['view'] ?>.edit&id=<?php echo $id; ?>&return=<?php echo $this->return_here; ?>" title="<?php echo $_button['title']; ?>" ><span class="icon-<?php echo $_button['icon']; ?>"></span></a>
<?php elseif ($canDo->get($_button['view'].'.create')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=<?php echo $_button['views'] ?>&task=<?php echo $_button['view'] ?>.edit&ref=admin_view&refid=<?php echo $item->id; ?>&return=<?php echo $this->return_here; ?>" title="<?php echo $_button['title']; ?>" ><span class="icon-<?php echo $_button['icon']; ?>"></span></a>
@ -110,9 +115,9 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
</div>
</td>
<td class="hidden-phone">
<div><?php echo JText::_('COM_COMPONENTBUILDER_EDIT_VIEW'); ?>: <b>
<div><?php echo Text::_('COM_COMPONENTBUILDER_EDIT_VIEW'); ?>: <b>
<?php echo $this->escape($item->name_single); ?></b><br />
<?php echo JText::_('COM_COMPONENTBUILDER_LIST_VIEW'); ?>: <b>
<?php echo Text::_('COM_COMPONENTBUILDER_LIST_VIEW'); ?>: <b>
<?php echo $this->escape($item->name_list); ?></b>
</div>
</td>
@ -120,14 +125,14 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
<div><em>
<?php echo $this->escape($item->short_description); ?></em>
<ul style="list-style: none">
<li><?php echo JText::_("COM_COMPONENTBUILDER_CUSTOM_BUTTON"); ?>: <b>
<?php echo JText::_($item->add_custom_button); ?></b></li>
<li><?php echo JText::_("COM_COMPONENTBUILDER_CUSTOM_IMPORT"); ?>: <b>
<?php echo JText::_($item->add_custom_import); ?></b></li>
<li><?php echo JText::_("COM_COMPONENTBUILDER_FADE_IN"); ?>: <b>
<?php echo JText::_($item->add_fadein); ?></b></li>
<li><?php echo JText::_("COM_COMPONENTBUILDER_AJAX"); ?>: <b>
<?php echo JText::_($item->add_php_ajax); ?></b></li>
<li><?php echo Text::_("COM_COMPONENTBUILDER_CUSTOM_BUTTON"); ?>: <b>
<?php echo Text::_($item->add_custom_button); ?></b></li>
<li><?php echo Text::_("COM_COMPONENTBUILDER_CUSTOM_IMPORT"); ?>: <b>
<?php echo Text::_($item->add_custom_import); ?></b></li>
<li><?php echo Text::_("COM_COMPONENTBUILDER_FADE_IN"); ?>: <b>
<?php echo Text::_($item->add_fadein); ?></b></li>
<li><?php echo Text::_("COM_COMPONENTBUILDER_AJAX"); ?>: <b>
<?php echo Text::_($item->add_php_ajax); ?></b></li>
</ul>
</div>
</td>
@ -135,15 +140,15 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
<?php if ($canDo->get('admin_view.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admin_views.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admin_views.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admin_views.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admin_views.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admin_views.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admin_views.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admin_views.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admin_views.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@ -12,14 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
<?php echo Html::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo Html::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
@ -30,24 +33,24 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_SYSTEM_NAME_LABEL', 'a.system_name', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_SYSTEM_NAME_LABEL', 'a.system_name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEWS_NAMES', 'a.name_single', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEWS_NAMES', 'a.name_single', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEWS_DETAILS', 'a.short_description', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEWS_DETAILS', 'a.short_description', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_STATUS'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_VIEW_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -12,34 +12,37 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Admin_views'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search Admin_views'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -12,7 +12,20 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Admin_views
@ -35,7 +48,7 @@ class ComponentbuilderViewAdmin_views extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
@ -45,7 +58,7 @@ class ComponentbuilderViewAdmin_views extends HtmlView
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_view');
$this->canEdit = $this->canDo->get('admin_view.edit');
@ -65,7 +78,7 @@ class ComponentbuilderViewAdmin_views extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -84,32 +97,32 @@ class ComponentbuilderViewAdmin_views extends HtmlView
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMIN_VIEWS'), 'stack');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admin_views');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMIN_VIEWS'), 'stack');
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('admin_view.add');
ToolbarHelper::addNew('admin_view.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('admin_view.edit');
ToolbarHelper::editList('admin_view.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('admin_views.publish');
JToolBarHelper::unpublishList('admin_views.unpublish');
JToolBarHelper::archiveList('admin_views.archive');
ToolbarHelper::publishList('admin_views.publish');
ToolbarHelper::unpublishList('admin_views.unpublish');
ToolbarHelper::archiveList('admin_views.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('admin_views.checkin');
ToolbarHelper::checkin('admin_views.checkin');
}
}
@ -117,11 +130,11 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar = Toolbar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
$title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@ -129,49 +142,49 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'admin_views.delete', 'JTOOLBAR_EMPTY_TRASH');
ToolbarHelper::deleteList('', 'admin_views.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('admin_views.trash');
ToolbarHelper::trash('admin_views.trash');
}
if ($this->canDo->get('core.export') && $this->canDo->get('admin_view.export'))
{
JToolBarHelper::custom('admin_views.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
ToolbarHelper::custom('admin_views.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
}
}
if ($this->user->authorise('admin_view.run_expansion', 'com_componentbuilder'))
{
// add Run Expansion button.
JToolBarHelper::custom('admin_views.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false);
ToolbarHelper::custom('admin_views.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false);
}
if ($this->canDo->get('core.import') && $this->canDo->get('admin_view.import'))
{
JToolBarHelper::custom('admin_views.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
ToolbarHelper::custom('admin_views.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admin_views');
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');
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
@ -179,9 +192,9 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text')
);
}
@ -189,19 +202,19 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Add Fadein Selection
$this->add_fadeinOptions = JFormHelper::loadFieldType('adminviewsfilteraddfadein')->options;
$this->add_fadeinOptions = FormHelper::loadFieldType('adminviewsfilteraddfadein')->options;
// We do some sanitation for Add Fadein filter
if (ComponentbuilderHelper::checkArray($this->add_fadeinOptions) &&
if (ArrayHelper::check($this->add_fadeinOptions) &&
isset($this->add_fadeinOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->add_fadeinOptions[0]->value))
!StringHelper::check($this->add_fadeinOptions[0]->value))
{
unset($this->add_fadeinOptions[0]);
}
// Add Fadein Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_FADEIN_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_FADEIN_LABEL').' -',
'batch[add_fadein]',
JHtml::_('select.options', $this->add_fadeinOptions, 'value', 'text')
Html::_('select.options', $this->add_fadeinOptions, 'value', 'text')
);
}
@ -209,19 +222,19 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Type Selection
$this->typeOptions = JFormHelper::loadFieldType('adminviewsfiltertype')->options;
$this->typeOptions = FormHelper::loadFieldType('adminviewsfiltertype')->options;
// We do some sanitation for Type filter
if (ComponentbuilderHelper::checkArray($this->typeOptions) &&
if (ArrayHelper::check($this->typeOptions) &&
isset($this->typeOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->typeOptions[0]->value))
!StringHelper::check($this->typeOptions[0]->value))
{
unset($this->typeOptions[0]);
}
// Type Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_TYPE_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_TYPE_LABEL').' -',
'batch[type]',
JHtml::_('select.options', $this->typeOptions, 'value', 'text')
Html::_('select.options', $this->typeOptions, 'value', 'text')
);
}
@ -229,19 +242,19 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Add Custom Button Selection
$this->add_custom_buttonOptions = JFormHelper::loadFieldType('adminviewsfilteraddcustombutton')->options;
$this->add_custom_buttonOptions = FormHelper::loadFieldType('adminviewsfilteraddcustombutton')->options;
// We do some sanitation for Add Custom Button filter
if (ComponentbuilderHelper::checkArray($this->add_custom_buttonOptions) &&
if (ArrayHelper::check($this->add_custom_buttonOptions) &&
isset($this->add_custom_buttonOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->add_custom_buttonOptions[0]->value))
!StringHelper::check($this->add_custom_buttonOptions[0]->value))
{
unset($this->add_custom_buttonOptions[0]);
}
// Add Custom Button Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL').' -',
'batch[add_custom_button]',
JHtml::_('select.options', $this->add_custom_buttonOptions, 'value', 'text')
Html::_('select.options', $this->add_custom_buttonOptions, 'value', 'text')
);
}
@ -249,19 +262,19 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Add Php Ajax Selection
$this->add_php_ajaxOptions = JFormHelper::loadFieldType('adminviewsfilteraddphpajax')->options;
$this->add_php_ajaxOptions = FormHelper::loadFieldType('adminviewsfilteraddphpajax')->options;
// We do some sanitation for Add Php Ajax filter
if (ComponentbuilderHelper::checkArray($this->add_php_ajaxOptions) &&
if (ArrayHelper::check($this->add_php_ajaxOptions) &&
isset($this->add_php_ajaxOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->add_php_ajaxOptions[0]->value))
!StringHelper::check($this->add_php_ajaxOptions[0]->value))
{
unset($this->add_php_ajaxOptions[0]);
}
// Add Php Ajax Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AJAX_LABEL').' -',
'batch[add_php_ajax]',
JHtml::_('select.options', $this->add_php_ajaxOptions, 'value', 'text')
Html::_('select.options', $this->add_php_ajaxOptions, 'value', 'text')
);
}
@ -269,19 +282,19 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Add Custom Import Selection
$this->add_custom_importOptions = JFormHelper::loadFieldType('adminviewsfilteraddcustomimport')->options;
$this->add_custom_importOptions = FormHelper::loadFieldType('adminviewsfilteraddcustomimport')->options;
// We do some sanitation for Add Custom Import filter
if (ComponentbuilderHelper::checkArray($this->add_custom_importOptions) &&
if (ArrayHelper::check($this->add_custom_importOptions) &&
isset($this->add_custom_importOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->add_custom_importOptions[0]->value))
!StringHelper::check($this->add_custom_importOptions[0]->value))
{
unset($this->add_custom_importOptions[0]);
}
// Add Custom Import Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL').' -',
'batch[add_custom_import]',
JHtml::_('select.options', $this->add_custom_importOptions, 'value', 'text')
Html::_('select.options', $this->add_custom_importOptions, 'value', 'text')
);
}
}
@ -295,10 +308,10 @@ class ComponentbuilderViewAdmin_views extends HtmlView
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
$this->document = Factory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMIN_VIEWS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_views.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMIN_VIEWS'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_views.css", ['version' => 'auto']);
}
/**
@ -313,26 +326,36 @@ class ComponentbuilderViewAdmin_views extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
return StringHelper::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.system_name' => JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SYSTEM_NAME_LABEL'),
'a.name_single' => JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_LABEL'),
'a.short_description' => JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SHORT_DESCRIPTION_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
'a.published' => Text::_('JSTATUS'),
'a.system_name' => Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SYSTEM_NAME_LABEL'),
'a.name_single' => Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_LABEL'),
'a.short_description' => Text::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SHORT_DESCRIPTION_LABEL'),
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,17 +12,24 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
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\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_custom_tabs.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'admin_custom_tabsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
Html::_('sortablelist.sortable', 'admin_custom_tabsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=admins_custom_tabs'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=admins_custom_tabs'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -33,13 +40,13 @@ if ($this->saveOrder)
<?php endif; ?>
<?php
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
echo LayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="admin_custom_tabsList">
@ -49,11 +56,11 @@ if ($this->saveOrder)
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
<?php echo Html::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_ADMINS_CUSTOM_TABS_BATCH_OPTIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_ADMINS_CUSTOM_TABS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
@ -63,5 +70,5 @@ if ($this->saveOrder)
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>

View File

@ -12,7 +12,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_ADMINS_CUSTOM_TABS_BATCH_TIP'); ?></p>
<p><?php echo Text::_('COM_COMPONENTBUILDER_ADMINS_CUSTOM_TABS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -12,12 +12,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('admin_custom_tabs.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -12,13 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
$edit = "index.php?option=com_componentbuilder&view=admins_custom_tabs&task=admin_custom_tabs.edit";
?>
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$userChkOut = Factory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('admin_custom_tabs',$item,'admins_custom_tabs');
?>
<tr class="row<?php echo $i % 2; ?>">
@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_custom_tabs&task=admi
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=admins_custom_tabs&task=admi
<?php if ($canDo->get('admin_custom_tabs.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_custom_tabs&task=admi
<?php if ($canDo->get('admin_custom_tabs.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->admin_view_system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_custom_tabs.', $canCheckin); ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_custom_tabs.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->admin_view_system_name); ?>
@ -73,15 +77,15 @@ $edit = "index.php?option=com_componentbuilder&view=admins_custom_tabs&task=admi
<?php if ($canDo->get('admin_custom_tabs.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_custom_tabs.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_custom_tabs.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_custom_tabs.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_custom_tabs.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_custom_tabs.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_custom_tabs.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_custom_tabs.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_custom_tabs.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@ -12,14 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
<?php echo Html::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo Html::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
@ -30,18 +33,18 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ADMIN_VIEW_LABEL'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ADMIN_VIEW_LABEL'); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_STATUS'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -12,34 +12,37 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Admins_custom_tabs'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search Admins_custom_tabs'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -12,7 +12,20 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Admins_custom_tabs
@ -35,7 +48,7 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
@ -45,7 +58,7 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_custom_tabs');
$this->canEdit = $this->canDo->get('admin_custom_tabs.edit');
@ -65,7 +78,7 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -84,32 +97,32 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_CUSTOM_TABS'), 'joomla');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_custom_tabs');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMINS_CUSTOM_TABS'), 'joomla');
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('admin_custom_tabs.add');
ToolbarHelper::addNew('admin_custom_tabs.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('admin_custom_tabs.edit');
ToolbarHelper::editList('admin_custom_tabs.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('admins_custom_tabs.publish');
JToolBarHelper::unpublishList('admins_custom_tabs.unpublish');
JToolBarHelper::archiveList('admins_custom_tabs.archive');
ToolbarHelper::publishList('admins_custom_tabs.publish');
ToolbarHelper::unpublishList('admins_custom_tabs.unpublish');
ToolbarHelper::archiveList('admins_custom_tabs.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('admins_custom_tabs.checkin');
ToolbarHelper::checkin('admins_custom_tabs.checkin');
}
}
@ -117,11 +130,11 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar = Toolbar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
$title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@ -129,34 +142,34 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'admins_custom_tabs.delete', 'JTOOLBAR_EMPTY_TRASH');
ToolbarHelper::deleteList('', 'admins_custom_tabs.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('admins_custom_tabs.trash');
ToolbarHelper::trash('admins_custom_tabs.trash');
}
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admins_custom_tabs');
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');
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
@ -164,9 +177,9 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text')
);
}
}
@ -180,10 +193,10 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
$this->document = Factory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_CUSTOM_TABS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_custom_tabs.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMINS_CUSTOM_TABS'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admins_custom_tabs.css", ['version' => 'auto']);
}
/**
@ -198,23 +211,33 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
return StringHelper::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.id' => JText::_('JGRID_HEADING_ID')
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
'a.published' => Text::_('JSTATUS'),
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,17 +12,24 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
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\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'admin_fieldsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
Html::_('sortablelist.sortable', 'admin_fieldsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=admins_fields'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=admins_fields'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -33,13 +40,13 @@ if ($this->saveOrder)
<?php endif; ?>
<?php
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
echo LayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="admin_fieldsList">
@ -49,11 +56,11 @@ if ($this->saveOrder)
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
<?php echo Html::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_BATCH_OPTIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
@ -63,5 +70,5 @@ if ($this->saveOrder)
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>

View File

@ -12,7 +12,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_BATCH_TIP'); ?></p>
<p><?php echo Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -12,12 +12,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('admin_fields.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -12,13 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
$edit = "index.php?option=com_componentbuilder&view=admins_fields&task=admin_fields.edit";
?>
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$userChkOut = Factory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('admin_fields',$item,'admins_fields');
?>
<tr class="row<?php echo $i % 2; ?>">
@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields&task=admin_fie
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields&task=admin_fie
<?php if ($canDo->get('admin_fields.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields&task=admin_fie
<?php if ($canDo->get('admin_fields.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->admin_view_system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_fields.', $canCheckin); ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_fields.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->admin_view_system_name); ?>
@ -73,15 +77,15 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields&task=admin_fie
<?php if ($canDo->get('admin_fields.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@ -12,14 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
<?php echo Html::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo Html::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
@ -30,18 +33,18 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_ADMIN_VIEW_LABEL'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_ADMIN_VIEW_LABEL'); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_STATUS'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -12,34 +12,37 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Admins_fields'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search Admins_fields'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -12,7 +12,20 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Admins_fields
@ -35,7 +48,7 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
@ -45,7 +58,7 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
$this->canEdit = $this->canDo->get('admin_fields.edit');
@ -65,7 +78,7 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -84,32 +97,32 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS'), 'joomla');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS'), 'joomla');
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('admin_fields.add');
ToolbarHelper::addNew('admin_fields.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('admin_fields.edit');
ToolbarHelper::editList('admin_fields.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('admins_fields.publish');
JToolBarHelper::unpublishList('admins_fields.unpublish');
JToolBarHelper::archiveList('admins_fields.archive');
ToolbarHelper::publishList('admins_fields.publish');
ToolbarHelper::unpublishList('admins_fields.unpublish');
ToolbarHelper::archiveList('admins_fields.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('admins_fields.checkin');
ToolbarHelper::checkin('admins_fields.checkin');
}
}
@ -117,11 +130,11 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar = Toolbar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
$title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@ -129,34 +142,34 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'admins_fields.delete', 'JTOOLBAR_EMPTY_TRASH');
ToolbarHelper::deleteList('', 'admins_fields.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('admins_fields.trash');
ToolbarHelper::trash('admins_fields.trash');
}
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields');
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');
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
@ -164,9 +177,9 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text')
);
}
}
@ -180,10 +193,10 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
$this->document = Factory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admins_fields.css", ['version' => 'auto']);
}
/**
@ -198,23 +211,33 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
return StringHelper::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.id' => JText::_('JGRID_HEADING_ID')
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
'a.published' => Text::_('JSTATUS'),
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,17 +12,24 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
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\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields_conditions.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'admin_fields_conditionsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
Html::_('sortablelist.sortable', 'admin_fields_conditionsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_conditions'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=admins_fields_conditions'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -33,13 +40,13 @@ if ($this->saveOrder)
<?php endif; ?>
<?php
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
echo LayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="admin_fields_conditionsList">
@ -49,11 +56,11 @@ if ($this->saveOrder)
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
<?php echo Html::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_BATCH_OPTIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
@ -63,5 +70,5 @@ if ($this->saveOrder)
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>

View File

@ -12,7 +12,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_BATCH_TIP'); ?></p>
<p><?php echo Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -12,12 +12,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('admin_fields_conditions.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -12,13 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
$edit = "index.php?option=com_componentbuilder&view=admins_fields_conditions&task=admin_fields_conditions.edit";
?>
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$userChkOut = Factory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('admin_fields_conditions',$item,'admins_fields_conditions');
?>
<tr class="row<?php echo $i % 2; ?>">
@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_conditions&tas
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_conditions&tas
<?php if ($canDo->get('admin_fields_conditions.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_conditions&tas
<?php if ($canDo->get('admin_fields_conditions.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->admin_view_system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_fields_conditions.', $canCheckin); ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_fields_conditions.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->admin_view_system_name); ?>
@ -73,15 +77,15 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_conditions&tas
<?php if ($canDo->get('admin_fields_conditions.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_conditions.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields_conditions.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_conditions.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields_conditions.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_conditions.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields_conditions.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_conditions.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields_conditions.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@ -12,14 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
<?php echo Html::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo Html::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
@ -30,18 +33,18 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_LABEL'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_LABEL'); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_STATUS'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -12,34 +12,37 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Admins_fields_conditions'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search Admins_fields_conditions'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -12,7 +12,20 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Admins_fields_conditions
@ -35,7 +48,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
@ -45,7 +58,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
$this->canEdit = $this->canDo->get('admin_fields_conditions.edit');
@ -65,7 +78,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -84,32 +97,32 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'), 'joomla');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_conditions');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'), 'joomla');
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('admin_fields_conditions.add');
ToolbarHelper::addNew('admin_fields_conditions.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('admin_fields_conditions.edit');
ToolbarHelper::editList('admin_fields_conditions.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('admins_fields_conditions.publish');
JToolBarHelper::unpublishList('admins_fields_conditions.unpublish');
JToolBarHelper::archiveList('admins_fields_conditions.archive');
ToolbarHelper::publishList('admins_fields_conditions.publish');
ToolbarHelper::unpublishList('admins_fields_conditions.unpublish');
ToolbarHelper::archiveList('admins_fields_conditions.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('admins_fields_conditions.checkin');
ToolbarHelper::checkin('admins_fields_conditions.checkin');
}
}
@ -117,11 +130,11 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar = Toolbar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
$title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@ -129,34 +142,34 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'admins_fields_conditions.delete', 'JTOOLBAR_EMPTY_TRASH');
ToolbarHelper::deleteList('', 'admins_fields_conditions.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('admins_fields_conditions.trash');
ToolbarHelper::trash('admins_fields_conditions.trash');
}
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions');
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');
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
@ -164,9 +177,9 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text')
);
}
}
@ -180,10 +193,10 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
$this->document = Factory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_conditions.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admins_fields_conditions.css", ['version' => 'auto']);
}
/**
@ -198,23 +211,33 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
return StringHelper::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.id' => JText::_('JGRID_HEADING_ID')
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
'a.published' => Text::_('JSTATUS'),
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,17 +12,24 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
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\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields_relations.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'admin_fields_relationsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
Html::_('sortablelist.sortable', 'admin_fields_relationsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_relations'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=admins_fields_relations'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -33,13 +40,13 @@ if ($this->saveOrder)
<?php endif; ?>
<?php
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
echo LayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="admin_fields_relationsList">
@ -49,11 +56,11 @@ if ($this->saveOrder)
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
<?php echo Html::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
@ -63,5 +70,5 @@ if ($this->saveOrder)
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>

View File

@ -12,7 +12,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_TIP'); ?></p>
<p><?php echo Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -12,12 +12,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('admin_fields_relations.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -12,13 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
$edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task=admin_fields_relations.edit";
?>
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$userChkOut = Factory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('admin_fields_relations',$item,'admins_fields_relations');
?>
<tr class="row<?php echo $i % 2; ?>">
@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task
<?php if ($canDo->get('admin_fields_relations.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task
<?php if ($canDo->get('admin_fields_relations.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->admin_view_system_name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->admin_view_system_name); ?>
@ -73,15 +77,15 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task
<?php if ($canDo->get('admin_fields_relations.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'admins_fields_relations.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@ -12,14 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
<?php echo Html::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo Html::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
@ -30,18 +33,18 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_LABEL'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ADMIN_VIEW_LABEL'); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -12,34 +12,37 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Admins_fields_relations'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search Admins_fields_relations'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -12,7 +12,20 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Admins_fields_relations
@ -35,7 +48,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
@ -45,7 +58,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations');
$this->canEdit = $this->canDo->get('admin_fields_relations.edit');
@ -65,7 +78,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -84,32 +97,32 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'), 'joomla');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_relations');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'), 'joomla');
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('admin_fields_relations.add');
ToolbarHelper::addNew('admin_fields_relations.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('admin_fields_relations.edit');
ToolbarHelper::editList('admin_fields_relations.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('admins_fields_relations.publish');
JToolBarHelper::unpublishList('admins_fields_relations.unpublish');
JToolBarHelper::archiveList('admins_fields_relations.archive');
ToolbarHelper::publishList('admins_fields_relations.publish');
ToolbarHelper::unpublishList('admins_fields_relations.unpublish');
ToolbarHelper::archiveList('admins_fields_relations.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('admins_fields_relations.checkin');
ToolbarHelper::checkin('admins_fields_relations.checkin');
}
}
@ -117,11 +130,11 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar = Toolbar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
$title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@ -129,34 +142,34 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'admins_fields_relations.delete', 'JTOOLBAR_EMPTY_TRASH');
ToolbarHelper::deleteList('', 'admins_fields_relations.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('admins_fields_relations.trash');
ToolbarHelper::trash('admins_fields_relations.trash');
}
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_relations');
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');
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
@ -164,9 +177,9 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text')
);
}
}
@ -180,10 +193,10 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
$this->document = Factory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_relations.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admins_fields_relations.css", ['version' => 'auto']);
}
/**
@ -198,23 +211,33 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
return StringHelper::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.id' => JText::_('JGRID_HEADING_ID')
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
'a.published' => Text::_('JSTATUS'),
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,17 +12,24 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
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\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_extendings.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'class_extendsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
Html::_('sortablelist.sortable', 'class_extendsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=class_extendings'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=class_extendings'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -33,13 +40,13 @@ if ($this->saveOrder)
<?php endif; ?>
<?php
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
echo LayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="class_extendsList">
@ -49,11 +56,11 @@ if ($this->saveOrder)
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
<?php echo Html::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_OPTIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
@ -63,5 +70,5 @@ if ($this->saveOrder)
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>

View File

@ -12,7 +12,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_TIP'); ?></p>
<p><?php echo Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -12,12 +12,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('class_extends.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -12,13 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
$edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_extends.edit";
?>
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$userChkOut = Factory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('class_extends',$item,'class_extendings');
?>
<tr class="row<?php echo $i % 2; ?>">
@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_
<?php if ($canDo->get('class_extends.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_
<?php if ($canDo->get('class_extends.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'class_extendings.', $canCheckin); ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'class_extendings.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->name); ?>
@ -70,21 +74,21 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_
</div>
</td>
<td class="hidden-phone">
<?php echo JText::_($item->extension_type); ?>
<?php echo Text::_($item->extension_type); ?>
</td>
<td class="center">
<?php if ($canDo->get('class_extends.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_extendings.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_extendings.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_extendings.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_extendings.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_extendings.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_extendings.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_extendings.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_extendings.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@ -12,14 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
<?php echo Html::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo Html::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
@ -30,21 +33,21 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL', 'a.extension_type', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL', 'a.extension_type', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_EXTENDS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_EXTENDS_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_STATUS'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_EXTENDS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_EXTENDS_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -12,34 +12,37 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Class_extendings'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search Class_extendings'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -12,7 +12,20 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Class_extendings
@ -35,7 +48,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
@ -45,7 +58,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView
$this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_extends');
$this->canEdit = $this->canDo->get('class_extends.edit');
@ -65,7 +78,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -84,32 +97,32 @@ class ComponentbuilderViewClass_extendings extends HtmlView
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'), 'joomla');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_extendings');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'), 'joomla');
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('class_extends.add');
ToolbarHelper::addNew('class_extends.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('class_extends.edit');
ToolbarHelper::editList('class_extends.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('class_extendings.publish');
JToolBarHelper::unpublishList('class_extendings.unpublish');
JToolBarHelper::archiveList('class_extendings.archive');
ToolbarHelper::publishList('class_extendings.publish');
ToolbarHelper::unpublishList('class_extendings.unpublish');
ToolbarHelper::archiveList('class_extendings.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('class_extendings.checkin');
ToolbarHelper::checkin('class_extendings.checkin');
}
}
@ -117,11 +130,11 @@ class ComponentbuilderViewClass_extendings extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar = Toolbar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
$title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@ -129,34 +142,34 @@ class ComponentbuilderViewClass_extendings extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'class_extendings.delete', 'JTOOLBAR_EMPTY_TRASH');
ToolbarHelper::deleteList('', 'class_extendings.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('class_extendings.trash');
ToolbarHelper::trash('class_extendings.trash');
}
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_extendings');
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');
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
@ -164,9 +177,9 @@ class ComponentbuilderViewClass_extendings extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text')
);
}
@ -174,19 +187,19 @@ class ComponentbuilderViewClass_extendings extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Extension Type Selection
$this->extension_typeOptions = JFormHelper::loadFieldType('classextendingsfilterextensiontype')->options;
$this->extension_typeOptions = FormHelper::loadFieldType('classextendingsfilterextensiontype')->options;
// We do some sanitation for Extension Type filter
if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) &&
if (ArrayHelper::check($this->extension_typeOptions) &&
isset($this->extension_typeOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value))
!StringHelper::check($this->extension_typeOptions[0]->value))
{
unset($this->extension_typeOptions[0]);
}
// Extension Type Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -',
'batch[extension_type]',
JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text')
Html::_('select.options', $this->extension_typeOptions, 'value', 'text')
);
}
}
@ -200,10 +213,10 @@ class ComponentbuilderViewClass_extendings extends HtmlView
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
$this->document = Factory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_extendings.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_extendings.css", ['version' => 'auto']);
}
/**
@ -218,25 +231,35 @@ class ComponentbuilderViewClass_extendings extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
return StringHelper::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL'),
'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
'a.published' => Text::_('JSTATUS'),
'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL'),
'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL'),
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,76 +12,75 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'class_extendsTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'class_extendsTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_extendsTab', 'details', JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_DETAILS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_extendsTab', 'details', Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('class_extends.details_left', $this); ?>
<?php echo LayoutHelper::render('class_extends.details_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('class_extends.details_right', $this); ?>
<?php echo LayoutHelper::render('class_extends.details_right', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('class_extends.details_fullwidth', $this); ?>
<?php echo LayoutHelper::render('class_extends.details_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'class_extendsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('class_extends.edit.created_by') || $this->canDo->get('class_extends.edit.created') || $this->canDo->get('class_extends.edit.state') || ($this->canDo->get('class_extends.delete') && $this->canDo->get('class_extends.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_extendsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_extendsTab', 'publishing', Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('class_extends.publishing', $this); ?>
<?php echo LayoutHelper::render('class_extends.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('class_extends.publlshing', $this); ?>
<?php echo LayoutHelper::render('class_extends.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_extendsTab', 'permissions', JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_extendsTab', 'permissions', Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -96,14 +95,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="class_extends.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>
@ -115,13 +114,13 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php
$app = JFactory::getApplication();
$app = Factory::getApplication();
?>
function JRouter(link) {
<?php
if ($app->isClient('site'))
{
echo 'var url = "'.JURI::root().'";';
echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";';
}
else
{

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Class_extends Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewClass_extends extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewClass_extends extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_extends', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewClass_extends extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewClass_extends extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('class_extends.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('class_extends.edit'))
{
// We can save the record.
JToolBarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewClass_extends extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('class_extends.create'))
{
JToolBarHelper::apply('class_extends.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('class_extends.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('class_extends.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('class_extends.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('class_extends.edit'))
{
// We can save the new record
JToolBarHelper::apply('class_extends.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('class_extends.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('class_extends.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('class_extends.create'))
{
JToolBarHelper::custom('class_extends.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('class_extends.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('class_extends.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('class_extends.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.class_extends', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.class_extends', $this->item->id);
}
if ($this->canDo->get('class_extends.create'))
{
JToolBarHelper::custom('class_extends.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('class_extends.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_extends');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewClass_extends extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,32 +196,38 @@ class ComponentbuilderViewClass_extends extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_extends.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_extends.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/class_extends/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/class_extends/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
// add the Uikit v2 extra style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 extra JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';");
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,76 +12,75 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'class_methodTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'class_methodTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_methodTab', 'details', JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_DETAILS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_methodTab', 'details', Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('class_method.details_left', $this); ?>
<?php echo LayoutHelper::render('class_method.details_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('class_method.details_right', $this); ?>
<?php echo LayoutHelper::render('class_method.details_right', $this); ?>
</div>
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('class_method.details_fullwidth', $this); ?>
<?php echo LayoutHelper::render('class_method.details_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'class_methodTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('class_method.edit.created_by') || $this->canDo->get('class_method.edit.created') || $this->canDo->get('class_method.edit.state') || ($this->canDo->get('class_method.delete') && $this->canDo->get('class_method.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_methodTab', 'publishing', JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_methodTab', 'publishing', Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('class_method.publishing', $this); ?>
<?php echo LayoutHelper::render('class_method.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('class_method.publlshing', $this); ?>
<?php echo LayoutHelper::render('class_method.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_methodTab', 'permissions', JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_methodTab', 'permissions', Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -96,14 +95,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="class_method.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>
@ -130,13 +129,13 @@ jQuery('#adminForm').on('change', '#jform_extension_type',function (e)
<?php
$app = JFactory::getApplication();
$app = Factory::getApplication();
?>
function JRouter(link) {
<?php
if ($app->isClient('site'))
{
echo 'var url = "'.JURI::root().'";';
echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";';
}
else
{

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Class_method Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewClass_method extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewClass_method extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_method', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewClass_method extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewClass_method extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('class_method.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('class_method.edit'))
{
// We can save the record.
JToolBarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('class_method.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewClass_method extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('class_method.create'))
{
JToolBarHelper::apply('class_method.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('class_method.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('class_method.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('class_method.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('class_method.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('class_method.edit'))
{
// We can save the new record
JToolBarHelper::apply('class_method.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('class_method.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('class_method.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('class_method.create'))
{
JToolBarHelper::custom('class_method.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('class_method.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('class_method.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('class_method.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.class_method', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.class_method', $this->item->id);
}
if ($this->canDo->get('class_method.create'))
{
JToolBarHelper::custom('class_method.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('class_method.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_method');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewClass_method extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,32 +196,38 @@ class ComponentbuilderViewClass_method extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_method.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_method.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/class_method/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/class_method/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
// add the Uikit v2 extra style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 extra JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';");
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,17 +12,24 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
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\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_methods.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'class_methodList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
Html::_('sortablelist.sortable', 'class_methodList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=class_methods'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=class_methods'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -33,13 +40,13 @@ if ($this->saveOrder)
<?php endif; ?>
<?php
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
echo LayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="class_methodList">
@ -49,11 +56,11 @@ if ($this->saveOrder)
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
<?php echo Html::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_OPTIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
@ -63,5 +70,5 @@ if ($this->saveOrder)
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>

View File

@ -12,7 +12,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_TIP'); ?></p>
<p><?php echo Text::_('COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -12,12 +12,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('class_method.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -12,13 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
$edit = "index.php?option=com_componentbuilder&view=class_methods&task=class_method.edit";
?>
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$userChkOut = Factory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('class_method',$item,'class_methods');
?>
<tr class="row<?php echo $i % 2; ?>">
@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_methods&task=class_met
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=class_methods&task=class_met
<?php if ($canDo->get('class_method.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_methods&task=class_met
<?php if ($canDo->get('class_method.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'class_methods.', $canCheckin); ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'class_methods.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->name); ?>
@ -71,16 +75,16 @@ $edit = "index.php?option=com_componentbuilder&view=class_methods&task=class_met
</div>
</td>
<td class="hidden-phone">
<?php echo JText::_($item->visibility); ?>
<?php echo Text::_($item->visibility); ?>
</td>
<td class="hidden-phone">
<div><?php if (isset($item->joomla_plugin_group) && $item->joomla_plugin_group > 0): ?>
<?php echo JText::_($item->extension_type); ?> <?php echo JText::_('COM_COMPONENTBUILDER_GROUP'); ?>: <b>
<?php echo Text::_($item->extension_type); ?> <?php echo Text::_('COM_COMPONENTBUILDER_GROUP'); ?>: <b>
<?php echo $this->escape($item->joomla_plugin_group_name); ?></b>
<?php else: ?>
<?php echo JText::_($item->extension_type); ?>
<?php echo Text::_($item->extension_type); ?>
<?php endif; ?>
</div>
</td>
@ -88,15 +92,15 @@ $edit = "index.php?option=com_componentbuilder&view=class_methods&task=class_met
<?php if ($canDo->get('class_method.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_methods.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_methods.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_methods.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_methods.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_methods.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_methods.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_methods.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_methods.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@ -12,14 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
<?php echo Html::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo Html::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
@ -30,24 +33,24 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL', 'a.visibility', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL', 'a.visibility', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL', 'a.extension_type', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL', 'a.extension_type', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_STATUS'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_METHOD_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -12,34 +12,37 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Class_methods'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search Class_methods'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -12,7 +12,20 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Class_methods
@ -35,7 +48,7 @@ class ComponentbuilderViewClass_methods extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
@ -45,7 +58,7 @@ class ComponentbuilderViewClass_methods extends HtmlView
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_method');
$this->canEdit = $this->canDo->get('class_method.edit');
@ -65,7 +78,7 @@ class ComponentbuilderViewClass_methods extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -84,32 +97,32 @@ class ComponentbuilderViewClass_methods extends HtmlView
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_METHODS'), 'cube');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_methods');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_METHODS'), 'cube');
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('class_method.add');
ToolbarHelper::addNew('class_method.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('class_method.edit');
ToolbarHelper::editList('class_method.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('class_methods.publish');
JToolBarHelper::unpublishList('class_methods.unpublish');
JToolBarHelper::archiveList('class_methods.archive');
ToolbarHelper::publishList('class_methods.publish');
ToolbarHelper::unpublishList('class_methods.unpublish');
ToolbarHelper::archiveList('class_methods.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('class_methods.checkin');
ToolbarHelper::checkin('class_methods.checkin');
}
}
@ -117,11 +130,11 @@ class ComponentbuilderViewClass_methods extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar = Toolbar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
$title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@ -129,44 +142,44 @@ class ComponentbuilderViewClass_methods extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'class_methods.delete', 'JTOOLBAR_EMPTY_TRASH');
ToolbarHelper::deleteList('', 'class_methods.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('class_methods.trash');
ToolbarHelper::trash('class_methods.trash');
}
if ($this->canDo->get('core.export') && $this->canDo->get('class_method.export'))
{
JToolBarHelper::custom('class_methods.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
ToolbarHelper::custom('class_methods.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
}
}
if ($this->canDo->get('core.import') && $this->canDo->get('class_method.import'))
{
JToolBarHelper::custom('class_methods.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
ToolbarHelper::custom('class_methods.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_methods');
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');
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
@ -174,9 +187,9 @@ class ComponentbuilderViewClass_methods extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text')
);
}
@ -184,19 +197,19 @@ class ComponentbuilderViewClass_methods extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Visibility Selection
$this->visibilityOptions = JFormHelper::loadFieldType('classmethodsfiltervisibility')->options;
$this->visibilityOptions = FormHelper::loadFieldType('classmethodsfiltervisibility')->options;
// We do some sanitation for Visibility filter
if (ComponentbuilderHelper::checkArray($this->visibilityOptions) &&
if (ArrayHelper::check($this->visibilityOptions) &&
isset($this->visibilityOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->visibilityOptions[0]->value))
!StringHelper::check($this->visibilityOptions[0]->value))
{
unset($this->visibilityOptions[0]);
}
// Visibility Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -',
'batch[visibility]',
JHtml::_('select.options', $this->visibilityOptions, 'value', 'text')
Html::_('select.options', $this->visibilityOptions, 'value', 'text')
);
}
@ -204,19 +217,19 @@ class ComponentbuilderViewClass_methods extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Extension Type Selection
$this->extension_typeOptions = JFormHelper::loadFieldType('classmethodsfilterextensiontype')->options;
$this->extension_typeOptions = FormHelper::loadFieldType('classmethodsfilterextensiontype')->options;
// We do some sanitation for Extension Type filter
if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) &&
if (ArrayHelper::check($this->extension_typeOptions) &&
isset($this->extension_typeOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value))
!StringHelper::check($this->extension_typeOptions[0]->value))
{
unset($this->extension_typeOptions[0]);
}
// Extension Type Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -',
'batch[extension_type]',
JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text')
Html::_('select.options', $this->extension_typeOptions, 'value', 'text')
);
}
}
@ -230,10 +243,10 @@ class ComponentbuilderViewClass_methods extends HtmlView
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
$this->document = Factory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_METHODS'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_methods.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_METHODS'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_methods.css", ['version' => 'auto']);
}
/**
@ -248,26 +261,36 @@ class ComponentbuilderViewClass_methods extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
return StringHelper::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL'),
'a.visibility' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL'),
'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
'a.published' => Text::_('JSTATUS'),
'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL'),
'a.visibility' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL'),
'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL'),
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,17 +12,24 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -'));
JHtml::_('formbehavior.chosen', 'select');
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\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)
{
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_properties.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'class_propertyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
Html::_('sortablelist.sortable', 'class_propertyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
}
?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=class_properties'); ?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=class_properties'); ?>" method="post" name="adminForm" id="adminForm">
<?php if(!empty( $this->sidebar)): ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
@ -33,13 +40,13 @@ if ($this->saveOrder)
<?php endif; ?>
<?php
// Add the trash helper layout
echo JLayoutHelper::render('trashhelper', $this);
echo LayoutHelper::render('trashhelper', $this);
// Add the searchtools
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)): ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table table-striped" id="class_propertyList">
@ -49,11 +56,11 @@ if ($this->saveOrder)
</table>
<?php // Load the batch processing form. ?>
<?php if ($this->canCreate && $this->canEdit) : ?>
<?php echo JHtml::_(
<?php echo Html::_(
'bootstrap.renderModal',
'collapseModal',
array(
'title' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_OPTIONS'),
'title' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_OPTIONS'),
'footer' => $this->loadTemplate('batch_footer')
),
$this->loadTemplate('batch_body')
@ -63,5 +70,5 @@ if ($this->saveOrder)
</div>
<?php endif; ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>

View File

@ -12,7 +12,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<p><?php echo JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_TIP'); ?></p>
<p><?php echo Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_TIP'); ?></p>
<?php echo $this->batchDisplay; ?>

View File

@ -12,12 +12,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
?>
<!-- clear the batch values if cancel -->
<button class="btn" type="button" onclick="" data-dismiss="modal">
<?php echo JText::_('JCANCEL'); ?>
<?php echo Text::_('JCANCEL'); ?>
</button>
<!-- post the batch values if process -->
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('class_property.batch');">
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
</button>

View File

@ -11,6 +11,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use VDM\Joomla\Utilities\StringHelper;
$edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_property.edit";
@ -19,7 +23,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
<?php foreach ($this->items as $i => $item): ?>
<?php
$canCheckin = $this->user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
$userChkOut = JFactory::getUser($item->checked_out);
$userChkOut = Factory::getUser($item->checked_out);
$canDo = ComponentbuilderHelper::getActions('class_property',$item,'class_properties');
?>
<tr class="row<?php echo $i % 2; ?>">
@ -29,7 +33,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
$iconClass = '';
if (!$this->saveOrder)
{
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
$iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED');
}
?>
<span class="sortable-handler<?php echo $iconClass; ?>">
@ -47,12 +51,12 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
<?php if ($canDo->get('class_property.edit')): ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php else: ?>
&#9633;
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('grid.id', $i, $item->id); ?>
<?php echo Html::_('grid.id', $i, $item->id); ?>
<?php endif; ?>
<?php else: ?>
&#9633;
@ -63,7 +67,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
<?php if ($canDo->get('class_property.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $this->escape($item->name); ?></a>
<?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'class_properties.', $canCheckin); ?>
<?php echo Html::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'class_properties.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $this->escape($item->name); ?>
@ -71,16 +75,16 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
</div>
</td>
<td class="hidden-phone">
<?php echo JText::_($item->visibility); ?>
<?php echo Text::_($item->visibility); ?>
</td>
<td class="hidden-phone">
<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 Text::_($item->extension_type); ?> <?php echo Text::_('COM_COMPONENTBUILDER_GROUP'); ?>: <b>
<?php echo $this->escape($item->joomla_plugin_group_name); ?></b>
<?php else: ?>
<?php echo JText::_($item->extension_type); ?>
<?php echo Text::_($item->extension_type); ?>
<?php endif; ?>
</div>
</td>
@ -88,15 +92,15 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
<?php if ($canDo->get('class_property.edit.state')) : ?>
<?php if ($item->checked_out) : ?>
<?php if ($canCheckin) : ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_properties.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_properties.', true, 'cb'); ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_properties.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_properties.', false, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_properties.', true, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_properties.', true, 'cb'); ?>
<?php endif; ?>
<?php else: ?>
<?php echo JHtml::_('jgrid.published', $item->published, $i, 'class_properties.', false, 'cb'); ?>
<?php echo Html::_('jgrid.published', $item->published, $i, 'class_properties.', false, 'cb'); ?>
<?php endif; ?>
</td>
<td class="nowrap center hidden-phone">

View File

@ -12,14 +12,17 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<tr>
<?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
<?php echo Html::_('searchtools.sort', '', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?>
</th>
<th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo Html::_('grid.checkall'); ?>
</th>
<?php else: ?>
<th width="20" class="nowrap center hidden-phone">
@ -30,24 +33,24 @@ defined('_JEXEC') or die('Restricted access');
</th>
<?php endif; ?>
<th class="nowrap" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL', 'a.name', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL', 'a.visibility', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL', 'a.visibility', $this->listDirn, $this->listOrder); ?>
</th>
<th class="nowrap hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL', 'a.extension_type', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL', 'a.extension_type', $this->listDirn, $this->listOrder); ?>
</th>
<?php if ($this->canState): ?>
<th width="10" class="nowrap center" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_STATUS', 'a.published', $this->listDirn, $this->listOrder); ?>
</th>
<?php else: ?>
<th width="10" class="nowrap center" >
<?php echo JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_STATUS'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_STATUS'); ?>
</th>
<?php endif; ?>
<th width="5" class="nowrap center hidden-phone" >
<?php echo JHtml::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_CLASS_PROPERTY_ID', 'a.id', $this->listDirn, $this->listOrder); ?>
</th>
</tr>

View File

@ -12,34 +12,37 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search Class_properties'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search Class_properties'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right">
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>

View File

@ -12,7 +12,20 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Class_properties
@ -35,7 +48,7 @@ class ComponentbuilderViewClass_properties extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Load the filter form from xml.
$this->filterForm = $this->get('FilterForm');
// Load the active filters.
@ -45,7 +58,7 @@ class ComponentbuilderViewClass_properties extends HtmlView
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_property');
$this->canEdit = $this->canDo->get('class_property.edit');
@ -65,7 +78,7 @@ class ComponentbuilderViewClass_properties extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -84,32 +97,32 @@ class ComponentbuilderViewClass_properties extends HtmlView
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'), 'cube');
JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_properties');
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'), 'cube');
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
JToolBarHelper::addNew('class_property.add');
ToolbarHelper::addNew('class_property.add');
}
// Only load if there are items
if (ComponentbuilderHelper::checkArray($this->items))
if (ArrayHelper::check($this->items))
{
if ($this->canEdit)
{
JToolBarHelper::editList('class_property.edit');
ToolbarHelper::editList('class_property.edit');
}
if ($this->canState)
{
JToolBarHelper::publishList('class_properties.publish');
JToolBarHelper::unpublishList('class_properties.unpublish');
JToolBarHelper::archiveList('class_properties.archive');
ToolbarHelper::publishList('class_properties.publish');
ToolbarHelper::unpublishList('class_properties.unpublish');
ToolbarHelper::archiveList('class_properties.archive');
if ($this->canDo->get('core.admin'))
{
JToolBarHelper::checkin('class_properties.checkin');
ToolbarHelper::checkin('class_properties.checkin');
}
}
@ -117,11 +130,11 @@ class ComponentbuilderViewClass_properties extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$bar = Toolbar::getInstance('toolbar');
// set the batch button name
$title = JText::_('JTOOLBAR_BATCH');
$title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
$layout = new JLayoutFile('joomla.toolbar.batch');
$layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@ -129,44 +142,44 @@ class ComponentbuilderViewClass_properties extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
JToolbarHelper::deleteList('', 'class_properties.delete', 'JTOOLBAR_EMPTY_TRASH');
ToolbarHelper::deleteList('', 'class_properties.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
JToolbarHelper::trash('class_properties.trash');
ToolbarHelper::trash('class_properties.trash');
}
if ($this->canDo->get('core.export') && $this->canDo->get('class_property.export'))
{
JToolBarHelper::custom('class_properties.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
ToolbarHelper::custom('class_properties.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
}
}
if ($this->canDo->get('core.import') && $this->canDo->get('class_property.import'))
{
JToolBarHelper::custom('class_properties.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
ToolbarHelper::custom('class_properties.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_properties');
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');
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
@ -174,9 +187,9 @@ class ComponentbuilderViewClass_properties extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
JHtmlBatch_::addListSelection(
JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text')
);
}
@ -184,19 +197,19 @@ class ComponentbuilderViewClass_properties extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Visibility Selection
$this->visibilityOptions = JFormHelper::loadFieldType('classpropertiesfiltervisibility')->options;
$this->visibilityOptions = FormHelper::loadFieldType('classpropertiesfiltervisibility')->options;
// We do some sanitation for Visibility filter
if (ComponentbuilderHelper::checkArray($this->visibilityOptions) &&
if (ArrayHelper::check($this->visibilityOptions) &&
isset($this->visibilityOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->visibilityOptions[0]->value))
!StringHelper::check($this->visibilityOptions[0]->value))
{
unset($this->visibilityOptions[0]);
}
// Visibility Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -',
'batch[visibility]',
JHtml::_('select.options', $this->visibilityOptions, 'value', 'text')
Html::_('select.options', $this->visibilityOptions, 'value', 'text')
);
}
@ -204,19 +217,19 @@ class ComponentbuilderViewClass_properties extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Extension Type Selection
$this->extension_typeOptions = JFormHelper::loadFieldType('classpropertiesfilterextensiontype')->options;
$this->extension_typeOptions = FormHelper::loadFieldType('classpropertiesfilterextensiontype')->options;
// We do some sanitation for Extension Type filter
if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) &&
if (ArrayHelper::check($this->extension_typeOptions) &&
isset($this->extension_typeOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value))
!StringHelper::check($this->extension_typeOptions[0]->value))
{
unset($this->extension_typeOptions[0]);
}
// Extension Type Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -',
'- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -',
'batch[extension_type]',
JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text')
Html::_('select.options', $this->extension_typeOptions, 'value', 'text')
);
}
}
@ -230,10 +243,10 @@ class ComponentbuilderViewClass_properties extends HtmlView
{
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
$this->document = Factory::getDocument();
}
$this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_properties.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_properties.css", ['version' => 'auto']);
}
/**
@ -248,26 +261,36 @@ class ComponentbuilderViewClass_properties extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
return StringHelper::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
* @return array Array containing the field name to sort by as the key and display text as value
* @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
return array(
'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL'),
'a.visibility' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL'),
'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL'),
'a.id' => JText::_('JGRID_HEADING_ID')
'a.ordering' => Text::_('JGRID_HEADING_ORDERING'),
'a.published' => Text::_('JSTATUS'),
'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL'),
'a.visibility' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL'),
'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL'),
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,71 +12,70 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'class_propertyTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'class_propertyTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_propertyTab', 'details', JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_DETAILS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_propertyTab', 'details', Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('class_property.details_left', $this); ?>
<?php echo LayoutHelper::render('class_property.details_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('class_property.details_right', $this); ?>
<?php echo LayoutHelper::render('class_property.details_right', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'class_propertyTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('class_property.edit.created_by') || $this->canDo->get('class_property.edit.created') || $this->canDo->get('class_property.edit.state') || ($this->canDo->get('class_property.delete') && $this->canDo->get('class_property.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_propertyTab', 'publishing', JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_propertyTab', 'publishing', Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('class_property.publishing', $this); ?>
<?php echo LayoutHelper::render('class_property.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('class_property.publlshing', $this); ?>
<?php echo LayoutHelper::render('class_property.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'class_propertyTab', 'permissions', JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'class_propertyTab', 'permissions', Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -91,14 +90,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="class_property.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>
@ -125,13 +124,13 @@ jQuery('#adminForm').on('change', '#jform_extension_type',function (e)
<?php
$app = JFactory::getApplication();
$app = Factory::getApplication();
?>
function JRouter(link) {
<?php
if ($app->isClient('site'))
{
echo 'var url = "'.JURI::root().'";';
echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";';
}
else
{

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Class_property Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewClass_property extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewClass_property extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('class_property', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewClass_property extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewClass_property extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('class_property.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('class_property.edit'))
{
// We can save the record.
JToolBarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('class_property.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewClass_property extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('class_property.create'))
{
JToolBarHelper::apply('class_property.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('class_property.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('class_property.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('class_property.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('class_property.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('class_property.edit'))
{
// We can save the new record
JToolBarHelper::apply('class_property.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('class_property.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('class_property.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('class_property.create'))
{
JToolBarHelper::custom('class_property.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('class_property.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('class_property.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('class_property.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.class_property', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.class_property', $this->item->id);
}
if ($this->canDo->get('class_property.create'))
{
JToolBarHelper::custom('class_property.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('class_property.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('class_property');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewClass_property extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,32 +196,38 @@ class ComponentbuilderViewClass_property extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_property.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_property.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/class_property/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/class_property/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
// add the Uikit v2 extra style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 extra JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';");
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -11,16 +11,22 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
use Joomla\CMS\Session\Session;
use VDM\Joomla\Utilities\StringHelper;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$this->app->input->set('hidemainmenu', false);
$selectNotice = '<h3>' . JText::_('COM_COMPONENTBUILDER_HI') . ' ' . $this->user->name . '</h3>';
$selectNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE') . '</p>';
$selectNotice = '<h3>' . Text::_('COM_COMPONENTBUILDER_HI') . ' ' . $this->user->name . '</h3>';
$selectNotice .= '<p>' . Text::_('COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE') . '</p>';
// set the noticeboard options
$noticeboardOptions = array('vdm', 'pro');
@ -28,94 +34,101 @@ $noticeboardOptions = array('vdm', 'pro');
<?php if ($this->canDo->get('compiler.access')): ?>
<script type="text/javascript">
Joomla.submitbutton = function(task, key)
{
if (task == ''){
Joomla.submitbutton = function(task, key) {
if (task === '') {
return false;
} else {
var component = jQuery('#component_id').val();
var component = document.getElementById('component_id').value;
var isValid = true;
if(component == '' && task == 'compiler.compiler'){
if (component === '' && task === 'compiler.compiler') {
isValid = false;
}
if (isValid){
jQuery('#form').hide();
// get correct form based on task
if (isValid) {
document.getElementById('form').style.display = 'none';
var form = document.getElementById('adminForm');
// set the plugin id
if (task == 'compiler.installCompiledModule' || task == 'compiler.installCompiledPlugin') {
if (task === 'compiler.installCompiledModule' || task === 'compiler.installCompiledPlugin') {
form.install_item_id.value = key;
}
// set the task value
form.task.value = task;
// seems we need a little delay here
setTimeout(function() {
form.submit();
}, 100);
// some ui movements
if (task == 'compiler.compiler'){
// get the component name
let component_name = jQuery("#component_id option:selected").text();
// set the component name
jQuery(".component-name").text(component_name);
// wait a little since to much is happening...
if (task === 'compiler.compiler') {
let component_name = document.querySelector("#component_id option:checked").textContent;
document.querySelectorAll(".component-name").forEach(elem => {
elem.textContent = component_name;
});
setTimeout(function() {
jQuery('#compiler').show();
jQuery('#compiling').css('display', 'block');
// wait a little since to much is happening...
document.getElementById('compiler').style.display = 'block';
document.getElementById('compiling').style.display = 'block';
setTimeout(function() {
jQuery('#compiler-spinner').show();
jQuery('#compiler-notice').show();
document.getElementById('compiler-spinner').style.display = 'block';
document.getElementById('compiler-notice').style.display = 'block';
}, 100);
}, 100);
} else if (task == 'compiler.clearTmp'){
jQuery('#clear').show();
jQuery('#loading').css('display', 'block');
} else if (task == 'compiler.getCompilerAnimations'){
jQuery('#get-compiler-animations').show();
jQuery('#loading').css('display', 'block');
} else if (task === 'compiler.clearTmp') {
document.getElementById('clear').style.display = 'block';
document.getElementById('loading').style.display = 'block';
} else if (task === 'compiler.getCompilerAnimations') {
document.getElementById('get-compiler-animations').style.display = 'block';
document.getElementById('loading').style.display = 'block';
} else {
jQuery('#loading').css('display', 'block');
document.getElementById('loading').style.display = 'block';
}
return true;
} else {
jQuery('.notice').show();
document.querySelectorAll('.notice').forEach(elem => {
elem.style.display = 'block';
});
return false;
}
}
}
// Add spindle-wheel for importations:
jQuery(document).ready(function($) {
document.addEventListener('DOMContentLoaded', function() {
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
// for the compiler
var outerDiv = jQuery('body');
jQuery('<div id="compiling"></div>')
.css("background", "rgba(16, 164, 230, .4)")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.40")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 40)")
.css("filter", "alpha(opacity = 40)")
.css("display", "none")
.appendTo(outerDiv);
// get page body
var outerBodyDiv = document.querySelector('body');
// start loading spinner
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
// Set CSS properties individually
loadingDiv.style.background = "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat";
loadingDiv.style.top = (outerBodyDiv.getBoundingClientRect().top + window.pageYOffset) + "px";
loadingDiv.style.left = (outerBodyDiv.getBoundingClientRect().left + window.pageXOffset) + "px";
loadingDiv.style.width = outerBodyDiv.offsetWidth + "px";
loadingDiv.style.height = outerBodyDiv.offsetHeight + "px";
loadingDiv.style.position = 'fixed';
loadingDiv.style.opacity = '0.80';
loadingDiv.style.msFilter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
loadingDiv.style.filter = "alpha(opacity=80)";
loadingDiv.style.display = 'none';
// add to page body
outerBodyDiv.appendChild(loadingDiv);
// waiting compiler overlay
var compilingDiv = document.createElement('div');
compilingDiv.id = 'compiling';
// Set CSS properties individually
compilingDiv.style.background = "rgba(16, 164, 230, .4)";
compilingDiv.style.top = (outerBodyDiv.getBoundingClientRect().top + window.pageYOffset) + "px";
compilingDiv.style.left = (outerBodyDiv.getBoundingClientRect().left + window.pageXOffset) + "px";
compilingDiv.style.width = outerBodyDiv.offsetWidth + "px";
compilingDiv.style.height = outerBodyDiv.offsetHeight + "px";
compilingDiv.style.position = 'fixed';
compilingDiv.style.opacity = '0.40';
compilingDiv.style.msFilter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)";
compilingDiv.style.filter = "alpha(opacity=40)";
compilingDiv.style.display = 'none';
// add to page
outerBodyDiv.appendChild(compilingDiv);
});
</script>
<?php if(!empty( $this->sidebar)): ?>
@ -132,14 +145,14 @@ jQuery('<div id="compiling"></div>')
<?php echo $this->SuccessMessage; ?>
</div>
<?php endif; ?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=compiler'); ?>"
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=compiler'); ?>"
method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<div id="form" >
<div class="span4">
<h3><?php echo JText::_('COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT'); ?></h3>
<h3><?php echo Text::_('COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT'); ?></h3>
<div id="compilerForm">
<div>
<span class="notice" style="display:none; color:red;"><?php echo JText::_('COM_COMPONENTBUILDER_YOU_MUST_SELECT_A_COMPONENT'); ?></span><br />
<span class="notice" style="display:none; color:red;"><?php echo Text::_('COM_COMPONENTBUILDER_YOU_MUST_SELECT_A_COMPONENT'); ?></span><br />
<?php if ($this->form): ?>
<?php echo $this->form->renderFieldset('builder'); ?>
<?php endif; ?>
@ -147,7 +160,7 @@ jQuery('<div id="compiling"></div>')
<br />
<div class="clearfix"></div>
<button class="btn btn-small btn-success" onclick="Joomla.submitbutton('compiler.compiler')"><span class="icon-cog icon-white"></span>
<?php echo JText::_('COM_COMPONENTBUILDER_COMPILE_COMPONENT'); ?>
<?php echo Text::_('COM_COMPONENTBUILDER_COMPILE_COMPONENT'); ?>
</button>
<input type="hidden" name="install_item_id" value="0">
<input type="hidden" name="version" value="3" />
@ -156,75 +169,83 @@ jQuery('<div id="compiling"></div>')
<div class="span7">
<div id="advance-details"><?php echo $this->form->renderFieldset('advanced'); ?></div>
<div id="component-details"><?php echo $selectNotice; ?></div>
<?php echo JLayoutHelper::render('jcbnoticeboardtabs', array('id' => 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?>
<?php echo LayoutHelper::render('jcbnoticeboardtabs', array('id' => 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?>
</div>
</div>
<div id="get-compiler-animations" style="display:none;">
<h1><?php echo JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT'); ?></h1>
<h4><?php echo JText::_('COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION'); ?> <span class="loading-dots">.</span></h4>
<h1><?php echo Text::_('COM_COMPONENTBUILDER_PLEASE_WAIT'); ?></h1>
<h4><?php echo Text::_('COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION'); ?> <span class="loading-dots">.</span></h4>
<div class="clearfix"></div>
</div>
<div id="clear" style="display:none;">
<h1><?php echo JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT'); ?></h1>
<h4><?php echo JText::_('COM_COMPONENTBUILDER_REMOVING_ALL_ZIP_PACKAGES_FROM_THE_TEMPORARY_FOLDER_OF_THE_JOOMLA_INSTALL'); ?> <span class="loading-dots">.</span></h4>
<h1><?php echo Text::_('COM_COMPONENTBUILDER_PLEASE_WAIT'); ?></h1>
<h4><?php echo Text::_('COM_COMPONENTBUILDER_REMOVING_ALL_ZIP_PACKAGES_FROM_THE_TEMPORARY_FOLDER_OF_THE_JOOMLA_INSTALL'); ?> <span class="loading-dots">.</span></h4>
<div class="clearfix"></div>
</div>
<div id="compiler" style="display:none;">
<div id="compiler-spinner" class="span4" style="display:none;">
<h3><?php echo JText::sprintf('COM_COMPONENTBUILDER_S_PLEASE_WAIT', $this->user->name); ?></h3>
<p style="font-size: smaller;"><?php echo JText::_('COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT'); ?></p>
<p><b><span class="component-name"><?php echo JText::_('COM_COMPONENTBUILDER_THE_COMPONENT'); ?></span></b> <?php echo JText::_('COM_COMPONENTBUILDER_IS_BEING_COMPILED'); ?> <span class="loading-dots">.</span></p>
<h3><?php echo Text::sprintf('COM_COMPONENTBUILDER_S_PLEASE_WAIT', $this->user->name); ?></h3>
<p style="font-size: smaller;"><?php echo Text::_('COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT'); ?></p>
<p><b><span class="component-name"><?php echo Text::_('COM_COMPONENTBUILDER_THE_COMPONENT'); ?></span></b> <?php echo Text::_('COM_COMPONENTBUILDER_IS_BEING_COMPILED'); ?> <span class="loading-dots">.</span></p>
<div style="text-align: center;"><?php echo ComponentbuilderHelper::getDynamicContent('builder-gif', $this->builder_gif_size); ?></div>
<div class="clearfix"></div>
</div>
<div id="compiler-notice" class="span7" style="display:none;">
<?php echo JLayoutHelper::render('jcbnoticeboard' . $noticeboardOptions[array_rand($noticeboardOptions)], null); ?>
<?php echo LayoutHelper::render('jcbnoticeboard' . $noticeboardOptions[array_rand($noticeboardOptions)], null); ?>
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
</div>
</div>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</form>
</div>
<script type="text/javascript">
// token
var token = '<?php echo JSession::getFormToken(); ?>';
var all_is_good = '<?php echo JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME'); ?>';
jQuery('#compilerForm').on('change', '#component_id',function (e)
{
var component = jQuery('#component_id').val();
if(component == "") {
jQuery('#component-details').html("<?php echo $selectNotice; ?>");
jQuery("#noticeboard").show();
jQuery('.notice').show();
} else {
getComponentDetails(component);
jQuery("#noticeboard").hide();
jQuery('.notice').hide();
var token = '<?php echo Session::getFormToken(); ?>';
var all_is_good = '<?php echo Text::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME'); ?>';
jQuery('#compilerForm').on('change', '#component_id', function (e) {
var componentSelect = document.getElementById('component_id');
if (componentSelect) {
var component = componentSelect.value;
if (component === "") {
document.getElementById('component-details').innerHTML = "<?php echo $selectNotice; ?>";
document.getElementById("noticeboard").style.display = 'block';
document.querySelectorAll('.notice').forEach(function (elem) {
elem.style.display = 'block';
});
} else {
getComponentDetails(component);
document.getElementById("noticeboard").style.display = 'none';
document.querySelectorAll('.notice').forEach(function (elem) {
elem.style.display = 'none';
});
}
}
});
// nice little dot trick :)
jQuery(document).ready( function($) {
var x=0;
setInterval(function() {
var dots = "";
x++;
for (var y=0; y < x%8; y++) {
dots+=".";
}
$(".loading-dots").text(dots);
} , 500);
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll(".loading-dots").forEach(function(loading_dots) {
let x = 0;
let intervalId = setInterval(function() {
if (!loading_dots.classList.contains("loading-dots")) {
clearInterval(intervalId);
return;
}
let dots = ".".repeat(x % 8);
loading_dots.textContent = dots;
x++;
}, 500);
});
});
<?php
$app = JFactory::getApplication();
$app = Factory::getApplication();
?>
function JRouter(link) {
<?php
if ($app->isClient('site'))
{
echo 'var url = "'.JURI::root().'";';
echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";';
}
else
{
@ -235,5 +256,5 @@ function JRouter(link) {
}
</script>
<?php else: ?>
<h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>
<h1><?php echo Text::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>
<?php endif; ?>

View File

@ -12,10 +12,20 @@
// 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 Joomla\CMS\Form\Form;
use Joomla\CMS\Layout\LayoutHelper;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\FormHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Compiler
@ -26,11 +36,11 @@ class ComponentbuilderViewCompiler 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('compiler');
// Initialise variables.
@ -102,15 +112,15 @@ class ComponentbuilderViewCompiler 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);
}
// These are subform layouts used in JCB
// JLayoutHelper::render('sectionjcb', [?]); // added to ensure the layout are loaded
// JLayoutHelper::render('repeatablejcb', [?]); // added to ensure the layout are loaded
// LayoutHelper::render('sectionjcb', [?]); // added to ensure the layout are loaded
// LayoutHelper::render('repeatablejcb', [?]); // added to ensure the layout are loaded
/**
* Get the dynamic build form fields needed on the page
@ -147,7 +157,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
@ -167,7 +177,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
@ -188,7 +198,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
@ -208,7 +218,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
@ -228,7 +238,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
@ -248,7 +258,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
@ -272,7 +282,58 @@ class ComponentbuilderViewCompiler extends HtmlView
}
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// Joomla Versions attributes
$attributes = [
'type' => 'list',
'name' => 'joomla_version',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_VERSION',
'class' => 'list_class',
'description' => 'COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET',
'default' => '3'];
// start the joomla versions options
$options = [
'3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE',
'4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR_AND_FIVE'
];
// add to form
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// Joomla Version 3 attributes
$attributes = [
'type' => 'note',
'name' => 'joomla_version_note_three',
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE',
'class' => 'alert alert-success',
'showon' => 'joomla_version:3'];
// add to form
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// Joomla Version 4 and five attributes
$attributes = [
'type' => 'note',
'name' => 'joomla_version_note_four_five',
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR_AND_JOOMLA_FIVE',
'class' => 'alert alert-success',
'showon' => 'joomla_version:4'];
// add to form
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
@ -292,7 +353,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
@ -307,58 +368,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'showon' => 'show_advanced_options:1'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Joomla Versions attributes
$attributes = [
'type' => 'radio',
'name' => 'joomla_version_donations',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_VERSION',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET',
'default' => '3',
'showon' => 'show_advanced_options:1'];
// start the joomla versions options
$options = [
'3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE',
'4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Joomla Version 3 attributes
$attributes = [
'type' => 'note',
'name' => 'joomla_version_note_three',
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE',
'class' => 'alert alert-success',
'showon' => 'show_advanced_options:1[AND]joomla_version_donations:3'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Joomla Version 4 attributes
$attributes = [
'type' => 'note',
'name' => 'joomla_version_note_four',
'description' => 'COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB',
'class' => 'alert alert-info',
'showon' => 'show_advanced_options:1[AND]joomla_version_donations:4'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -380,7 +390,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -397,7 +407,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'showon' => 'show_advanced_options:1[AND]powers_repository:1'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -420,7 +430,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'4' => 'COM_COMPONENTBUILDER_FOUR_SPACES'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -442,7 +452,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'3' => 'COM_COMPONENTBUILDER_COMPONENT'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -457,7 +467,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'showon' => 'show_advanced_options:1[AND]add_build_date:2'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -472,7 +482,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'showon' => 'show_advanced_options:1[AND]add_build_date:3'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -490,7 +500,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'showon' => 'show_advanced_options:1[AND]add_build_date:2'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -507,7 +517,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'showon' => 'show_advanced_options:1'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -521,7 +531,7 @@ class ComponentbuilderViewCompiler extends HtmlView
'showon' => 'show_advanced_options:1'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
@ -543,7 +553,7 @@ class ComponentbuilderViewCompiler extends HtmlView
*/
protected function getSupportMessage(): string
{
return JLayoutHelper::render('jcbsupportmessage', []);
return LayoutHelper::render('jcbsupportmessage', []);
}
@ -556,12 +566,12 @@ class ComponentbuilderViewCompiler 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();
// Load uikit options.
$uikit = $this->params->get('uikit_load');
@ -573,26 +583,26 @@ class ComponentbuilderViewCompiler 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';
// Get field uikit components needed in this view.
$uikitFieldComp = $this->get('UikitComp');
if (isset($uikitFieldComp) && ComponentbuilderHelper::checkArray($uikitFieldComp))
if (isset($uikitFieldComp) && ArrayHelper::check($uikitFieldComp))
{
if (isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp))
if (isset($uikitComp) && ArrayHelper::check($uikitComp))
{
$uikitComp = array_merge($uikitComp, $uikitFieldComp);
$uikitComp = array_unique($uikitComp);
@ -605,10 +615,8 @@ class ComponentbuilderViewCompiler extends HtmlView
}
// 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)
{
@ -618,95 +626,108 @@ class ComponentbuilderViewCompiler 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']);
}
}
}
}
// add marked library
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/custom/marked.js");
Html::_('script', 'administrator/components/com_componentbuilder/custom/marked.js', ['version' => 'auto']);
// add the document default css file
JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/compiler.css', ['version' => 'auto']);
Html::_('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){
var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json&raw=true\");
if(token.length > 0 && id > 0){
var request = token+'=1&id='+id;
function getComponentDetails_server(id) {
let getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json&raw=true\");
let request = new URLSearchParams();
if (token.length > 0 && id > 0) {
request.append(token, '1');
request.append('id', id);
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'json',
data: request,
jsonp: false
});
return fetch(getUrl + '&' + request.toString(), {
method: 'GET',
headers: {
'Accept': 'application/json'
}
}).then(response => response.json());
}
function getComponentDetails(id) {
getComponentDetails_server(id).done(function(result) {
if(result.html) {
jQuery('#component-details').html(result.html);
getComponentDetails_server(id).then(function(result) {
if (result.html) {
document.getElementById('component-details').innerHTML = result.html;
}
});
}
var noticeboard = \"https://vdm.bz/componentbuilder-noticeboard-md\";
var proboard = \"https://vdm.bz/componentbuilder-pro-noticeboard-md\";
jQuery(document).ready(function () {
jQuery.get(noticeboard)
.success(function(board) {
if (board.length > 5) {
jQuery(\".noticeboard-md\").html(marked.parse(board));
getIS(1,board).done(function(result) {
if (result){
jQuery(\".vdm-new-notice\").show();
getIS(2,board);
}
});
} else {
jQuery(\".noticeboard-md\").html(all_is_good);
}
})
.error(function(jqXHR, textStatus, errorThrown) {
jQuery(\".noticeboard-md\").html(all_is_good);
});
jQuery.get(proboard)
.success(function(board) {
if (board.length > 5) {
jQuery(\".proboard-md\").html(marked.parse(board));
} else {
jQuery(\".proboard-md\").html(all_is_good);
}
})
.error(function(jqXHR, textStatus, errorThrown) {
jQuery(\".proboard-md\").html(all_is_good);
});
document.addEventListener('DOMContentLoaded', function() {
fetchNoticeboard(\"https://vdm.bz/componentbuilder-noticeboard-md\", \".noticeboard-md\", true);
fetchNoticeboard(\"https://vdm.bz/componentbuilder-pro-noticeboard-md\", \".proboard-md\", false);
});
// to check is READ/NEW
function getIS(type,notice){
if (type == 1) {
var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true\");
} else if (type == 2) {
var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true\");
}
if(token.length > 0 && notice.length){
var request = token+\"=1&notice=\"+notice;
}
return jQuery.ajax({
type: \"POST\",
url: getUrl,
dataType: 'json',
data: request,
jsonp: false
function fetchNoticeboard(url, selector, processGetIS) {
fetch(url)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(board => {
var elements = document.querySelectorAll(selector);
if (board.length > 5) {
let html_board = marked.parse(board);
elements.forEach(element => {
element.innerHTML = html_board;
});
if (processGetIS) {
getIS(1, board).then(result => {
if (result) {
document.querySelectorAll(\".vdm-new-notice\").forEach(element => {
element.style.display = 'block';
});
getIS(2, board);
}
});
}
} else {
elements.forEach(element => {
element.innerHTML = all_is_good;
});
}
})
.catch(error => {
console.error('There was an error!', error);
document.querySelectorAll(selector).forEach(element => {
element.innerHTML = all_is_good;
});
});
}
// to check is READ/NEW
function getIS(type, notice) {
let getUrl = \"\";
if (type === 1) {
getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true\");
} else if (type === 2) {
getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true\");
}
let request = new URLSearchParams();
if (token.length > 0 && notice.length) {
request.append(token, \"1\");
request.append(\"notice\", notice);
}
return fetch(getUrl, {
method: \"POST\",
headers: {
\"Content-Type\": \"application/x-www-form-urlencoded;charset=UTF-8\"
},
body: request
}).then(response => response.json());
}
");
}
@ -718,41 +739,41 @@ class ComponentbuilderViewCompiler extends HtmlView
// hide the main menu
$this->app->input->set('hidemainmenu', true);
// add title to the page
JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPILER'),'cogs');
ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_COMPILER'),'cogs');
// add cpanel button
JToolBarHelper::custom('compiler.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false);
ToolbarHelper::custom('compiler.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false);
if ($this->canDo->get('compiler.run_expansion'))
{
// add Run Expansion button.
JToolBarHelper::custom('compiler.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false);
ToolbarHelper::custom('compiler.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false);
}
if ($this->canDo->get('compiler.translate'))
{
// add Translate button.
JToolBarHelper::custom('compiler.runTranslator', 'comments-2 custom-button-runtranslator', '', 'COM_COMPONENTBUILDER_TRANSLATE', false);
ToolbarHelper::custom('compiler.runTranslator', 'comments-2 custom-button-runtranslator', '', 'COM_COMPONENTBUILDER_TRANSLATE', false);
}
if ($this->canDo->get('compiler.compiler_animations'))
{
// add Compiler Animations button.
JToolBarHelper::custom('compiler.getDynamicContent', 'download custom-button-getdynamiccontent', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false);
ToolbarHelper::custom('compiler.getDynamicContent', 'download custom-button-getdynamiccontent', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false);
}
if ($this->canDo->get('compiler.clear_tmp'))
{
// add Clear tmp button.
JToolBarHelper::custom('compiler.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false);
ToolbarHelper::custom('compiler.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false);
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('compiler');
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');
}
}
@ -766,6 +787,16 @@ class ComponentbuilderViewCompiler 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;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,79 +12,78 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('component_admin_views.views_above', $this); ?>
<?php echo LayoutHelper::render('component_admin_views.views_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'component_admin_viewsTab', array('active' => 'views')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'component_admin_viewsTab', ['active' => 'views', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_admin_viewsTab', 'views', JText::_('COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_VIEWS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_admin_viewsTab', 'views', Text::_('COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_VIEWS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_admin_views.views_fullwidth', $this); ?>
<?php echo LayoutHelper::render('component_admin_views.views_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_admin_viewsTab', 'clone', JText::_('COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_CLONE', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_admin_viewsTab', 'clone', Text::_('COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_CLONE', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_admin_views.clone_left', $this); ?>
<?php echo LayoutHelper::render('component_admin_views.clone_left', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'component_admin_viewsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('component_admin_views.edit.created_by') || $this->canDo->get('component_admin_views.edit.created') || $this->canDo->get('component_admin_views.edit.state') || ($this->canDo->get('component_admin_views.delete') && $this->canDo->get('component_admin_views.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_admin_viewsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_admin_viewsTab', 'publishing', Text::_('COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('component_admin_views.publishing', $this); ?>
<?php echo LayoutHelper::render('component_admin_views.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('component_admin_views.publlshing', $this); ?>
<?php echo LayoutHelper::render('component_admin_views.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_admin_viewsTab', 'permissions', JText::_('COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_admin_viewsTab', 'permissions', Text::_('COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -99,14 +98,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="component_admin_views.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Component_admin_views Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('component_admin_views.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('component_admin_views.edit'))
{
// We can save the record.
JToolBarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('component_admin_views.create'))
{
JToolBarHelper::apply('component_admin_views.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('component_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('component_admin_views.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('component_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('component_admin_views.edit'))
{
// We can save the new record
JToolBarHelper::apply('component_admin_views.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('component_admin_views.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('component_admin_views.create'))
{
JToolBarHelper::custom('component_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('component_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_admin_views.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_admin_views.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.component_admin_views', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.component_admin_views', $this->item->id);
}
if ($this->canDo->get('component_admin_views.create'))
{
JToolBarHelper::custom('component_admin_views.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('component_admin_views.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('component_admin_views');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,20 +196,26 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_admin_views.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_admin_views/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_admin_views.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/component_admin_views/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,79 +12,78 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('component_config.options_above', $this); ?>
<?php echo LayoutHelper::render('component_config.options_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'component_configTab', array('active' => 'options')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'component_configTab', ['active' => 'options', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_configTab', 'options', JText::_('COM_COMPONENTBUILDER_COMPONENT_CONFIG_OPTIONS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_configTab', 'options', Text::_('COM_COMPONENTBUILDER_COMPONENT_CONFIG_OPTIONS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_config.options_fullwidth', $this); ?>
<?php echo LayoutHelper::render('component_config.options_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_configTab', 'clone', JText::_('COM_COMPONENTBUILDER_COMPONENT_CONFIG_CLONE', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_configTab', 'clone', Text::_('COM_COMPONENTBUILDER_COMPONENT_CONFIG_CLONE', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_config.clone_left', $this); ?>
<?php echo LayoutHelper::render('component_config.clone_left', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'component_configTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('component_config.edit.created_by') || $this->canDo->get('component_config.edit.created') || $this->canDo->get('component_config.edit.state') || ($this->canDo->get('component_config.delete') && $this->canDo->get('component_config.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_configTab', 'publishing', JText::_('COM_COMPONENTBUILDER_COMPONENT_CONFIG_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_configTab', 'publishing', Text::_('COM_COMPONENTBUILDER_COMPONENT_CONFIG_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('component_config.publishing', $this); ?>
<?php echo LayoutHelper::render('component_config.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('component_config.publlshing', $this); ?>
<?php echo LayoutHelper::render('component_config.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_configTab', 'permissions', JText::_('COM_COMPONENTBUILDER_COMPONENT_CONFIG_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_configTab', 'permissions', Text::_('COM_COMPONENTBUILDER_COMPONENT_CONFIG_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -99,14 +98,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="component_config.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Component_config Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewComponent_config extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewComponent_config extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_config', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewComponent_config extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewComponent_config extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('component_config.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('component_config.edit'))
{
// We can save the record.
JToolBarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('component_config.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_config.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('component_config.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_config.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewComponent_config extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('component_config.create'))
{
JToolBarHelper::apply('component_config.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('component_config.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('component_config.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('component_config.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('component_config.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_config.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('component_config.edit'))
{
// We can save the new record
JToolBarHelper::apply('component_config.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('component_config.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('component_config.create'))
{
JToolBarHelper::custom('component_config.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('component_config.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_config.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_config.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.component_config', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.component_config', $this->item->id);
}
if ($this->canDo->get('component_config.create'))
{
JToolBarHelper::custom('component_config.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('component_config.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('component_config.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_config.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('component_config');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewComponent_config extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,14 +196,20 @@ class ComponentbuilderViewComponent_config extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_config.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_config/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
JText::script('view not acceptable. Error');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_config.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/component_config/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,79 +12,78 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('component_custom_admin_menus.menus_above', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_menus.menus_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'component_custom_admin_menusTab', array('active' => 'menus')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'component_custom_admin_menusTab', ['active' => 'menus', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_custom_admin_menusTab', 'menus', JText::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_MENUS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_custom_admin_menusTab', 'menus', Text::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_MENUS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_custom_admin_menus.menus_fullwidth', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_menus.menus_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_custom_admin_menusTab', 'clone', JText::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_CLONE', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_custom_admin_menusTab', 'clone', Text::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_CLONE', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_custom_admin_menus.clone_left', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_menus.clone_left', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'component_custom_admin_menusTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('component_custom_admin_menus.edit.created_by') || $this->canDo->get('component_custom_admin_menus.edit.created') || $this->canDo->get('component_custom_admin_menus.edit.state') || ($this->canDo->get('component_custom_admin_menus.delete') && $this->canDo->get('component_custom_admin_menus.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_custom_admin_menusTab', 'publishing', JText::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_custom_admin_menusTab', 'publishing', Text::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('component_custom_admin_menus.publishing', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_menus.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('component_custom_admin_menus.publlshing', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_menus.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_custom_admin_menusTab', 'permissions', JText::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_custom_admin_menusTab', 'permissions', Text::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -99,14 +98,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="component_custom_admin_menus.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Component_custom_admin_menus Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('component_custom_admin_menus.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('component_custom_admin_menus.edit'))
{
// We can save the record.
JToolBarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('component_custom_admin_menus.create'))
{
JToolBarHelper::apply('component_custom_admin_menus.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('component_custom_admin_menus.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('component_custom_admin_menus.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('component_custom_admin_menus.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('component_custom_admin_menus.edit'))
{
// We can save the new record
JToolBarHelper::apply('component_custom_admin_menus.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('component_custom_admin_menus.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('component_custom_admin_menus.create'))
{
JToolBarHelper::custom('component_custom_admin_menus.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('component_custom_admin_menus.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_custom_admin_menus.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_custom_admin_menus.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.component_custom_admin_menus', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.component_custom_admin_menus', $this->item->id);
}
if ($this->canDo->get('component_custom_admin_menus.create'))
{
JToolBarHelper::custom('component_custom_admin_menus.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('component_custom_admin_menus.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('component_custom_admin_menus');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,20 +196,26 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_custom_admin_menus.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_custom_admin_menus/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_custom_admin_menus.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/component_custom_admin_menus/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,79 +12,78 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('component_custom_admin_views.views_above', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_views.views_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'component_custom_admin_viewsTab', array('active' => 'views')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'component_custom_admin_viewsTab', ['active' => 'views', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_custom_admin_viewsTab', 'views', JText::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_VIEWS', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_custom_admin_viewsTab', 'views', Text::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_VIEWS', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_custom_admin_views.views_fullwidth', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_views.views_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_custom_admin_viewsTab', 'clone', JText::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_CLONE', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_custom_admin_viewsTab', 'clone', Text::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_CLONE', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_custom_admin_views.clone_left', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_views.clone_left', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'component_custom_admin_viewsTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('component_custom_admin_views.edit.created_by') || $this->canDo->get('component_custom_admin_views.edit.created') || $this->canDo->get('component_custom_admin_views.edit.state') || ($this->canDo->get('component_custom_admin_views.delete') && $this->canDo->get('component_custom_admin_views.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_custom_admin_viewsTab', 'publishing', JText::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_custom_admin_viewsTab', 'publishing', Text::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('component_custom_admin_views.publishing', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_views.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('component_custom_admin_views.publlshing', $this); ?>
<?php echo LayoutHelper::render('component_custom_admin_views.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_custom_admin_viewsTab', 'permissions', JText::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_custom_admin_viewsTab', 'permissions', Text::_('COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -99,14 +98,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="component_custom_admin_views.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Component_custom_admin_views Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('component_custom_admin_views.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('component_custom_admin_views.edit'))
{
// We can save the record.
JToolBarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('component_custom_admin_views.create'))
{
JToolBarHelper::apply('component_custom_admin_views.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('component_custom_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('component_custom_admin_views.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('component_custom_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('component_custom_admin_views.edit'))
{
// We can save the new record
JToolBarHelper::apply('component_custom_admin_views.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('component_custom_admin_views.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('component_custom_admin_views.create'))
{
JToolBarHelper::custom('component_custom_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('component_custom_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_custom_admin_views.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_custom_admin_views.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.component_custom_admin_views', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.component_custom_admin_views', $this->item->id);
}
if ($this->canDo->get('component_custom_admin_views.create'))
{
JToolBarHelper::custom('component_custom_admin_views.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('component_custom_admin_views.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('component_custom_admin_views');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,20 +196,26 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_custom_admin_views.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_custom_admin_views/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_custom_admin_views.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/component_custom_admin_views/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,79 +12,78 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('component_dashboard.dashboard_above', $this); ?>
<?php echo LayoutHelper::render('component_dashboard.dashboard_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'component_dashboardTab', array('active' => 'dashboard')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'component_dashboardTab', ['active' => 'dashboard', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_dashboardTab', 'dashboard', JText::_('COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_DASHBOARD', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_dashboardTab', 'dashboard', Text::_('COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_DASHBOARD', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_dashboard.dashboard_fullwidth', $this); ?>
<?php echo LayoutHelper::render('component_dashboard.dashboard_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_dashboardTab', 'clone', JText::_('COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_CLONE', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_dashboardTab', 'clone', Text::_('COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_CLONE', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_dashboard.clone_left', $this); ?>
<?php echo LayoutHelper::render('component_dashboard.clone_left', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'component_dashboardTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('component_dashboard.edit.created_by') || $this->canDo->get('component_dashboard.edit.created') || $this->canDo->get('component_dashboard.edit.state') || ($this->canDo->get('component_dashboard.delete') && $this->canDo->get('component_dashboard.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_dashboardTab', 'publishing', JText::_('COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_dashboardTab', 'publishing', Text::_('COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('component_dashboard.publishing', $this); ?>
<?php echo LayoutHelper::render('component_dashboard.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('component_dashboard.publlshing', $this); ?>
<?php echo LayoutHelper::render('component_dashboard.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_dashboardTab', 'permissions', JText::_('COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_dashboardTab', 'permissions', Text::_('COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -99,14 +98,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="component_dashboard.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>
@ -118,13 +117,13 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php
$app = JFactory::getApplication();
$app = Factory::getApplication();
?>
function JRouter(link) {
<?php
if ($app->isClient('site'))
{
echo 'var url = "'.JURI::root().'";';
echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";';
}
else
{
@ -134,16 +133,18 @@ function JRouter(link) {
return url+link;
}
// nice little dot trick :)
jQuery(document).ready( function($) {
var x=0;
setInterval(function() {
var dots = "";
x++;
for (var y=0; y < x%8; y++) {
dots+=".";
}
$(".loading-dots").text(dots);
} , 500);
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll(".loading-dots").forEach(function(loading_dots) {
let x = 0;
let intervalId = setInterval(function() {
if (!loading_dots.classList.contains("loading-dots")) {
clearInterval(intervalId);
return;
}
let dots = ".".repeat(x % 8);
loading_dots.textContent = dots;
x++;
}, 500);
});
});
</script>

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Component_dashboard Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('component_dashboard.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('component_dashboard.edit'))
{
// We can save the record.
JToolBarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('component_dashboard.create'))
{
JToolBarHelper::apply('component_dashboard.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('component_dashboard.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('component_dashboard.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('component_dashboard.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('component_dashboard.edit'))
{
// We can save the new record
JToolBarHelper::apply('component_dashboard.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('component_dashboard.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('component_dashboard.create'))
{
JToolBarHelper::custom('component_dashboard.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('component_dashboard.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_dashboard.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_dashboard.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.component_dashboard', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.component_dashboard', $this->item->id);
}
if ($this->canDo->get('component_dashboard.create'))
{
JToolBarHelper::custom('component_dashboard.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('component_dashboard.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('component_dashboard');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,32 +196,38 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_dashboard.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_dashboard.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_dashboard/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/component_dashboard/submitbutton.js", ['version' => 'auto']);
// add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
// add the Uikit v2 extra style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']);
// add Uikit v2 extra JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';");
JText::script('view not acceptable. Error');
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@ -12,89 +12,88 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
.css("background", "rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat")
.css("top", outerDiv.position().top - jQuery(window).scrollTop())
.css("left", outerDiv.position().left - jQuery(window).scrollLeft())
.css("width", outerDiv.width())
.css("height", outerDiv.height())
.css("position", "fixed")
.css("opacity", "0.80")
.css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 80)")
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
jQuery('#loading').show();
var outerDiv = document.querySelector('body');
var loadingDiv = document.createElement('div');
loadingDiv.id = 'loading';
loadingDiv.style.cssText = "background: rgba(255, 255, 255, .8) url('components/com_componentbuilder/assets/images/import.gif') 50% 15% no-repeat; top: " + (outerDiv.getBoundingClientRect().top + window.pageYOffset) + "px; left: " + (outerDiv.getBoundingClientRect().left + window.pageXOffset) + "px; width: " + outerDiv.offsetWidth + "px; height: " + outerDiv.offsetHeight + "px; position: fixed; opacity: 0.80; -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); filter: alpha(opacity=80); display: none;";
outerDiv.appendChild(loadingDiv);
loadingDiv.style.display = 'block';
// when page is ready remove and show
jQuery(window).load(function() {
jQuery('#componentbuilder_loader').fadeIn('fast');
jQuery('#loading').hide();
window.addEventListener('load', function() {
var componentLoader = document.getElementById('componentbuilder_loader');
if (componentLoader) componentLoader.style.display = 'block';
loadingDiv.style.display = 'none';
});
</script>
<div id="componentbuilder_loader" style="display: none;">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('component_files_folders.basic_above', $this); ?>
<?php echo LayoutHelper::render('component_files_folders.basic_above', $this); ?>
<div class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'component_files_foldersTab', array('active' => 'basic')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'component_files_foldersTab', ['active' => 'basic', 'recall' => true]); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_files_foldersTab', 'basic', JText::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_BASIC', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_files_foldersTab', 'basic', Text::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_BASIC', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_files_folders.basic_fullwidth', $this); ?>
<?php echo LayoutHelper::render('component_files_folders.basic_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_files_foldersTab', 'advance', JText::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ADVANCE', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_files_foldersTab', 'advance', Text::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ADVANCE', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_files_folders.advance_fullwidth', $this); ?>
<?php echo LayoutHelper::render('component_files_folders.advance_fullwidth', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_files_foldersTab', 'clone', JText::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_CLONE', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_files_foldersTab', 'clone', Text::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_CLONE', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<?php echo JLayoutHelper::render('component_files_folders.clone_left', $this); ?>
<?php echo LayoutHelper::render('component_files_folders.clone_left', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
<?php $this->tab_name = 'component_files_foldersTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('component_files_folders.edit.created_by') || $this->canDo->get('component_files_folders.edit.created') || $this->canDo->get('component_files_folders.edit.state') || ($this->canDo->get('component_files_folders.delete') && $this->canDo->get('component_files_folders.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_files_foldersTab', 'publishing', JText::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_PUBLISHING', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_files_foldersTab', 'publishing', Text::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('component_files_folders.publishing', $this); ?>
<?php echo LayoutHelper::render('component_files_folders.publishing', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('component_files_folders.publlshing', $this); ?>
<?php echo LayoutHelper::render('component_files_folders.publlshing', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'component_files_foldersTab', 'permissions', JText::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_PERMISSION', true)); ?>
<?php echo Html::_('bootstrap.addTab', 'component_files_foldersTab', 'permissions', Text::_('COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
@ -109,14 +108,14 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
<div>
<input type="hidden" name="task" value="component_files_folders.edit" />
<?php echo JHtml::_('form.token'); ?>
<?php echo Html::_('form.token'); ?>
</div>
</div>
</form>

View File

@ -12,7 +12,19 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Toolbar\Toolbar;
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 VDM\Joomla\Utilities\StringHelper;
/**
* Component_files_folders Html View class
@ -26,7 +38,7 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
$this->params = ComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@ -35,7 +47,7 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@ -60,7 +72,7 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
// Set the toolbar
$this->addToolBar();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@ -80,34 +92,34 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
*/
protected function addToolBar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
Factory::getApplication()->input->set('hidemainmenu', true);
$user = Factory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT'), 'pencil-2 article-add');
ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT'), 'pencil-2 article-add');
// Built the actions for new and existing records.
if (ComponentbuilderHelper::checkString($this->referral))
if (StringHelper::check($this->referral))
{
if ($this->canDo->get('component_files_folders.create') && $isNew)
{
// We can create the record.
JToolBarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
}
elseif ($this->canDo->get('component_files_folders.edit'))
{
// We can save the record.
JToolBarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
ToolbarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
}
if ($isNew)
{
// Do not creat but cancel.
JToolBarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CANCEL');
}
else
{
// We can close it.
JToolBarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CLOSE');
}
}
else
@ -117,44 +129,44 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
// For new records, check the create permission.
if ($this->canDo->get('component_files_folders.create'))
{
JToolBarHelper::apply('component_files_folders.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
JToolBarHelper::custom('component_files_folders.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::apply('component_files_folders.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
ToolbarHelper::custom('component_files_folders.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
};
JToolBarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CANCEL');
ToolbarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CANCEL');
}
else
{
if ($this->canDo->get('component_files_folders.edit'))
{
// We can save the new record
JToolBarHelper::apply('component_files_folders.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
ToolbarHelper::apply('component_files_folders.apply', 'JTOOLBAR_APPLY');
ToolbarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
// We can save this record, but check the create permission to see
// if we can return to make a new one.
if ($this->canDo->get('component_files_folders.create'))
{
JToolBarHelper::custom('component_files_folders.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
ToolbarHelper::custom('component_files_folders.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
$canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_files_folders.version'));
if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_files_folders.edit') && $canVersion)
{
JToolbarHelper::versions('com_componentbuilder.component_files_folders', $this->item->id);
ToolbarHelper::versions('com_componentbuilder.component_files_folders', $this->item->id);
}
if ($this->canDo->get('component_files_folders.create'))
{
JToolBarHelper::custom('component_files_folders.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
ToolbarHelper::custom('component_files_folders.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CLOSE');
ToolbarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CLOSE');
}
}
JToolbarHelper::divider();
ToolbarHelper::divider();
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('component_files_folders');
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);
}
}
@ -169,11 +181,11 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
{
if(strlen($var) > 30)
{
// use the helper htmlEscape method instead and shorten the string
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
// use the helper htmlEscape method instead and shorten the string
return StringHelper::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
return StringHelper::html($var, $this->_charset);
}
/**
@ -184,14 +196,20 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = JFactory::getDocument();
}
$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT'));
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_files_folders.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_files_folders/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
JText::script('view not acceptable. Error');
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_files_folders.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_componentbuilder/views/component_files_folders/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

Some files were not shown because too many files have changed in this diff Show More