2016-01-30 20:28:43 +00:00
|
|
|
<?php
|
2018-05-18 06:28:27 +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>
|
2019-02-23 13:28:54 +00:00
|
|
|
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
2018-05-18 06:28:27 +00:00
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
// No direct access to this file
|
2018-09-11 20:28:17 +00:00
|
|
|
defined('_JEXEC') or die('Restricted access');
|
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>';
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
|
|
|
|
JHtml::_('behavior.tooltip');
|
|
|
|
JHtml::_('behavior.formvalidation');
|
|
|
|
JHtml::_('formbehavior.chosen', 'select');
|
|
|
|
JHtml::_('behavior.keepalive');
|
|
|
|
?>
|
2019-08-12 21:30:31 +00:00
|
|
|
<?php if ($this->canDo->get('compiler.access')): ?>
|
|
|
|
<script type="text/javascript">
|
|
|
|
Joomla.submitbutton = function(task) {
|
|
|
|
if (task === 'compiler.back') {
|
|
|
|
parent.history.back();
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
var form = document.getElementById('adminForm');
|
|
|
|
form.task.value = task;
|
|
|
|
form.submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2017-02-02 11:54:07 +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">
|
|
|
|
<input type="hidden" name="task" value="" />
|
|
|
|
<?php echo JHtml::_('form.token'); ?>
|
|
|
|
</form>
|
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
|
2019-08-12 21:30:31 +00:00
|
|
|
if (task == 'compiler.compiler' || task == 'compiler.installCompiledPlugin') {
|
2017-08-05 11:28:24 +00:00
|
|
|
var form = document.getElementById('compilerForm');
|
|
|
|
} else {
|
|
|
|
var form = document.getElementById('adminForm');
|
|
|
|
}
|
2019-08-12 21:30:31 +00:00
|
|
|
// set the plugin id
|
|
|
|
if (task == 'compiler.installCompiledPlugin') {
|
|
|
|
form.install_item_id.value = key;
|
|
|
|
}
|
|
|
|
// set the task value
|
2017-08-05 11:10:08 +00:00
|
|
|
form.task.value = task;
|
|
|
|
form.submit();
|
2017-08-05 11:28:24 +00:00
|
|
|
// some ui movements
|
2016-01-30 20:28:43 +00:00
|
|
|
if (task == 'compiler.compiler'){
|
|
|
|
jQuery('#compiler').show();
|
|
|
|
} else if (task == 'compiler.clearTmp'){
|
|
|
|
jQuery('#loading').css('display', 'block');
|
|
|
|
jQuery('#clear').show();
|
|
|
|
} 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);
|
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; ?>
|
2017-03-03 21:53:18 +00:00
|
|
|
<div id="form">
|
2018-04-08 06:12:18 +00:00
|
|
|
<div class="span4">
|
2017-03-03 21:53:18 +00:00
|
|
|
<h3><?php echo JText::_('COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT'); ?></h3>
|
2017-02-17 18:35:18 +00:00
|
|
|
<form action="index.php?option=com_componentbuilder&view=compiler" method="post" name="compilerForm" id="compilerForm" class="form-validate" enctype="multipart/form-data">
|
|
|
|
<div>
|
|
|
|
<span class="notice" style="display:none; color:red;"><?php echo JText::_('COM_COMPONENTBUILDER_YOU_MUST_SELECT_A_COMPONENT'); ?></span><br />
|
|
|
|
<?php if ($this->form): ?>
|
|
|
|
<?php foreach ($this->form as $field): ?>
|
|
|
|
<div class="control-group">
|
|
|
|
<div class="control-label"><?php echo $field->label;?></div>
|
|
|
|
<div class="controls"><?php echo $field->input;?></div>
|
|
|
|
</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>
|
2017-02-17 18:35:18 +00:00
|
|
|
<?php echo JText::_('COM_COMPONENTBUILDER_COMPILE_COMPONENT'); ?>
|
|
|
|
</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" />
|
|
|
|
<input type="hidden" name="task" value="compiler.compiler" />
|
|
|
|
<?php echo JHtml::_('form.token'); ?>
|
|
|
|
</form>
|
|
|
|
</div>
|
2018-04-08 06:12:18 +00:00
|
|
|
<div class="span7">
|
2017-03-03 21:53:18 +00:00
|
|
|
<div id="component-details"><?php echo $selectNotice; ?></div>
|
2018-11-08 04:05:08 +00:00
|
|
|
<div id="noticeboard">
|
2019-12-03 02:17:35 +00:00
|
|
|
<?php echo JHtml::_('bootstrap.startTabSet', 'compiler_tab', array('active' => 'vdm-noticeboard')); ?>
|
|
|
|
<?php echo JHtml::_('bootstrap.addTab', 'compiler_tab', 'vdm-noticeboard', JText::_('COM_COMPONENTBUILDER_VDM_BOARD', true)); ?>
|
|
|
|
<div class="well well-small">
|
|
|
|
<h2 class="module-title nav-header"><?php echo JText::_('COM_COMPONENTBUILDER_VDM_NOTICE_BOARD'); ?><span id="vdm-new-notice" style="display:none; color:red;"> (<?php echo JText::_('COM_COMPONENTBUILDER_NEW_NOTICE'); ?>)</span></h2>
|
|
|
|
<div id="noticeboard-md"><small><?php echo JText::_('COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING'); ?><span class="loading-dots">.</span></small></div>
|
|
|
|
<div style="text-align:right;"><small><a href="https://github.com/Llewellynvdm" target="_blank" style="color:gray"><<ewe>>yn</a></small></div>
|
|
|
|
</div>
|
|
|
|
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
|
|
|
|
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
|
|
|
<?php echo JHtml::_('bootstrap.addTab', 'compiler_tab', 'proboard', JText::_('COM_COMPONENTBUILDER_JCB_PRO_BOARD', true)); ?>
|
|
|
|
<div class="well well-small">
|
|
|
|
<h2 class="module-title nav-header"><?php echo JText::_('COM_COMPONENTBUILDER_JCB_PRO_NOTICE_BOARD'); ?></h2>
|
|
|
|
<div id="proboard-md"><small><?php echo JText::_('COM_COMPONENTBUILDER_THE_PRO_BOARD_IS_LOADING'); ?><span class="loading-dots">.</span></small></div>
|
|
|
|
<div style="text-align:right;"><small><a href="https://vdm.bz/get-jcb-pro-membership" target="_blank" style="color:gray">JCB PRO</a></small></div>
|
|
|
|
</div>
|
|
|
|
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
|
|
|
|
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
|
|
|
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
|
2017-03-03 21:53:18 +00:00
|
|
|
</div>
|
2017-02-17 18:35:18 +00:00
|
|
|
</div>
|
2017-03-03 21:53:18 +00:00
|
|
|
</div>
|
|
|
|
<div id="clear" style="display:none;">
|
|
|
|
<h1><?php echo JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT_CLEARING_THE_TMP_FOLDER'); ?> <span class="loading-dots">.</span></h1>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
</div>
|
|
|
|
<div id="compiler" style="display:none;">
|
|
|
|
<h1><?php echo JText::sprintf('COM_COMPONENTBUILDER_S_PLEASE_WAIT_THE_COMPONENT_IS_BEING_COMPILED', $this->user->name); ?><span class="loading-dots">.</span></h1>
|
2018-11-08 04:05:08 +00:00
|
|
|
<?php echo ComponentbuilderHelper::getDynamicContent('builder-gif', '707-400'); ?>
|
2017-02-17 18:35:18 +00:00
|
|
|
<div class="clearfix"></div>
|
|
|
|
</div>
|
2017-03-03 21:53:18 +00:00
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
2017-02-17 18:35:18 +00:00
|
|
|
// token
|
|
|
|
var token = '<?php echo JSession::getFormToken(); ?>';
|
2018-02-06 10:55:46 +00:00
|
|
|
var all_is_good = '<?php echo 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 == "") {
|
|
|
|
jQuery('#component-details').html("<?php echo $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
|
|
|
|
if ($app->isSite())
|
|
|
|
{
|
|
|
|
echo 'var url = "'.JURI::root().'";';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
echo 'var url = "";';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
return url+link;
|
2018-02-27 12:17:38 +00:00
|
|
|
}
|
2016-01-30 20:28:43 +00:00
|
|
|
</script>
|
2017-02-02 11:54:07 +00:00
|
|
|
<?php else: ?>
|
|
|
|
<h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>
|
|
|
|
<?php endif; ?>
|