Added minify of JS to the compiler area, also improved the infusion area to make more use of the getCustomScriptBuilder method

This commit is contained in:
2018-04-18 21:11:14 +02:00
parent 98448b24b7
commit 48a3a49d6f
12 changed files with 165 additions and 171 deletions

View File

@ -186,6 +186,32 @@ class ComponentbuilderViewCompiler extends JViewLegacy
// add to form
$form[] = $debuglinenr;
// get the minify radio field
$minify = JFormHelper::loadFieldType('radio',true);
// start minify xml
$minifyXML = new SimpleXMLElement('<field/>');
// minify attributes
$minifyAttributes = array(
'type' => 'radio',
'name' => 'minify',
'label' => 'COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_THE_JAVASCRIPT_BE_MINIFIED_IN_THE_COMPONENT',
'default' => '2');
// load the minify attributes
ComponentbuilderHelper::xmlAddAttributes($minifyXML, $minifyAttributes);
// start the minify options
$minifyOptions = array(
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO');
// load the minify options
ComponentbuilderHelper::xmlAddOptions($minifyXML, $minifyOptions);
// setup the minify radio field
$minify->setup($minifyXML,2);
// add to form
$form[] = $minify;
// get the component list field
$component = JFormHelper::loadFieldType('list',true);
// start component xml