Resolves gh-53 with stable export & import of fully mapped components. Key export & import encryption and forced update switch, with error and waring messages has been added.

This commit is contained in:
2017-03-28 16:57:59 +02:00
parent 8b522f44d9
commit f61bb46073
196 changed files with 1172 additions and 899 deletions

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.3.8
@build 27th March, 2017
@version 2.3.9
@build 28th March, 2017
@created 30th April, 2015
@package Component Builder
@subpackage view.html.php
@ -40,6 +40,8 @@ class ComponentbuilderViewImport_joomla_components extends JViewLegacy
protected $hasHeader = 0;
protected $dataType;
public $formPackage;
public function display($tpl = null)
{
if ($this->getLayout() !== 'modal')
@ -87,10 +89,50 @@ class ComponentbuilderViewImport_joomla_components extends JViewLegacy
{
$this->dataType = $session->get('dataType_VDM_IMPORTINTO', null);
}
// set form only if smart package
if ($this->dataType === 'smart_package')
{
$this->formPackage = $this->getForm();
}
// Display the template
parent::display($tpl);
}
public function getForm()
{
jimport('joomla.form.form');
$radio1 = JFormHelper::loadFieldType('radio',true);
// Switch to force local update
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE').'" description="'.JText::_('COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED').'" name="force_update" type="radio" class="btn-group btn-group-yesno" default="0" filter="INT">';
$xml .= '<option value="1">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="0">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$force = new SimpleXMLElement($xml);
// set components to form
$radio1->setup($force,0);
$radio2 = JFormHelper::loadFieldType('radio',true);
// has key
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_USE_KEY').'" description="'.JText::_('COM_COMPONENTBUILDER_DOES_THIS_PACKAGE_REQUIRE_A_KEY_TO_INSTALL').'" name="haskey" type="radio" class="btn-group btn-group-yesno" default="1" filter="INT">';
$xml .= '<option value="1">'.JText::_('COM_COMPONENTBUILDER_YES').'</option> <option value="0">'.JText::_('COM_COMPONENTBUILDER_NO').'</option>';
$xml .= "</field>";
// prepare the xml
$license = new SimpleXMLElement($xml);
// set components to form
$radio2->setup($license,1);
$text1 = JFormHelper::loadFieldType('text',true);
// add the key
$xml = '<field label="'.JText::_('COM_COMPONENTBUILDER_KEY').'" description="'.JText::_('COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE').'" name="sleutle" type="text" class="text_area" filter="STRING" hint="add key here" />';
// prepare the xml
$sleutle = new SimpleXMLElement($xml);
// set components to form
$text1->setup($sleutle,'');
return array($radio1,$radio2,$text1);
}
/**
* Setting the toolbar
*/