forked from joomla/Component-Builder
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:
parent
98448b24b7
commit
48a3a49d6f
@ -130,7 +130,7 @@ Component Builder is mapped as a component in itself on my local development env
|
||||
+ *Version*: 2.7.5
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
+ *Line count*: **182910**
|
||||
+ *Line count*: **182984**
|
||||
+ *Field count*: **1012**
|
||||
+ *File count*: **1199**
|
||||
+ *Folder count*: **193**
|
||||
|
@ -130,7 +130,7 @@ Component Builder is mapped as a component in itself on my local development env
|
||||
+ *Version*: 2.7.5
|
||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
+ *Line count*: **182910**
|
||||
+ *Line count*: **182984**
|
||||
+ *Field count*: **1012**
|
||||
+ *File count*: **1199**
|
||||
+ *Folder count*: **193**
|
||||
|
@ -66,17 +66,18 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
if($user->authorise('core.admin', 'com_componentbuilder'))
|
||||
{
|
||||
// get the post values
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$componentId = $jinput->post->get('component', 0, 'INT');
|
||||
$version = $jinput->post->get('version', 0, 'INT');
|
||||
$addBackup = $jinput->post->get('backup', 0, 'INT');
|
||||
$addRepo = $jinput->post->get('repository', 0, 'INT');
|
||||
$addPlaceholders = $jinput->post->get('placeholders', 2, 'INT');
|
||||
$debugLinenr = $jinput->post->get('debuglinenr', 2, 'INT');
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$componentId = $jinput->post->get('component', 0, 'INT');
|
||||
$version = $jinput->post->get('version', 0, 'INT');
|
||||
$addBackup = $jinput->post->get('backup', 0, 'INT');
|
||||
$addRepo = $jinput->post->get('repository', 0, 'INT');
|
||||
$addPlaceholders = $jinput->post->get('placeholders', 2, 'INT');
|
||||
$debugLinenr = $jinput->post->get('debuglinenr', 2, 'INT');
|
||||
$minify = $jinput->post->get('minify', 2, 'INT');
|
||||
// include component compiler
|
||||
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php';
|
||||
$model = $this->getModel('compiler');
|
||||
if ($model->builder($version,$componentId,$addBackup,$addRepo,$addPlaceholders,$debugLinenr))
|
||||
$model = $this->getModel('compiler');
|
||||
if ($model->builder($version,$componentId,$addBackup,$addRepo,$addPlaceholders,$debugLinenr, $minify))
|
||||
{
|
||||
$cache = JFactory::getCache('mod_menu');
|
||||
$cache->clean();
|
||||
@ -88,8 +89,8 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$redirect_url = $app->getUserState('com_componentbuilder.redirect_url');
|
||||
$message = $app->getUserState('com_componentbuilder.message');
|
||||
$redirect_url = $app->getUserState('com_componentbuilder.redirect_url');
|
||||
$message = $app->getUserState('com_componentbuilder.message');
|
||||
if (empty($redirect_url) && $componentId > 0)
|
||||
{
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
|
||||
|
@ -607,6 +607,13 @@ class Get
|
||||
*/
|
||||
public $libraries = array();
|
||||
|
||||
/**
|
||||
* Is minify Enabled
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $minify = 0;
|
||||
|
||||
/**
|
||||
* Is Tidy Enabled
|
||||
*
|
||||
@ -631,10 +638,12 @@ class Get
|
||||
{
|
||||
// load application
|
||||
$this->app = JFactory::getApplication();
|
||||
// check if we have Tidy enabled
|
||||
$this->tidy = extension_loaded('Tidy');
|
||||
// Set the params
|
||||
$this->params = JComponentHelper::getParams('com_componentbuilder');
|
||||
// set the minfy switch of the JavaScript
|
||||
$this->minify = (isset($config['minify']) && $config['minify'] != 2) ? $config['minify'] : $this->params->get('minify', 0);
|
||||
// check if we have Tidy enabled
|
||||
$this->tidy = extension_loaded('Tidy');
|
||||
// set the field type builder
|
||||
$this->fieldBuilderType = $this->params->get('compiler_field_builder_type', 2);
|
||||
// check the field builder type logic
|
||||
|
@ -2821,6 +2821,20 @@ class Interpretation extends Fields
|
||||
return $method;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the custom script in the script builder
|
||||
*
|
||||
* @param string $first The first key
|
||||
* @param string $second The second key
|
||||
* @param string $prefix The prefix to add in front of the script if found
|
||||
* @param string/bool $note The switch/note to add to the script
|
||||
* @param bool $unset The switch to unset the value if found
|
||||
* @param string/bool $unset The switch/string to use as default return if script not found
|
||||
* @param string $sufix The sufix to add after the script if found
|
||||
*
|
||||
* @return mix The string/script if found or the default value if not found
|
||||
*
|
||||
*/
|
||||
public function getCustomScriptBuilder($first, $second, $prefix = '', $note = null, $unset = null, $default = null, $sufix = '')
|
||||
{
|
||||
// check if there is any custom script
|
||||
@ -9052,7 +9066,7 @@ class Interpretation extends Fields
|
||||
}
|
||||
}
|
||||
// minfy the script
|
||||
if ($this->params->get('minify') && isset($fileScript) && ComponentbuilderHelper::checkString($fileScript))
|
||||
if ($this->minify && isset($fileScript) && ComponentbuilderHelper::checkString($fileScript))
|
||||
{
|
||||
// minify the fielScript javscript
|
||||
$minifier = new JS;
|
||||
@ -9060,7 +9074,7 @@ class Interpretation extends Fields
|
||||
$fileScript = $minifier->minify();
|
||||
}
|
||||
// minfy the script
|
||||
if ($this->params->get('minify') && isset($footerScript) && ComponentbuilderHelper::checkString($footerScript))
|
||||
if ($this->minify && isset($footerScript) && ComponentbuilderHelper::checkString($footerScript))
|
||||
{
|
||||
// minify the footerScript javscript
|
||||
$minifier = new JS;
|
||||
|
@ -299,14 +299,12 @@ class Infusion extends Interpretation
|
||||
// ###AJAXTOKE### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_single]['###AJAXTOKE###'] = $this->setAjaxToke($viewName_single);
|
||||
|
||||
if (isset($this->customScriptBuilder['php_document'][$viewName_single]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['php_document'][$viewName_single]))
|
||||
// ###DOCUMENT_CUSTOM_PHP### <<<DYNAMIC>>>
|
||||
if ($phpDocument = $this->getCustomScriptBuilder('php_document', $viewName_single, PHP_EOL, null, true, false))
|
||||
{
|
||||
// ###DOCUMENT_CUSTOM_PHP### <<<DYNAMIC>>>
|
||||
$this->customScriptBuilder['php_document'][$viewName_single] = str_replace('$document->', '$this->document->', $this->customScriptBuilder['php_document'][$viewName_single]);
|
||||
$this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = PHP_EOL . $this->setPlaceholders(
|
||||
$this->customScriptBuilder['php_document'][$viewName_single], $this->placeholders);
|
||||
$this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = str_replace('$document->', '$this->document->', $phpDocument);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder['php_document'][$viewName_single]);
|
||||
unset($phpDocument);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -361,18 +359,9 @@ class Infusion extends Interpretation
|
||||
// ###POSTSAVEHOOK### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###'] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . "\t\treturn;", PHP_EOL . PHP_EOL . "\t\treturn;");
|
||||
|
||||
if (isset($this->customScriptBuilder['css_view'][$viewName_single]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_view'][$viewName_single]))
|
||||
{
|
||||
// ###VIEWCSS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = $this->setPlaceholders($this->customScriptBuilder['css_view'][$viewName_single], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder['css_view'][$viewName_single]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###VIEWCSS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = '';
|
||||
}
|
||||
// ###VIEWCSS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = $this->getCustomScriptBuilder('css_view', $viewName_single, '', null, true);
|
||||
|
||||
// add css to front end
|
||||
if (isset($view['edit_create_site_view']) && $view['edit_create_site_view'])
|
||||
{
|
||||
@ -489,22 +478,26 @@ class Infusion extends Interpretation
|
||||
// ###JVIEWLISTCANDO### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_list]['###JVIEWLISTCANDO###'] = $this->setJviewListCanDo($viewName_single, $viewName_list);
|
||||
|
||||
if (isset($this->customScriptBuilder['css_views'][$viewName_list]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_views'][$viewName_list]))
|
||||
// ###VIEWSCSS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] = $this->getCustomScriptBuilder('css_views', $viewName_list, '', null, true);
|
||||
|
||||
// ###VIEWS_FOOTER_SCRIPT### <<<DYNAMIC>>>
|
||||
$scriptNote = PHP_EOL . '//' . $this->setLine(__LINE__) . ' ' . $viewName_list.' footer script';
|
||||
if ($footerScript = $this->getCustomScriptBuilder('views_footer', $viewName_single, '', $scriptNote, true, false, PHP_EOL))
|
||||
{
|
||||
// ###VIEWCSS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] = $this->setPlaceholders($this->customScriptBuilder['css_views'][$viewName_list], $this->placeholders);
|
||||
// only minfy if no php is added to the footer script
|
||||
if ($this->minify && strpos($footerScript, '<?php') === false)
|
||||
{
|
||||
// minfy the script
|
||||
$minifier = new JS;
|
||||
$minifier->add($footerScript);
|
||||
$footerScript = $minifier->minify();
|
||||
// clear some memory
|
||||
unset($minifier);
|
||||
}
|
||||
$this->fileContentDynamic[$viewName_list]['###VIEWS_FOOTER_SCRIPT###'] = PHP_EOL . '<script type="text/javascript">' . $footerScript . "</script>";
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder['css_views'][$viewName_list]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###VIEWCSS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] = '';
|
||||
}
|
||||
// ###VIEWS_FOOTER_SCRIPT###
|
||||
if ($footerScript = $this->getCustomScriptBuilder('views_footer', $viewName_single, PHP_EOL))
|
||||
{
|
||||
$this->fileContentDynamic[$viewName_list]['###VIEWS_FOOTER_SCRIPT###'] = PHP_EOL . '<script type="text/javascript">' . $footerScript . PHP_EOL . "</script>";
|
||||
unset($footerScript);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -626,86 +619,31 @@ class Infusion extends Interpretation
|
||||
|
||||
if ($view['settings']->main_get->gettype == 1)
|
||||
{
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]))
|
||||
{
|
||||
// ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] = $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] = '';
|
||||
}
|
||||
// ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true);
|
||||
|
||||
// ###CUSTOM_ADMIN_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t");
|
||||
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]))
|
||||
{
|
||||
// ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] = $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] = '';
|
||||
}
|
||||
// ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true);
|
||||
}
|
||||
elseif ($view['settings']->main_get->gettype == 2)
|
||||
{
|
||||
// ###CUSTOM_ADMIN_GET_LIST_QUERY### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
|
||||
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view['settings']->code]))
|
||||
{
|
||||
// ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] = '';
|
||||
}
|
||||
// ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] = $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $view['settings']->code, PHP_EOL, null, true);
|
||||
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]))
|
||||
{
|
||||
// ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] = '';
|
||||
}
|
||||
// ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true);
|
||||
|
||||
// ###CUSTOM_ADMIN_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
|
||||
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]))
|
||||
{
|
||||
// ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] = '';
|
||||
}
|
||||
// ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true);
|
||||
}
|
||||
|
||||
// ###CUSTOM_ADMIN_CUSTOM_METHODS### <<<DYNAMIC>>>
|
||||
@ -917,36 +855,15 @@ class Infusion extends Interpretation
|
||||
{
|
||||
// set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 1);
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]))
|
||||
{
|
||||
// ###SITE_BEFORE_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###'] = $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###SITE_BEFORE_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###'] = '';
|
||||
}
|
||||
|
||||
// ###SITE_BEFORE_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitem', $view['settings']->code, '', null, true);
|
||||
|
||||
// ###SITE_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t");
|
||||
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]))
|
||||
{
|
||||
// ###SITE_AFTER_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###'] = $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###SITE_AFTER_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###'] = '';
|
||||
}
|
||||
// ###SITE_AFTER_GET_ITEM### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitem', $view['settings']->code, '', null, true);
|
||||
}
|
||||
elseif ($view['settings']->main_get->gettype == 2)
|
||||
{
|
||||
@ -955,36 +872,14 @@ class Infusion extends Interpretation
|
||||
// ###SITE_GET_LIST_QUERY### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code);
|
||||
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]))
|
||||
{
|
||||
// ###SITE_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###SITE_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###'] = '';
|
||||
}
|
||||
// ###SITE_BEFORE_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_before_getitems', $view['settings']->code, PHP_EOL, null, true);
|
||||
|
||||
// ###SITE_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code);
|
||||
|
||||
// check if there is any custom script
|
||||
if (isset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]))
|
||||
{
|
||||
// ###SITE_AFTER_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code], $this->placeholders);
|
||||
// clear some memory
|
||||
unset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// ###SITE_AFTER_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###'] = '';
|
||||
}
|
||||
// ###SITE_AFTER_GET_ITEMS### <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###'] = $this->getCustomScriptBuilder($this->target . '_php_after_getitems', $view['settings']->code, PHP_EOL, null, true);
|
||||
}
|
||||
// add to lang array
|
||||
if (!isset($this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE]))
|
||||
|
@ -5325,6 +5325,7 @@ COM_COMPONENTBUILDER_MATCH_FIELD="Match Field"
|
||||
COM_COMPONENTBUILDER_MATCH_OPTIONS="Match Options"
|
||||
COM_COMPONENTBUILDER_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD="Max Length (only 4 text_field)"
|
||||
COM_COMPONENTBUILDER_MERGE="Merge"
|
||||
COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT="Minify JavaScript"
|
||||
COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)"
|
||||
COM_COMPONENTBUILDER_NAME="Name"
|
||||
COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)"
|
||||
@ -5574,6 +5575,7 @@ COM_COMPONENTBUILDER_SET_A_CLASS_VALUE_FOR_THE_LIST_VIEW_OF_THIS_FIELD="Set a cl
|
||||
COM_COMPONENTBUILDER_SHARE_SNIPPETS="Share Snippets"
|
||||
COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code."
|
||||
COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER="Should the component be moved to your local repository folder?"
|
||||
COM_COMPONENTBUILDER_SHOULD_THE_JAVASCRIPT_BE_MINIFIED_IN_THE_COMPONENT="Should the JavaScript be minified in the component."
|
||||
COM_COMPONENTBUILDER_SHOULD_THE_ZIPPED_PACKAGE_OF_THE_COMPONENT_BE_MOVED_TO_THE_LOCAL_BACKUP_AND_REMOTE_SALES_SERVER_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_THOSE_VALUES_SET="Should the zipped package of the component be moved to the local backup and remote sales server? This is only applicable if this component has those values set."
|
||||
COM_COMPONENTBUILDER_SHOULD_THIS_FIELD_BE_ESCAPED_IN_THE_LIST_VIEW="Should this field be escaped in the list view."
|
||||
COM_COMPONENTBUILDER_SHOULD_WE_BE_SHOWING_MORE_ELABORATE_INFORMATION_DURING_IMPORT="Should we be showing more elaborate information during import."
|
||||
|
@ -170,14 +170,15 @@ class ComponentbuilderModelCompiler extends JModelList
|
||||
return $db->loadObjectList();
|
||||
}
|
||||
|
||||
public function builder($version, $id, $backup, $repo, $addPlaceholders, $debugLinenr)
|
||||
public function builder($version, $id, $backup, $repo, $addPlaceholders, $debugLinenr, $minify)
|
||||
{
|
||||
$set['joomlaVersion'] = $version;
|
||||
$set['joomlaVersion'] = $version;
|
||||
$set['componentId'] = $id;
|
||||
$set['addBackup'] = $backup;
|
||||
$set['addRepo'] = $repo;
|
||||
$set['addPlaceholders'] = $addPlaceholders;
|
||||
$set['debugLinenr'] = $debugLinenr;
|
||||
$set['minify'] = $minify;
|
||||
// start up Compiler
|
||||
$this->compiler = new Compiler($set);
|
||||
if($this->compiler)
|
||||
|
@ -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
|
||||
|
@ -98,7 +98,7 @@ if ($this->saveOrder)
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
||||
// joomla_components footer script
|
||||
// waiting spinner
|
||||
var outerDiv = jQuery('body');
|
||||
jQuery('<div id="loading"></div>')
|
||||
|
@ -97,3 +97,26 @@ if ($this->saveOrder)
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
// language_translations footer script
|
||||
// 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);
|
||||
|
||||
// when the export button is clicked
|
||||
jQuery('#toolbar').on('click',"button.button-download", function(e){
|
||||
jQuery('#loading').show();
|
||||
});
|
||||
|
||||
</script>
|
@ -97,3 +97,26 @@ if ($this->saveOrder)
|
||||
<input type="hidden" name="task" value="" />
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
// languages footer script
|
||||
// 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);
|
||||
|
||||
// when the build button is clicked
|
||||
jQuery('#toolbar').on('click',"button.button-joomla", function(e){
|
||||
jQuery('#loading').show();
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user