diff --git a/README.md b/README.md index 985c30288..5d3e6ef7a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Component Builder (2.4.8) +# Joomla Component Builder (JCB) +[![GitHub release](https://img.shields.io/github/release/vdm-io/Joomla-Component-Builder.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases) [![Total Downloads](https://img.shields.io/github/downloads/vdm-io/Joomla-Component-Builder/total.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases) This is a [Joomla 3.x](http://www.joomla.org/) component. @@ -8,7 +9,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc Whether you're a seasoned [Joomla](http://www.joomla.org/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.4.8) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.4.9) with **ALL** its features and **ALL** concepts totally open-source and free! Once installed upgrades are quick and easy via the default Joomla upgrade area. @@ -107,12 +108,12 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](http://vdm.bz/component-builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 3rd July, 2017 -+ *Version*: 2.4.8 ++ *Last Build*: 24th July, 2017 ++ *Version*: 2.4.9 + *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*: **106184** -+ *File count*: **647** ++ *Line count*: **106272** ++ *File count*: **650** + *Folder count*: **115** > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). diff --git a/admin/README.txt b/admin/README.txt index 985c30288..5d3e6ef7a 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,5 @@ -# Component Builder (2.4.8) +# Joomla Component Builder (JCB) +[![GitHub release](https://img.shields.io/github/release/vdm-io/Joomla-Component-Builder.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases) [![Total Downloads](https://img.shields.io/github/downloads/vdm-io/Joomla-Component-Builder/total.svg)](https://github.com/vdm-io/Joomla-Component-Builder/releases) This is a [Joomla 3.x](http://www.joomla.org/) component. @@ -8,7 +9,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc Whether you're a seasoned [Joomla](http://www.joomla.org/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.4.8) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.4.9) with **ALL** its features and **ALL** concepts totally open-source and free! Once installed upgrades are quick and easy via the default Joomla upgrade area. @@ -107,12 +108,12 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](http://vdm.bz/component-builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 3rd July, 2017 -+ *Version*: 2.4.8 ++ *Last Build*: 24th July, 2017 ++ *Version*: 2.4.9 + *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*: **106184** -+ *File count*: **647** ++ *Line count*: **106272** ++ *File count*: **650** + *Folder count*: **115** > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index baa57d3d7..388d8159f 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin.css diff --git a/admin/assets/css/admin_view.css b/admin/assets/css/admin_view.css index e8075de82..64dd8a178 100644 --- a/admin/assets/css/admin_view.css +++ b/admin/assets/css/admin_view.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 111 of this MVC - @build 7th May, 2017 + @build 17th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin_view.css diff --git a/admin/assets/css/admin_views.css b/admin/assets/css/admin_views.css index 4ed6de9c5..b8dc4a2ee 100644 --- a/admin/assets/css/admin_views.css +++ b/admin/assets/css/admin_views.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 111 of this MVC - @build 7th May, 2017 + @build 17th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin_views.css diff --git a/admin/assets/css/custom_admin_view.css b/admin/assets/css/custom_admin_view.css index 0b81ae2a3..9e93f7e0c 100644 --- a/admin/assets/css/custom_admin_view.css +++ b/admin/assets/css/custom_admin_view.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 22 of this MVC - @build 1st March, 2017 + @build 17th July, 2017 @created 13th August, 2015 @package Component Builder @subpackage custom_admin_view.css diff --git a/admin/assets/css/custom_admin_views.css b/admin/assets/css/custom_admin_views.css index b9f2b5403..632a91216 100644 --- a/admin/assets/css/custom_admin_views.css +++ b/admin/assets/css/custom_admin_views.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 22 of this MVC - @build 1st March, 2017 + @build 17th July, 2017 @created 13th August, 2015 @package Component Builder @subpackage custom_admin_views.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 318a06042..0c2c246b8 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage dashboard.css diff --git a/admin/assets/css/site_view.css b/admin/assets/css/site_view.css index 7b9dea87a..2bff70315 100644 --- a/admin/assets/css/site_view.css +++ b/admin/assets/css/site_view.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 51 of this MVC - @build 6th March, 2017 + @build 17th July, 2017 @created 29th May, 2015 @package Component Builder @subpackage site_view.css diff --git a/admin/assets/css/site_views.css b/admin/assets/css/site_views.css index 294b3129e..8e88db20e 100644 --- a/admin/assets/css/site_views.css +++ b/admin/assets/css/site_views.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 51 of this MVC - @build 6th March, 2017 + @build 17th July, 2017 @created 29th May, 2015 @package Component Builder @subpackage site_views.css diff --git a/admin/compiler/joomla_3/JViewLegacy_list.php b/admin/compiler/joomla_3/JViewLegacy_list.php index f34931b7b..e5673e48c 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list.php +++ b/admin/compiler/joomla_3/JViewLegacy_list.php @@ -142,7 +142,7 @@ class ###Component###View###Views### extends JViewLegacy { JToolbarHelper::trash('###views###.trash'); }###EXPORTBUTTON### - }###IMPORTBUTTON### + }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST### ###IMPORTBUTTON### // set help url for this view if found $help_url = ###Component###Helper::getHelpUrl('###views###'); diff --git a/admin/compiler/joomla_3/headercheck.php b/admin/compiler/joomla_3/headercheck.php index 6b314cf7c..266363b05 100644 --- a/admin/compiler/joomla_3/headercheck.php +++ b/admin/compiler/joomla_3/headercheck.php @@ -29,7 +29,7 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); -class HeaderCheck +class ###component###HeaderCheck { function js_loaded($script_name) { diff --git a/admin/compiler/joomla_3/headercheck_admin.php b/admin/compiler/joomla_3/headercheck_admin.php index 6b314cf7c..266363b05 100644 --- a/admin/compiler/joomla_3/headercheck_admin.php +++ b/admin/compiler/joomla_3/headercheck_admin.php @@ -29,7 +29,7 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); -class HeaderCheck +class ###component###HeaderCheck { function js_loaded($script_name) { diff --git a/admin/componentbuilder.php b/admin/componentbuilder.php index 9d6e6fa22..b05258de9 100644 --- a/admin/componentbuilder.php +++ b/admin/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php diff --git a/admin/controller.php b/admin/controller.php index 1a64ff033..5f136ac60 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage controller.php diff --git a/admin/controllers/admin_view.php b/admin/controllers/admin_view.php index 64446adc4..66e3aebbb 100644 --- a/admin/controllers/admin_view.php +++ b/admin/controllers/admin_view.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 111 of this MVC - @build 7th May, 2017 + @build 17th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin_view.php diff --git a/admin/controllers/admin_views.php b/admin/controllers/admin_views.php index deef66e61..016170f57 100644 --- a/admin/controllers/admin_views.php +++ b/admin/controllers/admin_views.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 111 of this MVC - @build 7th May, 2017 + @build 17th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin_views.php diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 98c6ae98f..7eb3c275c 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage ajax.json.php diff --git a/admin/controllers/componentbuilder.php b/admin/controllers/componentbuilder.php index 43da67840..df25c20ae 100644 --- a/admin/controllers/componentbuilder.php +++ b/admin/controllers/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php diff --git a/admin/controllers/custom_admin_view.php b/admin/controllers/custom_admin_view.php index 638ca649f..60d3e9609 100644 --- a/admin/controllers/custom_admin_view.php +++ b/admin/controllers/custom_admin_view.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 22 of this MVC - @build 1st March, 2017 + @build 17th July, 2017 @created 13th August, 2015 @package Component Builder @subpackage custom_admin_view.php diff --git a/admin/controllers/custom_admin_views.php b/admin/controllers/custom_admin_views.php index 791e25ac4..a3d8b2d3f 100644 --- a/admin/controllers/custom_admin_views.php +++ b/admin/controllers/custom_admin_views.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 22 of this MVC - @build 1st March, 2017 + @build 17th July, 2017 @created 13th August, 2015 @package Component Builder @subpackage custom_admin_views.php diff --git a/admin/controllers/help.php b/admin/controllers/help.php index 1cd0c67b5..ca832a555 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage help.php diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 08c3fc914..917841d20 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage import.php diff --git a/admin/controllers/import_joomla_components.php b/admin/controllers/import_joomla_components.php index 972cfa108..6e9c8476b 100644 --- a/admin/controllers/import_joomla_components.php +++ b/admin/controllers/import_joomla_components.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage import_joomla_components.php diff --git a/admin/controllers/site_view.php b/admin/controllers/site_view.php index c1c4274a8..bf45d79c4 100644 --- a/admin/controllers/site_view.php +++ b/admin/controllers/site_view.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 51 of this MVC - @build 6th March, 2017 + @build 17th July, 2017 @created 29th May, 2015 @package Component Builder @subpackage site_view.php diff --git a/admin/controllers/site_views.php b/admin/controllers/site_views.php index 818cb5c06..07d32b32e 100644 --- a/admin/controllers/site_views.php +++ b/admin/controllers/site_views.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 51 of this MVC - @build 6th March, 2017 + @build 17th July, 2017 @created 29th May, 2015 @package Component Builder @subpackage site_views.php diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 96ce94214..4f111d132 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -1583,6 +1583,12 @@ class Fields extends Structure { $this->doNotEscape[$listViewName][] = $fieldAttributes['name']; } + // check if we have display switch for dynamic placment + $display = ComponentbuilderHelper::getBetween($field['settings']->xml, 'display="', '"'); + if (ComponentbuilderHelper::checkString($display)) + { + $fieldAttributes['display'] = $display; + } } } return $fieldAttributes; diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 8dab29312..2826944a4 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -583,9 +583,14 @@ class Interpretation extends Fields $updateServer[] = "\t"; // return the array to string $updateServer = implode(PHP_EOL, $updateServer); + // add update server details to component XML file + $this->fileContentStatic['###UPDATESERVER###'] = $updateServer; + } + else + { + // add update server details to component XML file + $this->fileContentStatic['###UPDATESERVER###'] = ''; } - // add update server details to component XML file - $this->fileContentStatic['###UPDATESERVER###'] = $updateServer; // ensure to update Component version data if (ComponentbuilderHelper::checkArray($this->updateSQLBuilder)) { @@ -1243,24 +1248,30 @@ class Interpretation extends Fields $menuSetter = $view.'_menu'; foreach ($params as $field) { - // we load fields that have options - if (strpos($field,'Option Set. -->') !== false && strpos($field,$menuSetter) === false) + // some switch to see if it should be added to front end params + $target = ComponentbuilderHelper::getBetween($field, 'display="', '"'); + if (!ComponentbuilderHelper::checkString($target) || $target === 'menu') { - // we add the global option - $field = str_replace('Option Set. -->', $this->setLine(__LINE__).' Global & Option Set. -->'.PHP_EOL."\t\t\t".'', $field); - // update the default to be global - $field = preg_replace('/default=".+"/', 'default=""', $field); - // update the default to be filter - $field = preg_replace('/filter=".+"/', 'filter="string"', $field); - // update required - $field = str_replace('required="true"', 'required="false"', $field); - // add to keeper array - $keep[] = $field; - } - else - { - // TODO add convetion to filter fields that we should not load - $keep[] = $field; + + $field = str_replace('display="menu"', '', $field); + // we load fields that have options + if (strpos($field,'Option Set. -->') !== false && strpos($field,$menuSetter) === false && !ComponentbuilderHelper::checkString($target)) + { + // we add the global option + $field = str_replace('Option Set. -->', $this->setLine(__LINE__).' Global & Option Set. -->'.PHP_EOL."\t\t\t".'', $field); + // update the default to be global + $field = preg_replace('/default=".+"/', 'default=""', $field); + // update the default to be filter + $field = preg_replace('/filter=".+"/', 'filter="string"', $field); + // update required + $field = str_replace('required="true"', 'required="false"', $field); + // add to keeper array + $keep[] = $field; + } + else + { + $keep[] = $field; + } } } return $keep; @@ -1858,7 +1869,7 @@ class Interpretation extends Fields break; } // check that the default and the redirect page is not the same - if ($this->fileContentStatic['###SITE_DEFAULT_VIEW###'] != $view['settings']->code) + if (isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']) && $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] != $view['settings']->code) { $redirectMessage = "\t\t\t//".$this->setLine(__LINE__)." redirect away to the default view if no access allowed."; $redirectString = "JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$this->fileContentStatic['###SITE_DEFAULT_VIEW###']."')"; @@ -1926,17 +1937,17 @@ class Interpretation extends Fields if ($type === 'main') { $getItem .= PHP_EOL."\t".$tab."\t\t\$app = JFactory::getApplication();"; - $langKeyWord = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Not found or access denied','U'); - if (!isset($this->langContent[$this->lang][$langKeyWord])) + $langKeyWoord = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Not found or access denied','U'); + if (!isset($this->langContent[$this->lang][$langKeyWoord])) { - $this->langContent[$this->lang][$langKeyWord] = 'Not found, or access denied.'; + $this->langContent[$this->lang][$langKeyWoord] = 'Not found, or access denied.'; } $getItem .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." If no data is found redirect to default page and show warning."; - $getItem .= PHP_EOL."\t".$tab."\t\t\$app->enqueueMessage(JText::_('".$langKeyWord."'), 'warning');"; + $getItem .= PHP_EOL."\t".$tab."\t\t\$app->enqueueMessage(JText::_('".$langKeyWoord."'), 'warning');"; if ('site' === $this->target) { // check that the default and the redirect page is not the same - if ($this->fileContentStatic['###SITE_DEFAULT_VIEW###'] != $code) + if (isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']) && $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] != $code) { $redirectString = "JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$this->fileContentStatic['###SITE_DEFAULT_VIEW###']."')"; } @@ -2933,6 +2944,7 @@ class Interpretation extends Fields if (isset($view['settings']->add_custom_button) && $view['settings']->add_custom_button == 1) { $buttons = array(); + $this->onlyFunctionButton = array(); $functionNames = array(); if (isset($view['settings']->custom_buttons) && ComponentbuilderHelper::checkArray($view['settings']->custom_buttons)) { @@ -2966,11 +2978,22 @@ class Interpretation extends Fields $keyCode = ComponentbuilderHelper::safeString($custom_button['name']); $this->langContent[$this->lang][$keyLang] = trim($custom_button['name']); // add cpanel button TODO does not work well on site with permissions - $buttons[] = "\t".$tab."\tif (\$this->user->authorise('".$viewName.".".$keyCode."'))"; - $buttons[] = "\t".$tab."\t{"; - $buttons[] = "\t".$tab."\t\t//".$this->setLine(__LINE__)." add ".$custom_button['name']." button."; - $buttons[] = "\t".$tab."\t\tJToolBarHelper::custom('".$viewsName.".".$custom_button['method']."', '".$custom_button['icomoon']."', '', '".$keyLang."', false);"; - $buttons[] = "\t".$tab."\t}"; + if (isset($custom_button['type']) && $custom_button['type'] == 2) + { + $this->onlyFunctionButton[] = "\t".$tab."if (\$this->user->authorise('".$viewName.".".$keyCode."'))"; + $this->onlyFunctionButton[] = "\t".$tab."{"; + $this->onlyFunctionButton[] = "\t".$tab."\t//".$this->setLine(__LINE__)." add ".$custom_button['name']." button."; + $this->onlyFunctionButton[] = "\t".$tab."\tJToolBarHelper::custom('".$viewsName.".".$custom_button['method']."', '".$custom_button['icomoon']."', '', '".$keyLang."', false);"; + $this->onlyFunctionButton[] = "\t".$tab."}"; + } + else + { + $buttons[] = "\t".$tab."\tif (\$this->user->authorise('".$viewName.".".$keyCode."'))"; + $buttons[] = "\t".$tab."\t{"; + $buttons[] = "\t".$tab."\t\t//".$this->setLine(__LINE__)." add ".$custom_button['name']." button."; + $buttons[] = "\t".$tab."\t\tJToolBarHelper::custom('".$viewsName.".".$custom_button['method']."', '".$custom_button['icomoon']."', '', '".$keyLang."', false);"; + $buttons[] = "\t".$tab."\t}"; + } } } } @@ -3026,6 +3049,16 @@ class Interpretation extends Fields return ''; } + public function setFunctionOnlyButtons() + { + // return buttons if they were build + if (isset($this->onlyFunctionButton) && ComponentbuilderHelper::checkArray($this->onlyFunctionButton)) + { + return PHP_EOL.implode(PHP_EOL,$this->onlyFunctionButton); + } + return ''; + } + public function setCustomCSS(&$view) { if ($view['settings']->add_css == 1) @@ -3226,7 +3259,7 @@ class Interpretation extends Fields $setter .= PHP_EOL."\t\trequire_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );"; } $setter .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Initialize the header checker."; - $setter .= PHP_EOL."\t\t\$HeaderCheck = new HeaderCheck;"; + $setter .= PHP_EOL."\t\t\$HeaderCheck = new ".$this->fileContentStatic['###component###']."HeaderCheck;"; // load the defaults needed if ($this->uikit) { @@ -7237,7 +7270,7 @@ class Interpretation extends Fields /** * @param $viewName_list * @return array|string - */ + */ public function setCustomAdminDynamicButton($viewName_list) { $buttons = ''; @@ -7267,7 +7300,7 @@ class Interpretation extends Fields /** * @param $viewName_list * @return array|string - */ + */ public function setCustomAdminDynamicButtonController($viewName_list) { $method = ''; @@ -7317,7 +7350,7 @@ class Interpretation extends Fields * @param $viewName_single * @param $viewName_list * @return string - */ + */ public function setModelExportMethod($viewName_single, $viewName_list) { $query = ''; @@ -8421,7 +8454,7 @@ class Interpretation extends Fields // target a class if this is a note or spacer $targetType = "."; } - elseif ($target['type'] === 'editor') + elseif ($target['type'] === 'editor' || $target['type'] === 'subform') { // target the label if editor field $targetType = "#jform_"; @@ -12169,8 +12202,19 @@ class Interpretation extends Fields $this->configFieldSets[] = "\t
"; // remove after loading diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index ec30a895a..945ab17e4 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -149,10 +149,12 @@ class Infusion extends Interpretation $this->fileContentStatic['###SITECSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css'], $this->placeholders); // ###CUSTOM_HELPER_SCRIPT### - $this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders); + $this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] + = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders); // ###BOTH_CUSTOM_HELPER_SCRIPT### - $this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders); + $this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] + = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders); // ###ADMIN_GLOBAL_EVENT_HELPER### $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = ''; @@ -168,14 +170,16 @@ class Infusion extends Interpretation { // ###ADMIN_GLOBAL_EVENT### $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = PHP_EOL.PHP_EOL.'// Triger the Global Admin Event'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] .= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] + .= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);'; // ###ADMIN_GLOBAL_EVENT_HELPER### $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = PHP_EOL.PHP_EOL."\t".'/**'; $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'* The Global Admin Event Method.'; $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/'; $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'public static function globalEvent($document)'; $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders); + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] + .= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders); $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}'; } @@ -258,7 +262,8 @@ class Infusion extends Interpretation $this->setLockLicensePer($viewName_list, $this->target); // ###FIELDSETS### <<The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanced, truly able to build extremely complex components in a fraction of the time.
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index a2c795c0f..2c8c4860e 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -339,4 +339,21 @@
"+text+"
"}return'"+(escaped?code:escape(code,true))+"\n
\n"};Renderer.prototype.blockquote=function(quote){return"'+(escaped?code:escape(code,true))+"\n
\n"+quote+"
\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"
\n":"
\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+""+type+">\n"};Renderer.prototype.listitem=function(text){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
\n"};Renderer.prototype.tablerow=function(content){return"\n"+content+" \n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+""+type+">\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+"
"};Renderer.prototype.br=function(){return this.options.xhtml?"
":"
"};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='"+text+"";return out};Renderer.prototype.image=function(href,title,text){var out='":">";return out};Renderer.prototype.text=function(text){return text};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i
"+escape(e.message+"",true)+""}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); + diff --git a/media/js/timeago.js b/media/js/timeago.js new file mode 100644 index 000000000..0c2c219f7 --- /dev/null +++ b/media/js/timeago.js @@ -0,0 +1,232 @@ +/** + * Timeago is a jQuery plugin that makes it easy to support automatically + * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). + * + * @name timeago + * @version 1.5.4 + * @requires jQuery v1.2.3+ + * @author Ryan McGeary + * @license MIT License - http://www.opensource.org/licenses/mit-license.php + * + * For usage and examples, visit: + * http://timeago.yarp.com/ + * + * Copyright (c) 2008-2017, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org) + */ + +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && typeof module.exports === 'object') { + factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + $.timeago = function(timestamp) { + if (timestamp instanceof Date) { + return inWords(timestamp); + } else if (typeof timestamp === "string") { + return inWords($.timeago.parse(timestamp)); + } else if (typeof timestamp === "number") { + return inWords(new Date(timestamp)); + } else { + return inWords($.timeago.datetime(timestamp)); + } + }; + var $t = $.timeago; + + $.extend($.timeago, { + settings: { + refreshMillis: 60000, + allowPast: true, + allowFuture: false, + localeTitle: false, + cutoff: 0, + autoDispose: true, + strings: { + prefixAgo: null, + prefixFromNow: null, + suffixAgo: "ago", + suffixFromNow: "from now", + inPast: 'any moment now', + seconds: "less than a minute", + minute: "about a minute", + minutes: "%d minutes", + hour: "about an hour", + hours: "about %d hours", + day: "a day", + days: "%d days", + month: "about a month", + months: "%d months", + year: "about a year", + years: "%d years", + wordSeparator: " ", + numbers: [] + } + }, + + inWords: function(distanceMillis) { + if (!this.settings.allowPast && ! this.settings.allowFuture) { + throw 'timeago allowPast and allowFuture settings can not both be set to false.'; + } + + var $l = this.settings.strings; + var prefix = $l.prefixAgo; + var suffix = $l.suffixAgo; + if (this.settings.allowFuture) { + if (distanceMillis < 0) { + prefix = $l.prefixFromNow; + suffix = $l.suffixFromNow; + } + } + + if (!this.settings.allowPast && distanceMillis >= 0) { + return this.settings.strings.inPast; + } + + var seconds = Math.abs(distanceMillis) / 1000; + var minutes = seconds / 60; + var hours = minutes / 60; + var days = hours / 24; + var years = days / 365; + + function substitute(stringOrFunction, number) { + var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction; + var value = ($l.numbers && $l.numbers[number]) || number; + return string.replace(/%d/i, value); + } + + var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || + seconds < 90 && substitute($l.minute, 1) || + minutes < 45 && substitute($l.minutes, Math.round(minutes)) || + minutes < 90 && substitute($l.hour, 1) || + hours < 24 && substitute($l.hours, Math.round(hours)) || + hours < 42 && substitute($l.day, 1) || + days < 30 && substitute($l.days, Math.round(days)) || + days < 45 && substitute($l.month, 1) || + days < 365 && substitute($l.months, Math.round(days / 30)) || + years < 1.5 && substitute($l.year, 1) || + substitute($l.years, Math.round(years)); + + var separator = $l.wordSeparator || ""; + if ($l.wordSeparator === undefined) { separator = " "; } + return $.trim([prefix, words, suffix].join(separator)); + }, + + parse: function(iso8601) { + var s = $.trim(iso8601); + s = s.replace(/\.\d+/,""); // remove milliseconds + s = s.replace(/-/,"/").replace(/-/,"/"); + s = s.replace(/T/," ").replace(/Z/," UTC"); + s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400 + s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900 + return new Date(s); + }, + datetime: function(elem) { + var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title"); + return $t.parse(iso8601); + }, + isTime: function(elem) { + // jQuery's `is()` doesn't play well with HTML5 in IE + return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time"); + } + }); + + // functions that can be called via $(el).timeago('action') + // init is default when no action is given + // functions are called with context of a single element + var functions = { + init: function() { + functions.dispose.call(this); + var refresh_el = $.proxy(refresh, this); + refresh_el(); + var $s = $t.settings; + if ($s.refreshMillis > 0) { + this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis); + } + }, + update: function(timestamp) { + var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp); + $(this).data('timeago', { datetime: date }); + if ($t.settings.localeTitle) { + $(this).attr("title", date.toLocaleString()); + } + refresh.apply(this); + }, + updateFromDOM: function() { + $(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) }); + refresh.apply(this); + }, + dispose: function () { + if (this._timeagoInterval) { + window.clearInterval(this._timeagoInterval); + this._timeagoInterval = null; + } + } + }; + + $.fn.timeago = function(action, options) { + var fn = action ? functions[action] : functions.init; + if (!fn) { + throw new Error("Unknown function name '"+ action +"' for timeago"); + } + // each over objects here and call the requested function + this.each(function() { + fn.call(this, options); + }); + return this; + }; + + function refresh() { + var $s = $t.settings; + + //check if it's still visible + if ($s.autoDispose && !$.contains(document.documentElement,this)) { + //stop if it has been removed + $(this).timeago("dispose"); + return this; + } + + var data = prepareData(this); + + if (!isNaN(data.datetime)) { + if ( $s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) { + $(this).text(inWords(data.datetime)); + } else { + if ($(this).attr('title').length > 0) { + $(this).text($(this).attr('title')); + } + } + } + return this; + } + + function prepareData(element) { + element = $(element); + if (!element.data("timeago")) { + element.data("timeago", { datetime: $t.datetime(element) }); + var text = $.trim(element.text()); + if ($t.settings.localeTitle) { + element.attr("title", element.data('timeago').datetime.toLocaleString()); + } else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) { + element.attr("title", text); + } + } + return element.data("timeago"); + } + + function inWords(date) { + return $t.inWords(distance(date)); + } + + function distance(date) { + return (new Date().getTime() - date.getTime()); + } + + // fix for IE6 suckage + document.createElement("abbr"); + document.createElement("time"); +})); diff --git a/script.php b/script.php index 365aa46a3..4cdbfdd89 100644 --- a/script.php +++ b/script.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.8 - @build 3rd July, 2017 + @version 2.4.9 + @build 24th July, 2017 @created 30th April, 2015 @package Component Builder @subpackage script.php @@ -2204,7 +2204,7 @@ class com_componentbuilderInstallerScript echo ' -