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:
@ -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; ?>
|
||||
|
@ -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¬ice=\"+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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user