Fixed the compiler to insure the getExImPortHeaders method is added even when no custom script has been set

This commit is contained in:
Llewellyn van der Merwe 2018-01-18 01:28:44 +02:00
parent 189a8723ac
commit f692e573f6
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
16 changed files with 382 additions and 3 deletions

View File

@ -130,7 +130,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.6.12
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **180823**
+ *Line count*: **181174**
+ *Field count*: **1573**
+ *File count*: **1160**
+ *Folder count*: **186**

View File

@ -130,7 +130,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.6.12
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **180823**
+ *Line count*: **181174**
+ *Field count*: **1573**
+ *File count*: **1160**
+ *Folder count*: **186**

View File

@ -8103,6 +8103,34 @@ class Interpretation extends Fields
$query .= PHP_EOL . "\t\t}";
$query .= PHP_EOL . "\t\treturn false;";
$query .= PHP_EOL . "\t}";
// set a default script for those with no custom script
$default = PHP_EOL . PHP_EOL . "\t/**";
$default .= PHP_EOL . "\t* Method to get header.";
$default .= PHP_EOL . "\t*";
$default .= PHP_EOL . "\t* @return mixed An array of data items on success, false on failure.";
$default .= PHP_EOL . "\t*/";
$default .= PHP_EOL . "\tpublic function getExImPortHeaders()";
$default .= PHP_EOL . "\t{";
$default .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection.";
$default .= PHP_EOL . "\t\t\$db = JFactory::getDbo();";
$default .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get the columns";
$default .= PHP_EOL . "\t\t\$columns = \$db->getTableColumns(" . '"#__' . $this->fileContentStatic['###component###'] . '_' . $viewName_single . '");';
$default .= PHP_EOL . "\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$columns))";
$default .= PHP_EOL . "\t\t{";
$default .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " remove the headers you don't import/export.";
$default .= PHP_EOL . "\t\t\tunset(\$columns['asset_id']);";
$default .= PHP_EOL . "\t\t\tunset(\$columns['checked_out']);";
$default .= PHP_EOL . "\t\t\tunset(\$columns['checked_out_time']);";
$default .= PHP_EOL . "\t\t\t\$headers = new stdClass();";
$default .= PHP_EOL . "\t\t\tforeach (\$columns as \$column => \$type)";
$default .= PHP_EOL . "\t\t\t{";
$default .= PHP_EOL . "\t\t\t\t\$headers->{\$column} = \$column;";
$default .= PHP_EOL . "\t\t\t}";
$default .= PHP_EOL . "\t\t\treturn \$headers;";
$default .= PHP_EOL . "\t\t}";
$default .= PHP_EOL . "\t\treturn false;";
$default .= PHP_EOL . "\t}";
// set some placeholders just incase
if (!isset($this->placeholders['###view###']) && !isset($this->placeholders['[[[view]]]']))
@ -8119,7 +8147,7 @@ class Interpretation extends Fields
}
// add getExImPortHeaders
$query .= $this->getCustomScriptBuilder('php_import_headers', 'import_' . $viewName_list, PHP_EOL . PHP_EOL, null, true);
$query .= $this->getCustomScriptBuilder('php_import_headers', 'import_' . $viewName_list, PHP_EOL . PHP_EOL, null, true, $default);
// remove place holders if not needed (to not be suprized)
if (isset($_viewSet))

View File

@ -346,6 +346,33 @@ class ComponentbuilderModelAdmin_views extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_admin_view");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -306,6 +306,33 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_custom_admin_view");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -406,6 +406,33 @@ class ComponentbuilderModelCustom_codes extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_custom_code");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -351,6 +351,33 @@ class ComponentbuilderModelDynamic_gets extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_dynamic_get");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -454,6 +454,33 @@ class ComponentbuilderModelFields extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_field");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -306,6 +306,33 @@ class ComponentbuilderModelFieldtypes extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_fieldtype");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -281,6 +281,33 @@ class ComponentbuilderModelFtps extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_ftp");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -373,6 +373,33 @@ class ComponentbuilderModelHelp_documents extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_help_document");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -270,6 +270,33 @@ class ComponentbuilderModelLanguages extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_language");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -291,6 +291,33 @@ class ComponentbuilderModelLayouts extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_layout");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -306,6 +306,33 @@ class ComponentbuilderModelSite_views extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_site_view");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -416,6 +416,33 @@ class ComponentbuilderModelSnippets extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_snippet");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**

View File

@ -282,6 +282,33 @@ class ComponentbuilderModelTemplates extends JModelList
}
}
return false;
}
/**
* Method to get header.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getExImPortHeaders()
{
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_template");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
$headers = new stdClass();
foreach ($columns as $column => $type)
{
$headers->{$column} = $column;
}
return $headers;
}
return false;
}
/**