Fixed the clone method that gave the error Call to undefined method ComponentbuilderModelImport_joomla_components::updateAfter()

This commit is contained in:
2018-05-04 22:27:49 +02:00
parent cc35295cf6
commit 7cb78222ea
10 changed files with 53 additions and 25 deletions

View File

@@ -48,19 +48,28 @@ JHtml::_('behavior.keepalive');
form.submit();
};
<?php else: ?>
Joomla.submitbutton = function()
Joomla.submitbutton = function(task)
{
var form = document.getElementById('adminForm');
// do field validation
if (form.import_package.value == "")
{
alert("<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PLEASE_SELECT_A_FILE', true); ?>");
}
else
{
if ('refresh' === task){
jQuery('#loading').css('display', 'block');
form.gettype.value = 'upload';
form.submit();
// clear the history
jQuery.jStorage.flush();
// now start the update
autoJCBpackageInfo();
jQuery('#loading').hide();
} else {
var form = document.getElementById('adminForm');
// do field validation
if (form.import_package.value == "")
{
alert("<?php echo JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PLEASE_SELECT_A_FILE', true); ?>");
}
else
{
jQuery('#loading').css('display', 'block');
form.gettype.value = 'upload';
form.submit();
}
}
};
Joomla.submitbuttonDir = function()

View File

@@ -62,15 +62,21 @@ class ComponentbuilderViewImport_joomla_components extends JViewLegacy
$this->state = &$state;
// get global action permissions
$this->canDo = ComponentbuilderHelper::getActions('import');
// load the application
$this->app = JFactory::getApplication();
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')
{
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
// hide the main menu
$this->app->input->set('hidemainmenu', true);
// add title to the page
JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT'),'upload');
// add refesh button.
JToolBarHelper::custom('refresh', 'refresh', '', 'COM_COMPONENTBUILDER_REFRESH', false);
}
// load the application
$app = JFactory::getApplication();
// get the session object
$session = JFactory::getSession();
// check if it has package