From 9f30f30b9e42a6263aef4c735b04713af591f235 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 4 Nov 2022 22:18:05 +0200 Subject: [PATCH] Release search stable BETA. --- README.md | 8 +- admin/README.txt | 8 +- admin/assets/js/search.js | 191 ++++++++++++++---- .../en-GB/en-GB.com_componentbuilder.ini | 16 +- admin/models/ajax.php | 13 +- admin/views/search/tmpl/default.php | 36 +++- admin/views/search/view.html.php | 15 +- componentbuilder.xml | 6 +- componentbuilder_update_server.xml | 4 +- .../Compiler/Customcode/External.php | 4 +- .../Search/Abstraction/Engine.php | 12 +- .../Componentbuilder/Search/Agent/Search.php | 28 ++- .../src/Componentbuilder/Search/Config.php | 22 ++ .../Componentbuilder/Search/Engine/Basic.php | 3 + .../Componentbuilder/Search/Engine/Regex.php | 3 + .../Componentbuilder/Search/Service/Agent.php | 1 + script.php | 2 +- 17 files changed, 298 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index c51792fe5..e74691b70 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.10) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.11) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -140,11 +140,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 2nd November, 2022 -+ *Version*: 3.1.10 ++ *Last Build*: 4th November, 2022 ++ *Version*: 3.1.11 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **333951** ++ *Line count*: **334175** + *Field count*: **2004** + *File count*: **2183** + *Folder count*: **381** diff --git a/admin/README.txt b/admin/README.txt index c51792fe5..e74691b70 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.10) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.11) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -140,11 +140,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 2nd November, 2022 -+ *Version*: 3.1.10 ++ *Last Build*: 4th November, 2022 ++ *Version*: 3.1.11 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **333951** ++ *Line count*: **334175** + *Field count*: **2004** + *File count*: **2183** + *Folder count*: **381** diff --git a/admin/assets/js/search.js b/admin/assets/js/search.js index 5262954d8..c19d10da7 100644 --- a/admin/assets/js/search.js +++ b/admin/assets/js/search.js @@ -48,6 +48,11 @@ const doSearch = async (signal, tables) => { // start search timer startSearchTimer(); + // reset our global counters + fieldCount = 0; + lineCount = 0; + + // set our local counters let total = 0; let progress = tables.length; let index; @@ -68,23 +73,13 @@ const doSearch = async (signal, tables) => { if (abort_this_search_values) { break; } - const response = await fetch(Url + 'doSearch', options).then(response => { + const response = await fetch(UrlAjax + 'doSearch', options).then(response => { total++; - // calculate the percent - let percent = 100.0 * (total / progress); - // update the progress bar - searchProgressBarObject.style.width = percent.toFixed(2) + '%'; - searchProgressBarObject.innerHTML = percent.toFixed(2) + '%'; - // when complete hide the progress bar - if (progress == total) { - searchProgressBarObject.innerHTML = Joomla.JText._('COM_COMPONENTBUILDER_SEARCH_FINISHED_IN') + ' ' + getSearchLenght() + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_SECONDS'); - setTimeout(function () { - searchProgressObject.style.display = 'none'; - }, 3000); - } // return the json response if (response.ok) { return response.json(); + } else { + UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE') + ' ' + tableName, {pos:'top-right', status:'danger'}); } }).then((data) => { if (typeof data.success !== 'undefined') { @@ -95,8 +90,35 @@ const doSearch = async (signal, tables) => { if (typeof data.items !== 'undefined') { addTableItems(resultsTable, data.items, typeSearch); } + if (typeof data.fields_count !== 'undefined') { + fieldCount += data.fields_count; + } + if (typeof data.line_count !== 'undefined') { + lineCount += data.line_count; + } + // calculate the percent + let percent = 100.0 * (total / progress); + // update the progress bar + searchProgressBarObject.style.width = percent.toFixed(2) + '%'; + searchProgressBarObject.innerHTML = percent.toFixed(2) + '%'; + // when complete hide the progress bar + if (progress == total) { + let total_field_line = ' ' + fieldCount + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_FIELDS_THAT_HAD') + ' ' + lineCount + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_LINES') + ' '; + if (progress == 1) { + searchProgressBarObject.innerHTML = Joomla.JText._('COM_COMPONENTBUILDER_SEARCHING') + ' ' + tableName + total_field_line + Joomla.JText._('COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN') + ' ' + getSearchLenght() + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_SECONDS'); + } else { + searchProgressBarObject.innerHTML = Joomla.JText._('COM_COMPONENTBUILDER_SEARCHING') + ' ' + progress + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_TABLES_WITH') + total_field_line + Joomla.JText._('COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN') + ' ' + getSearchLenght() + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_SECONDS'); + } + setTimeout(function () { + // hide the progress bar again + searchProgressObject.style.display = 'none'; + }, 13000); + } }).catch(error => { console.log(error); + if (error.name === "AbortError") { + abort_this_search_values = true; + } }); } } catch (error) { @@ -129,7 +151,7 @@ const getSearchLenght = () => { // get seconds return Math.round(timeDiff); -} +}; /** * JS Function to fetch selected item @@ -154,12 +176,12 @@ const getSelectedItem = async (table, row, field, line) => { // get search value if (mode == 1) { // calling URL - postURL = Url + 'getSearchValue'; + postURL = UrlAjax + 'getSearchValue'; } else { // add the line value formData.append('line_nr', line); // calling URL - postURL = Url + 'getReplaceValue'; + postURL = UrlAjax + 'getReplaceValue'; } let options = { @@ -198,28 +220,23 @@ const replaceAllCheck = () => { Joomla.JText._('COM_COMPONENTBUILDER_ARE_YOU_THEREFORE_ABSOLUTELY_SURE_YOU_WANT_TO_CONTINUE'); // do check UIkit.modal.confirm(question, function () { - // we clear the table again - clearAll(); // show the search settings again showSearch(); - // clear search values - clearSearch(); - // Create new controller and issue new request - controller = new AbortController(); + controller_replace = new AbortController(); // check if any specific table was set let tables = []; let table = tableObject.value; if (table != -1) { tables.push(table); - replaceAll(controller.signal, tables); + replaceAll(controller_replace.signal, tables); } else { - replaceAll(controller.signal, searchTables); + replaceAll(controller_replace.signal, searchTables); } - }); + }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES_UPDATE_ALL'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }}); }; /** @@ -230,31 +247,38 @@ const replaceAll = async (signal, tables) => { // build form const formData = new FormData(); - // load the result table - const resultsTable = new DataTable('#search_results_table'); - // get the search mode let typeSearch = modeObject.querySelector('input[type=\'radio\']:checked').value; // set some search values let searchValue = searchObject.value; let replaceValue = replaceObject.value; + let matchValue = matchObject.checked ? 1 : 0; + let wholeValue = wholeObject.checked ? 1 : 0; + let regexValue = regexObject.checked ? 1 : 0; // add the form data formData.append('table_name', ''); formData.append('type_search', typeSearch); formData.append('search_value', searchValue); formData.append('replace_value', replaceValue); - formData.append('match_case', matchObject.checked ? 1 : 0); - formData.append('whole_word', wholeObject.checked ? 1 : 0); - formData.append('regex_search', regexObject.checked ? 1 : 0); + formData.append('match_case', matchValue); + formData.append('whole_word', wholeValue); + formData.append('regex_search', regexValue); + + // reset the progress bar + replaceProgressBarObject.style.width = '0%'; + + // show the progress bar + replaceProgressObject.style.display = ''; let abort_this_replace_values = false; let total = 0; + let progress = tables.length; let index; - for (index = 0; index < tables.length; index++) { + for (index = 0; index < progress; index++) { let tableName = tables[index]; @@ -270,10 +294,12 @@ const replaceAll = async (signal, tables) => { if (abort_this_replace_values) { break; } - const response = await fetch(Url + 'replaceAll', options).then(response => { + const response = await fetch(UrlAjax + 'replaceAll', options).then(response => { total++; if (response.ok) { return response.json(); + } else { + UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE') + ' ' + tableName, {pos:'top-right', status:'danger'}); } }).then((data) => { if (typeof data.success !== 'undefined') { @@ -281,8 +307,44 @@ const replaceAll = async (signal, tables) => { } else if (typeof data.error !== 'undefined') { UIkit.notify(data.error, {pos:'bottom-right', timeout : 200}); } + // calculate the percent + let percent = 100.0 * (total / progress); + // update the progress bar + replaceProgressBarObject.style.width = percent.toFixed(2) + '%'; + // when complete hide the progress bar + if (progress == total) { + setTimeout(function () { + // hide the progress bar again + replaceProgressObject.style.display = 'none'; + // we clear the table again + clearAll(); + // if not reqex we reverse the search for you so you can see the update was a success + if (regexValue == 0) { + // set the replace value as the search value + UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH'), function(){ + setSearch(replaceValue, searchValue, matchValue, wholeValue, regexValue, 2); + }, function () { + UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH'), function(){ + onChange(); + }, function () { + clearSearch(); + }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }}); + }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }}); + } else { + // else we search it again just to prove its changed + UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH'), function(){ + onChange(); + }, function () { + clearSearch(); + }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }}); + } + }, 3000); + } }).catch(error => { console.log(error); + if (error.name === "AbortError") { + abort_this_replace_values = true; + } }); } } catch (error) { @@ -303,7 +365,7 @@ const setValueCheck = (row, field, table) => { // do check UIkit.modal.confirm(question, function () { setValue(row, field, table); - }); + }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }}); }; /** @@ -327,7 +389,7 @@ const setValue = async (row, field, table) => { body: formData } - const response = await fetch(Url + 'setValue', options).then(response => { + const response = await fetch(UrlAjax + 'setValue', options).then(response => { if (response.ok) { return response.json(); } @@ -382,7 +444,7 @@ const addSelectedItem = async (value, table, row, field, line) => { buttonUpdateItemObject.style.display = 'none'; } } -} +}; /** * JS Function to clear item from the editor and hide it @@ -399,7 +461,7 @@ const clearSelectedItem = async () => { itemLineNumberObject.innerHTML = '...'; // clear update button buttonUpdateItemObject.setAttribute('onclick', ''); -} +}; /** * JS Function to clear table items @@ -410,7 +472,7 @@ const clearTableItems = async () => { // hide the update all items buttonUpdateAllObject.style.display = 'none'; -} +}; /** * JS Function to clear all details of the search @@ -420,7 +482,7 @@ const clearAll = async () => { clearTableItems(); clearSelectedItem(); searchedObject.innerHTML = '....'; -} +}; /** * JS Function to clear the search and replace values @@ -429,7 +491,54 @@ const clearSearch = async () => { // clear the search and replace values searchObject.value = ''; replaceObject.value = ''; -} +}; + +/** + * JS Function to set the search and replace values + */ +const setSearch = async (search, replace = '', match = 0, whole = 0, regex = 0, mode = 1) => { + // update the type of search + if (mode == 1) { + window.location.href = UrlSearch + + '&search_value=' + search + + '&type_search=1&match_case=' + match + + '&whole_word=' + whole + + '®ex_search=' + regex; + } else if (mode == 2) { + window.location.href = UrlSearch + + '&search_value=' + search + + '&replace_value=' + replace + + '&type_search=2&match_case=' + match + + '&whole_word=' + whole + + '®ex_search=' + regex; + } +}; + +/** + * JS Function to check if a element has a class + */ + const hasClass = (elementObject, classNaam) => { + return !!elementObject.className.match(new RegExp('(\\s|^)' + classNaam + '(\\s|$)')); +}; + +/** + * JS Function add a class from an element + */ +const addClass = (elementObject, classNaam) => { + if (!hasClass(elementObject, classNaam)) { + elementObject.className += " " + classNaam; + } +}; + +/** + * JS Function remove a class from an element + */ +const removeClass = (elementObject, classNaam) => { + if (hasClass(elementObject, classNaam)) { + var reg = new RegExp('(\\s|^)' + classNaam + '(\\s|$)'); + elementObject.className = elementObject.className.replace(reg, ' '); + } +}; /** * JS Function to add items to the table @@ -441,7 +550,7 @@ const addTableItems = async (table, items, typeSearch) => { } else { buttonUpdateAllObject.style.display = 'none'; // TODO should only show once all items are loaded } -} +}; /** * JS Function to execute (A) on search/replace text change , (B) on search options changes diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 14dfa3342..63205ffae 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1302,6 +1302,7 @@ COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER="Already selected, try another COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO="Already translated into" COM_COMPONENTBUILDER_ALWAYS_ADD="Always Add" COM_COMPONENTBUILDER_ALWAYS_INSURE_THAT_YOU_HAVE_YOUR_LOCAL_COMPONENTS_BACKED_UP_BY_MAKING_AN_EXPORT_OF_ALL_YOUR_LOCAL_COMPONENTS_BEFORE_IMPORTING_ANY_NEW_COMPONENTS_SMALLMAKE_BSUREB_TO_MOVE_THIS_ZIPPED_BACKUP_PACKAGE_OUT_OF_THE_TMP_FOLDER_BEFORE_DOING_AN_IMPORTSMALLBR_IF_YOU_ARE_IMPORTING_A_PACKAGE_OF_A_THREERD_PARTY_JCB_PACKAGE_DEVELOPER_BMAKE_SURE_IT_IS_A_REPUTABLE_JCB_PACKAGE_DEVELOPERSB_A_SFIND_OUT_WHYA="Always insure that you have your local components backed up, by making an export of all your local components before importing any new components. (Make SURE to move this zipped backup package out of the tmp folder before doing an import)
If you are importing a package of a 3rd party JCB package developer, make sure it is a reputable JCB package developers! Find out why!" +COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN="and finished the search in" COM_COMPONENTBUILDER_ANY_LANGUAGE="Any language" COM_COMPONENTBUILDER_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST="Any Selection (only 4 list/radio/checkboxes/dynamic_list)" COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED="An error has occurred" @@ -4722,7 +4723,7 @@ COM_COMPONENTBUILDER_EMOWNEREM_BSB="Owner: %s" COM_COMPONENTBUILDER_EMPTY_TRASH="Empty trash" COM_COMPONENTBUILDER_EMWEBSITEEM_BSB="Website: %s" COM_COMPONENTBUILDER_ENTER_YOUR_REPLACE_TEXT="Enter your replace text" -COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT="Enter your search text." +COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT="Enter your search text" COM_COMPONENTBUILDER_EQUAL="Equal" COM_COMPONENTBUILDER_EQUAL_MEANS_THAT_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_AND_YOUR_LOCAL_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_THE_SAME_BCREATIONB_AND_BMODIFIED_DATEB="Equal means that the community snippet (with the same name, library and type) and your local snippet (with the same name, library and type) has the same creation and modified date." COM_COMPONENTBUILDER_ERROR="Error" @@ -4795,6 +4796,7 @@ COM_COMPONENTBUILDER_FIELDS_N_ITEMS_UNPUBLISHED="%s Fields unpublished." COM_COMPONENTBUILDER_FIELDS_N_ITEMS_UNPUBLISHED_1="%s Field unpublished." COM_COMPONENTBUILDER_FIELDS_SUBMENU="Fields Submenu" COM_COMPONENTBUILDER_FIELDS_SUBMENU_DESC="Allows the users in this group to submenu of field" +COM_COMPONENTBUILDER_FIELDS_THAT_HAD="fields that had" COM_COMPONENTBUILDER_FIELDTYPE="Fieldtype" COM_COMPONENTBUILDER_FIELDTYPES="Fieldtypes" COM_COMPONENTBUILDER_FIELDTYPES_ACCESS="Fieldtypes Access" @@ -7753,6 +7755,7 @@ COM_COMPONENTBUILDER_LIBRARY_VERSION_LABEL="Version" COM_COMPONENTBUILDER_LICENSE="License" COM_COMPONENTBUILDER_LICENSE_S="License: %s" COM_COMPONENTBUILDER_LINE="line" +COM_COMPONENTBUILDER_LINES="lines" COM_COMPONENTBUILDER_LINK="Link" COM_COMPONENTBUILDER_LINK_LOCAL_DYNAMIC="Link & Local (dynamic)" COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR="Link to the contributor" @@ -8164,6 +8167,7 @@ COM_COMPONENTBUILDER_REMOVING_ALL_ZIP_PACKAGES_FROM_THE_TEMPORARY_FOLDER_OF_THE_ COM_COMPONENTBUILDER_RENAME="Rename" COM_COMPONENTBUILDER_REPLACE="Replace" COM_COMPONENTBUILDER_REPLACED_WITH="replaced with" +COM_COMPONENTBUILDER_REPLACE_PROCESS_COMPLETE="replace process complete" 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." COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_TO_BE_A_TELEPHONE_NUMBER_COMPLYING_WITH_THE_STANDARDS_OF_NANPA_ITUT_TRECEONE_HUNDRED_AND_SIXTY_FOUR_OR_IETF_RFCFOUR_THOUSAND_NINE_HUNDRED_AND_THIRTY_THREE="Requires the value to be a Telephone number complying with the standards of nanpa, ITU-T T-REC-E.164 or ietf rfc4933." @@ -8180,13 +8184,13 @@ COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER COM_COMPONENTBUILDER_SEARCH="Search" COM_COMPONENTBUILDER_SEARCHABLE="Searchable" COM_COMPONENTBUILDER_SEARCHED_FOR="searched for" +COM_COMPONENTBUILDER_SEARCHING="searching" COM_COMPONENTBUILDER_SEARCH_ACCESS="Search Access" COM_COMPONENTBUILDER_SEARCH_ACCESS_DESC="Allows the users in this group to access search." COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS="Search Compiler Button Access" COM_COMPONENTBUILDER_SEARCH_COMPILER_BUTTON_ACCESS_DESC="Allows the users in this group to access the compiler button." COM_COMPONENTBUILDER_SEARCH_DATABASE_AGAIN="Search Database Again" COM_COMPONENTBUILDER_SEARCH_DESC="JCB Search" -COM_COMPONENTBUILDER_SEARCH_FINISHED_IN="Search finished in" COM_COMPONENTBUILDER_SEARCH_OR_SEARCH_AND_REPLACE="Search, or Search and Replace" COM_COMPONENTBUILDER_SEARCH_SUBMENU="Search Submenu" COM_COMPONENTBUILDER_SEARCH_SUBMENU_DESC="Allows the users in this group to submenu of Search" @@ -9032,6 +9036,7 @@ COM_COMPONENTBUILDER_S_WE_DETECTED_BNEW_EXTERNALCODEB_BUT_YOU_DO_NOT_HAVE_PERMIS COM_COMPONENTBUILDER_TAB="Tab" COM_COMPONENTBUILDER_TABLE="Table" COM_COMPONENTBUILDER_TABLES="Tables" +COM_COMPONENTBUILDER_TABLES_WITH="tables with" 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_TABLE_BSB_NOT_FOUND_IN_THE_LOCAL_DATABASE_SO_ITS_VALUES_COULD_NOT_BE_IMPORTED_THE_WHOLE_POWERS_FEATURE_IS_ONLY_AVAILABLE_TO_A_HREFSPRO_MEMBERSA_AT_THIS_TIME="Table %s not found in the local database so its values could not be imported. The whole powers feature is only available to PRO Members at this time." COM_COMPONENTBUILDER_TARGET_BEHAVIOUR="Target Behaviour" @@ -9184,6 +9189,7 @@ COM_COMPONENTBUILDER_THE_BSB_LIBRARY_CAN_NOT_BE_DELETED_OR_THINGS_WILL_BREAK="Th COM_COMPONENTBUILDER_THE_BSB_RETURNED_AN_INVALID_STRING="The %s returned an invalid string!" 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_CHANGES_YOU_MAKE_HERE_CAN_NOT_BE_UNDONE_THEREFORE_YOU_MUST_ALWAYS_USE_THE_UPDATE_AND_REPLACE_FEATURES_WITH_GREAT_CAUTION_SEARCH_FEATURE_IS_IN_BETA_STAGE="The changes you make here can not be undone, therefore you must always use the update and replace features with great caution. Search feature is in BETA stage." COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_ADDED_FOR_THE_BFIRST_TIMEB_PLEASE_IINVESTIGATEI_TO_ENSURE_THE_CORRECT_CODESTRING_WAS_USED_BSHOULD_YOU_NOT_KNOW_ABOUT_THIS_NEW_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_DANGER_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been added for the first time. Please investigate to ensure the correct code/string was used! Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention! Do not ignore this warning as it will only show once." COM_COMPONENTBUILDER_THE_CODESTRING_FROM_BSB_HAS_BEEN_BCHANGEDB_SINCE_THE_LAST_COMPILATION_PLEASE_INVESTIGATE_TO_ENSURE_THE_CHANGES_ARE_SAFE_BSHOULD_YOU_NOT_EXPECT_THIS_CHANGE_TO_THE_EXTERNAL_CODESTRING_BEING_ADDED_THEN_THIS_IS_A_SERIOUS_ISSUE_AND_REQUIRES_IMMEDIATE_ATTENTIONB_DO_NOT_IGNORE_THIS_WARNING_AS_IT_WILL_ONLY_SHOW_BONCEB="The code/string from %s has been changed since the last compilation. Please investigate to ensure the changes are safe! Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention! Do not ignore this warning as it will only show once." COM_COMPONENTBUILDER_THE_COMPONENT="The Component" @@ -9218,7 +9224,9 @@ COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER="T COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for %s server!" COM_COMPONENTBUILDER_THE_PRO_BOARD_IS_LOADING="The pro board is loading" COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading" +COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE="The replace process had an error with table" COM_COMPONENTBUILDER_THE_SEARCH_FOR_THE_SNIPPETS_ARE_CASE_SENSITIVE_SO_IF_YOU_CHANGED_THE_LOCAL_BNAMESB_OF_EITHER_OR_THE_BSNIPPET_LIBRARY_OR_SNIPPET_TYPESB_IN_ANY_SMALL_WAY_THE_SYSTEM_WILL_NOT_BE_ABLE_TO_CONNECT_YOUR_LOCAL_SNIPPETS_WITH_THOSE_IN_THE_COMMUNITY_REPOSITORY_SO_WE_STRONGLY_ADVICE_TO_BKEEP_TO_THE_COMMUNITY_NAMINGB_TO_AVOID_MISMATCHING_THAT_WILL_IN_TURN_CAUSE_DUPLICATION_SO_IF_YOU_CHANGED_ANY_NAMES_JUST_CHANGE_THEM_BACK_AND_ALL_WILL_AGAIN_WORK_AS_EXPECTED="The search for the snippets are case sensitive so if you changed the local names of either or the snippet, library or snippet types in any small way, the system will not be able to connect your local snippets with those in the community repository. So we strongly advice to keep to the community naming to avoid mismatching, that will in turn cause duplication. So if you changed any names, just change them back and all will again work as expected." +COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE="The search process had an error with table" COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED="The server details for (ID: %s) could not be retrieved!" COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED="The Snippets Were Successfully Exported!" COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED="The Snippet Was Successfully Exported!" @@ -9228,7 +9236,6 @@ 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_CAN_ONLY_BE_LOADED_WHEN_YOUR_JCB_SYSTEM_HAS_INTERNET_CONNECTION="The wiki can only be loaded when your JCB system has internet connection." COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading" -COM_COMPONENTBUILDER_THIS_AREA_IS_STILL_UNDER_DEVELOPMENT_ALTHOUGH_IT_WORKS_IT_SHOULD_BE_USED_WITH_EXTREME_CAUTION_AS_ITS_NOT_STABLE="This area is still under development, although it works, it should be used with extreme caution as its not stable." 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_CAN_NOT_BE_UNDONE_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="This can not be undone, are you sure you want to continue?" COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_BYOU_HAVE_BEEN_WARNEDB="This can not be undone, you have been warned!" @@ -9427,7 +9434,10 @@ 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_WHOLE_WORD="Whole Word" COM_COMPONENTBUILDER_WIKI="Wiki" +COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH="Would you like to do a reverse search?" +COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH="Would you like to repeat the same search?" COM_COMPONENTBUILDER_YES="Yes" +COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL" COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_REPLACE_BALLB_SEARCH_RESULTS="Your are about to replace ALL search results." COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW="Your are about to update row" COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_ONE_HUNDRED_AND_TWENTY_EIGHT_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 128 bit encryption using the above 32 character key." diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 77c88be23..131fea076 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -3639,10 +3639,19 @@ class ComponentbuilderModelAjax extends ListModel if (($items = SearchFactory::_('Agent')->table($tableName)) !== null) { - return ['success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName), 'items' => $items]; + return [ + 'success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName), + 'items' => $items, + 'fields_count' => SearchFactory::_('Config')->field_counter, + 'line_count' => SearchFactory::_('Config')->line_counter + ]; } - return ['not_found' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S', $tableName)]; + return [ + 'not_found' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S', $tableName), + 'fields_count' => SearchFactory::_('Config')->field_counter, + 'line_count' => SearchFactory::_('Config')->line_counter + ]; } catch(Exception $error) { diff --git a/admin/views/search/tmpl/default.php b/admin/views/search/tmpl/default.php index 0b7c35392..fa0bfe9c4 100644 --- a/admin/views/search/tmpl/default.php +++ b/admin/views/search/tmpl/default.php @@ -17,9 +17,12 @@ JHtml::_('behavior.formvalidator'); JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); +// allow main menu selection $this->app->input->set('hidemainmenu', false); -$selectNotice = '

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

'; -$selectNotice .= '

' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT') . '

'; + +// set the basu URL +$url_base = JUri::base() . 'index.php?option=com_componentbuilder'; +$url_search = $url_base . '&view=search'; ?> canDo->get('search.access')): ?> item->id)) ? '&id='. (int) $this->item->id : ''; ?> -