diff --git a/README.md b/README.md index 151600df6..483676720 100644 --- a/README.md +++ b/README.md @@ -147,8 +147,8 @@ TODO + *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*: **291909** -+ *Field count*: **1627** ++ *Line count*: **292151** ++ *Field count*: **1629** + *File count*: **1935** + *Folder count*: **322** diff --git a/admin/README.txt b/admin/README.txt index 151600df6..483676720 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -147,8 +147,8 @@ TODO + *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*: **291909** -+ *Field count*: **1627** ++ *Line count*: **292151** ++ *Field count*: **1629** + *File count*: **1935** + *Folder count*: **322** diff --git a/admin/access.xml b/admin/access.xml index e5398db15..287be5da2 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -107,6 +107,7 @@ + diff --git a/admin/config.xml b/admin/config.xml index 31a6b5c6e..f677f1778 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -657,6 +657,24 @@ name="compiler_custom_config" label="COM_COMPONENTBUILDER_CONFIG_COMPILER"> + + + + + + + + - - + + - - + + COM_COMPONENTBUILDER_CONFIG_NO - - + + @@ -757,8 +775,8 @@ - - + + authorise('compiler.compiler_animations', 'com_componentbuilder')) + { + // get the model + $model = $this->getModel('compiler'); + if ($model->getCompilerAnimations($message)) + { + $message = JText::_('COM_COMPONENTBUILDER_BALL_THE_COMPILER_ANIMATIONS_WERE_SUCCESSFULLY_DOWNLOADED_TO_THIS_JOOMLA_INSTALLB'); + $this->setRedirect($redirect_url, $message, 'message'); + return true; + } + } + $this->setRedirect($redirect_url, $message, 'error'); + return false; + } + /** * Run the Compiler * diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index e7afea28d..0fe7c2a2b 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -10339,7 +10339,7 @@ class Get foreach ($paths as $target => $path) { - // we are changing the working directory to the componet path + // we are changing the working directory to the component path chdir($path); foreach ($fileTypes as $type) { @@ -10837,7 +10837,7 @@ class Get // convert them foreach ($values as $path) { - // we first get the file + // we first get the file if it exist if ($value = ComponentbuilderHelper::getFileContents($path)) { // now we hash the file content diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index f9bb0c6aa..047a7d39c 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -1983,23 +1983,23 @@ abstract class ComponentbuilderHelper array( 'url' => 'https://cdn.joomla.org/volunteers/joomla-heart-wide.gif', 'hash' => 'f857e3a38facaeac9eba3cffa912b620', - 'html' => 'Joomla! Volunteers Portal'), + 'html' => 'Joomla! Volunteers Portal'), array( 'url' => 'https://magazine.joomla.org/images/banners/JCM_2010_728x90.png', 'hash' => '4083c66f996279fd5a76adffc3a7d194', - 'html' => 'Joomla! Community Magazine | Because community matters...'), + 'html' => 'Joomla! Community Magazine | Because community matters...'), array( 'url' => 'https://www.joomlacomponentbuilder.com/images/banners/tlwebdesign_jcb_sponsor_728_90.png', 'hash' => 'd19be1f9f5b2049ff901096aafc246be', - 'html' => 'tlwebdesign a JCB sponsor | Because community matters...'), + 'html' => 'tlwebdesign a JCB sponsor | Because community matters...'), array( 'url' => 'https://www.joomlacomponentbuilder.com/images/banners/vdm_jcb_sponsor_728_90.gif', 'hash' => '84478dfa0cd880395815e0ee026812a4', - 'html' => 'VDM a JCB sponsor | Because community matters...'), + 'html' => 'VDM a JCB sponsor | Because community matters...'), array( 'url' => 'https://allmycms.com/images/banners/agerix/agerix-loves-jcb-728-90.gif', 'hash' => 'b24c0726aa809cdcc04bcffe7e1e1529', - 'html' => 'Agerix a JCB sponsor | Because community matters...') + 'html' => 'Agerix a JCB sponsor | Because community matters...') ), '160-600' => array( array( @@ -2014,6 +2014,15 @@ abstract class ComponentbuilderHelper ), // The build-gif by size (width - height) 'builder-gif' => array( + // original gif ;) + '480-272' => array( + array( + 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/original.gif', + 'hash' => '676e37a949add8f4573381195cd1061c', + 'html' => '' + ) + ), + // new gif artwork since 2021 '480-540' => array( array( 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/1.gif', @@ -2115,55 +2124,90 @@ abstract class ComponentbuilderHelper ) ); + /** + * get the dynamic content array size + * + * @param string $type The type of content + * @param string $size The size of the content + * + * @return int on success number of items in array type,size + * + */ + public static function getDynamicContentSize($type, $size) + { + if (isset(self::$dynamicContent[$type]) && isset(self::$dynamicContent[$type][$size]) + && ($nr = self::checkArray(self::$dynamicContent[$type][$size]))) + { + return $nr; + } + return 0; + } + /** * get the dynamic content * * @param string $type The type of content * @param string $size The size of the content * @param mix $default The default to return + * @param int $try Retry tracker (when bigger then array size it stops) + * @param mix $getter The specific getter number (not zero based) * * @return string on success html string * */ - public static function getDynamicContent($type, $size, $default = '', $try = 0) + public static function getDynamicContent($type, $size, $default = '', $try = 1, $getter = null) { - if (isset(self::$dynamicContent[$type]) && isset(self::$dynamicContent[$type][$size]) - && ($nr = self::checkArray(self::$dynamicContent[$type][$size]))) + if (($nr = self::getDynamicContentSize($type, $size)) !== 0) { - // 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']) + // use specific getter + if ($getter) { - // 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); - } + $get = --$getter; + } + // get the random getter number + elseif ($nr > 1) + { + $get = (int) rand(0, --$nr); + } + else + { + $get = 0; + } + // get the current target if found + if (isset(self::$dynamicContent[$type][$size][$get])) + { + $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 array size times (unless specific getter is used) + elseif ($try <= $nr && !$getter) + { + // the first time around failed so we try again (the size of the array times) + return self::getDynamicContent($type, $size, $default, ++$try); + } + } + // return found content + return str_replace('[[[ROOT-URL]]]', JURI::root(), $target['html']); } - // return found content - 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 729a16e6f..922588a31 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1324,6 +1324,7 @@ COM_COMPONENTBUILDER_BACKUP_LOCAL_DATA_FIRST="Backup Local Data First" COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY="Backup was done successfully" COM_COMPONENTBUILDER_BACK_TO_LIBRARIES="Back to Libraries" COM_COMPONENTBUILDER_BADMIN_FIELDS_RELATIONSB_IDS_MISMATCH_IN_BFIELDSB_AND_WAS_NOT_UPDATED_IN_THE_CUSTOM_CODE="Admin fields relations id:%s mismatch in field:%s, and was not updated in the custom code." +COM_COMPONENTBUILDER_BALL_THE_COMPILER_ANIMATIONS_WERE_SUCCESSFULLY_DOWNLOADED_TO_THIS_JOOMLA_INSTALLB="All the compiler animations were successfully downloaded to this Joomla Install!" COM_COMPONENTBUILDER_BASIC_TUTORIAL_ON_GIT_BSB="Basic Tutorial on git: %s" COM_COMPONENTBUILDER_BBEST_TO_NOT_CONTINUEBBR_WE_COULD_NOT_LOAD_THE_CHECKSUM_FOR_THIS_PACKAGE_AND_SO_NO_VALIDATION_WAS_POSSIBLE_THIS_MAY_BE_DUE_TO_YOUR_NETWORK_OR_A_CHANGE_TO_THAT_PACKAGE_NAME="Best to not continue!
We could not load the checksum for this package, and so no validation was possible. This may be due to your network, or a change to that package name." COM_COMPONENTBUILDER_BBEST_TO_NOT_CONTINUEBBR_YOU_CAN_REFRESH_AND_TRY_AGAINBR_BUT_NOTE_THAT_THIS_PACKAGE_BFAILEDB_CHECKSUM_VALIDATION_THIS_COULD_BE_A_SERIOUS_SECURITY_BREACH_DO_NOT_CONTINUE="Best to not continue!
You can Refresh and try again.
But note that this package FAILED checksum validation, this could be a serious security breach! DO NOT CONTINUE!!!" @@ -1650,8 +1651,11 @@ COM_COMPONENTBUILDER_COMPANY_S="Company: %s" COM_COMPONENTBUILDER_COMPILER="Compiler" COM_COMPONENTBUILDER_COMPILER_ACCESS="Compiler Access" COM_COMPONENTBUILDER_COMPILER_ACCESS_DESC="Allows the users in this group to access compiler." +COM_COMPONENTBUILDER_COMPILER_ANIMATIONS="Compiler Animations" COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS="Compiler Clear tmp Button Access" COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS_DESC="Allows the users in this group to access the clear tmp button." +COM_COMPONENTBUILDER_COMPILER_COMPILER_ANIMATIONS_BUTTON_ACCESS="Compiler Compiler Animations Button Access" +COM_COMPONENTBUILDER_COMPILER_COMPILER_ANIMATIONS_BUTTON_ACCESS_DESC="Allows the users in this group to access the compiler animations button." COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST="Compiler Dashboard List" COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Compiler" COM_COMPONENTBUILDER_COMPILER_DESC="The compiler" @@ -3234,6 +3238,8 @@ COM_COMPONENTBUILDER_CONFIG_BASIC_KEY_DESC="Set the basic local key here." COM_COMPONENTBUILDER_CONFIG_BASIC_KEY_LABEL="Basic Key" COM_COMPONENTBUILDER_CONFIG_BASIC_KEY_NOTE_DESC="When using the basic encryption please use set a 32 character passphrase.
Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!" COM_COMPONENTBUILDER_CONFIG_BASIC_KEY_NOTE_LABEL="Basic Encryption" +COM_COMPONENTBUILDER_CONFIG_BUILDER_GIF_SIZE_DESCRIPTION="Select the artwork you would like to show during compilation of your projects in the compiler area." +COM_COMPONENTBUILDER_CONFIG_BUILDER_GIF_SIZE_LABEL="Compiler Artwork Options" COM_COMPONENTBUILDER_CONFIG_CHECK_TIMER_DESC="Set the intervals for the auto checkin fuction of tables that checks out the items to an user." COM_COMPONENTBUILDER_CONFIG_CHECK_TIMER_LABEL="Check in timer" COM_COMPONENTBUILDER_CONFIG_CHECK_TIMER_OPTION_FIVE="Once a week" @@ -3487,6 +3493,7 @@ COM_COMPONENTBUILDER_CONFIG_OFF="Off" COM_COMPONENTBUILDER_CONFIG_ON="On" COM_COMPONENTBUILDER_CONFIG_ONLY_BOOLEAN="Only Boolean" COM_COMPONENTBUILDER_CONFIG_ONLY_EXTRA="Only Extra" +COM_COMPONENTBUILDER_CONFIG_ORIGINAL_VDM="Original (VDM)" COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_DESCRIPTION="[YEAR] [MONTH] [DAY] [HOUR] [MINUTE]" COM_COMPONENTBUILDER_CONFIG_PACKAGE_NAME_PLAEHOLDERS_LABEL="Package Name Placeholders" COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_DESCRIPTION="Select percentage any language should be translated before the system should add the language to the component during compilation." @@ -3536,6 +3543,7 @@ COM_COMPONENTBUILDER_CONFIG_STORAGE_TIME_TO_LIVE_LABEL="Update Cycle" COM_COMPONENTBUILDER_CONFIG_STRING_MANIPULATION="String Manipulation" COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_DESCRIPTION="Select the sub-form layouts you would like to use." COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_LABEL="Sub-form Layouts" +COM_COMPONENTBUILDER_CONFIG_THREED_PARTICLE_EXPLORATIONS="3D Particle Explorations" COM_COMPONENTBUILDER_CONFIG_TLS="TLS" COM_COMPONENTBUILDER_CONFIG_TRUE="True" COM_COMPONENTBUILDER_CONFIG_TYPE_NAME_BUILDER_DESCRIPTION="The default option only uses alphabetical characters and converts all numbers in field names to the English equivalent like 1 becomes one.
Alphanumeric+dot keeps the numbers unconverted unless it is at the beginning of the field name, and allows for a dot (.) to be used in the type name for namespacing." @@ -7789,7 +7797,7 @@ COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_LATTER="Please check again latter." COM_COMPONENTBUILDER_PLEASE_NOTE_THAT_THIS_PACKAGE_BHAS_NOB_CHECKSUM_VALIDATION="Please note that this package has no checksum validation!" COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE="Please select a component that you would like to compile." COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER="Please try again later" -COM_COMPONENTBUILDER_PLEASE_WAIT_CLEARING_THE_TMP_FOLDER="Please wait! Clearing the tmp folder" +COM_COMPONENTBUILDER_PLEASE_WAIT="Please wait!" COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING="Please wait, loading" COM_COMPONENTBUILDER_PLUGIN="Plugin" COM_COMPONENTBUILDER_PLUGINS="Plugins" @@ -7806,6 +7814,7 @@ COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT="Ready to compile a component" COM_COMPONENTBUILDER_REFRESH="Refresh" COM_COMPONENTBUILDER_RELEASED_THIS="released this" COM_COMPONENTBUILDER_REMOVE="Remove" +COM_COMPONENTBUILDER_REMOVING_ALL_ZIP_PACKAGES_FROM_THE_TEMPORARY_FOLDER_OF_THE_JOOMLA_INSTALL="Removing all zip packages from the temporary folder of the Joomla install" COM_COMPONENTBUILDER_RENAME="Rename" COM_COMPONENTBUILDER_REPORT_AN_ISSUE_BSB="Report an issue: %s" COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_ENTERED_BE_ONE_OF_THE_OPTIONS_IN_AN_ELEMENT_OF_TYPEQUOTLISTQUOT_THAT_IS_THAT_THE_ELEMENT_IS_A_SELECT_LIST="Requires the value entered be one of the options in an element of type="list": that is, that the element is a select list." @@ -8648,6 +8657,7 @@ COM_COMPONENTBUILDER_SZIP_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="%s, please wait!" +COM_COMPONENTBUILDER_S_S_NUMBER_BSB_COULD_NOT_BE_DOWNLOADED_SUCCESSFULLY_TO_THIS_JOOMLA_INSTALL="%s (%s) number %s could not be downloaded successfully to this Joomla Install!" 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" @@ -9029,6 +9039,7 @@ COM_COMPONENTBUILDER_WEBSITE_S="Website: %s" COM_COMPONENTBUILDER_WE_DID_NOT_CHECK_THE_SNIPPET_IT_SELF_TO_SEE_IF_IT_CHANGED_WE_ONLY_WORK_ON_DATES="We did not check the snippet it self, to see if it changed. We only work on dates." COM_COMPONENTBUILDER_WE_FAILED_TO_MOVE_BSB="We failed to move %s!" COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved %s!" +COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION="While we download all 26 compiler GIF animations randomly used in the compiler GUI during compilation" COM_COMPONENTBUILDER_YES="Yes" COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEYBR_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY="Your data is encrypted with a AES 128 bit encryption using the above 32 character key.
Without this key it will take the current technology with a brute force attack method more then 700 000 000 000 000 000 000 000 000 000 000 years to crack theoretically." COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY_WITHOUT_THIS_KEY_IT_WILL_TAKE_THE_CURRENT_TECHNOLOGY_WITH_A_BRUTE_FORCE_ATTACK_METHOD_MORE_THEN_A_HREFHTTPRANDOMIZECOMHOWLONGTOHACKPASS_TARGET_BLANK_TITLEHOW_LONG_TO_HACK_PASSSEVEN_HUNDRED_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZERO_ZEROA_YEARS_TO_CRACK_THEORETICALLY_UNLESS_THEY_HAVE_THIS_KEY_ABOVE_SO_DO_KEEP_IT_SAFE="Your data is encrypted with a AES 128 bit encryption using the above 32 character key. Without this key it will take the current technology with a brute force attack method more then 700 000 000 000 000 000 000 000 000 000 000 years to crack theoretically. Unless they have this key above, so do keep it safe." @@ -9037,6 +9048,7 @@ COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASH_AREA_AND_YOU_DONT_HAVE_ COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL="You can now select the component zip package you would like to import.
Please note that smart component import only works with the following format: (.zip)" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="You do not have permission to access the server details (%s - denied), please contact your system administrator for more info." COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to clone a component, please contact your system administrator for more help." +COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_DOWNLOAD_THE_COMPILER_ANIMATIONS="You do not have permission to download the compiler animations!" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to import a component, please contact your system administrator for more help." COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THESE_EXTENSIONS="You do not have permission to install these extensions!" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_COMPONENT="You do not have permission to install the component!" diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index e978432da..bc6fe0238 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -183,6 +183,8 @@ COM_COMPONENTBUILDER_COMPILER_ACCESS="Compiler Access" COM_COMPONENTBUILDER_COMPILER_ACCESS_DESC="Allows the users in this group to access compiler." COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS="Compiler Clear tmp Button Access" COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS_DESC="Allows the users in this group to access the clear tmp button." +COM_COMPONENTBUILDER_COMPILER_COMPILER_ANIMATIONS_BUTTON_ACCESS="Compiler Compiler Animations Button Access" +COM_COMPONENTBUILDER_COMPILER_COMPILER_ANIMATIONS_BUTTON_ACCESS_DESC="Allows the users in this group to access the compiler animations button." COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST="Compiler Dashboard List" COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Compiler" COM_COMPONENTBUILDER_COMPILER_RUN_EXPANSION_BUTTON_ACCESS="Compiler Run Expansion Button Access" diff --git a/admin/layouts/jcbnoticeboardtabs.php b/admin/layouts/jcbnoticeboardtabs.php index b95aa2c13..89df0ef83 100644 --- a/admin/layouts/jcbnoticeboardtabs.php +++ b/admin/layouts/jcbnoticeboardtabs.php @@ -15,15 +15,15 @@ defined('JPATH_BASE') or die('Restricted access'); ?> -
- 'vdm-noticeboard')) ?> - +
+ $displayData['active'] . '-noticeboard')) ?> + -
+
- + -
+
diff --git a/admin/models/compiler.php b/admin/models/compiler.php index c2ead97c4..75e025c42 100644 --- a/admin/models/compiler.php +++ b/admin/models/compiler.php @@ -156,6 +156,51 @@ class ComponentbuilderModelCompiler extends JModelList return $db->loadObjectList(); } + public function getCompilerAnimations(&$errorMessage) + { + // convert error message to array + $errorMessage = array(); + $searchArray = array( + // add banners (width - height) + 'banner' => array( + '728-90', + '160-600' + ), + // The build-gif by size (width - height) + 'builder-gif' => array( + '480-540' + ) + ); + // start search, and get + foreach ($searchArray as $type => $sizes) + { + // per size + foreach ($sizes as $size) + { + // get size + if (($set_size = ComponentbuilderHelper::getDynamicContentSize($type, $size)) !== 0) + { + // we loop over all type size artwork + for ($target = 1; $target <= $set_size; $target++) + { + if (!ComponentbuilderHelper::getDynamicContent($type, $size, false, 0, $target)) + { + $errorMessage[] = JText::sprintf('COM_COMPONENTBUILDER_S_S_NUMBER_BSB_COULD_NOT_BE_DOWNLOADED_SUCCESSFULLY_TO_THIS_JOOMLA_INSTALL', $type, $size, $target); + } + } + } + } + } + // check if we had any errors + if (ComponentbuilderHelper::checkArray($errorMessage)) + { + // flatten the error message array + $errorMessage = implode('
', $errorMessage); + return false; + } + return true; + } + public function builder($version, $id, $backup, $repo, $addPlaceholders, $debugLinenr, $minify) { $set['version'] = $version; diff --git a/admin/views/compiler/tmpl/default.php b/admin/views/compiler/tmpl/default.php index dc730b299..9dbaa950c 100644 --- a/admin/views/compiler/tmpl/default.php +++ b/admin/views/compiler/tmpl/default.php @@ -21,6 +21,9 @@ JHtml::_('behavior.keepalive'); $this->app->input->set('hidemainmenu', false); $selectNotice = '

' . JText::_('COM_COMPONENTBUILDER_HI') . ' ' . $this->user->name . '

'; $selectNotice .= '

' . JText::_('COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE') . '

'; + +// set the noticeboard options +$noticeboardOptions = array('vdm', 'pro'); ?> canDo->get('compiler.access')): ?>
@@ -67,6 +70,9 @@ Joomla.submitbutton = function(task, key) } else if (task == 'compiler.clearTmp'){ jQuery('#clear').show(); jQuery('#loading').css('display', 'block'); + } else if (task == 'compiler.getCompilerAnimations'){ + jQuery('#get-compiler-animations').show(); + jQuery('#loading').css('display', 'block'); } else { jQuery('#loading').css('display', 'block'); } @@ -144,24 +150,30 @@ jQuery('
')
- + 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])) ?>
+ diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index c2e57ab42..356e1a3b3 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -37,8 +37,37 @@ class ComponentbuilderViewCompiler extends JViewLegacy JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=compiler'); $this->sidebar = JHtmlSidebar::render(); } - $this->Components = $this->get('Components'); - $this->form = $this->setForm(); + $this->Components = $this->get('Components'); + $this->form = $this->setForm(); + // set the compiler artwork from global settings + $this->builder_gif_size = $this->params->get('builder_gif_size', '480-272'); + // only run these checks if he has access + if ($this->canDo->get('compiler.compiler_animations')) + { + // if the new artwork is not being targeted hide download option of artwork + if ('480-540' !== $this->builder_gif_size) + { + $this->canDo->set('compiler.compiler_animations', false); + } + // we count of all the files are already there + else + { + // get all the gif files in the gif folder + $all_gifs = scandir(JPATH_ROOT . "/administrator/components/com_componentbuilder/assets/images/builder-gif"); + // check if we have any values + if (ComponentbuilderHelper::checkArray($all_gifs)) + { + // count number of files but remove the 2 dot values + $num_gifs = count($all_gifs) - 2; + // if we have more or the same number of files that are in the array, the we hide the download option + if ($num_gifs >= ComponentbuilderHelper::getDynamicContentSize('builder-gif', '480-540')) + { + $this->canDo->set('compiler.compiler_animations', false); + } + } + } + } + // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') @@ -346,6 +375,11 @@ class ComponentbuilderViewCompiler extends JViewLegacy // add Translate button. JToolBarHelper::custom('compiler.runTranslator', 'comments-2 custom-button-runtranslator', '', 'COM_COMPONENTBUILDER_TRANSLATE', false); } + if ($this->canDo->get('compiler.compiler_animations')) + { + // add Compiler Animations button. + JToolBarHelper::custom('compiler.getCompilerAnimations', 'download custom-button-getcompileranimations', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false); + } if ($this->canDo->get('compiler.clear_tmp')) { // add Clear tmp button. diff --git a/script.php b/script.php index c18c09ed3..0eaeece83 100644 --- a/script.php +++ b/script.php @@ -6612,7 +6612,7 @@ class com_componentbuilderInstallerScript $query = $db->getQuery(true); // Field to update. $fields = array( - $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"50","export_language_strings":"1","assets_table_fix":"1","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), + $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","builder_gif_size":"480-540","add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"50","export_language_strings":"1","assets_table_fix":"1","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), ); // Condition. $conditions = array( @@ -6629,7 +6629,7 @@ class com_componentbuilderInstallerScript { $rule_length = $db->loadResult(); // Check the size of the rules column - if ($rule_length <= 94240) + if ($rule_length <= 94400) { // Fix the assets table rules column size $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to MEDIUMTEXT by JCB';"; diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index e7d06c6a3..ee9c3e309 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -1980,23 +1980,23 @@ abstract class ComponentbuilderHelper array( 'url' => 'https://cdn.joomla.org/volunteers/joomla-heart-wide.gif', 'hash' => 'f857e3a38facaeac9eba3cffa912b620', - 'html' => 'Joomla! Volunteers Portal'), + 'html' => 'Joomla! Volunteers Portal'), array( 'url' => 'https://magazine.joomla.org/images/banners/JCM_2010_728x90.png', 'hash' => '4083c66f996279fd5a76adffc3a7d194', - 'html' => 'Joomla! Community Magazine | Because community matters...'), + 'html' => 'Joomla! Community Magazine | Because community matters...'), array( 'url' => 'https://www.joomlacomponentbuilder.com/images/banners/tlwebdesign_jcb_sponsor_728_90.png', 'hash' => 'd19be1f9f5b2049ff901096aafc246be', - 'html' => 'tlwebdesign a JCB sponsor | Because community matters...'), + 'html' => 'tlwebdesign a JCB sponsor | Because community matters...'), array( 'url' => 'https://www.joomlacomponentbuilder.com/images/banners/vdm_jcb_sponsor_728_90.gif', 'hash' => '84478dfa0cd880395815e0ee026812a4', - 'html' => 'VDM a JCB sponsor | Because community matters...'), + 'html' => 'VDM a JCB sponsor | Because community matters...'), array( 'url' => 'https://allmycms.com/images/banners/agerix/agerix-loves-jcb-728-90.gif', 'hash' => 'b24c0726aa809cdcc04bcffe7e1e1529', - 'html' => 'Agerix a JCB sponsor | Because community matters...') + 'html' => 'Agerix a JCB sponsor | Because community matters...') ), '160-600' => array( array( @@ -2011,6 +2011,15 @@ abstract class ComponentbuilderHelper ), // The build-gif by size (width - height) 'builder-gif' => array( + // original gif ;) + '480-272' => array( + array( + 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/original.gif', + 'hash' => '676e37a949add8f4573381195cd1061c', + 'html' => '' + ) + ), + // new gif artwork since 2021 '480-540' => array( array( 'url' => 'https://www.joomlacomponentbuilder.com/images/builder/1.gif', @@ -2112,55 +2121,90 @@ abstract class ComponentbuilderHelper ) ); + /** + * get the dynamic content array size + * + * @param string $type The type of content + * @param string $size The size of the content + * + * @return int on success number of items in array type,size + * + */ + public static function getDynamicContentSize($type, $size) + { + if (isset(self::$dynamicContent[$type]) && isset(self::$dynamicContent[$type][$size]) + && ($nr = self::checkArray(self::$dynamicContent[$type][$size]))) + { + return $nr; + } + return 0; + } + /** * get the dynamic content * * @param string $type The type of content * @param string $size The size of the content * @param mix $default The default to return + * @param int $try Retry tracker (when bigger then array size it stops) + * @param mix $getter The specific getter number (not zero based) * * @return string on success html string * */ - public static function getDynamicContent($type, $size, $default = '', $try = 0) + public static function getDynamicContent($type, $size, $default = '', $try = 1, $getter = null) { - if (isset(self::$dynamicContent[$type]) && isset(self::$dynamicContent[$type][$size]) - && ($nr = self::checkArray(self::$dynamicContent[$type][$size]))) + if (($nr = self::getDynamicContentSize($type, $size)) !== 0) { - // 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']) + // use specific getter + if ($getter) { - // 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); - } + $get = --$getter; + } + // get the random getter number + elseif ($nr > 1) + { + $get = (int) rand(0, --$nr); + } + else + { + $get = 0; + } + // get the current target if found + if (isset(self::$dynamicContent[$type][$size][$get])) + { + $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 array size times (unless specific getter is used) + elseif ($try <= $nr && !$getter) + { + // the first time around failed so we try again (the size of the array times) + return self::getDynamicContent($type, $size, $default, ++$try); + } + } + // return found content + return str_replace('[[[ROOT-URL]]]', JURI::root(), $target['html']); } - // return found content - return str_replace('[[[ROOT-URL]]]', JURI::root(), $target['html']); } return $default; }