2016-01-30 20:28:43 +00:00
|
|
|
|
<?php
|
2021-03-05 03:08:47 +00:00
|
|
|
|
/**
|
|
|
|
|
* @package Joomla.Component.Builder
|
|
|
|
|
*
|
|
|
|
|
* @created 30th April, 2015
|
|
|
|
|
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
|
|
|
|
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
|
|
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
|
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
|
|
2020-11-29 00:00:20 +00:00
|
|
|
|
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
2021-10-19 01:30:46 +00:00
|
|
|
|
JHtml::_('behavior.formvalidator');
|
2020-11-29 00:00:20 +00:00
|
|
|
|
JHtml::_('formbehavior.chosen', 'select');
|
|
|
|
|
JHtml::_('behavior.keepalive');
|
2017-02-02 11:54:07 +00:00
|
|
|
|
|
|
|
|
|
$this->app->input->set('hidemainmenu', false);
|
2017-03-03 21:53:18 +00:00
|
|
|
|
$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>';
|
2021-02-19 23:53:14 +00:00
|
|
|
|
|
|
|
|
|
// set the noticeboard options
|
2021-03-05 03:08:47 +00:00
|
|
|
|
$noticeboardOptions = array('vdm', 'pro');
|
|
|
|
|
?>
|
|
|
|
|
<?php if ($this->canDo->get('compiler.access')): ?>
|
2020-02-04 23:18:34 +00:00
|
|
|
|
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=compiler'); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
|
|
|
|
|
2016-01-30 20:28:43 +00:00
|
|
|
|
<script type="text/javascript">
|
2019-08-12 21:30:31 +00:00
|
|
|
|
Joomla.submitbutton = function(task, key)
|
2016-01-30 20:28:43 +00:00
|
|
|
|
{
|
|
|
|
|
if (task == ''){
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
var component = jQuery('#component').val();
|
|
|
|
|
var isValid = true;
|
|
|
|
|
|
2017-06-05 20:18:32 +00:00
|
|
|
|
if(component == '' && task == 'compiler.compiler'){
|
2016-01-30 20:28:43 +00:00
|
|
|
|
isValid = false;
|
|
|
|
|
}
|
|
|
|
|
if (isValid){
|
|
|
|
|
jQuery('#form').hide();
|
2017-08-05 11:28:24 +00:00
|
|
|
|
// get correct form based on task
|
2020-02-04 23:18:34 +00:00
|
|
|
|
var form = document.getElementById('adminForm');
|
2019-08-12 21:30:31 +00:00
|
|
|
|
// set the plugin id
|
2019-12-06 05:31:32 +00:00
|
|
|
|
if (task == 'compiler.installCompiledModule' || task == 'compiler.installCompiledPlugin') {
|
2019-08-12 21:30:31 +00:00
|
|
|
|
form.install_item_id.value = key;
|
|
|
|
|
}
|
|
|
|
|
// set the task value
|
2017-08-05 11:10:08 +00:00
|
|
|
|
form.task.value = task;
|
2021-03-04 06:13:05 +00:00
|
|
|
|
// seems we need a little delay here
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
form.submit();
|
|
|
|
|
}, 100);
|
2017-08-05 11:28:24 +00:00
|
|
|
|
// some ui movements
|
2016-01-30 20:28:43 +00:00
|
|
|
|
if (task == 'compiler.compiler'){
|
2021-02-19 00:35:54 +00:00
|
|
|
|
// get the component name
|
|
|
|
|
let component_name = jQuery("#component option:selected").text();
|
|
|
|
|
// set the component name
|
|
|
|
|
jQuery(".component-name").text(component_name);
|
|
|
|
|
// wait a little since to much is happening...
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
jQuery('#compiler').show();
|
|
|
|
|
jQuery('#compiling').css('display', 'block');
|
|
|
|
|
// wait a little since to much is happening...
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
jQuery('#compiler-spinner').show();
|
|
|
|
|
jQuery('#compiler-notice').show();
|
|
|
|
|
}, 100);
|
|
|
|
|
}, 100);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
} else if (task == 'compiler.clearTmp'){
|
|
|
|
|
jQuery('#clear').show();
|
2021-02-19 00:35:54 +00:00
|
|
|
|
jQuery('#loading').css('display', 'block');
|
2021-02-19 23:53:14 +00:00
|
|
|
|
} else if (task == 'compiler.getCompilerAnimations'){
|
|
|
|
|
jQuery('#get-compiler-animations').show();
|
|
|
|
|
jQuery('#loading').css('display', 'block');
|
2016-01-30 20:28:43 +00:00
|
|
|
|
} else {
|
|
|
|
|
jQuery('#loading').css('display', 'block');
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
jQuery('.notice').show();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Add spindle-wheel for importations:
|
|
|
|
|
jQuery(document).ready(function($) {
|
2019-07-08 16:05:54 +00:00
|
|
|
|
|
|
|
|
|
// 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);
|
2021-02-19 00:35:54 +00:00
|
|
|
|
// 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);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<?php if(!empty( $this->sidebar)): ?>
|
2017-03-03 21:53:18 +00:00
|
|
|
|
<div id="j-sidebar-container" class="span2">
|
|
|
|
|
<?php echo $this->sidebar; ?>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="j-main-container" class="span10">
|
2017-02-02 11:54:07 +00:00
|
|
|
|
<?php else : ?>
|
2017-03-03 21:53:18 +00:00
|
|
|
|
<div id="j-main-container">
|
2016-01-30 20:28:43 +00:00
|
|
|
|
<?php endif; ?>
|
2021-03-04 06:13:05 +00:00
|
|
|
|
<?php if (ComponentbuilderHelper::checkString($this->SuccessMessage)): ?>
|
|
|
|
|
<div class="alert alert-success">
|
|
|
|
|
<button type="button" class="close" data-dismiss="alert">×</button>
|
|
|
|
|
<?= $this->SuccessMessage; ?>
|
|
|
|
|
</div>
|
|
|
|
|
<?php endif; ?>
|
2017-03-03 21:53:18 +00:00
|
|
|
|
<div id="form">
|
2018-04-08 06:12:18 +00:00
|
|
|
|
<div class="span4">
|
2021-02-19 00:35:54 +00:00
|
|
|
|
<h3><?= JText::_('COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT') ?></h3>
|
2020-02-04 23:18:34 +00:00
|
|
|
|
<div id="compilerForm">
|
2017-02-17 18:35:18 +00:00
|
|
|
|
<div>
|
2021-02-19 00:35:54 +00:00
|
|
|
|
<span class="notice" style="display:none; color:red;"><?= JText::_('COM_COMPONENTBUILDER_YOU_MUST_SELECT_A_COMPONENT') ?></span><br />
|
2017-02-17 18:35:18 +00:00
|
|
|
|
<?php if ($this->form): ?>
|
|
|
|
|
<?php foreach ($this->form as $field): ?>
|
|
|
|
|
<div class="control-group">
|
2021-02-19 00:35:54 +00:00
|
|
|
|
<div class="control-label"><?= $field->label ?></div>
|
|
|
|
|
<div class="controls"><?= $field->input ?></div>
|
2017-02-17 18:35:18 +00:00
|
|
|
|
</div>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
<br />
|
|
|
|
|
<div class="clearfix"></div>
|
2017-08-05 11:28:24 +00:00
|
|
|
|
<button class="btn btn-small btn-success" onclick="Joomla.submitbutton('compiler.compiler')"><span class="icon-cog icon-white"></span>
|
2021-02-19 00:35:54 +00:00
|
|
|
|
<?= JText::_('COM_COMPONENTBUILDER_COMPILE_COMPONENT') ?>
|
2017-02-17 18:35:18 +00:00
|
|
|
|
</button>
|
2019-08-12 21:30:31 +00:00
|
|
|
|
<input type="hidden" name="install_item_id" value="0">
|
2017-02-17 18:35:18 +00:00
|
|
|
|
<input type="hidden" name="version" value="3" />
|
2020-02-04 23:18:34 +00:00
|
|
|
|
</div>
|
2017-02-17 18:35:18 +00:00
|
|
|
|
</div>
|
2018-04-08 06:12:18 +00:00
|
|
|
|
<div class="span7">
|
2021-02-19 00:35:54 +00:00
|
|
|
|
<div id="component-details"><?= $selectNotice ?></div>
|
2021-02-19 23:53:14 +00:00
|
|
|
|
<?= JLayoutHelper::render('jcbnoticeboardtabs', array('id' => 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])) ?>
|
2017-02-17 18:35:18 +00:00
|
|
|
|
</div>
|
2017-03-03 21:53:18 +00:00
|
|
|
|
</div>
|
2021-02-19 23:53:14 +00:00
|
|
|
|
<div id="get-compiler-animations" style="display:none;">
|
|
|
|
|
<h1><?= JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT') ?></h1>
|
|
|
|
|
<h4><?= 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>
|
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
</div>
|
2017-03-03 21:53:18 +00:00
|
|
|
|
<div id="clear" style="display:none;">
|
2021-02-19 23:53:14 +00:00
|
|
|
|
<h1><?= JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT') ?></h1>
|
|
|
|
|
<h4><?= JText::_('COM_COMPONENTBUILDER_REMOVING_ALL_ZIP_PACKAGES_FROM_THE_TEMPORARY_FOLDER_OF_THE_JOOMLA_INSTALL') ?> <span class="loading-dots">.</span></h4>
|
2017-03-03 21:53:18 +00:00
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="compiler" style="display:none;">
|
2021-02-19 00:35:54 +00:00
|
|
|
|
<div id="compiler-spinner" class="span4" style="display:none;">
|
|
|
|
|
<h3><?= JText::sprintf('COM_COMPONENTBUILDER_S_PLEASE_WAIT', $this->user->name) ?></h3>
|
2021-02-19 23:53:14 +00:00
|
|
|
|
<p style="font-size: smaller;"><?= JText::_('COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT') ?></p>
|
|
|
|
|
<p><b><span class="component-name"><?= JText::_('COM_COMPONENTBUILDER_THE_COMPONENT') ?></span></b> <?= JText::_('COM_COMPONENTBUILDER_IS_BEING_COMPILED') ?> <span class="loading-dots">.</span></p>
|
|
|
|
|
<div style="text-align: center;"><?= ComponentbuilderHelper::getDynamicContent('builder-gif', $this->builder_gif_size) ?></div>
|
2021-02-19 00:35:54 +00:00
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="compiler-notice" class="span7" style="display:none;">
|
2021-02-19 23:53:14 +00:00
|
|
|
|
<?= JLayoutHelper::render('jcbnoticeboard' . $noticeboardOptions[array_rand($noticeboardOptions)], null) ?>
|
|
|
|
|
<div><?= ComponentbuilderHelper::getDynamicContent('banner', '728-90') ?></div>
|
2021-02-19 00:35:54 +00:00
|
|
|
|
</div>
|
2017-02-17 18:35:18 +00:00
|
|
|
|
</div>
|
2017-03-03 21:53:18 +00:00
|
|
|
|
</div>
|
|
|
|
|
<script type="text/javascript">
|
2017-02-17 18:35:18 +00:00
|
|
|
|
// token
|
2021-02-19 00:35:54 +00:00
|
|
|
|
var token = '<?= JSession::getFormToken() ?>';
|
|
|
|
|
var all_is_good = '<?= JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME') ?>';
|
2017-02-02 11:54:07 +00:00
|
|
|
|
jQuery('#compilerForm').on('change', '#component',function (e)
|
2016-01-30 20:28:43 +00:00
|
|
|
|
{
|
|
|
|
|
var component = jQuery('#component').val();
|
2017-02-17 18:35:18 +00:00
|
|
|
|
if(component == "") {
|
2021-02-19 00:35:54 +00:00
|
|
|
|
jQuery('#component-details').html("<?= $selectNotice ?>");
|
2017-03-03 21:53:18 +00:00
|
|
|
|
jQuery("#noticeboard").show();
|
2016-01-30 20:28:43 +00:00
|
|
|
|
jQuery('.notice').show();
|
2017-02-17 18:35:18 +00:00
|
|
|
|
} else {
|
|
|
|
|
getComponentDetails(component);
|
2017-03-03 21:53:18 +00:00
|
|
|
|
jQuery("#noticeboard").hide();
|
2016-01-30 20:28:43 +00:00
|
|
|
|
jQuery('.notice').hide();
|
|
|
|
|
}
|
|
|
|
|
});
|
2018-02-27 12:17:38 +00:00
|
|
|
|
|
2016-01-30 20:28:43 +00:00
|
|
|
|
// 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);
|
2018-02-27 12:17:38 +00:00
|
|
|
|
});
|
|
|
|
|
|
2017-02-17 18:35:18 +00:00
|
|
|
|
<?php
|
|
|
|
|
$app = JFactory::getApplication();
|
|
|
|
|
?>
|
|
|
|
|
function JRouter(link) {
|
|
|
|
|
<?php
|
2020-01-03 01:41:55 +00:00
|
|
|
|
if ($app->isClient('site'))
|
2017-02-17 18:35:18 +00:00
|
|
|
|
{
|
|
|
|
|
echo 'var url = "'.JURI::root().'";';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo 'var url = "";';
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
return url+link;
|
2018-02-27 12:17:38 +00:00
|
|
|
|
}
|
2020-02-04 23:18:34 +00:00
|
|
|
|
</script>
|
|
|
|
|
<input type="hidden" name="task" value="" />
|
|
|
|
|
<?php echo JHtml::_('form.token'); ?>
|
2021-03-05 03:08:47 +00:00
|
|
|
|
</form>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>
|
|
|
|
|
<?php endif; ?>
|