diff --git a/README.md b/README.md index 6095311bf..312d3ed35 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.1) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.4) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -146,13 +146,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 14th October, 2019 -+ *Version*: 2.10.1 ++ *Last Build*: 16th October, 2019 ++ *Version*: 2.10.4 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **253791** -+ *Field count*: **1347** -+ *File count*: **1618** ++ *Line count*: **255312** ++ *Field count*: **1353** ++ *File count*: **1620** + *Folder count*: **261** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 6095311bf..312d3ed35 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.1) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.4) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -146,13 +146,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 14th October, 2019 -+ *Version*: 2.10.1 ++ *Last Build*: 16th October, 2019 ++ *Version*: 2.10.4 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **253791** -+ *Field count*: **1347** -+ *File count*: **1618** ++ *Line count*: **255312** ++ *Field count*: **1353** ++ *File count*: **1620** + *Folder count*: **261** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 41242cb2d..66dd3ad72 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -638,7 +638,7 @@ class Get * * @var array */ - public $cryptionTypes = array('basic', 'medium', 'whmcs'); + public $cryptionTypes = array('basic', 'medium', 'whmcs', 'expert'); /** * The WHMCS Encryption Switch @@ -2586,7 +2586,7 @@ class Get { if (!isset($this->libManager[$this->target][$view->code][$library])) { - if ($this->getLibrary((int) $library)) + if ($this->getMediaLibrary((int) $library)) { $this->libManager[$this->target][$view->code][(int) $library] = true; } @@ -2595,7 +2595,7 @@ class Get } elseif (is_numeric($view->libraries) && !isset($this->libManager[$this->target][$view->code][(int) $view->libraries])) { - if ($this->getLibrary((int) $view->libraries)) + if ($this->getMediaLibrary((int) $view->libraries)) { $this->libManager[$this->target][$view->code][(int) $view->libraries] = true; } @@ -2922,6 +2922,28 @@ class Get { $this->mediumEncryption = true; } + // check if we have better encryption + elseif (6 == $field->store + && ComponentbuilderHelper::checkString($field->on_get_model_field) + && ComponentbuilderHelper::checkString($field->on_save_model_field)) + { + // add only if string lenght found + if (ComponentbuilderHelper::checkString($field->initiator_on_save_model)) + { + $field->initiator_save_key = md5($field->initiator_on_save_model); + $field->initiator_save = explode(PHP_EOL, $this->setPlaceholders($this->setDynamicValues(base64_decode($field->initiator_on_save_model)), $this->placeholders)); + } + if (ComponentbuilderHelper::checkString($field->initiator_on_save_model)) + { + $field->initiator_get_key = md5($field->initiator_on_get_model); + $field->initiator_get = explode(PHP_EOL, $this->setPlaceholders($this->setDynamicValues(base64_decode($field->initiator_on_get_model)), $this->placeholders)); + } + // set the field modeling + $field->model_field['save'] = explode(PHP_EOL, $this->setPlaceholders($this->setDynamicValues(base64_decode($field->on_save_model_field)), $this->placeholders)); + $field->model_field['get'] = explode(PHP_EOL, $this->setPlaceholders($this->setDynamicValues(base64_decode($field->on_get_model_field)), $this->placeholders)); + // remove the original values + unset($field->on_save_model_field, $field->on_get_model_field, $field->initiator_on_save_model, $field->initiator_on_get_model); + } // get the last used version $field->history = $this->getHistoryWatch('field', $id); @@ -4400,7 +4422,7 @@ class Get { if (!isset($this->libManager[$this->target][$view][$library])) { - if ($this->getLibrary((int) $library)) + if ($this->getMediaLibrary((int) $library)) { $this->libManager[$this->target][$view][(int) $library] = true; } @@ -4409,7 +4431,7 @@ class Get } elseif (is_numeric($row->libraries) && !isset($this->libManager[$this->target][$view][(int) $row->libraries])) { - if ($this->getLibrary((int) $row->libraries)) + if ($this->getMediaLibrary((int) $row->libraries)) { $this->libManager[$this->target][$view][(int) $row->libraries] = true; } @@ -4488,14 +4510,14 @@ class Get } /** - * Get Library Data and store globaly + * Get Media Library Data and store globally * * @param string $id the library id * * @return bool true on success * */ - protected function getLibrary($id) + protected function getMediaLibrary($id) { // check if the lib has already been set @@ -4579,6 +4601,7 @@ class Get $query->join('LEFT', $this->db->quoteName('#__componentbuilder_library_config', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.library') . ')'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_library_files_folders_urls', 'c') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('c.library') . ')'); $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); + $query->where($this->db->quoteName('a.target') . ' = 1'); // Reset the query using our newly populated query object. $this->db->setQuery($query); diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index f6652de75..1e43e49c9 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -20,252 +20,266 @@ class Fields extends Structure /** * Metadate Switch - * + * * @var array */ public $metadataBuilder = array(); /** * View access Switch - * + * * @var array */ public $accessBuilder = array(); /** * edit view tabs counter - * + * * @var array */ public $tabCounter = array(); /** * layout builder - * + * * @var array */ public $layoutBuilder = array(); /** * used to fix the zero order - * + * * @var array */ private $zeroOrderFix = array(); /** * Site field data - * + * * @var array */ public $siteFieldData = array(); /** * list of fields that are not being escaped - * + * * @var array */ public $doNotEscape = array(); /** * list of classes used in the list view for the fields - * + * * @var array */ public $listFieldClass = array(); /** * tags builder - * + * * @var array */ public $tagsBuilder = array(); /** * query builder - * + * * @var array */ public $queryBuilder = array(); /** * unique keys for database field - * + * * @var array */ public $dbUniqueKeys = array(); /** * keys for database field - * + * * @var array */ public $dbKeys = array(); /** * history builder - * + * * @var array */ public $historyBuilder = array(); /** * alias builder - * + * * @var array */ public $aliasBuilder = array(); /** * title builder - * + * * @var array */ public $titleBuilder = array(); /** * list builder - * + * * @var array */ public $listBuilder = array(); /** * custom Builder List - * + * * @var array */ public $customBuilderList = array(); /** * Hidden Fields Builder - * + * * @var array */ public $hiddenFieldsBuilder = array(); /** * INT Field Builder - * + * * @var array */ public $intFieldsBuilder = array(); /** * Dynamic Fields Builder - * + * * @var array */ public $dynamicfieldsBuilder = array(); /** * Main text Builder - * + * * @var array */ public $maintextBuilder = array(); /** * Custom Builder - * + * * @var array */ public $customBuilder = array(); /** * Custom Field Links Builder - * + * * @var array */ public $customFieldLinksBuilder = array(); /** * Set Script for User Switch - * + * * @var array */ public $setScriptUserSwitch = array(); /** * Set Script for Media Switch - * + * * @var array */ public $setScriptMediaSwitch = array(); /** * Category builder - * + * * @var array */ public $categoryBuilder = array(); /** * Category Code builder - * + * * @var array */ public $catCodeBuilder = array(); /** * Check Box builder - * + * * @var array */ public $checkboxBuilder = array(); /** * Json String Builder - * + * * @var array */ public $jsonStringBuilder = array(); /** * Json String Builder for return values to array - * + * * @var array */ public $jsonItemBuilderArray = array(); /** * Json Item Builder - * + * * @var array */ public $jsonItemBuilder = array(); /** * Base 64 Builder - * + * * @var array */ public $base64Builder = array(); /** - * Basic Encryption Builder - * + * Basic Encryption Field Modeling + * * @var array */ - public $basicEncryptionBuilder = array(); + public $basicFieldModeling = array(); /** - * WHMCS Encryption Builder - * + * WHMCS Encryption Field Modeling + * * @var array */ - public $whmcsEncryptionBuilder = array(); + public $whmcsFieldModeling = array(); /** - * Medium Encryption Builder - * + * Medium Encryption Field Modeling + * * @var array */ - public $mediumEncryptionBuilder = array(); + public $mediumFieldModeling = array(); + + /** + * Expert Field Modeling + * + * @var array + */ + public $expertFieldModeling = array(); + + /** + * Expert Mode Initiator + * + * @var array + */ + public $expertFieldModelInitiator = array(); /** * Get Items Method List String Fix Builder - * + * * @var array */ public $getItemsMethodListStringFixBuilder = array(); @@ -2320,7 +2334,7 @@ class Fields extends Structure */ public function buildSiteFieldData($view, $field, $set, $type) { - $decode = array('json', 'base64', 'basic_encryption', 'whmcs_encryption', 'medium_encryption'); + $decode = array('json', 'base64', 'basic_encryption', 'whmcs_encryption', 'medium_encryption', 'expert_mode'); $textareas = array('textarea', 'editor'); if (isset($this->siteFields[$view][$field]) && ComponentbuilderHelper::checkArray($this->siteFields[$view][$field])) { @@ -2988,22 +3002,41 @@ class Fields extends Structure break; case 3: // BASIC_ENCRYPTION_LOCALKEY - $this->basicEncryptionBuilder[$view_name_single][] = $name; + $this->basicFieldModeling[$view_name_single][] = $name; // Site settings of each field if needed $this->buildSiteFieldData($view_name_single, $name, 'basic_encryption', $typeName); break; case 4: // WHMCS_ENCRYPTION_VDMKEY - $this->whmcsEncryptionBuilder[$view_name_single][] = $name; + $this->whmcsFieldModeling[$view_name_single][] = $name; // Site settings of each field if needed $this->buildSiteFieldData($view_name_single, $name, 'whmcs_encryption', $typeName); break; case 5: // MEDIUM_ENCRYPTION_LOCALFILE - $this->mediumEncryptionBuilder[$view_name_single][] = $name; + $this->mediumFieldModeling[$view_name_single][] = $name; // Site settings of each field if needed $this->buildSiteFieldData($view_name_single, $name, 'medium_encryption', $typeName); break; + case 6: + // EXPERT_MODE + if(isset($field['settings']->model_field)) + { + if (isset($field['settings']->initiator_save_key)) + { + $this->expertFieldModelInitiator[$view_name_single]['save'][$field['settings']->initiator_save_key] + = $field['settings']->initiator_save; + } + if (isset($field['settings']->initiator_get_key)) + { + $this->expertFieldModelInitiator[$view_name_single]['get'][$field['settings']->initiator_get_key] + = $field['settings']->initiator_get; + } + $this->expertFieldModeling[$view_name_single][$name] = $field['settings']->model_field; + // Site settings of each field if needed + $this->buildSiteFieldData($view_name_single, $name, 'expert_mode', $typeName); + } + break; default: // JSON_ARRAY_ENCODE $this->jsonItemBuilder[$view_name_single][] = $name; diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 0be8e1976..b3e4144fb 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -635,12 +635,12 @@ class Interpretation extends Fields // WHMCS_ENCRYPT_FILE $this->fileContentStatic[$this->hhh . 'WHMCS_ENCRYPT_FILE' . $this->hhh] = ''; // check if encryption is ative - if ((isset($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder)) || - (isset($this->mediumEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->mediumEncryptionBuilder)) || - (isset($this->whmcsEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->whmcsEncryptionBuilder)) || + if ((isset($this->basicFieldModeling) && ComponentbuilderHelper::checkArray($this->basicFieldModeling)) || + (isset($this->mediumFieldModeling) && ComponentbuilderHelper::checkArray($this->mediumFieldModeling)) || + (isset($this->whmcsFieldModeling) && ComponentbuilderHelper::checkArray($this->whmcsFieldModeling)) || $this->componentData->add_license) { - if (isset($this->whmcsEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->whmcsEncryptionBuilder) || $this->componentData->add_license) + if (isset($this->whmcsFieldModeling) && ComponentbuilderHelper::checkArray($this->whmcsFieldModeling) || $this->componentData->add_license) { // set whmcs encrypt file into place $target = array('admin' => 'whmcs'); @@ -669,7 +669,7 @@ class Interpretation extends Fields $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the global params"; $function[] = $this->_t(2) . "\$params = JComponentHelper::getParams('com_" . $component . "', true);"; // add the basic option - if (isset($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder)) + if (isset($this->basicFieldModeling) && ComponentbuilderHelper::checkArray($this->basicFieldModeling)) { $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Basic Encryption Type"; $function[] = $this->_t(2) . "if ('basic' === \$type)"; @@ -682,7 +682,7 @@ class Interpretation extends Fields $function[] = $this->_t(2) . "}"; } // add the medium option - if (isset($this->mediumEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->mediumEncryptionBuilder)) + if (isset($this->mediumFieldModeling) && ComponentbuilderHelper::checkArray($this->mediumFieldModeling)) { $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " Medium Encryption Type"; $function[] = $this->_t(2) . "if ('medium' === \$type)"; @@ -705,7 +705,7 @@ class Interpretation extends Fields $function[] = $this->_t(2) . "}"; } // add the whmcs option - if (isset($this->whmcsEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->whmcsEncryptionBuilder) || $this->componentData->add_license) + if (isset($this->whmcsFieldModeling) && ComponentbuilderHelper::checkArray($this->whmcsFieldModeling) || $this->componentData->add_license) { $function[] = $this->_t(2) . "//" . $this->setLine(__LINE__) . " WHMCS Encryption Type"; $function[] = $this->_t(2) . "if ('whmcs' === \$type || 'advanced' === \$type)"; @@ -724,7 +724,7 @@ class Interpretation extends Fields $function[] = PHP_EOL . $this->_t(2) . "return \$default;"; $function[] = $this->_t(1) . "}"; // set the getMediumCryptKey class/method - if (isset($this->mediumEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->mediumEncryptionBuilder)) + if (isset($this->mediumFieldModeling) && ComponentbuilderHelper::checkArray($this->mediumFieldModeling)) { $function[] = PHP_EOL . PHP_EOL . $this->_t(1) . "/**"; $function[] = $this->_t(1) . " * The Medium Encryption Key"; @@ -1821,6 +1821,8 @@ class Interpretation extends Fields // now loop the array foreach ($array['decode'] as $decode) { + $if = ''; + $decoder = ''; if ('json' === $decode) { $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (" . $this->fileContentStatic[$this->hhh . 'Component' . $this->hhh] . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; @@ -1839,17 +1841,33 @@ class Interpretation extends Fields { if ($cryptionType . '_encryption' === $decode) { - $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (!empty(" . $string . "->" . $field . ") && \$" . $cryptionType . "key && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; - // set decryption - $decoder = $string . "->" . $field . " = rtrim(\$" . $cryptionType . "->decryptString(" . $string . "->" . $field . "), " . '"\0"' . ");"; + if ('expert' !== $cryptionType) + { + $if = PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "if (!empty(" . $string . "->" . $field . ") && \$" . $cryptionType . "key && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; + // set decryption + $decoder = $string . "->" . $field . " = rtrim(\$" . $cryptionType . "->decryptString(" . $string . "->" . $field . "), " . '"\0"' . ");"; + } + elseif (isset($this->{$cryptionType . 'FieldModeling'}[$code][$field])) + { + $_placeholder_for_field = array('[[[field]]]' => $string . "->" . $field); + $fieldDecode .= $this->setPlaceholders(PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . implode(PHP_EOL . $this->_t(1) . $tab . $this->_t(1), $this->{$cryptionType . 'FieldModeling'}[$code][$field]['get']), $_placeholder_for_field); + } + // activate site decryption $this->siteDecrypt[$cryptionType][$code] = true; } } } - - // build decoder string - $fieldDecode .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Check if we can decode " . $field .$if . PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Decode " . $field; - $fieldDecode .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . $decoder . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; + // check if we have found the details + if (ComponentbuilderHelper::checkString($if)) + { + // build decoder string + $fieldDecode .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Check if we can decode " . $field .$if . PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Decode " . $field; + } + if (ComponentbuilderHelper::checkString($decoder)) + { + // build decoder string + $fieldDecode .= PHP_EOL . $this->_t(1) . $tab . $this->_t(2) . $decoder . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "}"; + } } } } @@ -2495,10 +2513,21 @@ class Interpretation extends Fields { if (isset($this->siteDecrypt[$cryptionType][$code]) && $this->siteDecrypt[$cryptionType][$code]) { - $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + if ('expert' !== $cryptionType) + { + $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + } + elseif (isset($this->{$cryptionType . 'FieldModelInitiator'}[$code]) + && isset($this->{$cryptionType . 'FieldModelInitiator'}[$code]['get'])) + { + foreach ($this->{$cryptionType . 'FieldModelInitiator'}[$code]['get'] as $block) + { + $script .= PHP_EOL . $this->_t(1) . implode(PHP_EOL . $this->_t(1), $block); + } + } } } $getItem = $script . $getItem; @@ -2993,10 +3022,21 @@ class Interpretation extends Fields { if (isset($this->siteDecrypt[$cryptionType][$code]) && $this->siteDecrypt[$cryptionType][$code]) { - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);" . PHP_EOL; + if ('expert' !== $cryptionType) + { + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);" . PHP_EOL; + } + elseif (isset($this->{$cryptionType . 'FieldModelInitiator'}[$code]) + && isset($this->{$cryptionType . 'FieldModelInitiator'}[$code]['get'])) + { + foreach ($this->{$cryptionType . 'FieldModelInitiator'}[$code]['get'] as $block) + { + $script .= PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $block); + } + } } } $methods = str_replace($this->hhh . 'CRYPT' . $this->hhh, $script, $methods); @@ -3250,10 +3290,21 @@ class Interpretation extends Fields { if ($this->siteDecrypt[$cryptionType][$code]) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + if ('expert' !== $cryptionType) + { + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + } + elseif (isset($this->{$cryptionType . 'FieldModelInitiator'}[$code]) + && isset($this->{$cryptionType . 'FieldModelInitiator'}[$code]['get'])) + { + foreach ($this->{$cryptionType . 'FieldModelInitiator'}[$code]['get'] as $block) + { + $script .= PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $block); + } + } } } return $script . $getItem; @@ -4574,19 +4625,38 @@ class Interpretation extends Fields // decryption foreach ($this->cryptionTypes as $cryptionType) { - if (isset($this->{$cryptionType . 'EncryptionBuilder'}[$view]) && ComponentbuilderHelper::checkArray($this->{$cryptionType . 'EncryptionBuilder'}[$view])) + if (isset($this->{$cryptionType . 'FieldModeling'}[$view]) && ComponentbuilderHelper::checkArray($this->{$cryptionType . 'FieldModeling'}[$view])) { - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; - $script .= PHP_EOL . $this->_t(3) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(3) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; - foreach ($this->{$cryptionType . 'EncryptionBuilder'}[$view] as $baseString) + if ('expert' !== $cryptionType) { - $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "if (!empty(\$item->" . $baseString . ") && \$" . $cryptionType . "key && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))"; - $script .= PHP_EOL . $this->_t(3) . "{"; - $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " " . $cryptionType . " decrypt data " . $baseString . "."; - $script .= PHP_EOL . $this->_t(4) . "\$item->" . $baseString . " = rtrim(\$" . $cryptionType . "->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");"; - $script .= PHP_EOL . $this->_t(3) . "}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption."; + $script .= PHP_EOL . $this->_t(3) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(3) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + foreach ($this->{$cryptionType . 'FieldModeling'}[$view] as $baseString) + { + $script .= PHP_EOL . PHP_EOL . $this->_t(3) . "if (!empty(\$item->" . $baseString . ") && \$" . $cryptionType . "key && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))"; + $script .= PHP_EOL . $this->_t(3) . "{"; + $script .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) . " " . $cryptionType . " decrypt data " . $baseString . "."; + $script .= PHP_EOL . $this->_t(4) . "\$item->" . $baseString . " = rtrim(\$" . $cryptionType . "->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");"; + $script .= PHP_EOL . $this->_t(3) . "}"; + } + } + else + { + if (isset($this->{$cryptionType . 'FieldModelInitiator'}[$view]['get'])) + { + foreach ($this->{$cryptionType . 'FieldModelInitiator'}[$view]['get'] as $block) + { + $script .= PHP_EOL . $this->_t(3) . implode(PHP_EOL . $this->_t(3), $block); + } + } + // set the expert script + foreach ($this->{$cryptionType . 'FieldModeling'}[$view] as $baseString => $opener_) + { + $_placeholder_for_field = array('[[[field]]]' => '$item->' . $baseString); + $script .= $this->setPlaceholders(PHP_EOL . $this->_t(3) . implode(PHP_EOL . $this->_t(3), $opener_['get']), $_placeholder_for_field); + } } } } @@ -4718,19 +4788,39 @@ class Interpretation extends Fields // turn string into encrypted string foreach ($this->cryptionTypes as $cryptionType) { - if (isset($this->{$cryptionType . 'EncryptionBuilder'}[$view]) && ComponentbuilderHelper::checkArray($this->{$cryptionType . 'EncryptionBuilder'}[$view])) + if (isset($this->{$cryptionType . 'FieldModeling'}[$view]) && ComponentbuilderHelper::checkArray($this->{$cryptionType . 'FieldModeling'}[$view])) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object"; - $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; - foreach ($this->{$cryptionType . 'EncryptionBuilder'}[$view] as $baseString) + if ('expert' !== $cryptionType) { - $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Encrypt data " . $baseString . "."; - $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" . $baseString . "']) && \$" . $cryptionType . "key)"; - $script .= PHP_EOL . $this->_t(2) . "{"; - $script .= PHP_EOL . $this->_t(3) . "\$data['" . $baseString . "'] = \$" . $cryptionType . "->encryptString(\$data['" . $baseString . "']);"; - $script .= PHP_EOL . $this->_t(2) . "}"; + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Get the encryption object"; + $script .= PHP_EOL . $this->_t(2) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + foreach ($this->{$cryptionType . 'FieldModeling'}[$view] as $baseString) + { + $script .= PHP_EOL . PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) . " Encrypt data " . $baseString . "."; + $script .= PHP_EOL . $this->_t(2) . "if (isset(\$data['" . $baseString . "']) && \$" . $cryptionType . "key)"; + $script .= PHP_EOL . $this->_t(2) . "{"; + $script .= PHP_EOL . $this->_t(3) . "\$data['" . $baseString . "'] = \$" . $cryptionType . "->encryptString(\$data['" . $baseString . "']);"; + $script .= PHP_EOL . $this->_t(2) . "}"; + } + } + else + { + if (isset($this->{$cryptionType . 'FieldModelInitiator'}[$view]) && + isset($this->{$cryptionType . 'FieldModelInitiator'}[$view]['save'])) + { + foreach ($this->{$cryptionType . 'FieldModelInitiator'}[$view]['save'] as $block) + { + $script .= PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $block); + } + } + // set the expert script + foreach ($this->{$cryptionType . 'FieldModeling'}[$view] as $baseString => $locker_) + { + $_placeholder_for_field = array('[[[field]]]' => "\$data['" . $baseString . "']"); + $script .= $this->setPlaceholders(PHP_EOL . $this->_t(2) . implode(PHP_EOL . $this->_t(2), $locker_['save']), $_placeholder_for_field); + } } } } @@ -12863,6 +12953,12 @@ class Interpretation extends Fields $mediumCrypt = true; $suffix_decode = ''; break; + case 6: + // EXPERT_ENCRYPTION + $decode = '///////////////////////////////////////////'; + $expertCrypt = true; + $suffix_decode = ''; + break; default: // JSON_ARRAY_ENCODE $decode = 'json_decode'; @@ -13142,10 +13238,21 @@ class Interpretation extends Fields { if (${$cryptionType . 'Crypt'}) { - $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; - $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + if ('expert' !== $cryptionType) + { + $script .= PHP_EOL . PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the " . $cryptionType . " encryption key."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . "key = " . $Component . "Helper::getCryptKey('" . $cryptionType . "');"; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$" . $cryptionType . " = new FOFEncryptAes(\$" . $cryptionType . "key);"; + } + elseif (isset($this->{$cryptionType . 'FieldModelInitiator'}[$viewName_single]) + && isset($this->{$cryptionType . 'FieldModelInitiator'}[$viewName_single]['get'])) + { + foreach ($this->{$cryptionType . 'FieldModelInitiator'}[$viewName_single]['get'] as $block) + { + $script .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . implode(PHP_EOL . $this->_t(1) . $tab . $this->_t(1), $block); + } + } } } // add the encryption script diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 8ec7bad42..918829a8c 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -224,7 +224,6 @@ class Infusion extends Interpretation $this->fileContentStatic[$globalPlaceholder] = $gloabalValue; } } - // reset view array $viewarray = array(); $site_edit_view_array = array(); @@ -313,7 +312,6 @@ class Infusion extends Interpretation { $this->fileContentDynamic[$viewName_single][$this->hhh . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] = ''; } - // LINKEDVIEWTABLESCRIPTS <<>> $this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] = ''; @@ -606,7 +604,6 @@ class Infusion extends Interpretation } // HELPER_EXEL $this->fileContentStatic[$this->hhh . 'HELPER_EXEL' . $this->hhh] = $this->setExelHelperMethods(); - // Trigger Event: jcb_ce_onAfterBuildAdminViewContent $this->triggerEvent('jcb_ce_onAfterBuildAdminViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh)); } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 2bd5be2dd..7499db214 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -3784,6 +3784,525 @@ abstract class ComponentbuilderHelper } + /** + * the Crypt objects + **/ + protected static $CRYPT = array(); + + /** + * the Cipher MODE switcher (list of ciphers) + **/ + protected static $setCipherMode = array( + 'AES' => true, + 'Rijndael' => true, + 'Twofish' => false, // can but not good idea + 'Blowfish' => false, // can but not good idea + 'RC4' => false, // nope + 'RC2' => false, // can but not good idea + 'TripleDES' => false, // can but not good idea + 'DES' => true + ); + + /** + * get the Crypt object + * + * @return object on success with Crypt power + **/ + public static function crypt($type, $mode = null) + { + // set key based on mode + if ($mode) + { + $key = $type . $mode; + } + else + { + $key = $type; + } + // check if it was already set + if (isset(self::$CRYPT[$key]) && self::checkObject(self::$CRYPT[$key])) + { + return self::$CRYPT[$key]; + } + // make sure we have the composer classes loaded + self::composerAutoload('phpseclib'); + // build class name + $CLASS = '\phpseclib\Crypt\\' . $type; + // make sure we have the phpseclib classes + if (!class_exists($CLASS)) + { + // class not in place so send out error + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', $CLASS), 'Error'); + return false; + } + // does this crypt class use mode + if ($mode && isset(self::$setCipherMode[$type]) && self::$setCipherMode[$type]) + { + switch ($mode) + { + case 'CTR': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CTR); + break; + case 'ECB': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_ECB); + break; + case 'CBC': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CBC); + break; + case 'CBC3': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CBC3); + break; + case 'CFB': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CFB); + break; + case 'CFB8': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_CFB8); + break; + case 'OFB': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_OFB); + break; + case 'GCM': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_GCM); + break; + case 'STREAM': + self::$CRYPT[$key] = new $CLASS($CLASS::MODE_STREAM); + break; + default: + // No valid mode has been specified + JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_NO_VALID_MODE_HAS_BEEN_SPECIFIED'), 'Error'); + return false; + break; + } + } + else + { + // set the + self::$CRYPT[$key] = new $CLASS(); + } + // return the object + return self::$CRYPT[$key]; + } + + /** + * Move File to Server + * + * @param string $localPath The local path to the file + * @param string $fileName The the actual file name + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return bool true on success + **/ + public static function moveToServer($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export') + { + // get the server + if ($server = self::getServer( (int) $serverID, $protocol, $permission)) + { + // use the FTP protocol + if (1 == $server->jcb_protocol) + { + // now move the file + if (!$server->store($localPath, $fileName)) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER', $fileName, $server->jcb_remote_server_name[(int) $serverID]), 'Error'); + return false; + } + // close the connection + $server->quit(); + } + // use the SFTP protocol + elseif (2 == $server->jcb_protocol) + { + // now move the file + if (!$server->put($server->jcb_remote_server_path[(int) $serverID] . $fileName, self::getFileContents($localPath, null))) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER', $fileName, $server->jcb_remote_server_path[(int) $serverID], $server->jcb_remote_server_name[(int) $serverID]), 'Error'); + return false; + } + } + return true; + } + return false; + } + + /** + * the SFTP objects + **/ + protected static $sftp = array(); + + /** + * the FTP objects + **/ + protected static $ftp = array(); + + /** + * get the server object + * + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return object on success server object + **/ + public static function getServer($serverID, $protocol = null, $permission = 'core.export') + { + // if not protocol is given get it (sad I know) + if (!$protocol) + { + $protocol = self::getVar('server', (int) $serverID, 'id', 'protocol'); + } + // return the server object + switch ($protocol) + { + case 1: // FTP + return self::getFtp($serverID, $permission); + break; + case 2: // SFTP + return self::getSftp($serverID, $permission); + break; + } + return false; + } + + /** + * get the sftp object + * + * @param int $serverID The server local id to use + * @param string $permission The permission validation area + * + * @return object on success with sftp power + **/ + public static function getSftp($serverID, $permission = 'core.export') + { + // check if we have a server with that id + if ($server = self::getServerDetails($serverID, 2, $permission)) + { + // check if it was already set + if (!isset(self::$sftp[$server->cache]) || !self::checkObject(self::$sftp[$server->cache])) + { + // make sure we have the composer classes loaded + self::composerAutoload('phpseclib'); + // make sure we have the phpseclib classes + if (!class_exists('\phpseclib\Net\SFTP')) + { + // class not in place so send out error + JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error'); + return false; + } + // insure the port is set + $server->port = (isset($server->port) && is_int($server->port) && $server->port > 0) ? $server->port : 22; + // open the connection + self::$sftp[$server->cache] = new phpseclib\Net\SFTP($server->host, $server->port); + // heads-up on protocol + self::$sftp[$server->cache]->jcb_protocol = 2; // SFTP <-- if called not knowing what type of protocol is being used + // now login based on authentication type + switch($server->authentication) + { + case 1: // password + if (!self::$sftp[$server->cache]->login($server->username, $server->password)) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + break; + case 2: // private key file + if (self::checkObject(self::crypt('RSA'))) + { + // check if we have a passprase + if (self::checkString($server->secret)) + { + self::crypt('RSA')->setPassword($server->secret); + } + // now load the key file + if (!self::crypt('RSA')->loadKey(self::getFileContents($server->private, null))) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + // now login + if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA'))) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + } + break; + case 3: // both password and private key file + if (self::checkObject(self::crypt('RSA'))) + { + // check if we have a passphrase + if (self::checkString($server->secret)) + { + self::crypt('RSA')->setPassword($server->secret); + } + // now load the key file + if (!self::crypt('RSA')->loadKey(self::getFileContents($server->private, null))) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + // now login + if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA'))) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + } + break; + case 4: // private key field + if (self::checkObject(self::crypt('RSA'))) + { + // check if we have a passprase + if (self::checkString($server->secret)) + { + self::crypt('RSA')->setPassword($server->secret); + } + // now load the key field + if (!self::crypt('RSA')->loadKey($server->private_key)) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + // now login + if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA'))) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + } + break; + case 5: // both password and private key field + if (self::checkObject(self::crypt('RSA'))) + { + // check if we have a passphrase + if (self::checkString($server->secret)) + { + self::crypt('RSA')->setPassword($server->secret); + } + // now load the key file + if (!self::crypt('RSA')->loadKey($server->private_key)) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + // now login + if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA'))) + { + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + unset(self::$sftp[$server->cache]); + return false; + } + } + break; + } + } + // only continue if object is set + if (isset(self::$sftp[$server->cache]) && self::checkObject(self::$sftp[$server->cache])) + { + // set the unique buckets + if (!isset(self::$sftp[$server->cache]->jcb_remote_server_name)) + { + self::$sftp[$server->cache]->jcb_remote_server_name = array(); + self::$sftp[$server->cache]->jcb_remote_server_path = array(); + } + // always set the name and remote server path + self::$sftp[$server->cache]->jcb_remote_server_name[$serverID] = $server->name; + self::$sftp[$server->cache]->jcb_remote_server_path[$serverID] = (self::checkString($server->path) && $server->path !== '/') ? $server->path : ''; + // return the sftp object + return self::$sftp[$server->cache]; + } + } + return false; + } + + /** + * get the JClientFtp object + * + * @param int $serverID The server local id to use + * @param string $permission The permission validation area + * + * @return object on success with ftp power + **/ + public static function getFtp($serverID, $permission) + { + // check if we have a server with that id + if ($server = self::getServerDetails($serverID, 1, $permission)) + { + // check if we already have the server instance + if (isset(self::$ftp[$server->cache]) && self::$ftp[$server->cache] instanceof JClientFtp) + { + // always set the name and remote server path + self::$ftp[$server->cache]->jcb_remote_server_name[$serverID] = $server->name; + // if still connected we are ready to go + if (self::$ftp[$server->cache]->isConnected()) + { + // return the FTP instance + return self::$ftp[$server->cache]; + } + // check if we can reinitialise the server + if (self::$ftp[$server->cache]->reinit()) + { + // return the FTP instance + return self::$ftp[$server->cache]; + } + } + // make sure we have a string and it is not default or empty + if (self::checkString($server->signature)) + { + // turn into variables + parse_str($server->signature); // because of this I am using strange variable naming to avoid any collisions. + // set options + if (isset($options) && self::checkArray($options)) + { + foreach ($options as $o__p0t1on => $vAln3) + { + if ('timeout' === $o__p0t1on) + { + $options[$o__p0t1on] = (int) $vAln3; + } + if ('type' === $o__p0t1on) + { + $options[$o__p0t1on] = (string) $vAln3; + } + } + } + else + { + $options = array(); + } + // get ftp object + if (isset($host) && $host != 'HOSTNAME' && isset($port) && $port != 'PORT_INT' && isset($username) && $username != 'user@name.com' && isset($password) && $password != 'password') + { + // load for reuse + self::$ftp[$server->cache] = JClientFtp::getInstance($host, $port, $options, $username, $password); + } + else + { + // load error to indicate signature was in error + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); + return false; + } + // check if we are connected + if (self::$ftp[$server->cache] instanceof JClientFtp && self::$ftp[$server->cache]->isConnected()) + { + // heads-up on protocol + self::$ftp[$server->cache]->jcb_protocol = 1; // FTP <-- if called not knowing what type of protocol is being used + // set the unique buckets + if (!isset(self::$ftp[$server->cache]->jcb_remote_server_name)) + { + self::$ftp[$server->cache]->jcb_remote_server_name = array(); + } + // always set the name and remote server path + self::$ftp[$server->cache]->jcb_remote_server_name[$serverID] = $server->name; + // return the FTP instance + return self::$ftp[$server->cache]; + } + // reset since we have no connection + unset(self::$ftp[$server->cache]); + } + // load error to indicate signature was in error + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); + } + return false; + } + + /** + * get the server details + * + * @param int $serverID The server local id to use + * @param int $protocol The server protocol to use + * @param string $permission The permission validation area + * + * @return object on success with server details + **/ + public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export') + { + // check if this user has permission to access items + if (!JFactory::getUser()->authorise($permission, 'com_componentbuilder')) + { + // set message to inform the user that permission was denied + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', self::safeString($permission, 'w')), 'Error'); + return false; + } + // now insure we have correct values + if (is_int($serverID) && is_int($protocol)) + { + // Get a db connection + $db = JFactory::getDbo(); + // start the query + $query = $db->getQuery(true); + // select based to protocol + if (2 == $protocol) + { + // SFTP + $query->select($db->quoteName(array('name','authentication','username','host','password','path','port','private','private_key','secret'))); + // cache builder + $cache = array('authentication','username','host','password','port','private','private_key','secret'); + } + else + { + // FTP + $query->select($db->quoteName(array('name','signature'))); + // cache builder + $cache = array('signature'); + } + $query->from($db->quoteName('#__componentbuilder_server')); + $query->where($db->quoteName('id') . ' = ' . (int) $serverID); + $query->where($db->quoteName('protocol') . ' = ' . (int) $protocol); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $server = $db->loadObject(); + // Get the basic encryption. + $basickey = self::getCryptKey('basic', 'Th1sMnsTbL0ck@d'); + // Get the encryption object. + $basic = new FOFEncryptAes($basickey, 128); + // start cache keys + $keys = array(); + // unlock the needed fields + foreach($server as $name => &$value) + { + // unlock the needed fields + if ($name !== 'name' && !empty($value) && $basickey && !is_numeric($value) && $value === base64_encode(base64_decode($value, true))) + { + // basic decrypt of data + $value = rtrim($basic->decryptString($value), "\0"); + } + // build cache (keys) for lower connection latency + if (in_array($name, $cache)) + { + $keys[] = $value; + } + } + // check if cache keys were found + if (self::checkArray($keys)) + { + // now set cache + $server->cache = md5(implode('', $keys)); + } + else + { + // default is ID + $server->cache = $serverID; + } + // return the server details + return $server; + } + } + JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error'); + return false; + } + /** * Composer Switch **/ @@ -3792,7 +4311,7 @@ abstract class ComponentbuilderHelper /** * Load the Composer Vendors **/ - public static function composerAutoload($target = 'vdm_io') + public static function composerAutoload($target) { // insure we load the composer vendor only once if (!isset(self::$composer[$target])) @@ -3811,14 +4330,14 @@ abstract class ComponentbuilderHelper /** - * Load the Composer Vendor vdm_io + * Load the Composer Vendor phpseclib **/ - protected static function composevdm_io() + protected static function composephpseclib() { - // load the autoloader for vdm_io - require_once JPATH_SITE . '/libraries/vdm_io/vendor/autoload.php'; + // load the autoloader for phpseclib + require_once JPATH_SITE . '/libraries/phpseclib/vendor/autoload.php'; // do not load again - self::$composer['vdm_io'] = true; + self::$composer['phpseclib'] = true; } @@ -4530,426 +5049,6 @@ abstract class ComponentbuilderHelper return false; } - /** - * Move File to Server - * - * @param string $localPath The local path to the file - * @param string $fileName The the actual file name - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return bool true on success - **/ - public static function moveToServer($localPath, $fileName, $serverID, $protocol = null, $permission = 'core.export') - { - // get the server - if ($server = self::getServer( (int) $serverID, $protocol, $permission)) - { - // use the FTP protocol - if (1 == $server->jcb_protocol) - { - // now move the file - if (!$server->store($localPath, $fileName)) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER', $fileName, $server->jcb_remote_server_name[(int) $serverID]), 'Error'); - return false; - } - // close the connection - $server->quit(); - } - // use the SFTP protocol - elseif (2 == $server->jcb_protocol) - { - // now move the file - if (!$server->put($server->jcb_remote_server_path[(int) $serverID] . $fileName, self::getFileContents($localPath, null))) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER', $fileName, $server->jcb_remote_server_path[(int) $serverID], $server->jcb_remote_server_name[(int) $serverID]), 'Error'); - return false; - } - } - return true; - } - return false; - } - - /** - * the SFTP objects - **/ - protected static $sftp = array(); - - /** - * the FTP objects - **/ - protected static $ftp = array(); - - /** - * get the server object - * - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return object on success server object - **/ - public static function getServer($serverID, $protocol = null, $permission = 'core.export') - { - // if not protocol is given get it (sad I know) - if (!$protocol) - { - $protocol = self::getVar('server', (int) $serverID, 'id', 'protocol'); - } - // return the server object - switch ($protocol) - { - case 1: // FTP - return self::getFtp($serverID, $permission); - break; - case 2: // SFTP - return self::getSftp($serverID, $permission); - break; - } - return false; - } - - /** - * get the sftp object - * - * @param int $serverID The server local id to use - * @param string $permission The permission validation area - * - * @return object on success with sftp power - **/ - public static function getSftp($serverID, $permission = 'core.export') - { - // check if we have a server with that id - if ($server = self::getServerDetails($serverID, 2, $permission)) - { - // check if it was already set - if (!isset(self::$sftp[$server->cache]) || !self::checkObject(self::$sftp[$server->cache])) - { - // make sure we have the composer classes loaded - self::composerAutoload(); - // make sure we have the phpseclib classes - if (!class_exists('\phpseclib\Net\SFTP')) - { - // class not in place so send out error - JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error'); - return false; - } - // insure the port is set - $server->port = (isset($server->port) && is_int($server->port) && $server->port > 0) ? $server->port : 22; - // open the connection - self::$sftp[$server->cache] = new phpseclib\Net\SFTP($server->host, $server->port); - // heads-up on protocol - self::$sftp[$server->cache]->jcb_protocol = 2; // SFTP <-- if called not knowing what type of protocol is being used - // now login based on authentication type - switch($server->authentication) - { - case 1: // password - if (!self::$sftp[$server->cache]->login($server->username, $server->password)) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - break; - case 2: // private key file - if (self::checkObject(self::crypt('RSA'))) - { - // check if we have a passprase - if (self::checkString($server->secret)) - { - self::crypt('RSA')->setPassword($server->secret); - } - // now load the key file - if (!self::crypt('RSA')->loadKey(self::getFileContents($server->private, null))) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - // now login - if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA'))) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - } - break; - case 3: // both password and private key file - if (self::checkObject(self::crypt('RSA'))) - { - // check if we have a passphrase - if (self::checkString($server->secret)) - { - self::crypt('RSA')->setPassword($server->secret); - } - // now load the key file - if (!self::crypt('RSA')->loadKey(self::getFileContents($server->private, null))) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - // now login - if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA'))) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - } - break; - case 4: // private key field - if (self::checkObject(self::crypt('RSA'))) - { - // check if we have a passprase - if (self::checkString($server->secret)) - { - self::crypt('RSA')->setPassword($server->secret); - } - // now load the key field - if (!self::crypt('RSA')->loadKey($server->private_key)) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - // now login - if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA'))) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - } - break; - case 5: // both password and private key field - if (self::checkObject(self::crypt('RSA'))) - { - // check if we have a passphrase - if (self::checkString($server->secret)) - { - self::crypt('RSA')->setPassword($server->secret); - } - // now load the key file - if (!self::crypt('RSA')->loadKey($server->private_key)) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - // now login - if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA'))) - { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); - unset(self::$sftp[$server->cache]); - return false; - } - } - break; - } - } - // only continue if object is set - if (isset(self::$sftp[$server->cache]) && self::checkObject(self::$sftp[$server->cache])) - { - // set the unique buckets - if (!isset(self::$sftp[$server->cache]->jcb_remote_server_name)) - { - self::$sftp[$server->cache]->jcb_remote_server_name = array(); - self::$sftp[$server->cache]->jcb_remote_server_path = array(); - } - // always set the name and remote server path - self::$sftp[$server->cache]->jcb_remote_server_name[$serverID] = $server->name; - self::$sftp[$server->cache]->jcb_remote_server_path[$serverID] = (self::checkString($server->path) && $server->path !== '/') ? $server->path : ''; - // return the sftp object - return self::$sftp[$server->cache]; - } - } - return false; - } - - /** - * get the JClientFtp object - * - * @param int $serverID The server local id to use - * @param string $permission The permission validation area - * - * @return object on success with ftp power - **/ - public static function getFtp($serverID, $permission) - { - // check if we have a server with that id - if ($server = self::getServerDetails($serverID, 1, $permission)) - { - // check if we already have the server instance - if (isset(self::$ftp[$server->cache]) && self::$ftp[$server->cache] instanceof JClientFtp) - { - // always set the name and remote server path - self::$ftp[$server->cache]->jcb_remote_server_name[$serverID] = $server->name; - // if still connected we are ready to go - if (self::$ftp[$server->cache]->isConnected()) - { - // return the FTP instance - return self::$ftp[$server->cache]; - } - // check if we can reinitialise the server - if (self::$ftp[$server->cache]->reinit()) - { - // return the FTP instance - return self::$ftp[$server->cache]; - } - } - // make sure we have a string and it is not default or empty - if (self::checkString($server->signature)) - { - // turn into variables - parse_str($server->signature); // because of this I am using strange variable naming to avoid any collisions. - // set options - if (isset($options) && self::checkArray($options)) - { - foreach ($options as $o__p0t1on => $vAln3) - { - if ('timeout' === $o__p0t1on) - { - $options[$o__p0t1on] = (int) $vAln3; - } - if ('type' === $o__p0t1on) - { - $options[$o__p0t1on] = (string) $vAln3; - } - } - } - else - { - $options = array(); - } - // get ftp object - if (isset($host) && $host != 'HOSTNAME' && isset($port) && $port != 'PORT_INT' && isset($username) && $username != 'user@name.com' && isset($password) && $password != 'password') - { - // load for reuse - self::$ftp[$server->cache] = JClientFtp::getInstance($host, $port, $options, $username, $password); - } - else - { - // load error to indicate signature was in error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); - return false; - } - // check if we are connected - if (self::$ftp[$server->cache] instanceof JClientFtp && self::$ftp[$server->cache]->isConnected()) - { - // heads-up on protocol - self::$ftp[$server->cache]->jcb_protocol = 1; // FTP <-- if called not knowing what type of protocol is being used - // set the unique buckets - if (!isset(self::$ftp[$server->cache]->jcb_remote_server_name)) - { - self::$ftp[$server->cache]->jcb_remote_server_name = array(); - } - // always set the name and remote server path - self::$ftp[$server->cache]->jcb_remote_server_name[$serverID] = $server->name; - // return the FTP instance - return self::$ftp[$server->cache]; - } - // reset since we have no connection - unset(self::$ftp[$server->cache]); - } - // load error to indicate signature was in error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); - } - return false; - } - - /** - * get the server details - * - * @param int $serverID The server local id to use - * @param int $protocol The server protocol to use - * @param string $permission The permission validation area - * - * @return object on success with server details - **/ - public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export') - { - // check if this user has permission to access items - if (!JFactory::getUser()->authorise($permission, 'com_componentbuilder')) - { - // set message to inform the user that permission was denied - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', self::safeString($permission, 'w')), 'Error'); - return false; - } - // now insure we have correct values - if (is_int($serverID) && is_int($protocol)) - { - // Get a db connection - $db = JFactory::getDbo(); - // start the query - $query = $db->getQuery(true); - // select based to protocol - if (2 == $protocol) - { - // SFTP - $query->select($db->quoteName(array('name','authentication','username','host','password','path','port','private','private_key','secret'))); - // cache builder - $cache = array('authentication','username','host','password','port','private','private_key','secret'); - } - else - { - // FTP - $query->select($db->quoteName(array('name','signature'))); - // cache builder - $cache = array('signature'); - } - $query->from($db->quoteName('#__componentbuilder_server')); - $query->where($db->quoteName('id') . ' = ' . (int) $serverID); - $query->where($db->quoteName('protocol') . ' = ' . (int) $protocol); - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) - { - $server = $db->loadObject(); - // Get the basic encryption. - $basickey = self::getCryptKey('basic', 'Th1sMnsTbL0ck@d'); - // Get the encryption object. - $basic = new FOFEncryptAes($basickey, 128); - // start cache keys - $keys = array(); - // unlock the needed fields - foreach($server as $name => &$value) - { - // unlock the needed fields - if ($name !== 'name' && !empty($value) && $basickey && !is_numeric($value) && $value === base64_encode(base64_decode($value, true))) - { - // basic decrypt of data - $value = rtrim($basic->decryptString($value), "\0"); - } - // build cache (keys) for lower connection latency - if (in_array($name, $cache)) - { - $keys[] = $value; - } - } - // check if cache keys were found - if (self::checkArray($keys)) - { - // now set cache - $server->cache = md5(implode('', $keys)); - } - else - { - // default is ID - $server->cache = $serverID; - } - // return the server details - return $server; - } - } - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error'); - return false; - } - /** * Get an edit button * @@ -5239,41 +5338,6 @@ abstract class ComponentbuilderHelper } - /** - * the Crypt objects - **/ - protected static $CRYPT = array(); - - /** - * get the Crypt object - * - * @return object on success with Crypt power - **/ - public static function crypt($TYPE) - { - // check if it was already set - if (isset(self::$CRYPT[$TYPE]) && self::checkObject(self::$CRYPT[$TYPE])) - { - return self::$CRYPT[$TYPE]; - } - // make sure we have the composer classes loaded - self::composerAutoload(); - // build class name - $CLASS = '\phpseclib\Crypt\\'.$TYPE; - // make sure we have the phpseclib classes - if (!class_exists($CLASS)) - { - // class not in place so send out error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', $CLASS), 'Error'); - return false; - } - // set the - self::$CRYPT[$TYPE] = new $CLASS(); - // return the object - return self::$CRYPT[$TYPE]; - } - - /** * set subform type table * diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 44f7e2603..a9eca0089 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -3798,8 +3798,8 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_KEY="Key" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LAMP="Lamp" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LAST="Last" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LIBRARIES="Libraries" -COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LIBRARIES_DESCRIPTION="Select the libraries you want to use here." -COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LIBRARIES_LABEL="Libraries" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LIBRARIES_DESCRIPTION="Select the media libraries you want to use here." +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LIBRARIES_LABEL="Media Libraries" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LINK="Link" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LINKED_COMPONENTS="Linked - Components" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_LIST="List" @@ -4800,6 +4800,7 @@ COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_DESCRIPTION="Text Area" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_HINT="Value/Example Here" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL="Value/Example" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_MESSAGE="Error! Please add value/example here." +COM_COMPONENTBUILDER_FIELDTYPE_EXPERT_MODE_CUSTOM="Expert Mode - Custom" COM_COMPONENTBUILDER_FIELDTYPE_FIELDS="Fields" COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES="Fieldtypes Categories" COM_COMPONENTBUILDER_FIELDTYPE_FIFTY="50" @@ -4865,8 +4866,8 @@ COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_MESSAGE="Error! Please add some COM_COMPONENTBUILDER_FIELDTYPE_SIXTY_FOUR="64" COM_COMPONENTBUILDER_FIELDTYPE_STATUS="Status" COM_COMPONENTBUILDER_FIELDTYPE_STORE="Store" -COM_COMPONENTBUILDER_FIELDTYPE_STORE_DESCRIPTION="How should the data be stored." -COM_COMPONENTBUILDER_FIELDTYPE_STORE_LABEL="Store Method" +COM_COMPONENTBUILDER_FIELDTYPE_STORE_DESCRIPTION="How should the field value be modeled during saving and getting of the value. Default is the Joomla basic normal storing way of dealing with this field type." +COM_COMPONENTBUILDER_FIELDTYPE_STORE_LABEL="Field Modeling Method
Store Method" COM_COMPONENTBUILDER_FIELDTYPE_TEN="10" COM_COMPONENTBUILDER_FIELDTYPE_TEXT="TEXT" COM_COMPONENTBUILDER_FIELDTYPE_TIME="TIME" @@ -4938,6 +4939,7 @@ COM_COMPONENTBUILDER_FIELD_DOUBLE="DOUBLE" COM_COMPONENTBUILDER_FIELD_EDIT="Editing the Field" COM_COMPONENTBUILDER_FIELD_ELEVEN="11" COM_COMPONENTBUILDER_FIELD_ERROR_UNIQUE_ALIAS="Another Field has the same alias." +COM_COMPONENTBUILDER_FIELD_EXPERT_MODE_CUSTOM="Expert Mode - Custom" COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES="Fields Categories" COM_COMPONENTBUILDER_FIELD_FIELDTYPE="Fieldtype" COM_COMPONENTBUILDER_FIELD_FIELDTYPE_DESCRIPTION="Set the field type" @@ -4948,6 +4950,20 @@ COM_COMPONENTBUILDER_FIELD_HELPNOTE_LABEL="Field Information" COM_COMPONENTBUILDER_FIELD_ID="Id" COM_COMPONENTBUILDER_FIELD_INDEXES="Indexes" COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL="Indexes Type" +COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_GET_MODEL="Initiator On Get Model" +COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_GET_MODEL_DESCRIPTION="The initiator to on get model this field. If JCB finds that there is more then one field with the same initiator code in one view it will only load it once. You could also leave this blank if you already have the on get model initiator set in another field of the same admin_view." +COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_GET_MODEL_HINT="// Get the medium decryption. +$mediumkey = [[[Component]]]Helper::getCryptKey('medium'); +// Get the encryption object. +$medium = new FOFEncryptAes($mediumkey);" +COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_GET_MODEL_LABEL="Initiator
on get model" +COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_SAVE_MODEL="Initiator On Save Model" +COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_SAVE_MODEL_DESCRIPTION="The initiator to on save model this field. If JCB finds that there is more then one field with the same initiator code in one view it will only load it once. You could also leave this blank if you already have the on save model initiator set in another field of the same admin_view." +COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_SAVE_MODEL_HINT="// Get the medium encryption. +$mediumkey = [[[Component]]]Helper::getCryptKey('medium'); +// Get the encryption object. +$medium = new FOFEncryptAes($mediumkey);" +COM_COMPONENTBUILDER_FIELD_INITIATOR_ON_SAVE_MODEL_LABEL="Initiator
on save model" COM_COMPONENTBUILDER_FIELD_INT="INT" COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEWS_FOOTER="Javascript Views Footer" COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEWS_FOOTER_DESCRIPTION="Add JavaScript for the list view that is loaded in the footer inside script tags. Do not add the script tags." @@ -4977,6 +4993,9 @@ COM_COMPONENTBUILDER_FIELD_NONE="None" COM_COMPONENTBUILDER_FIELD_NONE_SET="None Set" COM_COMPONENTBUILDER_FIELD_NOTE_DATABASE_SETTINGS_NEEDED_DESCRIPTION="

Set the database column for this field here. The column will have the same name as the field. Please take care to select these settings in the correct relationship. The nature of this area is to give you as much freedom/power as you would like, but with that comes responsibility.

You therefore need to insure that you know what the correct values should be. A great way to learn, is to look at the Joomla core components fields and the corresponding mySql columns.

" COM_COMPONENTBUILDER_FIELD_NOTE_DATABASE_SETTINGS_NEEDED_LABEL="Database Settings" +COM_COMPONENTBUILDER_FIELD_NOTE_EXPERT_FIELD_SAVE_MODE_DESCRIPTION="

When using the EXPERT mode you need to be that expert.

+

Bellow you must add the required code to on save model and on get model the set value. Usually if we start modeling values, we first load the needed classes, so for that purpose you have the initiator input areas.

" +COM_COMPONENTBUILDER_FIELD_NOTE_EXPERT_FIELD_SAVE_MODE_LABEL="The Expert Mode" COM_COMPONENTBUILDER_FIELD_NOTE_FILTER_INFORMATION_DESCRIPTION="

Filter Information

@@ -5080,6 +5099,18 @@ COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL="Null Switch" COM_COMPONENTBUILDER_FIELD_ONE="1" COM_COMPONENTBUILDER_FIELD_ONE_HUNDRED="100" COM_COMPONENTBUILDER_FIELD_ONE_THOUSAND_AND_TWENTY_FOUR="1024" +COM_COMPONENTBUILDER_FIELD_ON_GET_MODEL_FIELD="On Get Model Field" +COM_COMPONENTBUILDER_FIELD_ON_GET_MODEL_FIELD_DESCRIPTION="To on get model the field value" +COM_COMPONENTBUILDER_FIELD_ON_GET_MODEL_FIELD_HINT="if (!empty([[[field]]]) && $mediumkey && !is_numeric([[[field]]]) && [[[field]]] === base64_encode(base64_decode([[[field]]], true))) +{ + // medium decrypt field + [[[field]]] = rtrim($medium->decryptString([[[field]]]), "\0"); +}" +COM_COMPONENTBUILDER_FIELD_ON_GET_MODEL_FIELD_LABEL="On Get Model" +COM_COMPONENTBUILDER_FIELD_ON_SAVE_MODEL_FIELD="On Save Model Field" +COM_COMPONENTBUILDER_FIELD_ON_SAVE_MODEL_FIELD_DESCRIPTION="To on save model the field value" +COM_COMPONENTBUILDER_FIELD_ON_SAVE_MODEL_FIELD_HINT="[[[field]]] = $medium->encryptString([[[field]]]);" +COM_COMPONENTBUILDER_FIELD_ON_SAVE_MODEL_FIELD_LABEL="On Save Model" COM_COMPONENTBUILDER_FIELD_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_FIELD_OTHER="Other" COM_COMPONENTBUILDER_FIELD_PERMISSION="Permissions" @@ -5094,8 +5125,8 @@ COM_COMPONENTBUILDER_FIELD_SEVEN="7" COM_COMPONENTBUILDER_FIELD_SIXTY_FOUR="64" COM_COMPONENTBUILDER_FIELD_STATUS="Status" COM_COMPONENTBUILDER_FIELD_STORE="Store" -COM_COMPONENTBUILDER_FIELD_STORE_DESCRIPTION="How should the data be stored." -COM_COMPONENTBUILDER_FIELD_STORE_LABEL="Store Method" +COM_COMPONENTBUILDER_FIELD_STORE_DESCRIPTION="How should the field value be modeled during saving and getting of the value. Default is the Joomla basic normal storing way of dealing with this field type." +COM_COMPONENTBUILDER_FIELD_STORE_LABEL="Field Modeling Method
Store Method" COM_COMPONENTBUILDER_FIELD_TEN="10" COM_COMPONENTBUILDER_FIELD_TEXT="TEXT" COM_COMPONENTBUILDER_FIELD_TIME="TIME" @@ -6632,8 +6663,8 @@ COM_COMPONENTBUILDER_LAYOUT_LAYOUT="Layout" COM_COMPONENTBUILDER_LAYOUT_LAYOUT_DESCRIPTION="Add the layout code here." COM_COMPONENTBUILDER_LAYOUT_LAYOUT_LABEL="Layout
$displayData is the Object that is used inside the layout file to build displayed output" COM_COMPONENTBUILDER_LAYOUT_LIBRARIES="Libraries" -COM_COMPONENTBUILDER_LAYOUT_LIBRARIES_DESCRIPTION="Select the libraries you want to use here." -COM_COMPONENTBUILDER_LAYOUT_LIBRARIES_LABEL="Libraries" +COM_COMPONENTBUILDER_LAYOUT_LIBRARIES_DESCRIPTION="Select the media libraries you want to use here." +COM_COMPONENTBUILDER_LAYOUT_LIBRARIES_LABEL="Media Libraries" COM_COMPONENTBUILDER_LAYOUT_MODIFIED_BY_DESC="The last user that modified this Layout." COM_COMPONENTBUILDER_LAYOUT_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_LAYOUT_MODIFIED_DATE_DESC="The date this Layout was modified." @@ -6985,10 +7016,11 @@ COM_COMPONENTBUILDER_LIBRARY_KEY_WORD_ANY_CASEINSENSITIVE_ONLY_FOUR_TEXT_FIELD=" COM_COMPONENTBUILDER_LIBRARY_KEY_WORD_ANY_CASESENSITIVE_ONLY_FOUR_TEXT_FIELD="Key Word Any case-sensitive (only 4 text_field)" COM_COMPONENTBUILDER_LIBRARY_LIBRARIES="Libraries" COM_COMPONENTBUILDER_LIBRARY_LIBRARIES_DESCRIPTION="Select the libraries you want to bundle here." -COM_COMPONENTBUILDER_LIBRARY_LIBRARIES_LABEL="Libraries" +COM_COMPONENTBUILDER_LIBRARY_LIBRARIES_LABEL="Media Libraries" COM_COMPONENTBUILDER_LIBRARY_LINKED="Linked" COM_COMPONENTBUILDER_LIBRARY_MAIN="Main" COM_COMPONENTBUILDER_LIBRARY_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD="Max Length (only 4 text_field)" +COM_COMPONENTBUILDER_LIBRARY_MEDIA="Media" COM_COMPONENTBUILDER_LIBRARY_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)" COM_COMPONENTBUILDER_LIBRARY_MODIFIED_BY_DESC="The last user that modified this Library." COM_COMPONENTBUILDER_LIBRARY_MODIFIED_BY_LABEL="Modified By" @@ -7037,13 +7069,16 @@ COM_COMPONENTBUILDER_LIBRARY_PHP_SETDOCUMENT_LABEL="PHP - setDocument()" COM_COMPONENTBUILDER_LIBRARY_PUBLISHING="Publishing" COM_COMPONENTBUILDER_LIBRARY_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Library to customise the alias." COM_COMPONENTBUILDER_LIBRARY_STATUS="Status" +COM_COMPONENTBUILDER_LIBRARY_TARGET="Target" COM_COMPONENTBUILDER_LIBRARY_TARGET_BEHAVIOR_DESCRIPTION="Select the target behavior." COM_COMPONENTBUILDER_LIBRARY_TARGET_BEHAVIOR_LABEL="Target Behavior" +COM_COMPONENTBUILDER_LIBRARY_TARGET_DESCRIPTION="Select what target folder this library belongs to. Media is used mostly for CSS and JavaScript type libraries, and Libraries are for PHP libraries." +COM_COMPONENTBUILDER_LIBRARY_TARGET_LABEL="Target Folder" COM_COMPONENTBUILDER_LIBRARY_TARGET_RELATION_DESCRIPTION="Select the target file/s relation to other of the same target file/s." COM_COMPONENTBUILDER_LIBRARY_TARGET_RELATION_LABEL="Target Relation" COM_COMPONENTBUILDER_LIBRARY_TYPE="Type" -COM_COMPONENTBUILDER_LIBRARY_TYPE_DESCRIPTION="Select what type of library this should be." -COM_COMPONENTBUILDER_LIBRARY_TYPE_LABEL="Type" +COM_COMPONENTBUILDER_LIBRARY_TYPE_DESCRIPTION="Select what type of library behavior this should be." +COM_COMPONENTBUILDER_LIBRARY_TYPE_LABEL="Type Behavior" COM_COMPONENTBUILDER_LIBRARY_UNACTIVE_ONLY_FOUR_TEXT_FIELD="Unactive (only 4 text_field)" COM_COMPONENTBUILDER_LIBRARY_VERSION_DESC="A count of the number of times this Library has been revised." COM_COMPONENTBUILDER_LIBRARY_VERSION_LABEL="Revision" @@ -7105,6 +7140,7 @@ COM_COMPONENTBUILDER_NO_S_FOUND="No %s Found" COM_COMPONENTBUILDER_NO_S_HAVE_BEEN_LINKED_TO_THIS_VIEW_SOON_AS_THIS_IS_DONE_IT_WILL_BE_DISPLAYED_HERE="No %s have been linked to this view. Soon as this is done it will be displayed here." COM_COMPONENTBUILDER_NO_TYPE="No Type" COM_COMPONENTBUILDER_NO_VALIDATION_RULES_FOUND="No validation rules found." +COM_COMPONENTBUILDER_NO_VALID_MODE_HAS_BEEN_SPECIFIED="No valid mode has been specified!" COM_COMPONENTBUILDER_OFFICIAL_VDM_PACKAGES="Official VDM Packages" COM_COMPONENTBUILDER_ONLY_IN_ADMIN_LIST_VIEW="Only in Admin List View" COM_COMPONENTBUILDER_ONLY_IN_LINKED_LIST_VIEWS="Only in Linked List Views" @@ -7706,8 +7742,8 @@ COM_COMPONENTBUILDER_SITE_VIEW_KEY="Key" COM_COMPONENTBUILDER_SITE_VIEW_LAMP="Lamp" COM_COMPONENTBUILDER_SITE_VIEW_LAST="Last" COM_COMPONENTBUILDER_SITE_VIEW_LIBRARIES="Libraries" -COM_COMPONENTBUILDER_SITE_VIEW_LIBRARIES_DESCRIPTION="Select the libraries you want to use here." -COM_COMPONENTBUILDER_SITE_VIEW_LIBRARIES_LABEL="Libraries" +COM_COMPONENTBUILDER_SITE_VIEW_LIBRARIES_DESCRIPTION="Select the media libraries you want to use here." +COM_COMPONENTBUILDER_SITE_VIEW_LIBRARIES_LABEL="Media Libraries" COM_COMPONENTBUILDER_SITE_VIEW_LINK="Link" COM_COMPONENTBUILDER_SITE_VIEW_LINKED_COMPONENTS="Linked - Components" COM_COMPONENTBUILDER_SITE_VIEW_LIST="List" @@ -8222,8 +8258,8 @@ COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS="Template Get Snippets COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_TEMPLATE_ID="Id" COM_COMPONENTBUILDER_TEMPLATE_LIBRARIES="Libraries" -COM_COMPONENTBUILDER_TEMPLATE_LIBRARIES_DESCRIPTION="Select the libraries you want to use here." -COM_COMPONENTBUILDER_TEMPLATE_LIBRARIES_LABEL="Libraries" +COM_COMPONENTBUILDER_TEMPLATE_LIBRARIES_DESCRIPTION="Select the media libraries you want to use here." +COM_COMPONENTBUILDER_TEMPLATE_LIBRARIES_LABEL="Media Libraries" COM_COMPONENTBUILDER_TEMPLATE_MODIFIED_BY_DESC="The last user that modified this Template." COM_COMPONENTBUILDER_TEMPLATE_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_TEMPLATE_MODIFIED_DATE_DESC="The date this Template was modified." @@ -8284,7 +8320,7 @@ COM_COMPONENTBUILDER_THE_BONLY_IN_LINKED_LIST_VIEWSB_OPTION_WILL_ONLY_ADD_THIS_F COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The phpseclib\NET\SFTP library\class is not available! This library\class should have been added to your libraries/vdm_io/vendor folder. Please contact your system administrator for more info" COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER="The %s file could not be moved to %s path on %s server." COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER="The %s file could not be moved to %s server." -COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The %s library\class is not available! This library\class should have been added to your libraries/vdm_io/vendor folder. Please contact your system administrator for more info!" +COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="The %s library\class is not available! This library\class should have been added to your libraries/phpseclib/vendor folder. Please contact your system administrator for more info!" COM_COMPONENTBUILDER_THE_BSB_LIBRARY_CAN_NOT_BE_DELETED_OR_THINGS_WILL_BREAK="The %s library can not be deleted, or things will break." COM_COMPONENTBUILDER_THE_BSHOW_IN_ALL_LIST_VIEWSB_OPTION_WILL_ADD_THIS_FIELD_TO_ALL_LIST_VIEWS_ADMIN_AMP_LINKED="The Show in All List Views option will Add this field to all list views, admin & linked." COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views" diff --git a/admin/layouts/field/database_right.php b/admin/layouts/field/database_right.php index b311d32ec..3aec083f3 100644 --- a/admin/layouts/field/database_right.php +++ b/admin/layouts/field/database_right.php @@ -29,7 +29,12 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'indexes', 'null_switch', 'store', - 'note_whmcs_encryption' + 'note_whmcs_encryption', + 'note_expert_field_save_mode', + 'initiator_on_save_model', + 'initiator_on_get_model', + 'on_save_model_field', + 'on_get_model_field' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index c7430d98b..d9e3b26cc 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -13,7 +13,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vxyfields; +$items = $displayData->vyifields; $user = JFactory::getUser(); $id = $displayData->item->id; // set the edit URL diff --git a/admin/layouts/library/behaviour_above.php b/admin/layouts/library/behaviour_above.php index 62a28fbaf..bb5d598fc 100644 --- a/admin/layouts/library/behaviour_above.php +++ b/admin/layouts/library/behaviour_above.php @@ -27,6 +27,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( 'name', + 'target', 'how', 'type' ); diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index 007dc427b..7195f4dab 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -13,7 +13,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vyilinked_components; +$items = $displayData->vyslinked_components; $user = JFactory::getUser(); $id = $displayData->item->id; // set the edit URL diff --git a/admin/models/ajax.php b/admin/models/ajax.php index ed533d102..7afc33d96 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -2365,7 +2365,7 @@ class ComponentbuilderModelAjax extends JModelList ), // #__componentbuilder_field (i) 'field' => array( - 'search' => array('id', 'name', 'xml', 'javascript_view_footer', 'javascript_views_footer'), + 'search' => array('id', 'name', 'xml', 'javascript_view_footer', 'javascript_views_footer', 'on_save_model_field', 'on_get_model_field', 'initiator_on_save_model', 'initiator_on_get_model'), 'views' => 'fields', 'not_base64' => array('xml' => 'json'), 'base64_search' => array('xml' => array('start' => 'type_php', '_start' => '="', 'end' => '"')), diff --git a/admin/models/field.php b/admin/models/field.php index 0ff0cac4e..b95612521 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -51,7 +51,12 @@ class ComponentbuilderModelField extends JModelAdmin 'indexes', 'null_switch', 'store', - 'note_whmcs_encryption' + 'note_whmcs_encryption', + 'note_expert_field_save_mode', + 'initiator_on_save_model', + 'initiator_on_get_model', + 'on_save_model_field', + 'on_get_model_field' ), 'fullwidth' => array( 'note_no_database_settings_needed', @@ -154,10 +159,22 @@ class ComponentbuilderModelField extends JModelAdmin $item->metadata = $registry->toArray(); } - if (!empty($item->css_views)) + if (!empty($item->on_get_model_field)) { - // base64 Decode css_views. - $item->css_views = base64_decode($item->css_views); + // base64 Decode on_get_model_field. + $item->on_get_model_field = base64_decode($item->on_get_model_field); + } + + if (!empty($item->on_save_model_field)) + { + // base64 Decode on_save_model_field. + $item->on_save_model_field = base64_decode($item->on_save_model_field); + } + + if (!empty($item->initiator_on_get_model)) + { + // base64 Decode initiator_on_get_model. + $item->initiator_on_get_model = base64_decode($item->initiator_on_get_model); } if (!empty($item->css_view)) @@ -166,6 +183,12 @@ class ComponentbuilderModelField extends JModelAdmin $item->css_view = base64_decode($item->css_view); } + if (!empty($item->css_views)) + { + // base64 Decode css_views. + $item->css_views = base64_decode($item->css_views); + } + if (!empty($item->javascript_view_footer)) { // base64 Decode javascript_view_footer. @@ -178,6 +201,12 @@ class ComponentbuilderModelField extends JModelAdmin $item->javascript_views_footer = base64_decode($item->javascript_views_footer); } + if (!empty($item->initiator_on_save_model)) + { + // base64 Decode initiator_on_save_model. + $item->initiator_on_save_model = base64_decode($item->initiator_on_save_model); + } + if (!empty($item->xml)) { // JSON Decode xml. @@ -1067,10 +1096,22 @@ class ComponentbuilderModelField extends JModelAdmin $data['xml'] = (string) json_encode($data['xml']); } - // Set the css_views string to base64 string. - if (isset($data['css_views'])) + // Set the on_get_model_field string to base64 string. + if (isset($data['on_get_model_field'])) { - $data['css_views'] = base64_encode($data['css_views']); + $data['on_get_model_field'] = base64_encode($data['on_get_model_field']); + } + + // Set the on_save_model_field string to base64 string. + if (isset($data['on_save_model_field'])) + { + $data['on_save_model_field'] = base64_encode($data['on_save_model_field']); + } + + // Set the initiator_on_get_model string to base64 string. + if (isset($data['initiator_on_get_model'])) + { + $data['initiator_on_get_model'] = base64_encode($data['initiator_on_get_model']); } // Set the css_view string to base64 string. @@ -1079,6 +1120,12 @@ class ComponentbuilderModelField extends JModelAdmin $data['css_view'] = base64_encode($data['css_view']); } + // Set the css_views string to base64 string. + if (isset($data['css_views'])) + { + $data['css_views'] = base64_encode($data['css_views']); + } + // Set the javascript_view_footer string to base64 string. if (isset($data['javascript_view_footer'])) { @@ -1089,6 +1136,12 @@ class ComponentbuilderModelField extends JModelAdmin if (isset($data['javascript_views_footer'])) { $data['javascript_views_footer'] = base64_encode($data['javascript_views_footer']); + } + + // Set the initiator_on_save_model string to base64 string. + if (isset($data['initiator_on_save_model'])) + { + $data['initiator_on_save_model'] = base64_encode($data['initiator_on_save_model']); } // Set the Params Items to data diff --git a/admin/models/fields.php b/admin/models/fields.php index 0e9e965af..73ffa1358 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -233,7 +233,8 @@ class ComponentbuilderModelFields extends JModelList 2 => 'COM_COMPONENTBUILDER_FIELD_BASESIXTY_FOUR', 3 => 'COM_COMPONENTBUILDER_FIELD_BASIC_ENCRYPTION_LOCALDBKEY', 5 => 'COM_COMPONENTBUILDER_FIELD_MEDIUM_ENCRYPTION_LOCALFILEKEY', - 4 => 'COM_COMPONENTBUILDER_FIELD_WHMCSKEY_ENCRYPTION' + 4 => 'COM_COMPONENTBUILDER_FIELD_WHMCSKEY_ENCRYPTION', + 6 => 'COM_COMPONENTBUILDER_FIELD_EXPERT_MODE_CUSTOM' ); // Now check if value is found in this array if (isset($storeArray[$value]) && ComponentbuilderHelper::checkString($storeArray[$value])) @@ -428,14 +429,22 @@ class ComponentbuilderModelFields extends JModelList continue; } - // decode css_views - $item->css_views = base64_decode($item->css_views); + // decode on_get_model_field + $item->on_get_model_field = base64_decode($item->on_get_model_field); + // decode on_save_model_field + $item->on_save_model_field = base64_decode($item->on_save_model_field); + // decode initiator_on_get_model + $item->initiator_on_get_model = base64_decode($item->initiator_on_get_model); // decode css_view $item->css_view = base64_decode($item->css_view); + // decode css_views + $item->css_views = base64_decode($item->css_views); // decode javascript_view_footer $item->javascript_view_footer = base64_decode($item->javascript_view_footer); // decode javascript_views_footer $item->javascript_views_footer = base64_decode($item->javascript_views_footer); + // decode initiator_on_save_model + $item->initiator_on_save_model = base64_decode($item->initiator_on_save_model); // unset the values we don't want exported. unset($item->asset_id); unset($item->checked_out); diff --git a/admin/models/fields/libraries.php b/admin/models/fields/libraries.php index b3548346c..f4f82f756 100644 --- a/admin/models/fields/libraries.php +++ b/admin/models/fields/libraries.php @@ -139,22 +139,24 @@ class JFormFieldLibraries extends JFormFieldList */ protected function getOptions() { - $db = JFactory::getDBO(); - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.name'),array('id','libraries_name'))); - $query->from($db->quoteName('#__componentbuilder_library', 'a')); - $query->where($db->quoteName('a.published') . ' >= 1'); - $query->order('a.name ASC'); - $db->setQuery((string)$query); - $items = $db->loadObjectList(); - $options = array(); - if ($items) - { - foreach($items as $item) - { - $options[] = JHtml::_('select.option', $item->id, $item->libraries_name); - } - } + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name'),array('id','libraries_name'))); + $query->from($db->quoteName('#__componentbuilder_library', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->where($db->quoteName('a.target') . ' = 1'); + $query->order('a.name ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->libraries_name); + } + } + return $options; } } diff --git a/admin/models/fields/librariesx.php b/admin/models/fields/librariesx.php index 963cf17d0..6ecbe6a94 100644 --- a/admin/models/fields/librariesx.php +++ b/admin/models/fields/librariesx.php @@ -139,30 +139,32 @@ class JFormFieldLibrariesx extends JFormFieldList */ protected function getOptions() { - // get the input from url - $jinput = JFactory::getApplication()->input; - // get the library id - $libID = $jinput->getInt('id', 0); - $db = JFactory::getDBO(); - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.name'),array('id','libraries_name'))); - $query->from($db->quoteName('#__componentbuilder_library', 'a')); + // get the input from url + $jinput = JFactory::getApplication()->input; + // get the library id + $libID = $jinput->getInt('id', 0); + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name'),array('id','libraries_name'))); + $query->from($db->quoteName('#__componentbuilder_library', 'a')); $query->where($db->quoteName('a.published') . ' >= 1'); + $query->where($db->quoteName('a.target') . ' = 1'); if ($libID > 0) { $query->where($db->quoteName('a.id') . ' != ' . (int) $libID); - } - $query->order('a.name ASC'); - $db->setQuery((string)$query); - $items = $db->loadObjectList(); - $options = array(); - if ($items) - { - foreach($items as $item) - { - $options[] = JHtml::_('select.option', $item->id, $item->libraries_name); - } - } + } + $query->order('a.name ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->libraries_name); + } + } + return $options; } } diff --git a/admin/models/fields/library.php b/admin/models/fields/library.php index 98ae99b44..0ceb90fad 100644 --- a/admin/models/fields/library.php +++ b/admin/models/fields/library.php @@ -139,24 +139,25 @@ class JFormFieldLibrary extends JFormFieldList */ protected function getOptions() { - $db = JFactory::getDBO(); - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.name'),array('id','library_name'))); - $query->from($db->quoteName('#__componentbuilder_library', 'a')); + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name'),array('id','library_name'))); + $query->from($db->quoteName('#__componentbuilder_library', 'a')); $query->where($db->quoteName('a.published') . ' >= 1'); - $query->where($db->quoteName('a.type') . ' = 1'); - $query->order('a.name ASC'); - $db->setQuery((string)$query); - $items = $db->loadObjectList(); - $options = array(); - if ($items) - { - $options[] = JHtml::_('select.option', '', 'Select an option'); - foreach($items as $item) - { - $options[] = JHtml::_('select.option', $item->id, $item->library_name); - } - } + $query->where($db->quoteName('a.type') . ' = 1'); + $query->order('a.name ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + $options[] = JHtml::_('select.option', '', 'Select an option'); + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->library_name); + } + } + return $options; } } diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index 50f604c26..538d4d8d3 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -203,7 +203,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVxyfields() + public function getVyifields() { // Get the user object. $user = JFactory::getUser(); @@ -291,13 +291,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin foreach ($items as $nr => &$item) { // convert datatype - $item->datatype = $this->selectionTranslationVxyfields($item->datatype, 'datatype'); + $item->datatype = $this->selectionTranslationVyifields($item->datatype, 'datatype'); // convert indexes - $item->indexes = $this->selectionTranslationVxyfields($item->indexes, 'indexes'); + $item->indexes = $this->selectionTranslationVyifields($item->indexes, 'indexes'); // convert null_switch - $item->null_switch = $this->selectionTranslationVxyfields($item->null_switch, 'null_switch'); + $item->null_switch = $this->selectionTranslationVyifields($item->null_switch, 'null_switch'); // convert store - $item->store = $this->selectionTranslationVxyfields($item->store, 'store'); + $item->store = $this->selectionTranslationVyifields($item->store, 'store'); } } @@ -311,7 +311,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return translatable string */ - public function selectionTranslationVxyfields($value,$name) + public function selectionTranslationVyifields($value,$name) { // Array of datatype language strings if ($name === 'datatype') @@ -379,7 +379,8 @@ class ComponentbuilderModelFieldtype extends JModelAdmin 2 => 'COM_COMPONENTBUILDER_FIELD_BASESIXTY_FOUR', 3 => 'COM_COMPONENTBUILDER_FIELD_BASIC_ENCRYPTION_LOCALDBKEY', 5 => 'COM_COMPONENTBUILDER_FIELD_MEDIUM_ENCRYPTION_LOCALFILEKEY', - 4 => 'COM_COMPONENTBUILDER_FIELD_WHMCSKEY_ENCRYPTION' + 4 => 'COM_COMPONENTBUILDER_FIELD_WHMCSKEY_ENCRYPTION', + 6 => 'COM_COMPONENTBUILDER_FIELD_EXPERT_MODE_CUSTOM' ); // Now check if value is found in this array if (isset($storeArray[$value]) && ComponentbuilderHelper::checkString($storeArray[$value])) diff --git a/admin/models/forms/field.js b/admin/models/forms/field.js index d644d56da..e10251e1f 100644 --- a/admin/models/forms/field.js +++ b/admin/models/forms/field.js @@ -9,61 +9,77 @@ */ // Some Global Values -jform_vvvvwbtvxl_required = false; -jform_vvvvwbuvxm_required = false; -jform_vvvvwbvvxn_required = false; -jform_vvvvwbwvxo_required = false; -jform_vvvvwbxvxp_required = false; +jform_vvvvwccvxn_required = false; +jform_vvvvwcdvxo_required = false; +jform_vvvvwcevxp_required = false; +jform_vvvvwcfvxq_required = false; +jform_vvvvwcgvxr_required = false; +jform_vvvvwcjvxs_required = false; +jform_vvvvwcjvxt_required = false; +jform_vvvvwcjvxu_required = false; +jform_vvvvwcjvxv_required = false; +jform_vvvvwckvxw_required = false; +jform_vvvvwckvxx_required = false; +jform_vvvvwckvxy_required = false; +jform_vvvvwckvxz_required = false; // Initial Script jQuery(document).ready(function() { - var datalenght_vvvvwbt = jQuery("#jform_datalenght").val(); - vvvvwbt(datalenght_vvvvwbt); + var datalenght_vvvvwcc = jQuery("#jform_datalenght").val(); + vvvvwcc(datalenght_vvvvwcc); - var datadefault_vvvvwbu = jQuery("#jform_datadefault").val(); - vvvvwbu(datadefault_vvvvwbu); + var datadefault_vvvvwcd = jQuery("#jform_datadefault").val(); + vvvvwcd(datadefault_vvvvwcd); - var datatype_vvvvwbv = jQuery("#jform_datatype").val(); - vvvvwbv(datatype_vvvvwbv); + var datatype_vvvvwce = jQuery("#jform_datatype").val(); + vvvvwce(datatype_vvvvwce); - var datatype_vvvvwbw = jQuery("#jform_datatype").val(); - vvvvwbw(datatype_vvvvwbw); + var datatype_vvvvwcf = jQuery("#jform_datatype").val(); + vvvvwcf(datatype_vvvvwcf); - var datatype_vvvvwbx = jQuery("#jform_datatype").val(); - vvvvwbx(datatype_vvvvwbx); + var datatype_vvvvwcg = jQuery("#jform_datatype").val(); + vvvvwcg(datatype_vvvvwcg); - var store_vvvvwby = jQuery("#jform_store").val(); - var datatype_vvvvwby = jQuery("#jform_datatype").val(); - vvvvwby(store_vvvvwby,datatype_vvvvwby); + var store_vvvvwch = jQuery("#jform_store").val(); + var datatype_vvvvwch = jQuery("#jform_datatype").val(); + vvvvwch(store_vvvvwch,datatype_vvvvwch); - var add_css_view_vvvvwca = jQuery("#jform_add_css_view input[type='radio']:checked").val(); - vvvvwca(add_css_view_vvvvwca); + var store_vvvvwcj = jQuery("#jform_store").val(); + var datatype_vvvvwcj = jQuery("#jform_datatype").val(); + vvvvwcj(store_vvvvwcj,datatype_vvvvwcj); - var add_css_views_vvvvwcb = jQuery("#jform_add_css_views input[type='radio']:checked").val(); - vvvvwcb(add_css_views_vvvvwcb); + var datatype_vvvvwck = jQuery("#jform_datatype").val(); + var store_vvvvwck = jQuery("#jform_store").val(); + vvvvwck(datatype_vvvvwck,store_vvvvwck); - var add_javascript_view_footer_vvvvwcc = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val(); - vvvvwcc(add_javascript_view_footer_vvvvwcc); + var add_css_view_vvvvwcl = jQuery("#jform_add_css_view input[type='radio']:checked").val(); + vvvvwcl(add_css_view_vvvvwcl); - var add_javascript_views_footer_vvvvwcd = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val(); - vvvvwcd(add_javascript_views_footer_vvvvwcd); + var add_css_views_vvvvwcm = jQuery("#jform_add_css_views input[type='radio']:checked").val(); + vvvvwcm(add_css_views_vvvvwcm); + + var add_javascript_view_footer_vvvvwcn = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val(); + vvvvwcn(add_javascript_view_footer_vvvvwcn); + + var add_javascript_views_footer_vvvvwco = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val(); + vvvvwco(add_javascript_views_footer_vvvvwco); }); -// the vvvvwbt function -function vvvvwbt(datalenght_vvvvwbt) +// the vvvvwcc function +function vvvvwcc(datalenght_vvvvwcc) { - if (isSet(datalenght_vvvvwbt) && datalenght_vvvvwbt.constructor !== Array) + if (isSet(datalenght_vvvvwcc) && datalenght_vvvvwcc.constructor !== Array) { - var temp_vvvvwbt = datalenght_vvvvwbt; - var datalenght_vvvvwbt = []; - datalenght_vvvvwbt.push(temp_vvvvwbt); + var temp_vvvvwcc = datalenght_vvvvwcc; + var datalenght_vvvvwcc = []; + datalenght_vvvvwcc.push(temp_vvvvwcc); } - else if (!isSet(datalenght_vvvvwbt)) + else if (!isSet(datalenght_vvvvwcc)) { - var datalenght_vvvvwbt = []; + var datalenght_vvvvwcc = []; } - var datalenght = datalenght_vvvvwbt.some(datalenght_vvvvwbt_SomeFunc); + var datalenght = datalenght_vvvvwcc.some(datalenght_vvvvwcc_SomeFunc); // set this function logic @@ -71,55 +87,55 @@ function vvvvwbt(datalenght_vvvvwbt) { jQuery('#jform_datalenght_other').closest('.control-group').show(); // add required attribute to datalenght_other field - if (jform_vvvvwbtvxl_required) + if (jform_vvvvwccvxn_required) { updateFieldRequired('datalenght_other',0); jQuery('#jform_datalenght_other').prop('required','required'); jQuery('#jform_datalenght_other').attr('aria-required',true); jQuery('#jform_datalenght_other').addClass('required'); - jform_vvvvwbtvxl_required = false; + jform_vvvvwccvxn_required = false; } } else { jQuery('#jform_datalenght_other').closest('.control-group').hide(); // remove required attribute from datalenght_other field - if (!jform_vvvvwbtvxl_required) + if (!jform_vvvvwccvxn_required) { updateFieldRequired('datalenght_other',1); jQuery('#jform_datalenght_other').removeAttr('required'); jQuery('#jform_datalenght_other').removeAttr('aria-required'); jQuery('#jform_datalenght_other').removeClass('required'); - jform_vvvvwbtvxl_required = true; + jform_vvvvwccvxn_required = true; } } } -// the vvvvwbt Some function -function datalenght_vvvvwbt_SomeFunc(datalenght_vvvvwbt) +// the vvvvwcc Some function +function datalenght_vvvvwcc_SomeFunc(datalenght_vvvvwcc) { // set the function logic - if (datalenght_vvvvwbt == 'Other') + if (datalenght_vvvvwcc == 'Other') { return true; } return false; } -// the vvvvwbu function -function vvvvwbu(datadefault_vvvvwbu) +// the vvvvwcd function +function vvvvwcd(datadefault_vvvvwcd) { - if (isSet(datadefault_vvvvwbu) && datadefault_vvvvwbu.constructor !== Array) + if (isSet(datadefault_vvvvwcd) && datadefault_vvvvwcd.constructor !== Array) { - var temp_vvvvwbu = datadefault_vvvvwbu; - var datadefault_vvvvwbu = []; - datadefault_vvvvwbu.push(temp_vvvvwbu); + var temp_vvvvwcd = datadefault_vvvvwcd; + var datadefault_vvvvwcd = []; + datadefault_vvvvwcd.push(temp_vvvvwcd); } - else if (!isSet(datadefault_vvvvwbu)) + else if (!isSet(datadefault_vvvvwcd)) { - var datadefault_vvvvwbu = []; + var datadefault_vvvvwcd = []; } - var datadefault = datadefault_vvvvwbu.some(datadefault_vvvvwbu_SomeFunc); + var datadefault = datadefault_vvvvwcd.some(datadefault_vvvvwcd_SomeFunc); // set this function logic @@ -127,55 +143,55 @@ function vvvvwbu(datadefault_vvvvwbu) { jQuery('#jform_datadefault_other').closest('.control-group').show(); // add required attribute to datadefault_other field - if (jform_vvvvwbuvxm_required) + if (jform_vvvvwcdvxo_required) { updateFieldRequired('datadefault_other',0); jQuery('#jform_datadefault_other').prop('required','required'); jQuery('#jform_datadefault_other').attr('aria-required',true); jQuery('#jform_datadefault_other').addClass('required'); - jform_vvvvwbuvxm_required = false; + jform_vvvvwcdvxo_required = false; } } else { jQuery('#jform_datadefault_other').closest('.control-group').hide(); // remove required attribute from datadefault_other field - if (!jform_vvvvwbuvxm_required) + if (!jform_vvvvwcdvxo_required) { updateFieldRequired('datadefault_other',1); jQuery('#jform_datadefault_other').removeAttr('required'); jQuery('#jform_datadefault_other').removeAttr('aria-required'); jQuery('#jform_datadefault_other').removeClass('required'); - jform_vvvvwbuvxm_required = true; + jform_vvvvwcdvxo_required = true; } } } -// the vvvvwbu Some function -function datadefault_vvvvwbu_SomeFunc(datadefault_vvvvwbu) +// the vvvvwcd Some function +function datadefault_vvvvwcd_SomeFunc(datadefault_vvvvwcd) { // set the function logic - if (datadefault_vvvvwbu == 'Other') + if (datadefault_vvvvwcd == 'Other') { return true; } return false; } -// the vvvvwbv function -function vvvvwbv(datatype_vvvvwbv) +// the vvvvwce function +function vvvvwce(datatype_vvvvwce) { - if (isSet(datatype_vvvvwbv) && datatype_vvvvwbv.constructor !== Array) + if (isSet(datatype_vvvvwce) && datatype_vvvvwce.constructor !== Array) { - var temp_vvvvwbv = datatype_vvvvwbv; - var datatype_vvvvwbv = []; - datatype_vvvvwbv.push(temp_vvvvwbv); + var temp_vvvvwce = datatype_vvvvwce; + var datatype_vvvvwce = []; + datatype_vvvvwce.push(temp_vvvvwce); } - else if (!isSet(datatype_vvvvwbv)) + else if (!isSet(datatype_vvvvwce)) { - var datatype_vvvvwbv = []; + var datatype_vvvvwce = []; } - var datatype = datatype_vvvvwbv.some(datatype_vvvvwbv_SomeFunc); + var datatype = datatype_vvvvwce.some(datatype_vvvvwce_SomeFunc); // set this function logic @@ -184,13 +200,13 @@ function vvvvwbv(datatype_vvvvwbv) jQuery('#jform_datadefault').closest('.control-group').show(); jQuery('#jform_indexes').closest('.control-group').show(); // add required attribute to indexes field - if (jform_vvvvwbvvxn_required) + if (jform_vvvvwcevxp_required) { updateFieldRequired('indexes',0); jQuery('#jform_indexes').prop('required','required'); jQuery('#jform_indexes').attr('aria-required',true); jQuery('#jform_indexes').addClass('required'); - jform_vvvvwbvvxn_required = false; + jform_vvvvwcevxp_required = false; } } else @@ -198,42 +214,42 @@ function vvvvwbv(datatype_vvvvwbv) jQuery('#jform_datadefault').closest('.control-group').hide(); jQuery('#jform_indexes').closest('.control-group').hide(); // remove required attribute from indexes field - if (!jform_vvvvwbvvxn_required) + if (!jform_vvvvwcevxp_required) { updateFieldRequired('indexes',1); jQuery('#jform_indexes').removeAttr('required'); jQuery('#jform_indexes').removeAttr('aria-required'); jQuery('#jform_indexes').removeClass('required'); - jform_vvvvwbvvxn_required = true; + jform_vvvvwcevxp_required = true; } } } -// the vvvvwbv Some function -function datatype_vvvvwbv_SomeFunc(datatype_vvvvwbv) +// the vvvvwce Some function +function datatype_vvvvwce_SomeFunc(datatype_vvvvwce) { // set the function logic - if (datatype_vvvvwbv == 'CHAR' || datatype_vvvvwbv == 'VARCHAR' || datatype_vvvvwbv == 'DATETIME' || datatype_vvvvwbv == 'DATE' || datatype_vvvvwbv == 'TIME' || datatype_vvvvwbv == 'INT' || datatype_vvvvwbv == 'TINYINT' || datatype_vvvvwbv == 'BIGINT' || datatype_vvvvwbv == 'FLOAT' || datatype_vvvvwbv == 'DECIMAL' || datatype_vvvvwbv == 'DOUBLE') + if (datatype_vvvvwce == 'CHAR' || datatype_vvvvwce == 'VARCHAR' || datatype_vvvvwce == 'DATETIME' || datatype_vvvvwce == 'DATE' || datatype_vvvvwce == 'TIME' || datatype_vvvvwce == 'INT' || datatype_vvvvwce == 'TINYINT' || datatype_vvvvwce == 'BIGINT' || datatype_vvvvwce == 'FLOAT' || datatype_vvvvwce == 'DECIMAL' || datatype_vvvvwce == 'DOUBLE') { return true; } return false; } -// the vvvvwbw function -function vvvvwbw(datatype_vvvvwbw) +// the vvvvwcf function +function vvvvwcf(datatype_vvvvwcf) { - if (isSet(datatype_vvvvwbw) && datatype_vvvvwbw.constructor !== Array) + if (isSet(datatype_vvvvwcf) && datatype_vvvvwcf.constructor !== Array) { - var temp_vvvvwbw = datatype_vvvvwbw; - var datatype_vvvvwbw = []; - datatype_vvvvwbw.push(temp_vvvvwbw); + var temp_vvvvwcf = datatype_vvvvwcf; + var datatype_vvvvwcf = []; + datatype_vvvvwcf.push(temp_vvvvwcf); } - else if (!isSet(datatype_vvvvwbw)) + else if (!isSet(datatype_vvvvwcf)) { - var datatype_vvvvwbw = []; + var datatype_vvvvwcf = []; } - var datatype = datatype_vvvvwbw.some(datatype_vvvvwbw_SomeFunc); + var datatype = datatype_vvvvwcf.some(datatype_vvvvwcf_SomeFunc); // set this function logic @@ -241,55 +257,55 @@ function vvvvwbw(datatype_vvvvwbw) { jQuery('#jform_datalenght').closest('.control-group').show(); // add required attribute to datalenght field - if (jform_vvvvwbwvxo_required) + if (jform_vvvvwcfvxq_required) { updateFieldRequired('datalenght',0); jQuery('#jform_datalenght').prop('required','required'); jQuery('#jform_datalenght').attr('aria-required',true); jQuery('#jform_datalenght').addClass('required'); - jform_vvvvwbwvxo_required = false; + jform_vvvvwcfvxq_required = false; } } else { jQuery('#jform_datalenght').closest('.control-group').hide(); // remove required attribute from datalenght field - if (!jform_vvvvwbwvxo_required) + if (!jform_vvvvwcfvxq_required) { updateFieldRequired('datalenght',1); jQuery('#jform_datalenght').removeAttr('required'); jQuery('#jform_datalenght').removeAttr('aria-required'); jQuery('#jform_datalenght').removeClass('required'); - jform_vvvvwbwvxo_required = true; + jform_vvvvwcfvxq_required = true; } } } -// the vvvvwbw Some function -function datatype_vvvvwbw_SomeFunc(datatype_vvvvwbw) +// the vvvvwcf Some function +function datatype_vvvvwcf_SomeFunc(datatype_vvvvwcf) { // set the function logic - if (datatype_vvvvwbw == 'CHAR' || datatype_vvvvwbw == 'VARCHAR' || datatype_vvvvwbw == 'INT' || datatype_vvvvwbw == 'TINYINT' || datatype_vvvvwbw == 'BIGINT' || datatype_vvvvwbw == 'FLOAT' || datatype_vvvvwbw == 'DECIMAL' || datatype_vvvvwbw == 'DOUBLE') + if (datatype_vvvvwcf == 'CHAR' || datatype_vvvvwcf == 'VARCHAR' || datatype_vvvvwcf == 'INT' || datatype_vvvvwcf == 'TINYINT' || datatype_vvvvwcf == 'BIGINT' || datatype_vvvvwcf == 'FLOAT' || datatype_vvvvwcf == 'DECIMAL' || datatype_vvvvwcf == 'DOUBLE') { return true; } return false; } -// the vvvvwbx function -function vvvvwbx(datatype_vvvvwbx) +// the vvvvwcg function +function vvvvwcg(datatype_vvvvwcg) { - if (isSet(datatype_vvvvwbx) && datatype_vvvvwbx.constructor !== Array) + if (isSet(datatype_vvvvwcg) && datatype_vvvvwcg.constructor !== Array) { - var temp_vvvvwbx = datatype_vvvvwbx; - var datatype_vvvvwbx = []; - datatype_vvvvwbx.push(temp_vvvvwbx); + var temp_vvvvwcg = datatype_vvvvwcg; + var datatype_vvvvwcg = []; + datatype_vvvvwcg.push(temp_vvvvwcg); } - else if (!isSet(datatype_vvvvwbx)) + else if (!isSet(datatype_vvvvwcg)) { - var datatype_vvvvwbx = []; + var datatype_vvvvwcg = []; } - var datatype = datatype_vvvvwbx.some(datatype_vvvvwbx_SomeFunc); + var datatype = datatype_vvvvwcg.some(datatype_vvvvwcg_SomeFunc); // set this function logic @@ -297,67 +313,67 @@ function vvvvwbx(datatype_vvvvwbx) { jQuery('#jform_store').closest('.control-group').show(); // add required attribute to store field - if (jform_vvvvwbxvxp_required) + if (jform_vvvvwcgvxr_required) { updateFieldRequired('store',0); jQuery('#jform_store').prop('required','required'); jQuery('#jform_store').attr('aria-required',true); jQuery('#jform_store').addClass('required'); - jform_vvvvwbxvxp_required = false; + jform_vvvvwcgvxr_required = false; } } else { jQuery('#jform_store').closest('.control-group').hide(); // remove required attribute from store field - if (!jform_vvvvwbxvxp_required) + if (!jform_vvvvwcgvxr_required) { updateFieldRequired('store',1); jQuery('#jform_store').removeAttr('required'); jQuery('#jform_store').removeAttr('aria-required'); jQuery('#jform_store').removeClass('required'); - jform_vvvvwbxvxp_required = true; + jform_vvvvwcgvxr_required = true; } } } -// the vvvvwbx Some function -function datatype_vvvvwbx_SomeFunc(datatype_vvvvwbx) +// the vvvvwcg Some function +function datatype_vvvvwcg_SomeFunc(datatype_vvvvwcg) { // set the function logic - if (datatype_vvvvwbx == 'CHAR' || datatype_vvvvwbx == 'VARCHAR' || datatype_vvvvwbx == 'TEXT' || datatype_vvvvwbx == 'MEDIUMTEXT' || datatype_vvvvwbx == 'LONGTEXT' || datatype_vvvvwbx == 'BLOB' || datatype_vvvvwbx == 'TINYBLOB' || datatype_vvvvwbx == 'MEDIUMBLOB' || datatype_vvvvwbx == 'LONGBLOB') + if (datatype_vvvvwcg == 'CHAR' || datatype_vvvvwcg == 'VARCHAR' || datatype_vvvvwcg == 'TEXT' || datatype_vvvvwcg == 'MEDIUMTEXT' || datatype_vvvvwcg == 'LONGTEXT' || datatype_vvvvwcg == 'BLOB' || datatype_vvvvwcg == 'TINYBLOB' || datatype_vvvvwcg == 'MEDIUMBLOB' || datatype_vvvvwcg == 'LONGBLOB') { return true; } return false; } -// the vvvvwby function -function vvvvwby(store_vvvvwby,datatype_vvvvwby) +// the vvvvwch function +function vvvvwch(store_vvvvwch,datatype_vvvvwch) { - if (isSet(store_vvvvwby) && store_vvvvwby.constructor !== Array) + if (isSet(store_vvvvwch) && store_vvvvwch.constructor !== Array) { - var temp_vvvvwby = store_vvvvwby; - var store_vvvvwby = []; - store_vvvvwby.push(temp_vvvvwby); + var temp_vvvvwch = store_vvvvwch; + var store_vvvvwch = []; + store_vvvvwch.push(temp_vvvvwch); } - else if (!isSet(store_vvvvwby)) + else if (!isSet(store_vvvvwch)) { - var store_vvvvwby = []; + var store_vvvvwch = []; } - var store = store_vvvvwby.some(store_vvvvwby_SomeFunc); + var store = store_vvvvwch.some(store_vvvvwch_SomeFunc); - if (isSet(datatype_vvvvwby) && datatype_vvvvwby.constructor !== Array) + if (isSet(datatype_vvvvwch) && datatype_vvvvwch.constructor !== Array) { - var temp_vvvvwby = datatype_vvvvwby; - var datatype_vvvvwby = []; - datatype_vvvvwby.push(temp_vvvvwby); + var temp_vvvvwch = datatype_vvvvwch; + var datatype_vvvvwch = []; + datatype_vvvvwch.push(temp_vvvvwch); } - else if (!isSet(datatype_vvvvwby)) + else if (!isSet(datatype_vvvvwch)) { - var datatype_vvvvwby = []; + var datatype_vvvvwch = []; } - var datatype = datatype_vvvvwby.some(datatype_vvvvwby_SomeFunc); + var datatype = datatype_vvvvwch.some(datatype_vvvvwch_SomeFunc); // set this function logic @@ -371,33 +387,315 @@ function vvvvwby(store_vvvvwby,datatype_vvvvwby) } } -// the vvvvwby Some function -function store_vvvvwby_SomeFunc(store_vvvvwby) +// the vvvvwch Some function +function store_vvvvwch_SomeFunc(store_vvvvwch) { // set the function logic - if (store_vvvvwby == 4) + if (store_vvvvwch == 4) { return true; } return false; } -// the vvvvwby Some function -function datatype_vvvvwby_SomeFunc(datatype_vvvvwby) +// the vvvvwch Some function +function datatype_vvvvwch_SomeFunc(datatype_vvvvwch) { // set the function logic - if (datatype_vvvvwby == 'CHAR' || datatype_vvvvwby == 'VARCHAR' || datatype_vvvvwby == 'TEXT' || datatype_vvvvwby == 'MEDIUMTEXT' || datatype_vvvvwby == 'LONGTEXT' || datatype_vvvvwby == 'BLOB' || datatype_vvvvwby == 'TINYBLOB' || datatype_vvvvwby == 'MEDIUMBLOB' || datatype_vvvvwby == 'LONGBLOB') + if (datatype_vvvvwch == 'CHAR' || datatype_vvvvwch == 'VARCHAR' || datatype_vvvvwch == 'TEXT' || datatype_vvvvwch == 'MEDIUMTEXT' || datatype_vvvvwch == 'LONGTEXT' || datatype_vvvvwch == 'BLOB' || datatype_vvvvwch == 'TINYBLOB' || datatype_vvvvwch == 'MEDIUMBLOB' || datatype_vvvvwch == 'LONGBLOB') { return true; } return false; } -// the vvvvwca function -function vvvvwca(add_css_view_vvvvwca) +// the vvvvwcj function +function vvvvwcj(store_vvvvwcj,datatype_vvvvwcj) +{ + if (isSet(store_vvvvwcj) && store_vvvvwcj.constructor !== Array) + { + var temp_vvvvwcj = store_vvvvwcj; + var store_vvvvwcj = []; + store_vvvvwcj.push(temp_vvvvwcj); + } + else if (!isSet(store_vvvvwcj)) + { + var store_vvvvwcj = []; + } + var store = store_vvvvwcj.some(store_vvvvwcj_SomeFunc); + + if (isSet(datatype_vvvvwcj) && datatype_vvvvwcj.constructor !== Array) + { + var temp_vvvvwcj = datatype_vvvvwcj; + var datatype_vvvvwcj = []; + datatype_vvvvwcj.push(temp_vvvvwcj); + } + else if (!isSet(datatype_vvvvwcj)) + { + var datatype_vvvvwcj = []; + } + var datatype = datatype_vvvvwcj.some(datatype_vvvvwcj_SomeFunc); + + + // set this function logic + if (store && datatype) + { + jQuery('#jform_initiator_on_get_model').closest('.control-group').show(); + // add required attribute to initiator_on_get_model field + if (jform_vvvvwcjvxs_required) + { + updateFieldRequired('initiator_on_get_model',0); + jQuery('#jform_initiator_on_get_model').prop('required','required'); + jQuery('#jform_initiator_on_get_model').attr('aria-required',true); + jQuery('#jform_initiator_on_get_model').addClass('required'); + jform_vvvvwcjvxs_required = false; + } + jQuery('#jform_initiator_on_save_model').closest('.control-group').show(); + // add required attribute to initiator_on_save_model field + if (jform_vvvvwcjvxt_required) + { + updateFieldRequired('initiator_on_save_model',0); + jQuery('#jform_initiator_on_save_model').prop('required','required'); + jQuery('#jform_initiator_on_save_model').attr('aria-required',true); + jQuery('#jform_initiator_on_save_model').addClass('required'); + jform_vvvvwcjvxt_required = false; + } + jQuery('#jform_on_save_model_field').closest('.control-group').show(); + // add required attribute to on_save_model_field field + if (jform_vvvvwcjvxu_required) + { + updateFieldRequired('on_save_model_field',0); + jQuery('#jform_on_save_model_field').prop('required','required'); + jQuery('#jform_on_save_model_field').attr('aria-required',true); + jQuery('#jform_on_save_model_field').addClass('required'); + jform_vvvvwcjvxu_required = false; + } + jQuery('.note_expert_field_save_mode').closest('.control-group').show(); + jQuery('#jform_on_get_model_field').closest('.control-group').show(); + // add required attribute to on_get_model_field field + if (jform_vvvvwcjvxv_required) + { + updateFieldRequired('on_get_model_field',0); + jQuery('#jform_on_get_model_field').prop('required','required'); + jQuery('#jform_on_get_model_field').attr('aria-required',true); + jQuery('#jform_on_get_model_field').addClass('required'); + jform_vvvvwcjvxv_required = false; + } + } + else + { + jQuery('#jform_initiator_on_get_model').closest('.control-group').hide(); + // remove required attribute from initiator_on_get_model field + if (!jform_vvvvwcjvxs_required) + { + updateFieldRequired('initiator_on_get_model',1); + jQuery('#jform_initiator_on_get_model').removeAttr('required'); + jQuery('#jform_initiator_on_get_model').removeAttr('aria-required'); + jQuery('#jform_initiator_on_get_model').removeClass('required'); + jform_vvvvwcjvxs_required = true; + } + jQuery('#jform_initiator_on_save_model').closest('.control-group').hide(); + // remove required attribute from initiator_on_save_model field + if (!jform_vvvvwcjvxt_required) + { + updateFieldRequired('initiator_on_save_model',1); + jQuery('#jform_initiator_on_save_model').removeAttr('required'); + jQuery('#jform_initiator_on_save_model').removeAttr('aria-required'); + jQuery('#jform_initiator_on_save_model').removeClass('required'); + jform_vvvvwcjvxt_required = true; + } + jQuery('#jform_on_save_model_field').closest('.control-group').hide(); + // remove required attribute from on_save_model_field field + if (!jform_vvvvwcjvxu_required) + { + updateFieldRequired('on_save_model_field',1); + jQuery('#jform_on_save_model_field').removeAttr('required'); + jQuery('#jform_on_save_model_field').removeAttr('aria-required'); + jQuery('#jform_on_save_model_field').removeClass('required'); + jform_vvvvwcjvxu_required = true; + } + jQuery('.note_expert_field_save_mode').closest('.control-group').hide(); + jQuery('#jform_on_get_model_field').closest('.control-group').hide(); + // remove required attribute from on_get_model_field field + if (!jform_vvvvwcjvxv_required) + { + updateFieldRequired('on_get_model_field',1); + jQuery('#jform_on_get_model_field').removeAttr('required'); + jQuery('#jform_on_get_model_field').removeAttr('aria-required'); + jQuery('#jform_on_get_model_field').removeClass('required'); + jform_vvvvwcjvxv_required = true; + } + } +} + +// the vvvvwcj Some function +function store_vvvvwcj_SomeFunc(store_vvvvwcj) { // set the function logic - if (add_css_view_vvvvwca == 1) + if (store_vvvvwcj == 6) + { + return true; + } + return false; +} + +// the vvvvwcj Some function +function datatype_vvvvwcj_SomeFunc(datatype_vvvvwcj) +{ + // set the function logic + if (datatype_vvvvwcj == 'CHAR' || datatype_vvvvwcj == 'VARCHAR' || datatype_vvvvwcj == 'TEXT' || datatype_vvvvwcj == 'MEDIUMTEXT' || datatype_vvvvwcj == 'LONGTEXT' || datatype_vvvvwcj == 'BLOB' || datatype_vvvvwcj == 'TINYBLOB' || datatype_vvvvwcj == 'MEDIUMBLOB' || datatype_vvvvwcj == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwck function +function vvvvwck(datatype_vvvvwck,store_vvvvwck) +{ + if (isSet(datatype_vvvvwck) && datatype_vvvvwck.constructor !== Array) + { + var temp_vvvvwck = datatype_vvvvwck; + var datatype_vvvvwck = []; + datatype_vvvvwck.push(temp_vvvvwck); + } + else if (!isSet(datatype_vvvvwck)) + { + var datatype_vvvvwck = []; + } + var datatype = datatype_vvvvwck.some(datatype_vvvvwck_SomeFunc); + + if (isSet(store_vvvvwck) && store_vvvvwck.constructor !== Array) + { + var temp_vvvvwck = store_vvvvwck; + var store_vvvvwck = []; + store_vvvvwck.push(temp_vvvvwck); + } + else if (!isSet(store_vvvvwck)) + { + var store_vvvvwck = []; + } + var store = store_vvvvwck.some(store_vvvvwck_SomeFunc); + + + // set this function logic + if (datatype && store) + { + jQuery('#jform_initiator_on_get_model').closest('.control-group').show(); + // add required attribute to initiator_on_get_model field + if (jform_vvvvwckvxw_required) + { + updateFieldRequired('initiator_on_get_model',0); + jQuery('#jform_initiator_on_get_model').prop('required','required'); + jQuery('#jform_initiator_on_get_model').attr('aria-required',true); + jQuery('#jform_initiator_on_get_model').addClass('required'); + jform_vvvvwckvxw_required = false; + } + jQuery('#jform_initiator_on_save_model').closest('.control-group').show(); + // add required attribute to initiator_on_save_model field + if (jform_vvvvwckvxx_required) + { + updateFieldRequired('initiator_on_save_model',0); + jQuery('#jform_initiator_on_save_model').prop('required','required'); + jQuery('#jform_initiator_on_save_model').attr('aria-required',true); + jQuery('#jform_initiator_on_save_model').addClass('required'); + jform_vvvvwckvxx_required = false; + } + jQuery('#jform_on_save_model_field').closest('.control-group').show(); + // add required attribute to on_save_model_field field + if (jform_vvvvwckvxy_required) + { + updateFieldRequired('on_save_model_field',0); + jQuery('#jform_on_save_model_field').prop('required','required'); + jQuery('#jform_on_save_model_field').attr('aria-required',true); + jQuery('#jform_on_save_model_field').addClass('required'); + jform_vvvvwckvxy_required = false; + } + jQuery('.note_expert_field_save_mode').closest('.control-group').show(); + jQuery('#jform_on_get_model_field').closest('.control-group').show(); + // add required attribute to on_get_model_field field + if (jform_vvvvwckvxz_required) + { + updateFieldRequired('on_get_model_field',0); + jQuery('#jform_on_get_model_field').prop('required','required'); + jQuery('#jform_on_get_model_field').attr('aria-required',true); + jQuery('#jform_on_get_model_field').addClass('required'); + jform_vvvvwckvxz_required = false; + } + } + else + { + jQuery('#jform_initiator_on_get_model').closest('.control-group').hide(); + // remove required attribute from initiator_on_get_model field + if (!jform_vvvvwckvxw_required) + { + updateFieldRequired('initiator_on_get_model',1); + jQuery('#jform_initiator_on_get_model').removeAttr('required'); + jQuery('#jform_initiator_on_get_model').removeAttr('aria-required'); + jQuery('#jform_initiator_on_get_model').removeClass('required'); + jform_vvvvwckvxw_required = true; + } + jQuery('#jform_initiator_on_save_model').closest('.control-group').hide(); + // remove required attribute from initiator_on_save_model field + if (!jform_vvvvwckvxx_required) + { + updateFieldRequired('initiator_on_save_model',1); + jQuery('#jform_initiator_on_save_model').removeAttr('required'); + jQuery('#jform_initiator_on_save_model').removeAttr('aria-required'); + jQuery('#jform_initiator_on_save_model').removeClass('required'); + jform_vvvvwckvxx_required = true; + } + jQuery('#jform_on_save_model_field').closest('.control-group').hide(); + // remove required attribute from on_save_model_field field + if (!jform_vvvvwckvxy_required) + { + updateFieldRequired('on_save_model_field',1); + jQuery('#jform_on_save_model_field').removeAttr('required'); + jQuery('#jform_on_save_model_field').removeAttr('aria-required'); + jQuery('#jform_on_save_model_field').removeClass('required'); + jform_vvvvwckvxy_required = true; + } + jQuery('.note_expert_field_save_mode').closest('.control-group').hide(); + jQuery('#jform_on_get_model_field').closest('.control-group').hide(); + // remove required attribute from on_get_model_field field + if (!jform_vvvvwckvxz_required) + { + updateFieldRequired('on_get_model_field',1); + jQuery('#jform_on_get_model_field').removeAttr('required'); + jQuery('#jform_on_get_model_field').removeAttr('aria-required'); + jQuery('#jform_on_get_model_field').removeClass('required'); + jform_vvvvwckvxz_required = true; + } + } +} + +// the vvvvwck Some function +function datatype_vvvvwck_SomeFunc(datatype_vvvvwck) +{ + // set the function logic + if (datatype_vvvvwck == 'CHAR' || datatype_vvvvwck == 'VARCHAR' || datatype_vvvvwck == 'TEXT' || datatype_vvvvwck == 'MEDIUMTEXT' || datatype_vvvvwck == 'LONGTEXT' || datatype_vvvvwck == 'BLOB' || datatype_vvvvwck == 'TINYBLOB' || datatype_vvvvwck == 'MEDIUMBLOB' || datatype_vvvvwck == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwck Some function +function store_vvvvwck_SomeFunc(store_vvvvwck) +{ + // set the function logic + if (store_vvvvwck == 6) + { + return true; + } + return false; +} + +// the vvvvwcl function +function vvvvwcl(add_css_view_vvvvwcl) +{ + // set the function logic + if (add_css_view_vvvvwcl == 1) { jQuery('#jform_css_view-lbl').closest('.control-group').show(); } @@ -407,11 +705,11 @@ function vvvvwca(add_css_view_vvvvwca) } } -// the vvvvwcb function -function vvvvwcb(add_css_views_vvvvwcb) +// the vvvvwcm function +function vvvvwcm(add_css_views_vvvvwcm) { // set the function logic - if (add_css_views_vvvvwcb == 1) + if (add_css_views_vvvvwcm == 1) { jQuery('#jform_css_views-lbl').closest('.control-group').show(); } @@ -421,11 +719,11 @@ function vvvvwcb(add_css_views_vvvvwcb) } } -// the vvvvwcc function -function vvvvwcc(add_javascript_view_footer_vvvvwcc) +// the vvvvwcn function +function vvvvwcn(add_javascript_view_footer_vvvvwcn) { // set the function logic - if (add_javascript_view_footer_vvvvwcc == 1) + if (add_javascript_view_footer_vvvvwcn == 1) { jQuery('#jform_javascript_view_footer-lbl').closest('.control-group').show(); } @@ -435,11 +733,11 @@ function vvvvwcc(add_javascript_view_footer_vvvvwcc) } } -// the vvvvwcd function -function vvvvwcd(add_javascript_views_footer_vvvvwcd) +// the vvvvwco function +function vvvvwco(add_javascript_views_footer_vvvvwco) { // set the function logic - if (add_javascript_views_footer_vvvvwcd == 1) + if (add_javascript_views_footer_vvvvwco == 1) { jQuery('#jform_javascript_views_footer-lbl').closest('.control-group').show(); } diff --git a/admin/models/forms/field.xml b/admin/models/forms/field.xml index bdd33a2e7..5b6a9d0eb 100644 --- a/admin/models/forms/field.xml +++ b/admin/models/forms/field.xml @@ -219,6 +219,8 @@ COM_COMPONENTBUILDER_FIELD_MEDIUM_ENCRYPTION_LOCALFILEKEY + - - - - - - - - - - - - - - - - + + + + + + + + + + COM_COMPONENTBUILDER_FIELD_NO - - - - + + + + + + + + + + + + - + @@ -413,6 +422,46 @@ + + + + + + + + @@ -431,8 +480,8 @@ filter="raw" validate="code" /> - - + + - + + - + + type="radio" + name="target" + label="COM_COMPONENTBUILDER_LIBRARY_TARGET_LABEL" + description="COM_COMPONENTBUILDER_LIBRARY_TARGET_DESCRIPTION" + class="btn-group btn-group-yesno" + default="1" + required="true"> + + + + COM_COMPONENTBUILDER_LIBRARY_BUNDLE + + - - - - + + + + + + - - - - - - + + + + diff --git a/admin/models/forms/server.js b/admin/models/forms/server.js index 926b9724d..24c034cb0 100644 --- a/admin/models/forms/server.js +++ b/admin/models/forms/server.js @@ -9,56 +9,56 @@ */ // Some Global Values -jform_vvvvwcsvxz_required = false; -jform_vvvvwcsvya_required = false; -jform_vvvvwcsvyb_required = false; -jform_vvvvwcsvyc_required = false; -jform_vvvvwcsvyd_required = false; -jform_vvvvwctvye_required = false; -jform_vvvvwcuvyf_required = false; -jform_vvvvwcwvyg_required = false; -jform_vvvvwcyvyh_required = false; +jform_vvvvwddvyj_required = false; +jform_vvvvwddvyk_required = false; +jform_vvvvwddvyl_required = false; +jform_vvvvwddvym_required = false; +jform_vvvvwddvyn_required = false; +jform_vvvvwdevyo_required = false; +jform_vvvvwdfvyp_required = false; +jform_vvvvwdhvyq_required = false; +jform_vvvvwdjvyr_required = false; // Initial Script jQuery(document).ready(function() { - var protocol_vvvvwcs = jQuery("#jform_protocol").val(); - vvvvwcs(protocol_vvvvwcs); + var protocol_vvvvwdd = jQuery("#jform_protocol").val(); + vvvvwdd(protocol_vvvvwdd); - var protocol_vvvvwct = jQuery("#jform_protocol").val(); - vvvvwct(protocol_vvvvwct); + var protocol_vvvvwde = jQuery("#jform_protocol").val(); + vvvvwde(protocol_vvvvwde); - var protocol_vvvvwcu = jQuery("#jform_protocol").val(); - var authentication_vvvvwcu = jQuery("#jform_authentication").val(); - vvvvwcu(protocol_vvvvwcu,authentication_vvvvwcu); + var protocol_vvvvwdf = jQuery("#jform_protocol").val(); + var authentication_vvvvwdf = jQuery("#jform_authentication").val(); + vvvvwdf(protocol_vvvvwdf,authentication_vvvvwdf); - var protocol_vvvvwcw = jQuery("#jform_protocol").val(); - var authentication_vvvvwcw = jQuery("#jform_authentication").val(); - vvvvwcw(protocol_vvvvwcw,authentication_vvvvwcw); + var protocol_vvvvwdh = jQuery("#jform_protocol").val(); + var authentication_vvvvwdh = jQuery("#jform_authentication").val(); + vvvvwdh(protocol_vvvvwdh,authentication_vvvvwdh); - var protocol_vvvvwcy = jQuery("#jform_protocol").val(); - var authentication_vvvvwcy = jQuery("#jform_authentication").val(); - vvvvwcy(protocol_vvvvwcy,authentication_vvvvwcy); + var protocol_vvvvwdj = jQuery("#jform_protocol").val(); + var authentication_vvvvwdj = jQuery("#jform_authentication").val(); + vvvvwdj(protocol_vvvvwdj,authentication_vvvvwdj); - var protocol_vvvvwda = jQuery("#jform_protocol").val(); - var authentication_vvvvwda = jQuery("#jform_authentication").val(); - vvvvwda(protocol_vvvvwda,authentication_vvvvwda); + var protocol_vvvvwdl = jQuery("#jform_protocol").val(); + var authentication_vvvvwdl = jQuery("#jform_authentication").val(); + vvvvwdl(protocol_vvvvwdl,authentication_vvvvwdl); }); -// the vvvvwcs function -function vvvvwcs(protocol_vvvvwcs) +// the vvvvwdd function +function vvvvwdd(protocol_vvvvwdd) { - if (isSet(protocol_vvvvwcs) && protocol_vvvvwcs.constructor !== Array) + if (isSet(protocol_vvvvwdd) && protocol_vvvvwdd.constructor !== Array) { - var temp_vvvvwcs = protocol_vvvvwcs; - var protocol_vvvvwcs = []; - protocol_vvvvwcs.push(temp_vvvvwcs); + var temp_vvvvwdd = protocol_vvvvwdd; + var protocol_vvvvwdd = []; + protocol_vvvvwdd.push(temp_vvvvwdd); } - else if (!isSet(protocol_vvvvwcs)) + else if (!isSet(protocol_vvvvwdd)) { - var protocol_vvvvwcs = []; + var protocol_vvvvwdd = []; } - var protocol = protocol_vvvvwcs.some(protocol_vvvvwcs_SomeFunc); + var protocol = protocol_vvvvwdd.some(protocol_vvvvwdd_SomeFunc); // set this function logic @@ -66,137 +66,137 @@ function vvvvwcs(protocol_vvvvwcs) { jQuery('#jform_authentication').closest('.control-group').show(); // add required attribute to authentication field - if (jform_vvvvwcsvxz_required) + if (jform_vvvvwddvyj_required) { updateFieldRequired('authentication',0); jQuery('#jform_authentication').prop('required','required'); jQuery('#jform_authentication').attr('aria-required',true); jQuery('#jform_authentication').addClass('required'); - jform_vvvvwcsvxz_required = false; + jform_vvvvwddvyj_required = false; } jQuery('#jform_host').closest('.control-group').show(); // add required attribute to host field - if (jform_vvvvwcsvya_required) + if (jform_vvvvwddvyk_required) { updateFieldRequired('host',0); jQuery('#jform_host').prop('required','required'); jQuery('#jform_host').attr('aria-required',true); jQuery('#jform_host').addClass('required'); - jform_vvvvwcsvya_required = false; + jform_vvvvwddvyk_required = false; } jQuery('#jform_port').closest('.control-group').show(); // add required attribute to port field - if (jform_vvvvwcsvyb_required) + if (jform_vvvvwddvyl_required) { updateFieldRequired('port',0); jQuery('#jform_port').prop('required','required'); jQuery('#jform_port').attr('aria-required',true); jQuery('#jform_port').addClass('required'); - jform_vvvvwcsvyb_required = false; + jform_vvvvwddvyl_required = false; } jQuery('#jform_path').closest('.control-group').show(); // add required attribute to path field - if (jform_vvvvwcsvyc_required) + if (jform_vvvvwddvym_required) { updateFieldRequired('path',0); jQuery('#jform_path').prop('required','required'); jQuery('#jform_path').attr('aria-required',true); jQuery('#jform_path').addClass('required'); - jform_vvvvwcsvyc_required = false; + jform_vvvvwddvym_required = false; } jQuery('.note_ssh_security').closest('.control-group').show(); jQuery('#jform_username').closest('.control-group').show(); // add required attribute to username field - if (jform_vvvvwcsvyd_required) + if (jform_vvvvwddvyn_required) { updateFieldRequired('username',0); jQuery('#jform_username').prop('required','required'); jQuery('#jform_username').attr('aria-required',true); jQuery('#jform_username').addClass('required'); - jform_vvvvwcsvyd_required = false; + jform_vvvvwddvyn_required = false; } } else { jQuery('#jform_authentication').closest('.control-group').hide(); // remove required attribute from authentication field - if (!jform_vvvvwcsvxz_required) + if (!jform_vvvvwddvyj_required) { updateFieldRequired('authentication',1); jQuery('#jform_authentication').removeAttr('required'); jQuery('#jform_authentication').removeAttr('aria-required'); jQuery('#jform_authentication').removeClass('required'); - jform_vvvvwcsvxz_required = true; + jform_vvvvwddvyj_required = true; } jQuery('#jform_host').closest('.control-group').hide(); // remove required attribute from host field - if (!jform_vvvvwcsvya_required) + if (!jform_vvvvwddvyk_required) { updateFieldRequired('host',1); jQuery('#jform_host').removeAttr('required'); jQuery('#jform_host').removeAttr('aria-required'); jQuery('#jform_host').removeClass('required'); - jform_vvvvwcsvya_required = true; + jform_vvvvwddvyk_required = true; } jQuery('#jform_port').closest('.control-group').hide(); // remove required attribute from port field - if (!jform_vvvvwcsvyb_required) + if (!jform_vvvvwddvyl_required) { updateFieldRequired('port',1); jQuery('#jform_port').removeAttr('required'); jQuery('#jform_port').removeAttr('aria-required'); jQuery('#jform_port').removeClass('required'); - jform_vvvvwcsvyb_required = true; + jform_vvvvwddvyl_required = true; } jQuery('#jform_path').closest('.control-group').hide(); // remove required attribute from path field - if (!jform_vvvvwcsvyc_required) + if (!jform_vvvvwddvym_required) { updateFieldRequired('path',1); jQuery('#jform_path').removeAttr('required'); jQuery('#jform_path').removeAttr('aria-required'); jQuery('#jform_path').removeClass('required'); - jform_vvvvwcsvyc_required = true; + jform_vvvvwddvym_required = true; } jQuery('.note_ssh_security').closest('.control-group').hide(); jQuery('#jform_username').closest('.control-group').hide(); // remove required attribute from username field - if (!jform_vvvvwcsvyd_required) + if (!jform_vvvvwddvyn_required) { updateFieldRequired('username',1); jQuery('#jform_username').removeAttr('required'); jQuery('#jform_username').removeAttr('aria-required'); jQuery('#jform_username').removeClass('required'); - jform_vvvvwcsvyd_required = true; + jform_vvvvwddvyn_required = true; } } } -// the vvvvwcs Some function -function protocol_vvvvwcs_SomeFunc(protocol_vvvvwcs) +// the vvvvwdd Some function +function protocol_vvvvwdd_SomeFunc(protocol_vvvvwdd) { // set the function logic - if (protocol_vvvvwcs == 2) + if (protocol_vvvvwdd == 2) { return true; } return false; } -// the vvvvwct function -function vvvvwct(protocol_vvvvwct) +// the vvvvwde function +function vvvvwde(protocol_vvvvwde) { - if (isSet(protocol_vvvvwct) && protocol_vvvvwct.constructor !== Array) + if (isSet(protocol_vvvvwde) && protocol_vvvvwde.constructor !== Array) { - var temp_vvvvwct = protocol_vvvvwct; - var protocol_vvvvwct = []; - protocol_vvvvwct.push(temp_vvvvwct); + var temp_vvvvwde = protocol_vvvvwde; + var protocol_vvvvwde = []; + protocol_vvvvwde.push(temp_vvvvwde); } - else if (!isSet(protocol_vvvvwct)) + else if (!isSet(protocol_vvvvwde)) { - var protocol_vvvvwct = []; + var protocol_vvvvwde = []; } - var protocol = protocol_vvvvwct.some(protocol_vvvvwct_SomeFunc); + var protocol = protocol_vvvvwde.some(protocol_vvvvwde_SomeFunc); // set this function logic @@ -205,13 +205,13 @@ function vvvvwct(protocol_vvvvwct) jQuery('.note_ftp_signature').closest('.control-group').show(); jQuery('#jform_signature').closest('.control-group').show(); // add required attribute to signature field - if (jform_vvvvwctvye_required) + if (jform_vvvvwdevyo_required) { updateFieldRequired('signature',0); jQuery('#jform_signature').prop('required','required'); jQuery('#jform_signature').attr('aria-required',true); jQuery('#jform_signature').addClass('required'); - jform_vvvvwctvye_required = false; + jform_vvvvwdevyo_required = false; } } else @@ -219,54 +219,54 @@ function vvvvwct(protocol_vvvvwct) jQuery('.note_ftp_signature').closest('.control-group').hide(); jQuery('#jform_signature').closest('.control-group').hide(); // remove required attribute from signature field - if (!jform_vvvvwctvye_required) + if (!jform_vvvvwdevyo_required) { updateFieldRequired('signature',1); jQuery('#jform_signature').removeAttr('required'); jQuery('#jform_signature').removeAttr('aria-required'); jQuery('#jform_signature').removeClass('required'); - jform_vvvvwctvye_required = true; + jform_vvvvwdevyo_required = true; } } } -// the vvvvwct Some function -function protocol_vvvvwct_SomeFunc(protocol_vvvvwct) +// the vvvvwde Some function +function protocol_vvvvwde_SomeFunc(protocol_vvvvwde) { // set the function logic - if (protocol_vvvvwct == 1) + if (protocol_vvvvwde == 1) { return true; } return false; } -// the vvvvwcu function -function vvvvwcu(protocol_vvvvwcu,authentication_vvvvwcu) +// the vvvvwdf function +function vvvvwdf(protocol_vvvvwdf,authentication_vvvvwdf) { - if (isSet(protocol_vvvvwcu) && protocol_vvvvwcu.constructor !== Array) + if (isSet(protocol_vvvvwdf) && protocol_vvvvwdf.constructor !== Array) { - var temp_vvvvwcu = protocol_vvvvwcu; - var protocol_vvvvwcu = []; - protocol_vvvvwcu.push(temp_vvvvwcu); + var temp_vvvvwdf = protocol_vvvvwdf; + var protocol_vvvvwdf = []; + protocol_vvvvwdf.push(temp_vvvvwdf); } - else if (!isSet(protocol_vvvvwcu)) + else if (!isSet(protocol_vvvvwdf)) { - var protocol_vvvvwcu = []; + var protocol_vvvvwdf = []; } - var protocol = protocol_vvvvwcu.some(protocol_vvvvwcu_SomeFunc); + var protocol = protocol_vvvvwdf.some(protocol_vvvvwdf_SomeFunc); - if (isSet(authentication_vvvvwcu) && authentication_vvvvwcu.constructor !== Array) + if (isSet(authentication_vvvvwdf) && authentication_vvvvwdf.constructor !== Array) { - var temp_vvvvwcu = authentication_vvvvwcu; - var authentication_vvvvwcu = []; - authentication_vvvvwcu.push(temp_vvvvwcu); + var temp_vvvvwdf = authentication_vvvvwdf; + var authentication_vvvvwdf = []; + authentication_vvvvwdf.push(temp_vvvvwdf); } - else if (!isSet(authentication_vvvvwcu)) + else if (!isSet(authentication_vvvvwdf)) { - var authentication_vvvvwcu = []; + var authentication_vvvvwdf = []; } - var authentication = authentication_vvvvwcu.some(authentication_vvvvwcu_SomeFunc); + var authentication = authentication_vvvvwdf.some(authentication_vvvvwdf_SomeFunc); // set this function logic @@ -274,78 +274,78 @@ function vvvvwcu(protocol_vvvvwcu,authentication_vvvvwcu) { jQuery('#jform_password').closest('.control-group').show(); // add required attribute to password field - if (jform_vvvvwcuvyf_required) + if (jform_vvvvwdfvyp_required) { updateFieldRequired('password',0); jQuery('#jform_password').prop('required','required'); jQuery('#jform_password').attr('aria-required',true); jQuery('#jform_password').addClass('required'); - jform_vvvvwcuvyf_required = false; + jform_vvvvwdfvyp_required = false; } } else { jQuery('#jform_password').closest('.control-group').hide(); // remove required attribute from password field - if (!jform_vvvvwcuvyf_required) + if (!jform_vvvvwdfvyp_required) { updateFieldRequired('password',1); jQuery('#jform_password').removeAttr('required'); jQuery('#jform_password').removeAttr('aria-required'); jQuery('#jform_password').removeClass('required'); - jform_vvvvwcuvyf_required = true; + jform_vvvvwdfvyp_required = true; } } } -// the vvvvwcu Some function -function protocol_vvvvwcu_SomeFunc(protocol_vvvvwcu) +// the vvvvwdf Some function +function protocol_vvvvwdf_SomeFunc(protocol_vvvvwdf) { // set the function logic - if (protocol_vvvvwcu == 2) + if (protocol_vvvvwdf == 2) { return true; } return false; } -// the vvvvwcu Some function -function authentication_vvvvwcu_SomeFunc(authentication_vvvvwcu) +// the vvvvwdf Some function +function authentication_vvvvwdf_SomeFunc(authentication_vvvvwdf) { // set the function logic - if (authentication_vvvvwcu == 1 || authentication_vvvvwcu == 3 || authentication_vvvvwcu == 5) + if (authentication_vvvvwdf == 1 || authentication_vvvvwdf == 3 || authentication_vvvvwdf == 5) { return true; } return false; } -// the vvvvwcw function -function vvvvwcw(protocol_vvvvwcw,authentication_vvvvwcw) +// the vvvvwdh function +function vvvvwdh(protocol_vvvvwdh,authentication_vvvvwdh) { - if (isSet(protocol_vvvvwcw) && protocol_vvvvwcw.constructor !== Array) + if (isSet(protocol_vvvvwdh) && protocol_vvvvwdh.constructor !== Array) { - var temp_vvvvwcw = protocol_vvvvwcw; - var protocol_vvvvwcw = []; - protocol_vvvvwcw.push(temp_vvvvwcw); + var temp_vvvvwdh = protocol_vvvvwdh; + var protocol_vvvvwdh = []; + protocol_vvvvwdh.push(temp_vvvvwdh); } - else if (!isSet(protocol_vvvvwcw)) + else if (!isSet(protocol_vvvvwdh)) { - var protocol_vvvvwcw = []; + var protocol_vvvvwdh = []; } - var protocol = protocol_vvvvwcw.some(protocol_vvvvwcw_SomeFunc); + var protocol = protocol_vvvvwdh.some(protocol_vvvvwdh_SomeFunc); - if (isSet(authentication_vvvvwcw) && authentication_vvvvwcw.constructor !== Array) + if (isSet(authentication_vvvvwdh) && authentication_vvvvwdh.constructor !== Array) { - var temp_vvvvwcw = authentication_vvvvwcw; - var authentication_vvvvwcw = []; - authentication_vvvvwcw.push(temp_vvvvwcw); + var temp_vvvvwdh = authentication_vvvvwdh; + var authentication_vvvvwdh = []; + authentication_vvvvwdh.push(temp_vvvvwdh); } - else if (!isSet(authentication_vvvvwcw)) + else if (!isSet(authentication_vvvvwdh)) { - var authentication_vvvvwcw = []; + var authentication_vvvvwdh = []; } - var authentication = authentication_vvvvwcw.some(authentication_vvvvwcw_SomeFunc); + var authentication = authentication_vvvvwdh.some(authentication_vvvvwdh_SomeFunc); // set this function logic @@ -353,78 +353,78 @@ function vvvvwcw(protocol_vvvvwcw,authentication_vvvvwcw) { jQuery('#jform_private').closest('.control-group').show(); // add required attribute to private field - if (jform_vvvvwcwvyg_required) + if (jform_vvvvwdhvyq_required) { updateFieldRequired('private',0); jQuery('#jform_private').prop('required','required'); jQuery('#jform_private').attr('aria-required',true); jQuery('#jform_private').addClass('required'); - jform_vvvvwcwvyg_required = false; + jform_vvvvwdhvyq_required = false; } } else { jQuery('#jform_private').closest('.control-group').hide(); // remove required attribute from private field - if (!jform_vvvvwcwvyg_required) + if (!jform_vvvvwdhvyq_required) { updateFieldRequired('private',1); jQuery('#jform_private').removeAttr('required'); jQuery('#jform_private').removeAttr('aria-required'); jQuery('#jform_private').removeClass('required'); - jform_vvvvwcwvyg_required = true; + jform_vvvvwdhvyq_required = true; } } } -// the vvvvwcw Some function -function protocol_vvvvwcw_SomeFunc(protocol_vvvvwcw) +// the vvvvwdh Some function +function protocol_vvvvwdh_SomeFunc(protocol_vvvvwdh) { // set the function logic - if (protocol_vvvvwcw == 2) + if (protocol_vvvvwdh == 2) { return true; } return false; } -// the vvvvwcw Some function -function authentication_vvvvwcw_SomeFunc(authentication_vvvvwcw) +// the vvvvwdh Some function +function authentication_vvvvwdh_SomeFunc(authentication_vvvvwdh) { // set the function logic - if (authentication_vvvvwcw == 2 || authentication_vvvvwcw == 3) + if (authentication_vvvvwdh == 2 || authentication_vvvvwdh == 3) { return true; } return false; } -// the vvvvwcy function -function vvvvwcy(protocol_vvvvwcy,authentication_vvvvwcy) +// the vvvvwdj function +function vvvvwdj(protocol_vvvvwdj,authentication_vvvvwdj) { - if (isSet(protocol_vvvvwcy) && protocol_vvvvwcy.constructor !== Array) + if (isSet(protocol_vvvvwdj) && protocol_vvvvwdj.constructor !== Array) { - var temp_vvvvwcy = protocol_vvvvwcy; - var protocol_vvvvwcy = []; - protocol_vvvvwcy.push(temp_vvvvwcy); + var temp_vvvvwdj = protocol_vvvvwdj; + var protocol_vvvvwdj = []; + protocol_vvvvwdj.push(temp_vvvvwdj); } - else if (!isSet(protocol_vvvvwcy)) + else if (!isSet(protocol_vvvvwdj)) { - var protocol_vvvvwcy = []; + var protocol_vvvvwdj = []; } - var protocol = protocol_vvvvwcy.some(protocol_vvvvwcy_SomeFunc); + var protocol = protocol_vvvvwdj.some(protocol_vvvvwdj_SomeFunc); - if (isSet(authentication_vvvvwcy) && authentication_vvvvwcy.constructor !== Array) + if (isSet(authentication_vvvvwdj) && authentication_vvvvwdj.constructor !== Array) { - var temp_vvvvwcy = authentication_vvvvwcy; - var authentication_vvvvwcy = []; - authentication_vvvvwcy.push(temp_vvvvwcy); + var temp_vvvvwdj = authentication_vvvvwdj; + var authentication_vvvvwdj = []; + authentication_vvvvwdj.push(temp_vvvvwdj); } - else if (!isSet(authentication_vvvvwcy)) + else if (!isSet(authentication_vvvvwdj)) { - var authentication_vvvvwcy = []; + var authentication_vvvvwdj = []; } - var authentication = authentication_vvvvwcy.some(authentication_vvvvwcy_SomeFunc); + var authentication = authentication_vvvvwdj.some(authentication_vvvvwdj_SomeFunc); // set this function logic @@ -432,78 +432,78 @@ function vvvvwcy(protocol_vvvvwcy,authentication_vvvvwcy) { jQuery('#jform_private_key').closest('.control-group').show(); // add required attribute to private_key field - if (jform_vvvvwcyvyh_required) + if (jform_vvvvwdjvyr_required) { updateFieldRequired('private_key',0); jQuery('#jform_private_key').prop('required','required'); jQuery('#jform_private_key').attr('aria-required',true); jQuery('#jform_private_key').addClass('required'); - jform_vvvvwcyvyh_required = false; + jform_vvvvwdjvyr_required = false; } } else { jQuery('#jform_private_key').closest('.control-group').hide(); // remove required attribute from private_key field - if (!jform_vvvvwcyvyh_required) + if (!jform_vvvvwdjvyr_required) { updateFieldRequired('private_key',1); jQuery('#jform_private_key').removeAttr('required'); jQuery('#jform_private_key').removeAttr('aria-required'); jQuery('#jform_private_key').removeClass('required'); - jform_vvvvwcyvyh_required = true; + jform_vvvvwdjvyr_required = true; } } } -// the vvvvwcy Some function -function protocol_vvvvwcy_SomeFunc(protocol_vvvvwcy) +// the vvvvwdj Some function +function protocol_vvvvwdj_SomeFunc(protocol_vvvvwdj) { // set the function logic - if (protocol_vvvvwcy == 2) + if (protocol_vvvvwdj == 2) { return true; } return false; } -// the vvvvwcy Some function -function authentication_vvvvwcy_SomeFunc(authentication_vvvvwcy) +// the vvvvwdj Some function +function authentication_vvvvwdj_SomeFunc(authentication_vvvvwdj) { // set the function logic - if (authentication_vvvvwcy == 4 || authentication_vvvvwcy == 5) + if (authentication_vvvvwdj == 4 || authentication_vvvvwdj == 5) { return true; } return false; } -// the vvvvwda function -function vvvvwda(protocol_vvvvwda,authentication_vvvvwda) +// the vvvvwdl function +function vvvvwdl(protocol_vvvvwdl,authentication_vvvvwdl) { - if (isSet(protocol_vvvvwda) && protocol_vvvvwda.constructor !== Array) + if (isSet(protocol_vvvvwdl) && protocol_vvvvwdl.constructor !== Array) { - var temp_vvvvwda = protocol_vvvvwda; - var protocol_vvvvwda = []; - protocol_vvvvwda.push(temp_vvvvwda); + var temp_vvvvwdl = protocol_vvvvwdl; + var protocol_vvvvwdl = []; + protocol_vvvvwdl.push(temp_vvvvwdl); } - else if (!isSet(protocol_vvvvwda)) + else if (!isSet(protocol_vvvvwdl)) { - var protocol_vvvvwda = []; + var protocol_vvvvwdl = []; } - var protocol = protocol_vvvvwda.some(protocol_vvvvwda_SomeFunc); + var protocol = protocol_vvvvwdl.some(protocol_vvvvwdl_SomeFunc); - if (isSet(authentication_vvvvwda) && authentication_vvvvwda.constructor !== Array) + if (isSet(authentication_vvvvwdl) && authentication_vvvvwdl.constructor !== Array) { - var temp_vvvvwda = authentication_vvvvwda; - var authentication_vvvvwda = []; - authentication_vvvvwda.push(temp_vvvvwda); + var temp_vvvvwdl = authentication_vvvvwdl; + var authentication_vvvvwdl = []; + authentication_vvvvwdl.push(temp_vvvvwdl); } - else if (!isSet(authentication_vvvvwda)) + else if (!isSet(authentication_vvvvwdl)) { - var authentication_vvvvwda = []; + var authentication_vvvvwdl = []; } - var authentication = authentication_vvvvwda.some(authentication_vvvvwda_SomeFunc); + var authentication = authentication_vvvvwdl.some(authentication_vvvvwdl_SomeFunc); // set this function logic @@ -517,22 +517,22 @@ function vvvvwda(protocol_vvvvwda,authentication_vvvvwda) } } -// the vvvvwda Some function -function protocol_vvvvwda_SomeFunc(protocol_vvvvwda) +// the vvvvwdl Some function +function protocol_vvvvwdl_SomeFunc(protocol_vvvvwdl) { // set the function logic - if (protocol_vvvvwda == 2) + if (protocol_vvvvwdl == 2) { return true; } return false; } -// the vvvvwda Some function -function authentication_vvvvwda_SomeFunc(authentication_vvvvwda) +// the vvvvwdl Some function +function authentication_vvvvwdl_SomeFunc(authentication_vvvvwdl) { // set the function logic - if (authentication_vvvvwda == 2 || authentication_vvvvwda == 3 || authentication_vvvvwda == 4 || authentication_vvvvwda == 5) + if (authentication_vvvvwdl == 2 || authentication_vvvvwdl == 3 || authentication_vvvvwdl == 4 || authentication_vvvvwdl == 5) { return true; } diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 15d81c55b..0a121d991 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -1829,7 +1829,7 @@ class ComponentbuilderModelJoomla_components extends JModelList ), // #__componentbuilder_field (i) 'field' => array( - 'search' => array('id', 'name', 'xml', 'javascript_view_footer', 'javascript_views_footer'), + 'search' => array('id', 'name', 'xml', 'javascript_view_footer', 'javascript_views_footer', 'on_save_model_field', 'on_get_model_field', 'initiator_on_save_model', 'initiator_on_get_model'), 'views' => 'fields', 'not_base64' => array('xml' => 'json'), 'base64_search' => array('xml' => array('start' => 'type_php', '_start' => '="', 'end' => '"')), diff --git a/admin/models/libraries.php b/admin/models/libraries.php index 6db1d97f8..e507dce20 100644 --- a/admin/models/libraries.php +++ b/admin/models/libraries.php @@ -28,8 +28,9 @@ class ComponentbuilderModelLibraries extends JModelList 'a.created_by','created_by', 'a.modified_by','modified_by', 'a.name','name', - 'a.description','description', + 'a.target','target', 'a.type','type', + 'a.description','description', 'a.how','how' ); } @@ -54,12 +55,15 @@ class ComponentbuilderModelLibraries extends JModelList $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); $this->setState('filter.name', $name); - $description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description'); - $this->setState('filter.description', $description); + $target = $this->getUserStateFromRequest($this->context . '.filter.target', 'filter_target'); + $this->setState('filter.target', $target); $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type'); $this->setState('filter.type', $type); + $description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description'); + $this->setState('filter.description', $description); + $how = $this->getUserStateFromRequest($this->context . '.filter.how', 'filter_how'); $this->setState('filter.how', $how); @@ -128,6 +132,8 @@ class ComponentbuilderModelLibraries extends JModelList { foreach ($items as $nr => &$item) { + // convert target + $item->target = $this->selectionTranslation($item->target, 'target'); // convert type $item->type = $this->selectionTranslation($item->type, 'type'); } @@ -145,6 +151,19 @@ class ComponentbuilderModelLibraries extends JModelList */ public function selectionTranslation($value,$name) { + // Array of target language strings + if ($name === 'target') + { + $targetArray = array( + 1 => 'COM_COMPONENTBUILDER_LIBRARY_MEDIA', + 2 => 'COM_COMPONENTBUILDER_LIBRARY_LIBRARIES' + ); + // Now check if value is found in this array + if (isset($targetArray[$value]) && ComponentbuilderHelper::checkString($targetArray[$value])) + { + return $targetArray[$value]; + } + } // Array of type language strings if ($name === 'type') { @@ -238,6 +257,11 @@ class ComponentbuilderModelLibraries extends JModelList } } + // Filter by Target. + if ($target = $this->getState('filter.target')) + { + $query->where('a.target = ' . $db->quote($db->escape($target))); + } // Filter by how. if ($how = $this->getState('filter.how')) { @@ -276,8 +300,9 @@ class ComponentbuilderModelLibraries extends JModelList $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); $id .= ':' . $this->getState('filter.name'); - $id .= ':' . $this->getState('filter.description'); + $id .= ':' . $this->getState('filter.target'); $id .= ':' . $this->getState('filter.type'); + $id .= ':' . $this->getState('filter.description'); $id .= ':' . $this->getState('filter.how'); return parent::getStoreId($id); diff --git a/admin/models/library.php b/admin/models/library.php index 0aee440a8..f9ddd66b5 100644 --- a/admin/models/library.php +++ b/admin/models/library.php @@ -42,6 +42,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin ), 'above' => array( 'name', + 'target', 'how', 'type' ), diff --git a/admin/models/server.php b/admin/models/server.php index 1448757d6..e4950f1a8 100644 --- a/admin/models/server.php +++ b/admin/models/server.php @@ -189,7 +189,7 @@ class ComponentbuilderModelServer extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVyilinked_components() + public function getVyslinked_components() { // Get the user object. $user = JFactory::getUser(); diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 936e2f242..ef304476a 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -803,6 +803,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_library` ( `name` VARCHAR(255) NOT NULL DEFAULT '', `not_required` INT(1) NOT NULL DEFAULT 0, `php_setdocument` MEDIUMTEXT NOT NULL, + `target` TINYINT(1) NOT NULL DEFAULT 1, `type` TINYINT(1) NOT NULL DEFAULT 0, `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, @@ -909,10 +910,14 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_field` ( `datatype` CHAR(64) NOT NULL DEFAULT '', `fieldtype` INT(11) NOT NULL DEFAULT 0, `indexes` CHAR(64) NOT NULL DEFAULT '', + `initiator_on_get_model` TEXT NOT NULL, + `initiator_on_save_model` TEXT NOT NULL, `javascript_view_footer` TEXT NOT NULL, `javascript_views_footer` TEXT NOT NULL, `name` VARCHAR(255) NOT NULL DEFAULT '', `null_switch` CHAR(64) NOT NULL DEFAULT '', + `on_get_model_field` TEXT NOT NULL, + `on_save_model_field` TEXT NOT NULL, `store` INT(11) NOT NULL DEFAULT 0, `xml` TEXT NOT NULL, `params` text NOT NULL, @@ -934,14 +939,14 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_field` ( KEY `idx_indexes` (`indexes`), KEY `idx_null_switch` (`null_switch`), KEY `idx_catid` (`catid`), - KEY `idx_add_css_views` (`add_css_views`), - KEY `idx_add_css_view` (`add_css_view`), KEY `idx_datalenght` (`datalenght`), KEY `idx_add_javascript_views_footer` (`add_javascript_views_footer`), + KEY `idx_add_javascript_view_footer` (`add_javascript_view_footer`), + KEY `idx_add_css_views` (`add_css_views`), KEY `idx_datadefault_other` (`datadefault_other`), KEY `idx_datadefault` (`datadefault`), KEY `idx_datalenght_other` (`datalenght_other`), - KEY `idx_add_javascript_view_footer` (`add_javascript_view_footer`), + KEY `idx_add_css_view` (`add_css_view`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), KEY `idx_createdby` (`created_by`), diff --git a/admin/sql/updates/mysql/2.10.1.sql b/admin/sql/updates/mysql/2.10.1.sql new file mode 100644 index 000000000..1a11dd958 --- /dev/null +++ b/admin/sql/updates/mysql/2.10.1.sql @@ -0,0 +1 @@ +ALTER TABLE `#__componentbuilder_library` ADD `target` TINYINT(1) NOT NULL DEFAULT 1 AFTER `php_setdocument`; diff --git a/admin/sql/updates/mysql/2.10.2.sql b/admin/sql/updates/mysql/2.10.2.sql new file mode 100644 index 000000000..3ef817a23 --- /dev/null +++ b/admin/sql/updates/mysql/2.10.2.sql @@ -0,0 +1,7 @@ +ALTER TABLE `#__componentbuilder_field` ADD `on_get_model_field` TEXT NOT NULL AFTER `datatype`; + +ALTER TABLE `#__componentbuilder_field` ADD `on_save_model_field` TEXT NOT NULL AFTER `on_get_model_field`; + +ALTER TABLE `#__componentbuilder_field` ADD `initiator_on_save_model` TEXT NOT NULL AFTER `indexes`; + +ALTER TABLE `#__componentbuilder_field` ADD `initiator_on_get_model` TEXT NOT NULL AFTER `indexes`; diff --git a/admin/views/field/tmpl/edit.php b/admin/views/field/tmpl/edit.php index dd5e12a5b..aa8c16f8e 100644 --- a/admin/views/field/tmpl/edit.php +++ b/admin/views/field/tmpl/edit.php @@ -147,172 +147,240 @@ $componentParams = $this->params; // will be removed just use $this->params inst