diff --git a/README.md b/README.md index ce15e3cd0..f7b5416f2 100644 --- a/README.md +++ b/README.md @@ -144,11 +144,11 @@ 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*: 19th December, 2018 ++ *Last Build*: 29th December, 2018 + *Version*: 2.9.8 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **195562** ++ *Line count*: **195665** + *Field count*: **1087** + *File count*: **1275** + *Folder count*: **201** diff --git a/admin/README.txt b/admin/README.txt index ce15e3cd0..f7b5416f2 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,11 +144,11 @@ 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*: 19th December, 2018 ++ *Last Build*: 29th December, 2018 + *Version*: 2.9.8 + *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **195562** ++ *Line count*: **195665** + *Field count*: **1087** + *File count*: **1275** + *Folder count*: **201** diff --git a/admin/compiler/joomla_3/JViewLegacy_list.php b/admin/compiler/joomla_3/JViewLegacy_list.php index 60179e2b1..da24aba75 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list.php +++ b/admin/compiler/joomla_3/JViewLegacy_list.php @@ -42,6 +42,8 @@ class ###Component###View###Views### extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO### diff --git a/admin/compiler/joomla_3/routeHelper.php b/admin/compiler/joomla_3/routeHelper.php index 3486c4562..6b482a4a4 100644 --- a/admin/compiler/joomla_3/routeHelper.php +++ b/admin/compiler/joomla_3/routeHelper.php @@ -108,8 +108,8 @@ abstract class ###Component###HelperRoute } } return $link; - } - + } + protected static function _findItem($needles = null,$type = null) { $app = JFactory::getApplication(); @@ -157,6 +157,10 @@ abstract class ###Component###HelperRoute self::$lookup[$language][$view][$item->query['id']] = $item->id; } } + else + { + self::$lookup[$language][$view][0] = $item->id; + } } } } @@ -167,17 +171,24 @@ abstract class ###Component###HelperRoute { if (isset(self::$lookup[$language][$view])) { - foreach ($ids as $id) + if (###Component###Helper::checkArray($ids)) { - if (isset(self::$lookup[$language][$view][(int) $id])) + foreach ($ids as $id) { - return self::$lookup[$language][$view][(int) $id]; + if (isset(self::$lookup[$language][$view][(int) $id])) + { + return self::$lookup[$language][$view][(int) $id]; + } } } + elseif (isset(self::$lookup[$language][$view][0])) + { + return self::$lookup[$language][$view][0]; + } } } } - + if ($type) { // Check if the global menu item has been set. diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 53191cb53..9f1557b95 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -5270,8 +5270,10 @@ class Interpretation extends Fields $routeHelper[] = $this->_t(2) . "else"; $routeHelper[] = $this->_t(2) . "{"; $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Initialize the needel array."; - $routeHelper[] = $this->_t(3) . "\$needles = array();"; - $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . "Create the link but don't add the id."; + $routeHelper[] = $this->_t(3) . "\$needles = array("; + $routeHelper[] = $this->_t(4) . "'" . $viewName_single . "' => array()"; + $routeHelper[] = $this->_t(3) . ");"; + $routeHelper[] = $this->_t(3) . "//" . $this->setLine(__LINE__) . " Create the link but don't add the id."; $routeHelper[] = $this->_t(3) . "\$link = 'index.php?option=com_" . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . "&view=" . $viewName_single . "';"; $routeHelper[] = $this->_t(2) . "}"; if ('category' != $viewName_single && 'categories' != $viewName_single) @@ -7110,7 +7112,7 @@ class Interpretation extends Fields $referal = ''; if (!$ref) { - $ref = '&ref=' . $viewName_list; + $ref = '&return=return_here; ?>'; } // in linked tab/view so must add ref to default else diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 06ada1302..ff73ecd9b 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -2356,11 +2356,12 @@ abstract class ComponentbuilderHelper * * @param string $data The base64 string * @param string $key We store the string with that suffix :) + * @param string $default The default switch * * @return string The opened string * */ - public static function openValidBase64($data, $key = '__.o0=base64=Oo.__') + public static function openValidBase64($data, $key = '__.o0=base64=Oo.__', $default = 'string') { // check that we have a string if (self::checkString($data)) @@ -2379,7 +2380,12 @@ abstract class ComponentbuilderHelper return base64_decode($data); } } - return $data; + // check if we should just return the string + if ('string' === $default) + { + return $data; + } + return $default; } diff --git a/admin/models/forms/admin_view.js b/admin/models/forms/admin_view.js index b453fd44f..28ec70746 100644 --- a/admin/models/forms/admin_view.js +++ b/admin/models/forms/admin_view.js @@ -1330,16 +1330,16 @@ function checkAliasField() { } function checkAliasField_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.checkAliasField&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.checkAliasField&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type > 0){ var request = 'token='+token+'&type=' + type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -1354,16 +1354,16 @@ function getAjaxDisplay(type){ } function getAjaxDisplay_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type.length > 0){ var request = 'token='+token+'&type=' + type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -1372,16 +1372,16 @@ function addData(result,where){ } function addButtonID_server(type, size){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&raw=true&vdm="+vastDevMod); if(token.length > 0 && type.length > 0 && size > 0){ var request = 'token='+token+'&type='+type+'&size='+size; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function addButtonID(type, where, size){ @@ -1397,16 +1397,16 @@ function addButtonID(type, where, size){ } function addButton_server(type, size){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ var request = 'token='+token+'&type='+type+'&size='+size; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function addButton(type, where, size){ @@ -1424,16 +1424,16 @@ function addButton(type, where, size){ } function getLinked_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type > 0){ var request = 'token='+token+'&type='+type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -1446,16 +1446,16 @@ function getLinked(){ } function getTableColumns_server(tableName){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && tableName.length > 0){ var request = 'token='+token+'&table='+tableName; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -1477,16 +1477,16 @@ function getTableColumns(fieldKey, table_, nr_){ } function getDynamicScripts_server(typpe){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicScripts&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicScripts&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && typpe.length > 0){ var request = 'token='+token+'&type='+typpe; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } diff --git a/admin/models/forms/custom_admin_view.js b/admin/models/forms/custom_admin_view.js index ce6dcc754..c37d18352 100644 --- a/admin/models/forms/custom_admin_view.js +++ b/admin/models/forms/custom_admin_view.js @@ -443,16 +443,16 @@ jQuery(document).ready(function() }); function getLinked_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type > 0){ var request = 'token='+token+'&type='+type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -610,16 +610,16 @@ jQuery(document).ready(function($) }); function getSnippets_server(libraries){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&format=json"; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&raw=true&format=json"; if(token.length > 0 && libraries.length > 0){ var request = 'token='+token+'&libraries='+JSON.stringify(libraries); } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function getSnippets(){ diff --git a/admin/models/forms/dynamic_get.js b/admin/models/forms/dynamic_get.js index ec837ff82..af8576f38 100644 --- a/admin/models/forms/dynamic_get.js +++ b/admin/models/forms/dynamic_get.js @@ -1485,16 +1485,16 @@ jQuery(document).ready(function() }); function getLinked_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type > 0){ var request = 'token='+token+'&type='+type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -1508,7 +1508,7 @@ function getLinked(){ function getViewTableColumns_server(viewId,asKey,rowType) { - var getUrl = "index.php?option=com_componentbuilder&task=ajax.viewTableColumns&format=json"; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.viewTableColumns&format=json&raw=true"; if (token.length > 0 && viewId > 0 && asKey.length > 0) { var request = 'token='+token+'&as='+asKey+'&type='+rowType+'&id='+viewId; @@ -1516,9 +1516,9 @@ function getViewTableColumns_server(viewId,asKey,rowType) return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -1538,7 +1538,7 @@ function getViewTableColumns(id,asKey,key,rowType,main, table_, nr_) function getDbTableColumns_server(name,asKey,rowType) { - var getUrl = "index.php?option=com_componentbuilder&task=ajax.dbTableColumns&format=json"; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.dbTableColumns&format=json&raw=true"; if (token.length > 0 && name.length > 0 && asKey.length > 0) { var request = 'token='+token+'&as='+asKey+'&type='+rowType+'&name='+name; @@ -1546,9 +1546,9 @@ function getDbTableColumns_server(name,asKey,rowType) return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -1628,16 +1628,16 @@ function updateSubItems(fieldName, fieldNr, table_, nr_){ } function getDynamicScripts_server(typpe){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicScripts&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicScripts&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && typpe.length > 0){ var request = 'token='+token+'&type='+typpe; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } diff --git a/admin/models/forms/field.js b/admin/models/forms/field.js index 52e117a76..d51251d8d 100644 --- a/admin/models/forms/field.js +++ b/admin/models/forms/field.js @@ -522,16 +522,16 @@ jQuery(document).ready(function() }); function getLinked_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type > 0){ var request = 'token='+token+'&type='+type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -544,16 +544,16 @@ function getLinked(){ } function addButton_server(type, size){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ var request = 'token='+token+'&type='+type+'&size='+size; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function addButton(type, where, size){ @@ -574,16 +574,16 @@ function addButton(type, where, size){ var rowIdKey = 'properties'; function getFieldOptions_server(fieldtype){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && fieldtype > 0){ var request = 'token='+token+'&id='+fieldtype; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -734,31 +734,31 @@ function propertyIsSet(prop, id, targetForm) { } function getFieldPropertyDesc_server(fieldtype, property){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getFieldPropertyDesc&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getFieldPropertyDesc&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && (fieldtype > 0 || fieldtype.length > 0)&& property.length > 0){ var request = 'token='+token+'&fieldtype='+fieldtype+'&property='+property; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function getValidationRulesTable_server(){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getValidationRulesTable&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getValidationRulesTable&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0){ var request = 'token='+token+'&id=1'; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } diff --git a/admin/models/forms/joomla_component.js b/admin/models/forms/joomla_component.js index 0533e104c..b3891eebd 100644 --- a/admin/models/forms/joomla_component.js +++ b/admin/models/forms/joomla_component.js @@ -979,16 +979,16 @@ function getAjaxDisplay(type){ } function getAjaxDisplay_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type.length > 0){ var request = 'token='+token+'&type=' + type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -1012,16 +1012,16 @@ function dasboardSwitch(value){ function addButtonID_server(type, size){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&raw=true&vdm="+vastDevMod); if(token.length > 0 && type.length > 0 && size > 0){ var request = 'token='+token+'&type='+type+'&size='+size; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function addButtonID(type, where, size){ @@ -1037,16 +1037,16 @@ function addButtonID(type, where, size){ } function addButton_server(type, size){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ var request = 'token='+token+'&type='+type+'&size='+size; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function addButton(type, where, size){ @@ -1061,5 +1061,4 @@ function addButton(type, where, size){ } } }) -} - +} diff --git a/admin/models/forms/language_translation.js b/admin/models/forms/language_translation.js index d3a185301..d4af173bb 100644 --- a/admin/models/forms/language_translation.js +++ b/admin/models/forms/language_translation.js @@ -21,16 +21,16 @@ function addData(result,where){ } function addButton_server(type, size){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ var request = 'token='+token+'&type='+type+'&size='+size; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function addButton(type, where, size){ diff --git a/admin/models/forms/layout.js b/admin/models/forms/layout.js index f9960a44b..2eaa9007f 100644 --- a/admin/models/forms/layout.js +++ b/admin/models/forms/layout.js @@ -208,16 +208,16 @@ jQuery(document).ready(function($) }); function getSnippets_server(libraries){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&format=json"; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&raw=true&format=json"; if(token.length > 0 && libraries.length > 0){ var request = 'token='+token+'&libraries='+JSON.stringify(libraries); } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function getSnippets(){ diff --git a/admin/models/forms/library.js b/admin/models/forms/library.js index d4c51b0d8..6fd79de90 100644 --- a/admin/models/forms/library.js +++ b/admin/models/forms/library.js @@ -417,16 +417,16 @@ function addData(result,where){ } function addButtonID_server(type, size){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&raw=true&vdm="+vastDevMod); if(token.length > 0 && type.length > 0 && size > 0){ var request = 'token='+token+'&type='+type+'&size='+size; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function addButtonID(type, where, size){ @@ -442,16 +442,16 @@ function addButtonID(type, where, size){ } function addButton_server(type, size){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ var request = 'token='+token+'&type='+type+'&size='+size; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function addButton(type, where, size){ @@ -469,16 +469,16 @@ function addButton(type, where, size){ } function getLinked_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type > 0){ var request = 'token='+token+'&type='+type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -501,30 +501,30 @@ function getAjaxDisplay(type){ } function getAjaxDisplay_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&raw=true&vdm="+vastDevMod; if (token.length > 0 && type.length > 0) { var request = 'token='+token+'&type=' + type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function getFieldSelectOptions_server(fieldId){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json"; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json&raw=true"; if (token.length > 0 && fieldId > 0) { var request = 'token='+token+'&id='+fieldId; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } diff --git a/admin/models/forms/site_view.js b/admin/models/forms/site_view.js index 5e1be20e4..19e1c804b 100644 --- a/admin/models/forms/site_view.js +++ b/admin/models/forms/site_view.js @@ -484,16 +484,16 @@ jQuery(document).ready(function() }); function getLinked_server(type){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod; if(token.length > 0 && type > 0){ var request = 'token='+token+'&type='+type; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -651,16 +651,16 @@ jQuery(document).ready(function($) }); function getSnippets_server(libraries){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&format=json"; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&raw=true&format=json"; if(token.length > 0 && libraries.length > 0){ var request = 'token='+token+'&libraries='+JSON.stringify(libraries); } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function getSnippets(){ diff --git a/admin/models/forms/template.js b/admin/models/forms/template.js index f37cc830d..0960a91b2 100644 --- a/admin/models/forms/template.js +++ b/admin/models/forms/template.js @@ -234,16 +234,16 @@ jQuery(document).ready(function($) }); function getSnippets_server(libraries){ - var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&format=json"; + var getUrl = "index.php?option=com_componentbuilder&task=ajax.getSnippets&raw=true&format=json"; if(token.length > 0 && libraries.length > 0){ var request = 'token='+token+'&libraries='+JSON.stringify(libraries); } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } function getSnippets(){ diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 545020345..25ad6b568 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -350,6 +350,15 @@ class ComponentbuilderModelJoomla_components extends JModelList { $this->setData('custom_code', array_values($this->smartIDs['custom_code']), 'id'); } + // set limiter + $limit = 0; + // and add those custom codes found in custom codes + while (isset($this->smartIDs['custom_code']) && ComponentbuilderHelper::checkArray($this->smartIDs['custom_code']) && $limit < 100) + { + $this->setData('custom_code', array_values($this->smartIDs['custom_code']), 'id'); + // make sure we break + $limit++; // just in case (should not be needed) + } } } @@ -604,6 +613,10 @@ class ComponentbuilderModelJoomla_components extends JModelList { $this->smartIDs['layout'] = array(); } + elseif ('custom_code' === $table && 'id' === $key) + { + $this->smartIDs['custom_code'] = array(); + } // start loading the data if (!isset($this->smartBox[$table])) { diff --git a/admin/views/admin_views/view.html.php b/admin/views/admin_views/view.html.php index bb500e454..efad7cf3d 100644 --- a/admin/views/admin_views/view.html.php +++ b/admin/views/admin_views/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_view'); $this->canEdit = $this->canDo->get('admin_view.edit'); diff --git a/admin/views/admins_custom_tabs/view.html.php b/admin/views/admins_custom_tabs/view.html.php index 6a22de723..a07b50237 100644 --- a/admin/views/admins_custom_tabs/view.html.php +++ b/admin/views/admins_custom_tabs/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewAdmins_custom_tabs extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_custom_tabs'); $this->canEdit = $this->canDo->get('admin_custom_tabs.edit'); diff --git a/admin/views/admins_fields/view.html.php b/admin/views/admins_fields/view.html.php index 46a24546a..f9fd5cc73 100644 --- a/admin/views/admins_fields/view.html.php +++ b/admin/views/admins_fields/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields'); $this->canEdit = $this->canDo->get('admin_fields.edit'); diff --git a/admin/views/admins_fields_conditions/view.html.php b/admin/views/admins_fields_conditions/view.html.php index 3ba6c77cd..b2b4f632b 100644 --- a/admin/views/admins_fields_conditions/view.html.php +++ b/admin/views/admins_fields_conditions/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); $this->canEdit = $this->canDo->get('admin_fields_conditions.edit'); diff --git a/admin/views/admins_fields_relations/view.html.php b/admin/views/admins_fields_relations/view.html.php index 3a4e5da48..b54d57e7a 100644 --- a/admin/views/admins_fields_relations/view.html.php +++ b/admin/views/admins_fields_relations/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewAdmins_fields_relations extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations'); $this->canEdit = $this->canDo->get('admin_fields_relations.edit'); diff --git a/admin/views/components_admin_views/view.html.php b/admin/views/components_admin_views/view.html.php index a91cc2086..9e9477937 100644 --- a/admin/views/components_admin_views/view.html.php +++ b/admin/views/components_admin_views/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_admin_views'); $this->canEdit = $this->canDo->get('component_admin_views.edit'); diff --git a/admin/views/components_config/view.html.php b/admin/views/components_config/view.html.php index 3846d7e06..6e519e923 100644 --- a/admin/views/components_config/view.html.php +++ b/admin/views/components_config/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_config extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_config'); $this->canEdit = $this->canDo->get('component_config.edit'); diff --git a/admin/views/components_custom_admin_menus/view.html.php b/admin/views/components_custom_admin_menus/view.html.php index e7cb80d38..cfdd2a8ea 100644 --- a/admin/views/components_custom_admin_menus/view.html.php +++ b/admin/views/components_custom_admin_menus/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus'); $this->canEdit = $this->canDo->get('component_custom_admin_menus.edit'); diff --git a/admin/views/components_custom_admin_views/view.html.php b/admin/views/components_custom_admin_views/view.html.php index 5f79b2937..0186d31cf 100644 --- a/admin/views/components_custom_admin_views/view.html.php +++ b/admin/views/components_custom_admin_views/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views'); $this->canEdit = $this->canDo->get('component_custom_admin_views.edit'); diff --git a/admin/views/components_dashboard/view.html.php b/admin/views/components_dashboard/view.html.php index 63a51144f..8ed19d296 100644 --- a/admin/views/components_dashboard/view.html.php +++ b/admin/views/components_dashboard/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_dashboard'); $this->canEdit = $this->canDo->get('component_dashboard.edit'); diff --git a/admin/views/components_files_folders/view.html.php b/admin/views/components_files_folders/view.html.php index e7dde81a0..970d8c04f 100644 --- a/admin/views/components_files_folders/view.html.php +++ b/admin/views/components_files_folders/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_files_folders'); $this->canEdit = $this->canDo->get('component_files_folders.edit'); diff --git a/admin/views/components_mysql_tweaks/view.html.php b/admin/views/components_mysql_tweaks/view.html.php index 431679930..727a483ed 100644 --- a/admin/views/components_mysql_tweaks/view.html.php +++ b/admin/views/components_mysql_tweaks/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks'); $this->canEdit = $this->canDo->get('component_mysql_tweaks.edit'); diff --git a/admin/views/components_site_views/view.html.php b/admin/views/components_site_views/view.html.php index 60aedb446..af6e20779 100644 --- a/admin/views/components_site_views/view.html.php +++ b/admin/views/components_site_views/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_site_views'); $this->canEdit = $this->canDo->get('component_site_views.edit'); diff --git a/admin/views/components_updates/view.html.php b/admin/views/components_updates/view.html.php index 8b27644d0..6935273cf 100644 --- a/admin/views/components_updates/view.html.php +++ b/admin/views/components_updates/view.html.php @@ -37,6 +37,8 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_updates'); $this->canEdit = $this->canDo->get('component_updates.edit'); diff --git a/admin/views/custom_admin_views/tmpl/default_body.php b/admin/views/custom_admin_views/tmpl/default_body.php index 2fdf1de94..01f572b0e 100644 --- a/admin/views/custom_admin_views/tmpl/default_body.php +++ b/admin/views/custom_admin_views/tmpl/default_body.php @@ -97,7 +97,7 @@ $edit = "index.php?option=com_componentbuilder&view=custom_admin_views&task=cust