Fixed the auto backup system, to allow JCB to be backed up automatically

This commit is contained in:
Llewellyn van der Merwe 2018-04-23 14:47:19 +02:00
parent 0857101371
commit 909a91844f
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
13 changed files with 1868 additions and 864 deletions

View File

@ -130,8 +130,8 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.7.6
+ *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*: **183707**
+ *Field count*: **1024**
+ *Line count*: **184709**
+ *Field count*: **1025**
+ *File count*: **1201**
+ *Folder count*: **193**

View File

@ -130,8 +130,8 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.7.6
+ *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*: **183707**
+ *Field count*: **1024**
+ *Line count*: **184709**
+ *Field count*: **1025**
+ *File count*: **1201**
+ *Folder count*: **193**

File diff suppressed because it is too large Load Diff

View File

@ -3864,6 +3864,8 @@ COM_COMPONENTBUILDER_FIELD_NEW="A New Field"
COM_COMPONENTBUILDER_FIELD_NO="No"
COM_COMPONENTBUILDER_FIELD_NONE="None"
COM_COMPONENTBUILDER_FIELD_NONE_SET="None Set"
COM_COMPONENTBUILDER_FIELD_NOTE_DATABASE_SETTINGS_NEEDED_DESCRIPTION="<p>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.</p><p>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.</p>"
COM_COMPONENTBUILDER_FIELD_NOTE_DATABASE_SETTINGS_NEEDED_LABEL="Database Settings"
COM_COMPONENTBUILDER_FIELD_NOTE_FILTER_INFORMATION_DESCRIPTION="<div class='form-horizontal'>
<div class='span4'>
<h1>Filter Information</h1>

View File

@ -30,7 +30,8 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'note_no_database_settings_needed'
'note_no_database_settings_needed',
'note_database_settings_needed'
);
?>

View File

@ -106,12 +106,6 @@ class ComponentbuilderModelField extends JModelAdmin
$item->xml = json_decode($item->xml);
}
if (!empty($item->javascript_view_footer))
{
// base64 Decode javascript_view_footer.
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
}
if (!empty($item->css_views))
{
// base64 Decode css_views.
@ -124,6 +118,12 @@ class ComponentbuilderModelField extends JModelAdmin
$item->css_view = base64_decode($item->css_view);
}
if (!empty($item->javascript_view_footer))
{
// base64 Decode javascript_view_footer.
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
}
if (!empty($item->javascript_views_footer))
{
// base64 Decode javascript_views_footer.
@ -960,12 +960,6 @@ class ComponentbuilderModelField extends JModelAdmin
$data['xml'] = (string) json_encode($data['xml']);
}
// Set the javascript_view_footer string to base64 string.
if (isset($data['javascript_view_footer']))
{
$data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']);
}
// Set the css_views string to base64 string.
if (isset($data['css_views']))
{
@ -978,6 +972,12 @@ class ComponentbuilderModelField extends JModelAdmin
$data['css_view'] = base64_encode($data['css_view']);
}
// Set the javascript_view_footer string to base64 string.
if (isset($data['javascript_view_footer']))
{
$data['javascript_view_footer'] = base64_encode($data['javascript_view_footer']);
}
// Set the javascript_views_footer string to base64 string.
if (isset($data['javascript_views_footer']))
{

View File

@ -432,12 +432,12 @@ class ComponentbuilderModelFields extends JModelList
continue;
}
// decode javascript_view_footer
$item->javascript_view_footer = base64_decode($item->javascript_view_footer);
// decode css_views
$item->css_views = base64_decode($item->css_views);
// decode css_view
$item->css_view = base64_decode($item->css_view);
// 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);
// unset the values we don't want exported.

View File

@ -801,6 +801,7 @@ function dbChecker(type){
jQuery('#jform_null_switch').removeClass('required');
// show notice
jQuery('.note_no_database_settings_needed').closest('.control-group').show();
jQuery('.note_database_settings_needed').closest('.control-group').hide();
} else {
// add the datatype
jQuery('#jform_datatype-lbl').closest('.control-group').show();
@ -818,5 +819,6 @@ function dbChecker(type){
jQuery('#jform_null_switch').addClass('required');
// remove notice
jQuery('.note_no_database_settings_needed').closest('.control-group').hide();
jQuery('.note_database_settings_needed').closest('.control-group').show();
}
}

