diff --git a/README.md b/README.md
index 27646da62..151600df6 100644
--- a/README.md
+++ b/README.md
@@ -143,13 +143,13 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
-+ *Last Build*: 2nd February, 2021
++ *Last Build*: 19th February, 2021
+ *Version*: 2.12.6
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **293026**
-+ *Field count*: **1611**
-+ *File count*: **1934**
++ *Line count*: **291909**
++ *Field count*: **1627**
++ *File count*: **1935**
+ *Folder count*: **322**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
diff --git a/admin/README.txt b/admin/README.txt
index 27646da62..151600df6 100644
--- a/admin/README.txt
+++ b/admin/README.txt
@@ -143,13 +143,13 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
-+ *Last Build*: 2nd February, 2021
++ *Last Build*: 19th February, 2021
+ *Version*: 2.12.6
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **293026**
-+ *Field count*: **1611**
-+ *File count*: **1934**
++ *Line count*: **291909**
++ *Field count*: **1627**
++ *File count*: **1935**
+ *Folder count*: **322**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
diff --git a/admin/assets/css/compiler.css b/admin/assets/css/compiler.css
index 788e45266..125cf0702 100644
--- a/admin/assets/css/compiler.css
+++ b/admin/assets/css/compiler.css
@@ -10,4 +10,10 @@
/* CSS Document */
-
+html, body {
+ background-color: #fefcfe !important;
+}
+.jcb-sponsor-banner {
+ -webkit-box-shadow: 0 0 7px 1px #f0f0f0;
+ box-shadow: 0 0 7px 1px #f0f0f0;
+}
diff --git a/admin/assets/images/ajax-loader.gif b/admin/assets/images/ajax-loader.gif
deleted file mode 100644
index 2190cf849..000000000
Binary files a/admin/assets/images/ajax-loader.gif and /dev/null differ
diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php
index d600bfcc6..e55bc3b1e 100644
--- a/admin/helpers/compiler.php
+++ b/admin/helpers/compiler.php
@@ -1056,7 +1056,6 @@ class Compiler extends Infusion
. '.zip'
);
}
-
// move to sales server host
if ($this->componentData->add_sales_server == 1
&& $this->dynamicIntegration)
diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php
index 0535fd10f..e7afea28d 100644
--- a/admin/helpers/compiler/a_Get.php
+++ b/admin/helpers/compiler/a_Get.php
@@ -5245,6 +5245,8 @@ class Get
{
$script = $this->setGuiCodePlaceholder($script, $config);
}
+ // add Dynamic HASHING option of a file/string
+ $script = $this->setDynamicHASHING($script);
// add base64 locking option of a string
$script = $this->setBase64LOCK($script);
// load the script
@@ -10796,6 +10798,67 @@ class Get
}
}
+ /**
+ * Set a hash of a file and/or string
+ *
+ * @param string $string The code string
+ *
+ * @return string
+ *
+ */
+ protected function setDynamicHASHING($script)
+ {
+ // check if we should hash a string
+ if (strpos($script, 'HASHSTRING((((') !== false)
+ {
+ // get the strings
+ $values = ComponentbuilderHelper::getAllBetween(
+ $script, 'HASHSTRING((((', '))))'
+ );
+ $locker = array();
+ // convert them
+ foreach ($values as $value)
+ {
+ $locker['HASHSTRING((((' . $value . '))))']
+ = md5($value);
+ }
+
+ // update the script
+ return $this->setPlaceholders($script, $locker);
+ }
+ // check if we should hash a file
+ if (strpos($script, 'HASHFILE((((') !== false)
+ {
+ // get the strings
+ $values = ComponentbuilderHelper::getAllBetween(
+ $script, 'HASHFILE((((', '))))'
+ );
+ $locker = array();
+ // convert them
+ foreach ($values as $path)
+ {
+ // we first get the file
+ if ($value = ComponentbuilderHelper::getFileContents($path))
+ {
+ // now we hash the file content
+ $locker['HASHFILE((((' . $path . '))))']
+ = md5($value);
+ }
+ else
+ {
+ // could not retrieve the file so we show error
+ $locker['HASHFILE((((' . $path . '))))']
+ = 'ERROR';
+ }
+ }
+
+ // update the script
+ return $this->setPlaceholders($script, $locker);
+ }
+
+ return $script;
+ }
+
/**
* Lock a string with bsae64 (basic)
*
diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php
index 5e689d49d..f9bb0c6aa 100644
--- a/admin/helpers/componentbuilder.php
+++ b/admin/helpers/componentbuilder.php
@@ -1970,30 +1970,147 @@ abstract class ComponentbuilderHelper
}
return false;
}
+
/**
* The array of dynamic content
*
* @var array
*/
protected static $dynamicContent = array(
- // The banners by size
+ // The banners by size (width - height)
'banner' => array(
'728-90' => array(
- '',
- '',
- '',
- '',
- ''
+ array(
+ 'url' => 'https://cdn.joomla.org/volunteers/joomla-heart-wide.gif',
+ 'hash' => 'f857e3a38facaeac9eba3cffa912b620',
+ 'html' => ''),
+ array(
+ 'url' => 'https://magazine.joomla.org/images/banners/JCM_2010_728x90.png',
+ 'hash' => '4083c66f996279fd5a76adffc3a7d194',
+ 'html' => ''),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/banners/tlwebdesign_jcb_sponsor_728_90.png',
+ 'hash' => 'd19be1f9f5b2049ff901096aafc246be',
+ 'html' => ''),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/banners/vdm_jcb_sponsor_728_90.gif',
+ 'hash' => '84478dfa0cd880395815e0ee026812a4',
+ 'html' => ''),
+ array(
+ 'url' => 'https://allmycms.com/images/banners/agerix/agerix-loves-jcb-728-90.gif',
+ 'hash' => 'b24c0726aa809cdcc04bcffe7e1e1529',
+ 'html' => '')
),
'160-600' => array(
- '',
- ''
+ array(
+ 'url' => 'https://cdn.joomla.org/volunteers/joomla-heart-tall.gif',
+ 'hash' => '9a75e4929b86c318128b53cf78251678',
+ 'html' => ''),
+ array(
+ 'url' => 'https://magazine.joomla.org/images/banners/JCM_2010_120x600.png',
+ 'hash' => '5389cf3be8569cb3f6793e8bd4013d19',
+ 'html' => '')
)
),
- // The build-gif by size
+ // The build-gif by size (width - height)
'builder-gif' => array(
- '707-400' => array(
- ''
+ '480-540' => array(
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/1.gif',
+ 'hash' => 'ce6e36456fa794ba95d981547b2f54f8',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/2.gif',
+ 'hash' => '0a54dbc393359747e33db90cabb1e2d7',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/3.gif',
+ 'hash' => '4e5498713ff69a64a0a79dbf620372a3',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/4.gif',
+ 'hash' => '3554ffab2a6df95a116fd9f0db63925c',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/5.gif',
+ 'hash' => '08f0cdf188593eca65c6dafd7af27ef9',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/6.gif',
+ 'hash' => '103b46a7ac3fcb974e25d06f417a4e87',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/7.gif',
+ 'hash' => 'ffa8547099b7286f89ab7ff5a140dd90',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/8.gif',
+ 'hash' => '316df780f9e4ce81200a65d3c4303c41',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/9.gif',
+ 'hash' => '9ab6ba78b6e63a285fdef2ff5e447c93',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/10.gif',
+ 'hash' => 'cd9abaa1cb95f51a70916da6b70614f2',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/11.gif',
+ 'hash' => 'cfe53095b5249618e2348223b89262b9',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/12.gif',
+ 'hash' => '15a6690647d5160d67c80ce4dd1f5602',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/13.gif',
+ 'hash' => '2f77562e92c8a3b7c47664c98f551fe8',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/14.gif',
+ 'hash' => '46db15517ef5bd063be85134e1cc575d',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/15.gif',
+ 'hash' => 'e6c96eff157ea648ceb1583f2cc22544',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/16.gif',
+ 'hash' => '76010b7d1f99952eb9645df660467ae8',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/17.gif',
+ 'hash' => '021219ddd72d8fcfc7f80bd4a874d651',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/18.gif',
+ 'hash' => '383af3179d4ae27301c1292e630d7155',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/19.gif',
+ 'hash' => '8537e6d7be93447241b521f851e8a61d',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/20.gif',
+ 'hash' => '10d96f70e3d43086a925b00a7dc0022e',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/21.gif',
+ 'hash' => '161de9865b171b44039353b8d50491d3',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/22.gif',
+ 'hash' => '6a2354e43eb97d278d74bb2c12890988',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/23.gif',
+ 'hash' => '2cb6e2f9562a8dc8eef6d5d8d1a84f5e',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/24.gif',
+ 'hash' => '745b3fb5e16515689132432bf02ab1b4',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
')
)
)
);
@@ -2001,20 +2118,52 @@ abstract class ComponentbuilderHelper
/**
* get the dynamic content
*
- * @param string $type The type of content
- * @param string $size The size of the content
+ * @param string $type The type of content
+ * @param string $size The size of the content
+ * @param mix $default The default to return
*
- * @return string on success
+ * @return string on success html string
*
*/
- public static function getDynamicContent($type, $size, $default = '')
+ public static function getDynamicContent($type, $size, $default = '', $try = 0)
{
- if (isset(self::$dynamicContent[$type]) && isset(self::$dynamicContent[$type][$size]) && ($nr = self::checkArray(self::$dynamicContent[$type][$size])))
+ if (isset(self::$dynamicContent[$type]) && isset(self::$dynamicContent[$type][$size])
+ && ($nr = self::checkArray(self::$dynamicContent[$type][$size])))
{
// get the random item number
$get = (int) rand(0, --$nr);
+ // get the current target
+ $target = self::$dynamicContent[$type][$size][$get];
+ // set file name
+ $file_name = basename($target['url']);
+ // set the local path (in admin area so when the component uninstall these images get removed as well)
+ $path = JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type/$file_name";
+ // check if file exist or if it changed
+ if (($image_data = self::getFileContents($path, false)) === false ||
+ md5($image_data) !== $target['hash'])
+ {
+ // since the file does not exist or has changed (so we have a new hash)
+ // therefore we download it to validate
+ if (($image_data = self::getFileContents($target['url'], false)) !== false &&
+ md5($image_data) === $target['hash'])
+ {
+ // create the JCB type path if it does not exist
+ if (!JFolder::exists(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type"))
+ {
+ JFolder::create(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type");
+ }
+ // only set the image if the data match the hash
+ self::writeFile($path, $image_data);
+ }
+ // we retry 26 times
+ elseif ($try < 26)
+ {
+ // the time around failed so we try again
+ return self::getDynamicContent($type, $size, $default, ++$try);
+ }
+ }
// return found content
- return self::$dynamicContent[$type][$size][$get];
+ return str_replace('[[[ROOT-URL]]]', JURI::root(), $target['html']);
}
return $default;
}
diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini
index 487f132dc..729a16e6f 100644
--- a/admin/language/en-GB/en-GB.com_componentbuilder.ini
+++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini
@@ -3846,8 +3846,11 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NEW_TAB="New Tab"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NEW_TAB_TWO="New Tab 2"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NEXT="Next"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO="No"
-COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
"
-COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_LANGUAGE_STRING_LABEL="Add Language String"
+COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
+<?= JText::sprintf('Hello %s', $this->user->name) ?>
+Just get UPPERCASE language string:
+<?= JustTEXT::_('Text') ?>
"
+COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LIBRARIES_SELECTION_DESCRIPTION="All libraries you select will dynamically be added to the header of the page according to the settings of the selected library. Each library will also get its respective buttons added to the component global options if it has any set. Please take a look at the libraries for more details."
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LIBRARIES_SELECTION_LABEL="Select libraries you would like to use in your code"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LINKED_TO_NOTICE_DESCRIPTION="Searching the database.
"
@@ -5532,6 +5535,7 @@ COM_COMPONENTBUILDER_INACTIVE="Inactive"
COM_COMPONENTBUILDER_IN_SYNC="In Sync"
COM_COMPONENTBUILDER_ISOLATE="Isolate"
COM_COMPONENTBUILDER_ISSUE="issue"
+COM_COMPONENTBUILDER_IS_BEING_COMPILED="is being compiled"
COM_COMPONENTBUILDER_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES="Is Not (only 4 list/radio/checkboxes)"
COM_COMPONENTBUILDER_IS_ONLY_FOUR_LISTRADIOCHECKBOXES="Is (only 4 list/radio/checkboxes)"
COM_COMPONENTBUILDER_IWEBSITEI_BSB="Website: %s"
@@ -6327,8 +6331,11 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_NAME_MESSAGE="Error! Please add name here."
COM_COMPONENTBUILDER_JOOMLA_MODULE_NEW="A New Joomla Module"
COM_COMPONENTBUILDER_JOOMLA_MODULE_NO="No"
COM_COMPONENTBUILDER_JOOMLA_MODULE_NONE="None"
-COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_ADD_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
"
-COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_ADD_LANGUAGE_STRING_LABEL="Add Language String"
+COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
+<?= JText::sprintf('Hello %s', $this->user->name) ?>
+Just get UPPERCASE language string:
+<?= JustTEXT::_('Text') ?>
"
+COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String"
COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_LIBRARIES_OPTIONS_DESCRIPTION="All libraries added to modules are added to the component media folder for now
So over here you are able to manually add HTML code to your model default tmpl.
"
COM_COMPONENTBUILDER_JOOMLA_MODULE_NOTE_LIBRARIES_OPTIONS_LABEL="Libraries Options"
@@ -7170,8 +7177,11 @@ COM_COMPONENTBUILDER_LAYOUT_NAME_LABEL="Name"
COM_COMPONENTBUILDER_LAYOUT_NAME_MESSAGE="Error! Please add name here."
COM_COMPONENTBUILDER_LAYOUT_NEW="A New Layout"
COM_COMPONENTBUILDER_LAYOUT_NO="No"
-COM_COMPONENTBUILDER_LAYOUT_NOTE_ADD_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
"
-COM_COMPONENTBUILDER_LAYOUT_NOTE_ADD_LANGUAGE_STRING_LABEL="Add Language String"
+COM_COMPONENTBUILDER_LAYOUT_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
+<?= JText::sprintf('Hello %s', $this->user->name) ?>
+Just get UPPERCASE language string:
+<?= JustTEXT::_('Text') ?>
"
+COM_COMPONENTBUILDER_LAYOUT_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String"
COM_COMPONENTBUILDER_LAYOUT_NOTE_LIBRARIES_SELECTION_DESCRIPTION="All libraries you select will dynamically be added to the header of the page according to the settings of the selected library. Each library will also get its respective buttons added to the component global options if it has any set. Please take a look at the libraries for more details."
COM_COMPONENTBUILDER_LAYOUT_NOTE_LIBRARIES_SELECTION_LABEL="Select libraries you would like to use in your code"
COM_COMPONENTBUILDER_LAYOUT_NOTE_SNIPPET_USAGE_LABEL="Snippet Usage"
@@ -8260,8 +8270,11 @@ COM_COMPONENTBUILDER_SITE_VIEW_NEW_TAB_TWO="New Tab 2"
COM_COMPONENTBUILDER_SITE_VIEW_NEXT="Next"
COM_COMPONENTBUILDER_SITE_VIEW_NO="No"
COM_COMPONENTBUILDER_SITE_VIEW_NONE="None"
-COM_COMPONENTBUILDER_SITE_VIEW_NOTE_ADD_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
"
-COM_COMPONENTBUILDER_SITE_VIEW_NOTE_ADD_LANGUAGE_STRING_LABEL="Add Language String"
+COM_COMPONENTBUILDER_SITE_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
+<?= JText::sprintf('Hello %s', $this->user->name) ?>
+Just get UPPERCASE language string:
+<?= JustTEXT::_('Text') ?>
"
+COM_COMPONENTBUILDER_SITE_VIEW_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String"
COM_COMPONENTBUILDER_SITE_VIEW_NOTE_CUSTOM_TOOLBAR_PLACEHOLDER_DESCRIPTION="Use this placeholder in the body [[[SITE_TOOLBAR]]]
to add the custom position of the toolbar."
COM_COMPONENTBUILDER_SITE_VIEW_NOTE_LIBRARIES_SELECTION_DESCRIPTION="All libraries you select will dynamically be added to the header of the page according to the settings of the selected library. Each library will also get its respective buttons added to the component global options if it has any set. Please take a look at the libraries for more details."
COM_COMPONENTBUILDER_SITE_VIEW_NOTE_LIBRARIES_SELECTION_LABEL="Select libraries you would like to use in your code"
@@ -8634,7 +8647,7 @@ COM_COMPONENTBUILDER_SZIP_COULD_NOT_BE_INSTALLED="%s.zip could not be installed!
COM_COMPONENTBUILDER_SZIP_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION="%s.zip was removed the from tmp folder during installation!"
COM_COMPONENTBUILDER_S_BEING_IMPORTED="%s Being Imported"
COM_COMPONENTBUILDER_S_NOT_LINKED="%s Not Linked"
-COM_COMPONENTBUILDER_S_PLEASE_WAIT_THE_COMPONENT_IS_BEING_COMPILED="%s, please wait! The component is being compiled"
+COM_COMPONENTBUILDER_S_PLEASE_WAIT="%s, please wait!"
COM_COMPONENTBUILDER_TAB="Tab"
COM_COMPONENTBUILDER_TABLE_BSB_NOT_FOUND_IN_THE_LOCAL_DATABASE_SO_ITS_VALUES_COULD_NOT_BE_IMPORTED_PLEASE_UPDATE_YOUR_JCB_INSTALL_AND_TRY_AGAIN="Table %s not found in the local database so its values could not be imported, please update your JCB install and try again."
COM_COMPONENTBUILDER_TARGET_BEHAVIOUR="Target Behaviour"
@@ -8729,8 +8742,11 @@ COM_COMPONENTBUILDER_TEMPLATE_NAME_LABEL="Name"
COM_COMPONENTBUILDER_TEMPLATE_NAME_MESSAGE="Error! Please add name here."
COM_COMPONENTBUILDER_TEMPLATE_NEW="A New Template"
COM_COMPONENTBUILDER_TEMPLATE_NO="No"
-COM_COMPONENTBUILDER_TEMPLATE_NOTE_ADD_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
"
-COM_COMPONENTBUILDER_TEMPLATE_NOTE_ADD_LANGUAGE_STRING_LABEL="Add Language String"
+COM_COMPONENTBUILDER_TEMPLATE_NOTE_ADD_PHP_LANGUAGE_STRING_DESCRIPTION="<?= JText::_('Text') ?>
+<?= JText::sprintf('Hello %s', $this->user->name) ?>
+Just get UPPERCASE language string:
+<?= JustTEXT::_('Text') ?>
"
+COM_COMPONENTBUILDER_TEMPLATE_NOTE_ADD_PHP_LANGUAGE_STRING_LABEL="Add PHP Language String"
COM_COMPONENTBUILDER_TEMPLATE_NOTE_LIBRARIES_SELECTION_DESCRIPTION="All libraries you select will dynamically be added to the header of the page according to the settings of the selected library. Each library will also get its respective buttons added to the component global options if it has any set. Please take a look at the libraries for more details."
COM_COMPONENTBUILDER_TEMPLATE_NOTE_LIBRARIES_SELECTION_LABEL="Select libraries you would like to use in your code"
COM_COMPONENTBUILDER_TEMPLATE_NOTE_SNIPPET_USAGE_LABEL="Snippet Usage"
@@ -8780,6 +8796,7 @@ COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHO
COM_COMPONENTBUILDER_THE_BSB_LIBRARY_CAN_NOT_BE_DELETED_OR_THINGS_WILL_BREAK="The %s library can not be deleted, or things will break."
COM_COMPONENTBUILDER_THE_BSHOW_IN_ALL_LIST_VIEWSB_OPTION_WILL_ADD_THIS_FIELD_TO_ALL_LIST_VIEWS_ADMIN_AMP_LINKED="The Show in All List Views option will Add this field to all list views, admin & linked."
COM_COMPONENTBUILDER_THE_BSINGLE_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_JUST_ONE_VALUE_IN_THIS_FILTERFIELD="The single filter selection option allows the user to select just one value in this filter/field."
+COM_COMPONENTBUILDER_THE_COMPONENT="The Component"
COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views"
COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config"
COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS="The component custom admin menus"
@@ -8821,6 +8838,7 @@ COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST="The
COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA="The url (%s) set to retrieve the packages does not return any data!"
COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading"
COM_COMPONENTBUILDER_THIS_BSB_IS_NOT_LINKED_TO_ANY_OTHER_AREAS_OF_JCB_AT_THIS_TIME="This %s is not linked to any other areas of JCB at this time!"
+COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT="This may take a while depending on the size of your project."
COM_COMPONENTBUILDER_THIS_PACKAGE_BPASSEDB_THE_CHECKSUM_VALIDATIONBR_BR_SMALLMANUALLY_ALSO_VALIDATE_THAT_THE_CORRECT_CHECKSUM_WAS_USEDSMALLBR_THIS_CHECKSUM_BSB_MUST_BE_THE_SAME_AS_THE_ONE_FOUND_A_S_SA="This package PASSED the checksum validation!
Manually also validate that the correct checksum was used.
This checksum: %s must be the same as the one found @ "
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
COM_COMPONENTBUILDER_TITLE="Title"
diff --git a/admin/layouts/custom_admin_view/details_left.php b/admin/layouts/custom_admin_view/details_left.php
index dac8a799f..43b067ea4 100644
--- a/admin/layouts/custom_admin_view/details_left.php
+++ b/admin/layouts/custom_admin_view/details_left.php
@@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
'description',
'note_libraries_selection',
'libraries',
- 'note_add_language_string'
+ 'note_add_php_language_string'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
diff --git a/admin/layouts/jcbnoticeboardpro.php b/admin/layouts/jcbnoticeboardpro.php
new file mode 100644
index 000000000..cbd179baf
--- /dev/null
+++ b/admin/layouts/jcbnoticeboardpro.php
@@ -0,0 +1,22 @@
+
+ * @github Joomla Component Builder
+ * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+// No direct access to this file
+defined('JPATH_BASE') or die('Restricted access');
+
+
+
+?>
+
+
+
= JText::_('COM_COMPONENTBUILDER_THE_PRO_BOARD_IS_LOADING') ?>.
+
+
diff --git a/admin/layouts/jcbnoticeboardtabs.php b/admin/layouts/jcbnoticeboardtabs.php
index c6ef46064..b95aa2c13 100644
--- a/admin/layouts/jcbnoticeboardtabs.php
+++ b/admin/layouts/jcbnoticeboardtabs.php
@@ -15,23 +15,15 @@ defined('JPATH_BASE') or die('Restricted access');
?>
-
- 'vdm-noticeboard')); ?>
-
-
-
-
-
-
-
-
-
+
+ = JHtml::_('bootstrap.startTabSet', $displayData . '_tab', array('active' => 'vdm-noticeboard')) ?>
+ = JHtml::_('bootstrap.addTab', $displayData . '_tab', 'vdm-noticeboard', JText::_('COM_COMPONENTBUILDER_VDM_BOARD', true)) ?>
+ = JLayoutHelper::render('jcbnoticeboardvdm', null) ?>
+
+ = JHtml::_('bootstrap.endTab'); ?>
+ = JHtml::_('bootstrap.addTab', $displayData . '_tab', 'proboard', JText::_('COM_COMPONENTBUILDER_JCB_PRO_BOARD', true)) ?>
+ = JLayoutHelper::render('jcbnoticeboardpro', null) ?>
+
+ = JHtml::_('bootstrap.endTab') ?>
+ = JHtml::_('bootstrap.endTabSet') ?>
diff --git a/admin/layouts/jcbnoticeboardvdm.php b/admin/layouts/jcbnoticeboardvdm.php
new file mode 100644
index 000000000..6fac707f4
--- /dev/null
+++ b/admin/layouts/jcbnoticeboardvdm.php
@@ -0,0 +1,22 @@
+
+ * @github Joomla Component Builder
+ * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+// No direct access to this file
+defined('JPATH_BASE') or die('Restricted access');
+
+
+
+?>
+
+
+
= JText::_('COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING') ?>.
+
+
diff --git a/admin/layouts/joomla_module/html_left.php b/admin/layouts/joomla_module/html_left.php
index 2d19b5f80..f4645f89e 100644
--- a/admin/layouts/joomla_module/html_left.php
+++ b/admin/layouts/joomla_module/html_left.php
@@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
'description',
'libraries',
'note_libraries_options',
- 'note_add_language_string'
+ 'note_add_php_language_string'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
diff --git a/admin/layouts/layout/details_left.php b/admin/layouts/layout/details_left.php
index d2c223596..36e279e85 100644
--- a/admin/layouts/layout/details_left.php
+++ b/admin/layouts/layout/details_left.php
@@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
'description',
'note_libraries_selection',
'libraries',
- 'note_add_language_string'
+ 'note_add_php_language_string'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
diff --git a/admin/layouts/site_view/details_left.php b/admin/layouts/site_view/details_left.php
index dac8a799f..43b067ea4 100644
--- a/admin/layouts/site_view/details_left.php
+++ b/admin/layouts/site_view/details_left.php
@@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
'description',
'note_libraries_selection',
'libraries',
- 'note_add_language_string'
+ 'note_add_php_language_string'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
diff --git a/admin/layouts/template/details_left.php b/admin/layouts/template/details_left.php
index d2c223596..36e279e85 100644
--- a/admin/layouts/template/details_left.php
+++ b/admin/layouts/template/details_left.php
@@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
'description',
'note_libraries_selection',
'libraries',
- 'note_add_language_string'
+ 'note_add_php_language_string'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php
index 4d87dd2b2..4ad5dad23 100644
--- a/admin/models/componentbuilder.php
+++ b/admin/models/componentbuilder.php
@@ -560,7 +560,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList
var getUrl = "index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true";
}
if(token.length > 0 && notice.length){
- var request = "token="+token+"¬ice="+notice;
+ var request = token+"=1¬ice="+notice;
}
return jQuery.ajax({
type: "POST",
diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php
index 194743393..1f6396611 100644
--- a/admin/models/custom_admin_view.php
+++ b/admin/models/custom_admin_view.php
@@ -34,7 +34,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
'description',
'note_libraries_selection',
'libraries',
- 'note_add_language_string'
+ 'note_add_php_language_string'
),
'right' => array(
'icon',
diff --git a/admin/models/forms/custom_admin_view.xml b/admin/models/forms/custom_admin_view.xml
index afa495784..2f3056036 100644
--- a/admin/models/forms/custom_admin_view.xml
+++ b/admin/models/forms/custom_admin_view.xml
@@ -150,8 +150,8 @@
required="true"
button="true"
/>
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
array(
'snippet',
diff --git a/admin/models/layout.php b/admin/models/layout.php
index 61903c762..e285cedee 100644
--- a/admin/models/layout.php
+++ b/admin/models/layout.php
@@ -34,7 +34,7 @@ class ComponentbuilderModelLayout extends JModelAdmin
'description',
'note_libraries_selection',
'libraries',
- 'note_add_language_string'
+ 'note_add_php_language_string'
),
'right' => array(
'snippet',
diff --git a/admin/models/site_view.php b/admin/models/site_view.php
index f84cb3d02..0d40f7a74 100644
--- a/admin/models/site_view.php
+++ b/admin/models/site_view.php
@@ -34,7 +34,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
'description',
'note_libraries_selection',
'libraries',
- 'note_add_language_string'
+ 'note_add_php_language_string'
),
'right' => array(
'snippet',
diff --git a/admin/models/template.php b/admin/models/template.php
index f9d914f18..e627787a0 100644
--- a/admin/models/template.php
+++ b/admin/models/template.php
@@ -34,7 +34,7 @@ class ComponentbuilderModelTemplate extends JModelAdmin
'description',
'note_libraries_selection',
'libraries',
- 'note_add_language_string'
+ 'note_add_php_language_string'
),
'right' => array(
'snippet',
diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql
index 0bea7645b..bc3fad8ca 100644
--- a/admin/sql/install.mysql.utf8.sql
+++ b/admin/sql/install.mysql.utf8.sql
@@ -2299,7 +2299,7 @@ INSERT INTO `#__componentbuilder_admin_fields_conditions` (`id`, `addconditions`
--
INSERT INTO `#__componentbuilder_component_admin_views` (`id`, `addadmin_views`, `joomla_component`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
-(27, '{\"addadmin_views0\":{\"adminview\":\"109\",\"icomoon\":\"eye-open\",\"mainmenu\":\"1\",\"dashboard_add\":\"1\",\"dashboard_list\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"joomla_fields\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"port\":\"1\",\"edit_create_site_view\":\"1\",\"order\":\"1\"}}', 25, 1, '2017-10-28 03:56:26', '2018-08-22 19:18:19', 6, '', '');
+(27, '{\"addadmin_views0\":{\"adminview\":\"109\",\"icomoon\":\"eye-open\",\"mainmenu\":\"1\",\"dashboard_add\":\"1\",\"dashboard_list\":\"1\",\"submenu\":\"1\",\"checkin\":\"1\",\"history\":\"1\",\"joomla_fields\":\"1\",\"metadata\":\"1\",\"access\":\"1\",\"port\":\"1\",\"filter\":\"2\",\"edit_create_site_view\":\"1\",\"order\":\"1\"}}', 25, 1, '2017-10-28 03:56:26', '2021-02-08 10:32:04', 7, '', '');
--
-- Dumping data for table `#__componentbuilder_component_site_views`
diff --git a/admin/views/compiler/tmpl/default.php b/admin/views/compiler/tmpl/default.php
index 02639164c..dc730b299 100644
--- a/admin/views/compiler/tmpl/default.php
+++ b/admin/views/compiler/tmpl/default.php
@@ -50,10 +50,23 @@ Joomla.submitbutton = function(task, key)
form.submit();
// some ui movements
if (task == 'compiler.compiler'){
- jQuery('#compiler').show();
+ // get the component name
+ let component_name = jQuery("#component option:selected").text();
+ // set the component name
+ jQuery(".component-name").text(component_name);
+ // wait a little since to much is happening...
+ setTimeout(function() {
+ jQuery('#compiler').show();
+ jQuery('#compiling').css('display', 'block');
+ // wait a little since to much is happening...
+ setTimeout(function() {
+ jQuery('#compiler-spinner').show();
+ jQuery('#compiler-notice').show();
+ }, 100);
+ }, 100);
} else if (task == 'compiler.clearTmp'){
- jQuery('#loading').css('display', 'block');
jQuery('#clear').show();
+ jQuery('#loading').css('display', 'block');
} else {
jQuery('#loading').css('display', 'block');
}
@@ -81,6 +94,20 @@ jQuery('')
.css("filter", "alpha(opacity = 80)")
.css("display", "none")
.appendTo(outerDiv);
+// for the compiler
+var outerDiv = jQuery('body');
+jQuery('')
+ .css("background", "rgba(16, 164, 230, .4)")
+ .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.40")
+ .css("-ms-filter", "progid:DXImageTransform.Microsoft.Alpha(Opacity = 40)")
+ .css("filter", "alpha(opacity = 40)")
+ .css("display", "none")
+ .appendTo(outerDiv);
});
sidebar)): ?>
@@ -93,15 +120,15 @@ jQuery('')
@@ -467,6 +468,7 @@ function getJCBpackageInfo_server(url){
}
+
var noticeboard = "https://www.vdm.io/componentbuilder-noticeboard-md";
jQuery(document).ready(function () {
jQuery.get(noticeboard)
@@ -489,20 +491,20 @@ jQuery(document).ready(function () {
});
// to check is READ/NEW
function getIS(type,notice){
- if (type == 1) {
- var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.isNew&format=json");
+ if(type == 1){
+ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true");
} else if (type == 2) {
- var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.isRead&format=json");
+ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true");
}
if(token.length > 0 && notice.length){
- var request = "token="+token+"¬ice="+notice;
+ var request = token+"=1¬ice="+notice;
}
return jQuery.ajax({
type: "POST",
url: getUrl,
- dataType: "jsonp",
+ dataType: "json",
data: request,
- jsonp: "callback"
+ jsonp: false
});
}
diff --git a/componentbuilder.xml b/componentbuilder.xml
index f4140ab27..994fb015c 100644
--- a/componentbuilder.xml
+++ b/componentbuilder.xml
@@ -1,7 +1,7 @@
COM_COMPONENTBUILDER
- 2nd February, 2021
+ 19th February, 2021
Llewellyn van der Merwe
llewellyn@joomlacomponentbuilder.com
http://www.joomlacomponentbuilder.com
diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php
index 898810c59..e7d06c6a3 100644
--- a/site/helpers/componentbuilder.php
+++ b/site/helpers/componentbuilder.php
@@ -1967,30 +1967,147 @@ abstract class ComponentbuilderHelper
}
return false;
}
+
/**
* The array of dynamic content
*
* @var array
*/
protected static $dynamicContent = array(
- // The banners by size
+ // The banners by size (width - height)
'banner' => array(
'728-90' => array(
- '',
- '',
- '',
- '',
- ''
+ array(
+ 'url' => 'https://cdn.joomla.org/volunteers/joomla-heart-wide.gif',
+ 'hash' => 'f857e3a38facaeac9eba3cffa912b620',
+ 'html' => ''),
+ array(
+ 'url' => 'https://magazine.joomla.org/images/banners/JCM_2010_728x90.png',
+ 'hash' => '4083c66f996279fd5a76adffc3a7d194',
+ 'html' => ''),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/banners/tlwebdesign_jcb_sponsor_728_90.png',
+ 'hash' => 'd19be1f9f5b2049ff901096aafc246be',
+ 'html' => ''),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/banners/vdm_jcb_sponsor_728_90.gif',
+ 'hash' => '84478dfa0cd880395815e0ee026812a4',
+ 'html' => ''),
+ array(
+ 'url' => 'https://allmycms.com/images/banners/agerix/agerix-loves-jcb-728-90.gif',
+ 'hash' => 'b24c0726aa809cdcc04bcffe7e1e1529',
+ 'html' => '')
),
'160-600' => array(
- '',
- ''
+ array(
+ 'url' => 'https://cdn.joomla.org/volunteers/joomla-heart-tall.gif',
+ 'hash' => '9a75e4929b86c318128b53cf78251678',
+ 'html' => ''),
+ array(
+ 'url' => 'https://magazine.joomla.org/images/banners/JCM_2010_120x600.png',
+ 'hash' => '5389cf3be8569cb3f6793e8bd4013d19',
+ 'html' => '')
)
),
- // The build-gif by size
+ // The build-gif by size (width - height)
'builder-gif' => array(
- '707-400' => array(
- ''
+ '480-540' => array(
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/1.gif',
+ 'hash' => 'ce6e36456fa794ba95d981547b2f54f8',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/2.gif',
+ 'hash' => '0a54dbc393359747e33db90cabb1e2d7',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/3.gif',
+ 'hash' => '4e5498713ff69a64a0a79dbf620372a3',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/4.gif',
+ 'hash' => '3554ffab2a6df95a116fd9f0db63925c',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/5.gif',
+ 'hash' => '08f0cdf188593eca65c6dafd7af27ef9',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/6.gif',
+ 'hash' => '103b46a7ac3fcb974e25d06f417a4e87',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/7.gif',
+ 'hash' => 'ffa8547099b7286f89ab7ff5a140dd90',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/8.gif',
+ 'hash' => '316df780f9e4ce81200a65d3c4303c41',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/9.gif',
+ 'hash' => '9ab6ba78b6e63a285fdef2ff5e447c93',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/10.gif',
+ 'hash' => 'cd9abaa1cb95f51a70916da6b70614f2',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/11.gif',
+ 'hash' => 'cfe53095b5249618e2348223b89262b9',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/12.gif',
+ 'hash' => '15a6690647d5160d67c80ce4dd1f5602',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/13.gif',
+ 'hash' => '2f77562e92c8a3b7c47664c98f551fe8',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/14.gif',
+ 'hash' => '46db15517ef5bd063be85134e1cc575d',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/15.gif',
+ 'hash' => 'e6c96eff157ea648ceb1583f2cc22544',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/16.gif',
+ 'hash' => '76010b7d1f99952eb9645df660467ae8',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/17.gif',
+ 'hash' => '021219ddd72d8fcfc7f80bd4a874d651',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/18.gif',
+ 'hash' => '383af3179d4ae27301c1292e630d7155',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/19.gif',
+ 'hash' => '8537e6d7be93447241b521f851e8a61d',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/20.gif',
+ 'hash' => '10d96f70e3d43086a925b00a7dc0022e',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/21.gif',
+ 'hash' => '161de9865b171b44039353b8d50491d3',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/22.gif',
+ 'hash' => '6a2354e43eb97d278d74bb2c12890988',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/23.gif',
+ 'hash' => '2cb6e2f9562a8dc8eef6d5d8d1a84f5e',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
'),
+ array(
+ 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/24.gif',
+ 'hash' => '745b3fb5e16515689132432bf02ab1b4',
+ 'html' => '
Animation produced with 3D Particle Explorations by Jack Rugile.
')
)
)
);
@@ -1998,20 +2115,52 @@ abstract class ComponentbuilderHelper
/**
* get the dynamic content
*
- * @param string $type The type of content
- * @param string $size The size of the content
+ * @param string $type The type of content
+ * @param string $size The size of the content
+ * @param mix $default The default to return
*
- * @return string on success
+ * @return string on success html string
*
*/
- public static function getDynamicContent($type, $size, $default = '')
+ public static function getDynamicContent($type, $size, $default = '', $try = 0)
{
- if (isset(self::$dynamicContent[$type]) && isset(self::$dynamicContent[$type][$size]) && ($nr = self::checkArray(self::$dynamicContent[$type][$size])))
+ if (isset(self::$dynamicContent[$type]) && isset(self::$dynamicContent[$type][$size])
+ && ($nr = self::checkArray(self::$dynamicContent[$type][$size])))
{
// get the random item number
$get = (int) rand(0, --$nr);
+ // get the current target
+ $target = self::$dynamicContent[$type][$size][$get];
+ // set file name
+ $file_name = basename($target['url']);
+ // set the local path (in admin area so when the component uninstall these images get removed as well)
+ $path = JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type/$file_name";
+ // check if file exist or if it changed
+ if (($image_data = self::getFileContents($path, false)) === false ||
+ md5($image_data) !== $target['hash'])
+ {
+ // since the file does not exist or has changed (so we have a new hash)
+ // therefore we download it to validate
+ if (($image_data = self::getFileContents($target['url'], false)) !== false &&
+ md5($image_data) === $target['hash'])
+ {
+ // create the JCB type path if it does not exist
+ if (!JFolder::exists(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type"))
+ {
+ JFolder::create(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/$type");
+ }
+ // only set the image if the data match the hash
+ self::writeFile($path, $image_data);
+ }
+ // we retry 26 times
+ elseif ($try < 26)
+ {
+ // the time around failed so we try again
+ return self::getDynamicContent($type, $size, $default, ++$try);
+ }
+ }
// return found content
- return self::$dynamicContent[$type][$size][$get];
+ return str_replace('[[[ROOT-URL]]]', JURI::root(), $target['html']);
}
return $default;
}