Compare commits

...

3 Commits

36 changed files with 3044 additions and 402 deletions

View File

@ -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.9) 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,14 +140,14 @@ 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*: 23rd October, 2022
+ *Version*: 3.1.9
+ *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*: **332840**
+ *Line count*: **334175**
+ *Field count*: **2004**
+ *File count*: **2174**
+ *Folder count*: **378**
+ *File count*: **2183**
+ *Folder count*: **381**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -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.9) 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,14 +140,14 @@ 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*: 23rd October, 2022
+ *Version*: 3.1.9
+ *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*: **332840**
+ *Line count*: **334175**
+ *Field count*: **2004**
+ *File count*: **2174**
+ *Folder count*: **378**
+ *File count*: **2183**
+ *Folder count*: **381**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -10,4 +10,28 @@
/* CSS Document */
.selected {
background-color:#d7d8db !important
}
tr.selected td {
background-color:#d7d8db !important
}
tr {
cursor:pointer
}
.found_code {
color: #46a546;
font-weight: bolder;
}
.search_details_title {
font-size: large;
font-weight: bolder;
}
.small_column {
padding: 2px;
text-align: center;
}
th.small_column {
padding: 2px !important;
text-align: center !important;
}

File diff suppressed because it is too large Load Diff

View File

@ -67,8 +67,8 @@ class ComponentbuilderControllerAjax extends BaseController
$this->registerTask('fieldTypeProperties', 'ajax');
$this->registerTask('getFieldPropertyDesc', 'ajax');
$this->registerTask('getCodeGlueOptions', 'ajax');
$this->registerTask('searchTable', 'ajax');
$this->registerTask('updateTable', 'ajax');
$this->registerTask('doSearch', 'ajax');
$this->registerTask('replaceAll', 'ajax');
$this->registerTask('getSearchValue', 'ajax');
$this->registerTask('getReplaceValue', 'ajax');
$this->registerTask('setValue', 'ajax');
@ -1636,18 +1636,19 @@ class ComponentbuilderControllerAjax extends BaseController
}
}
break;
case 'searchTable':
case 'doSearch':
try
{
$table_nameValue = $jinput->get('table_name', NULL, 'WORD');
$type_searchValue = $jinput->get('type_search', 1, 'INT');
$search_valueValue = $jinput->get('search_value', NULL, 'RAW');
$match_caseValue = $jinput->get('match_case', 0, 'INT');
$whole_wordValue = $jinput->get('whole_word', 0, 'INT');
$regex_searchValue = $jinput->get('regex_search', 0, 'INT');
$component_idValue = $jinput->get('component_id', 0, 'INT');
if($table_nameValue && $user->id != 0 && $search_valueValue)
if($table_nameValue && $user->id != 0 && $type_searchValue && $search_valueValue)
{
$result = $this->getModel('ajax')->searchTable($table_nameValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue);
$result = $this->getModel('ajax')->doSearch($table_nameValue, $type_searchValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue);
}
else
{
@ -1682,7 +1683,7 @@ class ComponentbuilderControllerAjax extends BaseController
}
}
break;
case 'updateTable':
case 'replaceAll':
try
{
$table_nameValue = $jinput->get('table_name', NULL, 'WORD');
@ -1694,7 +1695,7 @@ class ComponentbuilderControllerAjax extends BaseController
$component_idValue = $jinput->get('component_id', 0, 'INT');
if($table_nameValue && $user->id != 0 && $search_valueValue)
{
$result = $this->getModel('ajax')->updateTable($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue);
$result = $this->getModel('ajax')->replaceAll($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue);
}
else
{
@ -1735,9 +1736,14 @@ class ComponentbuilderControllerAjax extends BaseController
$field_nameValue = $jinput->get('field_name', NULL, 'WORD');
$row_idValue = $jinput->get('row_id', NULL, 'INT');
$table_nameValue = $jinput->get('table_name', NULL, 'WORD');
if($field_nameValue && $user->id != 0 && $row_idValue && $table_nameValue)
$search_valueValue = $jinput->get('search_value', NULL, 'RAW');
$replace_valueValue = $jinput->get('replace_value', NULL, 'RAW');
$match_caseValue = $jinput->get('match_case', 0, 'INT');
$whole_wordValue = $jinput->get('whole_word', 0, 'INT');
$regex_searchValue = $jinput->get('regex_search', 0, 'INT');
if($field_nameValue && $user->id != 0 && $row_idValue && $table_nameValue && $search_valueValue)
{
$result = $this->getModel('ajax')->getSearchValue($field_nameValue, $row_idValue, $table_nameValue);
$result = $this->getModel('ajax')->getSearchValue($field_nameValue, $row_idValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue);
}
else
{

View File

@ -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. <small>(Make <b>SURE</b> to move this zipped backup package out of the tmp folder before doing an import)</small><br />If you are importing a package of a 3rd party JCB package developer, <b>make sure it is a reputable JCB package developers!</b> <a %s>Find out why!</a>"
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"
@ -1312,6 +1313,7 @@ COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE="Are you sure you w
COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET="Are you sure you would like to replace your local snippet with this JCB community snippet?"
COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET="Are you sure you would like to update your local snippet with this newer JCB community snippet?"
COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET="Are you sure you would like to update your local snippet with this older JCB community snippet?"
COM_COMPONENTBUILDER_ARE_YOU_THEREFORE_ABSOLUTELY_SURE_YOU_WANT_TO_CONTINUE="Are you therefore absolutely sure you want to continue?"
COM_COMPONENTBUILDER_AUTHOR="Author"
COM_COMPONENTBUILDER_AUTHOR_EMAIL="Author Email"
COM_COMPONENTBUILDER_AUTHOR_NAME="Author Name"
@ -4706,6 +4708,7 @@ COM_COMPONENTBUILDER_EDIT_CREATED_DATE="Edit Created Date"
COM_COMPONENTBUILDER_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date."
COM_COMPONENTBUILDER_EDIT_S="Edit %s"
COM_COMPONENTBUILDER_EDIT_S_FOR_THIS_S="Edit %s for this %s"
COM_COMPONENTBUILDER_EDIT_S_S_DIRECTLY="Edit %s (%s) directly"
COM_COMPONENTBUILDER_EDIT_VERSIONS="Edit Version"
COM_COMPONENTBUILDER_EDIT_VERSIONS_DESC="Allows users in this group to edit versions."
COM_COMPONENTBUILDER_EDIT_VIEW="Edit View"
@ -4720,7 +4723,7 @@ COM_COMPONENTBUILDER_EMOWNEREM_BSB="<em>Owner:</em> <b>%s</b>"
COM_COMPONENTBUILDER_EMPTY_TRASH="Empty trash"
COM_COMPONENTBUILDER_EMWEBSITEEM_BSB="<em>Website:</em> <b>%s</b>"
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 <b>creation</b> and <b>modified date</b>."
COM_COMPONENTBUILDER_ERROR="Error"
@ -4793,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"
@ -5034,6 +5038,7 @@ $mediumkey = ComponentbuilderHelper::getCryptKey('medium');
$medium = new FOFEncryptAes($mediumkey);"
COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_SAVE_MODEL_LABEL="Initiator<br /><small>on save model</small>"
COM_COMPONENTBUILDER_FIELD_INT="INT"
COM_COMPONENTBUILDER_FIELD_IN_THE="field in the"
COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEWS_FOOTER_DESCRIPTION="Add JavaScript for the list view that is loaded in the footer inside script tags. Do not add the script tags."
COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEWS_FOOTER_LABEL="Javascript (list view footer)"
COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_DESCRIPTION="Add JavaScript for the edit view that is loaded in the footer inside script tags. Do not add the script tags."
@ -5448,9 +5453,9 @@ COM_COMPONENTBUILDER_FOLDER_BSB_WAS_MOVED_TO_BSB="Folder <b>%s</b> was moved to
COM_COMPONENTBUILDER_FOLDER_BSB_WAS_NOT_MOVED_TO_BSB="Folder <b>%s</b> was not moved to <b>%s</b>"
COM_COMPONENTBUILDER_FORCE_LOCAL_UPDATE="Force Local Update"
COM_COMPONENTBUILDER_FORCE_THAT_THIS_JCB_PACKAGE_IMPORT_SEARCH_FOR_LOCAL_ITEMS_TO_BE_DONE_WITH_GUID_VALUE_ONLY_IF_BMERGEB_IS_SET_TO_YES_ABOVE="Force that this JCB package import (search for local items) to be done with GUID value only, if <b>Merge</b> is set to yes above."
COM_COMPONENTBUILDER_FOUND="Found"
COM_COMPONENTBUILDER_FOUND_TEXT="Found Text"
COM_COMPONENTBUILDER_FREEOPEN="Free/Open"
COM_COMPONENTBUILDER_FULL_TEXT="Full Text"
COM_COMPONENTBUILDER_FULL_WIDTH_IN_TAB="Full Width in Tab"
COM_COMPONENTBUILDER_FUNCTION_NAME_ALREADY_TAKEN_PLEASE_TRY_AGAIN="Function name already taken, please try again."
COM_COMPONENTBUILDER_GENERAL_OVERVIEW_OF_HOW_THINGS_WORK_BSB="General overview of how things work: <b>%s</b>"
@ -5493,6 +5498,7 @@ COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK="Great, this placeholder w
COM_COMPONENTBUILDER_GREAT_THIS_VALIDATION_RULE_NAME_S_WILL_WORK="Great, this validation rule name (%s) will work!"
COM_COMPONENTBUILDER_GROUP="group"
COM_COMPONENTBUILDER_HAS_METADATA="Has Metadata"
COM_COMPONENTBUILDER_HEADERS="Headers"
COM_COMPONENTBUILDER_HELP_DOCUMENT="Help Document"
COM_COMPONENTBUILDER_HELP_DOCUMENTS="Help Documents"
COM_COMPONENTBUILDER_HELP_DOCUMENTS_ACCESS="Help Documents Access"
@ -5617,6 +5623,7 @@ COM_COMPONENTBUILDER_HTWOWE_COULD_NOT_OPEN_THE_PACKAGEHTWOTHIS_COULD_BE_DUE_TO_T
COM_COMPONENTBUILDER_IAUTHORI_BSB="<i>Author:</i> <b>%s</b>"
COM_COMPONENTBUILDER_ICOMPANYI_BSB="<i>Company:</i> <b>%s</b>"
COM_COMPONENTBUILDER_ICON="Icon"
COM_COMPONENTBUILDER_ID="id"
COM_COMPONENTBUILDER_ID_MISMATCH_WAS_DETECTED_WITH_THE_SSSS_GUI_CODE_FIELD_SO_THE_PLACEHOLDER_WAS_NOT_SET="ID mismatch was detected with the %s.%s.%s.%s GUI code field. So the placeholder was not set."
COM_COMPONENTBUILDER_IEMAILI_BSB="<i>Email:</i> <b>%s</b>"
COM_COMPONENTBUILDER_IMPORT_BY_GUID_ONLY="Import by GUID only!"
@ -5683,6 +5690,7 @@ COM_COMPONENTBUILDER_ISOLATE="Isolate"
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_ITEM_CODE="Item Code"
COM_COMPONENTBUILDER_IWEBSITEI_BSB="<i>Website:</i> <b>%s</b>"
COM_COMPONENTBUILDER_JCB_COMMUNITY="JCB Community"
COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES="JCB Community Packages"
@ -7746,7 +7754,8 @@ COM_COMPONENTBUILDER_LIBRARY_VERSION_DESC="A count of the number of times this L
COM_COMPONENTBUILDER_LIBRARY_VERSION_LABEL="Version"
COM_COMPONENTBUILDER_LICENSE="License"
COM_COMPONENTBUILDER_LICENSE_S="License: %s"
COM_COMPONENTBUILDER_LINE="Line"
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"
@ -7801,7 +7810,7 @@ COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cr
COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND="No description found."
COM_COMPONENTBUILDER_NO_FILES_LINKED="No Files Linked"
COM_COMPONENTBUILDER_NO_FOUND="No Found"
COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_S="No instances where found %s"
COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S="No instances where found in %s"
COM_COMPONENTBUILDER_NO_ITEM_FOUND="No Item Found"
COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="No keys were found. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key."
COM_COMPONENTBUILDER_NO_LANGUAGES_FOUND="No Languages Found"
@ -8157,6 +8166,8 @@ 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_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: <b>%s</b>"
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=&quot;list&quot;: 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."
@ -8165,19 +8176,25 @@ COM_COMPONENTBUILDER_REVERT_ALL_AHEAD_SNIPPETS="Revert All Ahead Snippets"
COM_COMPONENTBUILDER_RIGHT_IN_TAB="Right in Tab"
COM_COMPONENTBUILDER_RIGHT_OF_TABS="Right of Tabs"
COM_COMPONENTBUILDER_RUN_EXPANSION="Run Expansion"
COM_COMPONENTBUILDER_SAVE_ALL_CHANGES_MADE_TO_THE_SELECTED_ITEM="Save all changes made to the selected item."
COM_COMPONENTBUILDER_SAVE_ITEM="Save Item"
COM_COMPONENTBUILDER_SAVE_SUCCESS="Great! Item successfully saved."
COM_COMPONENTBUILDER_SAVE_WARNING="The value already existed so please select another."
COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S="%s<br />You can add a <b>gitHub Access Token</b> to Componentbuilder global options to make authenticated requests to gitHub. An access token with only public access will do to retrieve %s."
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_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"
COM_COMPONENTBUILDER_SECONDS="seconds"
COM_COMPONENTBUILDER_SEE_ALL_IMPORT_INFO="See All Import Info"
COM_COMPONENTBUILDER_SELECTION="selection"
COM_COMPONENTBUILDER_SELECT_ADMIN_VIEW="Select Admin View"
@ -9019,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 <b>%s</b> 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 <b>%s</b> not found in the local database so its values could not be imported. The whole powers feature is only available to <a href=%s>PRO Members</a> at this time."
COM_COMPONENTBUILDER_TARGET_BEHAVIOUR="Target Behaviour"
@ -9171,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 <b>%s</b> 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 <b>Show in All List Views</b> option will Add this field to all list views, admin &amp; linked."
COM_COMPONENTBUILDER_THE_BSINGLE_FILTERB_SELECTION_OPTION_ALLOWS_THE_USER_TO_SELECT_JUST_ONE_VALUE_IN_THIS_FILTERFIELD="The <b>single filter</b> 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 <b>%s</b> has been added for the <b>first time</b>. Please <i>investigate</i> to ensure the correct code/string was used! <b>Should you not know about this NEW external code/string being added, then this is a serious danger! and requires immediate attention!</b> Do not ignore this warning as it will only show <b>once</b>."
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 <b>%s</b> has been <b>changed</b> since the last compilation. Please investigate to ensure the changes are safe! <b>Should you not expect this change to the external code/string being added, then this is a serious issue! and requires immediate attention!</b> Do not ignore this warning as it will only show <b>once</b>."
COM_COMPONENTBUILDER_THE_COMPONENT="The Component"
@ -9205,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 <b>%s</b> 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 <b>names</b> of either or the <b>snippet, library or snippet types</b> 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 <b>keep to the community naming</b> 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 <b>(ID: %s)</b> 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!"
@ -9215,8 +9236,9 @@ 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_AND_DOES_NOT_WORK="This area is still under development and does not work."
COM_COMPONENTBUILDER_THIS_BSB_IS_NOT_LINKED_TO_ANY_OTHER_AREAS_OF_JCB_AT_THIS_TIME="This <b>%s</b> 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, <b>you have been warned</b>!"
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 <b>PASSED</b> the checksum validation!<br /><br /><small>Manually also validate that the correct checksum was used.</small><br />This checksum: <b>%s</b> must be the same as the one found @ <a %s %s</a>"
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
@ -9292,7 +9314,9 @@ COM_COMPONENTBUILDER_TYPE_VALIDATION_RULE="Validation Rule"
COM_COMPONENTBUILDER_UNACTIVE_ONLY_FOUR_TEXT_FIELD="Unactive (only 4 text_field)"
COM_COMPONENTBUILDER_UNDERNEATH_TABS="Underneath Tabs"
COM_COMPONENTBUILDER_UPDATE="Update"
COM_COMPONENTBUILDER_UPDATE_ALL="Update All"
COM_COMPONENTBUILDER_UPDATE_ALL_DIVERGED_SNIPPETS="Update All Diverged Snippets"
COM_COMPONENTBUILDER_UPDATE_ALL_ITEMS_FOUND_WITH_THIS_DATABASE_SEARCH_WITH_THE_REPLACE_VALUE="Update all items found with this database search, with the replace value."
COM_COMPONENTBUILDER_UPDATE_ALL_OUT_DATED_SNIPPETS="Update All Out Dated Snippets"
COM_COMPONENTBUILDER_UP_TO_DATE="Up to date"
COM_COMPONENTBUILDER_USAGE="Usage"
@ -9410,7 +9434,12 @@ COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved <b>%s</b>!
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 <b>ALL</b> 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."
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 <a href="http://random-ize.com/how-long-to-hack-pass/" target="_blank" title="How long to hack pass">700 000 000 000 000 000 000 000 000 000 000</a> years to crack theoretically. Unless they have this key above, so do keep it safe."
COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items."

43
admin/layouts/rows.php Normal file
View File

@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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');
$headers = $displayData['headers'];
$items = $displayData['items'];
?>
<?php if (is_array($items)): ?>
<?php foreach ($items as $row => $values): ?>
<tr>
<?php foreach($values as $value): ?>
<td class=""><?php echo $value; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
<?php elseif (is_numeric($items) && is_array($headers)): ?>
<?php for( $row = 0; $row < $items; $row++): ?>
<tr class="">
<?php foreach($headers as $header): ?>
<td class="">&nbsp;&nbsp;</td>
<?php endforeach; ?>
</tr>
<?php endfor; ?>
<?php elseif (is_numeric($items) && is_numeric($headers)): ?>
<?php for( $row = 0; $row < $items; $row++): ?>
<tr class="">
<?php for( $column = 0; $column < $headers; $column++): ?>
<td class="">&nbsp;&nbsp;</td>
<?php endfor; ?>
</tr>
<?php endfor; ?>
<?php endif; ?>

72
admin/layouts/table.php Normal file
View File

@ -0,0 +1,72 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/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');
$table_id = (isset($displayData['id'])) ? $displayData['id'] : ComponentbuilderHelper::randomkey(7);
$name = (isset($displayData['name'])) ? $displayData['name'] : false;
$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [JText::_('COM_COMPONENTBUILDER_NO'), JText::_('COM_COMPONENTBUILDER_HEADERS'), JText::_('COM_COMPONENTBUILDER_FOUND')];
$items = (isset($displayData['items'])) ? $displayData['items'] : 6;
?>
<div class="uk-overflow-auto">
<table id="<?php echo $table_id; ?>" class="uk-table">
<thead>
<?php if (is_array($headers)): ?>
<?php if ($name): ?>
<tr>
<th colspan="<?php echo count($headers); ?>" style="text-align:center"><b><?php echo $name; ?></b></th>
</tr>
<?php endif; ?>
<tr>
<?php foreach($headers as $code_name => $header): ?>
<?php
if (is_numeric($code_name))
{
$code_name = ComponentbuilderHelper::safeString($header);
}
?>
<th data-name="<?php echo $code_name; ?>"><?php echo $header; ?></th>
<?php endforeach; ?>
</tr>
<?php elseif (is_numeric($headers)): ?>
<?php if ($name): ?>
<tr>
<th colspan="<?php echo (int) $headers; ?>" style="text-align:center"><b><?php echo $name; ?></b></th>
</tr>
<?php endif; ?>
<tr style="position: absolute; top: -9999px; left: -9999px;">
<?php for( $row = 0; $row < $headers; $row++): ?>
<th><?php echo ComponentbuilderHelper::safeString($row); ?></th>
<?php endfor; ?>
</tr>
<?php endif; ?>
</thead>
<tbody>
<?php echo JLayoutHelper::render('rows', ['headers' => $headers, 'items' => $items]); ?>
</tbody>
</table>
</div>
<?php
// Initialize the table if [init is not set], or [is true]
// To stop initialization set $displayData['init'] = false;
if (!isset($displayData['init']) || $displayData['init']) :
?>
<script type="text/javascript">
jQuery(document).ready(function() {
var <?php echo $table_id; ?> = jQuery('#<?php echo $table_id; ?>').DataTable({
paging: false,
select: true
});
});
</script>
<?php endif; ?>

View File

@ -3610,6 +3610,7 @@ class ComponentbuilderModelAjax extends ListModel
* Search for value in a table
*
* @param string $tableName The main table to search
* @param int $typeSearch The type of search being done
* @param string $searchValue The value to search for
* @param int $matchCase The switch to control match case
* @param int $wholeWord The switch to control whole word
@ -3619,26 +3620,43 @@ class ComponentbuilderModelAjax extends ListModel
* @return array|null
* @since 3.2.0
**/
public function searchTable(string $tableName, string $searchValue,
public function doSearch(string $tableName, int $typeSearch, string $searchValue,
int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array
{
// check if this is a valid table
if (SearchFactory::_('Table')->exist($tableName))
{
// load the configurations
SearchFactory::_('Config')->table_name = $tableName;
SearchFactory::_('Config')->search_value = $searchValue;
SearchFactory::_('Config')->match_case = $matchCase;
SearchFactory::_('Config')->whole_word = $wholeWord;
SearchFactory::_('Config')->regex_search = $regexSearch;
SearchFactory::_('Config')->component_id = $componentId;
if (($items = SearchFactory::_('Agent')->find()) !== null)
try
{
return ['success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName), 'items' => $items];
}
// load the configurations
SearchFactory::_('Config')->table_name = $tableName;
SearchFactory::_('Config')->type_search = $typeSearch;
SearchFactory::_('Config')->search_value = $searchValue;
SearchFactory::_('Config')->match_case = $matchCase;
SearchFactory::_('Config')->whole_word = $wholeWord;
SearchFactory::_('Config')->regex_search = $regexSearch;
SearchFactory::_('Config')->component_id = $componentId;
return ['success' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_S', $tableName)];
if (($items = SearchFactory::_('Agent')->table($tableName)) !== null)
{
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),
'fields_count' => SearchFactory::_('Config')->field_counter,
'line_count' => SearchFactory::_('Config')->line_counter
];
}
catch(Exception $error)
{
return ['error' => $error->getMessage()];
}
}
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
@ -3658,24 +3676,33 @@ class ComponentbuilderModelAjax extends ListModel
* @return array|null
* @since 3.2.0
**/
public function updateTable(string $tableName, string $searchValue, ?string $replaceValue = null,
public function replaceAll(string $tableName, string $searchValue, ?string $replaceValue = null,
int $matchCase, int $wholeWord, int $regexSearch, int $componentId): ?array
{
// check if this is a valid table
if (SearchFactory::_('Table')->exist($tableName))
{
// load the configurations
SearchFactory::_('Config')->table_name = $tableName;
SearchFactory::_('Config')->search_value = $searchValue;
SearchFactory::_('Config')->replace_value = $replaceValue;
SearchFactory::_('Config')->match_case = $matchCase;
SearchFactory::_('Config')->whole_word = $wholeWord;
SearchFactory::_('Config')->regex_search = $regexSearch;
SearchFactory::_('Config')->component_id = $componentId;
try
{
// load the configurations
SearchFactory::_('Config')->table_name = $tableName;
SearchFactory::_('Config')->search_value = $searchValue;
SearchFactory::_('Config')->replace_value = $replaceValue;
SearchFactory::_('Config')->match_case = $matchCase;
SearchFactory::_('Config')->whole_word = $wholeWord;
SearchFactory::_('Config')->regex_search = $regexSearch;
SearchFactory::_('Config')->component_id = $componentId;
SearchFactory::_('Agent')->replace();
return ['success' => JText::sprintf('COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED', $tableName)];
if (($number = SearchFactory::_('Agent')->replace()) !== 0)
{
return ['success' => JText::sprintf('COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED', $tableName)];
}
return ['not_found' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S', $tableName)];
}
catch(Exception $error)
{
return ['error' => $error->getMessage()];
}
}
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
}
@ -3686,18 +3713,42 @@ class ComponentbuilderModelAjax extends ListModel
* @param string $fieldName The field key
* @param int $rowId The item ID
* @param string $tableName The table
* @param string $searchValue The value to search for
* @param string|null $replaceValue The value to replace search value
* @param int $matchCase The switch to control match case
* @param int $wholeWord The switch to control whole word
* @param int $regexSearch The switch to control regex search
*
* @return array
* @since 3.2.0
**/
public function getSearchValue(string $fieldName, int $rowId, string $tableName): array
public function getSearchValue(string $fieldName, int $rowId, string $tableName,
string $searchValue, ?string $replaceValue = null, int $matchCase, int $wholeWord, int $regexSearch): array
{
// check if this is a valid table and field
if ($rowId > 0 && SearchFactory('Table')->exist($tableName, $fieldName) &&
($value = SearchFactory('Agent')->getValue($fieldName, $rowId, 0, $tableName)) !== null)
if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName))
{
// load the value
return ['value' => $value];
try
{
// load the configurations
SearchFactory::_('Config')->table_name = $tableName;
SearchFactory::_('Config')->type_search = 1;
SearchFactory::_('Config')->search_value = $searchValue;
SearchFactory::_('Config')->replace_value = $replaceValue;
SearchFactory::_('Config')->match_case = $matchCase;
SearchFactory::_('Config')->whole_word = $wholeWord;
SearchFactory::_('Config')->regex_search = $regexSearch;
if (($value = SearchFactory::_('Agent')->getValue($rowId, $fieldName, 0, $tableName)) !== null)
{
// load the value
return ['value' => $value];
}
}
catch(Exception $error)
{
return ['error' => $error->getMessage()];
}
}
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
}
@ -3722,20 +3773,28 @@ class ComponentbuilderModelAjax extends ListModel
string $searchValue, ?string $replaceValue = null, int $matchCase, int $wholeWord, int $regexSearch): array
{
// check if this is a valid table and field
if ($rowId > 0 && SearchFactory('Table')->exist($tableName, $fieldName))
if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName))
{
// load the configurations
SearchFactory::_('Config')->table_name = $tableName;
SearchFactory::_('Config')->search_value = $searchValue;
SearchFactory::_('Config')->replace_value = $replaceValue;
SearchFactory::_('Config')->match_case = $matchCase;
SearchFactory::_('Config')->whole_word = $wholeWord;
SearchFactory::_('Config')->regex_search = $regexSearch;
// load the value
if (($value = SearchFactory('Agent')->getValue($fieldName, $rowId, $line, $tableName, true)) !== null)
try
{
return ['value' => $value];
// load the configurations
SearchFactory::_('Config')->table_name = $tableName;
SearchFactory::_('Config')->type_search = 2;
SearchFactory::_('Config')->search_value = $searchValue;
SearchFactory::_('Config')->replace_value = $replaceValue;
SearchFactory::_('Config')->match_case = $matchCase;
SearchFactory::_('Config')->whole_word = $wholeWord;
SearchFactory::_('Config')->regex_search = $regexSearch;
// load the value
if (($value = SearchFactory::_('Agent')->getValue($rowId, $fieldName, $line, $tableName, true)) !== null)
{
return ['value' => $value];
}
}
catch(Exception $error)
{
return ['error' => $error->getMessage()];
}
}
return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')];
@ -3755,8 +3814,8 @@ class ComponentbuilderModelAjax extends ListModel
public function setValue($value, int $rowId, string $fieldName, string $tableName): array
{
// check if this is a valid table and field
if ($rowId > 0 && SearchFactory('Table')->exist($tableName, $fieldName) &&
SearchFactory('Agent')->setValue($value, $rowId, $fieldName, $tableName))
if ($rowId > 0 && SearchFactory::_('Table')->exist($tableName, $fieldName) &&
SearchFactory::_('Agent')->setValue($value, $rowId, $fieldName, $tableName))
{
return ['success' => JText::sprintf(
'<b>%s</b> (%s:%s) was successfully updated!',

View File

@ -148,6 +148,50 @@ class ComponentbuilderModelSearch extends ItemModel
return $this->_item[$pk];
}
/**
* Custom Method
*
* @return mixed item data object on success, false on failure.
*
*/
public function getUrlValues()
{
if (!isset($this->initSet) || !$this->initSet)
{
$this->user = JFactory::getUser();
$this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels();
$this->initSet = true;
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Get data
$data = [
'type_search' => SearchFactory::_('Config')->get('type_search', 1),
'search_value' => SearchFactory::_('Config')->get('search_value', ''),
'replace_value' => SearchFactory::_('Config')->get('replace_value', ''),
'match_case' => SearchFactory::_('Config')->get('match_case', 0),
'whole_word' => SearchFactory::_('Config')->get('whole_word', 0),
'regex_search' => SearchFactory::_('Config')->get('regex_search', 0)
];
if (empty($data))
{
return false;
}
// return data object.
return $data;
}
/**
* Get the uikit needed components
*

File diff suppressed because one or more lines are too long

View File

@ -16,11 +16,13 @@ JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
// allow main menu selection
$this->app->input->set('hidemainmenu', false);
$selectNotice = '<h3>' . JText::_('COM_COMPONENTBUILDER_HI') . ' ' . $this->user->name . '</h3>';
$selectNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT') . '</p>';
// set the basu URL
$url_base = JUri::base() . 'index.php?option=com_componentbuilder';
$url_search = $url_base . '&view=search';
?>
<?php if ($this->canDo->get('search.access')): ?>
<script type="text/javascript">
@ -37,8 +39,8 @@ $selectNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT')
</script>
<?php $urlId = (isset($this->item->id)) ? '&id='. (int) $this->item->id : ''; ?>
<div class="alert alert-info" role="alert">
<?php echo JText::_('COM_COMPONENTBUILDER_THIS_AREA_IS_STILL_UNDER_DEVELOPMENT_AND_DOES_NOT_WORK'); ?>
<div class="alert alert-warning" role="alert">
<?php echo JText::_('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'); ?>
</div>
<hr />
<?php if(!empty( $this->sidebar)): ?>
@ -50,37 +52,74 @@ $selectNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT')
<div id="j-main-container">
<?php endif; ?>
<?php if ($this->form): ?>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=search'); ?>" method="post"
<form action="<?php echo JRoute::_($url_search); ?>" method="post"
name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<div class="form-horizontal">
<div class="row-fluid">
<div class="span8">
<div class="row-fluid" id="search_progress_block" style="display: none">
<div class="uk-progress uk-progress-striped uk-active">
<div id="search_progress_bar" class="uk-progress-bar" style="width: 0%;">0%</div>
</div>
</div>
<div class="row-fluid" id="replace_progress_block" style="display: none">
<div class="uk-progress uk-progress-small uk-progress-danger uk-progress-striped uk-active">
<div id="replace_progress_bar" class="uk-progress-bar" style="width: 0%;"></div>
</div>
</div>
<div class="row-fluid" id="search_details_block" style="display: none">
<span id="search_details">
<span class="search_details_title"><?php echo JText::_('COM_COMPONENTBUILDER_SEARCHED_FOR'); ?></span>:
&nbsp;[<span id="searched" class="found_code">....</span>]&nbsp;&nbsp;&nbsp;&nbsp;
</span>
<span id="replace_details" style="display: none">
<span class="search_details_title"><?php echo JText::_('COM_COMPONENTBUILDER_REPLACED_WITH'); ?></span>:
&nbsp;[<span id="replaced" class="found_code">....</span>]
</span>
<button style="float: right;" type="button" onclick="showSearch();" class="btn button-new btn-success">
<span class="icon-search icon-white" aria-hidden="true"></span>
<?php echo JText::_('COM_COMPONENTBUILDER_SEARCH_DATABASE_AGAIN'); ?>
</button>
</div>
<div class="row-fluid" id="search_settings_block">
<div class="span7">
<?php echo $this->form->renderField('type_search'); ?>
<?php echo $this->form->renderField('search_value'); ?>
<?php echo $this->form->renderField('replace_value'); ?>
</div>
<div class="span3">
<div class="span4">
<?php echo $this->form->renderFieldset('settings'); ?>
</div>
</div>
<div class="row-fluid" id="search_view">
<div id="search-results-tbl-box">
<table id="search-results-tbl" class="table">
<thead>
<tr>
<th><?php echo JText::_('COM_COMPONENTBUILDER_FOUND_TEXT'); ?></th>
<th><?php echo JText::_('COM_COMPONENTBUILDER_TABLE'); ?></th>
<th><?php echo JText::_('COM_COMPONENTBUILDER_FIELD'); ?></th>
<th><?php echo JText::_('ID'); ?></th>
<th><?php echo JText::_('COM_COMPONENTBUILDER_LINE'); ?></th>
</tr>
</thead>
<tbody id="search-results-tbl-tbody"></tbody>
</table>
<div class="row-fluid" id="search_results_block">
<hr>
<div id="search_results_table_block">
<?php echo JLayoutHelper::render('table', ['id' => 'search_results_table', 'headers' => $this->table_headers, 'items' => 7, 'init' => false]); ?>
</div>
</div>
<div class="row-fluid" id="item_view" style="display: none;">
<?php echo $this->form->renderFieldset('view'); ?>
<div class="row-fluid" id="item_view_block">
<hr>
<div>
<span id="item_notice_block" style="display: none">
<span id="item_edit_button"></span>&nbsp;
<?php echo JText::_('COM_COMPONENTBUILDER_TABLE'); ?>:&nbsp;<b><span id="item_table_name">
</span></b>(<?php echo JText::_('COM_COMPONENTBUILDER_ID'); ?>:<b><span id="item_row_id">
</span></b>)&nbsp;|&nbsp;
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD'); ?>:&nbsp;<b><span id="item_field_name">
</span></b>(<?php echo JText::_('COM_COMPONENTBUILDER_LINE'); ?>:<b><span id="item_line_number">
</span></b>)&nbsp;&nbsp;&nbsp;
<button type="button" id="item_button_update" onclick="" class="hasTooltip btn btn-small button-new btn-success"
title="<?php echo JText::_('COM_COMPONENTBUILDER_SAVE_ALL_CHANGES_MADE_TO_THE_SELECTED_ITEM'); ?>">
<?php echo JText::_('COM_COMPONENTBUILDER_SAVE_ITEM'); ?>
</button>
</span>
<span id="update_all_block" style="display: none;">
<button style="float: right;" type="button" onclick="replaceAllCheck();" class="hasTooltip btn btn-small button-new btn-danger"
title="<?php echo JText::_('COM_COMPONENTBUILDER_UPDATE_ALL_ITEMS_FOUND_WITH_THIS_DATABASE_SEARCH_WITH_THE_REPLACE_VALUE'); ?>">
<?php echo JText::_('COM_COMPONENTBUILDER_UPDATE_ALL'); ?>
</button>
</span>
</div>
<hr>
<?php echo $this->form->getInput('item_code'); ?>
</div>
</div>
</form>
@ -88,14 +127,187 @@ $selectNotice .= '<p>' . JText::_('COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT')
</div>
<?php if (isset($this->item['tables']) && ComponentbuilderHelper::checkArray($this->item['tables'])) : ?>
<script>
var searchTables = json_encode($this->item['tables']);
// To class="uk-autoload uk-progress" UIkit.notify
const searchValueInp = document.getElementById("search_value");
const replaceValueInp = document.getElementById("replace_value");
const caseSensitiveLbl = document.getElementById("match_case_lbl");
const completeWordLbl = document.getElementById("whole_word_lbl");
const regexpSearchLbl = document.getElementById("regex_search_lbl");
let controller = null;
// get search table values
const searchTables = <?php echo json_encode($this->item['tables']); ?>;
// the search Ajax URLs
const UrlAjax = '<?php echo $url_base; ?>&format=json&raw=true&<?php echo JSession::getFormToken(); ?>=1&task=ajax.';
// the search URL
const UrlSearch = '<?php echo $url_search; ?>';
// make sure our controller is set
let controller = null;
let controller_replace = null;
// some counters
var fieldCount = 0;
var lineCount = 0;
// start search time keepers
var startSearchTime, endSearchTime;
// active edit button of row selected
var editButtonSelected;
// get search progress area
const searchProgressObject = document.getElementById("search_progress_block");
const searchProgressBarObject = document.getElementById("search_progress_bar");
const replaceProgressObject = document.getElementById("replace_progress_block");
const replaceProgressBarObject = document.getElementById("replace_progress_bar");
// get search settings area
const searchSettingsObject = document.getElementById("search_settings_block");
const searchDetailsObject = document.getElementById("search_details_block");
const searchedObject = document.getElementById("searched");
// get replace settings area
const replaceDetailsObject = document.getElementById("replace_details");
const replacedObject = document.getElementById("replaced");
// set the search mode objects
const modeObject = document.getElementById("type_search");
const typeSearchObject = document.getElementById("type_search0");
const typeReplaceObject = document.getElementById("type_search1");
const typeSearchLabelObject = document.querySelector('[for=type_search0]');
const typeReplaceLabelObject = document.querySelector('[for=type_search1]');
// set the search settings objects
const searchObject = document.getElementById("search_value");
const replaceObject = document.getElementById("replace_value");
const matchObject = document.getElementById("search_behaviour0");
const wholeObject = document.getElementById("search_behaviour1");
const regexObject = document.getElementById("search_behaviour2");
const tableObject = document.getElementById("table_name");
// Do the search on key up of search or replace input elements
searchObject.onkeyup = onChange;
// when the made changes and there is replace value do search
modeObject.onchange = onChange;
replaceObject.onkeyup = onChange;
// Do the search on key up of search input elements
matchObject.onchange = onChange;
wholeObject.onchange = onChange;
regexObject.onchange = onChange;
tableObject.onchange = onChange;
// set the item notice area
const itemNoticeObject = document.getElementById("item_notice_block");
const itemEditButtonObject = document.getElementById("item_edit_button");
const itemTableNameObject = document.getElementById("item_table_name");
const itemRowIdObject = document.getElementById("item_row_id");
const itemFieldNameObject = document.getElementById("item_field_name");
const itemLineNumberObject = document.getElementById("item_line_number");
// set the update buttons
const buttonUpdateItemObject = document.getElementById("item_button_update");
const buttonUpdateAllObject = document.getElementById("update_all_block");
// get the editor
var editorObject;
// set some global objects
document.addEventListener('DOMContentLoaded', function () {
// get the editor
editorObject = Joomla.editors.instances['item_code'];
});
// configurations of the table
const tableConfigObject = {
responsive: true,
order: [[ 2, "asc" ]],
select: true,
paging: true,
lengthMenu: [5, 10, 20 ,50, 80, 100, 150, 200, 500, 1000, 1500, 2000],
pageLength: 80,
scrollY: 170,
columnDefs: [
{ 'targets': [ 0 ], 'visible': false, 'searchable': false },
{ 'targets': [ 0, 1 ], type: 'html' },
{ responsivePriority: 1, targets: 1 },
{ responsivePriority: 2, targets: 2 },
{ responsivePriority: 3, targets: 3 }
],
columns: [
{
data: 'edit'
},
{
data: 'code'
},
{
data: 'table'
},
{
data: 'field'
},
{
data: 'id',
width: "15px",
className: "small_column"
},
{
data: 'line',
width: "15px",
className: "small_column"
}
]
};
// set some table object
var tableSearchObject;
var tableLengthObject;
var tableActiveObject;
// The Result Table Code
document.addEventListener('DOMContentLoaded', function () {
// init the table
let searchResultsTable = new DataTable('#search_results_table', tableConfigObject);
searchResultsTable.on( 'select', function ( e, dt, type, indexes ) {
if ( type === 'row' ) {
// get the data from the row
let data = searchResultsTable.rows( indexes ).data();
// get the item data
let item_id = data[0].id;
let item_table = data[0].table;
let item_field = data[0].field;
let item_line = data[0].line;
// set the active edit button
editButtonSelected = data[0].edit;
// set active row
tableActiveObject = searchResultsTable.row( indexes );
// get selected item
getSelectedItem(item_table, item_id, item_field, item_line);
// hide the search settings
hideSearch();
}
});
searchResultsTable.on( 'deselect', function ( e, dt, type, indexes ) {
if ( type === 'row' ) {
clearSelectedItem(false);
}
});
// set the table search object
tableSearchObject = document.getElementById("search_results_table_filter");
tableLengthObject = document.getElementById("search_results_table_length");
showSearch();
<?php if (strlen($this->urlvalues['search_value']) > 2): ?>
onChange();
<?php endif; ?>
});
</script>
<?php endif; ?>
<?php else: ?>

View File

@ -35,6 +35,7 @@ class ComponentbuilderViewSearch extends HtmlView
$this->canDo = ComponentbuilderHelper::getActions('search');
// Initialise variables.
$this->item = $this->get('Item');
$this->urlvalues = $this->get('UrlValues');
if ($this->getLayout() !== 'modal')
{
// Include helper submenu
@ -45,7 +46,39 @@ class ComponentbuilderViewSearch extends HtmlView
// get the needed form fields
$this->form = $this->getDynamicForm();
// build our table headers
$this->table_headers = array(
'edit' => 'E',
'code' => JText::_('COM_COMPONENTBUILDER_FOUND_TEXT'),
'table' => JText::_('COM_COMPONENTBUILDER_TABLE'),
'field' => JText::_('COM_COMPONENTBUILDER_FIELD'),
'id' => JText::_('ID'),
'line' => JText::_('COM_COMPONENTBUILDER_LINE')
);
// set some JavaScript Language
JText::script('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW');
JText::script('COM_COMPONENTBUILDER_FIELD_IN_THE');
JText::script('COM_COMPONENTBUILDER_TABLE');
JText::script('COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE');
JText::script('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_REPLACE_BALLB_SEARCH_RESULTS');
JText::script('COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_BYOU_HAVE_BEEN_WARNEDB');
JText::script('COM_COMPONENTBUILDER_ARE_YOU_THEREFORE_ABSOLUTELY_SURE_YOU_WANT_TO_CONTINUE');
JText::script('COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE');
JText::script('COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE');
JText::script('COM_COMPONENTBUILDER_REPLACE_PROCESS_COMPLETE');
JText::script('COM_COMPONENTBUILDER_SEARCHING');
JText::script('COM_COMPONENTBUILDER_TABLES_WITH');
JText::script('COM_COMPONENTBUILDER_FIELDS_THAT_HAD');
JText::script('COM_COMPONENTBUILDER_LINES');
JText::script('COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN');
JText::script('COM_COMPONENTBUILDER_SECONDS');
JText::script('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH');
JText::script('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH');
JText::script('COM_COMPONENTBUILDER_YES_UPDATE_ALL');
JText::script('COM_COMPONENTBUILDER_NO');
JText::script('COM_COMPONENTBUILDER_YES');
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')
@ -97,7 +130,7 @@ class ComponentbuilderViewSearch extends HtmlView
'label' => 'COM_COMPONENTBUILDER_MODE',
'class' => 'btn-group',
'description' => 'COM_COMPONENTBUILDER_SEARCH_OR_SEARCH_AND_REPLACE',
'default' => '1'];
'default' => $this->urlvalues['type_search']];
// set the mode options
$options = [
1 => 'COM_COMPONENTBUILDER_SEARCH',
@ -120,7 +153,8 @@ class ComponentbuilderViewSearch extends HtmlView
'filter' => 'RAW',
'class' => 'search-value span12',
'hint' => 'COM_COMPONENTBUILDER_ENTER_YOUR_SEARCH_TEXT',
'autocomplete' => true];
'autocomplete' => true,
'default' => $this->urlvalues['search_value']];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
@ -140,7 +174,8 @@ class ComponentbuilderViewSearch extends HtmlView
'class' => 'replace-value span12',
'hint' => 'COM_COMPONENTBUILDER_ENTER_YOUR_REPLACE_TEXT',
'autocomplete' => true,
'showon' => 'type_search:2'];
'showon' => 'type_search:2',
'default' => $this->urlvalues['replace_value']];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
@ -149,12 +184,28 @@ class ComponentbuilderViewSearch extends HtmlView
}
// Search Behaviour
$default = [];
if ($this->urlvalues['match_case'] == 1)
{
$default[] = 'match_case';
}
if ($this->urlvalues['whole_word'] == 1)
{
$default[] = 'whole_word';
}
if ($this->urlvalues['regex_search'] == 1)
{
$default[] = 'regex_search';
}
$attributes = [
'type' => 'checkboxes',
'name' => 'search_behaviour',
'label' => 'COM_COMPONENTBUILDER_BEHAVIOUR',
'class' => 'btn-group',
'description' => 'COM_COMPONENTBUILDER_SET_THE_SEARCH_BEHAVIOUR_HERE'];
if (ComponentbuilderHelper::checkArray($default))
{
$attributes['default'] = implode(',', $default);
}
// set the mode options
$options = [
'match_case' => 'COM_COMPONENTBUILDER_MATCH_CASE',
@ -220,11 +271,11 @@ class ComponentbuilderViewSearch extends HtmlView
// editor attributes
$attributes = [
'type' => 'editor',
'name' => 'full_text',
'label' => 'COM_COMPONENTBUILDER_FULL_TEXT',
'name' => 'item_code',
'label' => 'COM_COMPONENTBUILDER_ITEM_CODE',
'width' => '100%',
'height' => '450px',
'class' => 'full_text_editor',
'height' => '150px',
'class' => 'item_code_editor',
'syntax' => 'php',
'buttons' => 'false',
'filter' => 'raw',
@ -257,6 +308,12 @@ class ComponentbuilderViewSearch extends HtmlView
// Initialize the header checker.
$HeaderCheck = new componentbuilderHeaderCheck;
// always load these files.
$this->document->addStyleSheet(JURI::root(true) . "/media/com_componentbuilder/datatable/css/datatables.min.css", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/css");
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/pdfmake.min.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/vfs_fonts.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
$this->document->addScript(JURI::root(true) . "/media/com_componentbuilder/datatable/js/datatables.min.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
// Add View JavaScript File
$this->document->addScript(JURI::root(true) . "/administrator/components/com_componentbuilder/assets/js/search.js", (ComponentbuilderHelper::jVersion()->isCompatible("3.8.0")) ? array("version" => "auto") : "text/javascript");
@ -283,6 +340,7 @@ class ComponentbuilderViewSearch extends HtmlView
{
// Set the default uikit components in this view.
$uikitComp = array();
$uikitComp[] = 'UIkit.notify';
$uikitComp[] = 'uk-progress';
}

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="4" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>23rd October, 2022</creationDate>
<creationDate>4th November, 2022</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>3.1.9</version>
<version>3.1.11</version>
<description><![CDATA[
<h1>Component Builder (v.3.1.9)</h1>
<h1>Component Builder (v.3.1.11)</h1>
<div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
@ -39,6 +39,7 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
<folder>js</folder>
<folder>css</folder>
<folder>images</folder>
<folder>datatable</folder>
<folder>uikit-v2</folder>
<folder>footable-v3</folder>
</media>

View File

@ -1097,10 +1097,10 @@
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>3.1.9</version>
<version>3.1.11</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.9.zip</downloadurl>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.11.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>

View File

@ -255,7 +255,7 @@ class External implements ExternalInterface
))
{
// update the hash since it changed
$object = new stdClass();
$object = new \stdClass();
$object->target = $target_key;
$object->hash = $live_hash;
// update local hash
@ -296,7 +296,7 @@ class External implements ExternalInterface
))
{
// add the hash to track changes
$object = new stdClass();
$object = new \stdClass();
$object->target = $target_key;
$object->hash = $live_hash;
// insert local hash

View File

@ -108,6 +108,16 @@ abstract class Engine
// set end marker
$this->end = $this->config->marker_end;
}
/**
* we count every line being searched
*
* @since 3.2.0
*/
protected function lineCounter()
{
// we count every line we search
$this->config->line_counter = $this->config->line_counter + 1;
}
}

View File

@ -12,6 +12,7 @@
namespace VDM\Joomla\Componentbuilder\Search;
use Joomla\CMS\Language\Text;
use VDM\Joomla\Componentbuilder\Search\Factory;
use VDM\Joomla\Componentbuilder\Search\Config;
use VDM\Joomla\Componentbuilder\Search\Database\Get;
@ -20,6 +21,7 @@ use VDM\Joomla\Componentbuilder\Search\Agent\Find;
use VDM\Joomla\Componentbuilder\Search\Agent\Replace;
use VDM\Joomla\Componentbuilder\Search\Agent\Search;
use VDM\Joomla\Componentbuilder\Search\Agent\Update;
use VDM\Joomla\Componentbuilder\Search\Table;
/**
@ -85,21 +87,55 @@ class Agent
*/
protected Update $update;
/**
* Table
*
* @var Table
* @since 3.2.0
*/
protected Table $table;
/**
* Return value to search view
*
* @var string
* @since 3.2.0
*/
protected string $return;
/**
* Marker start and end values
*
* @var array
* @since 3.2.0
*/
protected array $marker;
/**
* Marker start and end html values
*
* @var array
* @since 3.2.0
*/
protected array $markerHtml;
/**
* Constructor
*
* @param Config|null $config The search config object.
* @param Get|null $get The search get database object.
* @param Set|null $set The search get database object.
* @param Find|null $find The search find object.
* @param Replace|null $replace The search replace object.
* @param Search|null $search The search object.
* @param Config|null $config The search config object.
* @param Get|null $get The search get database object.
* @param Set|null $set The search get database object.
* @param Find|null $find The search find object.
* @param Replace|null $replace The search replace object.
* @param Search|null $search The search object.
* @param Update|null $update The update object.
* @param Table|null $table The table object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Get $get = null,
?Set$set = null, ?Find $find = null, ?Replace $replace = null,
?Search $search = null, ?Update $update = null)
?Search $search = null, ?Update $update = null, ?Table $table = null)
{
$this->config = $config ?: Factory::_('Config');
$this->get = $get ?: Factory::_('Get.Database');
@ -108,23 +144,23 @@ class Agent
$this->replace = $replace ?: Factory::_('Agent.Replace');
$this->search = $search ?: Factory::_('Agent.Search');
$this->update = $update ?: Factory::_('Agent.Update');
$this->table = $table ?: Factory::_('Table');
}
/**
* Get the value of a field in a row and table
*
* @param mixed $value The field value
* @param int $id The item ID
* @param string $field The field key
* @param mixed $line The field line
* @param string|null $table The table
* @param bool $update The switch to triger an update (default is false)
*
* @return mixed
* @return string
* @since 3.2.0
*/
public function getValue(int $id, string $field, $line = null,
?string $table = null, bool $update = false)
?string $table = null, bool $update = false): string
{
// set the table name
if (empty($table))
@ -134,13 +170,19 @@ class Agent
if (($value = $this->get->value($id, $field, $table)) !== null)
{
// try to update the value if required
if ($update && ($updated_value = $this->update->value($value, $line)) !== null)
// we only return strings that can load in an editor
if (is_string($value))
{
return $updated_value;
// try to update the value if required
if ($update && ($updated_value = $this->update->value($value, $line)) !== null)
{
return $updated_value;
}
return $value;
}
return $value;
return '// VALUE CAN NOT BE LOADED (AT THIS TIME) SINCE ITS NOT A STRING';
}
return null;
@ -168,6 +210,48 @@ class Agent
return $this->set->value($value, $id, $field, $table);
}
/**
* Return Table Ready Search Results
*
* @param string|null $table The table being searched
*
* @return array|null
* @since 3.2.0
*/
public function table(?string $table = null): ?array
{
// set the table name
if (empty($table))
{
$table = $this->config->table_name;
}
if(($values = $this->find($table)) !== null)
{
// build return value
$this->setReturnValue();
// set the markers
$this->setMarkers();
// start table bucket
$table_rows = [];
foreach ($values as $id => $fields)
{
foreach ($fields as $field => $lines)
{
foreach ($lines as $line => $code)
{
$table_rows[] = $this->getRow($code, $table, $field, $id, $line);
}
}
}
return $table_rows;
}
return null;
}
/**
* Search the posted table for the search value and return all
*
@ -201,10 +285,10 @@ class Agent
*
* @param string|null $table The table being searched
*
* @return void
* @return int
* @since 3.2.0
*/
public function replace(?string $table = null)
public function replace(?string $table = null): int
{
// set the table name
if (empty($table))
@ -213,6 +297,7 @@ class Agent
}
$set = 1;
$replaced = 0;
// continue loading items until all was loaded
while(($items = $this->get->items($table, $set)) !== null)
@ -224,7 +309,10 @@ class Agent
$this->replace->items($this->find->get($table), $table);
// update the database
$this->set->items($this->replace->get($table), $table);
if ($this->set->items($this->replace->get($table), $table))
{
$replaced++;
}
// reset found items
$this->find->reset($table);
@ -232,6 +320,105 @@ class Agent
$set++;
}
// we return the number of times we replaced
return $replaced;
}
/**
* Return prepared code string for table
*
* @param string $code The code value fro the table
* @param string|null $table The table
* @param string $field The field key
* @param int $id The the row id
* @param mixed $line The code line where found
*
* @return array
* @since 3.2.0
*/
protected function getRow(string $code, string $table, string $field, int $id, $line): array
{
return [
'edit' => $this->getRowEditButton($table, $field, $id, $line),
'code' => $this->getRowCode($code),
'table' => $table,
'field' => $field,
'id' => $id,
'line' => $line
];
}
/**
* Return prepared code string for table
*
* @param string $code The code value fro the table
*
* @return string
* @since 3.2.0
*/
protected function getRowCode(string $code): string
{
return str_replace($this->marker, $this->markerHtml, htmlentities($code));
}
/**
* Get the Item button to edit an item
*
* @param string|null $view The single view
* @param string $field The field key
* @param int $id The the row id
* @param mixed $line The code line where found
*
* @return string
* @since 3.2.0
*/
protected function getRowEditButton(string $view, string $field, int $id, $line): string
{
// get list view
$views = $this->table->get($view, $field, 'list');
$tab = $this->table->get($view, $field, 'tab_name');
// return edit link
return '<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder' .
'&view=' . $views .
'&task=' . $view . '.edit' .
'&id=' . $id .
'&open_tab=' . $tab .
'&open_field=' . $field .
'&return=' . $this->return . '" title="' .
Text::sprintf('COM_COMPONENTBUILDER_EDIT_S_S_DIRECTLY', $view, $field) . '." ><span class="icon-edit"></span></a>';
}
/**
* Set the return value for this search
*
* @return void
* @since 3.2.0
*/
protected function setReturnValue()
{
// set the return value so the search auto load on return
$this->return = urlencode(base64_encode('index.php?option=com_componentbuilder&view=search' .
'&type_search=' . (int) $this->config->type_search .
'&match_case=' . (int) $this->config->match_case .
'&whole_word=' . (int) $this->config->whole_word .
'&regex_search=' . (int) $this->config->regex_search .
'&search_value=' . (string) urlencode($this->config->search_value) .
'&replace_value=' . (string) urlencode($this->config->replace_value)));
}
/**
* Set the markers of the found code
*
* @return void
* @since 3.2.0
*/
protected function setMarkers()
{
// set the markers
$this->marker = [$this->config->marker_start, $this->config->marker_end];
$this->markerHtml = ['<span class="found_code">','</span>'];
}
}

View File

@ -15,6 +15,7 @@ namespace VDM\Joomla\Componentbuilder\Search\Agent;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Componentbuilder\Search\Factory;
use VDM\Joomla\Componentbuilder\Search\Config;
use VDM\Joomla\Componentbuilder\Search\Interfaces\SearchTypeInterface as SearchEngine;
use VDM\Joomla\Componentbuilder\Search\Interfaces\SearchInterface;
@ -34,6 +35,14 @@ class Search implements SearchInterface
*/
protected array $found = [];
/**
* Search Config
*
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Search Engine
*
@ -45,12 +54,14 @@ class Search implements SearchInterface
/**
* Constructor
*
* @param Config|null $config The search config object.
* @param SearchEngine|null $search The search engine object.
*
* @since 3.2.0
*/
public function __construct(?SearchEngine $search = null)
public function __construct(?Config $config = null, ?SearchEngine $search = null)
{
$this->config = $config ?: Factory::_('Config');
$this->search = $search ?: Factory::_('Search');
}
@ -226,6 +237,9 @@ class Search implements SearchInterface
// line counter
$line = 1;
// we count every field we search
$this->fieldCounter();
// check if string has a new line
if (\preg_match('/\R/', $value))
{
@ -283,7 +297,18 @@ class Search implements SearchInterface
{
$this->found[$table][$id][$field] = [];
}
// we should add a call to get the item name if the table has a name field TODO
}
/**
* we count every field being searched
*
* @since 3.2.0
*/
protected function fieldCounter()
{
// we count every field we search
$this->config->field_counter = $this->config->field_counter + 1;
}
}

View File

@ -22,6 +22,17 @@ use VDM\Joomla\Componentbuilder\Abstraction\BaseConfig;
*/
class Config extends BaseConfig
{
/**
* get type search being preformed
*
* @return int the search type 1 = search, 2 = search & replace
* @since 3.2.0
*/
protected function getTypesearch(): ?int
{
return $this->input->get('type_search', 1, 'INT');
}
/**
* get posted search value
*
@ -30,7 +41,7 @@ class Config extends BaseConfig
*/
protected function getSearchvalue(): ?string
{
return $this->input->post->get('search_value', null, 'RAW');
return $this->input->get('search_value', null, 'RAW');
}
/**
@ -41,7 +52,7 @@ class Config extends BaseConfig
*/
protected function getReplacevalue(): string
{
return $this->input->post->get('replace_value', '', 'RAW');
return $this->input->get('replace_value', '', 'RAW');
}
/**
@ -52,7 +63,7 @@ class Config extends BaseConfig
*/
protected function getMatchcase(): int
{
return $this->input->post->get('match_case', 0, 'INT');
return $this->input->get('match_case', 0, 'INT');
}
/**
@ -63,7 +74,7 @@ class Config extends BaseConfig
*/
protected function getWholeword(): int
{
return $this->input->post->get('whole_word', 0, 'INT');
return $this->input->get('whole_word', 0, 'INT');
}
/**
@ -72,9 +83,9 @@ class Config extends BaseConfig
* @return int Regex
* @since 3.2.0
*/
protected function getRegex(): int
protected function getRegexsearch(): int
{
return $this->input->post->get('regex_search', 0, 'INT');
return $this->input->get('regex_search', 0, 'INT');
}
/**
@ -85,7 +96,7 @@ class Config extends BaseConfig
*/
protected function getComponentid(): int
{
return $this->input->post->get('component_id', 0, 'INT');
return $this->input->get('component_id', 0, 'INT');
}
/**
@ -96,7 +107,7 @@ class Config extends BaseConfig
*/
protected function getTablename(): string
{
return $this->input->post->get('table_name', null, 'word');
return $this->input->get('table_name', null, 'word');
}
/**
@ -107,7 +118,7 @@ class Config extends BaseConfig
*/
protected function getFieldname(): string
{
return $this->input->post->get('field_name', null, 'word');
return $this->input->get('field_name', null, 'word');
}
/**
@ -118,7 +129,29 @@ class Config extends BaseConfig
*/
protected function getItemid(): int
{
return $this->input->post->get('item_id', 0, 'INT');
return $this->input->get('item_id', 0, 'INT');
}
/**
* get field counter
*
* @return int we start at 0
* @since 3.2.0
*/
protected function getFieldcounter(): ?int
{
return 0;
}
/**
* get line counter
*
* @return int we start at 0
* @since 3.2.0
*/
protected function getLinecounter(): ?int
{
return 0;
}
/**

View File

@ -112,11 +112,11 @@ class Get implements GetInterface
$query = $this->db->getQuery(true);
// Order it by the ordering field.
$query->select($name);
$query->select($this->db->quoteName($name));
$query->from($this->db->quoteName('#__componentbuilder_' . $table));
// get by id
$query->where($this->db->quoteName('id') . " = " . $id);
$query->where($this->db->quoteName('id') . " = " . (int) $id);
// Reset the query using our newly populated query object.
$this->db->setQuery($query);

View File

@ -17,6 +17,7 @@ use VDM\Joomla\Componentbuilder\Search\Factory;
use VDM\Joomla\Componentbuilder\Search\Config;
use VDM\Joomla\Componentbuilder\Search\Table;
use VDM\Joomla\Componentbuilder\Search\Model\Set as Model;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Componentbuilder\Search\Interfaces\SetInterface;
@ -152,13 +153,13 @@ class Set implements SetInterface
* Set values to a given table
* Example: $this->items(Array, 'table_name');
*
* @param array $items The items being saved
* @param array|null $items The items being saved
* @param string|null $table The table
*
* @return bool
* @since 3.2.0
*/
public function items(array $items, string $table = null): bool
public function items(?array $items, string $table = null): bool
{
// load the table
if (empty($table))

View File

@ -46,7 +46,7 @@ class Basic extends Engine implements SearchTypeInterface
parent::__construct($config);
// quote all regular expression characters
$searchValue = \preg_quote($this->searchValue);
$searchValue = preg_quote($this->searchValue, '/');
$start = ''; $end = '';
@ -93,6 +93,9 @@ class Basic extends Engine implements SearchTypeInterface
*/
public function string(string $value): ?string
{
// we count every line
$this->lineCounter();
if (StringHelper::check($this->searchValue))
{
if ($this->wholeWord == 1)

View File

@ -65,6 +65,9 @@ class Regex extends Engine implements SearchTypeInterface
*/
public function string(string $value): ?string
{
// we count every line
$this->lineCounter();
if (StringHelper::check($this->searchValue) && $this->match($value))
{
return trim(preg_replace(

View File

@ -20,17 +20,17 @@ namespace VDM\Joomla\Componentbuilder\Search\Interfaces;
interface GetInterface
{
/**
* Get values from a given table
* Get a value from a given table
* Example: $this->value(23, 'value_key', 'table_name');
*
* @param string $field The field key
* @param int $id The item ID
* @param string $field The field key
* @param string|null $table The table
*
* @return mixed
* @since 3.2.0
*/
public function value(string $field, int $id, string $table = null);
public function value(int $id, string $field, string $table = null);
/**
* Get values from a given table

View File

@ -70,7 +70,9 @@ class Agent implements ServiceProviderInterface
$container->get('Set.Database'),
$container->get('Agent.Find'),
$container->get('Agent.Replace'),
$container->get('Agent.Search')
$container->get('Agent.Search'),
$container->get('Agent.Update'),
$container->get('Table')
);
}
@ -117,6 +119,7 @@ class Agent implements ServiceProviderInterface
public function getSearch(Container $container): Search
{
return new Search(
$container->get('Config'),
$container->get('Search')
);
}

View File

@ -237,7 +237,7 @@ abstract class StringHelper
*
* @since 3.0.9
*/
public static function html($var, $charset = 'UTF-8', $shorten = false, $length = 40)
public static function html($var, $charset = 'UTF-8', $shorten = false, $length = 40, $addTip = true)
{
if (self::check($var))
{
@ -254,7 +254,7 @@ abstract class StringHelper
);
if ($shorten)
{
return self::shorten($string, $length);
return self::shorten($string, $length, $addTip);
}
return $string;
}

57
media/datatable/css/datatables.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

1238
media/datatable/js/datatables.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

3
media/datatable/js/pdfmake.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9422,7 +9422,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="https://dev.vdm.io" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 3.1.9 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 3.1.11 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))

View File

@ -25,6 +25,7 @@ COM_COMPONENTBUILDER_DTOWNERDTDDSDD="<dt>Owner</dt><dd>%s</dd>"
COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="<dt>Website</dt><dd>%s</dd>"
COM_COMPONENTBUILDER_EDIT="Edit"
COM_COMPONENTBUILDER_EDIT_S="Edit %s"
COM_COMPONENTBUILDER_EDIT_S_S_DIRECTLY="Edit %s (%s) directly"
COM_COMPONENTBUILDER_EMAIL_S="Email: %s"
COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT="Email with the new key was sent"
COM_COMPONENTBUILDER_EMCOMPANYEM_BSB="<em>Company:</em> <b>%s</b>"