Permalink
Browse files

fixed issue that caused some custom code not to export for a JCB pack…

…ages if found in anther custom code area. Made some corrections to the router helper class. Added return_here value admin views to improve the return values in url redirection. Improved the open valid base64 method to make use of default string. Update many ajax calls to not use jsonp, and infact be more secure.
  • Loading branch information...
Llewellynvdm committed Dec 29, 2018
1 parent 17ba6c4 commit b7a5cb72854eec138d35e8be3b050e28c7f2256d
Showing with 245 additions and 127 deletions.
  1. +2 −2 README.md
  2. +2 −2 admin/README.txt
  3. +2 −0 admin/compiler/joomla_3/JViewLegacy_list.php
  4. +17 −6 admin/compiler/joomla_3/routeHelper.php
  5. +5 −3 admin/helpers/compiler/e_Interpretation.php
  6. +8 −2 admin/helpers/componentbuilder.php
  7. +21 −21 admin/models/forms/admin_view.js
  8. +6 −6 admin/models/forms/custom_admin_view.js
  9. +12 −12 admin/models/forms/dynamic_get.js
  10. +15 −15 admin/models/forms/field.js
  11. +10 −11 admin/models/forms/joomla_component.js
  12. +3 −3 admin/models/forms/language_translation.js
  13. +3 −3 admin/models/forms/layout.js
  14. +15 −15 admin/models/forms/library.js
  15. +6 −6 admin/models/forms/site_view.js
  16. +3 −3 admin/models/forms/template.js
  17. +13 −0 admin/models/joomla_components.php
  18. +2 −0 admin/views/admin_views/view.html.php
  19. +2 −0 admin/views/admins_custom_tabs/view.html.php
  20. +2 −0 admin/views/admins_fields/view.html.php
  21. +2 −0 admin/views/admins_fields_conditions/view.html.php
  22. +2 −0 admin/views/admins_fields_relations/view.html.php
  23. +2 −0 admin/views/components_admin_views/view.html.php
  24. +2 −0 admin/views/components_config/view.html.php
  25. +2 −0 admin/views/components_custom_admin_menus/view.html.php
  26. +2 −0 admin/views/components_custom_admin_views/view.html.php
  27. +2 −0 admin/views/components_dashboard/view.html.php
  28. +2 −0 admin/views/components_files_folders/view.html.php
  29. +2 −0 admin/views/components_mysql_tweaks/view.html.php
  30. +2 −0 admin/views/components_site_views/view.html.php
  31. +2 −0 admin/views/components_updates/view.html.php
  32. +1 −1 admin/views/custom_admin_views/tmpl/default_body.php
  33. +2 −0 admin/views/custom_admin_views/view.html.php
  34. +2 −0 admin/views/custom_codes/view.html.php
  35. +2 −0 admin/views/dynamic_gets/view.html.php
  36. +1 −1 admin/views/fields/tmpl/default_body.php
  37. +2 −0 admin/views/fields/view.html.php
  38. +2 −0 admin/views/fieldtypes/view.html.php
  39. +2 −0 admin/views/help_documents/view.html.php
  40. +2 −0 admin/views/joomla_components/view.html.php
  41. +2 −0 admin/views/language_translations/view.html.php
  42. +2 −0 admin/views/languages/view.html.php
  43. +1 −1 admin/views/layouts/tmpl/default_body.php
  44. +2 −0 admin/views/layouts/view.html.php
  45. +2 −0 admin/views/libraries/view.html.php
  46. +2 −0 admin/views/libraries_config/view.html.php
  47. +2 −0 admin/views/libraries_files_folders_urls/view.html.php
  48. +2 −0 admin/views/servers/view.html.php
  49. +1 −1 admin/views/site_views/tmpl/default_body.php
  50. +2 −0 admin/views/site_views/view.html.php
  51. +2 −0 admin/views/snippet_types/view.html.php
  52. +1 −1 admin/views/snippets/tmpl/default_body.php
  53. +2 −0 admin/views/snippets/view.html.php
  54. +1 −1 admin/views/templates/tmpl/default_body.php
  55. +2 −0 admin/views/templates/view.html.php
  56. +2 −0 admin/views/validation_rules/view.html.php
  57. +1 −1 componentbuilder.xml
  58. +8 −2 site/helpers/componentbuilder.php
  59. +21 −8 site/helpers/route.php
@@ -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**
@@ -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**
@@ -42,6 +42,8 @@ function display($tpl = null)
$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###

@@ -108,8 +108,8 @@ public static function getCategoryRoute_keep_for_later($catid, $language = 0)
}
}
return $link;
}
}

protected static function _findItem($needles = null,$type = null)
{
$app = JFactory::getApplication();
@@ -157,6 +157,10 @@ protected static function _findItem($needles = null,$type = null)
self::$lookup[$language][$view][$item->query['id']] = $item->id;
}
}
else
{
self::$lookup[$language][$view][0] = $item->id;
}
}
}
}
@@ -167,17 +171,24 @@ protected static function _findItem($needles = null,$type = null)
{
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.
@@ -5270,8 +5270,10 @@ public function setRouterHelp($viewName_single, $viewName_list, $front = false)
$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 @@ protected function getListItemLink($item, &$checkoutTriger, $viewName_single, $v
$referal = '';
if (!$ref)
{
$ref = '&ref=' . $viewName_list;
$ref = '&return=<?php echo $this->return_here; ?>';
}
// in linked tab/view so must add ref to default
else
@@ -2356,11 +2356,12 @@ public static function getSpacerIds()
*
* @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 @@ public static function openValidBase64($data, $key = '__.o0=base64=Oo.__')
return base64_decode($data);
}
}
return $data;
// check if we should just return the string
if ('string' === $default)
{
return $data;
}
return $default;
}
@@ -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
});
}

@@ -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(){
@@ -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,17 +1508,17 @@ 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;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
dataType: 'json',
data: request,
jsonp: 'callback'
jsonp: false
});
}

@@ -1538,17 +1538,17 @@ 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;
}
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
});
}

Oops, something went wrong.

0 comments on commit b7a5cb7

Please sign in to comment.