diff --git a/README.md b/README.md index f6a473d39..20ac6437d 100644 --- a/README.md +++ b/README.md @@ -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*: 10th September, 2022 ++ *Last Build*: 14th September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **324186** ++ *Line count*: **330282** + *Field count*: **2002** -+ *File count*: **2125** -+ *Folder count*: **366** ++ *File count*: **2161** ++ *Folder count*: **374** > 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) diff --git a/admin/README.txt b/admin/README.txt index f6a473d39..20ac6437d 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -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*: 10th September, 2022 ++ *Last Build*: 14th September, 2022 + *Version*: 3.1.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **324186** ++ *Line count*: **330282** + *Field count*: **2002** -+ *File count*: **2125** -+ *Folder count*: **366** ++ *File count*: **2161** ++ *Folder count*: **374** > 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) diff --git a/admin/access.xml b/admin/access.xml index 1e51d294b..7503798c3 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -498,6 +498,9 @@ + + + diff --git a/admin/assets/css/search.css b/admin/assets/css/search.css new file mode 100644 index 000000000..2731fc5aa --- /dev/null +++ b/admin/assets/css/search.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @git 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 + */ + +/* CSS Document */ + + diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 0d831e5ec..a626d5936 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -67,6 +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('snippetDetails', 'ajax'); $this->registerTask('setSnippetGithub', 'ajax'); $this->registerTask('getSnippets', 'ajax'); @@ -1631,6 +1633,99 @@ class ComponentbuilderControllerAjax extends BaseController } } break; + case 'searchTable': + try + { + $table_nameValue = $jinput->get('table_name', NULL, 'WORD'); + $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) + { + $result = $this->getModel('ajax')->searchTable($table_nameValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + } + else + { + $result = false; + } + if($callback) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback) + { + echo $callback."(".json_encode($e).");"; + } + elseif($returnRaw) + { + echo json_encode($e); + } + else + { + echo "(".json_encode($e).");"; + } + } + break; + case 'updateTable': + try + { + $table_nameValue = $jinput->get('table_name', NULL, 'WORD'); + $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'); + $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); + } + else + { + $result = false; + } + if($callback) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback) + { + echo $callback."(".json_encode($e).");"; + } + elseif($returnRaw) + { + echo json_encode($e); + } + else + { + echo "(".json_encode($e).");"; + } + } + break; case 'snippetDetails': try { diff --git a/admin/controllers/search.php b/admin/controllers/search.php new file mode 100644 index 000000000..041c25ecd --- /dev/null +++ b/admin/controllers/search.php @@ -0,0 +1,42 @@ + + * @git 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('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\Utilities\ArrayHelper; + +/** + * Componentbuilder Search Base Controller + */ +class ComponentbuilderControllerSearch extends BaseController +{ + public function __construct($config) + { + parent::__construct($config); + } + + public function dashboard() + { + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder', false)); + return; + } + + public function openCompiler() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // redirect to the libraries + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=compiler', false)); + return; + } +} diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 6e3f2769b..b8a540fed 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -1307,10 +1307,7 @@ class Get ); // load the global placeholders - if (ArrayHelper::check($this->globalPlaceholders)) - { - CFactory::_('Placeholder')->active = $this->globalPlaceholders; - } + CFactory::_('Placeholder')->active = CFactory::_('Component.Placeholder')->get(); // set component sales name $component->sales_name = StringHelper::safe( @@ -7567,7 +7564,7 @@ class Get CFactory::_('Config')->build_target = $_backup_target; CFactory::_('Config')->lang_target = $_backup_lang; $this->langPrefix = $_backup_langPrefix; - CFactory::_('Config')->set('lang_prefix', $_backup_langPrefix); + CFactory::_('Config')->lang_prefix = $_backup_langPrefix; unset( CFactory::_('Placeholder')->active[Placefix::_('Module_name')] @@ -7816,15 +7813,14 @@ class Get $plugin->official_name = ucwords( $plugin->group . ' - ' . $plugin->name ); - // set langPrefix - $this->langPrefix - = PluginHelper::safeLangPrefix( - $plugin->code_name, - $plugin->group - ); - CFactory::_('Config')->set('lang_prefix', $this->langPrefix); // set lang prefix - $plugin->lang_prefix = CFactory::_('Config')->lang_prefix; + $plugin->lang_prefix = PluginHelper::safeLangPrefix( + $plugin->code_name, + $plugin->group + ); + // set langPrefix + CFactory::_('Config')->lang_prefix = $plugin->lang_prefix; + $this->langPrefix = $plugin->lang_prefix; // set plugin class name $plugin->class_name = PluginHelper::safeClassName( diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index f158238f3..9390d8c85 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -3954,7 +3954,7 @@ class Fields extends Structure } // now build the layout if (StringHelper::check($tabName) - && $tabName != 'publishing') + && strtolower($tabName) != 'publishing') { $this->tabCounter[$nameSingleCode][(int) $field['tab']] = $tabName; @@ -5032,6 +5032,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'json', $typeName ); + // add open close method to field data + $field['store'] = 'json'; break; case 2: // BASE_SIXTY_FOUR @@ -5040,6 +5042,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'base64', $typeName ); + // add open close method to field data + $field['store'] = 'base64'; break; case 3: // BASIC_ENCRYPTION_LOCALKEY @@ -5048,6 +5052,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'basic_encryption', $typeName ); + // add open close method to field data + $field['store'] = 'basic_encryption'; break; case 4: // WHMCS_ENCRYPTION_VDMKEY (DUE REMOVAL) @@ -5056,6 +5062,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'whmcs_encryption', $typeName ); + // add open close method to field data + $field['store'] = 'whmcs_encryption'; break; case 5: // MEDIUM_ENCRYPTION_LOCALFILE @@ -5064,6 +5072,8 @@ class Fields extends Structure $this->buildSiteFieldData( $nameSingleCode, $name, 'medium_encryption', $typeName ); + // add open close method to field data + $field['store'] = 'medium_encryption'; break; case 6: // EXPERT_MODE @@ -5096,6 +5106,8 @@ class Fields extends Structure ); // no londer add the json again (already added) $subformJsonSwitch = false; + // add open close method to field data + $field['store'] = 'json'; break; } // just a heads-up for usergroups set to multiple @@ -5286,6 +5298,22 @@ class Fields extends Structure $tabName = 'publishing'; } $this->setLayoutBuilder($nameSingleCode, $tabName, $name, $field); + + // only load fields we want to search + if ($dbSwitch && ComponentbuilderHelper::fieldCheck($typeName, 'search')) + { + // load a search array of view, field, and [encryption, type, tab] + CFactory::_('Registry')->set('all_search_fields.' . $nameSingleCode . '.' . $name, + [ + 'name' => $name, + 'type' => $typeName, + 'title' => (isset($this->titleBuilder[$nameSingleCode]) && $name === $this->titleBuilder[$nameSingleCode]) ? true : false, + 'list' => $nameListCode, + 'store' => (isset($field['store'])) ? $field['store'] : null, + 'tab_name' => $tabName + ] + ); + } } /** @@ -5384,15 +5412,9 @@ class Fields extends Structure $replace[$replacekey] = $replacevalue; } // load the global placeholders - if (ArrayHelper::check($this->globalPlaceholders)) + foreach (CFactory::_('Component.Placeholder')->get() as $globalPlaceholder => $gloabalValue) { - foreach ( - $this->globalPlaceholders as $globalPlaceholder => - $gloabalValue - ) - { - $replace[$globalPlaceholder] = $gloabalValue; - } + $replace[$globalPlaceholder] = $gloabalValue; } // start loading the field type $this->fileContentDynamic['customfield_' . $data['type']] = array(); diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 17c492f56..6dd1bbd61 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -24106,17 +24106,9 @@ class Interpretation extends Fields $placeholders[Placefix::_('views')] = $nameListCode; // load the global placeholders - if (ArrayHelper::check( - $this->globalPlaceholders - )) + foreach (CFactory::_('Component.Placeholder')->get() as $globalPlaceholder => $gloabalValue) { - foreach ( - $this->globalPlaceholders as $globalPlaceholder => - $gloabalValue - ) - { - $placeholders[$globalPlaceholder] = $gloabalValue; - } + $placeholders[$globalPlaceholder] = $gloabalValue; } $view = ''; $viewType = 0; @@ -29015,10 +29007,12 @@ function vdm_dkim() { public function getExtensionFieldsetXML(&$extension, &$fields, $dbkey = 'zz' ) { + // get global placeholders + $placeholder = CFactory::_('Component.Placeholder')->get(); // build the fieldset return $this->getFieldsetXML( $fields, $extension->lang_prefix, $extension->key, $extension->key, - $this->globalPlaceholders, $dbkey + $placeholder, $dbkey ); } diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index fd9707e04..4093f1c70 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -324,17 +324,13 @@ class Infusion extends Interpretation = $this->addEmailHelper(); // load the global placeholders - if (ArrayHelper::check($this->globalPlaceholders)) + foreach (CFactory::_('Component.Placeholder')->get() as $globalPlaceholder => + $gloabalValue + ) { - foreach ( - $this->globalPlaceholders as $globalPlaceholder => - $gloabalValue - ) - { - $this->fileContentStatic[$globalPlaceholder] - = $gloabalValue; - } + $this->fileContentStatic[$globalPlaceholder] = $gloabalValue; } + // reset view array $viewarray = array(); $site_edit_view_array = array(); @@ -1169,6 +1165,10 @@ class Infusion extends Interpretation CFactory::_('Placeholder')->active = $this->placeholders; } + // all fields stored in database + $this->fileContentStatic[Placefix::_h('ARRAY_ALL_SEARCH_FIELDS')] = + CFactory::_('Registry')->varExport('all_search_fields', 1); + // setup the layouts $this->setCustomViewLayouts(); diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 28d69846d..780981212 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -3550,6 +3550,9 @@ abstract class ComponentbuilderHelper ), 'special' => array( 'contentlanguage', 'moduleposition', 'plugin', 'repeatable', 'subform' + ), + 'search' => array( + 'editor', 'email', 'tel', 'text', 'textarea', 'url', 'subform' ) ); @@ -6318,6 +6321,11 @@ abstract class ComponentbuilderHelper { JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_COMPILER'), 'index.php?option=com_componentbuilder&view=compiler', $submenu === 'compiler'); } + // Access control (search.submenu). + if ($user->authorise('search.submenu', 'com_componentbuilder')) + { + JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SEARCH'), 'index.php?option=com_componentbuilder&view=search', $submenu === 'search'); + } if ($user->authorise('joomla_component.access', 'com_componentbuilder') && $user->authorise('joomla_component.submenu', 'com_componentbuilder')) { JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS'), 'index.php?option=com_componentbuilder&view=joomla_components', $submenu === 'joomla_components'); diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 5556dee6f..5d19974ee 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1292,6 +1292,7 @@ COM_COMPONENTBUILDER_AJAX="Ajax" COM_COMPONENTBUILDER_ALIAS="Alias" COM_COMPONENTBUILDER_ALIGNMENT="Alignment" COM_COMPONENTBUILDER_ALL="All" +COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED="All found instances in %s where replaced" COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter." COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME="All is good, there is no notice at this time." COM_COMPONENTBUILDER_ALL_OF_THESE_PACKAGES_ARE_A_FULLY_DEVELOPEDMAPPED_COMPONENTS_FOR_JCB_THEY_CAN_BE_SEEN_AS_DEMO_CONTENT_OR_BASE_IMAGES_FROM_WHICH_TO_START_YOUR_PROJECTBR_ALWAYS_MAKE_SURE_YOU_ARE_ON_THE_LATEST_VERSION_OF_JCB_BEFORE_IMPORTING_ANY_OF_THESE_PACKAGES_SHOULD_ANY_OF_THEM_FAIL_TO_IMPORT_A_S_PLEASE_LET_US_KNOWA="All of these packages are a fully developed/mapped components for JCB. They can be seen as demo content, or base images from which to start your project.
Always make sure you are on the latest version of JCB before importing any of these packages, should any of them fail to import please let us know." @@ -7759,6 +7760,7 @@ COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)" COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)" COM_COMPONENTBUILDER_MODULE="Module" COM_COMPONENTBUILDER_MODULES="Modules" +COM_COMPONENTBUILDER_MORE_SOON="More soon" COM_COMPONENTBUILDER_MOVE="Move" COM_COMPONENTBUILDER_NAME="Name" COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)" @@ -7789,6 +7791,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_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" @@ -8138,7 +8141,15 @@ COM_COMPONENTBUILDER_RUN_EXPANSION="Run Expansion" 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
You can add a gitHub Access Token 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_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_DESC="JCB Search" +COM_COMPONENTBUILDER_SEARCH_SUBMENU="Search Submenu" +COM_COMPONENTBUILDER_SEARCH_SUBMENU_DESC="Allows the users in this group to submenu of Search" COM_COMPONENTBUILDER_SEE_ALL_IMPORT_INFO="See All Import Info" COM_COMPONENTBUILDER_SELECTION="selection" COM_COMPONENTBUILDER_SELECT_ADMIN_VIEW="Select Admin View" @@ -8957,6 +8968,7 @@ COM_COMPONENTBUILDER_SUBMENU_LAYOUTS="Layouts" COM_COMPONENTBUILDER_SUBMENU_LIBRARIES="Libraries" COM_COMPONENTBUILDER_SUBMENU_PLACEHOLDERS="Placeholders" COM_COMPONENTBUILDER_SUBMENU_POWERS="Powers" +COM_COMPONENTBUILDER_SUBMENU_SEARCH="Search" COM_COMPONENTBUILDER_SUBMENU_SERVERS="Servers" COM_COMPONENTBUILDER_SUBMENU_SITE_VIEWS="Site Views" COM_COMPONENTBUILDER_SUBMENU_SNIPPETS="Snippets" @@ -9100,6 +9112,7 @@ COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME="There are no new sn COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME="There are no out of date snippets at this time" COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME="There are no snippets to update at this time" COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_IF_THIS_CONTINUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR_OF_A_TYPE_ERROR_IN_THE_FIELDS_DISPLAY_REQUEST="There has been an error, if this continues please inform your system administrator of a type error in the fields display request!" +COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN="There has been an error please try again" COM_COMPONENTBUILDER_THERE_WAS_AN_ERROR_GETTING_THE_PACKAGE_INFO="There was an error getting the package info." COM_COMPONENTBUILDER_THERE_WAS_A_PROBLEM_BNO_VIEW_OR_ID_FOUND_IN_SESSION_OR_VIEW_NOT_ALLOWED_TO_ACCESS_AREAB_WE_COULD_NOT_LOAD_ANY_LINKED_TO_VALUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR="There was a problem, no view or id found in session or view not allowed to access area, we could not load any linked to values. Please inform your system administrator!" COM_COMPONENTBUILDER_THESE_ARE_THE_SAME_PACKAGES_FOUND_ON_A_S_GITHUBA_AND_CAN_BE_IMPORTED_BY_SIMPLY_MAKING_A_SELECTION_AND_THEN_CLICKING_THE_BGET_PACKAGEB_BUTTONBR_SOME_OF_THESE_PACKAGES_WOULD_REQUIRE_A_KEY_SINCE_THEY_ARE_NOT_FREE="These are the same packages found on gitHub and can be imported by simply making a selection and then clicking the [Get Package] button.
Some of these packages would require a key, since they are not free." @@ -9358,6 +9371,7 @@ COM_COMPONENTBUILDER_WEBSITE_S="Website: %s" COM_COMPONENTBUILDER_WE_DID_NOT_CHECK_THE_SNIPPET_IT_SELF_TO_SEE_IF_IT_CHANGED_WE_ONLY_WORK_ON_DATES="We did not check the snippet it self, to see if it changed. We only work on dates." COM_COMPONENTBUILDER_WE_FAILED_TO_MOVE_BSB="We failed to move %s!" COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS="We found dynamic code all in one line, and ignored it! Please review (%s) for more details!" +COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S="We found some instances in %s" COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved %s!" COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION="While we download all 26 compiler GIF animations randomly used in the compiler GUI during compilation" COM_COMPONENTBUILDER_WIKI="Wiki" diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index 4e7b3ff77..34b9d4815 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -963,6 +963,7 @@ COM_COMPONENTBUILDER_MENU_LAYOUTS="Layouts" COM_COMPONENTBUILDER_MENU_LIBRARIES="Libraries" COM_COMPONENTBUILDER_MENU_PLACEHOLDERS="Placeholders" COM_COMPONENTBUILDER_MENU_POWERS="Powers" +COM_COMPONENTBUILDER_MENU_SEARCH="Search" COM_COMPONENTBUILDER_MENU_SITE_VIEWS="Site Views" COM_COMPONENTBUILDER_MENU_SNIPPETS="Snippets" COM_COMPONENTBUILDER_MENU_TEMPLATES="Templates" @@ -1017,6 +1018,12 @@ COM_COMPONENTBUILDER_POWERS_SUBMENU="Powers Submenu" COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC="Allows the users in this group to submenu of power" COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS="Power Run Expansion Button Access" COM_COMPONENTBUILDER_POWER_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button." +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_SUBMENU="Search Submenu" +COM_COMPONENTBUILDER_SEARCH_SUBMENU_DESC="Allows the users in this group to submenu of Search" COM_COMPONENTBUILDER_SERVERS_ACCESS="Servers Access" COM_COMPONENTBUILDER_SERVERS_ACCESS_DESC="Allows the users in this group to access access servers" COM_COMPONENTBUILDER_SERVERS_BATCH_USE="Servers Batch Use" diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 86ab41226..9c3ce9a3e 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -14,8 +14,8 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Model\ListModel; use Joomla\Utilities\ArrayHelper; -use Joomla\Registry\Registry; -use VDM\Gitea\Gitea; + +use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; /** * Componentbuilder Ajax List Model @@ -3604,6 +3604,82 @@ class ComponentbuilderModelAjax extends ListModel return false; } + // Used in search + /** + * Search for value in a table + * + * @param string $tableName The main table to search + * @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 + * @param int $regexSearch The switch to control regex search + * @param int $componentId The option to filter by component + * + * @return array|null + * @since 3.2.0 + **/ + public function searchTable(string $tableName, 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) + { + return ['success' => JText::sprintf('COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S', $tableName), 'items' => $items]; + } + + return ['success' => JText::sprintf('COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_S', $tableName)]; + } + + return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')]; + } + + /** + * Search and replace value in a table + * + * @param string $tableName The main table to search + * @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 + * @param int $componentId The option to filter by component + * + * @return array|null + * @since 3.2.0 + **/ + public function updateTable(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; + + SearchFactory('Agent')->replace(); + + return ['success' => JText::sprintf('COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED', $tableName)]; + } + return ['error' => JText::_('COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_PLEASE_TRY_AGAIN')]; + } + + // Used in get_snippets public function getSnippets($libraries) diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index 32bfb2260..59cf8a907 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -36,6 +36,7 @@ class ComponentbuilderModelComponentbuilder extends ListModel $viewAccess = array( 'compiler.submenu' => 'compiler.submenu', 'compiler.dashboard_list' => 'compiler.dashboard_list', + 'search.submenu' => 'search.submenu', 'get_snippets.submenu' => 'get_snippets.submenu', 'get_snippets.dashboard_list' => 'get_snippets.dashboard_list', 'joomla_component.create' => 'joomla_component.create', diff --git a/admin/models/search.php b/admin/models/search.php new file mode 100644 index 000000000..560080af6 --- /dev/null +++ b/admin/models/search.php @@ -0,0 +1,165 @@ + + * @git 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('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\MVC\Model\ItemModel; +use Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory; + +/** + * Componentbuilder Search Item Model + */ +class ComponentbuilderModelSearch extends ItemModel +{ + /** + * Model context string. + * + * @var string + */ + protected $_context = 'com_componentbuilder.search'; + + /** + * Model user data. + * + * @var strings + */ + protected $user; + protected $userId; + protected $guest; + protected $groups; + protected $levels; + protected $app; + protected $input; + protected $uikitComp; + + /** + * @var object item + */ + protected $item; + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @since 1.6 + * + * @return void + */ + protected function populateState() + { + $this->app = JFactory::getApplication(); + $this->input = $this->app->input; + // Get the item main id + $id = $this->input->getInt('id', null); + $this->setState('search.id', $id); + + // Load the parameters. + parent::populateState(); + } + + /** + * Method to get article data. + * + * @param integer $pk The id of the article. + * + * @return mixed Menu item data object on success, false on failure. + */ + public function getItem($pk = null) + { + $this->user = JFactory::getUser(); + // check if this user has permission to access item + if (!$this->user->authorise('search.access', 'com_componentbuilder')) + { + $app = JFactory::getApplication(); + $app->enqueueMessage(JText::_('Not authorised!'), 'error'); + // redirect away if not a correct to cPanel/default view + $app->redirect('index.php?option=com_componentbuilder'); + return false; + } + $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; + + $pk = (!empty($pk)) ? $pk : (int) $this->getState('search.id'); + + $pk = $this->userId; + + if ($this->_item === null) + { + $this->_item = array(); + } + + if (!isset($this->_item[$pk])) + { + try + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Get data + // load the tables and components (soon) + $data = ['tables' => SearchFactory::_('Table')->tables(), 'components' => null]; + + + if (empty($data)) + { + $app = JFactory::getApplication(); + // If no data is found redirect to default page and show warning. + $app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_NOT_FOUND_OR_ACCESS_DENIED'), 'warning'); + $app->redirect('index.php?option=com_componentbuilder'); + return false; + } + + // set data object to item. + $this->_item[$pk] = $data; + } + catch (Exception $e) + { + if ($e->getCode() == 404) + { + // Need to go thru the error handler to allow Redirect to work. + JError::raiseWarning(404, $e->getMessage()); + } + else + { + $this->setError($e); + $this->_item[$pk] = false; + } + } + } + + return $this->_item[$pk]; + } + + /** + * Get the uikit needed components + * + * @return mixed An array of objects on success. + * + */ + public function getUikitComp() + { + if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp)) + { + return $this->uikitComp; + } + return false; + } +} diff --git a/admin/views/search/index.html b/admin/views/search/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/search/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/search/tmpl/default.php b/admin/views/search/tmpl/default.php new file mode 100644 index 000000000..d28ecae59 --- /dev/null +++ b/admin/views/search/tmpl/default.php @@ -0,0 +1,52 @@ + + * @git 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('_JEXEC') or die('Restricted access'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.formvalidator'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +?> +canDo->get('search.access')): ?> + +item->id)) ? '&id='. (int) $this->item->id : ''; ?> +
+ +sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ + +
+ + + + +