View File

@ -219,33 +219,6 @@
description="COM_COMPONENTBUILDER_FIELD_CATID_DESCRIPTION"
class="inputbox"
/>
<!-- Javascript_view_footer Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="javascript_view_footer"
label="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_HINT"
required="true"
/>
<!-- Add_javascript_view_footer Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_javascript_view_footer"
label="COM_COMPONENTBUILDER_FIELD_ADD_JAVASCRIPT_VIEW_FOOTER_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_FIELD_YES</option>
<option value="0">
COM_COMPONENTBUILDER_FIELD_NO</option>
</field>
<!-- Css_views Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -300,6 +273,8 @@
<option value="0">
COM_COMPONENTBUILDER_FIELD_NO</option>
</field>
<!-- Note_database_settings_needed Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_database_settings_needed" label="COM_COMPONENTBUILDER_FIELD_NOTE_DATABASE_SETTINGS_NEEDED_LABEL" description="COM_COMPONENTBUILDER_FIELD_NOTE_DATABASE_SETTINGS_NEEDED_DESCRIPTION" heading="h4" class="alert alert-info note_database_settings_needed" />
<!-- Datalenght Field. Type: List. (joomla) -->
<field
type="list"
@ -334,8 +309,20 @@
<option value="Other">
COM_COMPONENTBUILDER_FIELD_OTHER</option>
</field>
<!-- Note_whmcs_encryption Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_whmcs_encryption" label="COM_COMPONENTBUILDER_FIELD_NOTE_WHMCS_ENCRYPTION_LABEL" description="COM_COMPONENTBUILDER_FIELD_NOTE_WHMCS_ENCRYPTION_DESCRIPTION" heading="h4" class="alert alert-success note_whmcs_encryption" />
<!-- Add_javascript_views_footer Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_javascript_views_footer"
label="COM_COMPONENTBUILDER_FIELD_ADD_JAVASCRIPT_VIEWS_FOOTER_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_FIELD_YES</option>
<option value="0">
COM_COMPONENTBUILDER_FIELD_NO</option>
</field>
<!-- Note_filter_information Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_filter_information" description="COM_COMPONENTBUILDER_FIELD_NOTE_FILTER_INFORMATION_DESCRIPTION" class="note_filter_information" />
<!-- Helpnote Field. Type: Note. A None Database Field. (joomla) -->
@ -394,11 +381,11 @@
message="COM_COMPONENTBUILDER_FIELD_DATALENGHT_OTHER_MESSAGE"
hint="COM_COMPONENTBUILDER_FIELD_DATALENGHT_OTHER_HINT"
/>
<!-- Add_javascript_views_footer Field. Type: Radio. (joomla) -->
<!-- Add_javascript_view_footer Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_javascript_views_footer"
label="COM_COMPONENTBUILDER_FIELD_ADD_JAVASCRIPT_VIEWS_FOOTER_LABEL"
name="add_javascript_view_footer"
label="COM_COMPONENTBUILDER_FIELD_ADD_JAVASCRIPT_VIEW_FOOTER_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -408,6 +395,21 @@
<option value="0">
COM_COMPONENTBUILDER_FIELD_NO</option>
</field>
<!-- Note_whmcs_encryption Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_whmcs_encryption" label="COM_COMPONENTBUILDER_FIELD_NOTE_WHMCS_ENCRYPTION_LABEL" description="COM_COMPONENTBUILDER_FIELD_NOTE_WHMCS_ENCRYPTION_DESCRIPTION" heading="h4" class="alert alert-success note_whmcs_encryption" />
<!-- Javascript_view_footer Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="javascript_view_footer"
label="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_FIELD_JAVASCRIPT_VIEW_FOOTER_HINT"
required="true"
/>
<!-- Note_no_database_settings_needed Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_no_database_settings_needed" label="COM_COMPONENTBUILDER_FIELD_NOTE_NO_DATABASE_SETTINGS_NEEDED_LABEL" description="COM_COMPONENTBUILDER_FIELD_NOTE_NO_DATABASE_SETTINGS_NEEDED_DESCRIPTION" heading="h4" class="alert alert-info note_no_database_settings_needed" />
<!-- Javascript_views_footer Field. Type: Textarea. (joomla) -->

View File

@ -730,14 +730,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_javascript_view_footer` (`add_javascript_view_footer`),
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_datadefault_other` (`datadefault_other`),
KEY `idx_datadefault` (`datadefault`),
KEY `idx_datalenght_other` (`datalenght_other`),
KEY `idx_add_javascript_views_footer` (`add_javascript_views_footer`)
KEY `idx_add_javascript_view_footer` (`add_javascript_view_footer`)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__componentbuilder_fieldtype` (

View File

@ -3428,9 +3428,9 @@ class com_componentbuilderInstallerScript
$field->type_title = 'Componentbuilder Field';
$field->type_alias = 'com_componentbuilder.field';
$field->table = '{"special": {"dbtable": "#__componentbuilder_field","key": "id","type": "Field","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","store":"store","javascript_view_footer":"javascript_view_footer","add_javascript_view_footer":"add_javascript_view_footer","css_views":"css_views","add_css_views":"add_css_views","css_view":"css_view","add_css_view":"add_css_view","datalenght":"datalenght","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","add_javascript_views_footer":"add_javascript_views_footer","javascript_views_footer":"javascript_views_footer","not_required":"not_required","xml":"xml"}}';
$field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","store":"store","css_views":"css_views","add_css_views":"add_css_views","css_view":"css_view","add_css_view":"add_css_view","datalenght":"datalenght","add_javascript_views_footer":"add_javascript_views_footer","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","add_javascript_view_footer":"add_javascript_view_footer","javascript_view_footer":"javascript_view_footer","javascript_views_footer":"javascript_views_footer","not_required":"not_required","xml":"xml"}}';
$field->router = 'ComponentbuilderHelperRoute::getFieldRoute';
$field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","store","catid","add_javascript_view_footer","add_css_views","add_css_view","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}';
$field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","store","catid","add_css_views","add_css_view","add_javascript_views_footer","add_javascript_view_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}';
// Set the object into the content types table.
$field_Inserted = $db->insertObject('#__content_types', $field);
@ -4037,9 +4037,9 @@ class com_componentbuilderInstallerScript
$field->type_title = 'Componentbuilder Field';
$field->type_alias = 'com_componentbuilder.field';
$field->table = '{"special": {"dbtable": "#__componentbuilder_field","key": "id","type": "Field","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","store":"store","javascript_view_footer":"javascript_view_footer","add_javascript_view_footer":"add_javascript_view_footer","css_views":"css_views","add_css_views":"add_css_views","css_view":"css_view","add_css_view":"add_css_view","datalenght":"datalenght","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","add_javascript_views_footer":"add_javascript_views_footer","javascript_views_footer":"javascript_views_footer","not_required":"not_required","xml":"xml"}}';
$field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","store":"store","css_views":"css_views","add_css_views":"add_css_views","css_view":"css_view","add_css_view":"add_css_view","datalenght":"datalenght","add_javascript_views_footer":"add_javascript_views_footer","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","add_javascript_view_footer":"add_javascript_view_footer","javascript_view_footer":"javascript_view_footer","javascript_views_footer":"javascript_views_footer","not_required":"not_required","xml":"xml"}}';
$field->router = 'ComponentbuilderHelperRoute::getFieldRoute';
$field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","store","catid","add_javascript_view_footer","add_css_views","add_css_view","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}';
$field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","store","catid","add_css_views","add_css_view","add_javascript_views_footer","add_javascript_view_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}';
// Check if field type is already in content_type DB.
$field_id = null;

View File

@ -36,6 +36,9 @@ JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/compon
JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php');
JLoader::register('ComponentbuilderHelperRoute', dirname(__FILE__) . '/helpers/route.php');
// Triger the Global Site Event
ComponentbuilderHelper::globalEvent($document);
// import joomla controller library
jimport('joomla.application.component.controller');

File diff suppressed because it is too large Load Diff