+ + diff --git a/admin/views/search/tmpl/index.html b/admin/views/search/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/search/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/search/view.html.php b/admin/views/search/view.html.php new file mode 100644 index 000000000..551d3d701 --- /dev/null +++ b/admin/views/search/view.html.php @@ -0,0 +1,150 @@ + + * @git 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('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\MVC\View\HtmlView; + +/** + * Componentbuilder Html View class for the Search + */ +class ComponentbuilderViewSearch extends HtmlView +{ + // Overwriting JView display method + function display($tpl = null) + { + // get component params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // get the application + $this->app = JFactory::getApplication(); + // get the user object + $this->user = JFactory::getUser(); + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('search'); + // Initialise variables. + $this->item = $this->get('Item'); + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('search'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=search'); + $this->sidebar = JHtmlSidebar::render(); + } + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + // add the tool bar + $this->addToolBar(); + } + + // set the document + $this->setDocument(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode(PHP_EOL, $errors), 500); + } + + parent::display($tpl); + } + + /** + * Prepares the document + */ + protected function setDocument() + { + + // always make sure jquery is loaded. + JHtml::_('jquery.framework'); + // Load the header checker class. + require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' ); + // Initialize the header checker. + $HeaderCheck = new componentbuilderHeaderCheck; + + // Load uikit options. + $uikit = $this->params->get('uikit_load'); + // Set script size. + $size = $this->params->get('uikit_min'); + // Set css style. + $style = $this->params->get('uikit_style'); + + // The uikit css. + if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) + { + JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']); + } + // The uikit js. + if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) + { + JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); + } + // add the document default css file + $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/search.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + // hide the main menu + $this->app->input->set('hidemainmenu', true); + // set the title + if (isset($this->item->name) && $this->item->name) + { + $title = $this->item->name; + } + // Check for empty title and add view name if param is set + if (empty($title)) + { + $title = JText::_('COM_COMPONENTBUILDER_SEARCH'); + } + // add title to the page + JToolbarHelper::title($title,'search'); + // add cpanel button + JToolBarHelper::custom('search.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); + if ($this->canDo->get('search.compiler')) + { + // add Compiler button. + JToolBarHelper::custom('search.openCompiler', 'cogs custom-button-opencompiler', '', 'COM_COMPONENTBUILDER_COMPILER', false); + } + + // set help url for this view if found + $this->help_url = ComponentbuilderHelper::getHelpUrl('search'); + if (ComponentbuilderHelper::checkString($this->help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } +} +?> diff --git a/componentbuilder.xml b/componentbuilder.xml index 225f932f2..522cc8fa3 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 10th September, 2022 + 14th September, 2022 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io @@ -74,6 +74,7 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo COM_COMPONENTBUILDER_MENU_COMPILER + COM_COMPONENTBUILDER_MENU_SEARCH COM_COMPONENTBUILDER_MENU_JOOMLA_COMPONENTS COM_COMPONENTBUILDER_MENU_JOOMLA_MODULES COM_COMPONENTBUILDER_MENU_JOOMLA_PLUGINS diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/BaseConfig.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/BaseConfig.php new file mode 100644 index 000000000..596296a9f --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/BaseConfig.php @@ -0,0 +1,131 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder; + + +use Joomla\Registry\Registry; +use Joomla\CMS\Factory; +use Joomla\Input\Input; +use VDM\Joomla\Utilities\Component\Helper; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; + + +/** + * Configurations + * + * @since 3.2.0 + */ +abstract class BaseConfig extends Registry +{ + /** + * Hold a JInput object for easier access to the input variables. + * + * @var Input + * @since 3.2.0 + */ + protected $input; + + /** + * The Params + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $params; + + /** + * Constructor + * + * @param Input|null $input Input + * @param Registry|null $params The component parameters + * + * @throws \Exception + * @since 3.2.0 + */ + public function __construct(?Input $input = null, ?Registry $params = null) + { + $this->input = $input ?: Factory::getApplication()->input; + $this->params = $params ?: Helper::getParams('com_componentbuilder'); + + // use underscore as the separator + $this->separator = '_'; + + // Instantiate the internal data object. + $this->data = new \stdClass(); + } + + /** + * setting any config value + * + * @param String $key The value's key/path name + * @param mixed $value Optional default value, returned if the internal value is null. + * + * @since 3.2.0 + */ + public function __set($key, $value) + { + $this->set($key, $value); + } + + /** + * getting any valid value + * + * @param String $key The value's key/path name + * + * @since 3.2.0 + * @throws \InvalidArgumentException If $key is not a valid function name. + */ + public function __get($key) + { + // check if it has been set + if (($value = $this->get($key, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') + { + return $value; + } + + throw new \InvalidArgumentException(sprintf('Argument %s could not be found as function [%s], or path.', $key, $method)); + } + + /** + * Get a config value. + * + * @param string $path Registry path (e.g. joomla.content.showauthor) + * @param mixed $default Optional default value, returned if the internal value is null. + * + * @return mixed Value of entry or null + * + * @since 3.2.0 + */ + public function get($path, $default = null) + { + // function name with no underscores + $method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $path))); + + // check if it has been set + if (($value = parent::get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') + { + return $value; + } + elseif (method_exists($this, $method)) + { + $value = $this->{$method}(); + + $this->set($path, $value); + + return $value; + } + + return $default; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php index 7cd6a1281..69552cc9a 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Component/Placeholder.php @@ -71,11 +71,11 @@ class Placeholder implements PlaceholderInterface /** * get all System Placeholders * - * @return array The global placeholders + * @return array The global placeholders * * @since 3.2.0 */ - public function get() + public function get(): array { // set only once if (is_array($this->placeholders)) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php index c1c5a3f05..340a58df5 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php @@ -12,13 +12,9 @@ namespace VDM\Joomla\Componentbuilder\Compiler; -use Joomla\Registry\Registry; -use Joomla\CMS\Factory; -use Joomla\Input\Input; -use VDM\Joomla\Utilities\Component\Helper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Componentbuilder\BaseConfig; /** @@ -26,119 +22,8 @@ use VDM\Joomla\Utilities\String\ClassfunctionHelper; * * @since 3.2.0 */ -class Config extends Registry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable +class Config extends BaseConfig { - /** - * Hold a JInput object for easier access to the input variables. - * - * @var Input - * @since 3.2.0 - */ - protected $input; - - /** - * The Params - * - * @var Registry - * @since 3.2.0 - */ - protected Registry $params; - - /** - * Constructor - * - * @param Input|null $input Input - * @param Registry|null $params The component parameters - * - * @throws \Exception - * @since 3.2.0 - */ - public function __construct(?Input $input = null, ?Registry $params = null) - { - $this->input = $input ?: Factory::getApplication()->input; - $this->params = $params ?: Helper::getParams('com_componentbuilder'); - - // use underscore as the separator - $this->separator = '_'; - - // Instantiate the internal data object. - $this->data = new \stdClass(); - } - - /** - * setting any config value - * - * @param String $key The value's key/path name - * @param mixed $value Optional default value, returned if the internal value is null. - * - * @since 3.2.0 - */ - public function __set($key, $value) - { - $this->set($key, $value); - } - - /** - * getting any valid value - * - * @param String $key The value's key/path name - * - * @since 3.2.0 - * @throws \InvalidArgumentException If $key is not a valid function name. - */ - public function __get($key) - { - // function name with no underscores - $method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $key))); - - if (($value = $this->get($key, '__N0T_S3T_')) !== '__N0T_S3T_') - { - return $value; - } - elseif (method_exists($this, $method)) - { - $value = $this->{$method}(); - - $this->set($key, $value); - - return $value; - } - - throw new \InvalidArgumentException(sprintf('Argument %s could not be found as function [%s], or path.', $key, $method)); - } - - /** - * Get a registry value. - * - * @param string $path Registry path (e.g. joomla.content.showauthor) - * @param mixed $default Optional default value, returned if the internal value is null. - * - * @return mixed Value of entry or null - * - * @since 3.2.0 - */ - public function get($path, $default = null) - { - // function name with no underscores - $method = 'get' . ucfirst(ClassfunctionHelper::safe(str_replace('_', '', $path))); - - // check if it has been set - if (($value = parent::get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_') - { - return $value; - } - elseif (method_exists($this, $method)) - { - $value = $this->{$method}(); - - $this->set($path, $value); - - return $value; - } - - return $default; - } - /** * get posted component id * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php index c90737faa..062d30449 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Interfaces/Component/PlaceholderInterface.php @@ -26,6 +26,6 @@ interface PlaceholderInterface * * @since 3.2.0 */ - public function get(); + public function get(): array; } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php index 5e188777d..484e49e70 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Registry.php @@ -13,6 +13,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler; use Joomla\Registry\Registry as JoomlaRegistry; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; /** @@ -24,6 +25,14 @@ use Joomla\Registry\Registry as JoomlaRegistry; */ class Registry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess, \IteratorAggregate, \Countable { + /** + * Default indentation value + * + * @var int + * @since 1.0 + */ + protected $indent = 2; + /** * Method to iterate over any part of the registry * @@ -43,6 +52,73 @@ class Registry extends JoomlaRegistry implements \JsonSerializable, \ArrayAccess } return $data->getIterator(); - } + } + + /** + * Method to export a set of values to a PHP array + * + * @param string $path Registry path (e.g. joomla.content.showauthor) + * @param int $default The default indentation + * + * @return ?string The var set being exported as a PHP array + * + * @since 3.4.0 + */ + public function varExport(string $path, int $default = 2): ?string + { + // check if we have data + if (($data = $this->extract($path)) !== null) + { + // set the default indentation value + $this->indent = $default; + + // convert to array + $data = $data->toArray(); + + // convert to string + $data = var_export($data, true); + + // replace all space with system indentation + $data = preg_replace_callback("/^(\s{2})(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(\s{2})?(.*)/m", [$this, 'convertIndent'], $data); + + // convert all array to [] + $array = preg_split("/\r\n|\n|\r/", $data); + $array = preg_replace(["/\s*array\s\($/", "/\)(,)?$/", "/\s=>\s$/"], [NULL, ']$1', ' => ['], $array); + $data = join(PHP_EOL, array_filter(["["] + $array)); + + // add needed indentation to the last ] + $data = preg_replace("/^(\])/m", Indent::_($default) . '$1', $data); + + return $data; + } + return null; + } + + /** + * Method to convert found of grouped spaces to system indentation + * + * @param array $matches The regex array of matching values + * + * @return string The resulting string. + * + * @since 3.4.0 + */ + protected function convertIndent(array $matches): string + { + // set number to indent by default + $indent = Indent::_($this->indent); + + // update each found space (group) with one indentation + foreach (range(1, 11) as $space) + { + if (strlen($matches[$space]) > 0) + { + $indent .= Indent::_(1); + } + } + + return $indent . $matches[12]; + } + } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php index 3182fa113..32a6edc76 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Path.php @@ -44,9 +44,9 @@ abstract class Path { foreach ($targets as $target) { - if (isset($values[$target]) && strpos($values[$target], '\\') !== false) + if (isset($values[$target])) { - $values[$target] = str_replace('\\', '/', $values[$target]); + self::fix($values[$target], $targets); } } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php new file mode 100644 index 000000000..34a5b8c5b --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent.php @@ -0,0 +1,170 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Database\Get; +use VDM\Joomla\Componentbuilder\Search\Database\Set; +use VDM\Joomla\Componentbuilder\Search\Agent\Find; +use VDM\Joomla\Componentbuilder\Search\Agent\Replace; +use VDM\Joomla\Componentbuilder\Search\Agent\Search; + + +/** + * Search Agent + * + * @since 3.2.0 + */ +class Agent +{ + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search Get Database + * + * @var Get + * @since 3.2.0 + */ + protected Get $get; + + /** + * Search Set Database + * + * @var Set + * @since 3.2.0 + */ + protected Set $set; + + /** + * Search Find + * + * @var Find + * @since 3.2.0 + */ + protected Find $find; + + /** + * Search Replace + * + * @var Replace + * @since 3.2.0 + */ + protected Replace $replace; + + /** + * Search + * + * @var Search + * @since 3.2.0 + */ + protected Search $search; + + /** + * 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. + * + * @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) + { + $this->config = $config ?: Factory::_('Config'); + $this->get = $get ?: Factory::_('Get.Database'); + $this->set = $set ?: Factory::_('Set.Database'); + $this->find = $find ?: Factory::_('Agent.Find'); + $this->replace = $replace ?: Factory::_('Agent.Replace'); + $this->search = $search ?: Factory::_('Agent.Search'); + } + + /** + * Search the posted table for the search value and return all + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function find(?string $table = null): ?array + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + $set = 1; + + // continue loading items until all are searched + while(($items = $this->get->items($table, $set)) !== null) + { + $this->find->items($items, $table); + $set++; + } + + return $this->search->found($table); + } + + /** + * Search the posted table for the search value, and replace all + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function replace(?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + $set = 1; + + // continue loading items until all was loaded + while(($items = $this->get->items($table, $set)) !== null) + { + // search for items + $this->find->items($items, $table); + + // update those found + $this->replace->items($this->find->get($table), $table); + + // update the database + $this->set->items($this->replace->get($table), $table); + + // reset found items + $this->find->reset($table); + $this->replace->reset($table); + + $set++; + } + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Find.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Find.php new file mode 100644 index 000000000..9c3e4d5fd --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Find.php @@ -0,0 +1,180 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Agent; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Agent\Search; +use VDM\Joomla\Componentbuilder\Search\Interfaces\FindInterface; + + +/** + * Search Agent Find + * + * @since 3.2.0 + */ +class Find implements FindInterface +{ + /** + * Found Values + * + * @var array + * @since 3.2.0 + */ + protected array $found = []; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search + * + * @var Search + * @since 3.2.0 + */ + protected Search $search; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Search|null $search The search object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Search $search = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->search = $search ?: Factory::_('Agent.Search'); + } + + /** + * Get found values + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function get(?string $table = null): ?array + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (isset($this->found[$table])) + { + return $this->found[$table]; + } + + return null; + } + + /** + * Search over an item fields + * + * @param object $item The item object of fields to search through + * @param int|null $id The item id + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function item(object $item, ?int $id =null, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // set the item id + if (empty($id)) + { + $id = $item->id; + } + + if (ObjectHelper::check($item)) + { + foreach ($item as $field => $value) + { + if ($field !== 'id' && $this->search->value($value, $id, $field, $table)) + { + if (empty($this->found[$table][$id])) + { + $this->found[$table][$id] = new \stdClass(); + $this->found[$table][$id]->id = $id; + } + $this->found[$table][$id]->{$field} = $value; + } + } + } + } + + /** + * Search over an array of items + * + * @param array|null $items The array of items to search through + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (ArrayHelper::check($items)) + { + foreach ($items as $id => $item) + { + $this->item($item, $id, $table); + } + } + } + + /** + * Reset all found values of a table + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function reset(?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // empty or unset the table active values + unset($this->found[$table]); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Replace.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Replace.php new file mode 100644 index 000000000..c0de189bf --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Replace.php @@ -0,0 +1,181 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Agent; + + +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Agent\Update; +use VDM\Joomla\Componentbuilder\Search\Interfaces\ReplaceInterface; + + +/** + * Search Agent Replace + * + * @since 3.2.0 + */ +class Replace implements ReplaceInterface +{ + /** + * Updated Values + * + * @var array + * @since 3.2.0 + */ + protected array $updated = []; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Update + * + * @var Update + * @since 3.2.0 + */ + protected Update $update; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Update|null $update The update object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Update $update = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->update = $update ?: Factory::_('Agent.Update'); + } + + /** + * Get updated values + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function get(?string $table = null): ?array + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (isset($this->updated[$table])) + { + return $this->updated[$table]; + } + + return null; + } + + /** + * Search over an item fields + * + * @param object $item The item object of fields to search through + * @param int|null $id The item id + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function item(object $item, ?int $id =null, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // set the item id + if (empty($id)) + { + $id = $item->id; + } + + if (ObjectHelper::check($item)) + { + foreach ($item as $field => $value) + { + if ($field !== 'id' && ($_value = $this->update->value($value, $id, $field, $table)) !== null) + { + if (empty($this->updated[$table][$id])) + { + $this->updated[$table][$id] = new \stdClass(); + $this->updated[$table][$id]->id = $id; + } + // add updated value + $this->updated[$table][$id]->{$field} = $_value; + } + } + } + } + + /** + * Search over an array of items + * + * @param array|null $items The array of items to search through + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (ArrayHelper::check($items)) + { + foreach ($items as $id => $item) + { + $this->item($item, $id, $table); + } + } + } + + /** + * Reset all updated values of a table + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function reset(?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // empty or unset the table active values + unset($this->updated[$table]); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Search.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Search.php new file mode 100644 index 000000000..3aac163b5 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Search.php @@ -0,0 +1,74 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Agent; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; + + +/** + * Search Agent Search + * + * @since 3.2.0 + */ +class Search +{ + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + } + + /** + * Search inside a value + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function value($value, int $id, string $field, ?string $table = null): bool + { + return true; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Update.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Update.php new file mode 100644 index 000000000..b253e4bbd --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/Update.php @@ -0,0 +1,74 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Agent; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; + + +/** + * Search Agent Update + * + * @since 3.2.0 + */ +class Update +{ + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + } + + /** + * Update value + * + * @param mixed $value The field value + * @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($value, int $id, string $field, ?string $table = null) + { + return $value; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Agent/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php new file mode 100644 index 000000000..83e423980 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Config.php @@ -0,0 +1,125 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use VDM\Joomla\Componentbuilder\BaseConfig; + + +/** + * Search Configurations + * + * @since 3.2.0 + */ +class Config extends BaseConfig +{ + /** + * get posted search value + * + * @return string Raw search value + * @since 3.2.0 + */ + protected function getSearchvalue(): string + { + return $this->input->post->get('search_value', null, 'RAW'); + } + + /** + * get posted replace value + * + * @return string Raw replace value + * @since 3.2.0 + */ + protected function getReplacevalue(): string + { + return $this->input->post->get('replace_value', null, 'RAW'); + } + + /** + * get posted search match case + * + * @return int Match case + * @since 3.2.0 + */ + protected function getMatchcase(): int + { + return $this->input->post->get('match_case', 0, 'INT'); + } + + /** + * get posted search whole word + * + * @return int Whole word + * @since 3.2.0 + */ + protected function getWholeword(): int + { + return $this->input->post->get('whole_word', 0, 'INT'); + } + + /** + * get posted search regex + * + * @return int Regex + * @since 3.2.0 + */ + protected function getRegex(): int + { + return $this->input->post->get('regex_search', 0, 'INT'); + } + + /** + * get posted component + * + * @return int Component ID + * @since 3.2.0 + */ + protected function getComponentid(): int + { + return $this->input->post->get('component_id', 0, 'INT'); + } + + /** + * get posted area/table + * + * @return string Table name + * @since 3.2.0 + */ + protected function getTablename(): string + { + return $this->input->post->get('table_name', null, 'word'); + } + + /** + * get posted field + * + * @return string Field name + * @since 3.2.0 + */ + protected function getFieldname(): string + { + return $this->input->post->get('field_name', null, 'word'); + } + + /** + * get posted item id + * + * @return int Item id + * @since 3.2.0 + */ + protected function getItemid(): int + { + return $this->input->post->get('item_id', 0, 'INT'); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php new file mode 100644 index 000000000..d84927f53 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Get.php @@ -0,0 +1,295 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Database; + + +use Joomla\CMS\Factory as JoomlaFactory; +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; +use VDM\Joomla\Componentbuilder\Search\Model\Get as Model; +use VDM\Joomla\Componentbuilder\Search\Interfaces\GetInterface; + + +/** + * Search Database Get + * + * @since 3.2.0 + */ +class Get implements GetInterface +{ + /** + * Bundle Size + * + * @var int + * @since 3.2.0 + */ + protected int $bundle = 300; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Search Model + * + * @var Model + * @since 3.2.0 + */ + protected Model $model; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * @param Model|null $model The search get model object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null, + ?Model $model = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + $this->model = $model ?: Factory::_('Get.Model'); + $this->db = $db ?: JoomlaFactory::getDbo(); + } + + /** + * Get values 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|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value(string $field, int $id, string $table = null) + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid field and table + if ($id > 0 && ($name = $this->table->get($table, $field, 'name')) !== null) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Order it by the ordering field. + $query->select($name); + $query->from($this->db->quoteName('#__componentbuilder_' . $table)); + + // get by id + $query->where($this->db->quoteName('id') . " = " . $id); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + $this->db->execute(); + + // check if we have any values + if ($this->db->getNumRows()) + { + // return found values + return $this->model->value($this->db->loadResult(), $name, $table); + } + } + return null; + } + + /** + * Get values from a given table + * Example: $this->item(23, 'table_name'); + * + * @param int $id The item ID + * @param string| null $table The table + * + * @return object|null + * @since 3.2.0 + */ + public function item(int $id, string $table = null): ?object + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if ($id > 0 && ($fields = $this->table->fields($table)) !== null) + { + // add the ID + array_unshift($fields , 'id'); + + // Create a new query object. + $query = $this->db->getQuery(true); + + // Order it by the ordering field. + $query->select($this->db->quoteName($fields)); + $query->from($this->db->quoteName('#__componentbuilder_' . $table)); + + // get by id + $query->where($this->db->quoteName('id') . " = " . $id); + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + $this->db->execute(); + + // check if we have any values + if ($this->db->getNumRows()) + { + // return found values + return $this->model->item($this->db->loadObject(), $table); + } + } + return null; + } + + /** + * Get values from a given table + * Example: $this->items('table_name'); + * + * @param string|null $table The table + * @param int $bundle The bundle to return (0 = all) + * + * @return array|null + * @since 3.2.0 + */ + public function items(string $table = null, int $bundle = 0): ?array + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($fields = $this->table->fields($table)) !== null) + { + // add the ID + array_unshift($fields , 'id'); + + // get the title value + $title = $this->table->titleName($table); + + // Create a new query object. + $query = $this->db->getQuery(true); + + // Order it by the ordering field. + $query->select($this->db->quoteName($fields)); + $query->from($this->db->quoteName('#__componentbuilder_' . $table)); + $query->order($title .' ASC'); + + // add limitation and pagination + if ($bundle > 0) + { + // get the incremental number + $query->where($this->db->quoteName('id') . " >= " . $this->next($table, $bundle)); + + // only return a limited number + $query->setLimit($this->bundle); + } + + // Reset the query using our newly populated query object. + $this->db->setQuery($query); + $this->db->execute(); + + // check if we have any values + if ($this->db->getNumRows()) + { + // return found values + return $this->model->items($this->db->loadObjectList('id'), $table); + } + } + return null; + } + + /** + * Get next id to call + * + * @param string $table The table + * @param int $bundle The bundle to return + * + * @return int + * @since 3.2.0 + */ + protected function next(string $table, int $bundle): int + { + if ($bundle == 1 || $bundle == 0) + { + return 1; + } + + if (($number = $this->model->last($table)) !== null) + { + return $number + 1; + } + + return $this->incremental($bundle); + } + + /** + * Get Incremental number where the set starts + * + * @param int $bundle The bundle to return + * + * @return int + * @since 3.2.0 + */ + protected function incremental(int $bundle): int + { + // just in case + if ($bundle == 1 || $bundle == 0) + { + return 1; + } + + /** Number two set starts at 301 + * 2 x 300 = 600 + * 600 - 300 = 300 + * 300 + 1 = 301 <-- + * Number five set starts at 1201 + * 5 x 300 = 1500 + * 1500 - 300 = 1200 + * 1200 + 1 = 1201 <-- + **/ + return (($bundle * $this->bundle) - $this->bundle) + 1; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Set.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Set.php new file mode 100644 index 000000000..8afa6201d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Set.php @@ -0,0 +1,187 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Database; + + +use Joomla\CMS\Factory as JoomlaFactory; +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\Componentbuilder\Search\Interfaces\SetInterface; + + +/** + * Search Database Set + * + * @since 3.2.0 + */ +class Set implements SetInterface +{ + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Search Model + * + * @var Model + * @since 3.2.0 + */ + protected Model $model; + + /** + * Database object to query local DB + * + * @var \JDatabaseDriver + * @since 3.2.0 + **/ + protected \JDatabaseDriver $db; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * @param Model|null $model The search get model object. + * @param \JDatabaseDriver|null $db The database object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null, + ?Model $model = null, ?\JDatabaseDriver $db = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + $this->model = $model ?: Factory::_('Set.Model'); + $this->db = $db ?: JoomlaFactory::getDbo(); + } + + /** + * Set values to a given table + * Example: $this->value(Value, 23, 'value_key', 'table_name'); + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function value($value, int $id, string $field, ?string $table = null): bool + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid field and table + if ($id > 0 && ($name = $this->table->get($table, $field, 'name')) !== null) + { + // build the object + $item = new \stdClass(); + $item->id = $id; + $item->{$name} = $this->model->value($value, $name, $table); + + // Update the column of this table using id as the primary key. + return $this->db->updateObject('#__componentbuilder_' . $table, $item, 'id'); + } + return false; + } + + /** + * Set values to a given table + * Example: $this->item(Object, 23, 'table_name'); + * + * @param object $item The item to save + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): bool + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($fields = $this->table->fields($table)) !== null) + { + // model the item values + foreach ($fields as $field) + { + if (isset($item->{$field})) + { + $item->{$field} = $this->model->value($item->{$field}, $field, $table); + } + } + + // Update the column of this table using id as the primary key. + return $this->db->updateObject('#__componentbuilder_' . $table, $item, 'id'); + } + return false; + } + + /** + * Set values to a given table + * Example: $this->items(Array, 'table_name'); + * + * @param array $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 + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (ArrayHelper::check($items)) + { + $success = true; + foreach ($items as $item) + { + if ($this->item($item, $table) !== true) + { + $success = false; + break; + } + } + return $success; + } + return false; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php new file mode 100644 index 000000000..8f712414b --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Factory.php @@ -0,0 +1,80 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use Joomla\DI\Container; + + +/** + * Search Factory + * + * @since 3.2.0 + */ +abstract class Factory +{ + /** + * Global Compiler Container + * + * @var Container + * @since 3.2.0 + **/ + protected static $container = null; + + /** + * Get any class from the compiler container + * + * @param string $key The container class key + * + * @return Mixed + * @since 3.2.0 + */ + public static function _($key) + { + return self::getContainer()->get($key); + } + + /** + * Get a the global compiler container + * + * @return Container + * @since 3.2.0 + */ + public static function getContainer(): Container + { + if (!self::$container) + { + self::$container = self::createContainer(); + } + + return self::$container; + } + + /** + * Create a container object + * + * @return Container + * @since 3.2.0 + */ + protected static function createContainer(): Container + { + $container = (new Container()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Search()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Model()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Database()) + ->registerServiceProvider(new \VDM\Joomla\Componentbuilder\Search\Service\Agent()); + + return $container; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/FindInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/FindInterface.php new file mode 100644 index 000000000..d8bca4d6b --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/FindInterface.php @@ -0,0 +1,65 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Find Interface + * + * @since 3.2.0 + */ +interface FindInterface +{ + /** + * Get found values + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function get(?string $table = null): ?array; + + /** + * Search over an item fields + * + * @param object $item The item object of fields to search through + * @param int|null $id The item id + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function item(object $item, ?int $id =null, ?string $table = null); + + /** + * Search over an array of items + * + * @param array|null $items The array of items to search through + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null); + + /** + * Reset all found values of a table + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function reset(?string $table = null); +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php new file mode 100644 index 000000000..d02daeef1 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/GetInterface.php @@ -0,0 +1,60 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Database Get Interface + * + * @since 3.2.0 + */ +interface GetInterface +{ + /** + * Get values 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|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value(string $field, int $id, string $table = null); + + /** + * Get values from a given table + * Example: $this->item(23, 'table_name'); + * + * @param int $id The item ID + * @param string| null $table The table + * + * @return object|null + * @since 3.2.0 + */ + public function item(int $id, string $table = null): ?object; + + /** + * Get values from a given table + * Example: $this->items('table_name'); + * + * @param string|null $table The table + * @param int $bundle The bundle to return (0 = all) + * + * @return array|null + * @since 3.2.0 + */ + public function items(string $table = null, int $bundle = 0): ?array; + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ModelInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ModelInterface.php new file mode 100644 index 000000000..c0aa6a2a2 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ModelInterface.php @@ -0,0 +1,71 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Model Interface + * + * @since 3.2.0 + */ +interface ModelInterface +{ + /** + * Model the value + * Example: $this->value(value, 'value_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value($value, string $field, ?string $table = null); + + /** + * Model the values of an item + * Example: $this->item('table_name', Object); + * + * @param string $table The table + * @param object $item The item object + * + * @return object + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): object; + + /** + * Model the values of multiple items + * Example: $this->items(Array, 'table_name'); + * + * @param array|null $items The array of item objects + * @param string|null $table The table + * + * @return array|null + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null): ?array; + + /** + * Get last modeled ID + * Example: $this->last('table_name'); + * + * @param string|null $table The table + * + * @return int|null + * @since 3.2.0 + */ + public function last(?string $table = null): ?int; + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ReplaceInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ReplaceInterface.php new file mode 100644 index 000000000..bb619f2cf --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/ReplaceInterface.php @@ -0,0 +1,66 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Replace Interface + * + * @since 3.2.0 + */ +interface ReplaceInterface +{ + /** + * Get updated values + * + * @param string|null $table The table being searched + * + * @return array|null + * @since 3.2.0 + */ + public function get(?string $table = null): ?array; + + /** + * Search over an item fields + * + * @param object $item The item object of fields to search through + * @param int|null $id The item id + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function item(object $item, ?int $id =null, ?string $table = null); + + /** + * Search over an array of items + * + * @param array|null $items The array of items to search through + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null); + + /** + * Reset all updated values of a table + * + * @param string|null $table The table being searched + * + * @return void + * @since 3.2.0 + */ + public function reset(?string $table = null); + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SetInterface.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SetInterface.php new file mode 100644 index 000000000..f8a62ee82 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/SetInterface.php @@ -0,0 +1,60 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Interfaces; + + +/** + * Search Database Set Interface + * + * @since 3.2.0 + */ +interface SetInterface +{ + /** + * Set values to a given table + * Example: $this->value(Value, 23, 'value_key', 'table_name'); + * + * @param mixed $value The field value + * @param int $id The item ID + * @param string $field The field key + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function value($value, int $id, string $field, ?string $table = null): bool; + + /** + * Set values to a given table + * Example: $this->item(Object, 23, 'table_name'); + * + * @param object $item The item to save + * @param string|null $table The table + * + * @return bool + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): bool; + + /** + * Set values to a given table + * Example: $this->items(Array, 'table_name'); + * + * @param array $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; +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Interfaces/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model.php new file mode 100644 index 000000000..7e5cc2984 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model.php @@ -0,0 +1,160 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; +use VDM\Joomla\Utilities\ArrayHelper; + + +/** + * Search Model + * + * @since 3.2.0 + */ +abstract class Model +{ + /** + * Last ID + * + * @var array + * @since 3.2.0 + */ + protected array $last; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Search Table + * + * @var Table + * @since 3.2.0 + */ + protected Table $table; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * @param Table|null $table The search table object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null, ?Table $table = null) + { + $this->config = $config ?: Factory::_('Config'); + $this->table = $table ?: Factory::_('Table'); + } + + /** + * Model the values of an item + * Example: $this->item(Object, 'table_name'); + * + * @param object $item The item object + * @param string|null $table The table + * + * @return object + * @since 3.2.0 + */ + public function item(object $item, ?string $table = null): object + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($fields = $this->table->fields($table)) !== null) + { + foreach ($fields as $field) + { + if(isset($item->{$field})) + { + $item->{$field} = $this->value($item->{$field}, $field, $table); + } + } + } + + return $item; + } + + /** + * Model the values of multiple items + * Example: $this->items(Array, 'table_name'); + * + * @param array|null $items The array of item objects + * @param string|null $table The table + * + * @return array|null + * @since 3.2.0 + */ + public function items(?array $items = null, ?string $table = null): ?array + { + // check if this is a valid table + if (ArrayHelper::check($items)) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + foreach ($items as $id => &$item) + { + // model the item + $item = $this->item($item, $table); + + // add the last ID + $this->last[$table] = $item->id; + } + } + + return $items; + } + + /** + * Get last modeled ID + * Example: $this->last('table_name'); + * + * @param string|null $table The table + * + * @return int|null + * @since 3.2.0 + */ + public function last(?string $table = null): ?int + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if ($table && isset($this->last[$table])) + { + return $this->last[$table]; + } + + return null; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Get.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Get.php new file mode 100644 index 000000000..4f5b3d756 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Get.php @@ -0,0 +1,63 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Model; + + +use VDM\Joomla\Componentbuilder\Search\Interfaces\ModelInterface; +use VDM\Joomla\Componentbuilder\Search\Model; + + +/** + * Search Get Model + * + * @since 3.2.0 + */ +class Get extends Model implements ModelInterface +{ + /** + * Model the value + * Example: $this->value(value, 'value_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value($value, string $field, ?string $table = null) + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($store = $this->table->get($table, $field, 'store')) !== null) + { + // open the value based on the store method + switch($store) + { + case 'base64': + $value = \base64_decode($value); + break; + case 'json': + $value = \json_decode($value, true); + break; + } + } + return $value; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Set.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Set.php new file mode 100644 index 000000000..274f0e897 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Set.php @@ -0,0 +1,63 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Model; + + +use VDM\Joomla\Componentbuilder\Search\Interfaces\ModelInterface; +use VDM\Joomla\Componentbuilder\Search\Model; + + +/** + * Search Set Model + * + * @since 3.2.0 + */ +class Set extends Model implements ModelInterface +{ + /** + * Model the value + * Example: $this->value(value, 'field_key', 'table_name'); + * + * @param mixed $value The value to model + * @param string $field The field key + * @param string|null $table The table + * + * @return mixed + * @since 3.2.0 + */ + public function value($value, string $field, ?string $table = null) + { + // set the table name + if (empty($table)) + { + $table = $this->config->table_name; + } + + // check if this is a valid table + if (($store = $this->table->get($table, $field, 'store')) !== null) + { + // open the value based on the store method + switch($store) + { + case 'base64': + $value = \base64_encode($value); + break; + case 'json': + $value = \json_encode($value, JSON_FORCE_OBJECT); + break; + } + } + return $value; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php new file mode 100644 index 000000000..d487ab809 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Agent.php @@ -0,0 +1,142 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Search\Agent as SearchAgent; +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; + + +/** + * Agent Service Provider + * + * @since 3.2.0 + */ +class Agent implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(SearchAgent::class, 'Agent') + ->share('Agent', [$this, 'getAgent'], true); + + $container->alias(Find::class, 'Agent.Find') + ->share('Agent.Find', [$this, 'getFind'], true); + + $container->alias(Replace::class, 'Agent.Replace') + ->share('Agent.Replace', [$this, 'getReplace'], true); + + $container->alias(Search::class, 'Agent.Search') + ->share('Agent.Search', [$this, 'getSearch'], true); + + $container->alias(Update::class, 'Agent.Update') + ->share('Agent.Update', [$this, 'getUpdate'], true); + } + + /** + * Get the Search Agent + * + * @param Container $container The DI container. + * + * @return SearchAgent + * @since 3.2.0 + */ + public function getAgent(Container $container): SearchAgent + { + return new SearchAgent( + $container->get('Config'), + $container->get('Get.Database'), + $container->get('Set.Database'), + $container->get('Agent.Find'), + $container->get('Agent.Replace'), + $container->get('Agent.Search') + ); + } + + /** + * Get the Search Agent Find + * + * @param Container $container The DI container. + * + * @return Find + * @since 3.2.0 + */ + public function getFind(Container $container): Find + { + return new Find( + $container->get('Config'), + $container->get('Agent.Search') + ); + } + + /** + * Get the Search Agent Replace + * + * @param Container $container The DI container. + * + * @return Replace + * @since 3.2.0 + */ + public function getReplace(Container $container): Replace + { + return new Replace( + $container->get('Config'), + $container->get('Agent.Update') + ); + } + + /** + * Get the Search Agent Search + * + * @param Container $container The DI container. + * + * @return Search + * @since 3.2.0 + */ + public function getSearch(Container $container): Search + { + return new Search( + $container->get('Config'), + $container->get('Table') + ); + } + + /** + * Get the Search Agent Update + * + * @param Container $container The DI container. + * + * @return Update + * @since 3.2.0 + */ + public function getUpdate(Container $container): Update + { + return new Update( + $container->get('Config'), + $container->get('Table') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Database.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Database.php new file mode 100644 index 000000000..d5586a786 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Database.php @@ -0,0 +1,80 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Search\Database\Get as GetDatabase; +use VDM\Joomla\Componentbuilder\Search\Database\Set as SetDatabase; + + +/** + * Database Service Provider + * + * @since 3.2.0 + */ +class Database implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(GetDatabase::class, 'Get.Database') + ->share('Get.Database', [$this, 'getDatabaseGet'], true); + + $container->alias(SetDatabase::class, 'Set.Database') + ->share('Set.Database', [$this, 'getDatabaseSet'], true); + } + + /** + * Get the Get Database + * + * @param Container $container The DI container. + * + * @return GetDatabase + * @since 3.2.0 + */ + public function getDatabaseGet(Container $container): GetDatabase + { + return new GetDatabase( + $container->get('Config'), + $container->get('Table'), + $container->get('Get.Model') + ); + } + + /** + * Get the Set Database + * + * @param Container $container The DI container. + * + * @return SetDatabase + * @since 3.2.0 + */ + public function getDatabaseSet(Container $container): SetDatabase + { + return new SetDatabase( + $container->get('Config'), + $container->get('Table'), + $container->get('Set.Model') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Model.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Model.php new file mode 100644 index 000000000..9e3817f83 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Model.php @@ -0,0 +1,78 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Search\Model\Get; +use VDM\Joomla\Componentbuilder\Search\Model\Set; + + +/** + * Model Service Provider + * + * @since 3.2.0 + */ +class Model implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Get::class, 'Get.Model') + ->share('Get.Model', [$this, 'getModelGet'], true); + + $container->alias(Set::class, 'Set.Model') + ->share('Set.Model', [$this, 'getModelSet'], true); + } + + /** + * Get the Get Model + * + * @param Container $container The DI container. + * + * @return Get + * @since 3.2.0 + */ + public function getModelGet(Container $container): Get + { + return new Get( + $container->get('Config'), + $container->get('Table') + ); + } + + /** + * Get the Set Model + * + * @param Container $container The DI container. + * + * @return Set + * @since 3.2.0 + */ + public function getModelSet(Container $container): Set + { + return new Set( + $container->get('Config'), + $container->get('Table') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php new file mode 100644 index 000000000..6b26bf9aa --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/Search.php @@ -0,0 +1,74 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Search\Config; +use VDM\Joomla\Componentbuilder\Search\Table; + + +/** + * Search Service Provider + * + * @since 3.2.0 + */ +class Search implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(Config::class, 'Config') + ->share('Config', [$this, 'getConfig'], true); + + $container->alias(Table::class, 'Table') + ->share('Table', [$this, 'getTable'], true); + } + + /** + * Get the Config + * + * @param Container $container The DI container. + * + * @return Config + * @since 3.2.0 + */ + public function getConfig(Container $container): Config + { + return new Config(); + } + + /** + * Get the Table + * + * @param Container $container The DI container. + * + * @return Table + * @since 3.2.0 + */ + public function getTable(Container $container): Table + { + return new Table( + $container->get('Config') + ); + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Service/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php new file mode 100644 index 000000000..d40448f72 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Table.php @@ -0,0 +1,3026 @@ + + * @git 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 + */ + +namespace VDM\Joomla\Componentbuilder\Search; + + +use VDM\Joomla\Componentbuilder\Search\Factory; +use VDM\Joomla\Componentbuilder\Search\Config; + + +/** + * Search Table + * + * @since 3.2.0 + */ +class Table +{ + /** + * All areas/views/tables with their field details to SEARCH + * + * @var array + * @since 3.2.0 + **/ + protected $tables = [ + 'joomla_component' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => true, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'name_code' => [ + 'name' => 'name_code', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'short_description' => [ + 'name' => 'short_description', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'companyname' => [ + 'name' => 'companyname', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_helper_both' => [ + 'name' => 'php_helper_both', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'crowdin_project_identifier' => [ + 'name' => 'crowdin_project_identifier', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_method_uninstall' => [ + 'name' => 'php_method_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'php_preflight_install' => [ + 'name' => 'php_preflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'css_admin' => [ + 'name' => 'css_admin', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'php_admin_event' => [ + 'name' => 'php_admin_event', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'php_site_event' => [ + 'name' => 'php_site_event', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'author' => [ + 'name' => 'author', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_postflight_install' => [ + 'name' => 'php_postflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'email' => [ + 'name' => 'email', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'sql_uninstall' => [ + 'name' => 'sql_uninstall', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'website' => [ + 'name' => 'website', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_helper_admin' => [ + 'name' => 'php_helper_admin', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'whmcs_key' => [ + 'name' => 'whmcs_key', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'php_helper_site' => [ + 'name' => 'php_helper_site', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'whmcs_url' => [ + 'name' => 'whmcs_url', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'javascript' => [ + 'name' => 'javascript', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'whmcs_buy_link' => [ + 'name' => 'whmcs_buy_link', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'css_site' => [ + 'name' => 'css_site', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'license' => [ + 'name' => 'license', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_preflight_update' => [ + 'name' => 'php_preflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'php_postflight_update' => [ + 'name' => 'php_postflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'copyright' => [ + 'name' => 'copyright', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'sql' => [ + 'name' => 'sql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'update_server_url' => [ + 'name' => 'update_server_url', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'component_version' => [ + 'name' => 'component_version', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'crowdin_username' => [ + 'name' => 'crowdin_username', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Dynamic Integration', + ], + 'buildcompsql' => [ + 'name' => 'buildcompsql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dynamic Build (beta)', + ], + 'menu_prefix' => [ + 'name' => 'menu_prefix', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'toignore' => [ + 'name' => 'toignore', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'export_key' => [ + 'name' => 'export_key', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Settings', + ], + 'joomla_source_link' => [ + 'name' => 'joomla_source_link', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'export_buy_link' => [ + 'name' => 'export_buy_link', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'addcontributors' => [ + 'name' => 'addcontributors', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'readme' => [ + 'name' => 'readme', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Readme', + ], + 'crowdin_project_api_key' => [ + 'name' => 'crowdin_project_api_key', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Dynamic Integration', + ], + 'crowdin_account_api_key' => [ + 'name' => 'crowdin_account_api_key', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Dynamic Integration', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'joomla_module' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => true, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'HTML', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'HTML', + ], + 'default' => [ + 'name' => 'default', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'HTML', + ], + 'module_version' => [ + 'name' => 'module_version', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'HTML', + ], + 'php_preflight_update' => [ + 'name' => 'php_preflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_preflight_uninstall' => [ + 'name' => 'php_preflight_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'mod_code' => [ + 'name' => 'mod_code', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'php_postflight_install' => [ + 'name' => 'php_postflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_postflight_update' => [ + 'name' => 'php_postflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_method_uninstall' => [ + 'name' => 'php_method_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'class_helper_header' => [ + 'name' => 'class_helper_header', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Helper', + ], + 'sql' => [ + 'name' => 'sql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'class_helper_code' => [ + 'name' => 'class_helper_code', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Helper', + ], + 'sql_uninstall' => [ + 'name' => 'sql_uninstall', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'fields' => [ + 'name' => 'fields', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'json', + 'tab_name' => 'Forms & Fields', + ], + 'readme' => [ + 'name' => 'readme', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Readme', + ], + 'update_server_url' => [ + 'name' => 'update_server_url', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_script_construct' => [ + 'name' => 'php_script_construct', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_preflight_install' => [ + 'name' => 'php_preflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_modules', + 'store' => NULL, + 'tab_name' => 'HTML', + ], + ], + 'joomla_plugin' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => true, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'method_selection' => [ + 'name' => 'method_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'property_selection' => [ + 'name' => 'property_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'head' => [ + 'name' => 'head', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'main_class_code' => [ + 'name' => 'main_class_code', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'php_postflight_install' => [ + 'name' => 'php_postflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'plugin_version' => [ + 'name' => 'plugin_version', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'php_postflight_update' => [ + 'name' => 'php_postflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'fields' => [ + 'name' => 'fields', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'json', + 'tab_name' => 'Forms & Fields', + ], + 'php_method_uninstall' => [ + 'name' => 'php_method_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'sql' => [ + 'name' => 'sql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'php_script_construct' => [ + 'name' => 'php_script_construct', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'sql_uninstall' => [ + 'name' => 'sql_uninstall', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'readme' => [ + 'name' => 'readme', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Readme', + ], + 'php_preflight_install' => [ + 'name' => 'php_preflight_install', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'update_server_url' => [ + 'name' => 'update_server_url', + 'type' => 'url', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_preflight_update' => [ + 'name' => 'php_preflight_update', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'php_preflight_uninstall' => [ + 'name' => 'php_preflight_uninstall', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => 'base64', + 'tab_name' => 'Script File', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_plugins', + 'store' => NULL, + 'tab_name' => 'Code', + ], + ], + 'power' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => true, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'namespace' => [ + 'name' => 'namespace', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'power_version' => [ + 'name' => 'power_version', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'load_selection' => [ + 'name' => 'load_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'powers', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'main_class_code' => [ + 'name' => 'main_class_code', + 'type' => 'editor', + 'title' => false, + 'list' => 'powers', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'use_selection' => [ + 'name' => 'use_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'powers', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'property_selection' => [ + 'name' => 'property_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'powers', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'implements_custom' => [ + 'name' => 'implements_custom', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'extends_custom' => [ + 'name' => 'extends_custom', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + 'method_selection' => [ + 'name' => 'method_selection', + 'type' => 'subform', + 'title' => false, + 'list' => 'powers', + 'store' => 'json', + 'tab_name' => 'Code', + ], + 'head' => [ + 'name' => 'head', + 'type' => 'editor', + 'title' => false, + 'list' => 'powers', + 'store' => 'base64', + 'tab_name' => 'Code', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => false, + 'list' => 'powers', + 'store' => NULL, + 'tab_name' => 'Code', + ], + ], + 'admin_view' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'name_single' => [ + 'name' => 'name_single', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'short_description' => [ + 'name' => 'short_description', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_allowedit' => [ + 'name' => 'php_allowedit', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_postsavehook' => [ + 'name' => 'php_postsavehook', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_before_save' => [ + 'name' => 'php_before_save', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_getlistquery' => [ + 'name' => 'php_getlistquery', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_import_ext' => [ + 'name' => 'php_import_ext', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_after_publish' => [ + 'name' => 'php_after_publish', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_after_cancel' => [ + 'name' => 'php_after_cancel', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_batchmove' => [ + 'name' => 'php_batchmove', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_after_delete' => [ + 'name' => 'php_after_delete', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_import' => [ + 'name' => 'php_import', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'addpermissions' => [ + 'name' => 'addpermissions', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'php_getitems_after_all' => [ + 'name' => 'php_getitems_after_all', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_getform' => [ + 'name' => 'php_getform', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'addtabs' => [ + 'name' => 'addtabs', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'php_save' => [ + 'name' => 'php_save', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_allowadd' => [ + 'name' => 'php_allowadd', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_before_cancel' => [ + 'name' => 'php_before_cancel', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'addlinked_views' => [ + 'name' => 'addlinked_views', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'php_batchcopy' => [ + 'name' => 'php_batchcopy', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_before_publish' => [ + 'name' => 'php_before_publish', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_before_delete' => [ + 'name' => 'php_before_delete', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_document' => [ + 'name' => 'php_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'sql' => [ + 'name' => 'sql', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'MySQL', + ], + 'php_import_display' => [ + 'name' => 'php_import_display', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_import_setdata' => [ + 'name' => 'php_import_setdata', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'name_list' => [ + 'name' => 'name_list', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'css_view' => [ + 'name' => 'css_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'CSS', + ], + 'css_views' => [ + 'name' => 'css_views', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'CSS', + ], + 'javascript_view_file' => [ + 'name' => 'javascript_view_file', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript', + ], + 'javascript_view_footer' => [ + 'name' => 'javascript_view_footer', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript', + ], + 'javascript_views_file' => [ + 'name' => 'javascript_views_file', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript', + ], + 'javascript_views_footer' => [ + 'name' => 'javascript_views_footer', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript', + ], + 'custom_button' => [ + 'name' => 'custom_button', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'Custom Buttons', + ], + 'php_controller' => [ + 'name' => 'php_controller', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'php_model' => [ + 'name' => 'php_model', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'php_controller_list' => [ + 'name' => 'php_controller_list', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'php_model_list' => [ + 'name' => 'php_model_list', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'addtables' => [ + 'name' => 'addtables', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'MySQL', + ], + 'php_ajaxmethod' => [ + 'name' => 'php_ajaxmethod', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'ajax_input' => [ + 'name' => 'ajax_input', + 'type' => 'subform', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'json', + 'tab_name' => 'PHP', + ], + 'html_import_view' => [ + 'name' => 'html_import_view', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_getitem' => [ + 'name' => 'php_getitem', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_import_headers' => [ + 'name' => 'php_import_headers', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_import_save' => [ + 'name' => 'php_import_save', + 'type' => 'textarea', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Import', + ], + 'php_getitems' => [ + 'name' => 'php_getitems', + 'type' => 'editor', + 'title' => false, + 'list' => 'admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'admin_views', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + ], + 'custom_admin_view' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'css_document' => [ + 'name' => 'css_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'css' => [ + 'name' => 'css', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'js_document' => [ + 'name' => 'js_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'javascript_file' => [ + 'name' => 'javascript_file', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'codename' => [ + 'name' => 'codename', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'default' => [ + 'name' => 'default', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'context' => [ + 'name' => 'context', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_ajaxmethod' => [ + 'name' => 'php_ajaxmethod', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'ajax_input' => [ + 'name' => 'ajax_input', + 'type' => 'subform', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'json', + 'tab_name' => 'PHP', + ], + 'php_document' => [ + 'name' => 'php_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_view' => [ + 'name' => 'php_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_jview_display' => [ + 'name' => 'php_jview_display', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'custom_button' => [ + 'name' => 'custom_button', + 'type' => 'subform', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'json', + 'tab_name' => 'Custom Buttons', + ], + 'php_jview' => [ + 'name' => 'php_jview', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_controller' => [ + 'name' => 'php_controller', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'php_model' => [ + 'name' => 'php_model', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_admin_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + ], + 'site_view' => [ + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'js_document' => [ + 'name' => 'js_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'codename' => [ + 'name' => 'codename', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'javascript_file' => [ + 'name' => 'javascript_file', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'context' => [ + 'name' => 'context', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'default' => [ + 'name' => 'default', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'css_document' => [ + 'name' => 'css_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'css' => [ + 'name' => 'css', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'JavaScript & CSS', + ], + 'php_ajaxmethod' => [ + 'name' => 'php_ajaxmethod', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'ajax_input' => [ + 'name' => 'ajax_input', + 'type' => 'subform', + 'title' => false, + 'list' => 'site_views', + 'store' => 'json', + 'tab_name' => 'PHP', + ], + 'php_document' => [ + 'name' => 'php_document', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_view' => [ + 'name' => 'php_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_jview_display' => [ + 'name' => 'php_jview_display', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'custom_button' => [ + 'name' => 'custom_button', + 'type' => 'subform', + 'title' => false, + 'list' => 'site_views', + 'store' => 'json', + 'tab_name' => 'Custom Buttons', + ], + 'php_jview' => [ + 'name' => 'php_jview', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'PHP', + ], + 'php_controller' => [ + 'name' => 'php_controller', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'site_views', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'php_model' => [ + 'name' => 'php_model', + 'type' => 'editor', + 'title' => false, + 'list' => 'site_views', + 'store' => 'base64', + 'tab_name' => 'Custom Buttons', + ], + ], + 'template' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'templates', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'templates', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_view' => [ + 'name' => 'php_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'templates', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'template' => [ + 'name' => 'template', + 'type' => 'editor', + 'title' => false, + 'list' => 'templates', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'alias' => [ + 'name' => 'alias', + 'type' => 'text', + 'title' => false, + 'list' => 'templates', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'layout' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'layouts', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'layouts', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_view' => [ + 'name' => 'php_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'layouts', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'layout' => [ + 'name' => 'layout', + 'type' => 'editor', + 'title' => false, + 'list' => 'layouts', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'alias' => [ + 'name' => 'alias', + 'type' => 'text', + 'title' => false, + 'list' => 'layouts', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'dynamic_get' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_router_parse' => [ + 'name' => 'php_router_parse', + 'type' => 'textarea', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_before_getitems' => [ + 'name' => 'php_before_getitems', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_after_getitems' => [ + 'name' => 'php_after_getitems', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_after_getitem' => [ + 'name' => 'php_after_getitem', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_getlistquery' => [ + 'name' => 'php_getlistquery', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'join_db_table' => [ + 'name' => 'join_db_table', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Joint', + ], + 'view_selection' => [ + 'name' => 'view_selection', + 'type' => 'textarea', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_custom_get' => [ + 'name' => 'php_custom_get', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Main', + ], + 'db_selection' => [ + 'name' => 'db_selection', + 'type' => 'textarea', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_calculation' => [ + 'name' => 'php_calculation', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Abacus', + ], + 'php_before_getitem' => [ + 'name' => 'php_before_getitem', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'getcustom' => [ + 'name' => 'getcustom', + 'type' => 'text', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'filter' => [ + 'name' => 'filter', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'where' => [ + 'name' => 'where', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'order' => [ + 'name' => 'order', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'group' => [ + 'name' => 'group', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'global' => [ + 'name' => 'global', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Tweak', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'join_view_table' => [ + 'name' => 'join_view_table', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Joint', + ], + ], + 'custom_code' => [ + 'path' => [ + 'name' => 'path', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'function_name' => [ + 'name' => 'function_name', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'system_name' => [ + 'name' => 'system_name', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'code' => [ + 'name' => 'code', + 'type' => 'editor', + 'title' => false, + 'list' => 'custom_codes', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'hashendtarget' => [ + 'name' => 'hashendtarget', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'to_line' => [ + 'name' => 'to_line', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'from_line' => [ + 'name' => 'from_line', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'hashtarget' => [ + 'name' => 'hashtarget', + 'type' => 'text', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'class_property' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'class_properties', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'class_properties', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'comment' => [ + 'name' => 'comment', + 'type' => 'textarea', + 'title' => false, + 'list' => 'class_properties', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'default' => [ + 'name' => 'default', + 'type' => 'textarea', + 'title' => false, + 'list' => 'class_properties', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + ], + 'class_method' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'class_methods', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'class_methods', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'code' => [ + 'name' => 'code', + 'type' => 'editor', + 'title' => false, + 'list' => 'class_methods', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'comment' => [ + 'name' => 'comment', + 'type' => 'textarea', + 'title' => false, + 'list' => 'class_methods', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'arguments' => [ + 'name' => 'arguments', + 'type' => 'text', + 'title' => false, + 'list' => 'class_methods', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + ], + 'placeholder' => [ + 'target' => [ + 'name' => 'target', + 'type' => 'text', + 'title' => true, + 'list' => 'placeholders', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'value' => [ + 'name' => 'value', + 'type' => 'text', + 'title' => false, + 'list' => 'placeholders', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + ], + 'library' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'libraries', + 'store' => NULL, + 'tab_name' => 'Behaviour', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'libraries', + 'store' => NULL, + 'tab_name' => 'Behaviour', + ], + 'php_setdocument' => [ + 'name' => 'php_setdocument', + 'type' => 'textarea', + 'title' => false, + 'list' => 'libraries', + 'store' => 'base64', + 'tab_name' => 'Behaviour', + ], + 'addconditions' => [ + 'name' => 'addconditions', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries', + 'store' => 'json', + 'tab_name' => 'Behaviour', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'libraries', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + ], + 'snippet' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'url' => [ + 'name' => 'url', + 'type' => 'url', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'heading' => [ + 'name' => 'heading', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + 'contributor_email' => [ + 'name' => 'contributor_email', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Contributor', + ], + 'contributor_name' => [ + 'name' => 'contributor_name', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Contributor', + ], + 'contributor_website' => [ + 'name' => 'contributor_website', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Contributor', + ], + 'contributor_company' => [ + 'name' => 'contributor_company', + 'type' => 'text', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Contributor', + ], + 'snippet' => [ + 'name' => 'snippet', + 'type' => 'textarea', + 'title' => false, + 'list' => 'snippets', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'usage' => [ + 'name' => 'usage', + 'type' => 'textarea', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'snippets', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'validation_rule' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'validation_rules', + 'store' => NULL, + 'tab_name' => 'Extends FormRule', + ], + 'short_description' => [ + 'name' => 'short_description', + 'type' => 'text', + 'title' => false, + 'list' => 'validation_rules', + 'store' => NULL, + 'tab_name' => 'Extends FormRule', + ], + 'php' => [ + 'name' => 'php', + 'type' => 'textarea', + 'title' => false, + 'list' => 'validation_rules', + 'store' => 'base64', + 'tab_name' => 'Extends FormRule', + ], + ], + 'field' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'fields', + 'store' => NULL, + 'tab_name' => 'Set Properties', + ], + 'on_get_model_field' => [ + 'name' => 'on_get_model_field', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Database', + ], + 'on_save_model_field' => [ + 'name' => 'on_save_model_field', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Database', + ], + 'initiator_on_get_model' => [ + 'name' => 'initiator_on_get_model', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Database', + ], + 'css_view' => [ + 'name' => 'css_view', + 'type' => 'editor', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Scripts', + ], + 'javascript_view_footer' => [ + 'name' => 'javascript_view_footer', + 'type' => 'editor', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Scripts', + ], + 'css_views' => [ + 'name' => 'css_views', + 'type' => 'editor', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Scripts', + ], + 'datadefault_other' => [ + 'name' => 'datadefault_other', + 'type' => 'text', + 'title' => false, + 'list' => 'fields', + 'store' => NULL, + 'tab_name' => 'Database', + ], + 'datalenght_other' => [ + 'name' => 'datalenght_other', + 'type' => 'text', + 'title' => false, + 'list' => 'fields', + 'store' => NULL, + 'tab_name' => 'Database', + ], + 'javascript_views_footer' => [ + 'name' => 'javascript_views_footer', + 'type' => 'editor', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Scripts', + ], + 'initiator_on_save_model' => [ + 'name' => 'initiator_on_save_model', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fields', + 'store' => 'base64', + 'tab_name' => 'Database', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'fields', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + ], + 'fieldtype' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'datadefault_other' => [ + 'name' => 'datadefault_other', + 'type' => 'text', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Database (defaults)', + ], + 'datalenght_other' => [ + 'name' => 'datalenght_other', + 'type' => 'text', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Database (defaults)', + ], + 'short_description' => [ + 'name' => 'short_description', + 'type' => 'text', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'properties' => [ + 'name' => 'properties', + 'type' => 'subform', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => 'json', + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'textarea', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'guid' => [ + 'name' => 'guid', + 'type' => 'text', + 'title' => false, + 'list' => 'fieldtypes', + 'store' => NULL, + 'tab_name' => 'publishing', + ], + ], + 'language_translation' => [ + 'source' => [ + 'name' => 'source', + 'type' => 'textarea', + 'title' => true, + 'list' => 'language_translations', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'translation' => [ + 'name' => 'translation', + 'type' => 'subform', + 'title' => false, + 'list' => 'language_translations', + 'store' => 'json', + 'tab_name' => 'Details', + ], + ], + 'language' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'languages', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'langtag' => [ + 'name' => 'langtag', + 'type' => 'text', + 'title' => false, + 'list' => 'languages', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'server' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'servers', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'signature' => [ + 'name' => 'signature', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'private_key' => [ + 'name' => 'private_key', + 'type' => 'textarea', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'private' => [ + 'name' => 'private', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'path' => [ + 'name' => 'path', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'port' => [ + 'name' => 'port', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'host' => [ + 'name' => 'host', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + 'username' => [ + 'name' => 'username', + 'type' => 'text', + 'title' => false, + 'list' => 'servers', + 'store' => 'basic_encryption', + 'tab_name' => 'Details', + ], + ], + 'help_document' => [ + 'title' => [ + 'name' => 'title', + 'type' => 'text', + 'title' => true, + 'list' => 'help_documents', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'content' => [ + 'name' => 'content', + 'type' => 'editor', + 'title' => false, + 'list' => 'help_documents', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'url' => [ + 'name' => 'url', + 'type' => 'url', + 'title' => false, + 'list' => 'help_documents', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'alias' => [ + 'name' => 'alias', + 'type' => 'text', + 'title' => false, + 'list' => 'help_documents', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'admin_fields' => [ + 'addfields' => [ + 'name' => 'addfields', + 'type' => 'subform', + 'title' => false, + 'list' => 'admins_fields', + 'store' => 'json', + 'tab_name' => 'Fields', + ], + ], + 'admin_fields_conditions' => [ + 'addconditions' => [ + 'name' => 'addconditions', + 'type' => 'subform', + 'title' => false, + 'list' => 'admins_fields_conditions', + 'store' => 'json', + 'tab_name' => 'Conditions', + ], + ], + 'admin_fields_relations' => [ + 'addrelations' => [ + 'name' => 'addrelations', + 'type' => 'subform', + 'title' => false, + 'list' => 'admins_fields_relations', + 'store' => 'json', + 'tab_name' => 'Relations', + ], + ], + 'admin_custom_tabs' => [ + 'tabs' => [ + 'name' => 'tabs', + 'type' => 'subform', + 'title' => false, + 'list' => 'admins_custom_tabs', + 'store' => 'json', + 'tab_name' => 'Tabs', + ], + ], + 'component_admin_views' => [ + 'addadmin_views' => [ + 'name' => 'addadmin_views', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_admin_views', + 'store' => 'json', + 'tab_name' => 'Views', + ], + ], + 'component_site_views' => [ + 'addsite_views' => [ + 'name' => 'addsite_views', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_site_views', + 'store' => 'json', + 'tab_name' => 'Views', + ], + ], + 'component_custom_admin_views' => [ + 'addcustom_admin_views' => [ + 'name' => 'addcustom_admin_views', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_custom_admin_views', + 'store' => 'json', + 'tab_name' => 'Views', + ], + ], + 'component_updates' => [ + 'version_update' => [ + 'name' => 'version_update', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_updates', + 'store' => 'json', + 'tab_name' => 'Updates', + ], + ], + 'component_mysql_tweaks' => [ + 'sql_tweak' => [ + 'name' => 'sql_tweak', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_mysql_tweaks', + 'store' => 'json', + 'tab_name' => 'Mysql Tweaks', + ], + ], + 'component_custom_admin_menus' => [ + 'addcustommenus' => [ + 'name' => 'addcustommenus', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_custom_admin_menus', + 'store' => 'json', + 'tab_name' => 'Menus', + ], + ], + 'component_config' => [ + 'addconfig' => [ + 'name' => 'addconfig', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_config', + 'store' => 'json', + 'tab_name' => 'Options', + ], + ], + 'component_dashboard' => [ + 'dashboard_tab' => [ + 'name' => 'dashboard_tab', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_dashboard', + 'store' => 'json', + 'tab_name' => 'Dashboard', + ], + 'php_dashboard_methods' => [ + 'name' => 'php_dashboard_methods', + 'type' => 'textarea', + 'title' => false, + 'list' => 'components_dashboard', + 'store' => 'base64', + 'tab_name' => 'Dashboard', + ], + ], + 'component_files_folders' => [ + 'addfoldersfullpath' => [ + 'name' => 'addfoldersfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_files_folders', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfilesfullpath' => [ + 'name' => 'addfilesfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_files_folders', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfolders' => [ + 'name' => 'addfolders', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_files_folders', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addfiles' => [ + 'name' => 'addfiles', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_files_folders', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + ], + 'component_placeholders' => [ + 'addplaceholders' => [ + 'name' => 'addplaceholders', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_placeholders', + 'store' => 'json', + 'tab_name' => 'Details', + ], + ], + 'component_plugins' => [ + 'addjoomla_plugins' => [ + 'name' => 'addjoomla_plugins', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_plugins', + 'store' => 'json', + 'tab_name' => 'Plugins', + ], + ], + 'component_modules' => [ + 'addjoomla_modules' => [ + 'name' => 'addjoomla_modules', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_modules', + 'store' => 'json', + 'tab_name' => 'Modules', + ], + ], + 'snippet_type' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'snippet_types', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'description' => [ + 'name' => 'description', + 'type' => 'text', + 'title' => false, + 'list' => 'snippet_types', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'library_config' => [ + 'addconfig' => [ + 'name' => 'addconfig', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_config', + 'store' => 'json', + 'tab_name' => 'Tweaks', + ], + ], + 'library_files_folders_urls' => [ + 'addfoldersfullpath' => [ + 'name' => 'addfoldersfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfilesfullpath' => [ + 'name' => 'addfilesfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfolders' => [ + 'name' => 'addfolders', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addfiles' => [ + 'name' => 'addfiles', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addurls' => [ + 'name' => 'addurls', + 'type' => 'subform', + 'title' => false, + 'list' => 'libraries_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + ], + 'class_extends' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'class_extendings', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'head' => [ + 'name' => 'head', + 'type' => 'editor', + 'title' => false, + 'list' => 'class_extendings', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + 'comment' => [ + 'name' => 'comment', + 'type' => 'textarea', + 'title' => false, + 'list' => 'class_extendings', + 'store' => 'base64', + 'tab_name' => 'Details', + ], + ], + 'joomla_module_updates' => [ + 'version_update' => [ + 'name' => 'version_update', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_updates', + 'store' => 'json', + 'tab_name' => 'Updates', + ], + ], + 'joomla_module_files_folders_urls' => [ + 'addfoldersfullpath' => [ + 'name' => 'addfoldersfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfilesfullpath' => [ + 'name' => 'addfilesfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfolders' => [ + 'name' => 'addfolders', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addfiles' => [ + 'name' => 'addfiles', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addurls' => [ + 'name' => 'addurls', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_modules_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + ], + 'joomla_plugin_group' => [ + 'name' => [ + 'name' => 'name', + 'type' => 'text', + 'title' => true, + 'list' => 'joomla_plugin_groups', + 'store' => NULL, + 'tab_name' => 'Details', + ], + ], + 'joomla_plugin_updates' => [ + 'version_update' => [ + 'name' => 'version_update', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_updates', + 'store' => 'json', + 'tab_name' => 'Updates', + ], + ], + 'joomla_plugin_files_folders_urls' => [ + 'addfoldersfullpath' => [ + 'name' => 'addfoldersfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfilesfullpath' => [ + 'name' => 'addfilesfullpath', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Advance', + ], + 'addfolders' => [ + 'name' => 'addfolders', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addfiles' => [ + 'name' => 'addfiles', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + 'addurls' => [ + 'name' => 'addurls', + 'type' => 'subform', + 'title' => false, + 'list' => 'joomla_plugins_files_folders_urls', + 'store' => 'json', + 'tab_name' => 'Basic', + ], + ], + ]; + + /** + * Search Config + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * Constructor + * + * @param Config|null $config The search config object. + * + * @since 3.2.0 + */ + public function __construct(?Config $config = null) + { + $this->config = $config ?: Factory::_('Config'); + } + + /** + * Get any value from a item/field/column of an area/view/table + * Example: $this->get('table_name', 'field_name', 'value_key'); + * Get an item/field/column of an area/view/table + * Example: $this->get('table_name', 'field_name'); + * Get all items/fields/columns of an area/view/table + * Example: $this->get('table_name'); + * Get all areas/views/tables with all their item/field/column details + * Example: $this->get(); + * + * @param string|null $table The table + * @param string|null $field The field + * @param string|null $key The value key + * + * @return mixed + * @since 3.2.0 + */ + public function get(?string $table = null, ?string $field = null, ?string $key = null) + { + // load the table + if (empty($table) && is_string($field)) + { + $table = $this->config->table_name; + } + + // return the item/field/column of an area/view/table + if (is_string($field) && is_string($key)) + { + // return the value of a item/field/column of an area/view/table + if (isset($this->tables[$table][$field][$key])) + { + return $this->tables[$table][$field][$key]; + } + return null; + } + // return the item/field/column of an area/view/table + elseif (is_string($field)) + { + if (isset($this->tables[$table][$field])) + { + return $this->tables[$table][$field]; + } + return null; + } + // return an area/view/table + elseif (is_string($table)) + { + if (isset($this->tables[$table])) + { + return $this->tables[$table]; + } + return null; + } + + // return all + return $this->tables; + } + + /** + * Get title field from an area/view/table + * + * @param string|null $table The area + * + * @return ?array + * @since 3.2.0 + */ + public function title(?string $table = null): ?array + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // return the title item/field/column of an area/view/table + if (($table = $this->get($table)) !== null) + { + foreach ($table as $item) + { + if ($item['title']) + { + return $item; + } + } + } + + // none found + return null; + } + + /** + * Get title field name + * + * @param string|null $table The area + * + * @return string + * @since 3.2.0 + */ + public function titleName(?string $table = null): string + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // return the title name of an area/view/table + if (($field = $this->title($table)) !== null) + { + return $field['name']; + } + + // none found default to ID + return 'id'; + } + + /** + * Get all tables + * + * @return array + * @since 3.2.0 + */ + public function tables(): array + { + // return all areas/views/tables + return array_keys($this->tables); + } + + /** + * Check if a table exist + * + * @param string|null $table The area + * + * @return bool + * @since 3.2.0 + */ + public function exist(?string $table = null): bool + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + if (isset($table) && isset($this->tables[$table])) + { + return true; + } + + return false; + } + + /** + * Get all fields of an area/view/table + * + * @param string|null $table The area + * + * @return ?array + * @since 3.2.0 + */ + public function fields(?string $table = null): ?array + { + // load the table + if (empty($table)) + { + $table = $this->config->table_name; + } + + // return all fields of an area/view/table + if (($table = $this->get($table)) !== null) + { + return array_keys($table); + } + + // none found + return null; + } + +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/script.php b/script.php index a6b8b4cb2..273dbc77b 100644 --- a/script.php +++ b/script.php @@ -6755,7 +6755,7 @@ class com_componentbuilderInstallerScript { $rule_length = $db->loadResult(); // Check the size of the rules column - if ($rule_length <= 96960) + if ($rule_length <= 97440) { // Fix the assets table rules column size $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to MEDIUMTEXT by JCB';"; diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index c77a1c867..7033e9fc1 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -3547,6 +3547,9 @@ abstract class ComponentbuilderHelper ), 'special' => array( 'contentlanguage', 'moduleposition', 'plugin', 'repeatable', 'subform' + ), + 'search' => array( + 'editor', 'email', 'tel', 'text', 'textarea', 'url', 'subform' ) );