diff --git a/README.md b/README.md index 015b7e54b..2075284fc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,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.6.6) 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.6.7) 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) @@ -112,11 +112,11 @@ Component Builder is mapped as a component in itself on my local development env + *Name*: [Component Builder](http://vdm.bz/component-builder) + *First Build*: 30th April, 2015 + *Last Build*: 14th December, 2017 -+ *Version*: 2.6.6 ++ *Version*: 2.6.7 + *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*: **177938** -+ *File count*: **1142** ++ *Line count*: **178213** ++ *File count*: **1145** + *Folder count*: **184** > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). diff --git a/admin/README.txt b/admin/README.txt index 015b7e54b..2075284fc 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -10,7 +10,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.6.6) 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.6.7) 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) @@ -112,11 +112,11 @@ Component Builder is mapped as a component in itself on my local development env + *Name*: [Component Builder](http://vdm.bz/component-builder) + *First Build*: 30th April, 2015 + *Last Build*: 14th December, 2017 -+ *Version*: 2.6.6 ++ *Version*: 2.6.7 + *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*: **177938** -+ *File count*: **1142** ++ *Line count*: **178213** ++ *File count*: **1145** + *Folder count*: **184** > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). diff --git a/admin/assets/js/get_snippets.js b/admin/assets/js/get_snippets.js new file mode 100644 index 000000000..6652bc0d6 --- /dev/null +++ b/admin/assets/js/get_snippets.js @@ -0,0 +1,542 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version 2.6.x + @created 30th April, 2015 + @package Component Builder + @subpackage get_snippets.js + @author Llewellyn van der Merwe + @github Joomla Component Builder + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +/* JS Document */ +// start the moment the document is ready +jQuery(document).ready(function () { + // just get the available libraries + getLibraries(snippetsPath); +}); + +// add an ajax call tracker +var ajaxcall = null; +var fromLocal = false; + +jQuery(document).ready(function(){ + jQuery('body').on('click','.getreaction',function(){ + // Ajax request + var btn = jQuery(this); + btn.prop('disabled', true); + setTimeout(function(){ + btn.prop('disabled', false); + }, 3000); + var type = btn.data('type'); + if ('getLibraries' === type) { + getLibraries(snippetsPath); + } else if ('getSnippets' === type) { + var name = btn.data('name'); + getSnippets(snippetsPath, name); + } else if ('all' === type) { + var status = btn.data('status'); + bulkSnippetGithub(status); + } else if ('bulk' === type) { + checkBulkSnippetGithub(); + } else if ('get' === type) { + var path = btn.data('path'); + var status = btn.data('status'); + setSnippetGithub(path, status); + } else { + var path = btn.data('path'); + getSnippetModal(path, type); + } + }); +}); + +// load every thing once ready +jQuery(document).ajaxStop(function () { + if (0 === jQuery.active) { + //do something special + if ('snippets' === ajaxcall) { + setTimeout( function() { + jQuery('#snippets-github').html('

'+Joomla.JText._('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS')+'

'); + jQuery('#snippets-display').show(); + jQuery('#snippets-grid').trigger('display.uk.check'); + jQuery('#loading').hide(); + }, 1000); + } + } +}); + +// get the libraries +function getLibraries(path) { + var _paths = jQuery.jStorage.get('JCB-Snippets-Paths', null); + // always hide the snippets display + jQuery('#snippets-display').hide(); + // always reset the grid + jQuery('#libraries-grid').html(''); + // set the ajax scope + ajaxcall = 'libraries'; + if (_paths) { + buildLibraries(_paths); + } else { + jQuery.get(path) + .success(function(paths) { + // load only this library paths + jQuery.jStorage.set('JCB-Snippets-Paths', paths, {TTL: expire}); + buildLibraries(paths); + }) + .error(function(jqXHR, textStatus, errorThrown) { + jQuery('#snippets-github').html(returnError); + }); + } +} + +// build the ibraries object +function buildLibraries(paths) { + var _temp = jQuery.jStorage.get('JCB-Libraries', null); + if (_temp) { + setLibraries(_temp); + } else { + var temp = {}; + jQuery.each(paths.tree, function(key,value) { + if (value.path.match(".json$")) { + var libName = value.path.split(/ -(.+)/)[0]; + libName = libName.trim() + temp[libName] = libName; + } + }); + // load only this library paths + jQuery.jStorage.set('JCB-Libraries', temp, {TTL: expire}); + setLibraries(temp); + } +} + +// set the libraries +function setLibraries(names) { + // now load the lib buttons + jQuery.each(names, function(value) { + setLibrary(value); + }); + setTimeout( function() { + jQuery('#snippets-github').html('

'+Joomla.JText._('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES')+'

'); + jQuery('#libraries-display').show(); + jQuery('#libraries-grid').trigger('display.uk.check'); + }, 1000); +} + +// set the snippets +function setLibrary(name) { + // get useful ID + var keyID = getKeyID(name); + // build the library display + var html = '
'; + html += '
'; + html += '

' + name + '

'; + html += '
'; + // set the data buttons + html += setLibButtons(name); + // close the box panel + html += '
'; + html += '
'; + // now we have the library + jQuery('#libraries-grid').append(html); +} + +function setLibButtons(name) { + return ''; +} + +// get the snippets +function getSnippets(path, libraryName) { + jQuery('#loading').show(); + // get local values if set + var _paths = jQuery.jStorage.get('JCB-Snippets-Paths', null); + // always reset the grid + jQuery('#snippets-grid').html(''); + // always hide libraries + jQuery('#libraries-display').hide(); + // set the ajax scope + ajaxcall = 'snippets'; + fromLocal = false; + if (_paths) { + setSnippets(_paths, libraryName); + jQuery('#snippets-github').html('

'+Joomla.JText._('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS')+'

'); + } else { + jQuery.get(path) + .success(function(paths) { + // load only this library paths + jQuery.jStorage.set('JCB-Snippets-Paths', paths, {TTL: expire}); + setSnippets(paths, libraryName); + }) + .error(function(jqXHR, textStatus, errorThrown) { + jQuery('#snippets-github').html(returnError); + }); + } + // only use if loading localy + if (fromLocal) { + jQuery('#snippets-display').show(); + jQuery('#snippets-grid').trigger('display.uk.check'); + jQuery('#loading').hide(); + } +} + +// set the snippets +function setSnippets(paths, libraryName) { + // set the ajax scope + ajaxcall = 'snippets'; + jQuery.each(paths.tree, function(key,value) { + if (value.path.match(".json$") && value.path.match("^"+libraryName)) { + var _snippet = jQuery.jStorage.get(value.path, null); + if (_snippet) { + setSnippet(_snippet, value.path); + fromLocal = true; + } else { + jQuery.get(snippetPath+value.path) + .success(function(snippet) { + // convert the string to json.object + snippet = jQuery.parseJSON(snippet); + jQuery.jStorage.set(value.path, snippet, {TTL: expire}); + setSnippet(snippet, value.path); + }) + .error(function(jqXHR, textStatus, errorThrown) { + // we could do more + }); + } + } + }); +} + +// set the snippets +function setSnippet(snippet, key) { + // get useful ID + var keyID = getKeyID(key); + // get the status + var status = getSnippetStatus(snippet, key); + // add to bulk updater + if ('equal' !== status) { + bulkItems[status].push(key); + } + // build the snippet display + var html = '
'; + html += '
'; + html += '
'; + html += '

' + snippet.library+ ' - (' + snippet.type + ') ' + snippet.name + '

'; + html += snippet.heading + '
'; + // set the data buttons + html += setDataButtons(snippet, key, status); + // set the snippet ref button + html += setRefButtons(snippet, key, status, keyID); + // set the contributor buttons + html += setContributorButtons(snippet, key); + // close the box panel + html += '
'; + html += '
'; + // now we have the snippet + jQuery('#snippets-grid').append(html); +} + +// set the snippet status +function getSnippetStatus(snippet, key) { + // check if JCB already has this snippet + if(local_snippets.hasOwnProperty(key)){ + // first get local time stamp + var local_created = strtotime(local_snippets[key].created); + var local_modified = strtotime(local_snippets[key].modified); + // now get github time stamps + var created = strtotime(snippet.created); + var modified = strtotime(snippet.modified); + // work out the status + if (local_created == created) { + if (local_modified == modified) { + return 'equal'; + } else if (local_modified > modified) { + return 'ahead'; + } else if (local_modified < modified) { + return 'behind'; + } + } + return 'diverged'; + } + return 'new'; +} + +function setDataButtons(snippet, key, status) { + var html = '
'; + html += ''; + html += ''; + html += ''; + html += '
'; + // return data buttons + return html; +} + +function setRefButtons(snippet, key, status, keyID) { + var html = '
' + snippet.name + '
'; + // set the update button + html += '
'; + if ('equal' !== status) { + if ('new' === status) { + var tooltip = Joomla.JText._('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY'); + } else { + var tooltip = Joomla.JText._('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION'); + } + html += ''; + } else { + html += ''; + } + html += '
'; + // return data buttons + return html; +} + +function setContributorButtons(snippet, key) { + // set the contributor name + if (snippet.contributor_company) { + var contributor_name = snippet.contributor_company; + } else if (snippet.contributor_name) { + var contributor_name = snippet.contributor_name; + } else { + var contributor_name = Joomla.JText._('COM_COMPONENTBUILDER_JCB_COMMUNITY'); + } + // set the contributor url + if (snippet.contributor_website) { + var contributor_url = snippet.contributor_website; + } else if (snippet.contributor_email) { + var contributor_url = 'mailto:'+snippet.contributor_email; + } else { + var contributor_url = 'https://github.com/vdm-io/Joomla-Component-Builder-Snippets'; + } + var html = '
'; + html += ''; + html += ' ' + contributor_name + ''; + html += ' '+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_BLAME')+''; + html += '
'; + // return contributor buttons + return html; +} + +// do a bulk update +function checkBulkSnippetGithub() { + // check if there is new items + if (bulkItems.new.length === 0) { + jQuery('#bulk-button-new').prop('disabled', true); + jQuery('#bulk-button-new').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME')); + jQuery('#bulk-notice-new').show(); + } + // check if there is diverged items + if (bulkItems.diverged.length === 0) { + jQuery('#bulk-button-diverged').prop('disabled', true); + jQuery('#bulk-button-diverged').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME')); + jQuery('#bulk-notice-diverged').show(); + } + // check if there is ahead items + if (bulkItems.ahead.length === 0) { + jQuery('#bulk-button-ahead').prop('disabled', true); + jQuery('#bulk-button-ahead').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME')); + jQuery('#bulk-notice-ahead').show(); + } + // check if there is behind items + if (bulkItems.behind.length === 0) { + jQuery('#bulk-button-behind').prop('disabled', true); + jQuery('#bulk-button-behind').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME')); + jQuery('#bulk-notice-behind').show(); + } + // check if all we should close the all button + if (bulkItems.behind.length === 0 && bulkItems.new.length === 0 && bulkItems.ahead.length === 0 && bulkItems.diverged.length === 0) { + jQuery('#bulk-button-all').prop('disabled', true); + jQuery('#bulk-button-all').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME')); + jQuery('#bulk-notice-all').show(); + } +} + +// do a bulk update +function bulkSnippetGithub(status) { + // if all then trigger those with values + if ('all' === status) { + bulkSnippetGithub('behind'); + bulkSnippetGithub('new'); + bulkSnippetGithub('ahead'); + bulkSnippetGithub('diverged'); + } else if (bulkItems[status].length > 0) { + jQuery.each(bulkItems[status], function(i, key){ + setTimeout(function(){ + doBulkUpdate_server(key, status).done(function(result) { + if (result.message) { + // only show errors + if ('error' === result.status || 'warning' === result.status) { + UIkit.notify(result.message, {status: result.status}); + } + // update local items + if ('success' === result.status) { + // get key ID + var keyID = getKeyID(key); + // update snippet if we can + updateSnippetDisplay(keyID, 'equal'); + } + } else { + UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED'), {status:'danger'}); + } + }); + }, 200); + }); + // reset array + bulkItems[status].length = 0; + // update the buttons (since we only do the bulk update once) + checkBulkSnippetGithub(); + } +} + +function doBulkUpdate_server(path, status) { + // set the ajax scope + ajaxcall = null; + var getUrl = "index.php?option=com_[[[component]]]&task=ajax.setSnippetGithub&format=json"; + if (token.length > 0 && path.length > 0 && status.length > 0) { + var request = 'token='+token+'&path='+path+'&status='+status; + } + return jQuery.ajax({ + type: 'POST', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); +} + +// set the snippet from gitHub +function setSnippetGithub(key, status) { + var message = getConfirmUpdate(status); + UIkit.modal.confirm(message, function(){ + // will be executed on confirm. + setSnippetGithub_server(key, status).done(function(result) { + if (result.message) { + UIkit.notify(result.message, {status: result.status}); + if ('success' === result.status) { + // get key ID + var keyID = getKeyID(key); + // update snippet if we can + updateSnippetDisplay(keyID, 'equal'); + } + } else { + UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED'), {status:'danger'}); + } + }); + }); +} + +function setSnippetGithub_server(path, status) { + // set the ajax scope + ajaxcall = null; + var getUrl = "index.php?option=com_[[[component]]]&task=ajax.setSnippetGithub&format=json"; + if (token.length > 0 && path.length > 0 && status.length > 0) { + var request = 'token='+token+'&path='+path+'&status='+status; + } + return jQuery.ajax({ + type: 'POST', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); +} + +// update the snippet display +function updateSnippetDisplay(keyID, status) { + // update badge + jQuery('#'+keyID+'-badge').html(' ' +status); + jQuery('#'+keyID+'-badge').attr('href' , '#'+status+'-meaning'); + // update button + if ('equal' === status) { + // update notice + jQuery('#'+keyID+'-getbutton').attr('title', Joomla.JText._('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION')); + jQuery('#'+keyID+'-getbutton').prop('disabled', true); + jQuery('#'+keyID+'-getbutton').html(' ' + Joomla.JText._('COM_COMPONENTBUILDER_LOCAL_SNIPPET')); + // counter delay just incase + setTimeout(function(){ + jQuery('#'+keyID+'-getbutton').prop('disabled', true); + }, 2000); + } + // update the data filter + jQuery('#'+keyID+'-panel').attr('data-uk-filter', status); + // tell the grid to update + jQuery('#snippets-grid').trigger('display.uk.check'); +} + +// set the modal +function getSnippetModal(key, type) { + // set the ajax scope + ajaxcall = 'snippets'; + var _snippet = jQuery.jStorage.get(key, null); + if (_snippet) { + // show modal + showSnippetModal(_snippet, type); + } else { + jQuery.get('https://raw.githubusercontent.com/vdm-io/Joomla-Component-Builder-Snippets/master/'+key) + .success(function(snippet) { + // convert the string to json.object + snippet = jQuery.parseJSON(snippet); + jQuery.jStorage.set(key, snippet, {TTL: expire}); + // show modal + showSnippetModal(snippet, type); + }) + .error(function(jqXHR, textStatus, errorThrown) { + // we could do more + }); + } +} + +// show the modal +function showSnippetModal(snippet, type) { + var html = '
'; + html += ''; + html += '

' + snippet.library + ' - (' + snippet.type + ') ' + snippet.name + '

'; + if ('contributor' === type) { + html += '
'; + html += '
'+Joomla.JText._('COM_COMPONENTBUILDER_COMPANY_NAME')+'
'; + html += '
'+snippet.contributor_company+'
'; + html += '
'+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_NAME')+'
'; + html += '
'+snippet.contributor_name+'
'; + html += '
'+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_EMAIL')+'
'; + html += '
'+snippet.contributor_email+'
'; + html += '
'+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_WEBSITE')+'
'; + html += '
'+snippet.contributor_website+'
'; + html += '
'; + } else { + html += '
'; + } + html += '
C: ' + snippet.created + ' | M: ' + snippet.modified + ''; + html += '
'; + // get current page position + var scroll = jQuery(window).scrollTop(); + // add html to modal + var modal = UIkit.modal.blockUI(html, {center:true, bgclose:true}).on({ + 'hide.uk.modal': function(){ + // scroll fix since the modal pops to the top of the page + jQuery(window).scrollTop(scroll); + } + }); + // show modal + modal.show(); +} + +// get key ID +function getKeyID(key) { + // get useful ID + var keyID = key.replace('-', ''); + keyID = keyID.replace('.json', ''); + keyID = keyID.replace(/\s+/ig, '-'); + keyID = keyID.replace(/\(/g, ''); + keyID = keyID.replace(/\)/g, ''); + // return the id build + return keyID; +} \ No newline at end of file diff --git a/admin/compiler/joomla_3/JControllerForm.php b/admin/compiler/joomla_3/JControllerForm.php index dd0e15a85..6c4a5e2db 100644 --- a/admin/compiler/joomla_3/JControllerForm.php +++ b/admin/compiler/joomla_3/JControllerForm.php @@ -105,10 +105,10 @@ class ###Component###Controller###View### extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -220,11 +220,11 @@ class ###Component###Controller###View### extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/compiler/joomla_3/JControllerForm_site.php b/admin/compiler/joomla_3/JControllerForm_site.php index 5ddd57d3b..8904ee4b5 100644 --- a/admin/compiler/joomla_3/JControllerForm_site.php +++ b/admin/compiler/joomla_3/JControllerForm_site.php @@ -102,13 +102,13 @@ class ###Component###Controller###View### extends JControllerForm $append = ''; if ($refid) - { + { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -220,11 +220,11 @@ class ###Component###Controller###View### extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/compiler/joomla_3/JControllerLegacy.php b/admin/compiler/joomla_3/JControllerLegacy.php index 38a10e588..a94d8357b 100644 --- a/admin/compiler/joomla_3/JControllerLegacy.php +++ b/admin/compiler/joomla_3/JControllerLegacy.php @@ -42,7 +42,7 @@ class ###Component###Controller extends JControllerLegacy * * @return void */ - function display($cachable = false, $urlparams = false) + function display($cachable = false, $urlparams = false) { // set default view if not set $view = $this->input->getCmd('view', '###Component###'); @@ -51,58 +51,58 @@ class ###Component###Controller extends JControllerLegacy $id = $this->input->getInt('id'); // Check for edit form. - if(###Component###Helper::checkArray($data)) - { - if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id)) - { - // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); - $this->setMessage($this->getError(), 'error'); - // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); - // set redirect - if ($refid > 0 && ###Component###Helper::checkString($ref)) - { - // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); - } - elseif (###Component###Helper::checkString($ref)) - { + if(###Component###Helper::checkArray($data)) + { + if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id)) + { + // Somehow the person just went to the form - we don't allow that. + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setMessage($this->getError(), 'error'); + // check if item was opend from other then its own list view + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); + // set redirect + if ($refid > 0 && ###Component###Helper::checkString($ref)) + { + // redirect to item of ref + $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + } + elseif (###Component###Helper::checkString($ref)) + { - // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); - } - else - { - // normal redirect back to the list view - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false)); - } + // redirect to ref + $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); + } + else + { + // normal redirect back to the list view + $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false)); + } - return false; - } - } + return false; + } + } return parent::display($cachable, $urlparams); } protected function getViewRelation($view) { - if (###Component###Helper::checkString($view)) - { - $views = array(###VIEWARRAY### - ); - // check if this is a list view - if (in_array($view,$views)) - { - return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view); - } - // check if it is an edit view - elseif (array_key_exists($view,$views)) - { - return array('edit' => true, 'view' => $view, 'views' => $views[$view]); - } - } + if (###Component###Helper::checkString($view)) + { + $views = array(###VIEWARRAY### + ); + // check if this is a list view + if (in_array($view,$views)) + { + return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view); + } + // check if it is an edit view + elseif (array_key_exists($view,$views)) + { + return array('edit' => true, 'view' => $view, 'views' => $views[$view]); + } + } return false; } } diff --git a/admin/compiler/joomla_3/JControllerLegacyAjax.php b/admin/compiler/joomla_3/JControllerLegacyAjax.php index 66bcedcc4..cd3a5f289 100644 --- a/admin/compiler/joomla_3/JControllerLegacyAjax.php +++ b/admin/compiler/joomla_3/JControllerLegacyAjax.php @@ -55,20 +55,20 @@ class ###Component###ControllerAjax extends JControllerLegacy $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); if($token == $call_token) - { + { $task = $this->getTask(); switch($task) - {###AJAX_INPUT_RETURN### + {###AJAX_INPUT_RETURN### } } - else - { + else + { if($callback = $jinput->get('callback', null, 'CMD')) - { + { echo $callback."(".json_encode(false).");"; } - else - { + else + { echo "(".json_encode(false).");"; } } diff --git a/admin/compiler/joomla_3/JControllerLegacyAjaxSite.php b/admin/compiler/joomla_3/JControllerLegacyAjaxSite.php index ddea7efad..93eafcfae 100644 --- a/admin/compiler/joomla_3/JControllerLegacyAjaxSite.php +++ b/admin/compiler/joomla_3/JControllerLegacyAjaxSite.php @@ -55,20 +55,20 @@ class ###Component###ControllerAjax extends JControllerLegacy $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); if($token == $call_token) - { + { $task = $this->getTask(); switch($task) - {###AJAX_SITE_INPUT_RETURN### + {###AJAX_SITE_INPUT_RETURN### } } - else - { + else + { if($callback = $jinput->get('callback', null, 'CMD')) - { + { echo $callback."(".json_encode(false).");"; } - else - { + else + { echo "(".json_encode(false).");"; } } diff --git a/admin/compiler/joomla_3/JControllerLegacyHelp.php b/admin/compiler/joomla_3/JControllerLegacyHelp.php index e529e76ea..45a7cda8f 100644 --- a/admin/compiler/joomla_3/JControllerLegacyHelp.php +++ b/admin/compiler/joomla_3/JControllerLegacyHelp.php @@ -51,7 +51,8 @@ class ###Component###ControllerHelp extends JControllerLegacy // Check Token! $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); - if($user->id != 0 && $token == $call_token){ + if($user->id != 0 && $token == $call_token) + { $task = $this->getTask(); switch($task){ case 'getText': @@ -67,25 +68,25 @@ class ###Component###ControllerHelp extends JControllerLegacy $result = ''; } echo $result; - // stop execution gracefully - jexit(); + // stop execution gracefully + jexit(); } - catch(Exception $e) + catch(Exception $e) { - // stop execution gracefully + // stop execution gracefully jexit(); } break; } } - else - { - // stop execution gracefully + else + { + // stop execution gracefully jexit(); } } - protected function getHelpDocumentText($id) + protected function getHelpDocumentText($id) { $db = JFactory::getDbo(); $query = $db->getQuery(true); diff --git a/admin/compiler/joomla_3/JControllerLegacyHelp_site.php b/admin/compiler/joomla_3/JControllerLegacyHelp_site.php index c3fa7208b..67ca284ab 100644 --- a/admin/compiler/joomla_3/JControllerLegacyHelp_site.php +++ b/admin/compiler/joomla_3/JControllerLegacyHelp_site.php @@ -51,7 +51,8 @@ class ###Component###ControllerHelp extends JControllerLegacy // Check Token! $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); - if($token == $call_token){ + if($token == $call_token) + { $task = $this->getTask(); switch($task){ case 'getText': @@ -67,25 +68,25 @@ class ###Component###ControllerHelp extends JControllerLegacy $result = ''; } echo $result; - // stop execution gracefully - jexit(); + // stop execution gracefully + jexit(); } catch(Exception $e) { - // stop execution gracefully + // stop execution gracefully jexit(); } break; } } - else - { - // stop execution gracefully + else + { + // stop execution gracefully jexit(); } } - protected function getHelpDocumentText($id) + protected function getHelpDocumentText($id) { $db = JFactory::getDbo(); $query = $db->getQuery(true); diff --git a/admin/compiler/joomla_3/JControllerLegacySITE.php b/admin/compiler/joomla_3/JControllerLegacySITE.php index 400aaf6c0..effb2a5a9 100644 --- a/admin/compiler/joomla_3/JControllerLegacySITE.php +++ b/admin/compiler/joomla_3/JControllerLegacySITE.php @@ -42,18 +42,18 @@ class ###Component###Controller extends JControllerLegacy * * @return void */ - function display($cachable = false, $urlparams = false) + function display($cachable = false, $urlparams = false) { // set default view if not set $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###'); $isEdit = $this->checkEditView($view); $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); + $id = $this->input->getInt('id'); $cachable = true; // Check for edit form. - if($isEdit) - { + if($isEdit) + { if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id)) { // Somehow the person just went to the form - we don't allow that. @@ -70,7 +70,6 @@ class ###Component###Controller extends JControllerLegacy } elseif (###Component###Helper::checkString($ref)) { - // redirect to ref $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); } @@ -81,23 +80,23 @@ class ###Component###Controller extends JControllerLegacy } return false; } - } + } return parent::display($cachable, $urlparams); } protected function checkEditView($view) { - if (###Component###Helper::checkString($view)) - { - $views = array(###SITE_EDIT_VIEW_ARRAY### - ); - // check if this is a edit view - if (in_array($view,$views)) - { - return true; - } - } + if (###Component###Helper::checkString($view)) + { + $views = array(###SITE_EDIT_VIEW_ARRAY### + ); + // check if this is a edit view + if (in_array($view,$views)) + { + return true; + } + } return false; } } diff --git a/admin/compiler/joomla_3/JControllerLegacy_custom_admin.php b/admin/compiler/joomla_3/JControllerLegacy_custom_admin.php index 4f892783e..396a6c0f3 100644 --- a/admin/compiler/joomla_3/JControllerLegacy_custom_admin.php +++ b/admin/compiler/joomla_3/JControllerLegacy_custom_admin.php @@ -42,7 +42,7 @@ class ###Component###Controller###SView### extends JControllerLegacy parent::__construct($config); } - public function dashboard() + public function dashboard() { $this->setRedirect(JRoute::_('index.php?option=com_###component###', false)); return; diff --git a/admin/compiler/joomla_3/JModelList_custom_admin.php b/admin/compiler/joomla_3/JModelList_custom_admin.php index df3d0241b..5a7c3571c 100644 --- a/admin/compiler/joomla_3/JModelList_custom_admin.php +++ b/admin/compiler/joomla_3/JModelList_custom_admin.php @@ -37,16 +37,16 @@ jimport('joomla.application.component.modellist'); */ class ###Component###Model###SViews### extends JModelList { - /** + /** * Model user data. * - * @var strings + * @var strings */ - protected $user; - protected $userId; - protected $guest; - protected $groups; - protected $levels; + protected $user; + protected $userId; + protected $guest; + protected $groups; + protected $levels; protected $app; protected $input; protected $uikitComp; @@ -58,14 +58,14 @@ class ###Component###Model###SViews### extends JModelList */ protected function getListQuery() { - // Get the current user for authorisation checks - $this->user = JFactory::getUser(); + // Get the current user for authorisation checks + $this->user = JFactory::getUser(); $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); - $this->groups = $this->user->get('groups'); - $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->levels = $this->user->getAuthorisedViewLevels(); - $this->app = JFactory::getApplication(); + $this->app = JFactory::getApplication(); $this->input = $this->app->input; $this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY### } @@ -77,16 +77,16 @@ class ###Component###Model###SViews### extends JModelList */ public function getItems() { - $user = JFactory::getUser(); - // check if this user has permission to access items - if (!$user->authorise('###sviews###.access', 'com_###component###')) - { + $user = JFactory::getUser(); + // check if this user has permission to access items + if (!$user->authorise('###sviews###.access', 'com_###component###')) + { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) $app->redirect('index.php?option=com_###component###'); return false; - }###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### + }###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### // load parent items $items = parent::getItems(); diff --git a/admin/compiler/joomla_3/JModelList_site.php b/admin/compiler/joomla_3/JModelList_site.php index 389be6d02..cc2abd418 100644 --- a/admin/compiler/joomla_3/JModelList_site.php +++ b/admin/compiler/joomla_3/JModelList_site.php @@ -59,13 +59,13 @@ class ###Component###Model###SViews### extends JModelList protected function getListQuery() { // Get the current user for authorisation checks - $this->user = JFactory::getUser(); + $this->user = JFactory::getUser(); $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); - $this->groups = $this->user->get('groups'); - $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->levels = $this->user->getAuthorisedViewLevels(); - $this->app = JFactory::getApplication(); + $this->app = JFactory::getApplication(); $this->input = $this->app->input; $this->initSet = true; ###SITE_GET_LIST_QUERY### } diff --git a/admin/compiler/joomla_3/JViewLegacy_custom_admin.php b/admin/compiler/joomla_3/JViewLegacy_custom_admin.php index a160e5cc2..e51ef6a0c 100644 --- a/admin/compiler/joomla_3/JViewLegacy_custom_admin.php +++ b/admin/compiler/joomla_3/JViewLegacy_custom_admin.php @@ -40,24 +40,24 @@ class ###Component###View###SView### extends JViewLegacy // Overwriting JView display method function display($tpl = null) { - // get component params + // get component params $this->params = JComponentHelper::getParams('com_###component###'); // get the application $this->app = JFactory::getApplication(); // get the user object $this->user = JFactory::getUser(); - // get global action permissions + // get global action permissions $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### - /** + /** * Prepares the document */ protected function setDocument() {###CUSTOM_ADMIN_LIBRARIES_LOADER### ###CUSTOM_ADMIN_DOCUMENT_METADATA### ###CUSTOM_ADMIN_UIKIT_LOADER### ###CUSTOM_ADMIN_GOOGLECHART_LOADER### ###CUSTOM_ADMIN_FOOTABLE_LOADER### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### - // add the document default css file + // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sview###.css');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### - } + } /** * Setting the toolbar @@ -78,26 +78,26 @@ class ###Component###View###SView### extends JViewLegacy } // add title to the page JToolbarHelper::title($title,'###ICOMOON###'); - // add the back button - // JToolBarHelper::custom('###sview###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false); - // add cpanel button + // add the back button + // JToolBarHelper::custom('###sview###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false); + // add cpanel button JToolBarHelper::custom('###sview###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($help_url)) - { + $help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (###Component###Helper::checkString($help_url)) + { JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); - } + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_###component###'); } }###CUSTOM_ADMIN_GET_MODULE### - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -106,8 +106,8 @@ class ###Component###View###SView### extends JViewLegacy */ public function escape($var) { - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ###Component###Helper::htmlEscape($var, $this->_charset); } } -?> \ No newline at end of file +?> diff --git a/admin/compiler/joomla_3/JViewLegacy_edit.php b/admin/compiler/joomla_3/JViewLegacy_edit.php index 77adae305..1ec6b6b92 100644 --- a/admin/compiler/joomla_3/JViewLegacy_edit.php +++ b/admin/compiler/joomla_3/JViewLegacy_edit.php @@ -56,15 +56,15 @@ class ###Component###View###View### extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - }###LINKEDVIEWITEMS### + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + }###LINKEDVIEWITEMS### // Set the toolbar $this->addToolBar(); @@ -91,7 +91,7 @@ class ###Component###View###View### extends JViewLegacy ###ADDTOOLBAR### } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -105,7 +105,7 @@ class ###Component###View###View### extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ###Component###Helper::htmlEscape($var, $this->_charset); } diff --git a/admin/compiler/joomla_3/JViewLegacy_edit_site.php b/admin/compiler/joomla_3/JViewLegacy_edit_site.php index 57fdca976..c5a70864a 100644 --- a/admin/compiler/joomla_3/JViewLegacy_edit_site.php +++ b/admin/compiler/joomla_3/JViewLegacy_edit_site.php @@ -48,7 +48,7 @@ class ###Component###View###View### extends JViewLegacy $this->item = $this->get('Item'); $this->script = $this->get('Script'); $this->state = $this->get('State'); - // get action permissions + // get action permissions $this->canDo = ###Component###Helper::getActions('###view###',$this->item); // get input $jinput = JFactory::getApplication()->input; @@ -56,15 +56,15 @@ class ###Component###View###View### extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - }###LINKEDVIEWITEMS### + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + }###LINKEDVIEWITEMS### // Set the toolbar $this->addToolBar(); @@ -95,7 +95,7 @@ class ###Component###View###View### extends JViewLegacy $this->toolbar = JToolbar::getInstance(); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -109,7 +109,7 @@ class ###Component###View###View### extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ###Component###Helper::htmlEscape($var, $this->_charset); } diff --git a/admin/compiler/joomla_3/JViewLegacy_import.php b/admin/compiler/joomla_3/JViewLegacy_import.php index 833072364..8510dc6ce 100644 --- a/admin/compiler/joomla_3/JViewLegacy_import.php +++ b/admin/compiler/joomla_3/JViewLegacy_import.php @@ -104,10 +104,10 @@ class ###Component###ViewImport extends JViewLegacy } // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('import'); - if (###Component###Helper::checkString($help_url)) - { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); - } + $help_url = ###Component###Helper::getHelpUrl('import'); + if (###Component###Helper::checkString($help_url)) + { + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + } } } diff --git a/admin/compiler/joomla_3/JViewLegacy_import_custom.php b/admin/compiler/joomla_3/JViewLegacy_import_custom.php index 69fb002b1..7207087fc 100644 --- a/admin/compiler/joomla_3/JViewLegacy_import_custom.php +++ b/admin/compiler/joomla_3/JViewLegacy_import_custom.php @@ -52,10 +52,10 @@ class ###Component###View###View### extends JViewLegacy } // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###view###'); - if (###Component###Helper::checkString($help_url)) - { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); - } + $help_url = ###Component###Helper::getHelpUrl('###view###'); + if (###Component###Helper::checkString($help_url)) + { + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + } } } diff --git a/admin/compiler/joomla_3/JViewLegacy_list.php b/admin/compiler/joomla_3/JViewLegacy_list.php index 5246cdbf0..9103cf8b6 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list.php +++ b/admin/compiler/joomla_3/JViewLegacy_list.php @@ -56,8 +56,7 @@ class ###Component###View###Views### extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO### // We don't need toolbar in the modal window. @@ -65,11 +64,11 @@ class ###Component###View###Views### extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -92,86 +91,86 @@ class ###Component###View###Views### extends JViewLegacy { JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###'); JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('###view###.add'); } - // Only load if there are items - if (###Component###Helper::checkArray($this->items)) + // Only load if there are items + if (###Component###Helper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('###view###.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('###view###.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('###views###.publish'); - JToolBarHelper::unpublishList('###views###.unpublish'); - JToolBarHelper::archiveList('###views###.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('###views###.publish'); + JToolBarHelper::unpublishList('###views###.unpublish'); + JToolBarHelper::archiveList('###views###.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('###views###.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('###views###.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - }###CUSTOM_ADMIN_DYNAMIC_BUTTONS### ###ADMIN_CUSTOM_BUTTONS_LIST### + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + }###CUSTOM_ADMIN_DYNAMIC_BUTTONS### ###ADMIN_CUSTOM_BUTTONS_LIST### - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('###views###.trash'); - }###EXPORTBUTTON### - }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST### ###IMPORTBUTTON### + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('###views###.trash'); + }###EXPORTBUTTON### + }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST### ###IMPORTBUTTON### - // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###views###'); - if (###Component###Helper::checkString($help_url)) - { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ###Component###Helper::getHelpUrl('###views###'); + if (###Component###Helper::checkString($help_url)) + { + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_###component###'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_###component###'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -183,11 +182,11 @@ class ###Component###View###Views### extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } ###CATEGORYFILTER### ###OTHERFILTERS### + }###CATEGORYFILTER### ###OTHERFILTERS### } /** @@ -205,7 +204,7 @@ class ###Component###View###Views### extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -216,10 +215,10 @@ class ###Component###View###Views### extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ###Component###Helper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ###Component###Helper::htmlEscape($var, $this->_charset); } @@ -231,5 +230,5 @@ class ###Component###View###Views### extends JViewLegacy protected function getSortFields() { ###SORTFIELDS### - } ###FILTERFUNCTIONS### + }###FILTERFUNCTIONS### } diff --git a/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php b/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php index 64bb5a5d5..10e12a0d9 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php +++ b/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php @@ -40,24 +40,24 @@ class ###Component###View###SViews### extends JViewLegacy // Overwriting JView display method function display($tpl = null) { - // get component params + // get component params $this->params = JComponentHelper::getParams('com_###component###'); // get the application $this->app = JFactory::getApplication(); // get the user object $this->user = JFactory::getUser(); - // get global action permissions + // get global action permissions $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### - /** + /** * Prepares the document */ protected function setDocument() {###CUSTOM_ADMIN_LIBRARIES_LOADER### ###CUSTOM_ADMIN_UIKIT_LOADER### ###CUSTOM_ADMIN_GOOGLECHART_LOADER### ###CUSTOM_ADMIN_FOOTABLE_LOADER### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### - // add the document default css file + // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sviews###.css');###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### - } + } /** * Setting the toolbar @@ -65,29 +65,29 @@ class ###Component###View###SViews### extends JViewLegacy protected function addToolBar() { // hide the main menu - $this->app->input->set('hidemainmenu', true); + $this->app->input->set('hidemainmenu', true); // add title to the page JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###'); - // add the back button - // JToolBarHelper::custom('###sviews###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false); - // add cpanel button + // add the back button + // JToolBarHelper::custom('###sviews###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false); + // add cpanel button JToolBarHelper::custom('###sviews###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found - $help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($help_url)) - { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); - } + $help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (###Component###Helper::checkString($help_url)) + { + JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_###component###'); } }###CUSTOM_ADMIN_GET_MODULE### - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -96,7 +96,7 @@ class ###Component###View###SViews### extends JViewLegacy */ public function escape($var) { - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ###Component###Helper::htmlEscape($var, $this->_charset); } } diff --git a/admin/compiler/joomla_3/JViewLegacy_list_site.php b/admin/compiler/joomla_3/JViewLegacy_list_site.php index 6369af260..7b7e038cc 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list_site.php +++ b/admin/compiler/joomla_3/JViewLegacy_list_site.php @@ -48,14 +48,14 @@ class ###Component###View###SViews### extends JViewLegacy $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD### }###SITE_EXTRA_DIPLAY_METHODS### - /** + /** * Prepares the document */ protected function _prepareDocument() {###SITE_LIBRARIES_LOADER### ###SITE_UIKIT_LOADER### ###SITE_GOOGLECHART_LOADER### ###SITE_FOOTABLE_LOADER### ###SITE_DOCUMENT_METADATA### ###SITE_DOCUMENT_CUSTOM_PHP### // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css');###SITE_DOCUMENT_CUSTOM_CSS### ###SITE_DOCUMENT_CUSTOM_JS### - } + } /** * Setting the toolbar @@ -75,7 +75,7 @@ class ###Component###View###SViews### extends JViewLegacy $this->toolbar = JToolbar::getInstance(); }###SITE_GET_MODULE### - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -84,7 +84,7 @@ class ###Component###View###SViews### extends JViewLegacy */ public function escape($var, $sorten = false, $length = 40) { - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length); } } diff --git a/admin/compiler/joomla_3/JViewLegacy_site.php b/admin/compiler/joomla_3/JViewLegacy_site.php index 3752acb8c..66c087eff 100644 --- a/admin/compiler/joomla_3/JViewLegacy_site.php +++ b/admin/compiler/joomla_3/JViewLegacy_site.php @@ -48,14 +48,14 @@ class ###Component###View###SView### extends JViewLegacy $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD### }###SITE_EXTRA_DIPLAY_METHODS### - /** + /** * Prepares the document */ protected function _prepareDocument() {###SITE_LIBRARIES_LOADER### ###SITE_UIKIT_LOADER### ###SITE_GOOGLECHART_LOADER### ###SITE_FOOTABLE_LOADER### ###SITE_DOCUMENT_METADATA### ###SITE_DOCUMENT_CUSTOM_PHP### // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css');###SITE_DOCUMENT_CUSTOM_CSS### ###SITE_DOCUMENT_CUSTOM_JS### - } + } /** * Setting the toolbar @@ -64,7 +64,7 @@ class ###Component###View###SView### extends JViewLegacy { // adding the joomla toolbar to the front JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php');###SITE_CUSTOM_BUTTONS### - + // set help url for this view if found $help_url = ###Component###Helper::getHelpUrl('###sview###'); if (###Component###Helper::checkString($help_url)) @@ -75,7 +75,7 @@ class ###Component###View###SView### extends JViewLegacy $this->toolbar = JToolbar::getInstance(); }###SITE_GET_MODULE### - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -84,7 +84,7 @@ class ###Component###View###SView### extends JViewLegacy */ public function escape($var, $sorten = false, $length = 40) { - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length); } } diff --git a/admin/compiler/joomla_3/settings.json b/admin/compiler/joomla_3/settings.json index 9e5cd8796..f9fcc2cf3 100644 --- a/admin/compiler/joomla_3/settings.json +++ b/admin/compiler/joomla_3/settings.json @@ -1,738 +1,748 @@ { - "create": { - "admin": { - "assets": { - "css": "css", - "images": { - "icons": "icons" - }, - "js": "js" - }, - "controllers": "controllers", - "helpers": { - "html": "html" - }, - "language": { - "en-GB": "en-GB" - }, - "layouts": "layouts", - "models": { - "fields": "fields", - "forms": "forms", - "rules": "rules" - }, - "sql": { - "updates": { - "mysql": "mysql" - } - }, - "tables": "tables", - "views": "views" - }, - "site": { - "assets": { - "css": "css", - "images": "images", - "js": "js" - }, - "controllers": "controllers", - "helpers": "helpers", - "language": { - "en-GB": "en-GB" - }, - "layouts": "layouts", - "models": "models", - "views": "views" - }, - "media": { - "css": "css", - "images": "images", - "js": "js" - } - }, - "move": { - "static": { - "access.xml": { - "naam":"access.xml", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "config.xml": { - "naam":"config.xml", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "JControllerLegacy.php": { - "naam":"JControllerLegacy.php", - "path": "c0mp0n3nt/admin", - "rename": "new", - "newName": "controller.php", - "type": "file" - }, - "component.xml": { - "naam":"component.xml", - "path": "c0mp0n3nt/", - "rename": "component", - "type": "file" - }, - "component_admin.php": { - "naam":"component_admin.php", - "path": "c0mp0n3nt/admin", - "rename": "component_admin", - "type": "file" - }, - "admin.css": { - "naam":"admin.css", - "path": "c0mp0n3nt/admin/assets/css", - "rename": false, - "type": "file" - }, - "admin.js": { - "naam":"admin.js", - "path": "c0mp0n3nt/admin/assets/js", - "rename": false, - "type": "file" - }, - "site.css": { - "naam":"site.css", - "path": "c0mp0n3nt/site/assets/css", - "rename": false, - "type": "file" - }, - "site.js": { - "naam":"site.js", - "path": "c0mp0n3nt/site/assets/js", - "rename": false, - "type": "file" - }, - "batch_.php": { - "naam":"batch_.php", - "path": "c0mp0n3nt/admin/helpers/html", - "rename": false, - "type": "file" - }, - "batchselection.php": { - "naam":"batchselection.php", - "path": "c0mp0n3nt/admin/layouts", - "rename": false, - "type": "file" - }, - "component_site.php": { - "naam":"component_site.php", - "path": "c0mp0n3nt/site", - "rename": "component_site", - "type": "file" - }, - "router.php": { - "naam":"router.php", - "path": "c0mp0n3nt/site", - "rename": false, - "type": "file" - }, - "routeHelper.php": { - "naam":"routeHelper.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "new", - "newName": "route.php", - "type": "file" - }, - "JControllerLegacySITE.php": { - "naam":"JControllerLegacySITE.php", - "path": "c0mp0n3nt/site", - "rename": "new", - "newName": "controller.php", - "type": "file" - }, - "Helper.php": { - "naam":"Helper.php", - "path": "c0mp0n3nt/admin/helpers", - "rename": "Helper", - "type": "file" - }, - "Helper_site.php": { - "naam":"Helper_site.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "Helper_site", - "type": "file" - }, - "Helper_category.php": { - "naam":"Helper_category.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "new", - "newName": "category.php", - "type": "file" - }, - "script.php": { - "naam":"script.php", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "install.mysql.utf8.sql": { - "naam":"install.mysql.utf8.sql", - "path": "c0mp0n3nt/admin/sql", - "rename": false, - "type": "file" - }, - "uninstall.mysql.utf8.sql": { - "naam":"uninstall.mysql.utf8.sql", - "path": "c0mp0n3nt/admin/sql", - "rename": false, - "type": "file" - }, - "headercheck_admin.php": { - "naam":"headercheck_admin.php", - "path": "c0mp0n3nt/admin/helpers", - "rename": "new", - "newName": "headercheck.php", - "type": "file" - }, - "LICENSE.txt": { - "naam":"LICENSE.txt", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "README.txt": { - "naam":"README.txt", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "README.md": { - "naam":"README.md", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "headercheck.php": { - "naam":"headercheck.php", - "path": "c0mp0n3nt/site/helpers", - "rename": false, - "type": "file" - } - }, - "dynamic": { - "admin": { - "vdm.php": { - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "encrypt" - }, - "Helper_email.php": { - "path": "c0mp0n3nt/admin/helpers", - "rename": "Helper_", - "type": "emailer" - }, - "DASHJControllerAdmin.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "DASHJControllerAdmin", - "type": "dashboard" - }, - "DASHJModelList.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "DASHJModelList", - "type": "dashboard" - }, - "DASHJViewLagacy.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "dashboard" - }, - "default_vdm.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "dashboard" - }, - "default_main.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "dashboard" - }, - "DASHdefault.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "dashboard" - }, - "dashboard.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": false, - "type": "dashboard" - }, - "module_forms.xml": { - "path": "c0mp0n3nt/admin/models/forms", - "rename": "module_forms", - "type": "single" - }, - "module_forms.js": { - "path": "c0mp0n3nt/admin/models/forms", - "rename": "module_forms", - "type": "single" - }, - "edit.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "single" - }, - "JModelAdmin.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "JModelAdmin", - "type": "single" - }, - "JControllerForm.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "JControllerForm", - "type": "single" - }, - "JTable.php": { - "path": "c0mp0n3nt/admin/tables", - "rename": "JTable", - "type": "single" - }, - "submitbutton.js": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": false, - "type": "single" - }, - "JViewLegacy_edit.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "view.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "view", - "type": "single" - }, - "JControllerAdmin.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "JControllerAdmin", - "type": "list" - }, - "JModelList.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "JModelList", - "type": "list" - }, - "views.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "views", - "type": "list" - }, - "JViewLegacy_list.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "default.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_batch_body.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_batch_footer.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_toolbar.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_head.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_body.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_foot.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "JFormRule.php": { - "path": "c0mp0n3nt/admin/models/rules", - "rename": "JFormRule", - "type": "rule" - }, - "layoutitems.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutitems", - "type": "layoutitems" - }, - "layoutfull.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutfull", - "type": "layoutfull" - }, - "layoutlinkedview.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutlinkedview", - "type": "layoutlinkedview" - }, - "layouttitle.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layouttitle", - "type": "layouttitle" - }, - "layoutpublished.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutpublished", - "type": "layoutpublished" - }, - "layoutmetadata.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutmetadata", - "type": "layoutmetadata" - }, - "JFormFieldList.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldList", - "type": "fieldlist" - }, - "JFormFieldRadio.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldRadio", - "type": "fieldradio" - }, - "JFormFieldCheckboxes.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldCheckboxes", - "type": "fieldcheckboxes" - }, - "JFormFieldUser.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldUser", - "type": "fielduser" - }, - "JControllerLegacyAjax.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "ajax.json.php", - "type": "ajax" - }, - "JModelListAjax.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "new", - "newName": "ajax.php", - "type": "ajax" - }, - "JControllerLegacy_import.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "import.php", - "type": "import" - }, - "JModelLegacy_import.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "new", - "newName": "import.php", - "type": "import" - }, - "JViewLegacy_import.php": { - "path": "c0mp0n3nt/admin/views/import", - "rename": "new", - "newName": "view.html.php", - "type": "import" - }, - "default_import.php": { - "path": "c0mp0n3nt/admin/views/import/tmpl", - "rename": "new", - "newName": "default.php", - "type": "import" - }, - "import.gif": { - "path": "c0mp0n3nt/admin/assets/images", - "rename": false, - "type": "import" - }, - "JControllerLegacy_import_custom.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "JControllerLegacy_import_custom", - "type": "customimport" - }, - "JModelLegacy_import_custom.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "JModelLegacy_import_custom", - "type": "customimport" - }, - "JViewLegacy_import_custom.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "customimport" - }, - "default_import_custom.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "customimport" - }, - "JControllerLegacyHelp.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "help.php", - "type": "help" - }, - "1.0.0.sql": { - "path": "c0mp0n3nt/admin/sql/updates/mysql", - "rename": "1.0.0", - "type": "sql_update" - }, - "update_server.xml": { - "path": "c0mp0n3nt/", - "rename": "update_server", - "type": "update_server" - } - }, - "site": { - "JViewLegacy_list_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "JModelList_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "JModelList_site", - "type": "list" - }, - "views_site.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "views_site", - "type": "list" - }, - "default_list_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "list" - }, - "JViewLegacy_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "view_site.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "view_site", - "type": "single" - }, - "JModelItem_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "JModelItem_site", - "type": "single" - }, - "default_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "single" - }, - "default_site_template.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "site_template", - "type": "template" - }, - "layout_site.php": { - "path": "c0mp0n3nt/site/layouts", - "rename": "layout_site", - "type": "layout" - }, - "layoutitems.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutitems", - "type": "layoutitems" - }, - "layoutfull.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutfull", - "type": "layoutfull" - }, - "layoutlinkedview.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutlinkedview", - "type": "layoutlinkedview" - }, - "layouttitle.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layouttitle", - "type": "layouttitle" - }, - "layoutpublished.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutpublished", - "type": "layoutpublished" - }, - "layoutmetadata.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutmetadata", - "type": "layoutmetadata" - }, - "default.xml": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": false, - "type": "menu" - }, - "module_forms.xml": { - "path": "c0mp0n3nt/site/models/forms", - "rename": "module_forms", - "type": "edit" - }, - "module_forms.js": { - "path": "c0mp0n3nt/site/models/forms", - "rename": "module_forms", - "type": "edit" - }, - "edit_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "edit.php", - "type": "edit" - }, - "JModelAdmin_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "JModelAdmin_site", - "type": "edit" - }, - "JControllerForm_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "JControllerForm_site", - "type": "edit" - }, - "submitbutton.js": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": false, - "type": "edit" - }, - "JViewLegacy_edit_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "edit" - }, - "view_site_edit.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "view_site_edit", - "type": "edit" - }, - "JControllerLegacyAjaxSite.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "new", - "newName": "ajax.json.php", - "type": "ajax" - }, - "JModelListAjaxSite.php": { - "path": "c0mp0n3nt/site/models", - "rename": "new", - "newName": "ajax.php", - "type": "ajax" - }, - "JControllerLegacyHelp_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "new", - "newName": "help.php", - "type": "help" - }, - "JControllerForm_custom_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "JControllerForm_custom_site", - "type": "custom_form" - }, - "submitbutton_site.js": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "submitbutton.js", - "type": "custom_form" - }, - "Helper_category_view.php": { - "path": "c0mp0n3nt/site/helpers", - "rename": "Helper_category_view", - "type": "category" - } - }, - "custom_admin": { - "JViewLegacy_list_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "JModelList_custom_admin.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "JModelList_custom_admin", - "type": "list" - }, - "default_list_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "list" - }, - "JControllerAdmin_custom_admin.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "JControllerAdmin_custom_admin", - "type": "list" - }, - "views_custom_admin.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "views_custom_admin", - "type": "list" - }, - "view_custom_admin.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "view_custom_admin", - "type": "single" - }, - "JViewLegacy_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "JModelItem_custom_admin.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "JModelItem_custom_admin", - "type": "single" - }, - "default_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "single" - }, - "JControllerLegacy_custom_admin.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "JControllerLegacy_custom_admin", - "type": "single" - }, - "default_custom_admin_template.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "custom_admin_template", - "type": "template" - }, - "layout_custom_admin.php": { - "path": "c0mp0n3nt/admin/layouts", - "rename": "layout_custom_admin", - "type": "layout" - } - } - } - } + "create": { + "admin": { + "assets": { + "css": "css", + "images": { + "icons": "icons" + }, + "js": "js" + }, + "controllers": "controllers", + "helpers": { + "html": "html" + }, + "language": { + "en-GB": "en-GB" + }, + "layouts": "layouts", + "models": { + "fields": "fields", + "forms": "forms", + "rules": "rules" + }, + "sql": { + "updates": { + "mysql": "mysql" + } + }, + "tables": "tables", + "views": "views" + }, + "site": { + "assets": { + "css": "css", + "images": "images", + "js": "js" + }, + "controllers": "controllers", + "helpers": "helpers", + "language": { + "en-GB": "en-GB" + }, + "layouts": "layouts", + "models": "models", + "views": "views" + }, + "media": { + "css": "css", + "images": "images", + "js": "js" + } + }, + "move": { + "static": { + "access.xml": { + "naam": "access.xml", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "config.xml": { + "naam": "config.xml", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "JControllerLegacy.php": { + "naam": "JControllerLegacy.php", + "path": "c0mp0n3nt/admin", + "rename": "new", + "newName": "controller.php", + "type": "file" + }, + "component.xml": { + "naam": "component.xml", + "path": "c0mp0n3nt/", + "rename": "component", + "type": "file" + }, + "component_admin.php": { + "naam": "component_admin.php", + "path": "c0mp0n3nt/admin", + "rename": "component_admin", + "type": "file" + }, + "admin.css": { + "naam": "admin.css", + "path": "c0mp0n3nt/admin/assets/css", + "rename": false, + "type": "file" + }, + "admin.js": { + "naam": "admin.js", + "path": "c0mp0n3nt/admin/assets/js", + "rename": false, + "type": "file" + }, + "site.css": { + "naam": "site.css", + "path": "c0mp0n3nt/site/assets/css", + "rename": false, + "type": "file" + }, + "site.js": { + "naam": "site.js", + "path": "c0mp0n3nt/site/assets/js", + "rename": false, + "type": "file" + }, + "batch_.php": { + "naam": "batch_.php", + "path": "c0mp0n3nt/admin/helpers/html", + "rename": false, + "type": "file" + }, + "batchselection.php": { + "naam": "batchselection.php", + "path": "c0mp0n3nt/admin/layouts", + "rename": false, + "type": "file" + }, + "component_site.php": { + "naam": "component_site.php", + "path": "c0mp0n3nt/site", + "rename": "component_site", + "type": "file" + }, + "router.php": { + "naam": "router.php", + "path": "c0mp0n3nt/site", + "rename": false, + "type": "file" + }, + "routeHelper.php": { + "naam": "routeHelper.php", + "path": "c0mp0n3nt/site/helpers", + "rename": "new", + "newName": "route.php", + "type": "file" + }, + "JControllerLegacySITE.php": { + "naam": "JControllerLegacySITE.php", + "path": "c0mp0n3nt/site", + "rename": "new", + "newName": "controller.php", + "type": "file" + }, + "Helper.php": { + "naam": "Helper.php", + "path": "c0mp0n3nt/admin/helpers", + "rename": "Helper", + "type": "file" + }, + "Helper_site.php": { + "naam": "Helper_site.php", + "path": "c0mp0n3nt/site/helpers", + "rename": "Helper_site", + "type": "file" + }, + "Helper_category.php": { + "naam": "Helper_category.php", + "path": "c0mp0n3nt/site/helpers", + "rename": "new", + "newName": "category.php", + "type": "file" + }, + "script.php": { + "naam": "script.php", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "install.mysql.utf8.sql": { + "naam": "install.mysql.utf8.sql", + "path": "c0mp0n3nt/admin/sql", + "rename": false, + "type": "file" + }, + "uninstall.mysql.utf8.sql": { + "naam": "uninstall.mysql.utf8.sql", + "path": "c0mp0n3nt/admin/sql", + "rename": false, + "type": "file" + }, + "headercheck_admin.php": { + "naam": "headercheck_admin.php", + "path": "c0mp0n3nt/admin/helpers", + "rename": "new", + "newName": "headercheck.php", + "type": "file" + }, + "LICENSE.txt": { + "naam": "LICENSE.txt", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "README.txt": { + "naam": "README.txt", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "README.md": { + "naam": "README.md", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "headercheck.php": { + "naam": "headercheck.php", + "path": "c0mp0n3nt/site/helpers", + "rename": false, + "type": "file" + } + }, + "dynamic": { + "admin": { + "vdm.php": { + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "encrypt" + }, + "Helper_email.php": { + "path": "c0mp0n3nt/admin/helpers", + "rename": "Helper_", + "type": "emailer" + }, + "DASHJControllerAdmin.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "DASHJControllerAdmin", + "type": "dashboard" + }, + "DASHJModelList.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "DASHJModelList", + "type": "dashboard" + }, + "DASHJViewLagacy.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "dashboard" + }, + "default_vdm.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "dashboard" + }, + "default_main.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "dashboard" + }, + "DASHdefault.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "dashboard" + }, + "dashboard.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": false, + "type": "dashboard" + }, + "module_forms.xml": { + "path": "c0mp0n3nt/admin/models/forms", + "rename": "module_forms", + "type": "single" + }, + "module_forms.js": { + "path": "c0mp0n3nt/admin/models/forms", + "rename": "module_forms", + "type": "single" + }, + "edit.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "single" + }, + "JModelAdmin.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelAdmin", + "type": "single" + }, + "JControllerForm.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerForm", + "type": "single" + }, + "JTable.php": { + "path": "c0mp0n3nt/admin/tables", + "rename": "JTable", + "type": "single" + }, + "submitbutton.js": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": false, + "type": "single" + }, + "JViewLegacy_edit.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "single" + }, + "view.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "view", + "type": "single" + }, + "JControllerAdmin.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerAdmin", + "type": "list" + }, + "JModelList.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelList", + "type": "list" + }, + "views.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "views", + "type": "list" + }, + "JViewLegacy_list.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "list" + }, + "default.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_batch_body.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_batch_footer.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_toolbar.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_head.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_body.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "default_foot.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": false, + "type": "list" + }, + "JFormRule.php": { + "path": "c0mp0n3nt/admin/models/rules", + "rename": "JFormRule", + "type": "rule" + }, + "layoutitems.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutitems", + "type": "layoutitems" + }, + "layoutfull.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutfull", + "type": "layoutfull" + }, + "layoutlinkedview.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutlinkedview", + "type": "layoutlinkedview" + }, + "layouttitle.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layouttitle", + "type": "layouttitle" + }, + "layoutpublished.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutpublished", + "type": "layoutpublished" + }, + "layoutmetadata.php": { + "path": "c0mp0n3nt/admin/layouts/VIEW", + "rename": "layoutmetadata", + "type": "layoutmetadata" + }, + "JFormFieldList.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldList", + "type": "fieldlist" + }, + "JFormFieldRadio.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldRadio", + "type": "fieldradio" + }, + "JFormFieldCheckboxes.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldCheckboxes", + "type": "fieldcheckboxes" + }, + "JFormFieldUser.php": { + "path": "c0mp0n3nt/admin/models/fields", + "rename": "JFormFieldUser", + "type": "fielduser" + }, + "JControllerLegacyAjax.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "new", + "newName": "ajax.json.php", + "type": "ajax" + }, + "JModelListAjax.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "new", + "newName": "ajax.php", + "type": "ajax" + }, + "JControllerLegacy_import.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "new", + "newName": "import.php", + "type": "import" + }, + "JModelLegacy_import.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "new", + "newName": "import.php", + "type": "import" + }, + "JViewLegacy_import.php": { + "path": "c0mp0n3nt/admin/views/import", + "rename": "new", + "newName": "view.html.php", + "type": "import" + }, + "default_import.php": { + "path": "c0mp0n3nt/admin/views/import/tmpl", + "rename": "new", + "newName": "default.php", + "type": "import" + }, + "import.gif": { + "path": "c0mp0n3nt/admin/assets/images", + "rename": false, + "type": "import" + }, + "JControllerLegacy_import_custom.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerLegacy_import_custom", + "type": "customimport" + }, + "JModelLegacy_import_custom.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelLegacy_import_custom", + "type": "customimport" + }, + "JViewLegacy_import_custom.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "customimport" + }, + "default_import_custom.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "customimport" + }, + "JControllerLegacyHelp.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "new", + "newName": "help.php", + "type": "help" + }, + "1.0.0.sql": { + "path": "c0mp0n3nt/admin/sql/updates/mysql", + "rename": "1.0.0", + "type": "sql_update" + }, + "update_server.xml": { + "path": "c0mp0n3nt/", + "rename": "update_server", + "type": "update_server" + } + }, + "site": { + "JViewLegacy_list_site.php": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "list" + }, + "JModelList_site.php": { + "path": "c0mp0n3nt/site/models", + "rename": "JModelList_site", + "type": "list" + }, + "views_site.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "views_site", + "type": "list" + }, + "default_list_site.php": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "JViewLegacy_site.php": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "single" + }, + "view_site.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "view_site", + "type": "single" + }, + "JModelItem_site.php": { + "path": "c0mp0n3nt/site/models", + "rename": "JModelItem_site", + "type": "single" + }, + "default_site.php": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "default_site_template.php": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": "site_template", + "type": "template" + }, + "layout_site.php": { + "path": "c0mp0n3nt/site/layouts", + "rename": "layout_site", + "type": "layout" + }, + "layoutitems.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutitems", + "type": "layoutitems" + }, + "layoutfull.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutfull", + "type": "layoutfull" + }, + "layoutlinkedview.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutlinkedview", + "type": "layoutlinkedview" + }, + "layouttitle.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layouttitle", + "type": "layouttitle" + }, + "layoutpublished.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutpublished", + "type": "layoutpublished" + }, + "layoutmetadata.php": { + "path": "c0mp0n3nt/site/layouts/VIEW", + "rename": "layoutmetadata", + "type": "layoutmetadata" + }, + "default.xml": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": false, + "type": "menu" + }, + "module_forms.xml": { + "path": "c0mp0n3nt/site/models/forms", + "rename": "module_forms", + "type": "edit" + }, + "module_forms.js": { + "path": "c0mp0n3nt/site/models/forms", + "rename": "module_forms", + "type": "edit" + }, + "edit_site.php": { + "path": "c0mp0n3nt/site/views/VIEW/tmpl", + "rename": "new", + "newName": "edit.php", + "type": "edit" + }, + "JModelAdmin_site.php": { + "path": "c0mp0n3nt/site/models", + "rename": "JModelAdmin_site", + "type": "edit" + }, + "JControllerForm_site.php": { + "path": "c0mp0n3nt/site/controllers", + "rename": "JControllerForm_site", + "type": "edit" + }, + "submitbutton.js": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": false, + "type": "edit" + }, + "JViewLegacy_edit_site.php": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "edit" + }, + "view_site_edit.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "view_site_edit", + "type": "edit" + }, + "JControllerLegacyAjaxSite.php": { + "path": "c0mp0n3nt/site/controllers", + "rename": "new", + "newName": "ajax.json.php", + "type": "ajax" + }, + "JModelListAjaxSite.php": { + "path": "c0mp0n3nt/site/models", + "rename": "new", + "newName": "ajax.php", + "type": "ajax" + }, + "JControllerLegacyHelp_site.php": { + "path": "c0mp0n3nt/site/controllers", + "rename": "new", + "newName": "help.php", + "type": "help" + }, + "JControllerForm_custom_site.php": { + "path": "c0mp0n3nt/site/controllers", + "rename": "JControllerForm_custom_site", + "type": "custom_form" + }, + "submitbutton_site.js": { + "path": "c0mp0n3nt/site/views/VIEW", + "rename": "new", + "newName": "submitbutton.js", + "type": "custom_form" + }, + "Helper_category_view.php": { + "path": "c0mp0n3nt/site/helpers", + "rename": "Helper_category_view", + "type": "category" + }, + "viewFileSite.js": { + "path": "c0mp0n3nt/site/assets/js", + "rename": "viewFileSite", + "type": "javascript_file" + } + }, + "custom_admin": { + "JViewLegacy_list_custom_admin.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "list" + }, + "JModelList_custom_admin.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelList_custom_admin", + "type": "list" + }, + "default_list_custom_admin.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "JControllerAdmin_custom_admin.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerAdmin_custom_admin", + "type": "list" + }, + "views_custom_admin.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "views_custom_admin", + "type": "list" + }, + "view_custom_admin.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "view_custom_admin", + "type": "single" + }, + "JViewLegacy_custom_admin.php": { + "path": "c0mp0n3nt/admin/views/VIEW", + "rename": "new", + "newName": "view.html.php", + "type": "single" + }, + "JModelItem_custom_admin.php": { + "path": "c0mp0n3nt/admin/models", + "rename": "JModelItem_custom_admin", + "type": "single" + }, + "default_custom_admin.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "JControllerLegacy_custom_admin.php": { + "path": "c0mp0n3nt/admin/controllers", + "rename": "JControllerLegacy_custom_admin", + "type": "single" + }, + "default_custom_admin_template.php": { + "path": "c0mp0n3nt/admin/views/VIEW/tmpl", + "rename": "custom_admin_template", + "type": "template" + }, + "layout_custom_admin.php": { + "path": "c0mp0n3nt/admin/layouts", + "rename": "layout_custom_admin", + "type": "layout" + }, + "viewFileCustomAdmin.js": { + "path": "c0mp0n3nt/admin/assets/js", + "rename": "viewFileCustomAdmin", + "type": "javascript_file" + } + } + } + } } \ No newline at end of file diff --git a/admin/compiler/joomla_3/viewFile.js b/admin/compiler/joomla_3/viewFile.js new file mode 100644 index 000000000..9c701e5be --- /dev/null +++ b/admin/compiler/joomla_3/viewFile.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###ADMINJS### \ No newline at end of file diff --git a/admin/compiler/joomla_3/viewFileCustomAdmin.js b/admin/compiler/joomla_3/viewFileCustomAdmin.js new file mode 100644 index 000000000..8abce3885 --- /dev/null +++ b/admin/compiler/joomla_3/viewFileCustomAdmin.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###CUSTOM_ADMIN_JAVASCRIPT_FILE### \ No newline at end of file diff --git a/admin/compiler/joomla_3/viewFileSite.js b/admin/compiler/joomla_3/viewFileSite.js new file mode 100644 index 000000000..12ed97db2 --- /dev/null +++ b/admin/compiler/joomla_3/viewFileSite.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###SITE_JAVASCRIPT_FILE### \ No newline at end of file diff --git a/admin/controller.php b/admin/controller.php index 9a52d777f..9561495ff 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -39,7 +39,7 @@ class ComponentbuilderController extends JControllerLegacy * * @return void */ - function display($cachable = false, $urlparams = false) + function display($cachable = false, $urlparams = false) { // set default view if not set $view = $this->input->getCmd('view', 'Componentbuilder'); @@ -48,46 +48,46 @@ class ComponentbuilderController extends JControllerLegacy $id = $this->input->getInt('id'); // Check for edit form. - if(ComponentbuilderHelper::checkArray($data)) - { - if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$data['view'], $id)) - { - // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); - $this->setMessage($this->getError(), 'error'); - // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); - // set redirect - if ($refid > 0 && ComponentbuilderHelper::checkString($ref)) - { - // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); - } - elseif (ComponentbuilderHelper::checkString($ref)) - { + if(ComponentbuilderHelper::checkArray($data)) + { + if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$data['view'], $id)) + { + // Somehow the person just went to the form - we don't allow that. + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setMessage($this->getError(), 'error'); + // check if item was opend from other then its own list view + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); + // set redirect + if ($refid > 0 && ComponentbuilderHelper::checkString($ref)) + { + // redirect to item of ref + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + } + elseif (ComponentbuilderHelper::checkString($ref)) + { - // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); - } - else - { - // normal redirect back to the list view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.$data['views'], false)); - } + // redirect to ref + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); + } + else + { + // normal redirect back to the list view + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.$data['views'], false)); + } - return false; - } - } + return false; + } + } return parent::display($cachable, $urlparams); } protected function getViewRelation($view) { - if (ComponentbuilderHelper::checkString($view)) - { - $views = array( + if (ComponentbuilderHelper::checkString($view)) + { + $views = array( 'joomla_component' => 'joomla_components', 'admin_view' => 'admin_views', 'custom_admin_view' => 'custom_admin_views', @@ -118,18 +118,18 @@ class ComponentbuilderController extends JControllerLegacy 'snippet_type' => 'snippet_types', 'library_config' => 'libraries_config', 'library_files_folders_urls' => 'libraries_files_folders_urls' - ); - // check if this is a list view - if (in_array($view,$views)) - { - return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view); - } - // check if it is an edit view - elseif (array_key_exists($view,$views)) - { - return array('edit' => true, 'view' => $view, 'views' => $views[$view]); - } - } + ); + // check if this is a list view + if (in_array($view,$views)) + { + return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view); + } + // check if it is an edit view + elseif (array_key_exists($view,$views)) + { + return array('edit' => true, 'view' => $view, 'views' => $views[$view]); + } + } return false; } } diff --git a/admin/controllers/admin_fields.php b/admin/controllers/admin_fields.php index 6f33ae718..101f3d29f 100644 --- a/admin/controllers/admin_fields.php +++ b/admin/controllers/admin_fields.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/admin_fields_conditions.php b/admin/controllers/admin_fields_conditions.php index ab95405b6..0b5f79099 100644 --- a/admin/controllers/admin_fields_conditions.php +++ b/admin/controllers/admin_fields_conditions.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/admin_view.php b/admin/controllers/admin_view.php index f239faef7..5610ef468 100644 --- a/admin/controllers/admin_view.php +++ b/admin/controllers/admin_view.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index f845eb1fc..93d127187 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -73,10 +73,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); if($token == $call_token) - { + { $task = $this->getTask(); switch($task) - { + { case 'isNew': try { @@ -887,14 +887,14 @@ class ComponentbuilderControllerAjax extends JControllerLegacy break; } } - else - { + else + { if($callback = $jinput->get('callback', null, 'CMD')) - { + { echo $callback."(".json_encode(false).");"; } - else - { + else + { echo "(".json_encode(false).");"; } } diff --git a/admin/controllers/component_admin_views.php b/admin/controllers/component_admin_views.php index 1bbfd1896..f74ca9b70 100644 --- a/admin/controllers/component_admin_views.php +++ b/admin/controllers/component_admin_views.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/component_config.php b/admin/controllers/component_config.php index 9f16fa549..04d1f5220 100644 --- a/admin/controllers/component_config.php +++ b/admin/controllers/component_config.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_config extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_config extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/component_custom_admin_menus.php b/admin/controllers/component_custom_admin_menus.php index 965907a9c..0c3cc89f0 100644 --- a/admin/controllers/component_custom_admin_menus.php +++ b/admin/controllers/component_custom_admin_menus.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/component_custom_admin_views.php b/admin/controllers/component_custom_admin_views.php index 88295e292..bcbf2b6a2 100644 --- a/admin/controllers/component_custom_admin_views.php +++ b/admin/controllers/component_custom_admin_views.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/component_dashboard.php b/admin/controllers/component_dashboard.php index 412f1f7b9..f4c411364 100644 --- a/admin/controllers/component_dashboard.php +++ b/admin/controllers/component_dashboard.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/component_files_folders.php b/admin/controllers/component_files_folders.php index 8e7133f2f..65dcb8a0f 100644 --- a/admin/controllers/component_files_folders.php +++ b/admin/controllers/component_files_folders.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/component_mysql_tweaks.php b/admin/controllers/component_mysql_tweaks.php index 3a08647de..bdebea6a8 100644 --- a/admin/controllers/component_mysql_tweaks.php +++ b/admin/controllers/component_mysql_tweaks.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/component_site_views.php b/admin/controllers/component_site_views.php index 85e873758..366d3fdfe 100644 --- a/admin/controllers/component_site_views.php +++ b/admin/controllers/component_site_views.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/component_updates.php b/admin/controllers/component_updates.php index 4d6b6b639..670ccbfe5 100644 --- a/admin/controllers/component_updates.php +++ b/admin/controllers/component_updates.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/custom_admin_view.php b/admin/controllers/custom_admin_view.php index 1bbad600b..c2cf7b824 100644 --- a/admin/controllers/custom_admin_view.php +++ b/admin/controllers/custom_admin_view.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/custom_code.php b/admin/controllers/custom_code.php index 55628f4a0..a5c799a7e 100644 --- a/admin/controllers/custom_code.php +++ b/admin/controllers/custom_code.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerCustom_code extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerCustom_code extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/dynamic_get.php b/admin/controllers/dynamic_get.php index ebfb0cd27..b2db5bcaa 100644 --- a/admin/controllers/dynamic_get.php +++ b/admin/controllers/dynamic_get.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/field.php b/admin/controllers/field.php index a1598f1ad..dbe21b334 100644 --- a/admin/controllers/field.php +++ b/admin/controllers/field.php @@ -158,10 +158,10 @@ class ComponentbuilderControllerField extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -273,11 +273,11 @@ class ComponentbuilderControllerField extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/fieldtype.php b/admin/controllers/fieldtype.php index 681378c18..9c2e006b0 100644 --- a/admin/controllers/fieldtype.php +++ b/admin/controllers/fieldtype.php @@ -158,10 +158,10 @@ class ComponentbuilderControllerFieldtype extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -273,11 +273,11 @@ class ComponentbuilderControllerFieldtype extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/ftp.php b/admin/controllers/ftp.php index 3e10d8c4f..9338475c1 100644 --- a/admin/controllers/ftp.php +++ b/admin/controllers/ftp.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerFtp extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerFtp extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/help.php b/admin/controllers/help.php index 941039bfa..0c58c6c71 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -48,7 +48,8 @@ class ComponentbuilderControllerHelp extends JControllerLegacy // Check Token! $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); - if($user->id != 0 && $token == $call_token){ + if($user->id != 0 && $token == $call_token) + { $task = $this->getTask(); switch($task){ case 'getText': @@ -64,25 +65,25 @@ class ComponentbuilderControllerHelp extends JControllerLegacy $result = ''; } echo $result; - // stop execution gracefully - jexit(); + // stop execution gracefully + jexit(); } - catch(Exception $e) + catch(Exception $e) { - // stop execution gracefully + // stop execution gracefully jexit(); } break; } } - else - { - // stop execution gracefully + else + { + // stop execution gracefully jexit(); } } - protected function getHelpDocumentText($id) + protected function getHelpDocumentText($id) { $db = JFactory::getDbo(); $query = $db->getQuery(true); diff --git a/admin/controllers/help_document.php b/admin/controllers/help_document.php index 07c70203b..1ddd4b3f6 100644 --- a/admin/controllers/help_document.php +++ b/admin/controllers/help_document.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerHelp_document extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerHelp_document extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/joomla_component.php b/admin/controllers/joomla_component.php index 9eff11704..d5d5330aa 100644 --- a/admin/controllers/joomla_component.php +++ b/admin/controllers/joomla_component.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/language.php b/admin/controllers/language.php index 3e041d5d8..ef979f490 100644 --- a/admin/controllers/language.php +++ b/admin/controllers/language.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerLanguage extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerLanguage extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/language_translation.php b/admin/controllers/language_translation.php index a7655d467..1876d674b 100644 --- a/admin/controllers/language_translation.php +++ b/admin/controllers/language_translation.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerLanguage_translation extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerLanguage_translation extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/layout.php b/admin/controllers/layout.php index db252606c..2cefa3187 100644 --- a/admin/controllers/layout.php +++ b/admin/controllers/layout.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerLayout extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerLayout extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/library.php b/admin/controllers/library.php index e45db5475..5fb2fe38e 100644 --- a/admin/controllers/library.php +++ b/admin/controllers/library.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerLibrary extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerLibrary extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/library_config.php b/admin/controllers/library_config.php index 2edb5eec0..04712651c 100644 --- a/admin/controllers/library_config.php +++ b/admin/controllers/library_config.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerLibrary_config extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerLibrary_config extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/library_files_folders_urls.php b/admin/controllers/library_files_folders_urls.php index b6061cfce..eda3af15b 100644 --- a/admin/controllers/library_files_folders_urls.php +++ b/admin/controllers/library_files_folders_urls.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends JControllerFo { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends JControllerFo $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/site_view.php b/admin/controllers/site_view.php index f53fe1ce3..a168419a5 100644 --- a/admin/controllers/site_view.php +++ b/admin/controllers/site_view.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerSite_view extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerSite_view extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/snippet.php b/admin/controllers/snippet.php index 382b493c4..0e86fedd5 100644 --- a/admin/controllers/snippet.php +++ b/admin/controllers/snippet.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerSnippet extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerSnippet extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/snippet_type.php b/admin/controllers/snippet_type.php index 3d6613c96..dae5d897c 100644 --- a/admin/controllers/snippet_type.php +++ b/admin/controllers/snippet_type.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerSnippet_type extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerSnippet_type extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/controllers/template.php b/admin/controllers/template.php index 01e7d39cf..e5ba4cc48 100644 --- a/admin/controllers/template.php +++ b/admin/controllers/template.php @@ -159,10 +159,10 @@ class ComponentbuilderControllerTemplate extends JControllerForm { $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; } - elseif ($ref) - { + elseif ($ref) + { $append .= '&ref='.(string)$ref; - } + } if ($tmpl) { @@ -274,11 +274,11 @@ class ComponentbuilderControllerTemplate extends JControllerForm $this->ref = $this->input->get('ref', 0, 'word'); $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) - { - // to make sure the item is checkedin on redirect - $this->task = 'save'; - } + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } $saved = parent::save($key, $urlVar); diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index e000b987a..32ebd78fa 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -1,27 +1,28 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| + /-------------------------------------------------------------------------------------------------------------------------------/ + + @version 2.6.x + @created 30th April, 2015 + @package Component Builder + @subpackage compiler.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + + /----------------------------------------------------------------------------------------------------------------------------- */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); @@ -39,8 +40,9 @@ class Compiler extends Infusion * * @var string */ + private $tempPath; - + /* * The timer * @@ -48,19 +50,18 @@ class Compiler extends Infusion */ private $time_start; private $time_end; - public $secondsCompiled; - - public $filepath = ''; + public $secondsCompiled; + public $filepath = ''; // fixed pathes - protected $dynamicIntegration = false; - protected $backupPath = false; - protected $repoPath = false; - protected $addCustomCodeAt = array(); + protected $dynamicIntegration = false; + protected $backupPath = false; + protected $repoPath = false; + protected $addCustomCodeAt = array(); /** * Constructor */ - public function __construct($config = array ()) + public function __construct($config = array()) { // to check the compiler speed $this->time_start = microtime(true); @@ -68,17 +69,17 @@ class Compiler extends Infusion if (parent::__construct($config)) { // set temp directory - $comConfig = JFactory::getConfig(); - $this->tempPath = $comConfig->get('tmp_path'); + $comConfig = JFactory::getConfig(); + $this->tempPath = $comConfig->get('tmp_path'); // set some folder paths in relation to distribution if ($config['addBackup']) { - $this->backupPath = $this->params->get('backup_folder_path', $this->tempPath).'/'.$this->componentBackupName.'.zip'; - $this->dynamicIntegration = true; + $this->backupPath = $this->params->get('backup_folder_path', $this->tempPath) . '/' . $this->componentBackupName . '.zip'; + $this->dynamicIntegration = true; } if ($config['addRepo']) { - $this->repoPath = $this->params->get('git_folder_path', null); + $this->repoPath = $this->params->get('git_folder_path', null); } // remove site folder if not needed (TODO add check if custom script was moved to site folder then we must do a more complex cleanup here) if ($this->removeSiteFolder) @@ -86,12 +87,12 @@ class Compiler extends Infusion // first remove the files and folders $this->removeFolder($this->componentPath . '/site'); // clear form component xml - $xmlPath = $this->componentPath . '/'. $this->fileContentStatic['###component###']. '.xml'; + $xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml'; $componentXML = ComponentbuilderHelper::getFileContents($xmlPath); - $textToSite = ComponentbuilderHelper::getBetween($componentXML,'',''); - $textToSiteLang = ComponentbuilderHelper::getBetween($componentXML,'',''); - $componentXML = str_replace(array(''.$textToSite."", ''.$textToSiteLang.""), array('',''), $componentXML); - $this->writeFile($xmlPath,$componentXML); + $textToSite = ComponentbuilderHelper::getBetween($componentXML, '', ''); + $textToSiteLang = ComponentbuilderHelper::getBetween($componentXML, '', ''); + $componentXML = str_replace(array('' . $textToSite . "", '' . $textToSiteLang . ""), array('', ''), $componentXML); + $this->writeFile($xmlPath, $componentXML); } // now update the files if (!$this->updateFiles()) @@ -100,7 +101,7 @@ class Compiler extends Infusion } // now insert into the new files if ($this->getCustomCode()) - { + { $this->addCustomCode(); } // set the lang data now @@ -112,11 +113,9 @@ class Compiler extends Infusion { foreach ($this->langNot as $tag => $percentage) { - $this->app->enqueueMessage(JText::sprintf('The %s language has %s% translated, you will need to translate %s% of the language strings before it will be added.', - $tag, $percentage, $this->percentageLanguageAdd), 'Warning'); + $this->app->enqueueMessage(JText::sprintf('The %s language has %s% translated, you will need to translate %s% of the language strings before it will be added.', $tag, $percentage, $this->percentageLanguageAdd), 'Warning'); } - $this->app->enqueueMessage(JText::sprintf('You can change this percentage of translated strings required in the global options of JCB.
Please watch this tutorial for more help surrounding the JCB translations manager.', - '"https://youtu.be/zzAcVkn_cWU?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE" target="_blank" title="JCB Tutorial surrounding Translation Manager"'), 'Notice'); + $this->app->enqueueMessage(JText::sprintf('You can change this percentage of translated strings required in the global options of JCB.
Please watch this tutorial for more help surrounding the JCB translations manager.', '"https://youtu.be/zzAcVkn_cWU?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE" target="_blank" title="JCB Tutorial surrounding Translation Manager"'), 'Notice'); } // set why the strings were added $whyAddedLang = JText::sprintf('because more then %s% of the strings have been translated.', $this->percentageLanguageAdd); @@ -129,8 +128,7 @@ class Compiler extends Infusion { foreach ($this->langSet as $tag => $percentage) { - $this->app->enqueueMessage(JText::sprintf('The %s language has %s% translated. Was addeded %s', - $tag, $percentage, $whyAddedLang), 'Notice'); + $this->app->enqueueMessage(JText::sprintf('The %s language has %s% translated. Was addeded %s', $tag, $percentage, $whyAddedLang), 'Notice'); } } } @@ -158,7 +156,7 @@ class Compiler extends Infusion $mismatch = array_unique($this->langMismatch); } // set a notice if we have a mismatch - if (ComponentbuilderHelper::checkArray($mismatch)) + if (isset($mismatch) && ComponentbuilderHelper::checkArray($mismatch)) { if (count($mismatch) > 1) { @@ -171,9 +169,8 @@ class Compiler extends Infusion // add the mismatching issues foreach ($mismatch as $string) { - $constant = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($string,'U'); - $this->app->enqueueMessage(JText::sprintf('The Joomla.JText._(\'%s\') language constant for (%s) does not have a corresponding JText::Script() decalaration.', - $constant, $string), 'Warning'); + $constant = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U'); + $this->app->enqueueMessage(JText::sprintf('The Joomla.JText._(\'%s\') language constant for (%s) does not have a corresponding JText::Script() decalaration.', $constant, $string), 'Warning'); } $this->app->enqueueMessage('
', 'Warning'); } @@ -186,7 +183,7 @@ class Compiler extends Infusion } return false; } - + /** * Set the line number in comments * @@ -199,11 +196,11 @@ class Compiler extends Infusion { if ($this->debugLinenr) { - return ' [Compiler '.$nr.']'; + return ' [Compiler ' . $nr . ']'; } return ''; } - + /** * Set the dynamic data to the created fils * @@ -223,26 +220,26 @@ class Compiler extends Infusion { $this->fileContentStatic['###FILENAME###'] = $static['name']; $php = ''; - if (ComponentbuilderHelper::checkFileType($static['name'],'php')) + if (ComponentbuilderHelper::checkFileType($static['name'], 'php')) { $php = "setPlaceholders($string, $this->fileContentStatic, 3); // add to zip array - $this->writeFile($static['path'],$answer); + $this->writeFile($static['path'], $answer); } else { $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); // add to zip array - $this->writeFile($static['path'],$answer); + $this->writeFile($static['path'], $answer); } - $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL ); + $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL); } } // now we do the dynamic files @@ -260,28 +257,28 @@ class Compiler extends Infusion // do some weird stuff to improve the verion and dates being added to the license $this->fixLicenseValues($file); $php = ''; - if (ComponentbuilderHelper::checkFileType($file['name'],'php')) + if (ComponentbuilderHelper::checkFileType($file['name'], 'php')) { $php = "setPlaceholders($string, $this->fileContentStatic, 3); $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); // add to zip array - $this->writeFile($file['path'],$answer); + $this->writeFile($file['path'], $answer); } else { $answer = $this->setPlaceholders($string, $this->fileContentStatic, 3); $answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3); // add to zip array - $this->writeFile($file['path'],$answer); + $this->writeFile($file['path'], $answer); } - $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL ); + $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL); } } } @@ -295,7 +292,7 @@ class Compiler extends Infusion } return false; } - + /** * move the local update server xml file to a remote ftp server * @@ -307,7 +304,7 @@ class Compiler extends Infusion // move the update server to host if ($this->componentData->add_update_server == 1 && $this->componentData->update_server_target == 1 && isset($this->updateServerFileName) && $this->dynamicIntegration) { - $xml_update_server_path = $this->componentPath.'/'.$this->updateServerFileName.'.xml'; + $xml_update_server_path = $this->componentPath . '/' . $this->updateServerFileName . '.xml'; // make sure we have the correct file if (JFile::exists($xml_update_server_path) && isset($this->componentData->update_server_ftp)) { @@ -321,7 +318,7 @@ class Compiler extends Infusion $this->componentData->update_server_ftp = rtrim($basic->decryptString($this->componentData->update_server_ftp), "\0"); } // now move the file - $this->moveFileToFtpServer($xml_update_server_path,$this->componentData->update_server_ftp); + $this->moveFileToFtpServer($xml_update_server_path, $this->componentData->update_server_ftp); } } } @@ -345,7 +342,7 @@ class Compiler extends Infusion } else { - $value = '@update number '.$value.' of this MVC'; + $value = '@update number ' . $value . ' of this MVC'; } } $this->fileContentStatic[$key] = $value; @@ -362,34 +359,34 @@ class Compiler extends Infusion protected function setCountingStuff() { // what is the size in terms of an A4 book - $this->pageCount = round($this->lineCount / 56); + $this->pageCount = round($this->lineCount / 56); // setup the unrealistic numbers - $this->folderSeconds = $this->folderCount * 5; - $this->fileSeconds = $this->fileCount * 5; - $this->lineSeconds = $this->lineCount * 10; - $this->seconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds; - $this->totalHours = round($this->seconds / 3600); - $this->totalDays = round($this->totalHours / 8); + $this->folderSeconds = $this->folderCount * 5; + $this->fileSeconds = $this->fileCount * 5; + $this->lineSeconds = $this->lineCount * 10; + $this->seconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds; + $this->totalHours = round($this->seconds / 3600); + $this->totalDays = round($this->totalHours / 8); // setup the more realistic numbers - $this->secondsDebugging = $this->seconds / 4; - $this->secondsPlanning = $this->seconds / 7; - $this->secondsMapping = $this->seconds / 10; - $this->secondsOffice = $this->seconds / 6; - $this->actualSeconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds + $this->secondsDebugging + $this->secondsPlanning + $this->secondsMapping + $this->secondsOffice; - $this->actualTotalHours = round($this->actualSeconds / 3600); - $this->actualTotalDays = round($this->actualTotalHours / 8); - $this->debuggingHours = round($this->secondsDebugging / 3600); - $this->planningHours = round($this->secondsPlanning / 3600); - $this->mappingHours = round($this->secondsMapping / 3600); - $this->officeHours = round($this->secondsOffice / 3600); + $this->secondsDebugging = $this->seconds / 4; + $this->secondsPlanning = $this->seconds / 7; + $this->secondsMapping = $this->seconds / 10; + $this->secondsOffice = $this->seconds / 6; + $this->actualSeconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds + $this->secondsDebugging + $this->secondsPlanning + $this->secondsMapping + $this->secondsOffice; + $this->actualTotalHours = round($this->actualSeconds / 3600); + $this->actualTotalDays = round($this->actualTotalHours / 8); + $this->debuggingHours = round($this->secondsDebugging / 3600); + $this->planningHours = round($this->secondsPlanning / 3600); + $this->mappingHours = round($this->secondsMapping / 3600); + $this->officeHours = round($this->secondsOffice / 3600); // the actual time spent - $this->actualHoursSpent = $this->actualTotalHours - $this->totalHours; - $this->actualDaysSpent = $this->actualTotalDays - $this->totalDays; + $this->actualHoursSpent = $this->actualTotalHours - $this->totalHours; + $this->actualDaysSpent = $this->actualTotalDays - $this->totalDays; // calculate the projects actual time frame of completion - $this->projectWeekTime = round($this->actualTotalDays / 5,1); - $this->projectMonthTime = round($this->actualTotalDays / 24,1); + $this->projectWeekTime = round($this->actualTotalDays / 5, 1); + $this->projectMonthTime = round($this->actualTotalDays / 24, 1); } - + private function buildReadMe() { // do a final run to update the readme file @@ -408,7 +405,7 @@ class Compiler extends Infusion } unset($this->newFiles['static']); } - + private function setReadMe($path) { // set readme data if not set already @@ -421,45 +418,45 @@ class Compiler extends Infusion // update the file $answer = $this->setPlaceholders($string, $this->fileContentStatic); // add to zip array - $this->writeFile($path,$answer); - } - + $this->writeFile($path, $answer); + } + private function buildReadMeData() { // set some defaults - $this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount; - $this->fileContentStatic['###FIELD_COUNT###'] = $this->fieldCount; - $this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount; - $this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount; - $this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount; - $this->fileContentStatic['###folders###'] = $this->folderSeconds; - $this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds; - $this->fileContentStatic['###files###'] = $this->fileSeconds; - $this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds; - $this->fileContentStatic['###lines###'] = $this->lineSeconds; - $this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds; - $this->fileContentStatic['###seconds###'] = $this->actualSeconds; - $this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds; - $this->fileContentStatic['###totalHours###'] = $this->totalHours; - $this->fileContentStatic['###totalDays###'] = $this->totalDays; - $this->fileContentStatic['###debugging###'] = $this->secondsDebugging; - $this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging; - $this->fileContentStatic['###planning###'] = $this->secondsPlanning; - $this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning; - $this->fileContentStatic['###mapping###'] = $this->secondsMapping; - $this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping; - $this->fileContentStatic['###office###'] = $this->secondsOffice; - $this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice; - $this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours; - $this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays; - $this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours; - $this->fileContentStatic['###planningHours###'] = $this->planningHours; - $this->fileContentStatic['###mappingHours###'] = $this->mappingHours; - $this->fileContentStatic['###officeHours###'] = $this->officeHours; - $this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent; - $this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent; - $this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime; - $this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime; + $this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount; + $this->fileContentStatic['###FIELD_COUNT###'] = $this->fieldCount; + $this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount; + $this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount; + $this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount; + $this->fileContentStatic['###folders###'] = $this->folderSeconds; + $this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds; + $this->fileContentStatic['###files###'] = $this->fileSeconds; + $this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds; + $this->fileContentStatic['###lines###'] = $this->lineSeconds; + $this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds; + $this->fileContentStatic['###seconds###'] = $this->actualSeconds; + $this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds; + $this->fileContentStatic['###totalHours###'] = $this->totalHours; + $this->fileContentStatic['###totalDays###'] = $this->totalDays; + $this->fileContentStatic['###debugging###'] = $this->secondsDebugging; + $this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging; + $this->fileContentStatic['###planning###'] = $this->secondsPlanning; + $this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning; + $this->fileContentStatic['###mapping###'] = $this->secondsMapping; + $this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping; + $this->fileContentStatic['###office###'] = $this->secondsOffice; + $this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice; + $this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours; + $this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays; + $this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours; + $this->fileContentStatic['###planningHours###'] = $this->planningHours; + $this->fileContentStatic['###mappingHours###'] = $this->mappingHours; + $this->fileContentStatic['###officeHours###'] = $this->officeHours; + $this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent; + $this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent; + $this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime; + $this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime; } private function zipComponent() @@ -468,15 +465,15 @@ class Compiler extends Infusion if (ComponentbuilderHelper::checkString($this->repoPath)) { // set the repo path - $repoFullPath = $this->repoPath.'/com_'.$this->componentData->sales_name.'__joomla_'.$this->joomlaVersion; + $repoFullPath = $this->repoPath . '/com_' . $this->componentData->sales_name . '__joomla_' . $this->joomlaVersion; // remove old data $this->removeFolder($repoFullPath, $this->componentData->toignore); // set the new data JFolder::copy($this->componentPath, $repoFullPath, '', true); } // the name of the zip file to create - $this->filepath = $this->tempPath.'/'.$this->componentFolderName.'.zip'; - + $this->filepath = $this->tempPath . '/' . $this->componentFolderName . '.zip'; + //create the zip file if (ComponentbuilderHelper::zip($this->componentPath, $this->filepath)) { @@ -485,7 +482,7 @@ class Compiler extends Infusion { JFile::copy($this->filepath, $this->backupPath); } - + // move to sales server host if ($this->componentData->add_sales_server == 1 && $this->dynamicIntegration) { @@ -502,7 +499,7 @@ class Compiler extends Infusion $this->componentData->sales_server_ftp = rtrim($basic->decryptString($this->componentData->sales_server_ftp), "\0"); } // now move the file - $this->moveFileToFtpServer($this->filepath, $this->componentData->sales_server_ftp, $this->componentSalesName.'.zip',false); + $this->moveFileToFtpServer($this->filepath, $this->componentData->sales_server_ftp, $this->componentSalesName . '.zip', false); } } // remove the component folder since we are done @@ -513,7 +510,7 @@ class Compiler extends Infusion } return false; } - + private function moveFileToFtpServer($localPath, $clientInput, $remote = null, $removeLocal = true) { // get the ftp opbject @@ -522,7 +519,7 @@ class Compiler extends Infusion if ($ftp instanceof JClientFtp && $ftp->isConnected()) { // move the file - if ($ftp->store($localPath,$remote)) + if ($ftp->store($localPath, $remote)) { // if moved then remove the file from repository if ($removeLocal) @@ -534,7 +531,7 @@ class Compiler extends Infusion $ftp->quit(); } } - + private function getFTP($clientInput) { $s1GnAtnr3 = md5($clientInput); @@ -581,41 +578,39 @@ class Compiler extends Infusion } return false; } - + protected function addCustomCode() { // reset all these $this->clearFromPlaceHolders('view'); $this->clearFromPlaceHolders('arg'); - foreach($this->customCode as $nr => $target) + foreach ($this->customCode as $nr => $target) { // reset each time per custom code $fingerPrint = array(); - if (isset($target['hashtarget'][0]) && $target['hashtarget'][0] > 3 - && isset($target['path']) && ComponentbuilderHelper::checkString($target['path']) - && isset($target['hashtarget'][1]) && ComponentbuilderHelper::checkString($target['hashtarget'][1])) + if (isset($target['hashtarget'][0]) && $target['hashtarget'][0] > 3 && isset($target['path']) && ComponentbuilderHelper::checkString($target['path']) && isset($target['hashtarget'][1]) && ComponentbuilderHelper::checkString($target['hashtarget'][1])) { - $file = $this->componentPath . '/'. $target['path']; - $size = (int) $target['hashtarget'][0]; - $hash = $target['hashtarget'][1]; - $cut = $size - 1; - $found = false; - $bites = 0; - $lineBites = array(); - $replace = array(); + $file = $this->componentPath . '/' . $target['path']; + $size = (int) $target['hashtarget'][0]; + $hash = $target['hashtarget'][1]; + $cut = $size - 1; + $found = false; + $bites = 0; + $lineBites = array(); + $replace = array(); if ($target['type'] == 1 && isset($target['hashendtarget'][0]) && $target['hashendtarget'][0] > 0) { - $foundEnd = false; - $sizeEnd = (int) $target['hashendtarget'][0]; - $hashEnd = $target['hashendtarget'][1]; - $cutEnd = $sizeEnd - 1; + $foundEnd = false; + $sizeEnd = (int) $target['hashendtarget'][0]; + $hashEnd = $target['hashendtarget'][1]; + $cutEnd = $sizeEnd - 1; } else { // replace to the end of the file - $foundEnd = true; + $foundEnd = true; } - $counter = 0; + $counter = 0; // check if file exist if (JFile::exists($file)) { @@ -635,12 +630,12 @@ class Compiler extends Infusion // check lines each time if it fits our target if (count($fingerPrint) === $sizeEnd && !$foundEnd) { - $fingerTest = md5(implode('',$fingerPrint)); + $fingerTest = md5(implode('', $fingerPrint)); if ($fingerTest === $hashEnd) { // we are done here $foundEnd = true; - $replace = array_slice($replace, 0, count($replace)-$sizeEnd); + $replace = array_slice($replace, 0, count($replace) - $sizeEnd); break; } else @@ -659,7 +654,7 @@ class Compiler extends Infusion // check lines each time if it fits our target if (count($fingerPrint) === $size && !$found) { - $fingerTest = md5(implode('',$fingerPrint)); + $fingerTest = md5(implode('', $fingerPrint)); if ($fingerTest === $hash) { // we are done here @@ -680,8 +675,8 @@ class Compiler extends Infusion } if ($found) { - $placeholder = $this->getPlaceHolder((int) $target['comment_type'].$target['type'], $target['id']); - $data = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($target['code'], $this->placeholders). $placeholder['end'] . PHP_EOL; + $placeholder = $this->getPlaceHolder((int) $target['comment_type'] . $target['type'], $target['id']); + $data = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($target['code'], $this->placeholders) . $placeholder['end'] . PHP_EOL; if ($target['type'] == 2) { // found it now add code from the next line @@ -732,12 +727,12 @@ class Compiler extends Infusion $code = explode(PHP_EOL, $target['code']); $code = PHP_EOL . $commentType . implode($_commentType . PHP_EOL . $commentType, $code) . $_commentType . PHP_EOL; // get place holders - $placeholder = $this->getPlaceHolder((int) $target['comment_type'].$target['type'], $target['id']); + $placeholder = $this->getPlaceHolder((int) $target['comment_type'] . $target['type'], $target['id']); // build the data - $data = $placeholder['start'] . $code . $placeholder['end']. PHP_EOL; + $data = $placeholder['start'] . $code . $placeholder['end'] . PHP_EOL; // get the bites before insertion - $bitBucket = array(); - foreach($lineBites as $line => $value) + $bitBucket = array(); + foreach ($lineBites as $line => $value) { if ($line < $target['from_line']) { @@ -775,7 +770,8 @@ class Compiler extends Infusion // done close both files fclose($fpFile); fclose($fpTemp); - + // any help to improve this is welcome... } + } diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index c5ddc01cf..3c691a5aa 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -1,27 +1,28 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| + /-------------------------------------------------------------------------------------------------------------------------------/ + + @version 2.6.0 + @created 30th April, 2015 + @package Component Builder + @subpackage compiler.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + + /----------------------------------------------------------------------------------------------------------------------------- */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); @@ -31,207 +32,208 @@ defined('_JEXEC') or die('Restricted access'); */ class Get { + /** * The app * * @var object */ public $app; - + /** * The Params * * @var object */ public $params; - + /** * The placeholders * * @var array */ public $placeholders = array(); - + /** * The Compiler Path * * @var object */ public $compilerPath; - + /** * Switch to add custom code placeholders * * @var bool */ public $addPlaceholders = false; - + /** * The Component data * * @var object */ public $componentData; - - /*********************************************************************************************** - * The custom script placeholders - we use the (xxx) to avoid detection it should be (***) - * ##################################---> PHP/JS <---#################################### + + /* * ********************************************************************************************* + * The custom script placeholders - we use the (xxx) to avoid detection it should be (***) + * ##################################---> PHP/JS <---#################################### * - * New Insert Code = /xxx[INSERT<>$$$$]xxx/ /xxx[/INSERT<>$$$$]xxx/ - * New Replace Code = /xxx[REPLACE<>$$$$]xxx/ /xxx[/REPLACE<>$$$$]xxx/ + * New Insert Code = /xxx[INSERT<>$$$$]xxx/ /xxx[/INSERT<>$$$$]xxx/ + * New Replace Code = /xxx[REPLACE<>$$$$]xxx/ /xxx[/REPLACE<>$$$$]xxx/ * - * //////////////////////////////// when JCB adds it back ////////////////////////////////// - * JCB Add Inserted Code = /xxx[INSERTED$$$$]xxx//x23x/ /xxx[/INSERTED$$$$]xxx/ - * JCB Add Replaced Code = /xxx[REPLACED$$$$]xxx//x25x/ /xxx[/REPLACED$$$$]xxx/ + * //////////////////////////////// when JCB adds it back ////////////////////////////////// + * JCB Add Inserted Code = /xxx[INSERTED$$$$]xxx//x23x/ /xxx[/INSERTED$$$$]xxx/ + * JCB Add Replaced Code = /xxx[REPLACED$$$$]xxx//x25x/ /xxx[/REPLACED$$$$]xxx/ * - * /////////////////////////////// changeing existing custom code ///////////////////////// - * Update Inserted Code = /xxx[INSERTED<>$$$$]xxx//x23x/ /xxx[/INSERTED<>$$$$]xxx/ - * Update Replaced Code = /xxx[REPLACED<>$$$$]xxx//x25x/ /xxx[/REPLACED<>$$$$]xxx/ + * /////////////////////////////// changeing existing custom code ///////////////////////// + * Update Inserted Code = /xxx[INSERTED<>$$$$]xxx//x23x/ /xxx[/INSERTED<>$$$$]xxx/ + * Update Replaced Code = /xxx[REPLACED<>$$$$]xxx//x25x/ /xxx[/REPLACED<>$$$$]xxx/ * - * The custom script placeholders - we use the (==) to avoid detection it should be (--) - * ###################################---> HTML <---##################################### + * The custom script placeholders - we use the (==) to avoid detection it should be (--) + * ###################################---> HTML <---##################################### * * New Insert Code = $$$$]==> $$$$]==> - * New Replace Code = $$$$]==> $$$$]==> + * New Replace Code = $$$$]==> $$$$]==> * - * ///////////////////////////////// when JCB adds it back /////////////////////////////// - * JCB Add Inserted Code = - * JCB Add Replaced Code = + * ///////////////////////////////// when JCB adds it back /////////////////////////////// + * JCB Add Inserted Code = + * JCB Add Replaced Code = * - * //////////////////////////// changeing existing custom code /////////////////////////// - * Update Inserted Code = $$$$]==> $$$$]==> - * Update Replaced Code = $$$$]==> $$$$]==> + * //////////////////////////// changeing existing custom code /////////////////////////// + * Update Inserted Code = $$$$]==> $$$$]==> + * Update Replaced Code = $$$$]==> $$$$]==> * - * ////////23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!! + * ////////23 is the ID of the code in the system don't change it!!!!!!!!!!!!!!!!!!!!!!!!!! * - * @var array - ***********************************************************************************************/ - protected $customCodePlaceholders = array( - 1 => 'REPLACE<>$$$$]', - 2 => 'INSERT<>$$$$]', - 3 => 'REPLACED<>$$$$]', - 4 => 'INSERTED<>$$$$]' - ); - + * @var array + * ********************************************************************************************* */ + protected $customCodePlaceholders = array( + 1 => 'REPLACE<>$$$$]', + 2 => 'INSERT<>$$$$]', + 3 => 'REPLACED<>$$$$]', + 4 => 'INSERTED<>$$$$]' + ); + /** * The custom code to be added * * @var array */ public $customCode; - + /** * The custom code to be added * * @var array */ protected $customCodeData = array(); - + /** * The function name memory ids * * @var array */ public $functionNameMemory = array(); - + /** * The custom code for local memory * * @var array */ public $customCodeMemory = array(); - + /** * The custom code in local files that aready exist in system * * @var array */ protected $existingCustomCode = array(); - + /** * The custom code in local files this are new * * @var array */ protected $newCustomCode = array(); - + /** * The index of code already loaded * * @var array */ - protected $codeAreadyDone = array(); - + protected $codeAreadyDone = array(); + /* * The line numbers Switch * * @var boolean */ - public $debugLinenr = false; - + public $debugLinenr = false; + /* * The percentage when a language should be added * * @var boolean */ public $percentageLanguageAdd = 0; - + /** * The Placholder Language prefix * * @var string */ public $langPrefix; - + /** * The Language content * * @var array */ public $langContent = array(); - + /** * The Languages bucket * * @var array */ - public $languages = array('en-GB' => array()); - + public $languages = array('en-GB' => array()); + /** * The Multi Languages bucket * * @var array */ public $multiLangString = array(); - + /** * The new lang to add * * @var array */ protected $newLangStrings = array(); - + /** * The existing lang to update * * @var array */ protected $existingLangStrings = array(); - + /** * The Language JS matching check * * @var array */ public $langMismatch = array(); - + /** * The Language SC matching check * * @var array */ public $langMatch = array(); - + /** * The Language string targets * @@ -242,309 +244,309 @@ class Get 'JText::script(', 'JText::_(', 'JText::sprintf(' - ); - + ); + /** * The Component Code Name * * @var string */ public $componentCodeName; - + /** * The Component ID * * @var int */ public $componentID; - + /** * The current user * * @var array */ public $user; - + /** * The database object * * @var array */ public $db; - + /** * The Component version * * @var string */ public $component_version; - + /** * The UIKIT Switch * * @var boolean */ public $uikit = 0; - + /** * The UIKIT component checker * * @var array */ public $uikitComp = array(); - + /** * The FOOTABLE Switch * * @var boolean */ public $footable = false; - + /** * The FOOTABLE Version * * @var int */ public $footableVersion; - + /** * The Google Chart Switch per view * * @var array */ public $googleChart = array(); - + /** * The Google Chart Switch * * @var boolean */ public $googlechart = false; - + /** * The Import & Export Switch * * @var boolean */ public $addEximport = false; - + /** * The Tag & History Switch * * @var boolean */ public $setTagHistory = false; - + /** * The site edit views * * @var array */ public $siteEditView = array(); - + /** * The Language target * * @var string */ public $lang = 'admin'; - + /** * The Build target Switch * * @var string */ public $target; - + /** * The unique codes * * @var array */ public $uniquecodes = array(); - + /** * The unique keys * * @var array */ public $uniquekeys = array(); - + /** * The Ad contributors Switch * * @var boolean */ public $addContributors = false; - + /** * The Custom Script Builder * * @var array */ public $customScriptBuilder = array(); - + /** * The Footable Script Builder * * @var array */ public $footableScripts = array(); - + /** * The pathe to the bom file to be used * * @var string */ public $bomPath; - + /** * The SQL Tweak of admin views * * @var array */ public $sqlTweak = array(); - + /** * The admin views data array * * @var array */ private $_adminViewData = array(); - + /** * The field data array * * @var array */ private $_fieldData = array(); - + /** * The linked admin view tabs * * @var array */ public $linkedAdminViews = array(); - + /** * The Add Ajax Switch * * @var boolean */ public $addAjax = false; - + /** * The Add Site Ajax Switch * * @var boolean */ public $addSiteAjax = false; - + /** * The get Module Script Switch * * @var array */ public $getModule = array(); - + /** * The template data * * @var array */ public $templateData = array(); - + /** * The layout data * * @var array */ public $layoutData = array(); - + /** * The Advanced Encryption Switch * * @var boolean */ public $advancedEncryption = false; - + /** * The Basic Encryption Switch * * @var boolean */ public $basicEncryption = false; - + /** * The Custom field Switch per view * * @var array */ public $customFieldScript = array(); - + /** * The site main get * * @var array */ public $siteMainGet = array(); - + /** * The site dynamic get * * @var array */ public $siteDynamicGet = array(); - + /** * The get AS lookup * * @var array */ public $getAsLookup = array(); - + /** * The site fields * * @var array */ public $siteFields = array(); - + /** * The add SQL * * @var array */ public $addSQL = array(); - + /** * The update SQL * * @var array */ public $updateSQL = array(); - + /** * The Library Manager * * @var array */ public $libManager = array(); - + /** * The Libraries * * @var array */ public $libraries = array(); - + /** * Is Tidy Enabled * * @var bool */ public $tidy = false; - + /** * Set Tidy warning once switch * @@ -552,40 +554,41 @@ class Get */ public $setTidyWarning = false; - /*** + /* * * * Constructor */ - public function __construct($config = array ()) + + public function __construct($config = array()) { if (isset($config) && count($config)) { // load application - $this->app = JFactory::getApplication(); + $this->app = JFactory::getApplication(); // check if we have Tidy enabled - $this->tidy = extension_loaded('Tidy'); + $this->tidy = extension_loaded('Tidy'); // Set the params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = JComponentHelper::getParams('com_componentbuilder'); // load the compiler path - $this->compilerPath = $this->params->get('compiler_folder_path', JPATH_COMPONENT_ADMINISTRATOR.'/compiler'); + $this->compilerPath = $this->params->get('compiler_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler'); // set the component ID - $this->componentID = (int) $config['componentId']; + $this->componentID = (int) $config['componentId']; // set this components code name if ($name_code = ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'name_code')) { // set lang prefix - $this->langPrefix = 'COM_'.ComponentbuilderHelper::safeString($name_code,'U'); + $this->langPrefix = 'COM_' . ComponentbuilderHelper::safeString($name_code, 'U'); // set component code name - $this->componentCodeName = ComponentbuilderHelper::safeString($name_code); + $this->componentCodeName = ComponentbuilderHelper::safeString($name_code); // set if placeholders should be added to customcode - $global = ((int) ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'add_placeholders') == 1) ? true:false; - $this->addPlaceholders = ((int) $config['addPlaceholders'] == 0) ? false : (((int) $config['addPlaceholders'] == 1) ? true : $global); + $global = ((int) ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'add_placeholders') == 1) ? true : false; + $this->addPlaceholders = ((int) $config['addPlaceholders'] == 0) ? false : (((int) $config['addPlaceholders'] == 1) ? true : $global); // set if line numbers should be added to comments - $global = ((int) ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'debug_linenr') == 1) ? true:false; - $this->debugLinenr = ((int) $config['debugLinenr'] == 0) ? false : (((int) $config['debugLinenr'] == 1) ? true : $global); + $global = ((int) ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'debug_linenr') == 1) ? true : false; + $this->debugLinenr = ((int) $config['debugLinenr'] == 0) ? false : (((int) $config['debugLinenr'] == 1) ? true : $global); // set the current user - $this->user = JFactory::getUser(); + $this->user = JFactory::getUser(); // Get a db connection. - $this->db = JFactory::getDbo(); + $this->db = JFactory::getDbo(); // check if this component is install on the current website if ($paths = $this->getLocalInstallPaths()) { @@ -602,8 +605,7 @@ class Get $this->componentData->component_version = '1.0.0'; } // update the version - if (!isset($this->componentData->old_component_version) - && (ComponentbuilderHelper::checkArray($this->addSQL) || ComponentbuilderHelper::checkArray($this->updateSQL))) + if (!isset($this->componentData->old_component_version) && (ComponentbuilderHelper::checkArray($this->addSQL) || ComponentbuilderHelper::checkArray($this->updateSQL))) { // set the new version $version = (array) explode('.', $this->componentData->component_version); @@ -611,7 +613,7 @@ class Get end($version); $key = key($version); // just increment the last - $version[$key]++; + $version[$key] ++; // set the old version $this->componentData->old_component_version = $this->componentData->component_version; // set the new version, and set update switch @@ -619,13 +621,13 @@ class Get } // set the percentage when a language can be added $this->percentageLanguageAdd = (int) $this->params->get('percentagelanguageadd', 50); - + return true; } } return false; } - + /** * Set the line number in comments * @@ -638,11 +640,11 @@ class Get { if ($this->debugLinenr) { - return ' [Get '.$nr.']'; + return ' [Get ' . $nr . ']'; } return ''; } - + /** * get all Component Data * @@ -660,37 +662,36 @@ class Get $query->select( $this->db->quoteName( array( - 'b.addadmin_views', - 'b.id', - 'h.addconfig', - 'd.addcustom_admin_views', - 'g.addcustommenus', - 'j.addfiles', - 'j.addfolders', - 'c.addsite_views', - 'i.dashboard_tab', - 'i.php_dashboard_methods', - 'f.sql_tweak', - 'e.version_update', - 'e.id' - ), - array( - 'addadmin_views', - 'addadmin_views_id', - 'addconfig', - 'addcustom_admin_views', - 'addcustommenus', - 'addfiles', - 'addfolders', - 'addsite_views', - 'dashboard_tab', - 'php_dashboard_methods', - 'sql_tweak', - 'version_update', - 'version_update_id' - ) + 'b.addadmin_views', + 'b.id', + 'h.addconfig', + 'd.addcustom_admin_views', + 'g.addcustommenus', + 'j.addfiles', + 'j.addfolders', + 'c.addsite_views', + 'i.dashboard_tab', + 'i.php_dashboard_methods', + 'f.sql_tweak', + 'e.version_update', + 'e.id' + ), array( + 'addadmin_views', + 'addadmin_views_id', + 'addconfig', + 'addcustom_admin_views', + 'addcustommenus', + 'addfiles', + 'addfolders', + 'addsite_views', + 'dashboard_tab', + 'php_dashboard_methods', + 'sql_tweak', + 'version_update', + 'version_update_id' ) - ); + ) + ); // from these tables $query->from('#__componentbuilder_joomla_component AS a'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_component_admin_views', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.joomla_component') . ')'); @@ -702,14 +703,14 @@ class Get $query->join('LEFT', $this->db->quoteName('#__componentbuilder_component_config', 'h') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('h.joomla_component') . ')'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_component_dashboard', 'i') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('i.joomla_component') . ')'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_component_files_folders', 'j') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('j.joomla_component') . ')'); - $query->where($this->db->quoteName('a.id') . ' = '. (int) $this->componentID); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $this->componentID); // Reset the query using our newly populated query object. $this->db->setQuery($query); // Load the results as a list of stdClass objects $component = $this->db->loadObject(); - + // set upater $updater = array( 'unique' => array( @@ -745,7 +746,7 @@ class Get ); // update the repeatable fields $component = ComponentbuilderHelper::convertRepeatableFields($component, $searchRepeatables, $updater); - + // set component place holders $this->placeholders['###component###'] = ComponentbuilderHelper::safeString($component->name_code); $this->placeholders['###Component###'] = ComponentbuilderHelper::safeString($component->name_code, 'F'); @@ -753,32 +754,32 @@ class Get $this->placeholders['[[[component]]]'] = $this->placeholders['###component###']; $this->placeholders['[[[Component]]]'] = $this->placeholders['###Component###']; $this->placeholders['[[[COMPONENT]]]'] = $this->placeholders['###COMPONENT###']; - + // set component sales name $component->sales_name = ComponentbuilderHelper::safeString($component->system_name); - + // ensure version naming is correct $this->component_version = preg_replace('/[^0-9.]+/', '', $component->component_version); - + // set the addfolders data - $component->addfolders = (isset($component->addfolders) && ComponentbuilderHelper::checkJson($component->addfolders)) ? json_decode($component->addfolders,true):null; + $component->addfolders = (isset($component->addfolders) && ComponentbuilderHelper::checkJson($component->addfolders)) ? json_decode($component->addfolders, true) : null; if (ComponentbuilderHelper::checkArray($component->addfolders)) { $component->folders = array_values($component->addfolders); } unset($component->addfolders); - + // set the addfiles data - $component->addfiles = (isset($component->addfiles) && ComponentbuilderHelper::checkJson($component->addfiles)) ? json_decode($component->addfiles,true):null; + $component->addfiles = (isset($component->addfiles) && ComponentbuilderHelper::checkJson($component->addfiles)) ? json_decode($component->addfiles, true) : null; if (ComponentbuilderHelper::checkArray($component->addfiles)) { $component->files = array_values($component->addfiles); } unset($component->addfiles); - + // set the uikit switch $this->uikit = $component->adduikit; - + // set the footable switch if ($component->addfootable) { @@ -786,35 +787,36 @@ class Get // add the version $this->footableVersion = (1 == $component->addfootable || 2 == $component->addfootable) ? 2 : $component->addfootable; } - + // set the addcustommenus data - $component->addcustommenus = (isset($component->addcustommenus) && ComponentbuilderHelper::checkJson($component->addcustommenus)) ? json_decode($component->addcustommenus,true):null; + $component->addcustommenus = (isset($component->addcustommenus) && ComponentbuilderHelper::checkJson($component->addcustommenus)) ? json_decode($component->addcustommenus, true) : null; if (ComponentbuilderHelper::checkArray($component->addcustommenus)) { $component->custommenus = array_values($component->addcustommenus); } unset($component->addcustommenus); - + // set the sql_tweak data - $component->sql_tweak = (isset($component->sql_tweak) && ComponentbuilderHelper::checkJson($component->sql_tweak)) ? json_decode($component->sql_tweak,true):null; + $component->sql_tweak = (isset($component->sql_tweak) && ComponentbuilderHelper::checkJson($component->sql_tweak)) ? json_decode($component->sql_tweak, true) : null; if (ComponentbuilderHelper::checkArray($component->sql_tweak)) { // build the tweak settings - $this->setSqlTweaking(array_map(function($array) { - return array_map(function($value) { - if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) - && strval($value) === strval(intval($value))) + $this->setSqlTweaking(array_map(function($array) + { + return array_map(function($value) { - return (int) $value; - } - return $value; - }, $array); - }, array_values($component->sql_tweak))); + if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) + { + return (int) $value; + } + return $value; + }, $array); + }, array_values($component->sql_tweak))); } unset($component->sql_tweak); - + // set the admin_view data - $component->addadmin_views = (isset($component->addadmin_views) && ComponentbuilderHelper::checkJson($component->addadmin_views)) ? json_decode($component->addadmin_views,true):null; + $component->addadmin_views = (isset($component->addadmin_views) && ComponentbuilderHelper::checkJson($component->addadmin_views)) ? json_decode($component->addadmin_views, true) : null; if (ComponentbuilderHelper::checkArray($component->addadmin_views)) { // sort the views acording to order @@ -835,10 +837,11 @@ class Get return 1; }); // build the admin_views settings - $component->admin_views = array_map(function($array) { - $array = array_map(function($value) { - if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) - && strval($value) === strval(intval($value))) + $component->admin_views = array_map(function($array) + { + $array = array_map(function($value) + { + if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) { return (int) $value; } @@ -864,19 +867,20 @@ class Get } // set the site_view data - $component->addsite_views = (isset($component->addsite_views) && ComponentbuilderHelper::checkJson($component->addsite_views)) ? json_decode($component->addsite_views,true):null; + $component->addsite_views = (isset($component->addsite_views) && ComponentbuilderHelper::checkJson($component->addsite_views)) ? json_decode($component->addsite_views, true) : null; if (ComponentbuilderHelper::checkArray($component->addsite_views)) { $this->lang = 'site'; $this->target = 'site'; // build the site_views settings - $component->site_views = array_map(function($array) { + $component->site_views = array_map(function($array) + { // has become a lacacy issue, can't remove this $array['view'] = $array['siteview']; $array['settings'] = $this->getCustomViewData($array['view']); - return array_map(function($value) { - if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) - && strval($value) === strval(intval($value))) + return array_map(function($value) + { + if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) { return (int) $value; } @@ -888,19 +892,20 @@ class Get } // set the custom_admin_views data - $component->addcustom_admin_views = (isset($component->addcustom_admin_views) && ComponentbuilderHelper::checkJson($component->addcustom_admin_views)) ? json_decode($component->addcustom_admin_views,true):null; + $component->addcustom_admin_views = (isset($component->addcustom_admin_views) && ComponentbuilderHelper::checkJson($component->addcustom_admin_views)) ? json_decode($component->addcustom_admin_views, true) : null; if (ComponentbuilderHelper::checkArray($component->addcustom_admin_views)) { $this->lang = 'admin'; $this->target = 'custom_admin'; // build the custom_admin_views settings - $component->custom_admin_views = array_map(function($array) { + $component->custom_admin_views = array_map(function($array) + { // has become a lacacy issue, can't remove this $array['view'] = $array['customadminview']; $array['settings'] = $this->getCustomViewData($array['view'], 'custom_admin_view'); - return array_map(function($value) { - if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) - && strval($value) === strval(intval($value))) + return array_map(function($value) + { + if (!ComponentbuilderHelper::checkArray($value) && !ComponentbuilderHelper::checkObject($value) && strval($value) === strval(intval($value))) { return (int) $value; } @@ -912,10 +917,11 @@ class Get } // set the config data - $component->addconfig = (isset($component->addconfig) && ComponentbuilderHelper::checkJson($component->addconfig)) ? json_decode($component->addconfig,true):null; + $component->addconfig = (isset($component->addconfig) && ComponentbuilderHelper::checkJson($component->addconfig)) ? json_decode($component->addconfig, true) : null; if (ComponentbuilderHelper::checkArray($component->addconfig)) { - $component->config = array_map(function($array) { + $component->config = array_map(function($array) + { $array['alias'] = 0; $array['title'] = 0; $array['settings'] = $this->getFieldData($array['field']); @@ -924,23 +930,23 @@ class Get // unset original value unset($component->addconfig); } - + // set the addcustommenus data - $component->addcontributors = (isset($component->addcontributors) && ComponentbuilderHelper::checkJson($component->addcontributors)) ? json_decode($component->addcontributors,true):null; + $component->addcontributors = (isset($component->addcontributors) && ComponentbuilderHelper::checkJson($component->addcontributors)) ? json_decode($component->addcontributors, true) : null; if (ComponentbuilderHelper::checkArray($component->addcontributors)) { $this->addContributors = true; $component->contributors = array_values($component->addcontributors); } unset($component->addcontributors); - + // set the addcustommenus data - $component->version_update = (isset($component->version_update) && ComponentbuilderHelper::checkJson($component->version_update)) ? json_decode($component->version_update,true):null; + $component->version_update = (isset($component->version_update) && ComponentbuilderHelper::checkJson($component->version_update)) ? json_decode($component->version_update, true) : null; if (ComponentbuilderHelper::checkArray($component->version_update)) { $component->version_update = array_values($component->version_update); } - + // build update SQL $old_admin_views = $this->getHistoryWatch('component_admin_views', $component->addadmin_views_id); $old_component = $this->getHistoryWatch('joomla_component', $this->componentID); @@ -993,32 +999,32 @@ class Get $this->customScriptBuilder['component_css'] = ''; } unset($component->css); - + // set the lang target $this->lang = 'admin'; // add PHP in ADMIN - $addScriptMethods = array('php_preflight','php_postflight','php_method'); - $addScriptTypes = array('install','update','uninstall'); + $addScriptMethods = array('php_preflight', 'php_postflight', 'php_method'); + $addScriptTypes = array('install', 'update', 'uninstall'); foreach ($addScriptMethods as $scriptMethod) - { + { foreach ($addScriptTypes as $scriptType) { - if (isset($component->{'add_'.$scriptMethod.'_'.$scriptType}) && $component->{'add_'.$scriptMethod.'_'.$scriptType} == 1 && ComponentbuilderHelper::checkString($component->{$scriptMethod.'_'.$scriptType})) + if (isset($component->{'add_' . $scriptMethod . '_' . $scriptType}) && $component->{'add_' . $scriptMethod . '_' . $scriptType} == 1 && ComponentbuilderHelper::checkString($component->{$scriptMethod . '_' . $scriptType})) { - $this->customScriptBuilder[$scriptMethod][$scriptType] = $this->setDynamicValues(base64_decode($component->{$scriptMethod.'_'.$scriptType})); + $this->customScriptBuilder[$scriptMethod][$scriptType] = $this->setDynamicValues(base64_decode($component->{$scriptMethod . '_' . $scriptType})); } else { $this->customScriptBuilder[$scriptMethod][$scriptType] = ''; } - unset($component->{$scriptMethod.'_'.$scriptType}); + unset($component->{$scriptMethod . '_' . $scriptType}); } } // add_php_helper if ($component->add_php_helper_admin == 1 && ComponentbuilderHelper::checkString($component->php_helper_admin)) { $this->lang = 'admin'; - $this->customScriptBuilder['component_php_helper_admin'] = PHP_EOL.PHP_EOL.$this->setDynamicValues(base64_decode($component->php_helper_admin)); + $this->customScriptBuilder['component_php_helper_admin'] = PHP_EOL . PHP_EOL . $this->setDynamicValues(base64_decode($component->php_helper_admin)); } else { @@ -1040,7 +1046,7 @@ class Get if ($component->add_php_helper_both == 1 && ComponentbuilderHelper::checkString($component->php_helper_both)) { $this->lang = 'both'; - $this->customScriptBuilder['component_php_helper_both'] = PHP_EOL.PHP_EOL.$this->setDynamicValues(base64_decode($component->php_helper_both)); + $this->customScriptBuilder['component_php_helper_both'] = PHP_EOL . PHP_EOL . $this->setDynamicValues(base64_decode($component->php_helper_both)); } else { @@ -1050,7 +1056,7 @@ class Get if ($component->add_php_helper_site == 1 && ComponentbuilderHelper::checkString($component->php_helper_site)) { $this->lang = 'site'; - $this->customScriptBuilder['component_php_helper_site'] = PHP_EOL.PHP_EOL.$this->setDynamicValues(base64_decode($component->php_helper_site)); + $this->customScriptBuilder['component_php_helper_site'] = PHP_EOL . PHP_EOL . $this->setDynamicValues(base64_decode($component->php_helper_site)); } else { @@ -1077,11 +1083,11 @@ class Get // bom if (ComponentbuilderHelper::checkString($component->bom)) { - $this->bomPath = $this->compilerPath.'/'.$component->bom; + $this->bomPath = $this->compilerPath . '/' . $component->bom; } else { - $this->bomPath = $this->compilerPath.'/default.txt'; + $this->bomPath = $this->compilerPath . '/default.txt'; } unset($component->bom); // README @@ -1096,12 +1102,13 @@ class Get // set lang now $nowLang = $this->lang; $this->lang = 'admin'; - + // dashboard methods - $component->dashboard_tab = (isset($component->dashboard_tab) && ComponentbuilderHelper::checkJson($component->dashboard_tab)) ? json_decode($component->dashboard_tab,true):null; + $component->dashboard_tab = (isset($component->dashboard_tab) && ComponentbuilderHelper::checkJson($component->dashboard_tab)) ? json_decode($component->dashboard_tab, true) : null; if (ComponentbuilderHelper::checkArray($component->dashboard_tab)) { - $component->dashboard_tab = array_map( function($array) { + $component->dashboard_tab = array_map(function($array) + { $array['html'] = $this->setDynamicValues($array['html']); return $array; }, array_values($component->dashboard_tab)); @@ -1122,7 +1129,7 @@ class Get } // reset back to nowlang $this->lang = $nowLang; - + // add the update FTP server sig if ($component->add_update_server == 1 && is_numeric($component->update_server_ftp) && $component->update_server_ftp > 0) { @@ -1159,11 +1166,11 @@ class Get // the default is to ignore the repo folder $component->toignore = array('.git'); } - + // return the found component data return $component; } - + /** * Get all Admin View Data * @@ -1183,23 +1190,22 @@ class Get $query->select( $this->db->quoteName( array( - 'b.addfields', - 'b.id', - 'c.addconditions', - 'c.id' - ), - array( - 'addfields', - 'addfields_id', - 'addconditions', - 'addconditions_id' - ) + 'b.addfields', + 'b.id', + 'c.addconditions', + 'c.id' + ), array( + 'addfields', + 'addfields_id', + 'addconditions', + 'addconditions_id' ) - ); + ) + ); $query->from('#__componentbuilder_admin_view AS a'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields', 'b') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('b.admin_view') . ')'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_admin_fields_conditions', 'c') . ' ON (' . $this->db->quoteName('a.id') . ' = ' . $this->db->quoteName('c.admin_view') . ')'); - $query->where($this->db->quoteName('a.id') . ' = '. (int) $id); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Reset the query using our newly populated query object. $this->db->setQuery($query); @@ -1209,7 +1215,7 @@ class Get // setup view name to use in storing the data $name_single = ComponentbuilderHelper::safeString($view->name_single); $name_list = ComponentbuilderHelper::safeString($view->name_list); - + // set upater $updater = array( 'unique' => array( @@ -1227,14 +1233,14 @@ class Get 'addconditions' => 'target_field', 'ajax_input' => 'value_name', 'custom_button' => 'name', - 'addlinked_views' => 'adminview', + 'addlinked_views' => 'adminview', 'addtables' => 'table', - 'addtabs' => 'name', + 'addtabs' => 'name', 'addpermissions' => 'action' ); // update the repeatable fields $view = ComponentbuilderHelper::convertRepeatableFields($view, $searchRepeatables, $updater); - + // setup token check if (!isset($this->customScriptBuilder['token'])) { @@ -1254,16 +1260,16 @@ class Get $this->placeholders['[[[View]]]'] = $this->placeholders['###View###']; $this->placeholders['[[[Views]]]'] = $this->placeholders['###Views###']; $this->placeholders['[[[VIEW]]]'] = $this->placeholders['###VIEW###']; - $this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###']; + $this->placeholders['[[[VIEWS]]]'] = $this->placeholders['###VIEWS###']; // add the tables - $view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables,true):null; + $view->addtables = (isset($view->addtables) && ComponentbuilderHelper::checkJson($view->addtables)) ? json_decode($view->addtables, true) : null; if (ComponentbuilderHelper::checkArray($view->addtables)) { $view->tables = array_values($view->addtables); } unset($view->addtables); // add the tabs - $view->addtabs = (isset($view->addtabs) && ComponentbuilderHelper::checkJson($view->addtabs)) ? json_decode($view->addtabs,true):null; + $view->addtabs = (isset($view->addtabs) && ComponentbuilderHelper::checkJson($view->addtabs)) ? json_decode($view->addtabs, true) : null; if (ComponentbuilderHelper::checkArray($view->addtabs)) { $nr = 1; @@ -1287,7 +1293,7 @@ class Get $view->tabs[15] = 'publishing'; unset($view->addtabs); // add permissions - $view->addpermissions = (isset($view->addpermissions) && ComponentbuilderHelper::checkJson($view->addpermissions)) ? json_decode($view->addpermissions,true):null; + $view->addpermissions = (isset($view->addpermissions) && ComponentbuilderHelper::checkJson($view->addpermissions)) ? json_decode($view->addpermissions, true) : null; if (ComponentbuilderHelper::checkArray($view->addpermissions)) { $view->permissions = array_values($view->addpermissions); @@ -1296,7 +1302,7 @@ class Get // reset fields $view->fields = array(); // set fields - $view->addfields = (isset($view->addfields) && ComponentbuilderHelper::checkJson($view->addfields)) ? json_decode($view->addfields,true):null; + $view->addfields = (isset($view->addfields) && ComponentbuilderHelper::checkJson($view->addfields)) ? json_decode($view->addfields, true) : null; if (ComponentbuilderHelper::checkArray($view->addfields)) { // build update SQL @@ -1306,14 +1312,15 @@ class Get if (isset($old_view->addfields) && ComponentbuilderHelper::checkJson($old_view->addfields)) { $this->setUpdateSQL(json_decode($old_view->addfields, true), $view->addfields, 'field', $name_single); - } + } // clear this data unset($old_view); } if (ComponentbuilderHelper::checkArray($view->addfields)) { // load the field data - $view->fields = array_map( function($array) use($name_single, $name_list){ + $view->fields = array_map(function($array) use($name_single, $name_list) + { $array['settings'] = $this->getFieldData($array['field'], $name_single, $name_list); return $array; }, array_values($view->addfields)); @@ -1340,7 +1347,7 @@ class Get }); } } - unset($view->addfields); + unset($view->addfields); // build update SQL if ($old_view = $this->getHistoryWatch('admin_view', $id)) { @@ -1348,12 +1355,12 @@ class Get if (ComponentbuilderHelper::checkString($old_view->name_single)) { $this->setUpdateSQL(ComponentbuilderHelper::safeString($old_view->name_single), $name_single, 'table_name', $name_single); - } + } // clear this data unset($old_view); - } + } // set the conditions - $view->addconditions = (isset($view->addconditions) && ComponentbuilderHelper::checkJson($view->addconditions)) ? json_decode($view->addconditions,true):null; + $view->addconditions = (isset($view->addconditions) && ComponentbuilderHelper::checkJson($view->addconditions)) ? json_decode($view->addconditions, true) : null; if (ComponentbuilderHelper::checkArray($view->addconditions)) { $view->conditions = array(); @@ -1369,23 +1376,23 @@ class Get if ((int) $fieldValues['field'] == (int) $fieldId) { // load the field details - $required = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml,'required="','"'); - $required = ($required == true) ? 'yes' : 'no'; - $filter = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml,'filter="','"'); - $filter = ComponentbuilderHelper::checkString($filter) ? $filter : 'none'; + $required = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'required="', '"'); + $required = ($required == true) ? 'yes' : 'no'; + $filter = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'filter="', '"'); + $filter = ComponentbuilderHelper::checkString($filter) ? $filter : 'none'; // get name - $name = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml,'name="','"'); - $name = ComponentbuilderHelper::checkString($name) ? $name : $fieldValues['settings']->name; + $name = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'name="', '"'); + $name = ComponentbuilderHelper::checkString($name) ? $name : $fieldValues['settings']->name; // get type - $type = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml,'type="','"'); - $type = ComponentbuilderHelper::checkString($type) ? $type : $fieldValues['settings']->type_name; + $type = ComponentbuilderHelper::getBetween($fieldValues['settings']->xml, 'type="', '"'); + $type = ComponentbuilderHelper::checkString($type) ? $type : $fieldValues['settings']->type_name; // set the field name $conditionValue['target_field'][$fieldKey] = array( 'name' => ComponentbuilderHelper::safeString($name), 'type' => ComponentbuilderHelper::safeString($type), 'required' => $required, 'filter' => $filter - ); + ); break; } } @@ -1400,19 +1407,19 @@ class Get if ((int) $fieldValue['field'] == (int) $conditionValue['match_field']) { // get name - $name = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml,'name="','"'); + $name = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'name="', '"'); $name = ComponentbuilderHelper::checkString($name) ? $name : $fieldValue['settings']->name; // get type - $type = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml,'type="','"'); + $type = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'type="', '"'); $type = ComponentbuilderHelper::checkString($type) ? $type : $fieldValue['settings']->type_name; // set the field details - $conditionValue['match_name'] = ComponentbuilderHelper::safeString($name); - $conditionValue['match_type'] = ComponentbuilderHelper::safeString($type); - $conditionValue['match_xml'] = $fieldValue['settings']->xml; + $conditionValue['match_name'] = ComponentbuilderHelper::safeString($name); + $conditionValue['match_type'] = ComponentbuilderHelper::safeString($type); + $conditionValue['match_xml'] = $fieldValue['settings']->xml; // if custom field load field being extended if (!ComponentbuilderHelper::typeField($type)) { - $conditionValue['match_extends'] = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml,'extends="','"'); + $conditionValue['match_extends'] = ComponentbuilderHelper::getBetween($fieldValue['settings']->xml, 'extends="', '"'); } else { @@ -1430,7 +1437,7 @@ class Get unset($view->addconditions); // set linked views $this->linkedAdminViews[$name_single] = null; - $view->addlinked_views = (isset($view->addlinked_views) && ComponentbuilderHelper::checkJson($view->addlinked_views)) ? json_decode($view->addlinked_views,true):null; + $view->addlinked_views = (isset($view->addlinked_views) && ComponentbuilderHelper::checkJson($view->addlinked_views)) ? json_decode($view->addlinked_views, true) : null; if (ComponentbuilderHelper::checkArray($view->addlinked_views)) { // setup linked views to global data sets @@ -1440,10 +1447,10 @@ class Get // set the lang target $this->lang = 'admin'; // add_javascript - $addArrayJ = array('javascript_view_file','javascript_view_footer','javascript_views_file','javascript_views_footer'); + $addArrayJ = array('javascript_view_file', 'javascript_view_footer', 'javascript_views_file', 'javascript_views_footer'); foreach ($addArrayJ as $scripter) { - if (isset($view->{'add_'.$scripter}) && $view->{'add_'.$scripter} == 1 && ComponentbuilderHelper::checkString($view->$scripter)) + if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1 && ComponentbuilderHelper::checkString($view->$scripter)) { $view->$scripter = $this->setDynamicValues(base64_decode($view->$scripter)); $scripter_target = str_replace('javascript_', '', $scripter); @@ -1456,7 +1463,7 @@ class Get $this->customScriptBuilder[$scripter_target][$name_single] = ''; } $this->customScriptBuilder[$scripter_target][$name_single] .= $view->$scripter; - if (strpos($view->$scripter,"token") !== false || strpos($view->$scripter,"task=ajax") !== false) + if (strpos($view->$scripter, "token") !== false || strpos($view->$scripter, "task=ajax") !== false) { if (!$this->customScriptBuilder['token'][$name_single]) { @@ -1470,7 +1477,7 @@ class Get $addArrayC = array('css_view', 'css_views'); foreach ($addArrayC as $scripter) { - if (isset($view->{'add_'.$scripter}) && $view->{'add_'.$scripter} == 1) + if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1) { if (!isset($this->customScriptBuilder[$scripter][$name_single])) { @@ -1481,63 +1488,63 @@ class Get } } // add_php - $addArrayP = array('php_getitem','php_before_save','php_save','php_postsavehook','php_getitems','php_getitems_after_all','php_getlistquery','php_allowedit','php_before_delete','php_after_delete','php_before_publish','php_after_publish','php_batchcopy','php_batchmove','php_document'); + $addArrayP = array('php_getitem', 'php_before_save', 'php_save', 'php_postsavehook', 'php_getitems', 'php_getitems_after_all', 'php_getlistquery', 'php_allowedit', 'php_before_delete', 'php_after_delete', 'php_before_publish', 'php_after_publish', 'php_batchcopy', 'php_batchmove', 'php_document'); foreach ($addArrayP as $scripter) { - if (isset($view->{'add_'.$scripter}) && $view->{'add_'.$scripter} == 1) + if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1) { $this->customScriptBuilder[$scripter][$name_single] = $this->setDynamicValues(base64_decode($view->$scripter)); unset($view->$scripter); } } - // add the custom buttons - if (isset($view->add_custom_button) && $view->add_custom_button == 1) - { + // add the custom buttons + if (isset($view->add_custom_button) && $view->add_custom_button == 1) + { // set for the edit views - if (ComponentbuilderHelper::checkString($view->php_model)) - { - $view->php_model = $this->setDynamicValues(base64_decode($view->php_model)); - } + if (ComponentbuilderHelper::checkString($view->php_model)) + { + $view->php_model = $this->setDynamicValues(base64_decode($view->php_model)); + } if (ComponentbuilderHelper::checkString($view->php_controller)) - { + { $view->php_controller = $this->setDynamicValues(base64_decode($view->php_controller)); } // set for the list views - if (isset($view->php_model_list) && ComponentbuilderHelper::checkString($view->php_model_list)) - { - $view->php_model_list = $this->setDynamicValues(base64_decode($view->php_model_list)); - } + if (isset($view->php_model_list) && ComponentbuilderHelper::checkString($view->php_model_list)) + { + $view->php_model_list = $this->setDynamicValues(base64_decode($view->php_model_list)); + } if (isset($view->php_controller_list) && ComponentbuilderHelper::checkString($view->php_controller_list)) - { + { $view->php_controller_list = $this->setDynamicValues(base64_decode($view->php_controller_list)); } - // set the button array - $view->custom_button = (isset($view->custom_button) && ComponentbuilderHelper::checkJson($view->custom_button)) ? json_decode($view->custom_button,true):null; + // set the button array + $view->custom_button = (isset($view->custom_button) && ComponentbuilderHelper::checkJson($view->custom_button)) ? json_decode($view->custom_button, true) : null; if (ComponentbuilderHelper::checkArray($view->custom_button)) - { - $view->custom_buttons = array_values($view->custom_button); - } - unset($view->custom_button); - } + { + $view->custom_buttons = array_values($view->custom_button); + } + unset($view->custom_button); + } // set custom import scripts if (isset($view->add_custom_import) && $view->add_custom_import == 1) { - $addImportArray = array('php_import_ext','php_import_display','php_import','php_import_setdata','php_import_save','html_import_view'); + $addImportArray = array('php_import_ext', 'php_import_display', 'php_import', 'php_import_setdata', 'php_import_save', 'html_import_view'); foreach ($addImportArray as $importScripter) { if (isset($view->$importScripter) && strlen($view->$importScripter) > 0) { - $this->customScriptBuilder[$importScripter]['import_'.$name_list] = $this->setDynamicValues(base64_decode($view->$importScripter)); + $this->customScriptBuilder[$importScripter]['import_' . $name_list] = $this->setDynamicValues(base64_decode($view->$importScripter)); unset($view->$importScripter); } else { // load the default - $this->customScriptBuilder[$importScripter]['import_'.$name_list] = ComponentbuilderHelper::getImportScripts($importScripter, true); + $this->customScriptBuilder[$importScripter]['import_' . $name_list] = ComponentbuilderHelper::getImportScripts($importScripter, true); } } } - + // add_Ajax for this view if (isset($view->add_php_ajax) && $view->add_php_ajax == 1) { @@ -1554,7 +1561,7 @@ class Get } } // check if controller input as been set - $view->ajax_input = (isset($view->ajax_input) && ComponentbuilderHelper::checkJson($view->ajax_input)) ? json_decode($view->ajax_input,true):null; + $view->ajax_input = (isset($view->ajax_input) && ComponentbuilderHelper::checkJson($view->ajax_input)) ? json_decode($view->ajax_input, true) : null; if (ComponentbuilderHelper::checkArray($view->ajax_input)) { if ($addAjaxSite) @@ -1612,7 +1619,7 @@ class Get // return the found view data return $this->_adminViewData[$id]; } - + /** * Get all Custom View Data * @@ -1628,8 +1635,8 @@ class Get $query = $this->db->getQuery(true); $query->select('a.*'); - $query->from('#__componentbuilder_'.$table.' AS a'); - $query->where($this->db->quoteName('a.id') . ' = '. (int) $id); + $query->from('#__componentbuilder_' . $table . ' AS a'); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); // Reset the query using our newly populated query object. $this->db->setQuery($query); @@ -1660,16 +1667,16 @@ class Get 'table' => $table, 'key' => 'id', 'val' => (int) $id - ); + ); // update the repeatable fields $view = ComponentbuilderHelper::convertRepeatableFields($view, $searchRepeatables, $updater); - + // set the default data $view->default = $this->setDynamicValues(base64_decode($view->default)); // fix alias to use in code $view->code = $this->uniqueCode(ComponentbuilderHelper::safeString($view->codename)); $view->Code = ComponentbuilderHelper::safeString($view->code, 'F'); - $view->CODE = ComponentbuilderHelper::safeString($view->code, 'U'); + $view->CODE = ComponentbuilderHelper::safeString($view->code, 'U'); // load the library if (!isset($this->libManager[$this->target])) { @@ -1708,7 +1715,7 @@ class Get // setup template array $this->templateData[$this->target][$view->code] = array(); // setup template and layout data - $this->setTemplateAndLayoutData($view->default,$view->code); + $this->setTemplateAndLayoutData($view->default, $view->code); // insure the uikit components are loaded if (2 == $this->uikit || 1 == $this->uikit) { @@ -1716,7 +1723,7 @@ class Get { $this->uikitComp[$view->code] = array(); } - $this->uikitComp[$view->code] = ComponentbuilderHelper::getUikitComp($view->default,$this->uikitComp[$view->code]); + $this->uikitComp[$view->code] = ComponentbuilderHelper::getUikitComp($view->default, $this->uikitComp[$view->code]); } // check for footable if (!isset($this->footableScripts[$this->target][$view->code]) || !$this->footableScripts[$this->target][$view->code]) @@ -1741,15 +1748,15 @@ class Get } } // set the main get data - $main_get = $this->setGetData(array($view->main_get),$view->code); + $main_get = $this->setGetData(array($view->main_get), $view->code); $view->main_get = $main_get[0]; // set the custom_get data - $view->custom_get = $this->setGetData(json_decode($view->custom_get, true),$view->code); + $view->custom_get = $this->setGetData(json_decode($view->custom_get, true), $view->code); // set array adding array of scripts - $addArray = array('php_view','php_jview','php_jview_display','php_document','js_document','css_document','css'); + $addArray = array('php_view', 'php_jview', 'php_jview_display', 'php_document', 'javascript_file', 'js_document', 'css_document', 'css'); foreach ($addArray as $scripter) { - if (isset($view->{'add_'.$scripter}) && $view->{'add_'.$scripter} == 1 && ComponentbuilderHelper::checkString($view->$scripter)) + if (isset($view->{'add_' . $scripter}) && $view->{'add_' . $scripter} == 1 && ComponentbuilderHelper::checkString($view->$scripter)) { $view->$scripter = $this->setDynamicValues(base64_decode($view->$scripter)); if (2 == $this->uikit || 1 == $this->uikit) @@ -1759,11 +1766,11 @@ class Get $this->uikitComp[$view->code] = array(); } // set uikit to views - $this->uikitComp[$view->code] = ComponentbuilderHelper::getUikitComp($view->$scripter,$this->uikitComp[$view->code]); + $this->uikitComp[$view->code] = ComponentbuilderHelper::getUikitComp($view->$scripter, $this->uikitComp[$view->code]); } - - $this->setTemplateAndLayoutData($view->$scripter,$view->code); - + + $this->setTemplateAndLayoutData($view->$scripter, $view->code); + // check for footable if (!isset($this->footableScripts[$this->target][$view->code]) || !$this->footableScripts[$this->target][$view->code]) { @@ -1805,7 +1812,7 @@ class Get if (isset($view->add_php_ajax) && $view->add_php_ajax == 1) { // check if controller input as been set - $view->ajax_input = (isset($view->ajax_input) && ComponentbuilderHelper::checkJson($view->ajax_input)) ? json_decode($view->ajax_input,true):null; + $view->ajax_input = (isset($view->ajax_input) && ComponentbuilderHelper::checkJson($view->ajax_input)) ? json_decode($view->ajax_input, true) : null; if (ComponentbuilderHelper::checkArray($view->ajax_input)) { $this->customScriptBuilder[$this->target]['ajax_controller'][$view->code] = array_values($view->ajax_input); @@ -1815,7 +1822,7 @@ class Get // load the ajax class mathods (if set) if (ComponentbuilderHelper::checkString($view->php_ajaxmethod)) { - + $this->customScriptBuilder[$this->target]['ajax_model'][$view->code] = $this->setDynamicValues(base64_decode($view->php_ajaxmethod)); $this->addSiteAjax = true; } @@ -1833,7 +1840,7 @@ class Get $view->php_controller = base64_decode($view->php_controller); $view->php_controller = $this->setDynamicValues($view->php_controller); // set the button array - $view->custom_button = (isset($view->custom_button) && ComponentbuilderHelper::checkJson($view->custom_button)) ? json_decode($view->custom_button,true):null; + $view->custom_button = (isset($view->custom_button) && ComponentbuilderHelper::checkJson($view->custom_button)) ? json_decode($view->custom_button, true) : null; if (ComponentbuilderHelper::checkArray($view->custom_button)) { $view->custom_buttons = array_values($view->custom_button); @@ -1843,7 +1850,7 @@ class Get // return the found view data return $view; } - + /** * Get all Field Data * @@ -1866,7 +1873,7 @@ class Get $query->select($this->db->quoteName(array('c.name', 'c.properties'), array('type_name', 'properties'))); $query->from('#__componentbuilder_field AS a'); $query->join('LEFT', $this->db->quoteName('#__componentbuilder_fieldtype', 'c') . ' ON (' . $this->db->quoteName('a.fieldtype') . ' = ' . $this->db->quoteName('c.id') . ')'); - $query->where($this->db->quoteName('a.id') . ' = '. $this->db->quote($id)); + $query->where($this->db->quoteName('a.id') . ' = ' . $this->db->quote($id)); // Reset the query using our newly populated query object. $this->db->setQuery($query); @@ -1878,7 +1885,7 @@ class Get // adding a fix for the changed name of type to fieldtype $field->type = $field->fieldtype; - + // repeatable fields to update $searchRepeatables = array( // repeatablefield => checker @@ -1897,25 +1904,25 @@ class Get $field->xml = $this->setDynamicValues(json_decode($field->xml)); // load the type values form type params - $field->properties = (isset($field->properties) && ComponentbuilderHelper::checkJson($field->properties)) ? json_decode($field->properties, true):null; + $field->properties = (isset($field->properties) && ComponentbuilderHelper::checkJson($field->properties)) ? json_decode($field->properties, true) : null; if (ComponentbuilderHelper::checkArray($field->properties)) { $field->properties = array_values($field->properties); } // check if we have advanced encryption - if (4 == $field->store && (!isset($this->advancedEncryption) || !$this->advancedEncryption)) + if (4 == $field->store && (!isset($this->advancedEncryption) || !$this->advancedEncryption)) { - $this->advancedEncryption = true; + $this->advancedEncryption = true; } // check if we have basic encryption - elseif (3 == $field->store && (!isset($this->basicEncryption) || !$this->basicEncryption)) + elseif (3 == $field->store && (!isset($this->basicEncryption) || !$this->basicEncryption)) { - $this->basicEncryption = true; + $this->basicEncryption = true; } - + // get the last used version $field->history = $this->getHistoryWatch('field', $id); - + $this->_fieldData[$id] = $field; } else @@ -1932,7 +1939,7 @@ class Get // add_javascript_view_footer if ($this->_fieldData[$id]->add_javascript_view_footer == 1 && ComponentbuilderHelper::checkString($this->_fieldData[$id]->javascript_view_footer)) { - if(!isset($this->customScriptBuilder['view_footer'])) + if (!isset($this->customScriptBuilder['view_footer'])) { $this->customScriptBuilder['view_footer'] = array(); } @@ -1945,11 +1952,11 @@ class Get $this->_fieldData[$id]->javascript_view_footer = $this->setDynamicValues(base64_decode($this->_fieldData[$id]->javascript_view_footer)); $this->_fieldData[$id]->javascript_view_footer_decoded = true; } - $this->customScriptBuilder['view_footer'][$name_single] .= PHP_EOL.$this->_fieldData[$id]->javascript_view_footer; - if ( strpos($this->_fieldData[$id]->javascript_view_footer,"token") !== false || - strpos($this->_fieldData[$id]->javascript_view_footer,"task=ajax") !== false) + $this->customScriptBuilder['view_footer'][$name_single] .= PHP_EOL . $this->_fieldData[$id]->javascript_view_footer; + if (strpos($this->_fieldData[$id]->javascript_view_footer, "token") !== false || + strpos($this->_fieldData[$id]->javascript_view_footer, "task=ajax") !== false) { - if(!isset($this->customScriptBuilder['token'])) + if (!isset($this->customScriptBuilder['token'])) { $this->customScriptBuilder['token'] = array(); } @@ -1973,12 +1980,12 @@ class Get } if (!isset($this->_fieldData[$id]->css_view_decoded)) { - $this->_fieldData[$id]->css_view = base64_decode($this->_fieldData[$id]->css_view); + $this->_fieldData[$id]->css_view = base64_decode($this->_fieldData[$id]->css_view); // check for custom code $this->setCustomCodeData($this->_fieldData[$id]->css_view); $this->_fieldData[$id]->css_view_decoded = true; } - $this->customScriptBuilder['css_view'][$name_single] .= PHP_EOL.$this->_fieldData[$id]->css_view; + $this->customScriptBuilder['css_view'][$name_single] .= PHP_EOL . $this->_fieldData[$id]->css_view; } // add this only once to view. @@ -1990,7 +1997,7 @@ class Get // add_javascript_views_footer if ($this->_fieldData[$id]->add_javascript_views_footer == 1 && ComponentbuilderHelper::checkString($this->_fieldData[$id]->javascript_views_footer)) { - if(!isset($this->customScriptBuilder['views_footer'])) + if (!isset($this->customScriptBuilder['views_footer'])) { $this->customScriptBuilder['views_footer'] = array(); } @@ -2004,10 +2011,10 @@ class Get $this->_fieldData[$id]->javascript_views_footer_decoded = true; } $this->customScriptBuilder['views_footer'][$name_list] .= $this->_fieldData[$id]->javascript_views_footer; - if ( strpos($this->_fieldData[$id]->javascript_views_footer,"token") !== false || - strpos($this->_fieldData[$id]->javascript_views_footer,"task=ajax") !== false) + if (strpos($this->_fieldData[$id]->javascript_views_footer, "token") !== false || + strpos($this->_fieldData[$id]->javascript_views_footer, "task=ajax") !== false) { - if(!isset($this->customScriptBuilder['token'])) + if (!isset($this->customScriptBuilder['token'])) { $this->customScriptBuilder['token'] = array(); } @@ -2030,7 +2037,7 @@ class Get } if (!isset($this->_fieldData[$id]->css_views_decoded)) { - $this->_fieldData[$id]->css_views = base64_decode($this->_fieldData[$id]->css_views); + $this->_fieldData[$id]->css_views = base64_decode($this->_fieldData[$id]->css_views); // check for custom code $this->setCustomCodeData($this->_fieldData[$id]->css_views); $this->_fieldData[$id]->css_views_decoded = true; @@ -2049,7 +2056,7 @@ class Get } return false; } - + /** * Set get Data * @@ -2081,67 +2088,62 @@ class Get foreach ($results as $_nr => &$result) { // add calculations if set - if($result->addcalculation == 1 && ComponentbuilderHelper::checkString($result->php_calculation)) + if ($result->addcalculation == 1 && ComponentbuilderHelper::checkString($result->php_calculation)) { $result->php_calculation = $this->setDynamicValues(base64_decode($result->php_calculation)); } // add php custom scripting (php_before_getitem) - if($result->add_php_before_getitem == 1 && ComponentbuilderHelper::checkString($result->php_before_getitem)) + if ($result->add_php_before_getitem == 1 && ComponentbuilderHelper::checkString($result->php_before_getitem)) { - if (!isset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code])) + if (!isset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view_code])) { - $this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code] = ''; + $this->customScriptBuilder[$this->target . '_php_before_getitem'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_before_getitem'][$view_code] .= - $this->setDynamicValues(PHP_EOL.PHP_EOL.base64_decode($result->php_before_getitem)); + $this->customScriptBuilder[$this->target . '_php_before_getitem'][$view_code] .= $this->setDynamicValues(PHP_EOL . PHP_EOL . base64_decode($result->php_before_getitem)); unset($result->php_before_getitem); } // add php custom scripting (php_after_getitem) - if($result->add_php_after_getitem == 1 && ComponentbuilderHelper::checkString($result->php_after_getitem)) + if ($result->add_php_after_getitem == 1 && ComponentbuilderHelper::checkString($result->php_after_getitem)) { - if (!isset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code])) + if (!isset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view_code])) { - $this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code] = ''; + $this->customScriptBuilder[$this->target . '_php_after_getitem'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_after_getitem'][$view_code] .= - $this->setDynamicValues(PHP_EOL.PHP_EOL.base64_decode($result->php_after_getitem)); + $this->customScriptBuilder[$this->target . '_php_after_getitem'][$view_code] .= $this->setDynamicValues(PHP_EOL . PHP_EOL . base64_decode($result->php_after_getitem)); unset($result->php_after_getitem); } // add php custom scripting (php_before_getitems) - if($result->add_php_before_getitems == 1 && ComponentbuilderHelper::checkString($result->php_before_getitems)) + if ($result->add_php_before_getitems == 1 && ComponentbuilderHelper::checkString($result->php_before_getitems)) { - if (!isset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code])) + if (!isset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view_code])) { - $this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code] = ''; + $this->customScriptBuilder[$this->target . '_php_before_getitems'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_before_getitems'][$view_code] .= - $this->setDynamicValues(PHP_EOL.PHP_EOL.base64_decode($result->php_before_getitems)); + $this->customScriptBuilder[$this->target . '_php_before_getitems'][$view_code] .= $this->setDynamicValues(PHP_EOL . PHP_EOL . base64_decode($result->php_before_getitems)); unset($result->php_before_getitems); } // add php custom scripting (php_after_getitems) - if($result->add_php_after_getitems == 1 && ComponentbuilderHelper::checkString($result->php_after_getitems)) + if ($result->add_php_after_getitems == 1 && ComponentbuilderHelper::checkString($result->php_after_getitems)) { - if (!isset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code])) + if (!isset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view_code])) { - $this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code] = ''; + $this->customScriptBuilder[$this->target . '_php_after_getitems'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_after_getitems'][$view_code] .= - $this->setDynamicValues(PHP_EOL.PHP_EOL.base64_decode($result->php_after_getitems)); + $this->customScriptBuilder[$this->target . '_php_after_getitems'][$view_code] .= $this->setDynamicValues(PHP_EOL . PHP_EOL . base64_decode($result->php_after_getitems)); unset($result->php_after_getitems); } // add php custom scripting (php_getlistquery) - if($result->add_php_getlistquery == 1 && ComponentbuilderHelper::checkString($result->php_getlistquery)) + if ($result->add_php_getlistquery == 1 && ComponentbuilderHelper::checkString($result->php_getlistquery)) { - if (!isset($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code])) + if (!isset($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view_code])) { - $this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code] = ''; + $this->customScriptBuilder[$this->target . '_php_getlistquery'][$view_code] = ''; } - $this->customScriptBuilder[$this->target.'_php_getlistquery'][$view_code] .= - $this->setDynamicValues(PHP_EOL.base64_decode($result->php_getlistquery)); + $this->customScriptBuilder[$this->target . '_php_getlistquery'][$view_code] .= $this->setDynamicValues(PHP_EOL . base64_decode($result->php_getlistquery)); unset($result->php_getlistquery); } // set the getmethod code name - $result->key = ComponentbuilderHelper::safeString($view_code. ' ' .$result->name . ' ' .$result->id); + $result->key = ComponentbuilderHelper::safeString($view_code . ' ' . $result->name . ' ' . $result->id); // reset buckets $result->main_get = array(); $result->custom_get = array(); @@ -2149,25 +2151,25 @@ class Get switch ($result->main_source) { case 1: - // set the view data - $result->main_get[0]['selection'] = $this->setDataSelection($result->key, $view_code, $result->view_selection, $result->view_table_main, 'a', '', 'view'); - $result->main_get[0]['as'] = 'a'; - $result->main_get[0]['key'] = $result->key; - unset($result->view_selection); - break; + // set the view data + $result->main_get[0]['selection'] = $this->setDataSelection($result->key, $view_code, $result->view_selection, $result->view_table_main, 'a', '', 'view'); + $result->main_get[0]['as'] = 'a'; + $result->main_get[0]['key'] = $result->key; + unset($result->view_selection); + break; case 2: - // set the database data - $result->main_get[0]['selection'] = $this->setDataSelection($result->key, $view_code, $result->db_selection, $result->db_table_main, 'a', '', 'db'); - $result->main_get[0]['as'] = 'a'; - $result->main_get[0]['key'] = $result->key; - unset($result->db_selection); - break; + // set the database data + $result->main_get[0]['selection'] = $this->setDataSelection($result->key, $view_code, $result->db_selection, $result->db_table_main, 'a', '', 'db'); + $result->main_get[0]['as'] = 'a'; + $result->main_get[0]['key'] = $result->key; + unset($result->db_selection); + break; case 3: - // set custom script - $result->main_get[0]['selection'] = array( - 'select' => base64_decode($result->php_custom_get), - 'from' => '', 'table' => '', 'type' => ''); - break; + // set custom script + $result->main_get[0]['selection'] = array( + 'select' => base64_decode($result->php_custom_get), + 'from' => '', 'table' => '', 'type' => ''); + break; } // set join_view_table details $result->join_view_table = json_decode($result->join_view_table, true); @@ -2178,17 +2180,16 @@ class Get if (ComponentbuilderHelper::checkString($option['selection'])) { // convert the type - $option['type'] = $typeArray[$option['type']]; + $option['type'] = $typeArray[$option['type']]; // convert the operator - $option['operator'] = $operatorArray[$option['operator']]; + $option['operator'] = $operatorArray[$option['operator']]; // get the on field values - $on_field = array(); // array(on_field_as, on_field) - $on_field = array_map('trim', explode('.',$option['on_field'])); + $on_field = array(); // array(on_field_as, on_field) + $on_field = array_map('trim', explode('.', $option['on_field'])); // get the join field values - $join_field = array(); // array(join_field_as, join_field) - $join_field = array_map('trim', explode('.',$option['join_field'])); - $option['selection'] = - $this->setDataSelection($result->key, $view_code, $option['selection'], $option['view_table'], $option['as'], $option['row_type'], 'view'); + $join_field = array(); // array(join_field_as, join_field) + $join_field = array_map('trim', explode('.', $option['join_field'])); + $option['selection'] = $this->setDataSelection($result->key, $view_code, $option['selection'], $option['view_table'], $option['as'], $option['row_type'], 'view'); $option['key'] = $result->key; // load to the getters if ($option['row_type'] == 1) @@ -2225,17 +2226,16 @@ class Get if (ComponentbuilderHelper::checkString($option1['selection'])) { // convert the type - $option1['type'] = $typeArray[$option1['type']]; + $option1['type'] = $typeArray[$option1['type']]; // convert the operator - $option1['operator'] = $operatorArray[$option1['operator']]; + $option1['operator'] = $operatorArray[$option1['operator']]; // get the on field values - $on_field = array(); // array(on_field_as, on_field) - $on_field = array_map('trim', explode('.',$option1['on_field'])); + $on_field = array(); // array(on_field_as, on_field) + $on_field = array_map('trim', explode('.', $option1['on_field'])); // get the join field values - $join_field = array(); // array(join_field_as, join_field) - $join_field = array_map('trim', explode('.',$option1['join_field'])); - $option1['selection'] = - $this->setDataSelection($result->key, $view_code, $option1['selection'], $option1['db_table'], $option1['as'], $option1['row_type'], 'db'); + $join_field = array(); // array(join_field_as, join_field) + $join_field = array_map('trim', explode('.', $option1['join_field'])); + $option1['selection'] = $this->setDataSelection($result->key, $view_code, $option1['selection'], $option1['db_table'], $option1['as'], $option1['row_type'], 'db'); $option1['key'] = $result->key; // load to the getters if ($option1['row_type'] == 1) @@ -2319,7 +2319,7 @@ class Get } return false; } - + /** * To limit the SQL Demo date build in the views * @@ -2327,12 +2327,12 @@ class Get * * @return void * - */ + */ public function setSqlTweaking($settings) { if (ComponentbuilderHelper::checkArray($settings)) { - foreach($settings as $setting) + foreach ($settings as $setting) { // should sql dump be added if (1 == $setting['add_sql']) @@ -2347,7 +2347,7 @@ class Get // now get the ids if (strpos($ids, ',') !== false) { - $id_array = (array) array_map('trim',explode(',', $ids)); + $id_array = (array) array_map('trim', explode(',', $ids)); } else { @@ -2364,8 +2364,8 @@ class Get // build range if (count($id_range) == 2) { - $range = range($id_range[0],$id_range[1]); - $id_array_new = array_merge($id_array_new,$range); + $range = range($id_range[0], $id_range[1]); + $id_array_new = array_merge($id_array_new, $range); } } } @@ -2381,20 +2381,19 @@ class Get // sort sort($id_array, SORT_NUMERIC); // now set it to global - $this->sqlTweak[ (int) $setting['adminview']]['where'] = implode(',', $id_array); + $this->sqlTweak[(int) $setting['adminview']]['where'] = implode(',', $id_array); } } } else { // remove all sql dump options - $this->sqlTweak[ (int) $setting['adminview']]['remove'] = true; - + $this->sqlTweak[(int) $setting['adminview']]['remove'] = true; } } } } - + /** * check if an update SQL is needed * @@ -2409,8 +2408,7 @@ class Get protected function setUpdateSQL($old, $new, $type, $key = null) { // check if there were new items added - if (ComponentbuilderHelper::checkArray($new) - && ComponentbuilderHelper::checkArray($old)) + if (ComponentbuilderHelper::checkArray($new) && ComponentbuilderHelper::checkArray($old)) { // check if this is old repeatable field if (isset($new[$type])) @@ -2432,7 +2430,7 @@ class Get elseif (!isset($old[$type])) { // we have new values - foreach($old as $oldItem) + foreach ($old as $oldItem) { if (isset($oldItem[$type])) { @@ -2480,7 +2478,7 @@ class Get elseif (!isset($old[$type])) { // we have new values - foreach($old as $oldItem) + foreach ($old as $oldItem) { if (isset($oldItem[$type])) { @@ -2515,9 +2513,7 @@ class Get } } } - elseif ($key && ComponentbuilderHelper::checkString($new) - && ComponentbuilderHelper::checkString($old) - && $new !== $old) + elseif ($key && ComponentbuilderHelper::checkString($new) && ComponentbuilderHelper::checkString($old) && $new !== $old) { // the string changed, lets add to SQL update if (!isset($this->updateSQL[$type]) || !ComponentbuilderHelper::checkArray($this->updateSQL[$type])) @@ -2525,10 +2521,10 @@ class Get $this->updateSQL[$type] = array(); } // set at key - $this->updateSQL[$type][$key] = array('old' => $old, 'new' => $new); + $this->updateSQL[$type][$key] = array('old' => $old, 'new' => $new); } } - + /** * Set the add sql * @@ -2567,7 +2563,7 @@ class Get } } } - + /** * Get Item History values * @@ -2586,10 +2582,10 @@ class Get $query->select('h.*'); $query->from('#__ucm_history AS h'); - $query->where($this->db->quoteName('h.ucm_item_id') . ' = '. (int) $id); + $query->where($this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id); // Join over the content type for the type id $query->join('LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'); - $query->where('ct.type_alias = ' . $this->db->quote('com_componentbuilder.'.$type)); + $query->where('ct.type_alias = ' . $this->db->quote('com_componentbuilder.' . $type)); $query->order('h.save_date DESC'); $this->db->setQuery($query, 0, 1); $this->db->execute(); @@ -2616,7 +2612,7 @@ class Get } // Join over the content type for the type id $query->join('LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'); - $query->where('ct.type_alias = ' . $this->db->quote('com_componentbuilder.'.$type)); + $query->where('ct.type_alias = ' . $this->db->quote('com_componentbuilder.' . $type)); $query->order('h.save_date DESC'); $this->db->setQuery($query); $this->db->execute(); @@ -2635,14 +2631,14 @@ class Get // return the last used history record or null. return $this->tmpHistory; } - + /** * Set Item History Watch * * @param Object $object The history object * @param int $action The action to take - * 0 = remove watch - * 1 = add watch + * 0 = remove watch + * 1 = add watch * @param string $type The type of item * * @return bool @@ -2664,7 +2660,7 @@ class Get { case 0: // remove watch - if(isset($version_note['component']) && ($key = array_search($this->componentID, $version_note['component'])) !== false) + if (isset($version_note['component']) && ($key = array_search($this->componentID, $version_note['component'])) !== false) { // last version that was used to build/compile $this->tmpHistory = json_decode($object->version_data); @@ -2676,7 +2672,7 @@ class Get // since it was not found, no need to update anything return true; } - break; + break; case 1: // add watch if (!in_array($this->componentID, $version_note['component'])) @@ -2688,7 +2684,7 @@ class Get // since it is there already, no need to update anything return true; } - break; + break; } // check if we need to still keep this locked if (isset($version_note['component']) && ComponentbuilderHelper::checkArray($version_note['component'])) @@ -2707,7 +2703,7 @@ class Get // run the update return $this->db->updateObject('#__ucm_history', $object, 'version_id'); } - + /** * Set Template and Layout Data * @@ -2717,16 +2713,16 @@ class Get * @return void * */ - public function setTemplateAndLayoutData($default,$view) + public function setTemplateAndLayoutData($default, $view) { // set the Tempale date - $temp1 = ComponentbuilderHelper::getAllBetween($default, "\$this->loadTemplate('","')"); - $temp2 = ComponentbuilderHelper::getAllBetween($default, '$this->loadTemplate("','")'); + $temp1 = ComponentbuilderHelper::getAllBetween($default, "\$this->loadTemplate('", "')"); + $temp2 = ComponentbuilderHelper::getAllBetween($default, '$this->loadTemplate("', '")'); $templates = array(); $again = array(); if (ComponentbuilderHelper::checkArray($temp1) && ComponentbuilderHelper::checkArray($temp2)) { - $templates = array_merge($temp1,$temp2); + $templates = array_merge($temp1, $temp2); } else { @@ -2743,25 +2739,26 @@ class Get { foreach ($templates as $template) { - if (!isset($this->templateData[$this->target][$view]) || !array_key_exists($template,$this->templateData[$this->target][$view])) + if (!isset($this->templateData[$this->target][$view]) || !array_key_exists($template, $this->templateData[$this->target][$view])) { - $data = $this->getDataWithAlias($template,'template',$view); + $data = $this->getDataWithAlias($template, 'template', $view); if (ComponentbuilderHelper::checkArray($data)) { $this->templateData[$this->target][$view][$template] = $data; // call self to get child data - $again[] = array($data['html'],$view); - $again[] = array($data['php_view'],$view); + $again[] = array($data['html'], $view); + $again[] = array($data['php_view'], $view); } } } } // set the layout data - $lay1 = ComponentbuilderHelper::getAllBetween($default, "JLayoutHelper::render('","',"); - $lay2 = ComponentbuilderHelper::getAllBetween($default, 'JLayoutHelper::render("','",');; + $lay1 = ComponentbuilderHelper::getAllBetween($default, "JLayoutHelper::render('", "',"); + $lay2 = ComponentbuilderHelper::getAllBetween($default, 'JLayoutHelper::render("', '",'); + ; if (ComponentbuilderHelper::checkArray($lay1) && ComponentbuilderHelper::checkArray($lay2)) { - $layouts = array_merge($lay1,$lay2); + $layouts = array_merge($lay1, $lay2); } else { @@ -2778,15 +2775,15 @@ class Get { foreach ($layouts as $layout) { - if (!isset($this->layoutData[$this->target]) || !ComponentbuilderHelper::checkArray($this->layoutData[$this->target]) || !array_key_exists($layout,$this->layoutData[$this->target])) + if (!isset($this->layoutData[$this->target]) || !ComponentbuilderHelper::checkArray($this->layoutData[$this->target]) || !array_key_exists($layout, $this->layoutData[$this->target])) { - $data = $this->getDataWithAlias($layout,'layout',$view); + $data = $this->getDataWithAlias($layout, 'layout', $view); if (ComponentbuilderHelper::checkArray($data)) { $this->layoutData[$this->target][$layout] = $data; // call self to get child data - $again[] = array($data['html'],$view); - $again[] = array($data['php_view'],$view); + $again[] = array($data['html'], $view); + $again[] = array($data['php_view'], $view); } } } @@ -2795,11 +2792,11 @@ class Get { foreach ($again as $go) { - $this->setTemplateAndLayoutData($go[0],$go[1]); + $this->setTemplateAndLayoutData($go[0], $go[1]); } } } - + /** * Get Data With Alias * @@ -2815,7 +2812,7 @@ class Get // Create a new query object. $query = $this->db->getQuery(true); $query->select('a.*'); - $query->from('#__componentbuilder_'.$table.' AS a'); + $query->from('#__componentbuilder_' . $table . ' AS a'); $this->db->setQuery($query); $rows = $this->db->loadObjectList(); foreach ($rows as $row) @@ -2874,7 +2871,7 @@ class Get $this->uikitComp[$view] = array(); } // set uikit to views - $this->uikitComp[$view] = ComponentbuilderHelper::getUikitComp($contnent,$this->uikitComp[$view]); + $this->uikitComp[$view] = ComponentbuilderHelper::getUikitComp($contnent, $this->uikitComp[$view]); } // set footable to views and turn it on if (!isset($this->footableScripts[$this->target][$view]) || !$this->footableScripts[$this->target][$view]) @@ -2918,7 +2915,7 @@ class Get } return false; } - + /** * Get Library Data and store globaly * @@ -2929,7 +2926,7 @@ class Get */ protected function getLibrary($id) { - + // check if the lib has already been set if (!isset($this->libraries[$id])) { @@ -2938,35 +2935,35 @@ class Get { case 1: // No Library return false; - break; + break; case 3: // Uikit v3 if (2 == $this->uikit || 3 == $this->uikit) { // already being loaded $this->libraries[$id] = false; } - break; + break; case 4: // Uikit v2 if (2 == $this->uikit || 1 == $this->uikit) { // already being loaded $this->libraries[$id] = false; } - break; + break; case 5: // FooTable v2 if (!isset($this->footableVersion) || 2 == $this->footableVersion) { // already being loaded $this->libraries[$id] = false; } - break; + break; case 6: // FooTable v3 if (3 == $this->footableVersion) { // already being loaded $this->libraries[$id] = false; } - break; + break; } } // check if the lib has already been set @@ -2978,43 +2975,42 @@ class Get $query->select( $this->db->quoteName( array( - 'a.id', - 'a.name', - 'a.how', - 'a.type', - 'a.addconditions', - 'b.addconfig', - 'c.addfiles', - 'c.addfolders', - 'c.addurls', - 'a.php_setdocument' - ), - array( - 'id', - 'name', - 'how', - 'type', - 'addconditions', - 'addconfig', - 'addfiles', - 'addfolders', - 'addurls', - 'php_setdocument' - ) + 'a.id', + 'a.name', + 'a.how', + 'a.type', + 'a.addconditions', + 'b.addconfig', + 'c.addfiles', + 'c.addfolders', + 'c.addurls', + 'a.php_setdocument' + ), array( + 'id', + 'name', + 'how', + 'type', + 'addconditions', + 'addconfig', + 'addfiles', + 'addfolders', + 'addurls', + 'php_setdocument' ) - ); + ) + ); // from these tables $query->from('#__componentbuilder_library AS a'); $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.id') . ' = ' . (int) $id); // Reset the query using our newly populated query object. $this->db->setQuery($query); // Load the results as a list of stdClass objects $library = $this->db->loadObject(); - + // check if this lib uses build-in behaviour if ($library->how == 4) { @@ -3040,31 +3036,32 @@ class Get if ($library->how > 0) { // set the addfolders data - $library->addfolders = (isset($library->addfolders) && ComponentbuilderHelper::checkJson($library->addfolders)) ? json_decode($library->addfolders,true):null; + $library->addfolders = (isset($library->addfolders) && ComponentbuilderHelper::checkJson($library->addfolders)) ? json_decode($library->addfolders, true) : null; if (ComponentbuilderHelper::checkArray($library->addfolders)) { $library->folders = array_values($library->addfolders); } // set the addfiles data - $library->addfiles = (isset($library->addfiles) && ComponentbuilderHelper::checkJson($library->addfiles)) ? json_decode($library->addfiles,true):null; + $library->addfiles = (isset($library->addfiles) && ComponentbuilderHelper::checkJson($library->addfiles)) ? json_decode($library->addfiles, true) : null; if (ComponentbuilderHelper::checkArray($library->addfiles)) { $library->files = array_values($library->addfiles); } // set the addurls data - $library->addurls = (isset($library->addurls) && ComponentbuilderHelper::checkJson($library->addurls)) ? json_decode($library->addurls,true):null; + $library->addurls = (isset($library->addurls) && ComponentbuilderHelper::checkJson($library->addurls)) ? json_decode($library->addurls, true) : null; if (ComponentbuilderHelper::checkArray($library->addurls)) { $library->urls = array_values($library->addurls); - } + } // add config fields only if needed if ($library->how > 1) { // set the config data - $library->addconfig = (isset($library->addconfig) && ComponentbuilderHelper::checkJson($library->addconfig)) ? json_decode($library->addconfig,true):null; + $library->addconfig = (isset($library->addconfig) && ComponentbuilderHelper::checkJson($library->addconfig)) ? json_decode($library->addconfig, true) : null; if (ComponentbuilderHelper::checkArray($library->addconfig)) { - $library->config = array_map(function($array) { + $library->config = array_map(function($array) + { $array['alias'] = 0; $array['title'] = 0; $array['settings'] = $this->getFieldData($array['field']); @@ -3085,7 +3082,7 @@ class Get elseif (2 == $library->how) { // set the addconditions data - $library->addconditions = (isset($library->addconditions) && ComponentbuilderHelper::checkJson($library->addconditions)) ? json_decode($library->addconditions,true):null; + $library->addconditions = (isset($library->addconditions) && ComponentbuilderHelper::checkJson($library->addconditions)) ? json_decode($library->addconditions, true) : null; if (ComponentbuilderHelper::checkArray($library->addconditions)) { $library->conditions = array_values($library->addconditions); @@ -3112,7 +3109,7 @@ class Get } return false; } - + /** * Set Language Place Holders * @@ -3125,24 +3122,24 @@ class Get { // get targets to search for $langStringTargets = array_filter( - $this->langStringTargets, - function($get) use($content){ - if (strpos($content, $get) !== false) - { - return true; - } - return false; - }); + $this->langStringTargets, function($get) use($content) + { + if (strpos($content, $get) !== false) + { + return true; + } + return false; + }); // check if we should continue if (ComponentbuilderHelper::checkArray($langStringTargets)) { // insure string is not broken - $content = str_replace('COM_###COMPONENT###',$this->langPrefix,$content); + $content = str_replace('COM_###COMPONENT###', $this->langPrefix, $content); // first get the Joomla.JText._() - if (in_array('Joomla.JText._(',$langStringTargets)) + if (in_array('Joomla.JText._(', $langStringTargets)) { - $jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, "Joomla.JText._('","'"); - $jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'Joomla.JText._("','"'); + $jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, "Joomla.JText._('", "'"); + $jsTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'Joomla.JText._("', '"'); // combine into one array $jsTEXT = ComponentbuilderHelper::mergeArrays($jsTEXT); // we need to add a check to insure these JavaScript lang matchup @@ -3154,10 +3151,10 @@ class Get } } // now get the JText::script() - if (in_array('JText::script(',$langStringTargets)) + if (in_array('JText::script(', $langStringTargets)) { - $scTEXT[] = ComponentbuilderHelper::getAllBetween($content, "JText::script('","'"); - $scTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'JText::script("','"'); + $scTEXT[] = ComponentbuilderHelper::getAllBetween($content, "JText::script('", "'"); + $scTEXT[] = ComponentbuilderHelper::getAllBetween($content, 'JText::script("', '"'); // combine into one array $scTEXT = ComponentbuilderHelper::mergeArrays($scTEXT); // we need to add a check to insure these JavaScript lang matchup @@ -3169,15 +3166,15 @@ class Get } } // set language data - foreach($langStringTargets as $langStringTarget) + foreach ($langStringTargets as $langStringTarget) { // need some special treatment here if ($langStringTarget === 'Joomla.JText._(' || $langStringTarget === 'JText::script(') { continue; } - $langCheck[] = ComponentbuilderHelper::getAllBetween($content, $langStringTarget."'","'"); - $langCheck[] = ComponentbuilderHelper::getAllBetween($content, $langStringTarget.'"','"'); + $langCheck[] = ComponentbuilderHelper::getAllBetween($content, $langStringTarget . "'", "'"); + $langCheck[] = ComponentbuilderHelper::getAllBetween($content, $langStringTarget . '"', '"'); } $langArray = ComponentbuilderHelper::mergeArrays($langCheck); if (ComponentbuilderHelper::checkArray($langArray)) //<-- not really needed hmmm @@ -3185,21 +3182,21 @@ class Get foreach ($langArray as $string) { // this is there to insure we dont break already added Language strings - if (ComponentbuilderHelper::safeString($string,'U') === $string) + if (ComponentbuilderHelper::safeString($string, 'U') === $string) { continue; } // only load if string is not already set - $keyLang = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($string,'U'); + $keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U'); if (!isset($this->langContent[$this->lang][$keyLang])) { $this->langContent[$this->lang][$keyLang] = trim($string); } // load the language targets - foreach($langStringTargets as $langStringTarget) + foreach ($langStringTargets as $langStringTarget) { - $langHolders[$langStringTarget."'".$string."'"] = $langStringTarget."'".$keyLang."'"; - $langHolders[$langStringTarget.'"'.$string.'"'] = $langStringTarget.'"'.$keyLang.'"'; + $langHolders[$langStringTarget . "'" . $string . "'"] = $langStringTarget . "'" . $keyLang . "'"; + $langHolders[$langStringTarget . '"' . $string . '"'] = $langStringTarget . '"' . $keyLang . '"'; } } // only continue if we have value to replace @@ -3211,7 +3208,7 @@ class Get } return $content; } - + /** * Set Data Selection of the dynamic get * @@ -3230,19 +3227,19 @@ class Get { if (ComponentbuilderHelper::checkString($string)) { - $lines = explode(PHP_EOL,$string); + $lines = explode(PHP_EOL, $string); if (ComponentbuilderHelper::checkArray($lines)) { if ('db' === $type) { - $table = '#__'.$asset; + $table = '#__' . $asset; $queryName = $asset; - $view = ''; + $view = ''; } elseif ('view' === $type) { $view = $this->getViewTableName($asset); - $table = '#__'.$this->componentCodeName.'_'.$view; + $table = '#__' . $this->componentCodeName . '_' . $view; $queryName = $view; } $gets = array(); @@ -3250,13 +3247,13 @@ class Get // first load all options foreach ($lines as $line) { - if (strpos($line,'AS') !== false) + if (strpos($line, 'AS') !== false) { - list($get,$key) = explode("AS",$line); + list($get, $key) = explode("AS", $line); } - elseif (strpos($line,'as') !== false) + elseif (strpos($line, 'as') !== false) { - list($get,$key) = explode("as",$line); + list($get, $key) = explode("as", $line); } else { @@ -3267,10 +3264,10 @@ class Get $get = trim($get); $key = trim($key); // only add the view (we must adapt this) - if (isset($this->getAsLookup[$method_key][$get]) && 'a' != $as && 1 == $row_type && 'view' === $type && strpos('#'.$key,'#'.$view.'_') === false) + if (isset($this->getAsLookup[$method_key][$get]) && 'a' != $as && 1 == $row_type && 'view' === $type && strpos('#' . $key, '#' . $view . '_') === false) { // this is a problem (TODO) since we may want to not add the view name. - $key = $view.'_'.trim($key); + $key = $view . '_' . trim($key); } // continue only if we have get if (ComponentbuilderHelper::checkString($get)) @@ -3283,21 +3280,21 @@ class Get } else { - $key = str_replace($as.'.','',$get); + $key = str_replace($as . '.', '', $get); $this->getAsLookup[$method_key][$get] = $key; $keys[] = $this->db->quote($key); } if (ComponentbuilderHelper::checkString($view)) { - $field = str_replace($as.'.','',$get); + $field = str_replace($as . '.', '', $get); $this->siteFields[$view][$field][$method_key] = array('site' => $view_code, 'get' => $get, 'as' => $as, 'key' => $key); } } } if (ComponentbuilderHelper::checkArray($gets) && ComponentbuilderHelper::checkArray($keys)) { - $querySelect = '$query->select($db->quoteName('.PHP_EOL."\t\t\t".'array('.implode(',',$gets).'),'.PHP_EOL."\t\t\t".'array('.implode(',',$keys).')));'; - $queryFrom = '$db->quoteName('.$this->db->quote($table).', '.$this->db->quote($as).')'; + $querySelect = '$query->select($db->quoteName(' . PHP_EOL . "\t\t\t" . 'array(' . implode(',', $gets) . '),' . PHP_EOL . "\t\t\t" . 'array(' . implode(',', $keys) . ')));'; + $queryFrom = '$db->quoteName(' . $this->db->quote($table) . ', ' . $this->db->quote($as) . ')'; // return the select query return array('select' => $querySelect, 'from' => $queryFrom, 'name' => $queryName, 'table' => $table, 'type' => $type, 'select_gets' => $gets, 'select_keys' => $keys); } @@ -3305,7 +3302,7 @@ class Get } return false; } - + /** * Get the View Table Name * @@ -3319,13 +3316,12 @@ class Get // Create a new query object. $query = $this->db->getQuery(true); $query->select($this->db->quoteName(array('a.name_single'))); - $query->from($this->db->quoteName('#__componentbuilder_admin_view','a')); - $query->where($this->db->quoteName('a.id') . ' = '. (int) $id); + $query->from($this->db->quoteName('#__componentbuilder_admin_view', 'a')); + $query->where($this->db->quoteName('a.id') . ' = ' . (int) $id); $this->db->setQuery($query); return ComponentbuilderHelper::safeString($this->db->loadResult()); - } - + /** * Build the SQL dump String for a view * @@ -3349,9 +3345,9 @@ class Get if ($counter === 'a') { // the main table fields - if (strpos($table['sourcemap'],PHP_EOL) !== false) + if (strpos($table['sourcemap'], PHP_EOL) !== false) { - $fields = explode(PHP_EOL,$table['sourcemap']); + $fields = explode(PHP_EOL, $table['sourcemap']); if (ComponentbuilderHelper::checkArray($fields)) { // reset array buckets @@ -3359,18 +3355,18 @@ class Get $targetArray = array(); foreach ($fields as $field) { - if (strpos($field,"=>") !== false) + if (strpos($field, "=>") !== false) { - list($source,$target) = explode("=>",$field); - $sourceArray[] = $counter.'.'.trim($source); + list($source, $target) = explode("=>", $field); + $sourceArray[] = $counter . '.' . trim($source); $targetArray[] = trim($target); } } if (ComponentbuilderHelper::checkArray($sourceArray) && ComponentbuilderHelper::checkArray($targetArray)) { // add to query - $query->select($this->db->quoteName($sourceArray,$targetArray)); - $query->from('#__'.$table['table'].' AS a'); + $query->select($this->db->quoteName($sourceArray, $targetArray)); + $query->from('#__' . $table['table'] . ' AS a'); } // we may need to filter the selection if (isset($this->sqlTweak[$view_id]['where'])) @@ -3384,9 +3380,9 @@ class Get else { // the other tables - if (strpos($table['sourcemap'],PHP_EOL) !== false) + if (strpos($table['sourcemap'], PHP_EOL) !== false) { - $fields = explode(PHP_EOL,$table['sourcemap']); + $fields = explode(PHP_EOL, $table['sourcemap']); if (ComponentbuilderHelper::checkArray($fields)) { // reset array buckets @@ -3394,23 +3390,23 @@ class Get $targetArray = array(); foreach ($fields as $field) { - if (strpos($field,"=>") !== false) + if (strpos($field, "=>") !== false) { - list($source,$target) = explode("=>",$field); - $sourceArray[] = $counter.'.'.trim($source); + list($source, $target) = explode("=>", $field); + $sourceArray[] = $counter . '.' . trim($source); $targetArray[] = trim($target); } - if (strpos($field,"==") !== false) + if (strpos($field, "==") !== false) { - list($aKey,$bKey) = explode("==",$field); + list($aKey, $bKey) = explode("==", $field); // add to query - $query->join('LEFT', $this->db->quoteName('#__'.$table['table'], $counter) . ' ON (' . $this->db->quoteName('a.'.trim($aKey)) . ' = ' . $this->db->quoteName($counter.'.'.trim($bKey)) . ')'); + $query->join('LEFT', $this->db->quoteName('#__' . $table['table'], $counter) . ' ON (' . $this->db->quoteName('a.' . trim($aKey)) . ' = ' . $this->db->quoteName($counter . '.' . trim($bKey)) . ')'); } } if (ComponentbuilderHelper::checkArray($sourceArray) && ComponentbuilderHelper::checkArray($targetArray)) { // add to query - $query->select($this->db->quoteName($sourceArray,$targetArray)); + $query->select($this->db->quoteName($sourceArray, $targetArray)); } } } @@ -3426,13 +3422,13 @@ class Get $data = $this->db->loadObjectList(); // start building the MySql dump $dump = "--"; - $dump .= PHP_EOL."-- Dumping data for table `#__[[[component]]]_".$view."`"; - $dump .= PHP_EOL."--"; - $dump .= PHP_EOL.PHP_EOL."INSERT INTO `#__[[[component]]]_".$view."` ("; + $dump .= PHP_EOL . "-- Dumping data for table `#__[[[component]]]_" . $view . "`"; + $dump .= PHP_EOL . "--"; + $dump .= PHP_EOL . PHP_EOL . "INSERT INTO `#__[[[component]]]_" . $view . "` ("; foreach ($data as $line) { $comaSet = 0; - foreach($line as $fieldName => $fieldValue) + foreach ($line as $fieldName => $fieldValue) { if ($comaSet == 0) { @@ -3440,7 +3436,7 @@ class Get } else { - $dump .= ", ".$this->db->quoteName($fieldName); + $dump .= ", " . $this->db->quoteName($fieldName); } $comaSet++; } @@ -3452,14 +3448,14 @@ class Get { if ($coma == 0) { - $dump .= PHP_EOL."("; + $dump .= PHP_EOL . "("; } else { - $dump .= ",".PHP_EOL."("; + $dump .= "," . PHP_EOL . "("; } $comaSet = 0; - foreach($line as $fieldName => $fieldValue) + foreach ($line as $fieldName => $fieldValue) { if ($comaSet == 0) { @@ -3467,7 +3463,7 @@ class Get } else { - $dump .= ", ". $this->mysql_escape($fieldValue); + $dump .= ", " . $this->mysql_escape($fieldValue); } $comaSet++; } @@ -3481,7 +3477,7 @@ class Get } return false; } - + /** * Escape the values for a SQL dump * @@ -3493,24 +3489,24 @@ class Get public function mysql_escape($value) { // if array then return maped - if(ComponentbuilderHelper::checkArray($value)) + if (ComponentbuilderHelper::checkArray($value)) { return array_map(__METHOD__, $value); } // if string make sure it is correctly escaped - if(ComponentbuilderHelper::checkString($value) && !is_numeric($value)) + if (ComponentbuilderHelper::checkString($value) && !is_numeric($value)) { return $this->db->quote($value); } // if empty value return place holder - if(empty($value)) + if (empty($value)) { return "''"; } // if not array or string then return number return $value; } - + /** * Creating an uniqueCode * @@ -3521,15 +3517,15 @@ class Get */ public function uniqueCode($code) { - if (!isset($this->uniquecodes[$this->target]) || !in_array($code,$this->uniquecodes[$this->target])) + if (!isset($this->uniquecodes[$this->target]) || !in_array($code, $this->uniquecodes[$this->target])) { $this->uniquecodes[$this->target][] = $code; return $code; } // make sure it is unique - return $this->uniqueCode($code.$this->uniquekey(1)); + return $this->uniqueCode($code . $this->uniquekey(1)); } - + /** * Creating an unique local key * @@ -3563,7 +3559,7 @@ class Get $this->uniquekeys[] = $key; return $key; } - + /** * Check for footable scripts * @@ -3574,13 +3570,13 @@ class Get */ public function getFootableScripts($content) { - if (strpos($content,'footable') !== false) + if (strpos($content, 'footable') !== false) { return true; } return false; } - + /** * Check for getModules script * @@ -3591,13 +3587,13 @@ class Get */ public function getGetModule($content) { - if (strpos($content,'this->getModules(') !== false) + if (strpos($content, 'this->getModules(') !== false) { return true; } return false; } - + /** * Check for get Google Chart script * @@ -3608,13 +3604,13 @@ class Get */ public function getGoogleChart($content) { - if (strpos($content,'Chartbuilder(') !== false) + if (strpos($content, 'Chartbuilder(') !== false) { return true; } return false; } - + /** * Set the dynamic values in strings here * @@ -3631,7 +3627,7 @@ class Get } return $string; } - + /** * We start set the custom code data & can load it in to string * @@ -3647,11 +3643,11 @@ class Get // insure the code is loaded $loaded = false; // check if content has custom code place holder - if (strpos($string, '[CUSTO'.'MCODE=') !== false) + if (strpos($string, '[CUSTO' . 'MCODE=') !== false) { // the ids found in this content $bucket = array(); - $found = ComponentbuilderHelper::getAllBetween($string, '[CUSTO'.'MCODE=', ']'); + $found = ComponentbuilderHelper::getAllBetween($string, '[CUSTO' . 'MCODE=', ']'); if (ComponentbuilderHelper::checkArray($found)) { foreach ($found as $key) @@ -3711,7 +3707,7 @@ class Get { if (strpos($array[1], ',') !== false) { - $this->customCodeData[$id]['args'][$key] = explode(',', $array[1]); + $this->customCodeData[$id]['args'][$key] = explode(',', $array[1]); } elseif (ComponentbuilderHelper::checkString($array[1])) { @@ -3719,7 +3715,7 @@ class Get $this->customCodeData[$id]['args'][$key][] = $array[1]; } } - } + } } else { @@ -3747,7 +3743,7 @@ class Get } return $string; } - + /** * Insert the custom code into the string * @@ -3759,14 +3755,14 @@ class Get protected function insertCustomCode($string) { $code = array(); - foreach($this->customCode as $item) + foreach ($this->customCode as $item) { $this->buildCustomCodePlaceholders($item, $code); } // now update the string return $this->setPlaceholders($string, $code); } - + /** * Insert the custom code into the string * @@ -3774,7 +3770,7 @@ class Get * * @return string on success * - */ + */ protected function buildCustomCodePlaceholders($item, &$code) { // check if there is args for this code @@ -3786,7 +3782,7 @@ class Get foreach ($this->customCodeData[$item['id']]['args'] as $key => $args) { $this->setThesePlaceHolders('arg', $args); - $code['[CUSTOM'.'CODE='.$key.']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders). $placeholder['end']; + $code['[CUSTOM' . 'CODE=' . $key . ']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders) . $placeholder['end']; } // always clear the args $this->clearFromPlaceHolders('arg'); @@ -3798,7 +3794,7 @@ class Get $keyPlaceholder = $item['id']; } // check what type of place holders we should load here - $placeholderType = (int) $item['comment_type'].'2'; + $placeholderType = (int) $item['comment_type'] . '2'; if (stripos($item['code'], '[[[view') !== false || stripos($item['code'], '[[[sview') !== false || stripos($item['code'], '[[[arg') !== false) { // if view is being set dynamicly then we can't update this code via IDE (TODO) @@ -3807,11 +3803,11 @@ class Get // if now ars were found, clear it $this->clearFromPlaceHolders('arg'); // load args for this code - $placeholder = $this->getPlaceHolder($placeholderType, $item['id']); - $code['[CUSTOM'.'CODE='.$keyPlaceholder.']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders). $placeholder['end']; + $placeholder = $this->getPlaceHolder($placeholderType, $item['id']); + $code['[CUSTOM' . 'CODE=' . $keyPlaceholder . ']'] = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($item['code'], $this->placeholders) . $placeholder['end']; } } - + /** * Set a type of placeholder with set of values * @@ -3829,12 +3825,12 @@ class Get $number = 0; foreach ($values as $value) { - $this->placeholders['[[['.$key.$number.']]]'] = $value; + $this->placeholders['[[[' . $key . $number . ']]]'] = $value; $number++; } } } - + /** * Remove a type of placeholder by main string * @@ -3852,7 +3848,7 @@ class Get } } } - + /** * to unset stuff that are private or protected * @@ -3861,7 +3857,7 @@ class Get { unset($this->$remove); } - + /** * Get the other languages * @@ -3875,11 +3871,14 @@ class Get { // Create a new query object. $query = $this->db->getQuery(true); - $query->from($this->db->quoteName('#__componentbuilder_language_translation','a')); + $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); if (ComponentbuilderHelper::checkArray($values)) { - $query->select($this->db->quoteName(array('a.id','a.translation','a.entranslation','a.components','a.published'))); - $query->where($this->db->quoteName('a.entranslation') . ' IN (' . implode(',',array_map(function($a){ return $this->db->quote($a); }, $values)) . ')'); + $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.entranslation', 'a.components', 'a.published'))); + $query->where($this->db->quoteName('a.entranslation') . ' IN (' . implode(',', array_map(function($a) + { + return $this->db->quote($a); + }, $values)) . ')'); $this->db->setQuery($query); $this->db->execute(); if ($this->db->getNumRows()) @@ -3889,7 +3888,7 @@ class Get } return false; } - + /** * Set the Current language values to DB * @@ -3917,8 +3916,7 @@ class Get $this->multiLangString[$string]['translation'] = json_decode($this->multiLangString[$string]['translation'], true); } // if we have an array continue - if (isset($this->multiLangString[$string]['translation']) - && ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation'])) + if (isset($this->multiLangString[$string]['translation']) && ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation'])) { // great lets build the multi languages strings foreach ($this->multiLangString[$string]['translation'] as $translations) @@ -3945,7 +3943,7 @@ class Get } } // do the database managment - if(ComponentbuilderHelper::checkString($string) && ($key = array_search($string, $strings)) !== false) + if (ComponentbuilderHelper::checkString($string) && ($key = array_search($string, $strings)) !== false) { if (isset($this->multiLangString[$string])) { @@ -3988,14 +3986,14 @@ class Get else { // add the new lang placeholder to the db - $this->newLangStrings[$counterInsert] = array(); - $this->newLangStrings[$counterInsert][] = $this->db->quote(json_encode(array($this->componentID))); // 'components' - $this->newLangStrings[$counterInsert][] = $this->db->quote($string); // 'entranslation' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'published' - $this->newLangStrings[$counterInsert][] = $this->db->quote($today); // 'created' - $this->newLangStrings[$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'version' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'access' + $this->newLangStrings[$counterInsert] = array(); + $this->newLangStrings[$counterInsert][] = $this->db->quote(json_encode(array($this->componentID))); // 'components' + $this->newLangStrings[$counterInsert][] = $this->db->quote($string); // 'entranslation' + $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'published' + $this->newLangStrings[$counterInsert][] = $this->db->quote($today); // 'created' + $this->newLangStrings[$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' + $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'version' + $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'access' $counterInsert++; @@ -4011,7 +4009,7 @@ class Get $this->setExistingLangStrings(); $this->setNewLangStrings(); } - + /** * store the language placeholders * @@ -4028,11 +4026,11 @@ class Get $query = $this->db->getQuery(true); $continue = false; // Insert columns. - $columns = array('components','entranslation','published','created','created_by','version','access'); + $columns = array('components', 'entranslation', 'published', 'created', 'created_by', 'version', 'access'); // Prepare the insert query. $query->insert($this->db->quoteName('#__componentbuilder_language_translation')); $query->columns($this->db->quoteName($columns)); - foreach($this->newLangStrings as $values) + foreach ($this->newLangStrings as $values) { if (count($values) == 7) { @@ -4054,8 +4052,8 @@ class Get $this->db->setQuery($query); $this->db->execute(); } - } - + } + /** * update the language placeholders * @@ -4068,7 +4066,7 @@ class Get { if (count($this->existingLangStrings) >= $when) { - foreach($this->existingLangStrings as $values) + foreach ($this->existingLangStrings as $values) { // Create a new query object. $query = $this->db->getQuery(true); @@ -4079,10 +4077,10 @@ class Get $this->db->execute(); } // clear the values array - $this->existingLangStrings = array(); + $this->existingLangStrings = array(); } - } - + } + /** * Remove exiting language translation stings * @@ -4095,10 +4093,10 @@ class Get { // Create a new query object. $query = $this->db->getQuery(true); - + // delete all custom keys for user 1001. $conditions = array( - $this->db->quoteName('id') . ' = ' . (int) $id + $this->db->quoteName('id') . ' = ' . (int) $id ); $query->delete($this->db->quoteName('#__componentbuilder_language_translation')); @@ -4107,7 +4105,7 @@ class Get $this->db->setQuery($query); $this->db->execute(); } - + /** * Function to purge the unused languge strings * @@ -4120,10 +4118,13 @@ class Get { // Create a new query object. $query = $this->db->getQuery(true); - $query->from($this->db->quoteName('#__componentbuilder_language_translation','a')); - $query->select($this->db->quoteName(array('a.id','a.translation','a.components'))); + $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); + $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.components'))); // get all string that are not linked to this component - $query->where($this->db->quoteName('a.entranslation') . ' NOT IN (' . implode(',',array_map(function($a){ return $this->db->quote($a); }, $values)) . ')'); + $query->where($this->db->quoteName('a.entranslation') . ' NOT IN (' . implode(',', array_map(function($a) + { + return $this->db->quote($a); + }, $values)) . ')'); $query->where($this->db->quoteName('a.published') . ' = 1'); $this->db->setQuery($query); $this->db->execute(); @@ -4185,7 +4186,7 @@ class Get $this->setExistingLangStrings(); } } - + /** * just to add lang string to the existing Lang Strings array * @@ -4195,17 +4196,17 @@ class Get protected function setUpdateExistingLangStrings($id, $components, $published, $today, $counterUpdate) { // start the bucket for this lang - $this->existingLangStrings[$counterUpdate] = array(); - $this->existingLangStrings[$counterUpdate]['id'] = (int) $id; - $this->existingLangStrings[$counterUpdate]['conditions'] = array(); - $this->existingLangStrings[$counterUpdate]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); - $this->existingLangStrings[$counterUpdate]['fields'] = array(); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('components') . ' = ' . $this->db->quote(json_encode($components)); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('published') . ' = ' . $this->db->quote($published); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified') . ' = ' . $this->db->quote($today); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote((int) $this->user->id); + $this->existingLangStrings[$counterUpdate] = array(); + $this->existingLangStrings[$counterUpdate]['id'] = (int) $id; + $this->existingLangStrings[$counterUpdate]['conditions'] = array(); + $this->existingLangStrings[$counterUpdate]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); + $this->existingLangStrings[$counterUpdate]['fields'] = array(); + $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('components') . ' = ' . $this->db->quote(json_encode($components)); + $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('published') . ' = ' . $this->db->quote($published); + $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified') . ' = ' . $this->db->quote($today); + $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote((int) $this->user->id); } - + /** * get the custom code from the system * @@ -4218,13 +4219,13 @@ class Get $loadInMemory = false; // Create a new query object. $query = $this->db->getQuery(true); - $query->from($this->db->quoteName('#__componentbuilder_custom_code','a')); + $query->from($this->db->quoteName('#__componentbuilder_custom_code', 'a')); if (ComponentbuilderHelper::checkArray($ids)) { if ($idArray = $this->customCodeMemory($ids)) { - $query->select($this->db->quoteName(array('a.id','a.code','a.comment_type'))); - $query->where($this->db->quoteName('a.id') . ' IN (' . implode(',',$idArray) . ')'); + $query->select($this->db->quoteName(array('a.id', 'a.code', 'a.comment_type'))); + $query->where($this->db->quoteName('a.id') . ' IN (' . implode(',', $idArray) . ')'); $query->where($this->db->quoteName('a.target') . ' = 2'); // <--- to load the correct target $loadInMemory = true; } @@ -4236,8 +4237,8 @@ class Get } else { - $query->select($this->db->quoteName(array('a.id','a.code','a.comment_type','a.component','a.from_line','a.hashtarget','a.hashendtarget','a.path','a.to_line','a.type'))); - $query->where($this->db->quoteName('a.component') . ' = '. (int) $this->componentData->id); + $query->select($this->db->quoteName(array('a.id', 'a.code', 'a.comment_type', 'a.component', 'a.from_line', 'a.hashtarget', 'a.hashendtarget', 'a.path', 'a.to_line', 'a.type'))); + $query->where($this->db->quoteName('a.component') . ' = ' . (int) $this->componentData->id); $query->where($this->db->quoteName('a.target') . ' = 1'); // <--- to load the correct target $query->order($this->db->quoteName('a.from_line') . ' ASC'); // <--- insrue we always add code from top of file // reset custom code @@ -4250,7 +4251,7 @@ class Get { $bucket = $this->db->loadAssocList('id'); // open the code - foreach($bucket as $nr => &$customCode) + foreach ($bucket as $nr => &$customCode) { $customCode['code'] = base64_decode($customCode['code']); if ($setLang) @@ -4276,7 +4277,7 @@ class Get } return false; } - + /** * check if we already have these ids in local memory * @@ -4302,7 +4303,7 @@ class Get } return false; } - + /** * store the code * @@ -4319,11 +4320,11 @@ class Get $query = $this->db->getQuery(true); $continue = false; // Insert columns. - $columns = array('path','type','target','comment_type','component','published','created','created_by','version','access','hashtarget','from_line','to_line','code','hashendtarget'); + $columns = array('path', 'type', 'target', 'comment_type', 'component', 'published', 'created', 'created_by', 'version', 'access', 'hashtarget', 'from_line', 'to_line', 'code', 'hashendtarget'); // Prepare the insert query. $query->insert($this->db->quoteName('#__componentbuilder_custom_code')); $query->columns($this->db->quoteName($columns)); - foreach($this->newCustomCode as $values) + foreach ($this->newCustomCode as $values) { if (count($values) == 15) { @@ -4346,7 +4347,7 @@ class Get $this->db->execute(); } } - + /** * store the code * @@ -4359,7 +4360,7 @@ class Get { if (count($this->existingCustomCode) >= $when) { - foreach($this->existingCustomCode as $code) + foreach ($this->existingCustomCode as $code) { // Create a new query object. $query = $this->db->getQuery(true); @@ -4370,10 +4371,10 @@ class Get $this->db->execute(); } // clear the values array - $this->existingCustomCode = array(); + $this->existingCustomCode = array(); } } - + /** * get the custom code from the local files * @@ -4389,12 +4390,12 @@ class Get $joomla = getcwd(); $counter = array(1 => 0, 2 => 0); // file types to get - $fileTypes = array('\.php', '\.js'); + $fileTypes = array('\.php', '\.js'); // set some local placeholders $placeholders = array(); - $placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F').'Helper::'] = '[[[Component]]]Helper::'; - $placeholders['COM_'.ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_[[[COMPONENT]]]'; - $placeholders['com_'.$this->componentCodeName] = 'com_[[[component]]]'; + $placeholders[ComponentbuilderHelper::safeString($this->componentCodeName, 'F') . 'Helper::'] = '[[[Component]]]Helper::'; + $placeholders['COM_' . ComponentbuilderHelper::safeString($this->componentCodeName, 'U')] = 'COM_[[[COMPONENT]]]'; + $placeholders['com_' . $this->componentCodeName] = 'com_[[[component]]]'; foreach ($paths as $target => $path) { // we are changing the working directory to the componet path @@ -4432,7 +4433,7 @@ class Get $this->setExistingCustomCode(); } } - + /** * search a file for placeholders and store result * @@ -4448,26 +4449,26 @@ class Get protected function searchFileContent(&$counter, &$file, &$target, &$searchArray, &$placeholders, &$today) { // reset each time per file - $loadEndFingerPrint = false; - $endFingerPrint = array(); - $fingerPrint = array(); - $codeBucket = array(); - $pointer = array(); - $reading = array(); - $reader = 0; + $loadEndFingerPrint = false; + $endFingerPrint = array(); + $fingerPrint = array(); + $codeBucket = array(); + $pointer = array(); + $reading = array(); + $reader = 0; // reset found Start type - $commentType = 0; + $commentType = 0; // make sure we have the path correct (the script file is not in admin path for example) // there may be more... will nead to keep our eye on this... since files could be moved during install $file = str_replace('./', '', $file); if ($file !== 'script.php') { - $path = $target . '/' . $file; + $path = $target . '/' . $file; } else { - $path = $file; - } + $path = $file; + } foreach (new SplFileObject($file) as $lineNumber => $lineContent) { // we musk keep last few lines to dynamic find target entry later @@ -4479,18 +4480,18 @@ class Get } foreach ($searchArray as $type => $search) { - $i = (int) ($type == 3 ||$type == 4) ? 2 : 1; - $_type = (int) ($type == 1 || $type == 3) ? 1 : 2; + $i = (int) ($type == 3 || $type == 4) ? 2 : 1; + $_type = (int) ($type == 1 || $type == 3) ? 1 : 2; if ($reader === 0 || $reader === $i) { - $targetKey = $type; - $start = '/***['.$search.'***/'; - $end = '/***[/'.$search.'***/'; - $startHTML = ''; - $endHTML = ''; + $targetKey = $type; + $start = '/***[' . $search . '***/'; + $end = '/***[/' . $search . '***/'; + $startHTML = ''; + $endHTML = ''; // check if the ending place holder was found - if(isset($reading[$targetKey]) && $reading[$targetKey] && - ((trim($lineContent) === $end || strpos($lineContent, $end) !== false) || + if (isset($reading[$targetKey]) && $reading[$targetKey] && + ((trim($lineContent) === $end || strpos($lineContent, $end) !== false) || (trim($lineContent) === $endHTML || strpos($lineContent, $endHTML) !== false))) { // trim the placeholder and if there is still data then load it @@ -4499,31 +4500,31 @@ class Get $codeBucket[$pointer[$targetKey]][] = $_line; } // deactivate the reader - $reading[$targetKey] = false; + $reading[$targetKey] = false; if ($_type == 2) { // deactivate search - $reader = 0; + $reader = 0; } else { // activate fingerPrint for replacement end target - $loadEndFingerPrint = true; - $backupTargetKey = $targetKey; - $backupI = $i; + $loadEndFingerPrint = true; + $backupTargetKey = $targetKey; + $backupI = $i; } // all new records we can do a bulk insert if ($i === 1) { // end the bucket info for this code block - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $lineNumber); // 'toline' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $lineNumber); // 'toline' // first reverse engineer this code block $c0de = $this->reversePlaceholders(implode('', $codeBucket[$pointer[$targetKey]]), $placeholders); - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(base64_encode($c0de)); // 'code' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(base64_encode($c0de)); // 'code' if ($_type == 2) { // load the last value - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(0); // 'hashendtarget' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(0); // 'hashendtarget' } } // the record already exist so we must update instead @@ -4544,12 +4545,12 @@ class Get // check if the endfingerprint is ready to save if (count($endFingerPrint) === 3) { - $hashendtarget = '3__'.md5(implode('',$endFingerPrint)); + $hashendtarget = '3__' . md5(implode('', $endFingerPrint)); // all new records we can do a bulk insert if ($i === 1) { // load the last value - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($hashendtarget); // 'hashendtarget' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($hashendtarget); // 'hashendtarget' } // the record already exist so we must use module to update elseif ($i === 2) @@ -4557,10 +4558,10 @@ class Get $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('hashendtarget') . ' = ' . $this->db->quote($hashendtarget); } // reset the needed values - $endFingerPrint = array(); - $loadEndFingerPrint = false; + $endFingerPrint = array(); + $loadEndFingerPrint = false; // deactivate reader (to allow other search) - $reader = 0; + $reader = 0; } // then read in the code if (isset($reading[$targetKey]) && $reading[$targetKey]) @@ -4570,20 +4571,20 @@ class Get // see if the custom code line starts now with PHP/JS comment type if ((!isset($reading[$targetKey]) || !$reading[$targetKey]) && (($i === 1 && trim($lineContent) === $start) || strpos($lineContent, $start) !== false)) { - $commentType = 1; // PHP/JS type - $startReplace = $start; - $endReplace = $end; + $commentType = 1; // PHP/JS type + $startReplace = $start; + $endReplace = $end; } // see if the custom code line starts now with HTML comment type elseif ((!isset($reading[$targetKey]) || !$reading[$targetKey]) && (($i === 1 && trim($lineContent) === $startHTML) || strpos($lineContent, $startHTML) !== false)) { - $commentType = 2; // HTML type - $startReplace = $startHTML; - $endReplace = $endHTML; + $commentType = 2; // HTML type + $startReplace = $startHTML; + $endReplace = $endHTML; } // check if the starting place holder was found - if($commentType > 0) - { + if ($commentType > 0) + { // if we have all on one line we have a problem (don't load it TODO) if (strpos($lineContent, $endReplace) !== false) { @@ -4612,71 +4613,70 @@ class Get // start replace $startReplace = $this->setStartReplace($id, $commentType, $startReplace); // set active reader (to lock out other search) - $reader = $i; + $reader = $i; // set pointer - $pointer[$targetKey] = $counter[$i]; + $pointer[$targetKey] = $counter[$i]; // activate the reader - $reading[$targetKey] = true; + $reading[$targetKey] = true; // start code bucket - $codeBucket[$pointer[$targetKey]] = array(); + $codeBucket[$pointer[$targetKey]] = array(); // trim the placeholder and if there is still data then load it if ($_line = $this->addLineChecker($startReplace, 1, $lineContent)) { $codeBucket[$pointer[$targetKey]][] = $_line; } // get the finger print around the custom code - $inFinger = count($fingerPrint); - $getFinger = $inFinger - 1; - $hasharray = array_slice($fingerPrint, -$inFinger, $getFinger, true); - $hasleng = count($hasharray); - $hashtarget = $hasleng.'__'.md5(implode('',$hasharray)); + $inFinger = count($fingerPrint); + $getFinger = $inFinger - 1; + $hasharray = array_slice($fingerPrint, -$inFinger, $getFinger, true); + $hasleng = count($hasharray); + $hashtarget = $hasleng . '__' . md5(implode('', $hasharray)); // all new records we can do a buldk insert if ($i === 1 || !$id) { // start the bucket for this code - $this->newCustomCode[$pointer[$targetKey]] = array(); - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($path); // 'path' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $_type); // 'type' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'target' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($commentType); // 'comment_type' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $this->componentID); // 'component' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'published' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($today); // 'created' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $this->user->id); // 'created_by' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'version' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'access' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($hashtarget); // 'hashtarget' - $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $lineNumber); // 'fromline' + $this->newCustomCode[$pointer[$targetKey]] = array(); + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($path); // 'path' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $_type); // 'type' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'target' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($commentType); // 'comment_type' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $this->componentID); // 'component' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'published' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($today); // 'created' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $this->user->id); // 'created_by' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'version' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote(1); // 'access' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote($hashtarget); // 'hashtarget' + $this->newCustomCode[$pointer[$targetKey]][] = $this->db->quote((int) $lineNumber); // 'fromline' } // the record already exist so we must update instead elseif ($i === 2 && $id > 0) { // start the bucket for this code - $this->existingCustomCode[$pointer[$targetKey]] = array(); - $this->existingCustomCode[$pointer[$targetKey]]['id'] = (int) $id; - $this->existingCustomCode[$pointer[$targetKey]]['conditions'] = array(); - $this->existingCustomCode[$pointer[$targetKey]]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); - $this->existingCustomCode[$pointer[$targetKey]]['fields'] = array(); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('path') . ' = ' . $this->db->quote($path); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('type') . ' = ' . $this->db->quote($_type); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('comment_type') . ' = ' . $this->db->quote($commentType); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('component') . ' = ' . $this->db->quote($this->componentID); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('from_line') . ' = ' . $this->db->quote($lineNumber); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('modified') . ' = ' . $this->db->quote($today); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote($this->user->id); - $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('hashtarget') . ' = ' . $this->db->quote($hashtarget); + $this->existingCustomCode[$pointer[$targetKey]] = array(); + $this->existingCustomCode[$pointer[$targetKey]]['id'] = (int) $id; + $this->existingCustomCode[$pointer[$targetKey]]['conditions'] = array(); + $this->existingCustomCode[$pointer[$targetKey]]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); + $this->existingCustomCode[$pointer[$targetKey]]['fields'] = array(); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('path') . ' = ' . $this->db->quote($path); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('type') . ' = ' . $this->db->quote($_type); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('comment_type') . ' = ' . $this->db->quote($commentType); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('component') . ' = ' . $this->db->quote($this->componentID); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('from_line') . ' = ' . $this->db->quote($lineNumber); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('modified') . ' = ' . $this->db->quote($today); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote($this->user->id); + $this->existingCustomCode[$pointer[$targetKey]]['fields'][] = $this->db->quoteName('hashtarget') . ' = ' . $this->db->quote($hashtarget); } else // this should actualy never happen { // de activate the reader - $reading[$targetKey] = false; - $reader = 0; - + $reading[$targetKey] = false; + $reader = 0; } // reset found comment type $commentType = 0; // update the counter - $counter[$i]++; + $counter[$i] ++; } } } @@ -4692,7 +4692,7 @@ class Get if (count($endFingerPrint) > 0) { $leng = count($endFingerPrint); - $hashendtarget = $leng . '__' . md5(implode('',$endFingerPrint)); + $hashendtarget = $leng . '__' . md5(implode('', $endFingerPrint)); } else { @@ -4702,7 +4702,7 @@ class Get if ($backupI === 1) { // load the last value - $this->newCustomCode[$pointer[$backupTargetKey]][] = $this->db->quote($hashendtarget); // 'hashendtarget' + $this->newCustomCode[$pointer[$backupTargetKey]][] = $this->db->quote($hashendtarget); // 'hashendtarget' } // the record already exist so we must use module to update elseif ($backupI === 2) @@ -4711,7 +4711,7 @@ class Get } } } - + /** * Check if this line should be added * @@ -4725,7 +4725,7 @@ class Get protected function addLineChecker($replaceKey, $type, $lineContent) { $check = explode($replaceKey, $lineContent); - switch($type) + switch ($type) { case 1: // beginning of code @@ -4734,7 +4734,7 @@ class Get { return $check[1]; } - break; + break; case 2: // end of code $i = trim($check[0]); @@ -4742,11 +4742,11 @@ class Get { return $check[0]; } - break; + break; } return false; } - + /** * search for the system id in the line given * @@ -4761,19 +4761,19 @@ class Get { if ($id > 0) { - switch($commentType) + switch ($commentType) { case 1: // the PHP & JS type - $startReplace .= '/*'.$id.'*/'; - break; + $startReplace .= '/*' . $id . '*/'; + break; case 2: // the HTML type - $startReplace .= ''; - break; + $startReplace .= ''; + break; } } return $startReplace; } - + /** * search for the system id in the line given * @@ -4791,7 +4791,7 @@ class Get $trim = '', - 'end' => ''); + 'start' => '', + 'end' => ''); } else { return array( - 'start' => "\t\t\t", + 'start' => "\t\t\t", 'end' => "\t\t\t"); } break; @@ -5016,25 +5016,25 @@ class Get if ($this->addPlaceholders === true) { return array( - 'start' => '', - 'end' => ''); + 'start' => '', + 'end' => ''); } else { return array( - 'start' => "\t\t\t", + 'start' => "\t\t\t", 'end' => "\t\t\t"); } break; case 3: return array( - 'start' => "\t\t\t", - 'end' => "\t\t\t"); + 'start' => "\t\t\t", + 'end' => "\t\t\t"); break; } return false; } - + /** * get the local installed path of this component * @@ -5046,11 +5046,11 @@ class Get // set the local paths to search $localPaths = array(); // admin path - $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_'. $this->componentCodeName; + $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_' . $this->componentCodeName; // site path - $localPaths['site'] = JPATH_ROOT . '/components/com_'. $this->componentCodeName; + $localPaths['site'] = JPATH_ROOT . '/components/com_' . $this->componentCodeName; // TODO later to include the JS and CSS - $localPaths['media'] = JPATH_ROOT . '/media/com_'. $this->componentCodeName; + $localPaths['media'] = JPATH_ROOT . '/media/com_' . $this->componentCodeName; // check if the local install is found foreach ($localPaths as $key => $localPath) { @@ -5065,4 +5065,5 @@ class Get } return false; } + } diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index aaa5207df..1b0971dc1 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -1,27 +1,28 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| + /-------------------------------------------------------------------------------------------------------------------------------/ + + @version 2.6.x + @created 30th April, 2015 + @package Component Builder + @subpackage compiler.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + + /----------------------------------------------------------------------------------------------------------------------------- */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); @@ -30,291 +31,292 @@ defined('_JEXEC') or die('Restricted access'); * Structure class */ class Structure extends Get -{ +{ + /** * The foulder counter * * @var int */ public $folderCount = 0; - + /** * The foulder counter * * @var int */ public $fileCount = 0; - + /** * The page counter * * @var int */ public $pageCount = 0; - + /** * The line counter * * @var int */ public $lineCount = 0; - + /** * The field counter * * @var int */ public $fieldCount = 0; - + /** * The seconds counter * * @var int */ public $seconds = 0; - + /** * The actual seconds counter * * @var int */ public $actualSeconds = 0; - + /** * The folder seconds counter * * @var int */ public $folderSeconds = 0; - + /** * The file seconds counter * * @var int */ public $fileSeconds = 0; - + /** * The line seconds counter * * @var int */ public $lineSeconds = 0; - + /** * The seconds debugging counter * * @var int */ public $secondsDebugging = 0; - + /** * The seconds planning counter * * @var int */ public $secondsPlanning = 0; - + /** * The seconds mapping counter * * @var int */ public $secondsMapping = 0; - + /** * The seconds office counter * * @var int */ public $secondsOffice = 0; - + /** * The total hours counter * * @var int */ public $totalHours = 0; - + /** * The debugging hours counter * * @var int */ public $debuggingHours = 0; - + /** * The planning hours counter * * @var int */ public $planningHours = 0; - + /** * The mapping hours counter * * @var int */ public $mappingHours = 0; - + /** * The office hours counter * * @var int */ public $officeHours = 0; - + /** * The actual Total Hours counter * * @var int */ public $actualTotalHours = 0; - + /** * The actual hours spent counter * * @var int */ public $actualHoursSpent = 0; - + /** * The actual days spent counter * * @var int */ public $actualDaysSpent = 0; - + /** * The total days counter * * @var int */ public $totalDays = 0; - + /** * The actual Total Days counter * * @var int */ public $actualTotalDays = 0; - + /** * The project week time counter * * @var int */ public $projectWeekTime = 0; - + /** * The project month time counter * * @var int */ public $projectMonthTime = 0; - + /** * The Joomla Version * * @var string */ public $joomlaVersion; - + /** * The template path * * @var string */ public $templatePath; - + /** * The custom template path * * @var string */ public $templatePathCustom; - + /** * The Joomla Version Data * * @var object */ public $joomlaVersionData; - + /** * Static File Content * * @var array */ public $fileContentStatic = array(); - + /** * Dynamic File Content * * @var array */ public $fileContentDynamic = array(); - + /** * The Component Sales name * * @var string */ public $componentSalesName; - + /** * The Component Backup name * * @var string */ public $componentBackupName; - + /** * The Component Folder name * * @var string */ public $componentFolderName; - + /** * The Component path * * @var string */ public $componentPath; - + /** * The not new static items * * @var array */ public $notNew = array(); - + /** * The new files * * @var array */ public $newFiles = array(); - + /** * The Checkin Switch * * @var boolean */ public $addCheckin = false; - + /** * The array of last modified dates * * @var array */ protected $lastModifiedDate = array(); - + /** * Constructor */ - public function __construct($config = array ()) + public function __construct($config = array()) { // first we run the perent constructor if (parent::__construct($config)) @@ -322,24 +324,24 @@ class Structure extends Get // run global updater ComponentbuilderHelper::runGlobalUpdater(); // set the Joomla version - $this->joomlaVersion = $config['joomlaVersion']; + $this->joomlaVersion = $config['joomlaVersion']; // set the template path - $this->templatePath = $this->compilerPath.'/joomla_'.$config['joomlaVersion']; + $this->templatePath = $this->compilerPath . '/joomla_' . $config['joomlaVersion']; // set some default names - $this->componentSalesName = 'com_'.$this->componentData->sales_name.'__J'.$this->joomlaVersion; - $this->componentBackupName = 'com_'.$this->componentData->sales_name.'_v'.str_replace('.','_',$this->componentData->component_version).'__J'.$this->joomlaVersion; - $this->componentFolderName = 'com_'.$this->componentData->name_code.'_v'.str_replace('.','_',$this->componentData->component_version).'__J'.$this->joomlaVersion; - + $this->componentSalesName = 'com_' . $this->componentData->sales_name . '__J' . $this->joomlaVersion; + $this->componentBackupName = 'com_' . $this->componentData->sales_name . '_v' . str_replace('.', '_', $this->componentData->component_version) . '__J' . $this->joomlaVersion; + $this->componentFolderName = 'com_' . $this->componentData->name_code . '_v' . str_replace('.', '_', $this->componentData->component_version) . '__J' . $this->joomlaVersion; + // set component folder path - $this->componentPath = $this->compilerPath.'/'.$this->componentFolderName; + $this->componentPath = $this->compilerPath . '/' . $this->componentFolderName; // set the template path for custom - $this->templatePathCustom = $this->params->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR.'/custom'); + $this->templatePathCustom = $this->params->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR . '/custom'); // make sure there is no old build $this->removeFolder($this->componentPath); // load the libraries files/folders and url's $this->setLibaries(); // set the Joomla Version Data - $this->joomlaVersionData = $this->setJoomlaVersionData(); + $this->joomlaVersionData = $this->setJoomlaVersionData(); // set the new folders if (!$this->setFolders()) { @@ -359,7 +361,7 @@ class Structure extends Get } return false; } - + /** * Set the line number in comments * @@ -372,11 +374,11 @@ class Structure extends Get { if ($this->debugLinenr) { - return ' [Structure '.$nr.']'; + return ' [Structure ' . $nr . ']'; } return ''; } - + /** * Build the Libraries files, folders, url's and config * @@ -396,14 +398,14 @@ class Structure extends Get $this->indexHTML(''); } // create media path if not set - if (!JFolder::exists( $this->componentPath . '/media')) + if (!JFolder::exists($this->componentPath . '/media')) { JFolder::create($this->componentPath . '/media'); // count the folder created $this->folderCount++; $this->indexHTML('/media'); } - foreach($this->libraries as $id => &$library) + foreach ($this->libraries as $id => &$library) { if (ComponentbuilderHelper::checkObject($library)) { @@ -429,7 +431,7 @@ class Structure extends Get if (isset($library->urls) && ComponentbuilderHelper::checkArray($library->urls)) { // build media folder path - $libFolder = strtolower( preg_replace('/\s+/', '-', ComponentbuilderHelper::safeString($library->name, 'filename', ' ', false))); + $libFolder = strtolower(preg_replace('/\s+/', '-', ComponentbuilderHelper::safeString($library->name, 'filename', ' ', false))); $mediaPath = '/media/' . $libFolder; // should we add the local folder $addLocalFolder = false; @@ -439,7 +441,7 @@ class Structure extends Get if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) && ComponentbuilderHelper::checkString($url['url'])) { // create media/lib path if not set - if (!JFolder::exists( $this->componentPath . $mediaPath)) + if (!JFolder::exists($this->componentPath . $mediaPath)) { JFolder::create($this->componentPath . $mediaPath); // count the folder created @@ -491,7 +493,7 @@ class Structure extends Get { $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = ''; } - $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL."\t\t".$libFolder.""; + $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t" . $libFolder . ""; } } // if config fields are found load into component config (avoiding dublicates) @@ -499,7 +501,8 @@ class Structure extends Get { foreach ($library->config as $cofig) { - $found = array_filter($this->componentData->config, function($item) use($cofig) { + $found = array_filter($this->componentData->config, function($item) use($cofig) + { return $item['field'] == $cofig['field']; }); // set the config data if not found @@ -513,7 +516,7 @@ class Structure extends Get } } } - + /** * Write data to file * @@ -524,7 +527,7 @@ class Structure extends Get { return ComponentbuilderHelper::writeFile($path, $data); } - + /** * Build the Initial Folders * @@ -546,9 +549,9 @@ class Structure extends Get // now build all folders needed for this component foreach ($this->joomlaVersionData->create as $main => $folders) { - if (!JFolder::exists($this->componentPath.'/'.$main)) + if (!JFolder::exists($this->componentPath . '/' . $main)) { - JFolder::create($this->componentPath.'/'.$main); + JFolder::create($this->componentPath . '/' . $main); // count the folder created $this->folderCount++; $this->indexHTML($main); @@ -557,79 +560,79 @@ class Structure extends Get { foreach ($folders as $sub => $subFolders) { - if (!JFolder::exists($this->componentPath.'/'.$main.'/'.$sub)) + if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub)) { - JFolder::create($this->componentPath.'/'.$main.'/'.$sub); + JFolder::create($this->componentPath . '/' . $main . '/' . $sub); // count the folder created $this->folderCount++; - $this->indexHTML($main.'/'.$sub); + $this->indexHTML($main . '/' . $sub); } if (ComponentbuilderHelper::checkObject($subFolders)) { foreach ($subFolders as $sub_2 => $subFolders_2) { - if (!JFolder::exists($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2)) + if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2)) { - JFolder::create($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2); + JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2); // count the folder created $this->folderCount++; - $this->indexHTML($main.'/'.$sub.'/'.$sub_2); + $this->indexHTML($main . '/' . $sub . '/' . $sub_2); } if (ComponentbuilderHelper::checkObject($subFolders_2)) { foreach ($subFolders_2 as $sub_3 => $subFolders_3) { - if (!JFolder::exists($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3)) + if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3)) { - JFolder::create($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3); + JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3); // count the folder created $this->folderCount++; - $this->indexHTML($main.'/'.$sub.'/'.$sub_2.'/'.$sub_3); + $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3); } if (ComponentbuilderHelper::checkObject($subFolders_3)) { foreach ($subFolders_3 as $sub_4 => $subFolders_4) { - if (!JFolder::exists($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4)) + if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4)) { - JFolder::create($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4); + JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4); // count the folder created $this->folderCount++; - $this->indexHTML($main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4); + $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4); } if (ComponentbuilderHelper::checkObject($subFolders_4)) { foreach ($subFolders_4 as $sub_5 => $subFolders_5) { - if (!JFolder::exists($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5)) + if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5)) { - JFolder::create($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5); + JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5); // count the folder created $this->folderCount++; - $this->indexHTML($main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5); + $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5); } if (ComponentbuilderHelper::checkObject($subFolders_5)) { foreach ($subFolders_5 as $sub_6 => $subFolders_6) { - if (!JFolder::exists($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5.'/'.$sub_6)) + if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6)) { - JFolder::create($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5.'/'.$sub_6); + JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6); // count the folder created $this->folderCount++; - $this->indexHTML($main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5.'/'.$sub_6); + $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6); } if (ComponentbuilderHelper::checkObject($subFolders_6)) { foreach ($subFolders_6 as $sub_7 => $subFolders_7) { - if (!JFolder::exists($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5.'/'.$sub_6.'/'.$sub_7)) + if (!JFolder::exists($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6 . '/' . $sub_7)) { - JFolder::create($this->componentPath.'/'.$main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5.'/'.$sub_6.'/'.$sub_7); + JFolder::create($this->componentPath . '/' . $main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6 . '/' . $sub_7); // count the folder created $this->folderCount++; - $this->indexHTML($main.'/'.$sub.'/'.$sub_2.'/'.$sub_3.'/'.$sub_4.'/'.$sub_5.'/'.$sub_6.'/'.$sub_7); + $this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3 . '/' . $sub_4 . '/' . $sub_5 . '/' . $sub_6 . '/' . $sub_7); } } } @@ -650,7 +653,7 @@ class Structure extends Get } return false; } - + /** * Set the Static File & Folder * @@ -668,12 +671,12 @@ class Structure extends Get // do license check $LICENSE = false; $licenseChecker = strtolower($this->componentData->license); - if (strpos($licenseChecker,'gnu') !== false && strpos($licenseChecker,'gpl') !== false) + if (strpos($licenseChecker, 'gnu') !== false && strpos($licenseChecker, 'gpl') !== false) { $LICENSE = true; } // do README check - $README = false; + $README = false; // add the README file if needed if ($this->componentData->addreadme) { @@ -711,27 +714,27 @@ class Structure extends Get continue; } // set destination path - $zipPath = str_replace('c0mp0n3nt/','', $details->path); - $path = str_replace('c0mp0n3nt/',$this->componentPath.'/', $details->path); + $zipPath = str_replace('c0mp0n3nt/', '', $details->path); + $path = str_replace('c0mp0n3nt/', $this->componentPath . '/', $details->path); // set the template folder path $templatePath = (isset($details->custom) && $details->custom) ? $this->templatePathCustom : $this->templatePath; // now mov the file if ($details->type === 'file') { // move the file to its place - JFile::copy($templatePath.'/'.$item, $path.'/'.$new); + JFile::copy($templatePath . '/' . $item, $path . '/' . $new); // count the file created $this->fileCount++; // store the new files - if (!in_array($ftem,$this->notNew)) + if (!in_array($ftem, $this->notNew)) { - $this->newFiles['static'][] = array( 'path' => $path.'/'.$new, 'name' => $new, 'zip' => $zipPath.'/'.$new ); + $this->newFiles['static'][] = array('path' => $path . '/' . $new, 'name' => $new, 'zip' => $zipPath . '/' . $new); } } elseif ($details->type === 'folder') { // move the folder to its place - JFolder::copy($templatePath.'/'.$item, $path.'/'.$new); + JFolder::copy($templatePath . '/' . $item, $path . '/' . $new); // count the folder created $this->folderCount++; } @@ -740,7 +743,7 @@ class Structure extends Get } return false; } - + /** * Set the Dynamic File & Folder * @@ -755,7 +758,7 @@ class Structure extends Get { // setup dashboard $target = array('admin' => $this->componentData->name_code); - $this->buildDynamique($target,'dashboard'); + $this->buildDynamique($target, 'dashboard'); // now the rest of the views foreach ($this->componentData->admin_views as $nr => $view) { @@ -766,21 +769,21 @@ class Structure extends Get if ($view['settings']->name_list != 'null') { $target = array('admin' => $view['settings']->name_list); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version); - $this->buildDynamique($target,'list', false, $config); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $this->buildDynamique($target, 'list', false, $config); } if ($view['settings']->name_single != 'null') { $target = array('admin' => $view['settings']->name_single); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version); - $this->buildDynamique($target,'single', false, $config); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $this->buildDynamique($target, 'single', false, $config); } - if ( isset($view['edit_create_site_view']) && $view['edit_create_site_view']) + if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) { // setup the front site edit-view files $target = array('site' => $view['settings']->name_single); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version); - $this->buildDynamique($target,'edit', false, $config); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $this->buildDynamique($target, 'edit', false, $config); } } // quick set of checkin once @@ -803,15 +806,15 @@ class Structure extends Get { // set list view $target = array('site' => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version); - $this->buildDynamique($target,'list', false, $config); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $this->buildDynamique($target, 'list', false, $config); } elseif ($view['settings']->main_get->gettype == 1) { // set single view $target = array('site' => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version); - $this->buildDynamique($target,'single', false, $config); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $this->buildDynamique($target, 'single', false, $config); } } $front = true; @@ -826,14 +829,14 @@ class Structure extends Get { // set list view$view $target = array('custom_admin' => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version); - $this->buildDynamique($target,'list', false, $config); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $this->buildDynamique($target, 'list', false, $config); } elseif ($view['settings']->main_get->gettype == 1) { // set single view $target = array('custom_admin' => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); $this->buildDynamique($target, 'single', false, $config); } } @@ -846,7 +849,7 @@ class Structure extends Get } return false; } - + /** * get the created date of the (view) * @@ -856,7 +859,7 @@ class Structure extends Get * */ public function getCreatedDate($view) - { + { if (isset($view['settings']->created) && ComponentbuilderHelper::checkString($view['settings']->created)) { // first set the main date @@ -869,7 +872,7 @@ class Structure extends Get } return JFactory::getDate($date)->format('jS F, Y'); } - + /** * get the last modified date of a MVC (view) * @@ -881,9 +884,7 @@ class Structure extends Get public function getLastModifiedDate($view) { // first set the main date - if (isset($view['settings']->modified) - && ComponentbuilderHelper::checkString($view['settings']->modified) - && '0000-00-00 00:00:00' !== $view['settings']->modified) + if (isset($view['settings']->modified) && ComponentbuilderHelper::checkString($view['settings']->modified) && '0000-00-00 00:00:00' !== $view['settings']->modified) { $date = strtotime($view['settings']->modified); } @@ -895,7 +896,7 @@ class Structure extends Get // search for the last modified date if (isset($view['adminview'])) { - $id = $view['adminview'].'admin'; + $id = $view['adminview'] . 'admin'; // now check if value has been set if (!isset($this->lastModifiedDate[$id])) { @@ -903,9 +904,7 @@ class Structure extends Get { foreach ($view['settings']->fields as $field) { - if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings']) - && isset($field['settings']->modified) && ComponentbuilderHelper::checkString($field['settings']->modified) - && '0000-00-00 00:00:00' !== $field['settings']->modified) + if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings']) && isset($field['settings']->modified) && ComponentbuilderHelper::checkString($field['settings']->modified) && '0000-00-00 00:00:00' !== $field['settings']->modified) { $anotherDate = strtotime($field['settings']->modified); if ($anotherDate > $date) @@ -918,14 +917,12 @@ class Structure extends Get } } elseif (isset($view['siteview'])) - { - $id = $view['siteview'].'site'; + { + $id = $view['siteview'] . 'site'; // now check if value has been set if (!isset($this->lastModifiedDate[$id])) { - if (isset($view['settings']->main_get->modified) - && ComponentbuilderHelper::checkString($view['settings']->main_get->modified) - && '0000-00-00 00:00:00' !== $view['settings']->main_get->modified) + if (isset($view['settings']->main_get->modified) && ComponentbuilderHelper::checkString($view['settings']->main_get->modified) && '0000-00-00 00:00:00' !== $view['settings']->main_get->modified) { $anotherDate = strtotime($view['settings']->main_get->modified); if ($anotherDate > $date) @@ -936,14 +933,12 @@ class Structure extends Get } } elseif (isset($view['customadminview'])) - { - $id = $view['customadminview'].'customadmin'; + { + $id = $view['customadminview'] . 'customadmin'; // now check if value has been set if (!isset($this->lastModifiedDate[$id])) { - if (isset($view['settings']->main_get->modified) - && ComponentbuilderHelper::checkString($view['settings']->main_get->modified) - && '0000-00-00 00:00:00' !== $view['settings']->main_get->modified) + if (isset($view['settings']->main_get->modified) && ComponentbuilderHelper::checkString($view['settings']->main_get->modified) && '0000-00-00 00:00:00' !== $view['settings']->main_get->modified) { $anotherDate = strtotime($view['settings']->main_get->modified); if ($anotherDate > $date) @@ -963,10 +958,10 @@ class Structure extends Get { $this->lastModifiedDate[$id] = $date; } - + return JFactory::getDate($this->lastModifiedDate[$id])->format('jS F, Y'); } - + /** * Set the Static File & Folder * @@ -982,7 +977,7 @@ class Structure extends Get { if (ComponentbuilderHelper::checkArray($target)) { - foreach ($target as $main => $name) + foreach ($target as $main => $name) { // make sure it is lower case $name = ComponentbuilderHelper::safeString($name); @@ -992,17 +987,17 @@ class Structure extends Get if ($details->type == $type) { // set destination path - $path = ''; - if (strpos($details->path,'VIEW') !== false) + $path = ''; + if (strpos($details->path, 'VIEW') !== false) { - $path = str_replace('VIEW',$name,$details->path); + $path = str_replace('VIEW', $name, $details->path); } else { $path = $details->path; } - $zipPath = str_replace('c0mp0n3nt/','', $path); - $path = str_replace('c0mp0n3nt/',$this->componentPath.'/', $path); + $zipPath = str_replace('c0mp0n3nt/', '', $path); + $path = str_replace('c0mp0n3nt/', $this->componentPath . '/', $path); // setup the folder if (!JFolder::exists($path)) @@ -1018,7 +1013,7 @@ class Structure extends Get if ($fileName) { $new = str_replace($details->rename, $fileName, $item); - $name = $name.'_'.$fileName; + $name = $name . '_' . $fileName; } elseif ($details->rename === 'new') { @@ -1033,15 +1028,15 @@ class Structure extends Get { $new = $item; } - if (!JFile::exists($path.'/'.$new)) + if (!JFile::exists($path . '/' . $new)) { // move the file to its place - JFile::copy($this->templatePath.'/'.$item, $path.'/'.$new,'',true); + JFile::copy($this->templatePath . '/' . $item, $path . '/' . $new, '', true); // count the file created $this->fileCount++; } // setup array for new file - $newFIle = array( 'path' => $path.'/'.$new, 'name' => $new , 'view' => $name, 'zip' => $zipPath.'/'.$new); + $newFIle = array('path' => $path . '/' . $new, 'name' => $new, 'view' => $name, 'zip' => $zipPath . '/' . $new); if (ComponentbuilderHelper::checkArray($config)) { $newFIle['config'] = $config; @@ -1055,7 +1050,7 @@ class Structure extends Get } return false; } - + /** * set the Joomla Version Data * @@ -1066,44 +1061,44 @@ class Structure extends Get private function setJoomlaVersionData() { // set the version data - $versionData = json_decode(ComponentbuilderHelper::getFileContents($this->templatePath.'/settings.json')); + $versionData = json_decode(ComponentbuilderHelper::getFileContents($this->templatePath . '/settings.json')); // add custom folders if ((isset($this->componentData->folders) && ComponentbuilderHelper::checkArray($this->componentData->folders)) || $this->addEximport || $this->uikit || $this->footable) { if ($this->addEximport) { // move the import view folder in place - $importView = array( 'folder' => 'importViews', 'path' => 'admin/views/import', 'rename' => 1); + $importView = array('folder' => 'importViews', 'path' => 'admin/views/import', 'rename' => 1); $this->componentData->folders[] = $importView; // move the PHPExel Folder - $PHPExcel = array( 'folder' => 'PHPExcel', 'path' => 'admin/helpers', 'rename' => 0); + $PHPExcel = array('folder' => 'PHPExcel', 'path' => 'admin/helpers', 'rename' => 0); $this->componentData->folders[] = $PHPExcel; } if (2 == $this->uikit || 1 == $this->uikit) { // move the UIKIT Folder into place - $uikit = array( 'folder' => 'uikit-v2', 'path' => 'media', 'rename' => 0); + $uikit = array('folder' => 'uikit-v2', 'path' => 'media', 'rename' => 0); $this->componentData->folders[] = $uikit; - } + } if (2 == $this->uikit || 3 == $this->uikit) { // move the UIKIT-3 Folder into place - $uikit = array( 'folder' => 'uikit-v3', 'path' => 'media', 'rename' => 0); + $uikit = array('folder' => 'uikit-v3', 'path' => 'media', 'rename' => 0); $this->componentData->folders[] = $uikit; } if ($this->footable && (!isset($this->footableVersion) || 2 == $this->footableVersion)) { // move the footable folder into place - $footable = array( 'folder' => 'footable-v2', 'path' => 'media', 'rename' => 0); + $footable = array('folder' => 'footable-v2', 'path' => 'media', 'rename' => 0); $this->componentData->folders[] = $footable; } elseif ($this->footable && 3 == $this->footableVersion) { // move the footable folder into place - $footable = array( 'folder' => 'footable-v3', 'path' => 'media', 'rename' => 0); + $footable = array('folder' => 'footable-v3', 'path' => 'media', 'rename' => 0); $this->componentData->folders[] = $footable; } - + // pointer tracker $pointer_tracker = 'h'; foreach ($this->componentData->folders as $custom) @@ -1112,16 +1107,16 @@ class Structure extends Get $custom['path'] = rtrim($custom['path'], '/'); $custom['path'] = ltrim($custom['path'], '/'); // make sure we use the correct name - $pathArray = (array) explode('/',$custom['path']); + $pathArray = (array) explode('/', $custom['path']); $firstFolder = array_values($pathArray)[0]; $lastFolder = end($pathArray); // only rename folder if last has folder name if (isset($custom['rename']) && $custom['rename'] == 1) { - $custom['path'] = str_replace('/'.$lastFolder,'',$custom['path']); + $custom['path'] = str_replace('/' . $lastFolder, '', $custom['path']); $rename = 'new'; $newname = $lastFolder; - if(($tkey = array_search($lastFolder, $pathArray)) !== false) + if (($tkey = array_search($lastFolder, $pathArray)) !== false) { unset($pathArray[$tkey]); } @@ -1139,7 +1134,7 @@ class Structure extends Get } if (count($pathArray) == 1 && $firstFolder === 'media') { - $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL."\t\t".$lastFolder.""; + $this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t" . $lastFolder . ""; } // check if we sould add it to the site xml list if (!isset($this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'])) @@ -1148,7 +1143,7 @@ class Structure extends Get } if (count($pathArray) == 1 && $firstFolder === 'site') { - $this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= PHP_EOL."\t\t".$lastFolder.""; + $this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= PHP_EOL . "\t\t" . $lastFolder . ""; } // check if we sould add it to the admin xml list if (!isset($this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'])) @@ -1157,15 +1152,15 @@ class Structure extends Get } if (count($pathArray) == 1 && $firstFolder === 'admin') { - $this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL."\t\t\t".$lastFolder.""; + $this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL . "\t\t\t" . $lastFolder . ""; } // make we have not duplicates - $key_pointer = ComponentbuilderHelper::safeString($custom['folder']).'_f'.$pointer_tracker; + $key_pointer = ComponentbuilderHelper::safeString($custom['folder']) . '_f' . $pointer_tracker; $pointer_tracker++; // set new folder to object $versionData->move->static->$key_pointer = new stdClass(); $versionData->move->static->$key_pointer->naam = $custom['folder']; - $versionData->move->static->$key_pointer->path = 'c0mp0n3nt/'.$custom['path']; + $versionData->move->static->$key_pointer->path = 'c0mp0n3nt/' . $custom['path']; $versionData->move->static->$key_pointer->rename = $rename; $versionData->move->static->$key_pointer->newName = $newname; $versionData->move->static->$key_pointer->type = 'folder'; @@ -1180,24 +1175,24 @@ class Structure extends Get if ($this->addEximport) { // move the PHPExel main file - $PHPExcel = array( 'file' => 'PHPExcel.php', 'path' => 'admin/helpers', 'rename' => 0); + $PHPExcel = array('file' => 'PHPExcel.php', 'path' => 'admin/helpers', 'rename' => 0); $this->componentData->files[] = $PHPExcel; } if ($this->googlechart) { // move the google chart files - $googleChart = array( 'file' => 'google.jsapi.js', 'path' => 'media/js', 'rename' => 0); + $googleChart = array('file' => 'google.jsapi.js', 'path' => 'media/js', 'rename' => 0); $this->componentData->files[] = $googleChart; - $googleChart = array( 'file' => 'chartbuilder.php', 'path' => 'admin/helpers', 'rename' => 0); + $googleChart = array('file' => 'chartbuilder.php', 'path' => 'admin/helpers', 'rename' => 0); $this->componentData->files[] = $googleChart; } - + // pointer tracker $pointer_tracker = 'h'; foreach ($this->componentData->files as $custom) { // make we have not duplicates - $key_pointer = ComponentbuilderHelper::safeString($custom['file']).'_g'.$pointer_tracker; + $key_pointer = ComponentbuilderHelper::safeString($custom['file']) . '_g' . $pointer_tracker; $pointer_tracker++; // set new file to object $versionData->move->static->$key_pointer = new stdClass(); @@ -1208,7 +1203,7 @@ class Structure extends Get { $pathInfo['dirname'] = rtrim($pathInfo['dirname'], '/'); $pathInfo['dirname'] = ltrim($pathInfo['dirname'], '/'); - $versionData->move->static->$key_pointer->path = 'c0mp0n3nt/'.$pathInfo['dirname']; + $versionData->move->static->$key_pointer->path = 'c0mp0n3nt/' . $pathInfo['dirname']; $versionData->move->static->$key_pointer->rename = 'new'; $versionData->move->static->$key_pointer->newName = $pathInfo['basename']; // set the name @@ -1218,7 +1213,7 @@ class Structure extends Get { $custom['path'] = rtrim($custom['path'], '/'); $custom['path'] = ltrim($custom['path'], '/'); - $versionData->move->static->$key_pointer->path = 'c0mp0n3nt/'.$custom['path']; + $versionData->move->static->$key_pointer->path = 'c0mp0n3nt/' . $custom['path']; $versionData->move->static->$key_pointer->rename = false; // set the name $name = $custom['file']; @@ -1236,7 +1231,7 @@ class Structure extends Get } return $versionData; } - + /** * set the index.html file in a folder path * @@ -1249,18 +1244,18 @@ class Structure extends Get { if (strlen($path) > 0) { - JFile::copy($this->templatePath.'/index.html', $this->componentPath.'/'.$path.'/index.html'); + JFile::copy($this->templatePath . '/index.html', $this->componentPath . '/' . $path . '/index.html'); // count the file created $this->fileCount++; } else { - JFile::copy($this->templatePath.'/index.html', $this->componentPath.'/index.html'); + JFile::copy($this->templatePath . '/index.html', $this->componentPath . '/index.html'); // count the file created $this->fileCount++; } } - + /** * Remove folders with files * diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index e17e33744..6d30f7308 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -1,27 +1,28 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| + /-------------------------------------------------------------------------------------------------------------------------------/ + + @version 2.6.x + @created 30th April, 2015 + @package Component Builder + @subpackage compiler.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + + /----------------------------------------------------------------------------------------------------------------------------- */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); @@ -31,12 +32,12 @@ defined('_JEXEC') or die('Restricted access'); */ class Fields extends Structure { + /** * Metadate Switch * * @var array */ - public $metadataBuilder = array(); /** @@ -45,315 +46,315 @@ class Fields extends Structure * @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(); - + /** * Category other name bucket * * @var array */ public $catOtherName = array(); - + /** * list of fields that are not being escaped * * @var array */ public $doNotEscape = 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 * * @var array */ public $basicEncryptionBuilder = array(); - + /** * Advnaced Encryption Builder * * @var array */ public $advancedEncryptionBuilder = array(); - + /** * Get Items Method List String Fix Builder * * @var array */ public $getItemsMethodListStringFixBuilder = array(); - + /** * Get Items Method Eximport String Fix Builder * * @var array */ public $getItemsMethodEximportStringFixBuilder = array(); - + /** * Selection Translation Fix Builder * * @var array */ - public $selectionTranslationFixBuilder = array(); - + public $selectionTranslationFixBuilder = array(); + /** * Sort Builder * * @var array */ public $sortBuilder = array(); - + /** * Search Builder * * @var array */ public $searchBuilder = array(); - + /** * Filter Builder * * @var array */ public $filterBuilder = array(); - + /** * Set Group Control * * @var array */ public $setGroupControl = array(); - + /** * Set Field Names * * @var array */ - public $fieldsNames = array(); - + public $fieldsNames = array(); + /** * Set unique Names * * @var array */ public $uniqueNames = array(); - + /** * Default Fields * * @var array */ public $defaultFields = array('created', 'created_by', 'modified', 'modified_by', 'published', 'ordering', 'access', 'version', 'hits', 'id'); - + /** * Default Fields set to publishing * * @var array */ public $newPublishingFields = array(); - + /** * Default Fields set to publishing * * @var array */ public $movedPublishingFields = array(); - + /** * Set the line number in comments * @@ -366,7 +367,7 @@ class Fields extends Structure { if ($this->debugLinenr) { - return ' [Fields '.$nr.']'; + return ' [Fields ' . $nr . ']'; } return ''; } @@ -487,13 +488,13 @@ class Fields extends Structure if (!isset($this->fieldsNames[$viewName]['id'])) { $attributes = array( - 'name' => 'id', - 'type' => 'text', - 'class' => 'readonly', - 'label' => 'JGLOBAL_FIELD_ID_LABEL', - 'description' => 'JGLOBAL_FIELD_ID_DESC', - 'size' => 10, - 'default' => 0 + 'name' => 'id', + 'type' => 'text', + 'class' => 'readonly', + 'label' => 'JGLOBAL_FIELD_ID_LABEL', + 'description' => 'JGLOBAL_FIELD_ID_DESC', + 'size' => 10, + 'default' => 0 ); $fieldXML = $fieldSetXML->addChild('field'); $this->xmlAddAttributes($fieldXML, $attributes); @@ -504,13 +505,13 @@ class Fields extends Structure if (!isset($this->fieldsNames[$viewName]['created'])) { $attributes = array( - 'name' => 'created', - 'type' => 'calendar', - 'label' => $langView . '_CREATED_DATE_LABEL', - 'description' => $langView . '_CREATED_DATE_DESC', - 'size' => 22, - 'format' => '%Y-%m-%d %H:%M:%S', - 'filter' => 'user_utc' + 'name' => 'created', + 'type' => 'calendar', + 'label' => $langView . '_CREATED_DATE_LABEL', + 'description' => $langView . '_CREATED_DATE_DESC', + 'size' => 22, + 'format' => '%Y-%m-%d %H:%M:%S', + 'filter' => 'user_utc' ); $attributes = array_merge($attributes, $readOnlyXML); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Created Field. Type: Calendar (joomla)"); @@ -523,10 +524,10 @@ class Fields extends Structure if (!isset($this->fieldsNames[$viewName]['created_by'])) { $attributes = array( - 'name' => 'created_by', - 'type' => 'user', - 'label' => $langView . '_CREATED_BY_LABEL', - 'description' => $langView . '_CREATED_BY_DESC', + 'name' => 'created_by', + 'type' => 'user', + 'label' => $langView . '_CREATED_BY_LABEL', + 'description' => $langView . '_CREATED_BY_DESC', ); $attributes = array_merge($attributes, $readOnlyXML); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Created Field. Type: User (joomla)"); @@ -539,9 +540,9 @@ class Fields extends Structure if (!isset($this->fieldsNames[$viewName]['published'])) { $attributes = array( - 'name' => 'published', - 'type' => 'list', - 'label' => 'JSTATUS' + 'name' => 'published', + 'type' => 'list', + 'label' => 'JSTATUS' ); $attributes = array_merge($attributes, $readOnlyXML); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Published Field. Type: List (joomla)"); @@ -560,15 +561,15 @@ class Fields extends Structure if (!isset($this->fieldsNames[$viewName]['modified'])) { $attributes = array( - 'name' => 'modified', - 'type' => 'calendar', - 'class' => 'readonly', - 'label' => $langView . '_MODIFIED_DATE_LABEL', - 'description' => $langView . '_MODIFIED_DATE_DESC', - 'size' => 22, - 'readonly' => "true", - 'format' => '%Y-%m-%d %H:%M:%S', - 'filter' => 'user_utc' + 'name' => 'modified', + 'type' => 'calendar', + 'class' => 'readonly', + 'label' => $langView . '_MODIFIED_DATE_LABEL', + 'description' => $langView . '_MODIFIED_DATE_DESC', + 'size' => 22, + 'readonly' => "true", + 'format' => '%Y-%m-%d %H:%M:%S', + 'filter' => 'user_utc' ); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Modified Field. Type: Calendar (joomla)"); $fieldXML = $fieldSetXML->addChild('field'); @@ -580,13 +581,13 @@ class Fields extends Structure if (!isset($this->fieldsNames[$viewName]['modified_by'])) { $attributes = array( - 'name' => 'modified_by', - 'type' => 'user', - 'label' => $langView . '_MODIFIED_BY_LABEL', - 'description' => $langView . '_MODIFIED_BY_DESC', - 'class' => 'readonly', - 'readonly' => 'true', - 'filter' => 'unset' + 'name' => 'modified_by', + 'type' => 'user', + 'label' => $langView . '_MODIFIED_BY_LABEL', + 'description' => $langView . '_MODIFIED_BY_DESC', + 'class' => 'readonly', + 'readonly' => 'true', + 'filter' => 'unset' ); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Modified Field. Type: User (joomla)"); $fieldXML = $fieldSetXML->addChild('field'); @@ -598,12 +599,12 @@ class Fields extends Structure if (isset($this->accessBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName]) && !isset($this->fieldsNames[$viewName]['access'])) { $attributes = array( - 'name' => 'access', - 'type' => 'accesslevel', - 'label' => 'JFIELD_ACCESS_LABEL', - 'description' => 'JFIELD_ACCESS_DESC', - 'default' => 1, - 'required' => "false" + 'name' => 'access', + 'type' => 'accesslevel', + 'label' => 'JFIELD_ACCESS_LABEL', + 'description' => 'JFIELD_ACCESS_DESC', + 'default' => 1, + 'required' => "false" ); $attributes = array_merge($attributes, $readOnlyXML); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Access Field. Type: Accesslevel (joomla)"); @@ -616,14 +617,14 @@ class Fields extends Structure if (!isset($this->fieldsNames[$viewName]['ordering'])) { $attributes = array( - 'name' => 'ordering', - 'type' => 'number', - 'class' => 'inputbox validate-ordering', - 'label' => $langView . '_ORDERING_LABEL', - 'description' => '', - 'default' => 0, - 'size' => 6, - 'required' => "false" + 'name' => 'ordering', + 'type' => 'number', + 'class' => 'inputbox validate-ordering', + 'label' => $langView . '_ORDERING_LABEL', + 'description' => '', + 'default' => 0, + 'size' => 6, + 'required' => "false" ); $attributes = array_merge($attributes, $readOnlyXML); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Ordering Field. Type: Numbers (joomla)"); @@ -636,14 +637,14 @@ class Fields extends Structure if (!isset($this->fieldsNames[$viewName]['version'])) { $attributes = array( - 'name' => 'version', - 'type' => 'text', - 'class' => 'readonly', - 'label' => $langView . '_VERSION_LABEL', - 'description' => $langView . '_VERSION_DESC', - 'size' => 6, - 'readonly' => "true", - 'filter' => 'unset' + 'name' => 'version', + 'type' => 'text', + 'class' => 'readonly', + 'label' => $langView . '_VERSION_LABEL', + 'description' => $langView . '_VERSION_DESC', + 'size' => 6, + 'readonly' => "true", + 'filter' => 'unset' ); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)"); $fieldXML = $fieldSetXML->addChild('field'); @@ -656,12 +657,12 @@ class Fields extends Structure { // metakey $attributes = array( - 'name' => 'metakey', - 'type' => 'textarea', - 'label' => 'JFIELD_META_KEYWORDS_LABEL', - 'description' => 'JFIELD_META_KEYWORDS_DESC', - 'rows' => 3, - 'cols' => 30 + 'name' => 'metakey', + 'type' => 'textarea', + 'label' => 'JFIELD_META_KEYWORDS_LABEL', + 'description' => 'JFIELD_META_KEYWORDS_DESC', + 'rows' => 3, + 'cols' => 30 ); $this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla)"); $fieldXML = $fieldSetXML->addChild('field'); @@ -701,20 +702,20 @@ class Fields extends Structure $this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)"); $robots = $fieldsFieldSetXML->addChild('field'); $attributes = array( - 'name' => 'robots', - 'type' => 'list', - 'label' => 'JFIELD_METADATA_ROBOTS_LABEL', - 'description' => 'JFIELD_METADATA_ROBOTS_DESC' + 'name' => 'robots', + 'type' => 'list', + 'label' => 'JFIELD_METADATA_ROBOTS_LABEL', + 'description' => 'JFIELD_METADATA_ROBOTS_DESC' ); $this->xmlAddAttributes($robots, $attributes); // count the static field created $this->fieldCount++; $options = array( - 'JGLOBAL_USE_GLOBAL' => '', - 'JGLOBAL_INDEX_FOLLOW' => 'index, follow', - 'JGLOBAL_NOINDEX_FOLLOW' => 'noindex, follow', - 'JGLOBAL_INDEX_NOFOLLOW' => 'index, nofollow', - 'JGLOBAL_NOINDEX_NOFOLLOW' => 'noindex, nofollow', + 'JGLOBAL_USE_GLOBAL' => '', + 'JGLOBAL_INDEX_FOLLOW' => 'index, follow', + 'JGLOBAL_NOINDEX_FOLLOW' => 'noindex, follow', + 'JGLOBAL_INDEX_NOFOLLOW' => 'index, nofollow', + 'JGLOBAL_NOINDEX_NOFOLLOW' => 'noindex, nofollow', ); foreach ($options as $text => $value) { @@ -726,11 +727,11 @@ class Fields extends Structure $this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)"); $author = $fieldsFieldSetXML->addChild('field'); $attributes = array( - 'name' => 'author', - 'type' => 'text', - 'label' => 'JAUTHOR', - 'description' => 'JFIELD_METADATA_AUTHOR_DESC', - 'size' => 20 + 'name' => 'author', + 'type' => 'text', + 'label' => 'JAUTHOR', + 'description' => 'JFIELD_METADATA_AUTHOR_DESC', + 'size' => 20 ); $this->xmlAddAttributes($author, $attributes); // count the static field created @@ -739,14 +740,14 @@ class Fields extends Structure $this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)"); $rights = $fieldsFieldSetXML->addChild('field'); $attributes = array( - 'name' => 'rights', - 'type' => 'textarea', - 'label' => 'JFIELD_META_RIGHTS_LABEL', - 'description' => 'JFIELD_META_RIGHTS_DESC', - 'required' => 'false', - 'filter' => 'string', - 'cols' => 30, - 'rows' => 2 + 'name' => 'rights', + 'type' => 'textarea', + 'label' => 'JFIELD_META_RIGHTS_LABEL', + 'description' => 'JFIELD_META_RIGHTS_DESC', + 'required' => 'false', + 'filter' => 'string', + 'cols' => 30, + 'rows' => 2 ); $this->xmlAddAttributes($rights, $attributes); // count the static field created @@ -807,8 +808,8 @@ class Fields extends Structure if (ComponentbuilderHelper::checkArray($fieldAttributes)) { // set the array of field names - $this->setFieldsNames($viewName,$fieldAttributes['name']); - + $this->setFieldsNames($viewName, $fieldAttributes['name']); + if ($this->defaultField($typeName, 'option')) { //reset options array @@ -1136,9 +1137,9 @@ class Fields extends Structure { $form = $field->fieldXML->addChild('form'); $attributes = array( - 'hidden' => 'true', - 'name' => 'list_' . $fieldAttributes['name'] . '_modal', - 'repeat' => 'true' + 'hidden' => 'true', + 'name' => 'list_' . $fieldAttributes['name'] . '_modal', + 'repeat' => 'true' ); $this->xmlAddAttributes($form, $attributes); @@ -1248,7 +1249,7 @@ class Fields extends Structure * @return void * */ - public function setLayoutBuilder(&$viewName,&$tabName,&$name,&$field) + public function setLayoutBuilder(&$viewName, &$tabName, &$name, &$field) { // first fix the zero order // to insure it lands before all the other fields @@ -1338,14 +1339,14 @@ class Fields extends Structure */ public function buildSiteFieldData($view, $field, $set, $type) { - $decode = array('json','base64','basic_encryption','advance_encryption'); - $textareas = array('textarea','editor'); + $decode = array('json', 'base64', 'basic_encryption', 'advance_encryption'); + $textareas = array('textarea', 'editor'); if (isset($this->siteFields[$view][$field]) && ComponentbuilderHelper::checkArray($this->siteFields[$view][$field])) { foreach ($this->siteFields[$view][$field] as $code => $array) { // set the decoding methods - if (in_array($set,$decode)) + if (in_array($set, $decode)) { $this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']] = array('decode' => $set, 'type' => $type); } @@ -1466,9 +1467,9 @@ class Fields extends Structure if (ComponentbuilderHelper::checkString($otherName) && ComponentbuilderHelper::checkString($otherViews) && ComponentbuilderHelper::checkString($otherView)) { $this->catOtherName[$listViewName] = array( - 'name' => ComponentbuilderHelper::safeString($otherName), - 'views' => ComponentbuilderHelper::safeString($otherViews), - 'view' => ComponentbuilderHelper::safeString($otherView) + 'name' => ComponentbuilderHelper::safeString($otherName), + 'views' => ComponentbuilderHelper::safeString($otherViews), + 'view' => ComponentbuilderHelper::safeString($otherView) ); } } @@ -1793,7 +1794,7 @@ class Fields extends Structure return; } // count how many times the field is used - $this->uniqueNames[$view]['counter'][$name]++; + $this->uniqueNames[$view]['counter'][$name] ++; return; } @@ -1825,7 +1826,6 @@ class Fields extends Structure return $name; } - /** * set Builders * @@ -1947,16 +1947,16 @@ class Fields extends Structure { // load to list builder $this->listBuilder[$listViewName][] = array( - 'type' => $typeName, - 'code' => $name, - 'lang' => $listLangName, - 'title' => (isset($field['title']) && $field['title']) ? true : false, - 'alias' => (isset($field['alias']) && $field['alias']) ? true : false, - 'link' => (isset($field['link']) && $field['link']) ? true : false, - 'sort' => (isset($field['sort']) && $field['sort']) ? true : false, - 'custom' => $custom, - 'multiple' => $multiple, - 'options' => $options); + 'type' => $typeName, + 'code' => $name, + 'lang' => $listLangName, + 'title' => (isset($field['title']) && $field['title']) ? true : false, + 'alias' => (isset($field['alias']) && $field['alias']) ? true : false, + 'link' => (isset($field['link']) && $field['link']) ? true : false, + 'sort' => (isset($field['sort']) && $field['sort']) ? true : false, + 'custom' => $custom, + 'multiple' => $multiple, + 'options' => $options); $this->customBuilderList[$listViewName][] = $name; } @@ -2156,26 +2156,26 @@ class Fields extends Structure public function setCustomFieldTypeFile($data, $viewName_list, $viewName_single) { // make sure it is not already been build - if (!isset($this->fileContentDynamic['customfield_'.$data['type']]) || !ComponentbuilderHelper::checkArray($this->fileContentDynamic['customfield_'.$data['type']])) + if (!isset($this->fileContentDynamic['customfield_' . $data['type']]) || !ComponentbuilderHelper::checkArray($this->fileContentDynamic['customfield_' . $data['type']])) { // first build the custom field type file $target = array('admin' => 'customfield'); - $this->buildDynamique($target,'field'.$data['custom']['extends'], $data['custom']['type']); + $this->buildDynamique($target, 'field' . $data['custom']['extends'], $data['custom']['type']); // set tab and break replacements $tabBreak = array( - '\t' => "\t", - '\n' => PHP_EOL + '\t' => "\t", + '\n' => PHP_EOL ); // make field dynamic $replace = array( '###TABLE###' => $data['custom']['table'], '###ID###' => $data['custom']['id'], '###TEXT###' => $data['custom']['text'], - '###CODE_TEXT###' => $data['code'].'_'.$data['custom']['text'], + '###CODE_TEXT###' => $data['code'] . '_' . $data['custom']['text'], '###CODE###' => $data['code'], '###component###' => $this->fileContentStatic['###component###'], '###Component###' => $this->fileContentStatic['###Component###'], - '###view_type###' => $viewName_single.'_'.$data['type'], + '###view_type###' => $viewName_single . '_' . $data['type'], '###type###' => $data['type'], '###view###' => $viewName_single, '###views###' => $viewName_list @@ -2195,7 +2195,7 @@ class Fields extends Structure } else { - $phpCode .= PHP_EOL."\t\t".$this->setPlaceholders($code, $tabBreak); + $phpCode .= PHP_EOL . "\t\t" . $this->setPlaceholders($code, $tabBreak); } } } @@ -2244,30 +2244,30 @@ class Fields extends Structure $phpxCode = 'return null;'; } // temp holder for name - $tempName = $data['custom']['label'].' Group'; + $tempName = $data['custom']['label'] . ' Group'; // set lang - $groupLangName = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($tempName,'U'); + $groupLangName = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($tempName, 'U'); // add to lang array - $this->langContent[$this->lang][$groupLangName] = ComponentbuilderHelper::safeString($tempName,'W'); + $this->langContent[$this->lang][$groupLangName] = ComponentbuilderHelper::safeString($tempName, 'W'); // build the Group Control $this->setGroupControl[$data['type']] = $groupLangName; // ###JFORM_GETGROUPS_PHP### <<>> - $this->fileContentDynamic['customfield_'.$data['type']]['###JFORM_GETGROUPS_PHP###'] = $phpCode; + $this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETGROUPS_PHP###'] = $phpCode; // ###JFORM_GETEXCLUDED_PHP### <<>> - $this->fileContentDynamic['customfield_'.$data['type']]['###JFORM_GETEXCLUDED_PHP###'] = $phpxCode; + $this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETEXCLUDED_PHP###'] = $phpxCode; } else { // ###JFORM_GETOPTIONS_PHP### <<>> - $this->fileContentDynamic['customfield_'.$data['type']]['###JFORM_GETOPTIONS_PHP###'] = $phpCode; + $this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETOPTIONS_PHP###'] = $phpCode; } // ###Type### <<>> - $this->fileContentDynamic['customfield_'.$data['type']]['###Type###'] = ComponentbuilderHelper::safeString($data['custom']['type'],'F'); + $this->fileContentDynamic['customfield_' . $data['type']]['###Type###'] = ComponentbuilderHelper::safeString($data['custom']['type'], 'F'); // ###type### <<>> - $this->fileContentDynamic['customfield_'.$data['type']]['###type###'] = $data['custom']['type']; + $this->fileContentDynamic['customfield_' . $data['type']]['###type###'] = $data['custom']['type']; // ###type### <<>> - $this->fileContentDynamic['customfield_'.$data['type']]['###ADD_BUTTON###'] = $this->setAddButttonToListField($data['custom']['view'],$data['custom']['views']); + $this->fileContentDynamic['customfield_' . $data['type']]['###ADD_BUTTON###'] = $this->setAddButttonToListField($data['custom']['view'], $data['custom']['views']); } } @@ -2281,39 +2281,39 @@ class Fields extends Structure * */ public function defaultField($type, $option = 'default') - { + { // list of default fields // https://docs.joomla.org/Form_field $defaults = array( - 'default' => array( - 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', - 'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor', - 'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file', - 'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite', - 'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password', - 'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag', - 'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag', - 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' - ), - 'plain' => array( - 'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color', - 'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors', - 'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite', - 'hidden', 'imagelist', 'integer', 'language', 'media', 'menu', - 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', - 'sessionhandler', 'tag', 'tel', 'text', 'textarea', - 'timezone', 'url', 'user', 'usergroup' - ), - 'spacer' => array( - 'note', 'spacer' - ), - 'option' => array( - 'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql' - ), - 'special' => array( - 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', - 'repeatable', 'templatestyle', 'subform' - ) + 'default' => array( + 'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox', + 'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor', + 'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file', + 'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite', + 'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password', + 'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag', + 'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag', + 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' + ), + 'plain' => array( + 'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color', + 'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors', + 'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite', + 'hidden', 'imagelist', 'integer', 'language', 'media', 'menu', + 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', + 'sessionhandler', 'tag', 'tel', 'text', 'textarea', + 'timezone', 'url', 'user', 'usergroup' + ), + 'spacer' => array( + 'note', 'spacer' + ), + 'option' => array( + 'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql' + ), + 'special' => array( + 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', + 'repeatable', 'templatestyle', 'subform' + ) ); if (in_array($type, $defaults[$option])) @@ -2415,9 +2415,9 @@ class Fields extends Structure if ($this->tidy) { $tidy = new Tidy(); - $tidy->parseString($xmlString,array('indent'=>true,'indent-spaces'=>8,'input-xml'=>true,'output-xml'=>true,'indent-attributes'=>true,'wrap-attributes'=>true,'wrap'=>false)); + $tidy->parseString($xmlString, array('indent' => true, 'indent-spaces' => 8, 'input-xml' => true, 'output-xml' => true, 'indent-attributes' => true, 'wrap-attributes' => true, 'wrap' => false)); $tidy->cleanRepair(); - return $this->xmlIndent((string)$tidy,' ',8,true,false); + return $this->xmlIndent((string) $tidy, ' ', 8, true, false); } // set tidy waring atleast once elseif (!$this->setTidyWarning) @@ -2429,7 +2429,7 @@ class Fields extends Structure } return $xmlString; } - + /** * xmlIndent * @@ -2442,18 +2442,18 @@ class Fields extends Structure * @return string XML output * */ - public function xmlIndent($string,$char=' ',$depth=0,$skipfirst=false,$skiplast=false) + public function xmlIndent($string, $char = ' ', $depth = 0, $skipfirst = false, $skiplast = false) { $output = array(); - $lines = explode("\n",$string); + $lines = explode("\n", $string); $first = true; - $last = count($lines)-1; - foreach($lines as $i=>$line) + $last = count($lines) - 1; + foreach ($lines as $i => $line) { - $output[] = (($first&&$skipfirst)||$i===$last&&$skiplast)?$line:str_repeat($char,$depth).$line; + $output[] = (($first && $skipfirst) || $i === $last && $skiplast) ? $line : str_repeat($char, $depth) . $line; $first = false; } - return implode("\n",$output); + return implode("\n", $output); } } diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 57641e0ce..f0a0ef5ae 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -1,27 +1,28 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| + /-------------------------------------------------------------------------------------------------------------------------------/ + + @version 2.6.x + @created 30th April, 2015 + @package Component Builder + @subpackage compiler.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + + /----------------------------------------------------------------------------------------------------------------------------- */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); @@ -30,167 +31,167 @@ defined('_JEXEC') or die('Restricted access'); * Compiler class */ class Interpretation extends Fields -{ +{ + /** * The contributors * * @var string */ public $theContributors = ''; - + /** * The unistall builder * * @var array */ public $uninstallBuilder = array(); - + /** * The update SQL builder * * @var array */ public $updateSQLBuilder = array(); - + /** * The List Column Builder * * @var array */ public $listColnrBuilder = array(); - + /** * The permissions Builder * * @var array */ public $permissionBuilder = array(); - + /** * The dashboard permissions builder * * @var array */ public $permissionDashboard = array(); - + /** * The permissions core * * @var array */ public $permissionCore = array(); - + /** * The customs field builder * * @var array */ public $customFieldBuilder = array(); - + /** * The category builder * * @var array */ public $buildCategories = array(); - + /** * The icon builder * * @var array */ public $iconBuilder = array(); - + /** * The validation fix builder * * @var array */ public $validationFixBuilder = array(); - + /** * The edit body script builder * * @var array */ public $editBodyViewScriptBuilder = array(); - + /** * The target relation control * * @var array */ public $targetRelationControl = array(); - + /** * The target control script checker * * @var array */ public $targetControlsScriptChecker = array(); - + /** * The router helper * * @var array */ public $setRouterHelpDone = array(); - + /** * The other where * * @var array */ public $otherWhere = array(); - + /** * The dashboard get custom data * * @var array */ public $DashboardGetCustomData = array(); - + /** * The custom admin added * * @var array */ public $customAdminAdded = array(); - + /** * The extensions params * * @var array - */ + */ protected $extensionsParams = array(); - + /** * The asset rules * * @var array */ public $assetsRules = array(); - + /** * View Has Category Request * * @var array */ protected $hasCatIdRequest = array(); - + /** * View Has Id Request * * @var array */ protected $hasIdRequest = array(); - protected $libwarning = array(); /** * Constructor */ - public function __construct($config = array ()) + public function __construct($config = array()) { // first we run the perent constructor if (parent::__construct($config)) @@ -199,7 +200,7 @@ class Interpretation extends Fields } return false; } - + /** * Set the line number in comments * @@ -212,14 +213,14 @@ class Interpretation extends Fields { if ($this->debugLinenr) { - return ' [Interpretation '.$nr.']'; + return ' [Interpretation ' . $nr . ']'; } return ''; } /** * add email helper - */ + */ public function addEmailHelper() { if (isset($this->componentData->add_email_helper) && $this->componentData->add_email_helper) @@ -228,13 +229,13 @@ class Interpretation extends Fields $component = $this->fileContentStatic['###component###']; $Component = $this->fileContentStatic['###Component###']; $target = array('admin' => 'emailer'); - $done = $this->buildDynamique($target,'emailer',$component); + $done = $this->buildDynamique($target, 'emailer', $component); if ($done) { // the text for the file ###BAKING### - $this->fileContentDynamic['emailer_'.$component]['###BAKING###'] = ''; // <<-- to insure it gets updated + $this->fileContentDynamic['emailer_' . $component]['###BAKING###'] = ''; // <<-- to insure it gets updated // return the code need to load the abstract class - return PHP_EOL."JLoader::register('".$Component."Email', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/".$component."email.php'); "; + return PHP_EOL . "JLoader::register('" . $Component . "Email', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/" . $component . "email.php'); "; } } return ''; @@ -242,19 +243,19 @@ class Interpretation extends Fields /** * set the lock license (NOT OKAY) - */ + */ public function setLockLicense() { if ($this->componentData->add_license && $this->componentData->license_type == 3) { if (!isset($this->fileContentStatic['###HELPER_SITE_LICENSE_LOCK###'])) { - $_VDM = '_'.ComponentbuilderHelper::safeString($this->uniquekey(10),'U'); + $_VDM = '_' . ComponentbuilderHelper::safeString($this->uniquekey(10), 'U'); // add it to the system - $this->fileContentStatic['###HELPER_SITE_LICENSE_LOCK###'] = $this->setHelperLicenseLock($_VDM,'site'); - $this->fileContentStatic['###HELPER_LICENSE_LOCK###'] = $this->setHelperLicenseLock($_VDM,'admin'); + $this->fileContentStatic['###HELPER_SITE_LICENSE_LOCK###'] = $this->setHelperLicenseLock($_VDM, 'site'); + $this->fileContentStatic['###HELPER_LICENSE_LOCK###'] = $this->setHelperLicenseLock($_VDM, 'admin'); $this->fileContentStatic['###LICENSE_LOCKED_INT###'] = $this->setInitLicenseLock($_VDM); - $this->fileContentStatic['###LICENSE_LOCKED_DEFINED###'] = PHP_EOL.PHP_EOL.'defined(\''.$_VDM.'\') or die(JText::_(\'NIE_REG_NIE\'));'; + $this->fileContentStatic['###LICENSE_LOCKED_DEFINED###'] = PHP_EOL . PHP_EOL . 'defined(\'' . $_VDM . '\') or die(JText::_(\'NIE_REG_NIE\'));'; } } else @@ -269,34 +270,34 @@ class Interpretation extends Fields /** * @param $view - */ + */ public function setLockLicensePer(&$view, $target) { if ($this->componentData->add_license && $this->componentData->license_type == 3) { if (!isset($this->fileContentDynamic[$view]['###BOOLMETHOD###'])) { - $boolMethod = 'get'.ComponentbuilderHelper::safeString($this->uniquekey(3, false, 'ddd'), 'W'); - $globalbool = 'set'.ComponentbuilderHelper::safeString($this->uniquekey(3), 'W'); + $boolMethod = 'get' . ComponentbuilderHelper::safeString($this->uniquekey(3, false, 'ddd'), 'W'); + $globalbool = 'set' . ComponentbuilderHelper::safeString($this->uniquekey(3), 'W'); // add it to the system - $this->fileContentDynamic[$view]['###LICENSE_LOCKED_SET_BOOL###'] = $this->setBoolLicenseLock($boolMethod,$globalbool); - $this->fileContentDynamic[$view]['###LICENSE_LOCKED_CHECK###'] = $this->checkStatmentLicenseLocked($boolMethod); - $this->fileContentDynamic[$view]['###LICENSE_TABLE_LOCKED_CHECK###'] = $this->checkStatmentLicenseLocked($boolMethod, '$table'); - $this->fileContentDynamic[$view]['###BOOLMETHOD###'] = $boolMethod; + $this->fileContentDynamic[$view]['###LICENSE_LOCKED_SET_BOOL###'] = $this->setBoolLicenseLock($boolMethod, $globalbool); + $this->fileContentDynamic[$view]['###LICENSE_LOCKED_CHECK###'] = $this->checkStatmentLicenseLocked($boolMethod); + $this->fileContentDynamic[$view]['###LICENSE_TABLE_LOCKED_CHECK###'] = $this->checkStatmentLicenseLocked($boolMethod, '$table'); + $this->fileContentDynamic[$view]['###BOOLMETHOD###'] = $boolMethod; } } else { // don't add it to the system - $this->fileContentDynamic[$view]['###LICENSE_LOCKED_SET_BOOL###'] = ''; - $this->fileContentDynamic[$view]['###LICENSE_LOCKED_CHECK###'] = ''; - $this->fileContentDynamic[$view]['###LICENSE_TABLE_LOCKED_CHECK###'] = ''; + $this->fileContentDynamic[$view]['###LICENSE_LOCKED_SET_BOOL###'] = ''; + $this->fileContentDynamic[$view]['###LICENSE_LOCKED_CHECK###'] = ''; + $this->fileContentDynamic[$view]['###LICENSE_TABLE_LOCKED_CHECK###'] = ''; } } - + public function checkStatmentLicenseLocked($boolMethod, $thIIS = '$this') { - $statment[] = PHP_EOL."\t\tif (!".$thIIS."->".$boolMethod."())"; + $statment[] = PHP_EOL . "\t\tif (!" . $thIIS . "->" . $boolMethod . "())"; $statment[] = "\t\t{"; $statment[] = "\t\t\t\$app = JFactory::getApplication();"; $statment[] = "\t\t\t\$app->enqueueMessage(JText::_('NIE_REG_NIE'), 'error');"; @@ -306,53 +307,53 @@ class Interpretation extends Fields // return the genuine mentod statement return implode(PHP_EOL, $statment); } - - public function setBoolLicenseLock($boolMethod,$globalbool) + + public function setBoolLicenseLock($boolMethod, $globalbool) { - $bool[] = PHP_EOL.PHP_EOL."\t/**"; + $bool[] = PHP_EOL . PHP_EOL . "\t/**"; $bool[] = "\t* The private bool."; $bool[] = "\t**/"; - $bool[] = "\tprivate $".$globalbool.";"; - $bool[] = PHP_EOL."\t/**"; + $bool[] = "\tprivate $" . $globalbool . ";"; + $bool[] = PHP_EOL . "\t/**"; $bool[] = "\t* Check if this install has a license."; $bool[] = "\t**/"; - $bool[] = "\tpublic function ".$boolMethod."()"; + $bool[] = "\tpublic function " . $boolMethod . "()"; $bool[] = "\t{"; - $bool[] = "\t\tif(!empty(\$this->".$globalbool."))"; + $bool[] = "\t\tif(!empty(\$this->" . $globalbool . "))"; $bool[] = "\t\t{"; - $bool[] = "\t\t\treturn \$this->".$globalbool.";"; + $bool[] = "\t\t\treturn \$this->" . $globalbool . ";"; $bool[] = "\t\t}"; - $bool[] = "\t\t//".$this->setLine(__LINE__)." Get the global params"; - $bool[] = "\t\t\$params = JComponentHelper::getParams('com_".$this->fileContentStatic['###component###']."', true);"; + $bool[] = "\t\t//" . $this->setLine(__LINE__) . " Get the global params"; + $bool[] = "\t\t\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic['###component###'] . "', true);"; $bool[] = "\t\t\$license_key = \$params->get('license_key', null);"; $bool[] = "\t\tif (\$license_key)"; $bool[] = "\t\t{"; - $bool[] = "\t\t\t//".$this->setLine(__LINE__)." load the file"; - $bool[] = "\t\t\tJLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_".$this->fileContentStatic['###component###']."');"; + $bool[] = "\t\t\t//" . $this->setLine(__LINE__) . " load the file"; + $bool[] = "\t\t\tJLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic['###component###'] . "');"; $bool[] = "\t\t\t\$the = new VDM(\$license_key);"; - $bool[] = "\t\t\t\$this->".$globalbool." = \$the->_is;"; - $bool[] = "\t\t\treturn \$this->".$globalbool.";"; + $bool[] = "\t\t\t\$this->" . $globalbool . " = \$the->_is;"; + $bool[] = "\t\t\treturn \$this->" . $globalbool . ";"; $bool[] = "\t\t}"; $bool[] = "\t\treturn false;"; $bool[] = "\t}"; // return the genuine mentod statement return implode(PHP_EOL, $bool); } - - public function setHelperLicenseLock($_VDM,$target) + + public function setHelperLicenseLock($_VDM, $target) { - $helper[] = PHP_EOL.PHP_EOL."\t/**"; + $helper[] = PHP_EOL . PHP_EOL . "\t/**"; $helper[] = "\t* Check if this install has a license."; $helper[] = "\t**/"; $helper[] = "\tpublic static function isGenuine()"; $helper[] = "\t{"; - $helper[] = "\t\t//".$this->setLine(__LINE__)." Get the global params"; - $helper[] = "\t\t\$params = JComponentHelper::getParams('com_".$this->fileContentStatic['###component###']."', true);"; + $helper[] = "\t\t//" . $this->setLine(__LINE__) . " Get the global params"; + $helper[] = "\t\t\$params = JComponentHelper::getParams('com_" . $this->fileContentStatic['###component###'] . "', true);"; $helper[] = "\t\t\$license_key = \$params->get('license_key', null);"; $helper[] = "\t\tif (\$license_key)"; $helper[] = "\t\t{"; - $helper[] = "\t\t\t//".$this->setLine(__LINE__)." load the file"; - $helper[] = "\t\t\tJLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_".$this->fileContentStatic['###component###']."');"; + $helper[] = "\t\t\t//" . $this->setLine(__LINE__) . " load the file"; + $helper[] = "\t\t\tJLoader::import( 'vdm', JPATH_ADMINISTRATOR .'/components/com_" . $this->fileContentStatic['###component###'] . "');"; $helper[] = "\t\t\t\$the = new VDM(\$license_key);"; $helper[] = "\t\t\treturn \$the->_is;"; $helper[] = "\t\t}"; @@ -361,21 +362,21 @@ class Interpretation extends Fields // return the genuine mentod statement return implode(PHP_EOL, $helper); } - + public function setInitLicenseLock($_VDM) { - $init[] = PHP_EOL."if (!defined('".$_VDM."'))"; + $init[] = PHP_EOL . "if (!defined('" . $_VDM . "'))"; $init[] = "{"; - $init[] = "\t\$allow = ".$this->fileContentStatic['###Component###']."Helper::isGenuine();"; + $init[] = "\t\$allow = " . $this->fileContentStatic['###Component###'] . "Helper::isGenuine();"; $init[] = "\tif (\$allow)"; $init[] = "\t{"; - $init[] = "\t\tdefine('".$_VDM."', 1);"; + $init[] = "\t\tdefine('" . $_VDM . "', 1);"; $init[] = "\t}"; $init[] = "}"; // return the initializing statement return implode(PHP_EOL, $init); } - + public function setVDMCryption() { // make sure we have the correct file @@ -397,9 +398,9 @@ class Interpretation extends Fields $theKey = base64_encode(serialize($key)); // set the script $encrypt[] = "/**"; - $encrypt[] = "* ".$this->setLine(__LINE__)."VDM Class "; + $encrypt[] = "* " . $this->setLine(__LINE__) . "VDM Class "; $encrypt[] = "**/"; - $encrypt[] = PHP_EOL."class VDM"; + $encrypt[] = PHP_EOL . "class VDM"; $encrypt[] = "{"; $encrypt[] = "\tpublic \$_key = false;"; $encrypt[] = "\tpublic \$_is = false;"; @@ -426,7 +427,7 @@ class Interpretation extends Fields $encrypt[] = "\t"; $encrypt[] = "\tprivate function get(\$Vk5smi0wjnjb,\$V2uekt2wcgwk)"; $encrypt[] = "\t{"; - $encrypt[] = "\t\t\$Viioj50xuqu2 = unserialize(base64_decode('".$theKey."'));"; + $encrypt[] = "\t\t\$Viioj50xuqu2 = unserialize(base64_decode('" . $theKey . "'));"; $encrypt[] = "\t\t\$Visqfrd1caus = time() . md5(mt_rand(1000000000, 9999999999) . \$Vk5smi0wjnjb);"; $encrypt[] = "\t\t\$Vo4tezfgcf3e = date(\"Ymd\");"; $encrypt[] = "\t\t\$Vozblwvfym2f = \$_SERVER['SERVER_NAME'];"; @@ -435,7 +436,7 @@ class Interpretation extends Fields $encrypt[] = "\t\t\$Vc2rayehw4f0 = unserialize(base64_decode('czozNjoibW9kdWxlcy9zZXJ2ZXJzL2xpY2Vuc2luZy92ZXJpZnkucGhwIjs='));"; $encrypt[] = "\t\t\$Vlpolphukogz = false;"; $encrypt[] = "\t\tif (\$V2uekt2wcgwk) {"; - $encrypt[] = "\t\t\t\$V2uekt2wcgwk = str_replace(\"".'".PHP_EOL."'."\", '', \$V2uekt2wcgwk);"; + $encrypt[] = "\t\t\t\$V2uekt2wcgwk = str_replace(\"" . '".PHP_EOL."' . "\", '', \$V2uekt2wcgwk);"; $encrypt[] = "\t\t\t\$Vm5cxjdc43g4 = substr(\$V2uekt2wcgwk, 0, strlen(\$V2uekt2wcgwk) - 32);"; $encrypt[] = "\t\t\t\$Vbgx0efeu2sy = substr(\$V2uekt2wcgwk, strlen(\$V2uekt2wcgwk) - 32);"; $encrypt[] = "\t\t\tif (\$Vbgx0efeu2sy == md5(\$Vm5cxjdc43g4 . \$Viioj50xuqu2['geheim'])) {"; @@ -496,7 +497,7 @@ class Interpretation extends Fields $encrypt[] = "\t\t\t} else {"; $encrypt[] = "\t\t\t\t\$Vrpmu4bvnmkp = fsockopen(\$Viioj50xuqu2['kasier'], 80, \$Vc0t5kmpwkwk, \$Va3g41fnofhu, 5);"; $encrypt[] = "\t\t\t\tif (\$Vrpmu4bvnmkp) {"; - $encrypt[] = "\t\t\t\t\t\$Vznkm0a0me1y = \"\r".PHP_EOL."\";"; + $encrypt[] = "\t\t\t\t\t\$Vznkm0a0me1y = \"\r" . PHP_EOL . "\";"; $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop = \"POST \".\$Viioj50xuqu2['kasier'] . \$Vc2rayehw4f0 . \" HTTP/1.0\" . \$Vznkm0a0me1y;"; $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop .= \"Host: \".\$Viioj50xuqu2['kasier'] . \$Vznkm0a0me1y;"; $encrypt[] = "\t\t\t\t\t\$V2sgyscukmgiop .= \"Content-type: application/x-www-form-urlencoded\" . \$Vznkm0a0me1y;"; @@ -525,7 +526,7 @@ class Interpretation extends Fields $encrypt[] = "\t\t\t\t\treturn \$Vwasqoybpyed;"; $encrypt[] = "\t\t\t\t}"; $encrypt[] = "\t\t\t} else {"; - $encrypt[] = "\t\t\t\tpreg_match_all('".'/<(.*?)>([^<]+)<\/\\1>/i'."', \$Vqojefyeohg5, \$V1ot20wob03f);"; + $encrypt[] = "\t\t\t\tpreg_match_all('" . '/<(.*?)>([^<]+)<\/\\1>/i' . "', \$Vqojefyeohg5, \$V1ot20wob03f);"; $encrypt[] = "\t\t\t\t\$Vwasqoybpyed = array();"; $encrypt[] = "\t\t\t\tforeach (\$V1ot20wob03f[1] AS \$V2sgyscukmgi=>\$V1u00zkzmb1d) {"; $encrypt[] = "\t\t\t\t\t\$Vwasqoybpyed[\$V1u00zkzmb1d] = \$V1ot20wob03f[2][\$V2sgyscukmgi];"; @@ -548,7 +549,7 @@ class Interpretation extends Fields $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = md5(\$Vo4tezfgcf3e . \$Viioj50xuqu2['geheim']) . \$Vqojefyeohg5ing;"; $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = strrev(\$Vqojefyeohg5ing);"; $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = \$Vqojefyeohg5ing . md5(\$Vqojefyeohg5ing . \$Viioj50xuqu2['geheim']);"; - $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = wordwrap(\$Vqojefyeohg5ing, 80, \"".'".PHP_EOL."'."\", true);"; + $encrypt[] = "\t\t\t\t\$Vqojefyeohg5ing = wordwrap(\$Vqojefyeohg5ing, 80, \"" . '".PHP_EOL."' . "\", true);"; $encrypt[] = "\t\t\t\t\$Vwasqoybpyed['eiegrendel'] = \$Vqojefyeohg5ing;"; $encrypt[] = "\t\t\t}"; $encrypt[] = "\t\t\t\$Vwasqoybpyed['nuut'] = true;"; @@ -559,7 +560,7 @@ class Interpretation extends Fields $encrypt[] = "}"; // return the help methods - return implode(PHP_EOL,$encrypt); + return implode(PHP_EOL, $encrypt); } } return ''; @@ -575,31 +576,31 @@ class Interpretation extends Fields { // set advanced encrypt file into place $target = array('admin' => 'encrypt'); - $done = $this->buildDynamique($target,'encrypt'); + $done = $this->buildDynamique($target, 'encrypt'); // the text for the file ###VDM_ENCRYPTION_BODY### $this->fileContentDynamic['encrypt']['###VDM_ENCRYPTION_BODY###'] = $this->setVDMCryption(); // ###ENCRYPT_FILE### - $this->fileContentStatic['###ENCRYPT_FILE###'] = PHP_EOL."\t\t\tvdm.php"; + $this->fileContentStatic['###ENCRYPT_FILE###'] = PHP_EOL . "\t\t\tvdm.php"; } // get component name - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic['###component###']; // set the getCryptKey function to the helper class $function = array(); if (isset($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder)) { - $function[] = PHP_EOL.PHP_EOL."\tpublic static function getCryptKey(\$type, \$default = null)"; + $function[] = PHP_EOL . PHP_EOL . "\tpublic static function getCryptKey(\$type, \$default = null)"; $function[] = "\t{"; - $function[] = "\t\t//".$this->setLine(__LINE__)." Get the global params"; - $function[] = "\t\t\$params = JComponentHelper::getParams('com_".$component."', true);"; + $function[] = "\t\t//" . $this->setLine(__LINE__) . " Get the global params"; + $function[] = "\t\t\$params = JComponentHelper::getParams('com_" . $component . "', true);"; $function[] = "\t\tif ('advanced' === \$type)"; $function[] = "\t\t{"; $function[] = "\t\t\t\$advanced_key = \$params->get('advanced_key', \$default);"; $function[] = "\t\t\tif (\$advanced_key)"; $function[] = "\t\t\t{"; - $function[] = "\t\t\t\t//".$this->setLine(__LINE__)." load the file"; + $function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " load the file"; $function[] = "\t\t\t\tJLoader::import( 'vdm', JPATH_COMPONENT_ADMINISTRATOR);"; - $function[] = PHP_EOL."\t\t\t\t\$the = new VDM(\$advanced_key);"; - $function[] = PHP_EOL."\t\t\t\treturn \$the->_key;"; + $function[] = PHP_EOL . "\t\t\t\t\$the = new VDM(\$advanced_key);"; + $function[] = PHP_EOL . "\t\t\t\treturn \$the->_key;"; $function[] = "\t\t\t}"; $function[] = "\t\t}"; $function[] = "\t\telseif ('basic' === \$type)"; @@ -615,19 +616,19 @@ class Interpretation extends Fields } elseif (isset($this->advancedEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder)) { - $function[] = PHP_EOL.PHP_EOL."\tpublic static function getCryptKey(\$type, \$default = null)"; + $function[] = PHP_EOL . PHP_EOL . "\tpublic static function getCryptKey(\$type, \$default = null)"; $function[] = "\t{"; $function[] = "\t\tif ('advanced' === \$type)"; $function[] = "\t\t{"; - $function[] = "\t\t\t//".$this->setLine(__LINE__)." Get the global params"; - $function[] = "\t\t\t\$params = JComponentHelper::getParams('com_".$component."', true);"; + $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the global params"; + $function[] = "\t\t\t\$params = JComponentHelper::getParams('com_" . $component . "', true);"; $function[] = "\t\t\t\$advanced_key = \$params->get('advanced_key', \$default);"; $function[] = "\t\t\tif (\$advanced_key)"; $function[] = "\t\t\t{"; - $function[] = "\t\t\t\t//".$this->setLine(__LINE__)." load the file"; + $function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " load the file"; $function[] = "\t\t\t\tJLoader::import( 'vdm', JPATH_COMPONENT_ADMINISTRATOR);"; - $function[] = PHP_EOL."\t\t\t\t\$the = new VDM(\$advanced_key);"; - $function[] = PHP_EOL."\t\t\t\treturn \$the->_key;"; + $function[] = PHP_EOL . "\t\t\t\t\$the = new VDM(\$advanced_key);"; + $function[] = PHP_EOL . "\t\t\t\treturn \$the->_key;"; $function[] = "\t\t\t}"; $function[] = "\t\t}"; $function[] = "\t\treturn false;"; @@ -635,12 +636,12 @@ class Interpretation extends Fields } elseif (isset($this->basicEncryptionBuilder) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder)) { - $function[] = PHP_EOL.PHP_EOL."\tpublic static function getCryptKey(\$type, \$default = null)"; + $function[] = PHP_EOL . PHP_EOL . "\tpublic static function getCryptKey(\$type, \$default = null)"; $function[] = "\t{"; $function[] = "\t\tif ('basic' === \$type)"; $function[] = "\t\t{"; - $function[] = "\t\t\t//".$this->setLine(__LINE__)." Get the global params"; - $function[] = "\t\t\t\$params = JComponentHelper::getParams('com_".$component."', true);"; + $function[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the global params"; + $function[] = "\t\t\t\$params = JComponentHelper::getParams('com_" . $component . "', true);"; $function[] = "\t\t\t\$basic_key = \$params->get('basic_key', \$default);"; $function[] = "\t\t\tif (\$basic_key)"; $function[] = "\t\t\t{"; @@ -651,11 +652,11 @@ class Interpretation extends Fields $function[] = "\t}"; } // return the help methods - return implode(PHP_EOL,$function); + return implode(PHP_EOL, $function); } return ''; } - + public function setVersionController() { if (ComponentbuilderHelper::checkArray($this->componentData->version_update) || ComponentbuilderHelper::checkArray($this->updateSQLBuilder)) @@ -666,7 +667,7 @@ class Interpretation extends Fields { $updateXML[] = ''; } - + // add the dynamic sql switch $addDynamicSQL = true; $addActive = true; @@ -675,7 +676,7 @@ class Interpretation extends Fields foreach ($this->componentData->version_update as $nr => &$update) { $this->setUpdateXMLSQL($update, $updateXML, $addDynamicSQL); - + if ($update['version'] == $this->componentData->component_version) { $addActive = false; @@ -701,9 +702,9 @@ class Interpretation extends Fields // ###UPDATE_SERVER_XML### $name = str_replace('.xml', '', substr($this->componentData->update_server, strrpos($this->componentData->update_server, '/') + 1)); $target = array('admin' => $name); - $this->buildDynamique($target,'update_server'); + $this->buildDynamique($target, 'update_server'); $this->fileContentDynamic[$name]['###UPDATE_SERVER_XML###'] = implode(PHP_EOL, $updateXML); - + // set the Update server file name $this->updateServerFileName = $name; } @@ -713,8 +714,8 @@ class Interpretation extends Fields { // ###UPDATESERVER### $updateServer = array(); - $updateServer[] = PHP_EOL."\t"; - $updateServer[] = "\t\t".''.$this->componentData->update_server.''; + $updateServer[] = PHP_EOL . "\t"; + $updateServer[] = "\t\t" . '' . $this->componentData->update_server . ''; $updateServer[] = "\t"; // return the array to string $updateServer = implode(PHP_EOL, $updateServer); @@ -733,9 +734,9 @@ class Interpretation extends Fields $nr = 0; foreach ($this->componentData->version_update as $values) { - $buket['version_update'.$nr] = $values; + $buket['version_update' . $nr] = $values; $nr++; - } + } // update the joomla component table $newJ = array(); $newJ['id'] = (int) $this->componentID; @@ -743,7 +744,6 @@ class Interpretation extends Fields // update the component with the new dynamic SQL $modelJ = ComponentbuilderHelper::getModel('joomla_component'); $modelJ->save($newJ); // <-- to insure the history is also updated - // reset the watch here $this->getHistoryWatch('joomla_component', $this->componentID); @@ -762,8 +762,8 @@ class Interpretation extends Fields $modelU = ComponentbuilderHelper::getModel('component_updates'); $modelU->save($newU); // <-- to insure the history is also updated } - } - + } + public function setDynamicUpdateXMLSQL(&$updateXML, $current_version = false) { // start building the update @@ -782,15 +782,15 @@ class Interpretation extends Fields // setup new version $update_['version'] = $this->componentData->old_component_version; // setup SQL - $update_['mysql'] = trim(implode(PHP_EOL.PHP_EOL, $this->updateSQLBuilder)); + $update_['mysql'] = trim(implode(PHP_EOL . PHP_EOL, $this->updateSQLBuilder)); // setup URL if (isset($this->lastupdateURL)) { $paceholders = array( $this->componentData->component_version => $this->componentData->old_component_version, - str_replace('.','-', $this->componentData->component_version) => str_replace('.','-', $this->componentData->old_component_version), - str_replace('.','_', $this->componentData->component_version) => str_replace('.','_', $this->componentData->old_component_version), - str_replace('.','', $this->componentData->component_version) => str_replace('.','', $this->componentData->old_component_version) + str_replace('.', '-', $this->componentData->component_version) => str_replace('.', '-', $this->componentData->old_component_version), + str_replace('.', '_', $this->componentData->component_version) => str_replace('.', '_', $this->componentData->old_component_version), + str_replace('.', '', $this->componentData->component_version) => str_replace('.', '', $this->componentData->old_component_version) ); $update_['url'] = $this->setPlaceholders($this->lastupdateURL, $paceholders); } @@ -806,7 +806,7 @@ class Interpretation extends Fields // add dynamic SQL $this->setUpdateXMLSQL($update_, $updateXML, $addDynamicSQL); } - + public function setUpdateXMLSQL(&$update, &$updateXML, &$addDynamicSQL) { // ensure version naming is correct @@ -818,8 +818,7 @@ class Interpretation extends Fields } // add dynamic SQL $force = false; - if ($addDynamicSQL && ComponentbuilderHelper::checkArray($this->updateSQLBuilder) - && (isset($this->componentData->old_component_version) && $this->componentData->old_component_version == $update['version'])) + if ($addDynamicSQL && ComponentbuilderHelper::checkArray($this->updateSQLBuilder) && (isset($this->componentData->old_component_version) && $this->componentData->old_component_version == $update['version'])) { $searchMySQL = preg_replace('/\s+/', '', $update['mysql']); // add the updates to the SQL only if not found @@ -827,7 +826,7 @@ class Interpretation extends Fields { if (strpos($searchMySQL, $search) === FALSE) { - $update['mysql'] .= PHP_EOL.PHP_EOL.$query; + $update['mysql'] .= PHP_EOL . PHP_EOL . $query; } } // make sure no unneeded white space is added @@ -840,8 +839,8 @@ class Interpretation extends Fields { $name = ComponentbuilderHelper::safeString($update['version']); $target = array('admin' => $name); - $this->buildDynamique($target,'sql_update',$update['version']); - $this->fileContentDynamic[$name.'_'.$update['version']]['###UPDATE_VERSION_MYSQL###'] = $update['mysql']; + $this->buildDynamique($target, 'sql_update', $update['version']); + $this->fileContentDynamic[$name . '_' . $update['version']]['###UPDATE_VERSION_MYSQL###'] = $update['mysql']; } elseif (isset($update['url']) && ComponentbuilderHelper::checkString($update['url'])) { @@ -852,25 +851,25 @@ class Interpretation extends Fields { // build update xml $updateXML[] = "\t"; - $updateXML[] = "\t\t".$this->fileContentStatic['###Component_name###'].""; - $updateXML[] = "\t\t".$this->fileContentStatic['###SHORT_DESCRIPTION###'].""; - $updateXML[] = "\t\tcom_".$this->fileContentStatic['###component###'].""; + $updateXML[] = "\t\t" . $this->fileContentStatic['###Component_name###'] . ""; + $updateXML[] = "\t\t" . $this->fileContentStatic['###SHORT_DESCRIPTION###'] . ""; + $updateXML[] = "\t\tcom_" . $this->fileContentStatic['###component###'] . ""; $updateXML[] = "\t\tcomponent"; - $updateXML[] = "\t\t".$update['version'].""; - $updateXML[] = "\t\t".''.$this->fileContentStatic['###AUTHORWEBSITE###'].''; + $updateXML[] = "\t\t" . $update['version'] . ""; + $updateXML[] = "\t\t" . '' . $this->fileContentStatic['###AUTHORWEBSITE###'] . ''; $updateXML[] = "\t\t"; if (!isset($update['url']) || !ComponentbuilderHelper::checkString($update['url'])) { $update['url'] = 'http://domain.com/demo.zip'; } - $updateXML[] = "\t\t\t".''.$update['url'].''; + $updateXML[] = "\t\t\t" . '' . $update['url'] . ''; $updateXML[] = "\t\t"; $updateXML[] = "\t\t"; $updateXML[] = "\t\t\tstable"; $updateXML[] = "\t\t"; - $updateXML[] = "\t\t".$this->fileContentStatic['###AUTHOR###'].""; - $updateXML[] = "\t\t".$this->fileContentStatic['###AUTHORWEBSITE###'].""; - $updateXML[] = "\t\t".''; + $updateXML[] = "\t\t" . $this->fileContentStatic['###AUTHOR###'] . ""; + $updateXML[] = "\t\t" . $this->fileContentStatic['###AUTHORWEBSITE###'] . ""; + $updateXML[] = "\t\t" . ''; $updateXML[] = "\t"; } } @@ -878,7 +877,7 @@ class Interpretation extends Fields public function noHelp() { $help = array(); - $help[] = PHP_EOL.PHP_EOL."\t/**"; + $help[] = PHP_EOL . PHP_EOL . "\t/**"; $help[] = "\t* Can be used to build help urls."; $help[] = "\t**/"; $help[] = "\tpublic static function getHelpUrl(\$view)"; @@ -886,7 +885,7 @@ class Interpretation extends Fields $help[] = "\t\treturn false;"; $help[] = "\t}"; // return the no help method - return implode(PHP_EOL,$help); + return implode(PHP_EOL, $help); } public function checkHelp($viewName_single) @@ -895,10 +894,10 @@ class Interpretation extends Fields { // set help file into admin place $target = array('admin' => 'help'); - $admindone = $this->buildDynamique($target,'help'); + $admindone = $this->buildDynamique($target, 'help'); // set the help file into site place $target = array('site' => 'help'); - $sitedone = $this->buildDynamique($target,'help'); + $sitedone = $this->buildDynamique($target, 'help'); if ($admindone && $sitedone) { // ###HELP### @@ -922,7 +921,7 @@ class Interpretation extends Fields $target = 'site_view'; } $help = array(); - $help[] = PHP_EOL.PHP_EOL."\t/**"; + $help[] = PHP_EOL . PHP_EOL . "\t/**"; $help[] = "\t* Load the Component Help URLs."; $help[] = "\t**/"; $help[] = "\tpublic static function getHelpUrl(\$view)"; @@ -932,9 +931,9 @@ class Interpretation extends Fields $help[] = "\t\t\$db = JFactory::getDbo();"; $help[] = "\t\t\$query = \$db->getQuery(true);"; $help[] = "\t\t\$query->select(array('a.id','a.groups','a.target','a.type','a.article','a.url'));"; - $help[] = "\t\t\$query->from('#__".$this->fileContentStatic['###component###']."_help_document AS a');"; - $help[] = "\t\t\$query->where('a.".$target." = '.\$db->quote(\$view));"; - $help[] = "\t\t\$query->where('a.location = ".(int) $location."');"; + $help[] = "\t\t\$query->from('#__" . $this->fileContentStatic['###component###'] . "_help_document AS a');"; + $help[] = "\t\t\$query->where('a." . $target . " = '.\$db->quote(\$view));"; + $help[] = "\t\t\$query->where('a.location = " . (int) $location . "');"; $help[] = "\t\t\$query->where('a.published = 1');"; $help[] = "\t\t\$db->setQuery(\$query);"; $help[] = "\t\t\$db->execute();"; @@ -950,23 +949,23 @@ class Interpretation extends Fields $help[] = "\t\t\t\t\t\t\$targetgroups = json_decode(\$help->groups, true);"; $help[] = "\t\t\t\t\t\tif (!array_intersect(\$targetgroups, \$groups))"; $help[] = "\t\t\t\t\t\t{"; - $help[] = "\t\t\t\t\t\t\t//".$this->setLine(__LINE__)." if user not in those target groups then remove the item"; + $help[] = "\t\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " if user not in those target groups then remove the item"; $help[] = "\t\t\t\t\t\t\tunset(\$helps[\$nr]);"; $help[] = "\t\t\t\t\t\t\tcontinue;"; $help[] = "\t\t\t\t\t\t}"; $help[] = "\t\t\t\t\t}"; - $help[] = "\t\t\t\t\t//".$this->setLine(__LINE__)." set the return type"; + $help[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " set the return type"; $help[] = "\t\t\t\t\tswitch (\$help->type)"; $help[] = "\t\t\t\t\t{"; - $help[] = "\t\t\t\t\t\t//".$this->setLine(__LINE__)." set joomla article"; + $help[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " set joomla article"; $help[] = "\t\t\t\t\t\tcase 1:"; $help[] = "\t\t\t\t\t\t\treturn self::loadArticleLink(\$help->article);"; $help[] = "\t\t\t\t\t\tbreak;"; - $help[] = "\t\t\t\t\t\t//".$this->setLine(__LINE__)." set help text"; + $help[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " set help text"; $help[] = "\t\t\t\t\t\tcase 2:"; $help[] = "\t\t\t\t\t\t\treturn self::loadHelpTextLink(\$help->id);"; $help[] = "\t\t\t\t\t\tbreak;"; - $help[] = "\t\t\t\t\t\t//".$this->setLine(__LINE__)." set Link"; + $help[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " set Link"; $help[] = "\t\t\t\t\t\tcase 3:"; $help[] = "\t\t\t\t\t\t\treturn \$help->url;"; $help[] = "\t\t\t\t\t\tbreak;"; @@ -976,23 +975,23 @@ class Interpretation extends Fields $help[] = "\t\t}"; $help[] = "\t\treturn false;"; $help[] = "\t}"; - $help[] = PHP_EOL."\t/**"; + $help[] = PHP_EOL . "\t/**"; $help[] = "\t* Get the Article Link."; $help[] = "\t**/"; $help[] = "\tprotected static function loadArticleLink(\$id)"; $help[] = "\t{"; $help[] = "\t\treturn JURI::root().'index.php?option=com_content&view=article&id='.\$id.'&tmpl=component&layout=modal';"; $help[] = "\t}"; - $help[] = PHP_EOL."\t/**"; + $help[] = PHP_EOL . "\t/**"; $help[] = "\t* Get the Help Text Link."; $help[] = "\t**/"; $help[] = "\tprotected static function loadHelpTextLink(\$id)"; $help[] = "\t{"; $help[] = "\t\t\$token = JSession::getFormToken();"; - $help[] = "\t\treturn 'index.php?option=com_".$this->fileContentStatic['###component###']."&task=help.getText&id=' . (int) \$id . '&token=' . \$token;"; + $help[] = "\t\treturn 'index.php?option=com_" . $this->fileContentStatic['###component###'] . "&task=help.getText&id=' . (int) \$id . '&token=' . \$token;"; $help[] = "\t}"; // return the help methods - return implode(PHP_EOL,$help); + return implode(PHP_EOL, $help); } public function setExelHelperMethods() @@ -1000,44 +999,44 @@ class Interpretation extends Fields if ($this->addEximport) { $exel = array(); - $exel[] = PHP_EOL.PHP_EOL."\t/**"; + $exel[] = PHP_EOL . PHP_EOL . "\t/**"; $exel[] = "\t * Prepares the xml document"; $exel[] = "\t */"; - $exel[] = "\tpublic static function xls(\$rows,\$fileName = null,\$title = null,\$subjectTab = null,\$creator = '".$this->fileContentStatic['###COMPANYNAME###']."',\$description = null,\$category = null,\$keywords = null,\$modified = null)"; + $exel[] = "\tpublic static function xls(\$rows,\$fileName = null,\$title = null,\$subjectTab = null,\$creator = '" . $this->fileContentStatic['###COMPANYNAME###'] . "',\$description = null,\$category = null,\$keywords = null,\$modified = null)"; $exel[] = "\t{"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." set the user"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set the user"; $exel[] = "\t\t\$user = JFactory::getUser();"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." set fieldname if not set"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set fieldname if not set"; $exel[] = "\t\tif (!\$fileName)"; $exel[] = "\t\t{"; $exel[] = "\t\t\t\$fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y');"; $exel[] = "\t\t}"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." set modiefied if not set"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set modiefied if not set"; $exel[] = "\t\tif (!\$modified)"; $exel[] = "\t\t{"; $exel[] = "\t\t\t\$modified = \$user->name;"; $exel[] = "\t\t}"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." set title if not set"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set title if not set"; $exel[] = "\t\tif (!\$title)"; $exel[] = "\t\t{"; $exel[] = "\t\t\t\$title = 'Book1';"; $exel[] = "\t\t}"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." set tab name if not set"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set tab name if not set"; $exel[] = "\t\tif (!\$subjectTab)"; $exel[] = "\t\t{"; $exel[] = "\t\t\t\$subjectTab = 'Sheet1';"; $exel[] = "\t\t}"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." make sure the file is loaded\t\t"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " make sure the file is loaded\t\t"; $exel[] = "\t\tJLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." Create new PHPExcel object"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Create new PHPExcel object"; $exel[] = "\t\t\$objPHPExcel = new PHPExcel();"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." Set document properties"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Set document properties"; $exel[] = "\t\t\$objPHPExcel->getProperties()->setCreator(\$creator)"; - $exel[] = "\t\t\t\t\t\t\t\t\t ->setCompany('".$this->fileContentStatic['###COMPANYNAME###']."')"; + $exel[] = "\t\t\t\t\t\t\t\t\t ->setCompany('" . $this->fileContentStatic['###COMPANYNAME###'] . "')"; $exel[] = "\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\$modified)"; $exel[] = "\t\t\t\t\t\t\t\t\t ->setTitle(\$title)"; $exel[] = "\t\t\t\t\t\t\t\t\t ->setSubject(\$subjectTab);"; @@ -1054,7 +1053,7 @@ class Interpretation extends Fields $exel[] = "\t\t\t\$objPHPExcel->getProperties()->setCategory(\$category);"; $exel[] = "\t\t}"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." Some styles"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Some styles"; $exel[] = "\t\t\$headerStyles = array("; $exel[] = "\t\t\t'font' => array("; $exel[] = "\t\t\t\t'bold' => true,"; @@ -1076,7 +1075,7 @@ class Interpretation extends Fields $exel[] = "\t\t\t\t'name' => 'Verdana'"; $exel[] = "\t\t));"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." Add some data"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Add some data"; $exel[] = "\t\tif (self::checkArray(\$rows))"; $exel[] = "\t\t{"; $exel[] = "\t\t\t\$i = 1;"; @@ -1103,20 +1102,20 @@ class Interpretation extends Fields $exel[] = "\t\t\treturn false;"; $exel[] = "\t\t}"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." Rename worksheet"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Rename worksheet"; $exel[] = "\t\t\$objPHPExcel->getActiveSheet()->setTitle(\$subjectTab);"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." Set active sheet index to the first sheet, so Excel opens this as the first sheet"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Set active sheet index to the first sheet, so Excel opens this as the first sheet"; $exel[] = "\t\t\$objPHPExcel->setActiveSheetIndex(0);"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." Redirect output to a client's web browser (Excel5)"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect output to a client's web browser (Excel5)"; $exel[] = "\t\theader('Content-Type: application/vnd.ms-excel');"; $exel[] = "\t\theader('Content-Disposition: attachment;filename=\"'.\$fileName.'.xls\"');"; $exel[] = "\t\theader('Cache-Control: max-age=0');"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." If you're serving to IE 9, then the following may be needed"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " If you're serving to IE 9, then the following may be needed"; $exel[] = "\t\theader('Cache-Control: max-age=1');"; $exel[] = "\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." If you're serving to IE over SSL, then the following may be needed"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " If you're serving to IE over SSL, then the following may be needed"; $exel[] = "\t\theader ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past"; $exel[] = "\t\theader ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified"; $exel[] = "\t\theader ('Cache-Control: cache, must-revalidate'); // HTTP/1.1"; @@ -1132,27 +1131,27 @@ class Interpretation extends Fields $exel[] = "\t*/"; $exel[] = "\tpublic static function getFileHeaders(\$dataType)"; $exel[] = "\t{\t\t"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." make sure these files are loaded\t\t"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " make sure these files are loaded\t\t"; $exel[] = "\t\tJLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');"; $exel[] = "\t\tJLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader');"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." get session object"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " get session object"; $exel[] = "\t\t\$session\t= JFactory::getSession();"; $exel[] = "\t\t\$package\t= \$session->get('package', null);"; $exel[] = "\t\t\$package\t= json_decode(\$package, true);"; - $exel[] = "\t\t//".$this->setLine(__LINE__)." set the headers"; + $exel[] = "\t\t//" . $this->setLine(__LINE__) . " set the headers"; $exel[] = "\t\tif(isset(\$package['dir']))"; $exel[] = "\t\t{"; $exel[] = "\t\t\t\$chunkFilter = new PHPExcel_Reader_chunkReadFilter();"; - $exel[] = "\t\t\t//".$this->setLine(__LINE__)." only load first three rows"; + $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " only load first three rows"; $exel[] = "\t\t\t\$chunkFilter->setRows(2,1);"; - $exel[] = "\t\t\t//".$this->setLine(__LINE__)." identify the file type"; + $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " identify the file type"; $exel[] = "\t\t\t\$inputFileType = PHPExcel_IOFactory::identify(\$package['dir']);"; - $exel[] = "\t\t\t//".$this->setLine(__LINE__)." create the reader for this file type"; + $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " create the reader for this file type"; $exel[] = "\t\t\t\$excelReader = PHPExcel_IOFactory::createReader(\$inputFileType);"; - $exel[] = "\t\t\t//".$this->setLine(__LINE__)." load the limiting filter"; + $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " load the limiting filter"; $exel[] = "\t\t\t\$excelReader->setReadFilter(\$chunkFilter);"; $exel[] = "\t\t\t\$excelReader->setReadDataOnly(true);"; - $exel[] = "\t\t\t//".$this->setLine(__LINE__)." load the rows (only first three)"; + $exel[] = "\t\t\t//" . $this->setLine(__LINE__) . " load the rows (only first three)"; $exel[] = "\t\t\t\$excelObj = \$excelReader->load(\$package['dir']);"; $exel[] = "\t\t\t\$headers = array();"; $exel[] = "\t\t\tforeach (\$excelObj->getActiveSheet()->getRowIterator() as \$row)"; @@ -1178,7 +1177,7 @@ class Interpretation extends Fields $exel[] = "\t\treturn false;"; $exel[] = "\t}"; // return the help methods - return implode(PHP_EOL,$exel); + return implode(PHP_EOL, $exel); } return ''; } @@ -1188,43 +1187,43 @@ class Interpretation extends Fields if ($add) { $method = array(); - $method[] = PHP_EOL.PHP_EOL."\t/**"; + $method[] = PHP_EOL . PHP_EOL . "\t/**"; $method[] = "\t* Greate user and update given table"; $method[] = "\t*/"; $method[] = "\tpublic static function createUser(\$new)"; $method[] = "\t{"; - $method[] = "\t\t//".$this->setLine(__LINE__)." load the user component language files if there is an error."; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " load the user component language files if there is an error."; $method[] = "\t\t\$lang = JFactory::getLanguage();"; $method[] = "\t\t\$extension = 'com_users';"; $method[] = "\t\t\$base_dir = JPATH_SITE;"; $method[] = "\t\t\$language_tag = 'en-GB';"; $method[] = "\t\t\$reload = true;"; $method[] = "\t\t\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);"; - $method[] = "\t\t//".$this->setLine(__LINE__)." load the user regestration model"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " load the user regestration model"; $method[] = "\t\t\$model = self::getModel('registration', JPATH_ROOT. '/components/com_users', 'Users');"; - $method[] = "\t\t//".$this->setLine(__LINE__)." make sure no activation is needed"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " make sure no activation is needed"; $method[] = "\t\t\$useractivation = self::setParams('com_users','useractivation',0);"; - $method[] = "\t\t//".$this->setLine(__LINE__)." make sure password is send"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " make sure password is send"; $method[] = "\t\t\$sendpassword = self::setParams('com_users','sendpassword',1);"; - $method[] = "\t\t//".$this->setLine(__LINE__)." Check if password was set"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " Check if password was set"; $method[] = "\t\tif (isset(\$new['password']) && isset(\$new['password2']) && self::checkString(\$new['password']) && self::checkString(\$new['password2']))"; $method[] = "\t\t{"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Use the users passwords"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Use the users passwords"; $method[] = "\t\t\t\$password = \$new['password'];"; $method[] = "\t\t\t\$password2 = \$new['password2'];"; $method[] = "\t\t}"; $method[] = "\t\telse"; $method[] = "\t\t{"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Set random password"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set random password"; $method[] = "\t\t\t\$password = self::randomkey(8);"; $method[] = "\t\t\t\$password2 = \$password;"; $method[] = "\t\t}"; - $method[] = "\t\t//".$this->setLine(__LINE__)." set username if not set"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " set username if not set"; $method[] = "\t\tif (!isset(\$new['username']) || !self::checkString(\$new['username']))"; $method[] = "\t\t{"; $method[] = "\t\t\t\$new['username'] = self::safeString(\$new['name']);"; $method[] = "\t\t}"; - $method[] = "\t\t//".$this->setLine(__LINE__)." linup new user data"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " linup new user data"; $method[] = "\t\t\$data = array("; $method[] = "\t\t\t'username' => \$new['username'],"; $method[] = "\t\t\t'name' => \$new['name'],"; @@ -1232,13 +1231,13 @@ class Interpretation extends Fields $method[] = "\t\t\t'password1' => \$password, // First password field"; $method[] = "\t\t\t'password2' => \$password2, // Confirm password field"; $method[] = "\t\t\t'block' => 0 );"; - $method[] = "\t\t//".$this->setLine(__LINE__)." register the new user"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " register the new user"; $method[] = "\t\t\$userId = \$model->register(\$data);"; - $method[] = "\t\t//".$this->setLine(__LINE__)." set activation back to default"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " set activation back to default"; $method[] = "\t\tself::setParams('com_users','useractivation',\$useractivation);"; - $method[] = "\t\t//".$this->setLine(__LINE__)." set send password back to default"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " set send password back to default"; $method[] = "\t\tself::setParams('com_users','sendpassword',\$sendpassword);"; - $method[] = "\t\t//".$this->setLine(__LINE__)." if user is created"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " if user is created"; $method[] = "\t\tif (\$userId > 0)"; $method[] = "\t\t{"; $method[] = "\t\t\treturn \$userId;"; @@ -1246,30 +1245,30 @@ class Interpretation extends Fields $method[] = "\t\treturn \$model->getError();"; $method[] = "\t}"; - $method[] = PHP_EOL."\tprotected static function setParams(\$component,\$target,\$value)"; + $method[] = PHP_EOL . "\tprotected static function setParams(\$component,\$target,\$value)"; $method[] = "\t{"; - $method[] = "\t\t//".$this->setLine(__LINE__)." Get the params and set the new values"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " Get the params and set the new values"; $method[] = "\t\t\$params = JComponentHelper::getParams(\$component);"; $method[] = "\t\t\$was = \$params->get(\$target, null);"; $method[] = "\t\tif (\$was != \$value)"; $method[] = "\t\t{"; $method[] = "\t\t\t\$params->set(\$target, \$value);"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Get a new database query instance"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get a new database query instance"; $method[] = "\t\t\t\$db = JFactory::getDBO();"; $method[] = "\t\t\t\$query = \$db->getQuery(true);"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Build the query"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Build the query"; $method[] = "\t\t\t\$query->update('#__extensions AS a');"; $method[] = "\t\t\t\$query->set('a.params = ' . \$db->quote((string)\$params));"; $method[] = "\t\t\t\$query->where('a.element = ' . \$db->quote((string)\$component));"; $method[] = "\t\t\t"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Execute the query"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Execute the query"; $method[] = "\t\t\t\$db->setQuery(\$query);"; $method[] = "\t\t\t\$db->query();"; $method[] = "\t\t}"; $method[] = "\t\treturn \$was;"; $method[] = "\t}"; - - $method[] = PHP_EOL."\t/**"; + + $method[] = PHP_EOL . "\t/**"; $method[] = "\t* Update user values"; $method[] = "\t*/"; $method[] = "\tpublic static function updateUser(\$new)"; @@ -1319,7 +1318,7 @@ class Interpretation extends Fields $method[] = "\t}"; // return the help method - return implode(PHP_EOL,$method); + return implode(PHP_EOL, $method); } return ''; } @@ -1329,85 +1328,85 @@ class Interpretation extends Fields $xml = ''; // build the file $target = array('site' => $view['settings']->code); - $done = $this->buildDynamique($target,'menu'); + $done = $this->buildDynamique($target, 'menu'); if ($done) { // set the lang - $lang = ComponentbuilderHelper::safeString('com_'.$this->fileContentStatic['###component###'].'_menu_'.$view['settings']->code, 'U'); - $this->langContent['adminsys'][$lang.'_TITLE'] = $view['settings']->name; - $this->langContent['adminsys'][$lang.'_OPTION'] = $view['settings']->name; - $this->langContent['adminsys'][$lang.'_DESC'] = $view['settings']->description; + $lang = ComponentbuilderHelper::safeString('com_' . $this->fileContentStatic['###component###'] . '_menu_' . $view['settings']->code, 'U'); + $this->langContent['adminsys'][$lang . '_TITLE'] = $view['settings']->name; + $this->langContent['adminsys'][$lang . '_OPTION'] = $view['settings']->name; + $this->langContent['adminsys'][$lang . '_DESC'] = $view['settings']->description; //start loading xml $xml = ''; - $xml .= PHP_EOL.''; - $xml .= PHP_EOL."\t".''; - $xml .= PHP_EOL."\t\t".''; - $xml .= PHP_EOL."\t\t\t".''; - $xml .= PHP_EOL."\t\t".''; - $xml .= PHP_EOL."\t".''; + $xml .= PHP_EOL . ''; + $xml .= PHP_EOL . "\t" . ''; + $xml .= PHP_EOL . "\t\t" . ''; + $xml .= PHP_EOL . "\t\t\t" . ''; + $xml .= PHP_EOL . "\t\t" . ''; + $xml .= PHP_EOL . "\t" . ''; if (isset($this->hasIdRequest[$view['settings']->code]) || isset($this->hasCatIdRequest[$view['settings']->code])) { - $xml .= PHP_EOL."\t".''; - $xml .= PHP_EOL."\t".''; - $xml .= PHP_EOL."\t\t".'
fileContentStatic['###component###'].'/models/rules"'; - $xml .= PHP_EOL."\t\t\t".'addfieldpath="/administrator/components/com_'.$this->fileContentStatic['###component###'].'/models/fields">'; + $xml .= PHP_EOL . "\t" . ''; + $xml .= PHP_EOL . "\t" . ''; + $xml .= PHP_EOL . "\t\t" . '
'; if (isset($this->hasIdRequest[$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->hasIdRequest[$view['settings']->code])) { - foreach($this->hasIdRequest[$view['settings']->code] as $requestFieldXML) + foreach ($this->hasIdRequest[$view['settings']->code] as $requestFieldXML) { - $xml .= PHP_EOL."\t\t\t".$requestFieldXML; + $xml .= PHP_EOL . "\t\t\t" . $requestFieldXML; } } if (isset($this->hasCatIdRequest[$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->hasCatIdRequest[$view['settings']->code])) { - foreach($this->hasCatIdRequest[$view['settings']->code] as $requestFieldXML) + foreach ($this->hasCatIdRequest[$view['settings']->code] as $requestFieldXML) { - $xml .= PHP_EOL."\t\t\t".$requestFieldXML; + $xml .= PHP_EOL . "\t\t\t" . $requestFieldXML; } } - $xml .= PHP_EOL."\t\t".'
'; - $xml .= PHP_EOL."\t".'
'; + $xml .= PHP_EOL . "\t\t" . '
'; + $xml .= PHP_EOL . "\t" . '
'; } if (isset($this->frontEndParams) && isset($this->frontEndParams[$view['settings']->name])) { // first we must setup the fields for the page use - $params = $this->setupFrontendParamFields($this->frontEndParams[$view['settings']->name],$view['settings']->code); + $params = $this->setupFrontendParamFields($this->frontEndParams[$view['settings']->name], $view['settings']->code); // now load the fields if (ComponentbuilderHelper::checkArray($params)) { - $xml .= PHP_EOL."\t".''; - $xml .= PHP_EOL."\t".''; - $xml .= PHP_EOL."\t\t".'
fileContentStatic['###component###'].'/models/rules"'; - $xml .= PHP_EOL."\t\t\t".'addfieldpath="/administrator/components/com_'.$this->fileContentStatic['###component###'].'/models/fields">'; - $xml .= implode("\t\t\t",$params); - $xml .= PHP_EOL."\t\t".'
'; - $xml .= PHP_EOL."\t".'
'; + $xml .= PHP_EOL . "\t" . ''; + $xml .= PHP_EOL . "\t" . ''; + $xml .= PHP_EOL . "\t\t" . '
'; + $xml .= implode("\t\t\t", $params); + $xml .= PHP_EOL . "\t\t" . '
'; + $xml .= PHP_EOL . "\t" . '
'; } } - $xml .= PHP_EOL.'
'; + $xml .= PHP_EOL . '
'; } return $xml; } - - public function setupFrontendParamFields($params,$view) + + public function setupFrontendParamFields($params, $view) { $keep = array(); - $menuSetter = $view.'_menu'; + $menuSetter = $view . '_menu'; foreach ($params as $field) { // some switch to see if it should be added to front end params $target = ComponentbuilderHelper::getBetween($field, 'display="', '"'); if (!ComponentbuilderHelper::checkString($target) || $target === 'menu') { - + $field = str_replace('display="menu"', '', $field); // we load fields that have options - if (strpos($field,'Option Set. -->') !== false && strpos($field,$menuSetter) === false && !ComponentbuilderHelper::checkString($target)) + if (strpos($field, 'Option Set. -->') !== false && strpos($field, $menuSetter) === false && !ComponentbuilderHelper::checkString($target)) { // we add the global option - $field = str_replace('Option Set. -->', $this->setLine(__LINE__).' Global & Option Set. -->'.PHP_EOL."\t\t\t".'', $field); + $field = str_replace('Option Set. -->', $this->setLine(__LINE__) . ' Global & Option Set. -->' . PHP_EOL . "\t\t\t" . '', $field); // update the default to be global $field = preg_replace('/default=".+"/', 'default=""', $field); // update the default to be filter @@ -1426,7 +1425,7 @@ class Interpretation extends Fields return $keep; } - public function setCustomViewQuery(&$gets,&$code,$tab = '',$type = 'main') + public function setCustomViewQuery(&$gets, &$code, $tab = '', $type = 'main') { $query = ''; if (ComponentbuilderHelper::checkArray($gets)) @@ -1436,40 +1435,40 @@ class Interpretation extends Fields foreach ($gets as $nr => $the_get) { // to insure that there be no double entries of a call - $checker = md5(serialize($the_get).$code); - if (!isset($this->customViewQueryChecker[$this->target]) || !in_array($checker,$this->customViewQueryChecker[$this->target])) + $checker = md5(serialize($the_get) . $code); + if (!isset($this->customViewQueryChecker[$this->target]) || !in_array($checker, $this->customViewQueryChecker[$this->target])) { // load this unuiqe key $this->customViewQueryChecker[$this->target][] = $checker; if (ComponentbuilderHelper::checkString($the_get['selection']['type'])) { - $getItem = PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get from ".$the_get['selection']['table']." as ".$the_get['as']; + $getItem = PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get from " . $the_get['selection']['table'] . " as " . $the_get['as']; } else { - $getItem = PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get data"; + $getItem = PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get data"; } // set the selection - $getItem .= PHP_EOL."\t".$tab."\t".$the_get['selection']['select']; + $getItem .= PHP_EOL . "\t" . $tab . "\t" . $the_get['selection']['select']; if (($nr == 0 && (!isset($the_get['join_field']) || !ComponentbuilderHelper::checkString($the_get['join_field'])) && (isset($the_get['selection']['type']) && ComponentbuilderHelper::checkString($the_get['selection']['type']))) || ($type === 'custom' && (isset($the_get['selection']['type']) && ComponentbuilderHelper::checkString($the_get['selection']['type'])))) { - $getItem .= PHP_EOL."\t".$tab."\t".'$query->from('.$the_get['selection']['from'].');'; + $getItem .= PHP_EOL . "\t" . $tab . "\t" . '$query->from(' . $the_get['selection']['from'] . ');'; } elseif (isset($the_get['join_field']) && ComponentbuilderHelper::checkString($the_get['join_field']) && isset($the_get['selection']['type']) && ComponentbuilderHelper::checkString($the_get['selection']['type'])) { - $getItem .= PHP_EOL."\t".$tab."\t\$query->join('".$the_get['type']; - $getItem .= "', (".$the_get['selection']['from']; - $getItem .= ") . ' ON (' . \$db->quoteName('".$the_get['on_field']; - $getItem .= "') . ' ".$the_get['operator']; - $getItem .= " ' . \$db->quoteName('".$the_get['join_field']."') . ')');"; + $getItem .= PHP_EOL . "\t" . $tab . "\t\$query->join('" . $the_get['type']; + $getItem .= "', (" . $the_get['selection']['from']; + $getItem .= ") . ' ON (' . \$db->quoteName('" . $the_get['on_field']; + $getItem .= "') . ' " . $the_get['operator']; + $getItem .= " ' . \$db->quoteName('" . $the_get['join_field'] . "') . ')');"; $check = current(explode(".", $the_get['on_field'])); } // set the method defaults - $default = $this->setCustomViewMethodDefaults($the_get,$code); - if (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) && ComponentbuilderHelper::checkString($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) && !in_array($check,$mainAsArray)) + $default = $this->setCustomViewMethodDefaults($the_get, $code); + if (isset($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) && ComponentbuilderHelper::checkString($this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]) && !in_array($check, $mainAsArray)) { // load to other query if (!isset($this->otherQuery[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']])) @@ -1489,7 +1488,7 @@ class Interpretation extends Fields return $query; } - public function setCustomViewFieldDecodeFilter(&$get,&$filters,$string,$removeString,$code,$tab) + public function setCustomViewFieldDecodeFilter(&$get, &$filters, $string, $removeString, $code, $tab) { $filter = ''; // check if filter is set for this field @@ -1501,105 +1500,105 @@ class Interpretation extends Fields { $as = ''; $felt = ''; - list($as,$felt) = array_map('trim', explode('.',$ter['table_key'])); + list($as, $felt) = array_map('trim', explode('.', $ter['table_key'])); if ($get['as'] == $as) { switch ($ter['filter_type']) { case 4: - // COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS - $filter .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." filter ".$as." based on user groups"; - $filter .= PHP_EOL."\t".$tab."\t\$remove = (count(array_intersect((array) \$this->groups, (array) ".$string."->".$field."))) ? false : true;"; - $filter .= PHP_EOL."\t".$tab."\tif (\$remove)"; - $filter .= PHP_EOL."\t".$tab."\t{"; - if ($removeString == $string) - { - $filter .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." Remove ".$string." if user not in groups"; - $filter .= PHP_EOL."\t".$tab."\t\t".$string." = null;"; - $filter .= PHP_EOL."\t".$tab."\t\treturn false;"; - } - else - { - $filter .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." Unset ".$string." if user not in groups"; - $filter .= PHP_EOL."\t".$tab."\t\tunset(".$removeString.");"; - $filter .= PHP_EOL."\t".$tab."\t\tcontinue;"; - } - $filter .= PHP_EOL."\t".$tab."\t}"; - break; + // COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS + $filter .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " filter " . $as . " based on user groups"; + $filter .= PHP_EOL . "\t" . $tab . "\t\$remove = (count(array_intersect((array) \$this->groups, (array) " . $string . "->" . $field . "))) ? false : true;"; + $filter .= PHP_EOL . "\t" . $tab . "\tif (\$remove)"; + $filter .= PHP_EOL . "\t" . $tab . "\t{"; + if ($removeString == $string) + { + $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $string . " if user not in groups"; + $filter .= PHP_EOL . "\t" . $tab . "\t\t" . $string . " = null;"; + $filter .= PHP_EOL . "\t" . $tab . "\t\treturn false;"; + } + else + { + $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Unset " . $string . " if user not in groups"; + $filter .= PHP_EOL . "\t" . $tab . "\t\tunset(" . $removeString . ");"; + $filter .= PHP_EOL . "\t" . $tab . "\t\tcontinue;"; + } + $filter .= PHP_EOL . "\t" . $tab . "\t}"; + break; case 9: - // COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE + // COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE - $filter .= PHP_EOL.PHP_EOL."\t".$tab."\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(".$string."->".$field."))"; - $filter .= PHP_EOL."\t".$tab."\t{"; + $filter .= PHP_EOL . PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(" . $string . "->" . $field . "))"; + $filter .= PHP_EOL . "\t" . $tab . "\t{"; - $filter .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." do your thing here"; + $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " do your thing here"; - $filter .= PHP_EOL."\t".$tab."\t}"; - $filter .= PHP_EOL."\t".$tab."\telse"; - $filter .= PHP_EOL."\t".$tab."\t{"; + $filter .= PHP_EOL . "\t" . $tab . "\t}"; + $filter .= PHP_EOL . "\t" . $tab . "\telse"; + $filter .= PHP_EOL . "\t" . $tab . "\t{"; - if ($removeString == $string) - { - $filter .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." Remove ".$string." if not array."; - $filter .= PHP_EOL."\t".$tab."\t\t".$string." = null;"; - } - else - { - $filter .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." Unset ".$string." if not array."; - $filter .= PHP_EOL."\t".$tab."\t\tunset(".$removeString.");"; - $filter .= PHP_EOL."\t".$tab."\t\tcontinue;"; - } + if ($removeString == $string) + { + $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $string . " if not array."; + $filter .= PHP_EOL . "\t" . $tab . "\t\t" . $string . " = null;"; + } + else + { + $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Unset " . $string . " if not array."; + $filter .= PHP_EOL . "\t" . $tab . "\t\tunset(" . $removeString . ");"; + $filter .= PHP_EOL . "\t" . $tab . "\t\tcontinue;"; + } - $filter .= PHP_EOL."\t".$tab."\t}"; - break; + $filter .= PHP_EOL . "\t" . $tab . "\t}"; + break; case 10: - // COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE - $filter .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." filter ".$as." based on repeatable value"; - $filter .= PHP_EOL."\t".$tab."\tif (".$this->fileContentStatic['###Component###']."Helper::checkString(".$string."->".$field."))"; - $filter .= PHP_EOL."\t".$tab."\t{"; + // COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE + $filter .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " filter " . $as . " based on repeatable value"; + $filter .= PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkString(" . $string . "->" . $field . "))"; + $filter .= PHP_EOL . "\t" . $tab . "\t{"; - $filter .= PHP_EOL."\t\t".$tab."\t\$array = json_decode(".$string."->".$field.",true);"; - $filter .= PHP_EOL."\t\t".$tab."\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$array))"; - $filter .= PHP_EOL."\t\t".$tab."\t{"; + $filter .= PHP_EOL . "\t\t" . $tab . "\t\$array = json_decode(" . $string . "->" . $field . ",true);"; + $filter .= PHP_EOL . "\t\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$array))"; + $filter .= PHP_EOL . "\t\t" . $tab . "\t{"; - $filter .= PHP_EOL."\t\t".$tab."\t\t//".$this->setLine(__LINE__)." do your thing here"; + $filter .= PHP_EOL . "\t\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " do your thing here"; - $filter .= PHP_EOL."\t\t".$tab."\t}"; - $filter .= PHP_EOL."\t".$tab."\t\telse"; - $filter .= PHP_EOL."\t".$tab."\t\t{"; + $filter .= PHP_EOL . "\t\t" . $tab . "\t}"; + $filter .= PHP_EOL . "\t" . $tab . "\t\telse"; + $filter .= PHP_EOL . "\t" . $tab . "\t\t{"; - if ($removeString == $string) - { - $filter .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." Remove ".$string." if not array."; - $filter .= PHP_EOL."\t".$tab."\t\t\t".$string." = null;"; - } - else - { - $filter .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." Unset ".$string." if not array."; - $filter .= PHP_EOL."\t".$tab."\t\t\tunset(".$removeString.");"; - $filter .= PHP_EOL."\t".$tab."\t\t\tcontinue;"; - } + if ($removeString == $string) + { + $filter .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $string . " if not array."; + $filter .= PHP_EOL . "\t" . $tab . "\t\t\t" . $string . " = null;"; + } + else + { + $filter .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " Unset " . $string . " if not array."; + $filter .= PHP_EOL . "\t" . $tab . "\t\t\tunset(" . $removeString . ");"; + $filter .= PHP_EOL . "\t" . $tab . "\t\t\tcontinue;"; + } - $filter .= PHP_EOL."\t".$tab."\t\t}"; + $filter .= PHP_EOL . "\t" . $tab . "\t\t}"; - $filter .= PHP_EOL."\t".$tab."\t}"; - $filter .= PHP_EOL."\t".$tab."\telse"; - $filter .= PHP_EOL."\t".$tab."\t{"; + $filter .= PHP_EOL . "\t" . $tab . "\t}"; + $filter .= PHP_EOL . "\t" . $tab . "\telse"; + $filter .= PHP_EOL . "\t" . $tab . "\t{"; - if ($removeString == $string) - { - $filter .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." Remove ".$string." if not string."; - $filter .= PHP_EOL."\t".$tab."\t\t".$string." = null;"; - } - else - { - $filter .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." Unset ".$string." if not string."; - $filter .= PHP_EOL."\t".$tab."\t\tunset(".$removeString.");"; - $filter .= PHP_EOL."\t".$tab."\t\tcontinue;"; - } + if ($removeString == $string) + { + $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $string . " if not string."; + $filter .= PHP_EOL . "\t" . $tab . "\t\t" . $string . " = null;"; + } + else + { + $filter .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Unset " . $string . " if not string."; + $filter .= PHP_EOL . "\t" . $tab . "\t\tunset(" . $removeString . ");"; + $filter .= PHP_EOL . "\t" . $tab . "\t\tcontinue;"; + } - $filter .= PHP_EOL."\t".$tab."\t}"; - break; + $filter .= PHP_EOL . "\t" . $tab . "\t}"; + break; } } } @@ -1608,7 +1607,7 @@ class Interpretation extends Fields return $filter; } - public function setCustomViewFieldDecode(&$get,$checker,$string,$code,$tab = '') + public function setCustomViewFieldDecode(&$get, $checker, $string, $code, $tab = '') { $fieldDecode = ''; foreach ($checker as $field => $array) @@ -1617,36 +1616,36 @@ class Interpretation extends Fields { if ($array['decode'] === 'json') { - $if = PHP_EOL."\t".$tab."\tif (".$this->fileContentStatic['###Component###']."Helper::checkJson(".$string."->".$field."))".PHP_EOL."\t".$tab."\t{"; + $if = PHP_EOL . "\t" . $tab . "\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkJson(" . $string . "->" . $field . "))" . PHP_EOL . "\t" . $tab . "\t{"; // json_decode - $decoder = $string."->".$field." = json_decode(".$string."->".$field.", true);"; + $decoder = $string . "->" . $field . " = json_decode(" . $string . "->" . $field . ", true);"; // TODO Use the type of field to prepare it even more for use in the view } elseif ($array['decode'] === 'base64') { - $if = PHP_EOL."\t".$tab."\tif (!empty(".$string."->".$field.") && ".$string."->".$field." === base64_encode(base64_decode(".$string."->".$field.")))".PHP_EOL."\t".$tab."\t{"; + $if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ")))" . PHP_EOL . "\t" . $tab . "\t{"; // base64_decode - $decoder = $string."->".$field." = base64_decode(".$string."->".$field.");"; + $decoder = $string . "->" . $field . " = base64_decode(" . $string . "->" . $field . ");"; // TODO Use the type of field to prepare it even more for use in the view } elseif ($array['decode'] === 'basic_encryption') { - $if = PHP_EOL."\t".$tab."\tif (!empty(".$string."->".$field.") && \$basickey && !is_numeric(".$string."->".$field.") && ".$string."->".$field." === base64_encode(base64_decode(".$string."->".$field.", true)))".PHP_EOL."\t".$tab."\t{"; + $if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && \$basickey && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" . PHP_EOL . "\t" . $tab . "\t{"; // basic decryption - $decoder = $string."->".$field." = rtrim(\$basic->decryptString(".$string."->".$field."), ".'"\0"'.");"; + $decoder = $string . "->" . $field . " = rtrim(\$basic->decryptString(" . $string . "->" . $field . "), " . '"\0"' . ");"; $this->siteDecrypt['basic'][$code] = true; } elseif ($array['decode'] === 'advance_encryption') { - $if = PHP_EOL."\t".$tab."\tif (!empty(".$string."->".$field.") && \$advancedkey && !is_numeric(".$string."->".$field.") && ".$string."->".$field." === base64_encode(base64_decode(".$string."->".$field.", true)))".PHP_EOL."\t".$tab."\t{"; + $if = PHP_EOL . "\t" . $tab . "\tif (!empty(" . $string . "->" . $field . ") && \$advancedkey && !is_numeric(" . $string . "->" . $field . ") && " . $string . "->" . $field . " === base64_encode(base64_decode(" . $string . "->" . $field . ", true)))" . PHP_EOL . "\t" . $tab . "\t{"; // advanced decryption - $decoder = $string."->".$field." = rtrim(\$advanced->decryptString(".$string."->".$field."), ".'"\0"'.");"; + $decoder = $string . "->" . $field . " = rtrim(\$advanced->decryptString(" . $string . "->" . $field . "), " . '"\0"' . ");"; $this->siteDecrypt['advanced'][$code] = true; } // build decoder string - $fieldDecode .= $if.PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." Decode ".$field; - $fieldDecode .= PHP_EOL."\t".$tab."\t\t".$decoder.PHP_EOL."\t".$tab."\t}"; + $fieldDecode .= $if . PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " Decode " . $field; + $fieldDecode .= PHP_EOL . "\t" . $tab . "\t\t" . $decoder . PHP_EOL . "\t" . $tab . "\t}"; } } return $fieldDecode; @@ -1656,26 +1655,27 @@ class Interpretation extends Fields { $fieldPrepare = ''; $runplugins = false; - $context = 'com_'.$this->fileContentStatic['###component###'].'.'.$code; + $context = 'com_' . $this->fileContentStatic['###component###'] . '.' . $code; foreach ($checker as $field => $array) { if (strpos($get['selection']['select'], $field) !== false) { // build decoder string - if(!$runplugins) { - $runplugins = PHP_EOL.$tab."\t//".$this->setLine(__LINE__)." Load the JEvent Dispatcher"; - $runplugins .= PHP_EOL.$tab."\tJPluginHelper::importPlugin('content');"; - $runplugins .= PHP_EOL.$tab."\t".'$this->_dispatcher = JEventDispatcher::getInstance();'; + if (!$runplugins) + { + $runplugins = PHP_EOL . $tab . "\t//" . $this->setLine(__LINE__) . " Load the JEvent Dispatcher"; + $runplugins .= PHP_EOL . $tab . "\tJPluginHelper::importPlugin('content');"; + $runplugins .= PHP_EOL . $tab . "\t" . '$this->_dispatcher = JEventDispatcher::getInstance();'; } - $fieldPrepare .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Make sure the content prepare plugins fire on ".$field; - $fieldPrepare .= PHP_EOL."\t".$tab."\t\$_".$field." = new stdClass();"; - $fieldPrepare .= PHP_EOL."\t".$tab."\t\$_".$field.'->text =& '.$string.'->'.$field.'; //'.$this->setLine(__LINE__).' value must be in text'; - $fieldPrepare .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Since all values are now in text (Joomla Limitation), we also add the field name (".$field.") to context"; - $fieldPrepare .= PHP_EOL."\t".$tab."\t".'$this->_dispatcher->trigger("onContentPrepare",array(\''.$context.'.'.$field.'\',&$_'.$field.',&$this->params));'; // we can improve the params later (TODO) + $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Make sure the content prepare plugins fire on " . $field; + $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t\$_" . $field . " = new stdClass();"; + $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t\$_" . $field . '->text =& ' . $string . '->' . $field . '; //' . $this->setLine(__LINE__) . ' value must be in text'; + $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Since all values are now in text (Joomla Limitation), we also add the field name (" . $field . ") to context"; + $fieldPrepare .= PHP_EOL . "\t" . $tab . "\t" . '$this->_dispatcher->trigger("onContentPrepare",array(\'' . $context . '.' . $field . '\',&$_' . $field . ',&$this->params));'; // we can improve the params later (TODO) } } // load dispatcher - $this->JEventDispatcher = array('###DISPATCHER###' => ($runplugins?:'')); + $this->JEventDispatcher = array('###DISPATCHER###' => ($runplugins ?: '')); // return content prepare fix return $fieldPrepare; } @@ -1690,8 +1690,8 @@ class Interpretation extends Fields // only load for uikit version 2 (TODO) we may need to add another check here if (2 == $this->uikit || 1 == $this->uikit) { - $fieldUikit .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Checking if ".$field." has uikit components that must be loaded."; - $fieldUikit .= PHP_EOL."\t".$tab."\t\$this->uikitComp = ".$this->fileContentStatic['###Component###']."Helper::getUikitComp(".$string."->".$field.",\$this->uikitComp);"; + $fieldUikit .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Checking if " . $field . " has uikit components that must be loaded."; + $fieldUikit .= PHP_EOL . "\t" . $tab . "\t\$this->uikitComp = " . $this->fileContentStatic['###Component###'] . "Helper::getUikitComp(" . $string . "->" . $field . ",\$this->uikitComp);"; } } } @@ -1699,7 +1699,7 @@ class Interpretation extends Fields return $fieldUikit; } - public function setCustomViewCustomJoin(&$gets,$string,$code,&$asBucket,$tab = '') + public function setCustomViewCustomJoin(&$gets, $string, $code, &$asBucket, $tab = '') { if (ComponentbuilderHelper::checkArray($gets)) { @@ -1707,12 +1707,12 @@ class Interpretation extends Fields foreach ($gets as $get) { // set the value name $default - $default = $this->setCustomViewMethodDefaults($get,$code); - if ($this->checkJoint($default,$get,$asBucket)) + $default = $this->setCustomViewMethodDefaults($get, $code); + if ($this->checkJoint($default, $get, $asBucket)) { // build custom join string - $otherJoin = PHP_EOL."\t###TAB###\t//".$this->setLine(__LINE__)." set ".$default['valueName']." to the ###STRING### object."; - $otherJoin .= PHP_EOL."\t###TAB###\t###STRING###->".$default['valueName']." = \$this->get".$default['methodName']."(###STRING###->".$this->getAsLookup[$get['key']][$get['on_field']].");"; + $otherJoin = PHP_EOL . "\t###TAB###\t//" . $this->setLine(__LINE__) . " set " . $default['valueName'] . " to the ###STRING### object."; + $otherJoin .= PHP_EOL . "\t###TAB###\t###STRING###->" . $default['valueName'] . " = \$this->get" . $default['methodName'] . "(###STRING###->" . $this->getAsLookup[$get['key']][$get['on_field']] . ");"; // load to other join if (!isset($this->otherJoin[$this->target][$default['code']][$this->siteDynamicGet[$this->target][$default['code']][$default['as']][$default['join_field']]][$default['valueName']])) { @@ -1723,20 +1723,20 @@ class Interpretation extends Fields else { // build custom join string - $customJoin .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." set ".$default['valueName']." to the ".$string." object."; - $customJoin .= PHP_EOL."\t".$tab."\t".$string."->".$default['valueName']." = \$this->get".$default['methodName']."(".$string."->".$this->getAsLookup[$get['key']][$get['on_field']].");"; + $customJoin .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set " . $default['valueName'] . " to the " . $string . " object."; + $customJoin .= PHP_EOL . "\t" . $tab . "\t" . $string . "->" . $default['valueName'] . " = \$this->get" . $default['methodName'] . "(" . $string . "->" . $this->getAsLookup[$get['key']][$get['on_field']] . ");"; } } return $customJoin; } return ''; } - - public function checkJoint(&$default,&$get,&$asBucket) + + public function checkJoint(&$default, &$get, &$asBucket) { // check if this function is not linked to the main call - list($aJoin) = explode('.',$get['on_field']); - if (ComponentbuilderHelper::checkArray($asBucket) && in_array($aJoin,$asBucket)) + list($aJoin) = explode('.', $get['on_field']); + if (ComponentbuilderHelper::checkArray($asBucket) && in_array($aJoin, $asBucket)) { return false; } @@ -1748,7 +1748,7 @@ class Interpretation extends Fields return false; } - public function setCustomViewFilter(&$filter,&$code,$tab = '') + public function setCustomViewFilter(&$filter, &$code, $tab = '') { $filters = ''; if (ComponentbuilderHelper::checkArray($filter)) @@ -1758,104 +1758,104 @@ class Interpretation extends Fields $as = ''; $field = ''; $string = ''; - if (strpos($ter['table_key'],'.') !== false) + if (strpos($ter['table_key'], '.') !== false) { - list($as,$field) = array_map('trim', explode('.',$ter['table_key'])); + list($as, $field) = array_map('trim', explode('.', $ter['table_key'])); } switch ($ter['filter_type']) { case 1: - // COM_COMPONENTBUILDER_DYNAMIC_GET_ID - $string = PHP_EOL."\t".$tab."\t\$query->where('".$ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$pk);"; - break; + // COM_COMPONENTBUILDER_DYNAMIC_GET_ID + $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$pk);"; + break; case 2: - // COM_COMPONENTBUILDER_DYNAMIC_GET_USER - $string = PHP_EOL."\t".$tab."\t\$query->where('".$ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$this->userId);"; - break; + // COM_COMPONENTBUILDER_DYNAMIC_GET_USER + $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . (int) \$this->userId);"; + break; case 3: - // COM_COMPONENTBUILDER_DYNAMIC_GET_ACCESS_LEVEL - $string = PHP_EOL."\t".$tab."\t\$query->where('".$ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->levels) . ')');"; - break; + // COM_COMPONENTBUILDER_DYNAMIC_GET_ACCESS_LEVEL + $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->levels) . ')');"; + break; case 4: - // COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS - $decodeChecker = $this->siteFieldData['decode'][$code][$ter['key']][$as][$field]; - if (ComponentbuilderHelper::checkArray($decodeChecker) || $ter['state_key'] === 'array') - { + // COM_COMPONENTBUILDER_DYNAMIC_GET_USER_GROUPS + $decodeChecker = $this->siteFieldData['decode'][$code][$ter['key']][$as][$field]; + if (ComponentbuilderHelper::checkArray($decodeChecker) || $ter['state_key'] === 'array') + { + // set needed fields to filter after query + $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field] = $ter; + } + else + { + $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->groups) . ')');"; + } + break; + case 5: + // COM_COMPONENTBUILDER_DYNAMIC_GET_CATEGORIES + $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic category filter is not ready."; + break; + case 6: + // COM_COMPONENTBUILDER_DYNAMIC_GET_TAGS + $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic tags filter is not ready."; + break; + case 7: + // COM_COMPONENTBUILDER_DYNAMIC_GET_DATE + $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " (TODO) The dynamic date filter is not ready."; + break; + case 8: + // COM_COMPONENTBUILDER_DYNAMIC_GET_FUNCTIONVAR + if ($ter['operator'] === 'IN' || $ter['operator'] === 'NOT IN') + { + $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " Check if " . $ter['state_key'] . " is an array with values."; + $string .= PHP_EOL . "\t\t" . $tab . "\$array = " . $ter['state_key'] . ";"; + $string .= PHP_EOL . "\t\t" . $tab . "if (isset(\$array) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$array))"; + $string .= PHP_EOL . "\t\t" . $tab . "{"; + $string .= PHP_EOL . "\t\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$array) . ')');"; + $string .= PHP_EOL . "\t\t" . $tab . "}"; + $string .= PHP_EOL . "\t\t" . $tab . "else"; + $string .= PHP_EOL . "\t\t" . $tab . "{"; + $string .= PHP_EOL . "\t\t" . $tab . "\treturn false;"; + $string .= PHP_EOL . "\t\t" . $tab . "}"; + } + else + { + $string = PHP_EOL . "\t\t" . $tab . "//" . $this->setLine(__LINE__) . " Check if " . $ter['state_key'] . " is a string or numeric value."; + $string .= PHP_EOL . "\t\t" . $tab . "\$checkValue = " . $ter['state_key'] . ";"; + $string .= PHP_EOL . "\t\t" . $tab . "if (isset(\$checkValue) && " . $this->fileContentStatic['###Component###'] . "Helper::checkString(\$checkValue))"; + $string .= PHP_EOL . "\t\t" . $tab . "{"; + $string .= PHP_EOL . "\t\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$db->quote(\$checkValue));"; + $string .= PHP_EOL . "\t\t" . $tab . "}"; + $string .= PHP_EOL . "\t\t" . $tab . "elseif (is_numeric(\$checkValue))"; + $string .= PHP_EOL . "\t\t" . $tab . "{"; + $string .= PHP_EOL . "\t\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " ' . \$checkValue);"; + $string .= PHP_EOL . "\t\t" . $tab . "}"; + $string .= PHP_EOL . "\t\t" . $tab . "else"; + $string .= PHP_EOL . "\t\t" . $tab . "{"; + $string .= PHP_EOL . "\t\t" . $tab . "\treturn false;"; + $string .= PHP_EOL . "\t\t" . $tab . "}"; + } + break; + case 9: + // COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE + $string = ""; // set needed fields to filter after query $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field] = $ter; - } - else - { - $string = PHP_EOL."\t".$tab."\t\$query->where('".$ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$this->groups) . ')');"; - } - break; - case 5: - // COM_COMPONENTBUILDER_DYNAMIC_GET_CATEGORIES - $string = PHP_EOL."\t\t".$tab."//".$this->setLine(__LINE__)." (TODO) The dynamic category filter is not ready."; - break; - case 6: - // COM_COMPONENTBUILDER_DYNAMIC_GET_TAGS - $string = PHP_EOL."\t\t".$tab."//".$this->setLine(__LINE__)." (TODO) The dynamic tags filter is not ready."; - break; - case 7: - // COM_COMPONENTBUILDER_DYNAMIC_GET_DATE - $string = PHP_EOL."\t\t".$tab."//".$this->setLine(__LINE__)." (TODO) The dynamic date filter is not ready."; - break; - case 8: - // COM_COMPONENTBUILDER_DYNAMIC_GET_FUNCTIONVAR - if ($ter['operator'] === 'IN' || $ter['operator'] === 'NOT IN') - { - $string = PHP_EOL."\t\t".$tab."//".$this->setLine(__LINE__)." Check if " . $ter['state_key'] . " is an array with values."; - $string .= PHP_EOL."\t\t".$tab."\$array = " . $ter['state_key'].";"; - $string .= PHP_EOL."\t\t".$tab."if (isset(\$array) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$array))"; - $string .= PHP_EOL."\t\t".$tab."{"; - $string .= PHP_EOL."\t\t".$tab."\t\$query->where('".$ter['table_key'] . " " . $ter['operator'] . " (' . implode(',', \$array) . ')');"; - $string .= PHP_EOL."\t\t".$tab."}"; - $string .= PHP_EOL."\t\t".$tab."else"; - $string .= PHP_EOL."\t\t".$tab."{"; - $string .= PHP_EOL."\t\t".$tab."\treturn false;"; - $string .= PHP_EOL."\t\t".$tab."}"; - } - else - { - $string = PHP_EOL."\t\t".$tab."//".$this->setLine(__LINE__)." Check if " . $ter['state_key'] . " is a string or numeric value."; - $string .= PHP_EOL."\t\t".$tab."\$checkValue = " . $ter['state_key'].";"; - $string .= PHP_EOL."\t\t".$tab."if (isset(\$checkValue) && ".$this->fileContentStatic['###Component###']."Helper::checkString(\$checkValue))"; - $string .= PHP_EOL."\t\t".$tab."{"; - $string .= PHP_EOL."\t\t".$tab."\t\$query->where('".$ter['table_key'] . " " . $ter['operator'] . " ' . \$db->quote(\$checkValue));"; - $string .= PHP_EOL."\t\t".$tab."}"; - $string .= PHP_EOL."\t\t".$tab."elseif (is_numeric(\$checkValue))"; - $string .= PHP_EOL."\t\t".$tab."{"; - $string .= PHP_EOL."\t\t".$tab."\t\$query->where('".$ter['table_key'] . " " . $ter['operator'] . " ' . \$checkValue);"; - $string .= PHP_EOL."\t\t".$tab."}"; - $string .= PHP_EOL."\t\t".$tab."else"; - $string .= PHP_EOL."\t\t".$tab."{"; - $string .= PHP_EOL."\t\t".$tab."\treturn false;"; - $string .= PHP_EOL."\t\t".$tab."}"; - } - break; - case 9: - // COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE - $string = ""; - // set needed fields to filter after query - $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field] = $ter; - break; + break; case 10: - // COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE - $string = ""; - // set needed fields to filter after query - $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field] = $ter; - break; + // COM_COMPONENTBUILDER_DYNAMIC_GET_REPEATABLE_VALUE + $string = ""; + // set needed fields to filter after query + $this->siteFieldDecodeFilter[$this->target][$code][$ter['key']][$as][$field] = $ter; + break; case 11: - // COM_COMPONENTBUILDER_DYNAMIC_GET_OTHER - if (strpos($as,'(') !== false) - { - // TODO (for now we only fix extra sql methods here) - list($dump,$as) = array_map('trim', explode('(',$as)); - $field = trim(str_replace(')', '', $field)); - } - $string = PHP_EOL."\t".$tab."\t\$query->where('".$ter['table_key'] . " " . $ter['operator'] . " ". $ter['state_key']."');"; - break; + // COM_COMPONENTBUILDER_DYNAMIC_GET_OTHER + if (strpos($as, '(') !== false) + { + // TODO (for now we only fix extra sql methods here) + list($dump, $as) = array_map('trim', explode('(', $as)); + $field = trim(str_replace(')', '', $field)); + } + $string = PHP_EOL . "\t" . $tab . "\t\$query->where('" . $ter['table_key'] . " " . $ter['operator'] . " " . $ter['state_key'] . "');"; + break; } // only add if the filter is set if (ComponentbuilderHelper::checkString($string)) @@ -1865,7 +1865,7 @@ class Interpretation extends Fields { $filters .= $string; } - elseif($as !== 'a') + elseif ($as !== 'a') { $this->otherFilter[$this->target][$code][$as][$field] = $string; } @@ -1875,32 +1875,32 @@ class Interpretation extends Fields return $filters; } - public function setCustomViewOrder(&$order,&$code,$tab = '') + public function setCustomViewOrder(&$order, &$code, $tab = '') { $ordering = ''; if (ComponentbuilderHelper::checkArray($order)) { foreach ($order as $or) { - list($as,$field) = array_map('trim', explode('.',$or['table_key'])); + list($as, $field) = array_map('trim', explode('.', $or['table_key'])); // set the string - $string = "\$query->order('".$or['table_key']." ".$or['direction']."');"; + $string = "\$query->order('" . $or['table_key'] . " " . $or['direction'] . "');"; // sort where if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) && ComponentbuilderHelper::checkString($this->siteMainGet[$this->target][$code][$as]))) { - $ordering .= PHP_EOL."\t".$tab."\t".$string; + $ordering .= PHP_EOL . "\t" . $tab . "\t" . $string; } else { - $this->otherOrder[$this->target][$code][$as][$field] = PHP_EOL."\t\t".$string; + $this->otherOrder[$this->target][$code][$as][$field] = PHP_EOL . "\t\t" . $string; } } } return $ordering; } - public function setCustomViewWhere(&$where,&$code,$tab = '') + public function setCustomViewWhere(&$where, &$code, $tab = '') { $wheres = ''; if (ComponentbuilderHelper::checkArray($where)) @@ -1910,13 +1910,12 @@ class Interpretation extends Fields $as = ''; $field = ''; $value = ''; - list($as,$field) = array_map('trim', explode('.',$whe['table_key'])); + list($as, $field) = array_map('trim', explode('.', $whe['table_key'])); if (is_numeric($whe['value_key'])) { - $value = " ".$whe['value_key']."');"; - + $value = " " . $whe['value_key'] . "');"; } - elseif (strpos($whe['value_key'],'$') !== false) + elseif (strpos($whe['value_key'], '$') !== false) { if ($whe['operator'] === 'IN' || $whe['operator'] === 'NOT IN') { @@ -1924,23 +1923,23 @@ class Interpretation extends Fields } else { - $value = " ' . \$db->quote(".$whe['value_key']."));"; + $value = " ' . \$db->quote(" . $whe['value_key'] . "));"; } } - elseif (strpos($whe['value_key'],'.') !== false) + elseif (strpos($whe['value_key'], '.') !== false) { - if (strpos($whe['value_key'],"'") !== false) + if (strpos($whe['value_key'], "'") !== false) { - $value = " ' . \$db->quote(".$whe['value_key']."));"; + $value = " ' . \$db->quote(" . $whe['value_key'] . "));"; } else { - $value = " ".$whe['value_key']."');"; + $value = " " . $whe['value_key'] . "');"; } } elseif (ComponentbuilderHelper::checkString($whe['value_key'])) { - $value = " ".$whe['value_key']."');"; + $value = " " . $whe['value_key'] . "');"; } // only load if there is a value if (ComponentbuilderHelper::checkString($value)) @@ -1953,30 +1952,29 @@ class Interpretation extends Fields // set the string if ($whe['operator'] === 'IN' || $whe['operator'] === 'NOT IN') { - $string = "if (isset(" . $whe['value_key']. ") && ".$this->fileContentStatic['###Component###']."Helper::checkArray(" . $whe['value_key']. "))"; - $string .= PHP_EOL."\t".$tabe."\t{"; - $string .= PHP_EOL."\t".$tabe."\t\t//".$this->setLine(__LINE__)." Get where ".$whe['table_key']." is " . $whe['value_key']; - $string .= PHP_EOL."\t".$tabe."\t\t\$query->where('".$whe['table_key']." ".$whe['operator'].$value; - $string .= PHP_EOL."\t".$tabe."\t}"; - $string .= PHP_EOL."\t".$tabe."\telse"; - $string .= PHP_EOL."\t".$tabe."\t{"; - $string .= PHP_EOL."\t".$tabe."\t\treturn false;"; - $string .= PHP_EOL."\t".$tabe."\t}"; - + $string = "if (isset(" . $whe['value_key'] . ") && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(" . $whe['value_key'] . "))"; + $string .= PHP_EOL . "\t" . $tabe . "\t{"; + $string .= PHP_EOL . "\t" . $tabe . "\t\t//" . $this->setLine(__LINE__) . " Get where " . $whe['table_key'] . " is " . $whe['value_key']; + $string .= PHP_EOL . "\t" . $tabe . "\t\t\$query->where('" . $whe['table_key'] . " " . $whe['operator'] . $value; + $string .= PHP_EOL . "\t" . $tabe . "\t}"; + $string .= PHP_EOL . "\t" . $tabe . "\telse"; + $string .= PHP_EOL . "\t" . $tabe . "\t{"; + $string .= PHP_EOL . "\t" . $tabe . "\t\treturn false;"; + $string .= PHP_EOL . "\t" . $tabe . "\t}"; } else { - $string = "//".$this->setLine(__LINE__)." Get where ".$whe['table_key']." is " . $whe['value_key']; - $string .= PHP_EOL."\t".$tabe."\t\$query->where('".$whe['table_key']." ".$whe['operator'].$value; + $string = "//" . $this->setLine(__LINE__) . " Get where " . $whe['table_key'] . " is " . $whe['value_key']; + $string .= PHP_EOL . "\t" . $tabe . "\t\$query->where('" . $whe['table_key'] . " " . $whe['operator'] . $value; } // sort where if ($as === 'a' || (isset($this->siteMainGet[$this->target][$code][$as]) && ComponentbuilderHelper::checkString($this->siteMainGet[$this->target][$code][$as]))) { - $wheres .= PHP_EOL."\t".$tab."\t".$string; + $wheres .= PHP_EOL . "\t" . $tab . "\t" . $string; } elseif ($as !== 'a') { - $this->otherWhere[$this->target][$code][$as][$field] = PHP_EOL."\t\t".$string; + $this->otherWhere[$this->target][$code][$as][$field] = PHP_EOL . "\t\t" . $string; } } } @@ -1984,7 +1982,7 @@ class Interpretation extends Fields return $wheres; } - public function setCustomViewGlobals(&$global,$string,$as,$tab = '') + public function setCustomViewGlobals(&$global, $string, $as, $tab = '') { $globals = ''; if (ComponentbuilderHelper::checkArray($global)) @@ -1992,23 +1990,23 @@ class Interpretation extends Fields $as = array_unique($as); foreach ($global as $glo) { - if (in_array($glo['as'],$as)) + if (in_array($glo['as'], $as)) { switch ($glo['type']) { case 1: - // SET STATE - $value = "\$this->setState('" . $glo['as'] . "." . $glo['name'] . "', " . $string . "->" . $glo['key'] . ");"; - break; + // SET STATE + $value = "\$this->setState('" . $glo['as'] . "." . $glo['name'] . "', " . $string . "->" . $glo['key'] . ");"; + break; case 2: - // SET THIS - $value = "\$this->" . $glo['as'] . "_" . $glo['name'] . " = " . $string . "->" . $glo['key'] . ";"; - break; + // SET THIS + $value = "\$this->" . $glo['as'] . "_" . $glo['name'] . " = " . $string . "->" . $glo['key'] . ";"; + break; } // only add if the filter is set if (ComponentbuilderHelper::checkString($value)) { - $globals .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." set the global " . $glo['name'] . " value.".PHP_EOL."\t".$tab."\t".$value; + $globals .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set the global " . $glo['name'] . " value." . PHP_EOL . "\t" . $tab . "\t" . $value; } } } @@ -2020,12 +2018,12 @@ class Interpretation extends Fields * @param $string * @param string $type * @return mixed - */ + */ public function removeAsDot($string, $type = '') { - if (strpos($string,'.') !== false) + if (strpos($string, '.') !== false) { - list($dump,$field) = array_map('trim', explode('.',$string)); + list($dump, $field) = array_map('trim', explode('.', $string)); } else { @@ -2033,7 +2031,7 @@ class Interpretation extends Fields } return $field; } - + /** * @param type $view * @param type $type @@ -2042,7 +2040,7 @@ class Interpretation extends Fields { if (isset($view['access']) && $view['access'] == 1) { - switch($type) + switch ($type) { case 1: $userString = '$this->user'; @@ -2054,32 +2052,32 @@ class Interpretation extends Fields // check that the default and the redirect page is not the same if (isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']) && $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] != $view['settings']->code) { - $redirectMessage = "\t\t\t//".$this->setLine(__LINE__)." redirect away to the default view if no access allowed."; - $redirectString = "JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$this->fileContentStatic['###SITE_DEFAULT_VIEW###']."')"; + $redirectMessage = "\t\t\t//" . $this->setLine(__LINE__) . " redirect away to the default view if no access allowed."; + $redirectString = "JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] . "')"; } else { - $redirectMessage = "\t\t\t//".$this->setLine(__LINE__)." redirect away to the home page if no access allowed."; + $redirectMessage = "\t\t\t//" . $this->setLine(__LINE__) . " redirect away to the home page if no access allowed."; $redirectString = 'JURI::root()'; } - $accessCheck[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." check if this user has permission to access item"; - $accessCheck[] = "\t\tif (!".$userString."->authorise('site.".$view['settings']->code.".access', 'com_".$this->fileContentStatic['###component###']."'))"; + $accessCheck[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " check if this user has permission to access item"; + $accessCheck[] = "\t\tif (!" . $userString . "->authorise('site." . $view['settings']->code . ".access', 'com_" . $this->fileContentStatic['###component###'] . "'))"; $accessCheck[] = "\t\t{"; $accessCheck[] = "\t\t\t\$app = JFactory::getApplication();"; // set lang - $langKeyWord = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Not authorised to view '.$view['settings']->code.'!','U'); + $langKeyWord = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Not authorised to view ' . $view['settings']->code . '!', 'U'); if (!isset($this->langContent['site'][$langKeyWord])) { - $this->langContent['site'][$langKeyWord] = 'Not authorised to view '.$view['settings']->code.'!'; + $this->langContent['site'][$langKeyWord] = 'Not authorised to view ' . $view['settings']->code . '!'; } - $accessCheck[] = "\t\t\t\$app->enqueueMessage(JText::_('".$langKeyWord."'), 'error');"; + $accessCheck[] = "\t\t\t\$app->enqueueMessage(JText::_('" . $langKeyWord . "'), 'error');"; $accessCheck[] = $redirectMessage; - $accessCheck[] = "\t\t\t\$app->redirect(".$redirectString.");"; + $accessCheck[] = "\t\t\t\$app->redirect(" . $redirectString . ");"; $accessCheck[] = "\t\t\treturn false;"; $accessCheck[] = "\t\t}"; - + // return the access check - return implode(PHP_EOL,$accessCheck); + return implode(PHP_EOL, $accessCheck); } return ''; } @@ -2090,7 +2088,7 @@ class Interpretation extends Fields * @param string $tab * @param string $type * @return string - */ + */ public function setCustomViewGetItem(&$get, &$code, $tab = '', $type = 'main') { if (ComponentbuilderHelper::checkObject($get)) @@ -2098,59 +2096,59 @@ class Interpretation extends Fields $this->siteDecrypt['basic'][$code] = false; $this->siteDecrypt['advanced'][$code] = false; - $getItem = PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get a db connection."; - $getItem .= PHP_EOL."\t".$tab."\t\$db = JFactory::getDbo();"; - $getItem .= PHP_EOL.PHP_EOL.$tab."\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $getItem .= PHP_EOL."\t".$tab."\t\$query = \$db->getQuery(true);"; + $getItem = PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get a db connection."; + $getItem .= PHP_EOL . "\t" . $tab . "\t\$db = JFactory::getDbo();"; + $getItem .= PHP_EOL . PHP_EOL . $tab . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $getItem .= PHP_EOL . "\t" . $tab . "\t\$query = \$db->getQuery(true);"; // set main get query - $getItem .= $this->setCustomViewQuery($get->main_get,$code,$tab); + $getItem .= $this->setCustomViewQuery($get->main_get, $code, $tab); // setup filters - $getItem .= $this->setCustomViewFilter($get->filter,$code,$tab); + $getItem .= $this->setCustomViewFilter($get->filter, $code, $tab); // setup Where - $getItem .= $this->setCustomViewWhere($get->where,$code,$tab); + $getItem .= $this->setCustomViewWhere($get->where, $code, $tab); // setup ordering - $getItem .= $this->setCustomViewOrder($get->order,$code,$tab); + $getItem .= $this->setCustomViewOrder($get->order, $code, $tab); // get ready to get query - $getItem .= PHP_EOL.PHP_EOL.$tab."\t\t//".$this->setLine(__LINE__)." Reset the query using our newly populated query object."; - $getItem .= PHP_EOL."\t".$tab."\t\$db->setQuery(\$query);"; - $getItem .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Load the results as a stdClass object."; - $getItem .= PHP_EOL."\t".$tab."\t\$data = \$db->loadObject();"; - $getItem .= PHP_EOL.PHP_EOL.$tab."\t\tif (empty(\$data))"; - $getItem .= PHP_EOL."\t".$tab."\t{"; + $getItem .= PHP_EOL . PHP_EOL . $tab . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $getItem .= PHP_EOL . "\t" . $tab . "\t\$db->setQuery(\$query);"; + $getItem .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Load the results as a stdClass object."; + $getItem .= PHP_EOL . "\t" . $tab . "\t\$data = \$db->loadObject();"; + $getItem .= PHP_EOL . PHP_EOL . $tab . "\t\tif (empty(\$data))"; + $getItem .= PHP_EOL . "\t" . $tab . "\t{"; if ($type === 'main') { - $getItem .= PHP_EOL."\t".$tab."\t\t\$app = JFactory::getApplication();"; - $langKeyWoord = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Not found or access denied','U'); + $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app = JFactory::getApplication();"; + $langKeyWoord = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Not found or access denied', 'U'); if (!isset($this->langContent[$this->lang][$langKeyWoord])) { $this->langContent[$this->lang][$langKeyWoord] = 'Not found, or access denied.'; } - $getItem .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." If no data is found redirect to default page and show warning."; - $getItem .= PHP_EOL."\t".$tab."\t\t\$app->enqueueMessage(JText::_('".$langKeyWoord."'), 'warning');"; + $getItem .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " If no data is found redirect to default page and show warning."; + $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->enqueueMessage(JText::_('" . $langKeyWoord . "'), 'warning');"; if ('site' === $this->target) { // check that the default and the redirect page is not the same if (isset($this->fileContentStatic['###SITE_DEFAULT_VIEW###']) && $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] != $code) { - $redirectString = "JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$this->fileContentStatic['###SITE_DEFAULT_VIEW###']."')"; + $redirectString = "JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $this->fileContentStatic['###SITE_DEFAULT_VIEW###'] . "')"; } else { $redirectString = 'JURI::root()'; } - $getItem .= PHP_EOL."\t".$tab."\t\t\$app->redirect(".$redirectString.");"; + $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->redirect(" . $redirectString . ");"; } else { - $getItem .= PHP_EOL."\t".$tab."\t\t\$app->redirect('index.php?option=com_".$this->fileContentStatic['###component###']."');"; + $getItem .= PHP_EOL . "\t" . $tab . "\t\t\$app->redirect('index.php?option=com_" . $this->fileContentStatic['###component###'] . "');"; } - $getItem .= PHP_EOL."\t".$tab."\t\treturn false;"; + $getItem .= PHP_EOL . "\t" . $tab . "\t\treturn false;"; } else { - $getItem .= PHP_EOL."\t".$tab."\t\treturn false;"; + $getItem .= PHP_EOL . "\t" . $tab . "\t\treturn false;"; } - $getItem .= PHP_EOL."\t".$tab."\t}"; + $getItem .= PHP_EOL . "\t" . $tab . "\t}"; // dispatcher placholder $getItem .= "###DISPATCHER###"; if (ComponentbuilderHelper::checkArray($get->main_get)) @@ -2164,20 +2162,20 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($decodeChecker)) { // set decoding of needed fields - $getItem .= $this->setCustomViewFieldDecode($main_get,$decodeChecker,'$data',$code,$tab); + $getItem .= $this->setCustomViewFieldDecode($main_get, $decodeChecker, '$data', $code, $tab); } } - - if (isset ($this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']])) + + if (isset($this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']])) { $decodeFilter = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]; if (ComponentbuilderHelper::checkArray($decodeFilter)) { // also filter fields if needed - $getItem .= $this->setCustomViewFieldDecodeFilter($main_get,$decodeFilter,'$data','$data',$code,$tab); + $getItem .= $this->setCustomViewFieldDecodeFilter($main_get, $decodeFilter, '$data', '$data', $code, $tab); } } - + if (isset($this->siteFieldData['textareas'][$code][$main_get['key']][$main_get['as']])) { $contentprepareChecker = $this->siteFieldData['textareas'][$code][$main_get['key']][$main_get['as']]; @@ -2187,7 +2185,7 @@ class Interpretation extends Fields $getItem .= $this->setCustomViewFieldonContentPrepareChecker($main_get, $contentprepareChecker, '$data', $code, $tab); } } - + if (isset($this->siteFieldData['uikit'][$code][$main_get['key']][$main_get['as']])) { $uikitChecker = $this->siteFieldData['uikit'][$code][$main_get['key']][$main_get['as']]; @@ -2203,53 +2201,53 @@ class Interpretation extends Fields if ((isset($this->siteDecrypt['basic'][$code]) && $this->siteDecrypt['basic'][$code]) || (isset($this->siteDecrypt['advanced'][$code]) && $this->siteDecrypt['advanced'][$code])) { - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic['###Component###']; $script = ''; if (isset($this->siteDecrypt['basic'][$code]) && $this->siteDecrypt['basic'][$code]) { - $script .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get the basic encryption."; - $script .= PHP_EOL."\t".$tab."\t\$basickey = ".$Component."Helper::getCryptKey('basic');"; - $script .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t".$tab."\t\$basic = new FOFEncryptAes(\$basickey, 128);"; + $script .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the basic encryption."; + $script .= PHP_EOL . "\t" . $tab . "\t\$basickey = " . $Component . "Helper::getCryptKey('basic');"; + $script .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t" . $tab . "\t\$basic = new FOFEncryptAes(\$basickey, 128);"; } if (isset($this->siteDecrypt['advanced'][$code]) && $this->siteDecrypt['advanced'][$code]) { - $script .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get the advanced encryption."; - $script .= PHP_EOL."\t".$tab."\t\$advancedkey = ".$Component."Helper::getCryptKey('advanced');"; - $script .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t".$tab."\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; + $script .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the advanced encryption."; + $script .= PHP_EOL . "\t" . $tab . "\t\$advancedkey = " . $Component . "Helper::getCryptKey('advanced');"; + $script .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t" . $tab . "\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; } $getItem = $script . $getItem; } // setup Globals - $getItem .= $this->setCustomViewGlobals($get->global,'$data',$asBucket,$tab); + $getItem .= $this->setCustomViewGlobals($get->global, '$data', $asBucket, $tab); // setup the custom gets that returns multipal values - $getItem .= $this->setCustomViewCustomJoin($get->custom_get,'$data',$code,$asBucket,$tab); + $getItem .= $this->setCustomViewCustomJoin($get->custom_get, '$data', $code, $asBucket, $tab); // set calculations if ($get->addcalculation == 1) { - $get->php_calculation = (array) explode(PHP_EOL,$get->php_calculation); - $getItem .= PHP_EOL."\t".$tab."\t".implode(PHP_EOL."\t".$tab."\t",$get->php_calculation); + $get->php_calculation = (array) explode(PHP_EOL, $get->php_calculation); + $getItem .= PHP_EOL . "\t" . $tab . "\t" . implode(PHP_EOL . "\t" . $tab . "\t", $get->php_calculation); } if ($type === 'custom') { // return the object - $getItem .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." return data object."; - $getItem .= PHP_EOL."\t".$tab."\treturn \$data;"; + $getItem .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " return data object."; + $getItem .= PHP_EOL . "\t" . $tab . "\treturn \$data;"; } else { // set the object - $getItem .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." set data object to item."; - $getItem .= PHP_EOL."\t".$tab."\t\$this->_item[\$pk] = \$data;"; + $getItem .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set data object to item."; + $getItem .= PHP_EOL . "\t" . $tab . "\t\$this->_item[\$pk] = \$data;"; } // check if the dispather should be added return str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $getItem); } - return PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)."add your custom code here."; + return PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . "add your custom code here."; } - public function setCustomViewCustomMethods($main_view,$code) + public function setCustomViewCustomMethods($main_view, $code) { $methods = ''; // then set the needed custom methods @@ -2266,51 +2264,51 @@ class Interpretation extends Fields if ($view->gettype == 3) { // ###SITE_GET_ITEM### <<>> - $main .= PHP_EOL.PHP_EOL."\t\tif (!isset(\$this->initSet) || !\$this->initSet)"; - $main .= PHP_EOL."\t\t{"; - $main .= PHP_EOL."\t\t\t\$this->user\t\t= JFactory::getUser();"; - $main .= PHP_EOL."\t\t\t\$this->userId\t\t= \$this->user->get('id');"; - $main .= PHP_EOL."\t\t\t\$this->guest\t\t= \$this->user->get('guest');"; - $main .= PHP_EOL."\t\t\t\$this->groups\t\t= \$this->user->get('groups');"; - $main .= PHP_EOL."\t\t\t\$this->authorisedGroups\t= \$this->user->getAuthorisedGroups();"; - $main .= PHP_EOL."\t\t\t\$this->levels\t\t= \$this->user->getAuthorisedViewLevels();"; - $main .= PHP_EOL."\t\t\t\$this->initSet\t\t= true;"; - $main .= PHP_EOL."\t\t}"; - $main .= $this->setCustomViewGetItem($view, $view->code,'','custom'); + $main .= PHP_EOL . PHP_EOL . "\t\tif (!isset(\$this->initSet) || !\$this->initSet)"; + $main .= PHP_EOL . "\t\t{"; + $main .= PHP_EOL . "\t\t\t\$this->user\t\t= JFactory::getUser();"; + $main .= PHP_EOL . "\t\t\t\$this->userId\t\t= \$this->user->get('id');"; + $main .= PHP_EOL . "\t\t\t\$this->guest\t\t= \$this->user->get('guest');"; + $main .= PHP_EOL . "\t\t\t\$this->groups\t\t= \$this->user->get('groups');"; + $main .= PHP_EOL . "\t\t\t\$this->authorisedGroups\t= \$this->user->getAuthorisedGroups();"; + $main .= PHP_EOL . "\t\t\t\$this->levels\t\t= \$this->user->getAuthorisedViewLevels();"; + $main .= PHP_EOL . "\t\t\t\$this->initSet\t\t= true;"; + $main .= PHP_EOL . "\t\t}"; + $main .= $this->setCustomViewGetItem($view, $view->code, '', 'custom'); $type = 'mixed item data object on success, false on failure.'; } elseif ($view->gettype == 4) { - $main .= PHP_EOL.PHP_EOL."\t\tif (!isset(\$this->initSet) || !\$this->initSet)"; - $main .= PHP_EOL."\t\t{"; - $main .= PHP_EOL."\t\t\t\$this->user\t\t= JFactory::getUser();"; - $main .= PHP_EOL."\t\t\t\$this->userId\t\t= \$this->user->get('id');"; - $main .= PHP_EOL."\t\t\t\$this->guest\t\t= \$this->user->get('guest');"; - $main .= PHP_EOL."\t\t\t\$this->groups\t\t= \$this->user->get('groups');"; - $main .= PHP_EOL."\t\t\t\$this->authorisedGroups\t= \$this->user->getAuthorisedGroups();"; - $main .= PHP_EOL."\t\t\t\$this->levels\t\t= \$this->user->getAuthorisedViewLevels();"; - $main .= PHP_EOL."\t\t\t\$this->initSet\t\t= true;"; - $main .= PHP_EOL."\t\t}"; - $main .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the global params"; - $main .= PHP_EOL."\t\t\$globalParams = JComponentHelper::getParams('com_".$this->fileContentStatic['###component###']."', true);"; + $main .= PHP_EOL . PHP_EOL . "\t\tif (!isset(\$this->initSet) || !\$this->initSet)"; + $main .= PHP_EOL . "\t\t{"; + $main .= PHP_EOL . "\t\t\t\$this->user\t\t= JFactory::getUser();"; + $main .= PHP_EOL . "\t\t\t\$this->userId\t\t= \$this->user->get('id');"; + $main .= PHP_EOL . "\t\t\t\$this->guest\t\t= \$this->user->get('guest');"; + $main .= PHP_EOL . "\t\t\t\$this->groups\t\t= \$this->user->get('groups');"; + $main .= PHP_EOL . "\t\t\t\$this->authorisedGroups\t= \$this->user->getAuthorisedGroups();"; + $main .= PHP_EOL . "\t\t\t\$this->levels\t\t= \$this->user->getAuthorisedViewLevels();"; + $main .= PHP_EOL . "\t\t\t\$this->initSet\t\t= true;"; + $main .= PHP_EOL . "\t\t}"; + $main .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the global params"; + $main .= PHP_EOL . "\t\t\$globalParams = JComponentHelper::getParams('com_" . $this->fileContentStatic['###component###'] . "', true);"; // ###SITE_GET_LIST_QUERY### <<>> $main .= $this->setCustomViewListQuery($view, $view->code, false); // load the object list - $main .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Reset the query using our newly populated query object."; - $main .= PHP_EOL."\t\t\$db->setQuery(\$query);"; - $main .= PHP_EOL."\t\t\$items = \$db->loadObjectList();"; - $main .= PHP_EOL.PHP_EOL."\t\tif (empty(\$items))"; - $main .= PHP_EOL."\t\t{"; - $main .= PHP_EOL."\t\t\treturn false;"; - $main .= PHP_EOL."\t\t}"; + $main .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $main .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; + $main .= PHP_EOL . "\t\t\$items = \$db->loadObjectList();"; + $main .= PHP_EOL . PHP_EOL . "\t\tif (empty(\$items))"; + $main .= PHP_EOL . "\t\t{"; + $main .= PHP_EOL . "\t\t\treturn false;"; + $main .= PHP_EOL . "\t\t}"; // ###SITE_GET_ITEMS### <<>> - $main .= $this->setCustomViewGetItems($view,$view->code); - $main .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." return items"; - $main .= PHP_EOL."\t\treturn \$items;"; + $main .= $this->setCustomViewGetItems($view, $view->code); + $main .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " return items"; + $main .= PHP_EOL . "\t\treturn \$items;"; $type = 'mixed An array of objects on success, false on failure.'; } // load the main mehtod - $methods .= $this->setMainCustomMehtod($main,$view->getcustom,$type); + $methods .= $this->setMainCustomMehtod($main, $view->getcustom, $type); // ###SITE_CUSTOM_METHODS### <<>> $methods .= $this->setCustomViewCustomItemMethods($view, $view->code); } @@ -2328,7 +2326,7 @@ class Interpretation extends Fields { // build uikit get method $ukit = array(); - $ukit[] = PHP_EOL.PHP_EOL."\t/**"; + $ukit[] = PHP_EOL . PHP_EOL . "\t/**"; $ukit[] = "\t* \tUIKIT Component Classes"; $ukit[] = "\t**/"; $ukit[] = "\tpublic static \$uk_components = array("; @@ -2397,7 +2395,7 @@ class Interpretation extends Fields $ukit[] = "\t{"; $ukit[] = "\t\tif (strpos(\$content,'class=\"uk-') !== false)"; $ukit[] = "\t\t{"; - $ukit[] = "\t\t\t//".$this->setLine(__LINE__)." reset"; + $ukit[] = "\t\t\t//" . $this->setLine(__LINE__) . " reset"; $ukit[] = "\t\t\t\$temp = array();"; $ukit[] = "\t\t\tforeach (self::\$uk_components as \$looking => \$add)"; $ukit[] = "\t\t\t{"; @@ -2406,15 +2404,15 @@ class Interpretation extends Fields $ukit[] = "\t\t\t\t\t\$temp[] = \$looking;"; $ukit[] = "\t\t\t\t}"; $ukit[] = "\t\t\t}"; - $ukit[] = "\t\t\t//".$this->setLine(__LINE__)." make sure uikit is loaded to config"; + $ukit[] = "\t\t\t//" . $this->setLine(__LINE__) . " make sure uikit is loaded to config"; $ukit[] = "\t\t\tif (strpos(\$content,'class=\"uk-') !== false)"; $ukit[] = "\t\t\t{"; $ukit[] = "\t\t\t\tself::\$uikit = true;"; $ukit[] = "\t\t\t}"; - $ukit[] = "\t\t\t//".$this->setLine(__LINE__)." sorter"; + $ukit[] = "\t\t\t//" . $this->setLine(__LINE__) . " sorter"; $ukit[] = "\t\t\tif (self::checkArray(\$temp))"; $ukit[] = "\t\t\t{"; - $ukit[] = "\t\t\t\t//".$this->setLine(__LINE__)." merger"; + $ukit[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " merger"; $ukit[] = "\t\t\t\tif (self::checkArray(\$classes))"; $ukit[] = "\t\t\t\t{"; $ukit[] = "\t\t\t\t\t\$newTemp = array_merge(\$temp,\$classes);"; @@ -2431,7 +2429,7 @@ class Interpretation extends Fields $ukit[] = "\t}"; // return the help methods - return implode(PHP_EOL,$ukit); + return implode(PHP_EOL, $ukit); } return ''; } @@ -2443,44 +2441,44 @@ class Interpretation extends Fields if (2 == $this->uikit || 1 == $this->uikit) { // build uikit get method - $method .= PHP_EOL.PHP_EOL."\t/**"; - $method .= PHP_EOL."\t* Get the uikit needed components"; - $method .= PHP_EOL."\t*"; - $method .= PHP_EOL."\t* @return mixed An array of objects on success."; - $method .= PHP_EOL."\t*"; - $method .= PHP_EOL."\t*/"; - $method .= PHP_EOL."\tpublic function getUikitComp()"; - $method .= PHP_EOL."\t{"; - $method .= PHP_EOL."\t\tif (isset(\$this->uikitComp) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$this->uikitComp))"; - $method .= PHP_EOL."\t\t{"; - $method .= PHP_EOL."\t\t\treturn \$this->uikitComp;"; - $method .= PHP_EOL."\t\t}"; - $method .= PHP_EOL."\t\treturn false;"; - $method .= PHP_EOL."\t}"; + $method .= PHP_EOL . PHP_EOL . "\t/**"; + $method .= PHP_EOL . "\t* Get the uikit needed components"; + $method .= PHP_EOL . "\t*"; + $method .= PHP_EOL . "\t* @return mixed An array of objects on success."; + $method .= PHP_EOL . "\t*"; + $method .= PHP_EOL . "\t*/"; + $method .= PHP_EOL . "\tpublic function getUikitComp()"; + $method .= PHP_EOL . "\t{"; + $method .= PHP_EOL . "\t\tif (isset(\$this->uikitComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$this->uikitComp))"; + $method .= PHP_EOL . "\t\t{"; + $method .= PHP_EOL . "\t\t\treturn \$this->uikitComp;"; + $method .= PHP_EOL . "\t\t}"; + $method .= PHP_EOL . "\t\treturn false;"; + $method .= PHP_EOL . "\t}"; } return $method; } - public function setMainCustomMehtod(&$body,$nAme,$type) + public function setMainCustomMehtod(&$body, $nAme, $type) { $method = ''; if (ComponentbuilderHelper::checkString($body)) { // build custom method - $method .= PHP_EOL.PHP_EOL."\t/**"; - $method .= PHP_EOL."\t* Custom Method"; - $method .= PHP_EOL."\t*"; - $method .= PHP_EOL."\t* @return ".$type; - $method .= PHP_EOL."\t*"; - $method .= PHP_EOL."\t*/"; - $method .= PHP_EOL."\tpublic function ".$nAme."()"; - $method .= PHP_EOL."\t{".$body; - $method .= PHP_EOL."\t}"; + $method .= PHP_EOL . PHP_EOL . "\t/**"; + $method .= PHP_EOL . "\t* Custom Method"; + $method .= PHP_EOL . "\t*"; + $method .= PHP_EOL . "\t* @return " . $type; + $method .= PHP_EOL . "\t*"; + $method .= PHP_EOL . "\t*/"; + $method .= PHP_EOL . "\tpublic function " . $nAme . "()"; + $method .= PHP_EOL . "\t{" . $body; + $method .= PHP_EOL . "\t}"; } return $method; } - public function setCustomViewCustomItemMethods(&$main_get,$code) + public function setCustomViewCustomItemMethods(&$main_get, $code) { $methods = ''; // first set the needed item/s methods @@ -2493,40 +2491,40 @@ class Interpretation extends Fields $this->siteDecrypt['basic'][$code] = false; $this->siteDecrypt['advanced'][$code] = false; // set the method defaults - $default = $this->setCustomViewMethodDefaults($get,$code); + $default = $this->setCustomViewMethodDefaults($get, $code); // build custom method - $methods .= PHP_EOL.PHP_EOL."\t/**"; - $methods .= PHP_EOL."\t* Method to get an array of ".$default['name']." Objects."; - $methods .= PHP_EOL."\t*"; - $methods .= PHP_EOL."\t* @return mixed An array of ".$default['name']." Objects on success, false on failure."; - $methods .= PHP_EOL."\t*"; - $methods .= PHP_EOL."\t*/"; - $methods .= PHP_EOL."\tpublic function get".$default['methodName']."(\$".$default['on_field'].")"; - $methods .= PHP_EOL."\t{###CRYPT###"; - $methods .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get a db connection."; - $methods .= PHP_EOL."\t\t\$db = JFactory::getDbo();"; - $methods .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $methods .= PHP_EOL."\t\t\$query = \$db->getQuery(true);"; - $methods .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get from ".$get['selection']['table']." as ".$default['as']; - $methods .= PHP_EOL."\t\t".$get['selection']['select']; - $methods .= PHP_EOL."\t\t".'$query->from('.$get['selection']['from'].');'; + $methods .= PHP_EOL . PHP_EOL . "\t/**"; + $methods .= PHP_EOL . "\t* Method to get an array of " . $default['name'] . " Objects."; + $methods .= PHP_EOL . "\t*"; + $methods .= PHP_EOL . "\t* @return mixed An array of " . $default['name'] . " Objects on success, false on failure."; + $methods .= PHP_EOL . "\t*"; + $methods .= PHP_EOL . "\t*/"; + $methods .= PHP_EOL . "\tpublic function get" . $default['methodName'] . "(\$" . $default['on_field'] . ")"; + $methods .= PHP_EOL . "\t{###CRYPT###"; + $methods .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; + $methods .= PHP_EOL . "\t\t\$db = JFactory::getDbo();"; + $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $methods .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; + $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get from " . $get['selection']['table'] . " as " . $default['as']; + $methods .= PHP_EOL . "\t\t" . $get['selection']['select']; + $methods .= PHP_EOL . "\t\t" . '$query->from(' . $get['selection']['from'] . ');'; // set the string if ($get['operator'] === 'IN' || $get['operator'] === 'NOT IN') { - $methods .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Check if \$" . $default['on_field'] . " is an array with values."; - $methods .= PHP_EOL."\t\t\$array = \$" . $default['on_field'] . ";"; - $methods .= PHP_EOL."\t\tif (isset(\$array) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$array, true))"; - $methods .= PHP_EOL."\t\t{"; - $methods .= PHP_EOL."\t\t\t\$query->where('".$get['join_field']." ".$get['operator']." (' . implode(',', \$array) . ')');"; - $methods .= PHP_EOL."\t\t}"; - $methods .= PHP_EOL."\t\telse"; - $methods .= PHP_EOL."\t\t{"; - $methods .= PHP_EOL."\t\t\treturn false;"; - $methods .= PHP_EOL."\t\t}"; + $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check if \$" . $default['on_field'] . " is an array with values."; + $methods .= PHP_EOL . "\t\t\$array = \$" . $default['on_field'] . ";"; + $methods .= PHP_EOL . "\t\tif (isset(\$array) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$array, true))"; + $methods .= PHP_EOL . "\t\t{"; + $methods .= PHP_EOL . "\t\t\t\$query->where('" . $get['join_field'] . " " . $get['operator'] . " (' . implode(',', \$array) . ')');"; + $methods .= PHP_EOL . "\t\t}"; + $methods .= PHP_EOL . "\t\telse"; + $methods .= PHP_EOL . "\t\t{"; + $methods .= PHP_EOL . "\t\t\treturn false;"; + $methods .= PHP_EOL . "\t\t}"; } else { - $methods .= PHP_EOL."\t\t\$query->where('".$get['join_field']." ".$get['operator']." ' . \$db->quote(\$".$default['on_field']."));"; + $methods .= PHP_EOL . "\t\t\$query->where('" . $get['join_field'] . " " . $get['operator'] . " ' . \$db->quote(\$" . $default['on_field'] . "));"; } // check if other queries should be loaded $queryChecker = (isset($this->otherQuery[$this->target][$default['code']][$default['as']]) && ComponentbuilderHelper::checkArray($this->otherQuery[$this->target][$default['code']][$default['as']])) ? $this->otherQuery[$this->target][$default['code']][$default['as']] : ''; @@ -2561,12 +2559,12 @@ class Interpretation extends Fields $methods .= $string; } } - $methods .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Reset the query using our newly populated query object."; - $methods .= PHP_EOL."\t\t\$db->setQuery(\$query);"; - $methods .= PHP_EOL."\t\t\$db->execute();"; - $methods .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." check if there was data returned"; - $methods .= PHP_EOL."\t\tif (\$db->getNumRows())"; - $methods .= PHP_EOL."\t\t{"; + $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object."; + $methods .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; + $methods .= PHP_EOL . "\t\t\$db->execute();"; + $methods .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " check if there was data returned"; + $methods .= PHP_EOL . "\t\tif (\$db->getNumRows())"; + $methods .= PHP_EOL . "\t\t{"; // set dispatcher placeholder $methods .= "###DISPATCHER###"; // set decoding of needed fields @@ -2592,32 +2590,32 @@ class Interpretation extends Fields // set joined values $placeholders = array('###TAB###' => "\t\t", '###STRING###' => '$item'); $joinedChecker = (isset($this->otherJoin[$this->target][$default['code']][$default['as']]) && ComponentbuilderHelper::checkArray($this->otherJoin[$this->target][$default['code']][$default['as']])) ? $this->otherJoin[$this->target][$default['code']][$default['as']] : ''; - if ( (isset($decodeChecker) && ComponentbuilderHelper::checkArray($decodeChecker)) || - (isset($uikitChecker) && ComponentbuilderHelper::checkArray($uikitChecker)) || - (isset($decodeFilter) && ComponentbuilderHelper::checkArray($decodeFilter)) || - (isset($contentprepareChecker) && ComponentbuilderHelper::checkArray($contentprepareChecker)) || + if ((isset($decodeChecker) && ComponentbuilderHelper::checkArray($decodeChecker)) || + (isset($uikitChecker) && ComponentbuilderHelper::checkArray($uikitChecker)) || + (isset($decodeFilter) && ComponentbuilderHelper::checkArray($decodeFilter)) || + (isset($contentprepareChecker) && ComponentbuilderHelper::checkArray($contentprepareChecker)) || ComponentbuilderHelper::checkArray($joinedChecker)) { $decoder = ''; if (isset($decodeChecker) && ComponentbuilderHelper::checkArray($decodeChecker)) { // also filter fields if needed - $decoder = $this->setCustomViewFieldDecode($get,$decodeChecker,'$item',$default['code'],"\t\t"); + $decoder = $this->setCustomViewFieldDecode($get, $decodeChecker, '$item', $default['code'], "\t\t"); } $decoder_filter = ''; if (isset($decodeFilter) && ComponentbuilderHelper::checkArray($decodeFilter)) { - $decoder_filter = $this->setCustomViewFieldDecodeFilter($get,$decodeFilter,'$item','$items[$nr]',$default['code'],"\t\t"); + $decoder_filter = $this->setCustomViewFieldDecodeFilter($get, $decodeFilter, '$item', '$items[$nr]', $default['code'], "\t\t"); } $contentprepare = ''; if (isset($contentprepareChecker) && ComponentbuilderHelper::checkArray($contentprepareChecker)) { - $contentprepare = $this->setCustomViewFieldonContentPrepareChecker($get,$contentprepareChecker,'$item',$default['code'],"\t\t"); + $contentprepare = $this->setCustomViewFieldonContentPrepareChecker($get, $contentprepareChecker, '$item', $default['code'], "\t\t"); } $uikit = ''; if (isset($uikitChecker) && ComponentbuilderHelper::checkArray($uikitChecker)) { - $uikit = $this->setCustomViewFieldUikitChecker($get,$uikitChecker,'$item',$default['code'],"\t\t"); + $uikit = $this->setCustomViewFieldUikitChecker($get, $uikitChecker, '$item', $default['code'], "\t\t"); } $joine = ''; if (ComponentbuilderHelper::checkArray($joinedChecker)) @@ -2629,10 +2627,10 @@ class Interpretation extends Fields } if (ComponentbuilderHelper::checkString($decoder) || ComponentbuilderHelper::checkString($contentprepare) || ComponentbuilderHelper::checkString($uikit) || ComponentbuilderHelper::checkString($decoder_filter) || ComponentbuilderHelper::checkString($joine)) { - $methods .= PHP_EOL."\t\t\t\$items = \$db->loadObjectList();"; - $methods .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Convert the parameter fields into objects."; - $methods .= PHP_EOL."\t\t\tforeach (\$items as \$nr => &\$item)"; - $methods .= PHP_EOL."\t\t\t{"; + $methods .= PHP_EOL . "\t\t\t\$items = \$db->loadObjectList();"; + $methods .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Convert the parameter fields into objects."; + $methods .= PHP_EOL . "\t\t\tforeach (\$items as \$nr => &\$item)"; + $methods .= PHP_EOL . "\t\t\t{"; if (ComponentbuilderHelper::checkString($decoder)) { $methods .= $decoder; @@ -2653,136 +2651,136 @@ class Interpretation extends Fields { $methods .= $joine; } - $methods .= PHP_EOL."\t\t\t}"; - $methods .= PHP_EOL."\t\t\treturn \$items;"; + $methods .= PHP_EOL . "\t\t\t}"; + $methods .= PHP_EOL . "\t\t\treturn \$items;"; } else { - $methods .= PHP_EOL."\t\t\treturn \$db->loadObjectList();"; + $methods .= PHP_EOL . "\t\t\treturn \$db->loadObjectList();"; } } else { - $methods .= PHP_EOL."\t\t\treturn \$db->loadObjectList();"; + $methods .= PHP_EOL . "\t\t\treturn \$db->loadObjectList();"; } - $methods .= PHP_EOL."\t\t}"; - $methods .= PHP_EOL."\t\treturn false;"; - $methods .= PHP_EOL."\t}"; + $methods .= PHP_EOL . "\t\t}"; + $methods .= PHP_EOL . "\t\treturn false;"; + $methods .= PHP_EOL . "\t}"; if ((isset($this->siteDecrypt['basic'][$code]) && $this->siteDecrypt['basic'][$code]) || (isset($this->siteDecrypt['advanced'][$code]) && $this->siteDecrypt['advanced'][$code])) { - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic['###Component###']; $script = ''; if ($this->siteDecrypt['basic'][$code]) { - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the basic encryption."; - $script .= PHP_EOL."\t\t\$basickey = ".$Component."Helper::getCryptKey('basic');"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t\t\$basic = new FOFEncryptAes(\$basickey, 128);".PHP_EOL; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the basic encryption."; + $script .= PHP_EOL . "\t\t\$basickey = " . $Component . "Helper::getCryptKey('basic');"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t\t\$basic = new FOFEncryptAes(\$basickey, 128);" . PHP_EOL; } if ($this->siteDecrypt['advanced'][$code]) { - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the advanced encryption."; - $script .= PHP_EOL."\t\t\$advancedkey = ".$Component."Helper::getCryptKey('advanced');"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);".PHP_EOL; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the advanced encryption."; + $script .= PHP_EOL . "\t\t\$advancedkey = " . $Component . "Helper::getCryptKey('advanced');"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);" . PHP_EOL; } $methods = str_replace('###CRYPT###', $script, $methods); } } // insure the crypt placeholder is removed - $methods = str_replace('###CRYPT###','',$methods); + $methods = str_replace('###CRYPT###', '', $methods); } } // check if the dispatcher must be set - return str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $methods).PHP_EOL; + return str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $methods) . PHP_EOL; } - public function setCustomViewMethodDefaults($get,$code) + public function setCustomViewMethodDefaults($get, $code) { - $key = substr(ComponentbuilderHelper::safeString(preg_replace('/[0-9]+/', '', md5($get['key'])),'F'), 0, 4); - $method['on_field'] = (isset($get['on_field'])) ? $this->removeAsDot($get['on_field']):null; - $method['join_field'] = (isset($get['join_field'])) ? ComponentbuilderHelper::safeString($this->removeAsDot($get['join_field'])):null; - $method['Join_field'] = (isset($method['join_field'])) ? ComponentbuilderHelper::safeString($method['join_field'],'F'):null; - $method['name'] = ComponentbuilderHelper::safeString($get['selection']['name'],'F'); + $key = substr(ComponentbuilderHelper::safeString(preg_replace('/[0-9]+/', '', md5($get['key'])), 'F'), 0, 4); + $method['on_field'] = (isset($get['on_field'])) ? $this->removeAsDot($get['on_field']) : null; + $method['join_field'] = (isset($get['join_field'])) ? ComponentbuilderHelper::safeString($this->removeAsDot($get['join_field'])) : null; + $method['Join_field'] = (isset($method['join_field'])) ? ComponentbuilderHelper::safeString($method['join_field'], 'F') : null; + $method['name'] = ComponentbuilderHelper::safeString($get['selection']['name'], 'F'); $method['code'] = ComponentbuilderHelper::safeString($code); - $method['AS'] = ComponentbuilderHelper::safeString($get['as'],'U'); + $method['AS'] = ComponentbuilderHelper::safeString($get['as'], 'U'); $method['as'] = ComponentbuilderHelper::safeString($get['as']); $method['valueName'] = $method['on_field'] . $method['Join_field'] . $method['name'] . $method['AS']; - $method['methodName'] = ComponentbuilderHelper::safeString($method['on_field'],'F') . $method['Join_field'] . $method['name'] . $key .'_'. $method['AS']; + $method['methodName'] = ComponentbuilderHelper::safeString($method['on_field'], 'F') . $method['Join_field'] . $method['name'] . $key . '_' . $method['AS']; // return return $method; } public function getCustomScriptBuilder($first, $second, $prefix = '', $note = null, $unset = null, $default = null, $sufix = '') { - // check if there is any custom script - $script = ''; + // check if there is any custom script + $script = ''; if (isset($this->customScriptBuilder[$first][$second]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$first][$second])) { - // add not if set - if ($note) - { - $script .= $note; - } - $script .= $prefix . str_replace( array_keys($this->placeholders), array_values($this->placeholders), $this->customScriptBuilder[$first][$second]) . $sufix; + // add not if set + if ($note) + { + $script .= $note; + } + $script .= $prefix . str_replace(array_keys($this->placeholders), array_values($this->placeholders), $this->customScriptBuilder[$first][$second]) . $sufix; // clear some memory - if ($unset) - { - unset($this->customScriptBuilder[$first][$second]); - } + if ($unset) + { + unset($this->customScriptBuilder[$first][$second]); + } } - // if not found return default - if (!ComponentbuilderHelper::checkString($script) && $default) - { - return $default; - } - return $script; - } + // if not found return default + if (!ComponentbuilderHelper::checkString($script) && $default) + { + return $default; + } + return $script; + } - public function setCustomViewListQuery(&$get,$code,$return = true) + public function setCustomViewListQuery(&$get, $code, $return = true) { if (ComponentbuilderHelper::checkObject($get)) { if ($get->pagination == 1) { - $getItem = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get a db connection."; + $getItem = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; } else { - $getItem = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Make sure all records load, since no pagination allowed."; - $getItem .= PHP_EOL."\t\t\$this->setState('list.limit', 0);"; - $getItem .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get a db connection."; + $getItem = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Make sure all records load, since no pagination allowed."; + $getItem .= PHP_EOL . "\t\t\$this->setState('list.limit', 0);"; + $getItem .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; } - $getItem .= PHP_EOL."\t\t\$db = JFactory::getDbo();"; - $getItem .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $getItem .= PHP_EOL."\t\t\$query = \$db->getQuery(true);"; + $getItem .= PHP_EOL . "\t\t\$db = JFactory::getDbo();"; + $getItem .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $getItem .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; // check if there is any custom script - $getItem .= $this->getCustomScriptBuilder($this->target.'_php_getlistquery', $code, '', PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filtering.", true); + $getItem .= $this->getCustomScriptBuilder($this->target . '_php_getlistquery', $code, '', PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filtering.", true); // set main get query - $getItem .= $this->setCustomViewQuery($get->main_get,$code); + $getItem .= $this->setCustomViewQuery($get->main_get, $code); // setup filters - $getItem .= $this->setCustomViewFilter($get->filter,$code); + $getItem .= $this->setCustomViewFilter($get->filter, $code); // setup where - $getItem .= $this->setCustomViewWhere($get->where,$code); + $getItem .= $this->setCustomViewWhere($get->where, $code); // setup ordering - $getItem .= $this->setCustomViewOrder($get->order,$code); + $getItem .= $this->setCustomViewOrder($get->order, $code); if ($return) { // return the query object - $getItem .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." return the query object".PHP_EOL."\t\treturn \$query;"; + $getItem .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " return the query object" . PHP_EOL . "\t\treturn \$query;"; } return $getItem; } - return PHP_EOL."\t\t//".$this->setLine(__LINE__)."add your custom code here."; + return PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . "add your custom code here."; } /** * @param $get * @param $code * @return string - */ + */ public function setCustomViewGetItems(&$get, $code) { $getItem = ''; @@ -2791,14 +2789,14 @@ class Interpretation extends Fields $Component = $this->fileContentStatic['###Component###']; if (ComponentbuilderHelper::checkObject($get)) { - $getItem .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Insure all item fields are adapted where needed."; - $getItem .= PHP_EOL."\t\tif (".$Component."Helper::checkArray(\$items))"; - $getItem .= PHP_EOL."\t\t{"; + $getItem .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Insure all item fields are adapted where needed."; + $getItem .= PHP_EOL . "\t\tif (" . $Component . "Helper::checkArray(\$items))"; + $getItem .= PHP_EOL . "\t\t{"; $getItem .= "###DISPATCHER###"; - $getItem .= PHP_EOL."\t\t\tforeach (\$items as \$nr => &\$item)"; - $getItem .= PHP_EOL."\t\t\t{"; - $getItem .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Always create a slug for sef URL's"; - $getItem .= PHP_EOL."\t\t\t\t\$item->slug = (isset(\$item->alias) && isset(\$item->id)) ? \$item->id.':'.\$item->alias : \$item->id;"; + $getItem .= PHP_EOL . "\t\t\tforeach (\$items as \$nr => &\$item)"; + $getItem .= PHP_EOL . "\t\t\t{"; + $getItem .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Always create a slug for sef URL's"; + $getItem .= PHP_EOL . "\t\t\t\t\$item->slug = (isset(\$item->alias) && isset(\$item->id)) ? \$item->id.':'.\$item->alias : \$item->id;"; if (isset($get->main_get) && ComponentbuilderHelper::checkArray($get->main_get)) { $asBucket = array(); @@ -2810,7 +2808,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($decodeChecker)) { // set decoding of needed fields - $getItem .= $this->setCustomViewFieldDecode($main_get,$decodeChecker,"\$item",$code,"\t\t"); + $getItem .= $this->setCustomViewFieldDecode($main_get, $decodeChecker, "\$item", $code, "\t\t"); } } // also filter fields if needed @@ -2819,7 +2817,7 @@ class Interpretation extends Fields $decodeFilter = $this->siteFieldDecodeFilter[$this->target][$code][$main_get['key']][$main_get['as']]; if (ComponentbuilderHelper::checkArray($decodeFilter)) { - $getItem .= $this->setCustomViewFieldDecodeFilter($main_get,$decodeFilter,"\$item",'$items[$nr]',$code,"\t\t"); + $getItem .= $this->setCustomViewFieldDecodeFilter($main_get, $decodeFilter, "\$item", '$items[$nr]', $code, "\t\t"); } } if (isset($this->siteFieldData['textareas'][$code][$main_get['key']][$main_get['as']])) @@ -2828,7 +2826,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($contentprepareChecker)) { // set contentprepare checkers on needed fields - $getItem .= $this->setCustomViewFieldonContentPrepareChecker($main_get,$contentprepareChecker,"\$item",$code,"\t\t"); + $getItem .= $this->setCustomViewFieldonContentPrepareChecker($main_get, $contentprepareChecker, "\$item", $code, "\t\t"); } } if (isset($this->siteFieldData['uikit'][$code][$main_get['key']][$main_get['as']])) @@ -2837,7 +2835,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($uikitChecker)) { // set uikit checkers on needed fields - $getItem .= $this->setCustomViewFieldUikitChecker($main_get,$uikitChecker,"\$item",$code,"\t\t"); + $getItem .= $this->setCustomViewFieldUikitChecker($main_get, $uikitChecker, "\$item", $code, "\t\t"); } } $asBucket[] = $main_get['as']; @@ -2846,21 +2844,21 @@ class Interpretation extends Fields // check if we should load the dispatcher $getItem = str_replace(array_keys($this->JEventDispatcher), array_values($this->JEventDispatcher), $getItem); // setup Globals - $getItem .= $this->setCustomViewGlobals($get->global,'$item',$asBucket,"\t\t"); + $getItem .= $this->setCustomViewGlobals($get->global, '$item', $asBucket, "\t\t"); // setup the custom gets that returns multipal values - $getItem .= $this->setCustomViewCustomJoin($get->custom_get,"\$item",$code,$asBucket,"\t\t"); + $getItem .= $this->setCustomViewCustomJoin($get->custom_get, "\$item", $code, $asBucket, "\t\t"); // set calculations if ($get->addcalculation == 1) { - $get->php_calculation = (array) explode(PHP_EOL,$get->php_calculation); + $get->php_calculation = (array) explode(PHP_EOL, $get->php_calculation); if (ComponentbuilderHelper::checkArray($get->php_calculation)) { - $_tmp = PHP_EOL."\t\t\t\t".implode(PHP_EOL."\t\t\t\t",$get->php_calculation); + $_tmp = PHP_EOL . "\t\t\t\t" . implode(PHP_EOL . "\t\t\t\t", $get->php_calculation); $getItem .= $this->setPlaceholders($_tmp, $this->placeholders); } } - $getItem .= PHP_EOL."\t\t\t}"; - $getItem .= PHP_EOL."\t\t}"; + $getItem .= PHP_EOL . "\t\t\t}"; + $getItem .= PHP_EOL . "\t\t}"; // remove empty foreach if (strlen($getItem) <= 100) { @@ -2873,17 +2871,17 @@ class Interpretation extends Fields $script = ''; if ($this->siteDecrypt['basic'][$code]) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the basic encryption."; - $script .= PHP_EOL."\t\t\$basickey = ".$Component."Helper::getCryptKey('basic');"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t\t\$basic = new FOFEncryptAes(\$basickey, 128);"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the basic encryption."; + $script .= PHP_EOL . "\t\t\$basickey = " . $Component . "Helper::getCryptKey('basic');"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t\t\$basic = new FOFEncryptAes(\$basickey, 128);"; } if ($this->siteDecrypt['advanced'][$code]) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the advanced encryption."; - $script .= PHP_EOL."\t\t\$advancedkey = ".$Component."Helper::getCryptKey('advanced');"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the advanced encryption."; + $script .= PHP_EOL . "\t\t\$advancedkey = " . $Component . "Helper::getCryptKey('advanced');"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; } $getItem = $script . $getItem; } @@ -2898,24 +2896,24 @@ class Interpretation extends Fields if ($view['settings']->main_get->gettype == 1) { // for single views - $method .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Initialise variables."; - $method .= PHP_EOL."\t\t\$this->item\t= \$this->get('Item');"; + $method .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialise variables."; + $method .= PHP_EOL . "\t\t\$this->item\t= \$this->get('Item');"; } elseif ($view['settings']->main_get->gettype == 2) { // for list views - $method .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Initialise variables."; - $method .= PHP_EOL."\t\t\$this->items\t= \$this->get('Items');"; + $method .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialise variables."; + $method .= PHP_EOL . "\t\t\$this->items\t= \$this->get('Items');"; // only add if pagination is requered if ($view['settings']->main_get->pagination == 1) { - $method .= PHP_EOL."\t\t\$this->pagination\t= \$this->get('Pagination');"; + $method .= PHP_EOL . "\t\t\$this->pagination\t= \$this->get('Pagination');"; } // add id to list view if (isset($this->customAdminViewListId[$view['settings']->code])) { // ###HIDDEN_INPUT_VALUES### - $this->fileContentDynamic[$view['settings']->code]['###HIDDEN_INPUT_VALUES###'] = PHP_EOL."\t".''; + $this->fileContentDynamic[$view['settings']->code]['###HIDDEN_INPUT_VALUES###'] = PHP_EOL . "\t" . ''; } else { @@ -2928,46 +2926,46 @@ class Interpretation extends Fields { foreach ($view['settings']->custom_get as $custom_get) { - $custom_get_name = str_replace('get','',$custom_get->getcustom); - $method .= PHP_EOL."\t\t\$this->".ComponentbuilderHelper::safeString($custom_get_name)."\t= \$this->get('".$custom_get_name."');"; + $custom_get_name = str_replace('get', '', $custom_get->getcustom); + $method .= PHP_EOL . "\t\t\$this->" . ComponentbuilderHelper::safeString($custom_get_name) . "\t= \$this->get('" . $custom_get_name . "');"; } } // add custom script if ($view['settings']->add_php_jview_display == 1) { - $view['settings']->php_jview_display = (array) explode(PHP_EOL,$view['settings']->php_jview_display); + $view['settings']->php_jview_display = (array) explode(PHP_EOL, $view['settings']->php_jview_display); if (ComponentbuilderHelper::checkArray($view['settings']->php_jview_display)) { - $_tmp = PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_jview_display); + $_tmp = PHP_EOL . "\t\t" . implode(PHP_EOL . "\t\t", $view['settings']->php_jview_display); $method .= $this->setPlaceholders($_tmp, $this->placeholders); } } if ('site' === $this->target) { - $method .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the toolbar"; - $method .= PHP_EOL."\t\t\$this->addToolBar();"; - $method .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." set the document"; - $method .= PHP_EOL."\t\t\$this->_prepareDocument();"; + $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the toolbar"; + $method .= PHP_EOL . "\t\t\$this->addToolBar();"; + $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " set the document"; + $method .= PHP_EOL . "\t\t\$this->_prepareDocument();"; } elseif ('custom_admin' === $this->target) { - $method .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." We don't need toolbar in the modal window."; - $method .= PHP_EOL."\t\tif (\$this->getLayout() !== 'modal')"; - $method .= PHP_EOL."\t\t{"; - $method .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." add the tool bar"; - $method .= PHP_EOL."\t\t\t\$this->addToolBar();"; - $method .= PHP_EOL."\t\t}"; - $method .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." set the document"; - $method .= PHP_EOL."\t\t\$this->setDocument();"; + $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " We don't need toolbar in the modal window."; + $method .= PHP_EOL . "\t\tif (\$this->getLayout() !== 'modal')"; + $method .= PHP_EOL . "\t\t{"; + $method .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " add the tool bar"; + $method .= PHP_EOL . "\t\t\t\$this->addToolBar();"; + $method .= PHP_EOL . "\t\t}"; + $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " set the document"; + $method .= PHP_EOL . "\t\t\$this->setDocument();"; } - $method .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Check for errors."; - $method .= PHP_EOL."\t\tif (count(\$errors = \$this->get('Errors')))"; - $method .= PHP_EOL."\t\t{"; - $method .= PHP_EOL."\t\t\tthrow new Exception(implode(".'"\n", $errors), 500);'; - $method .= PHP_EOL."\t\t}"; - - $method .= PHP_EOL.PHP_EOL."\t\tparent::display(\$tpl);"; + $method .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check for errors."; + $method .= PHP_EOL . "\t\tif (count(\$errors = \$this->get('Errors')))"; + $method .= PHP_EOL . "\t\t{"; + $method .= PHP_EOL . "\t\t\tthrow new Exception(implode(" . '"\n", $errors), 500);'; + $method .= PHP_EOL . "\t\t}"; + + $method .= PHP_EOL . PHP_EOL . "\t\tparent::display(\$tpl);"; } return $method; } @@ -2975,74 +2973,76 @@ class Interpretation extends Fields public function setPrepareDocument(&$view) { // ensure correct target is set - $TARGET = ComponentbuilderHelper::safeString($this->target,'U'); - + $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); + // set libraries ###'.$TARGET.'_LIBRARIES_LOADER### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_LIBRARIES_LOADER###'] = $this->setLibrariesLoader($view); - + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_LIBRARIES_LOADER###'] = $this->setLibrariesLoader($view); + // set uikit ###'.$TARGET.'_UIKIT_LOADER### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_UIKIT_LOADER###'] = $this->setUikitLoader($view); + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_UIKIT_LOADER###'] = $this->setUikitLoader($view); // set Google Charts ###'.$TARGET.'_GOOGLECHART_LOADER### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_GOOGLECHART_LOADER###'] = $this->setGoogleChartLoader($view); + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_GOOGLECHART_LOADER###'] = $this->setGoogleChartLoader($view); // set Footable ###FOOTABLE_LOADER### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_FOOTABLE_LOADER###'] = $this->setFootableScriptsLoader($view); + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_FOOTABLE_LOADER###'] = $this->setFootableScriptsLoader($view); // set metadata ###DOCUMENT_METADATA### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_DOCUMENT_METADATA###'] = $this->setDocumentMetadata($view); + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_DOCUMENT_METADATA###'] = $this->setDocumentMetadata($view); // set custom php scripting ###DOCUMENT_CUSTOM_PHP### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_DOCUMENT_CUSTOM_PHP###'] = $this->setDocumentCustomPHP($view); + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_DOCUMENT_CUSTOM_PHP###'] = $this->setDocumentCustomPHP($view); // set custom css ###DOCUMENT_CUSTOM_CSS### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_DOCUMENT_CUSTOM_CSS###'] = $this->setDocumentCustomCSS($view); + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_DOCUMENT_CUSTOM_CSS###'] = $this->setDocumentCustomCSS($view); // set custom javascript ###DOCUMENT_CUSTOM_JS### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_DOCUMENT_CUSTOM_JS###'] = $this->setDocumentCustomJS($view); + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_DOCUMENT_CUSTOM_JS###'] = $this->setDocumentCustomJS($view); // set custom css file ###VIEWCSS### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_VIEWCSS###'] = $this->setCustomCSS($view); + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_VIEWCSS###'] = $this->setCustomCSS($view); // set the custom buttons ###CUSTOM_BUTTONS### - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_CUSTOM_BUTTONS###'] = $this->setCustomButtons($view); - + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_CUSTOM_BUTTONS###'] = $this->setCustomButtons($view); + // only set the custom get form method if site target if ('site' === $this->target) { // set the custom get form method ###SITE_CUSTOM_GET_FORM_METHOD### $this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_GET_FORM_METHOD###'] = $this->setCustomGetForm($view); } - + // see if we should add get modules to the view.html - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_GET_MODULE###'] = $this->setGetModules($view,$TARGET); - + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_GET_MODULE###'] = $this->setGetModules($view, $TARGET); + + // set a JavaScript file if needed + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_LIBRARIES_LOADER###'] .= $this->setJavaScriptFile($view, $TARGET); } - - public function setGetModules($view,$TARGET) + + public function setGetModules($view, $TARGET) { if (isset($this->getModule[$this->target][$view['settings']->code]) && $this->getModule[$this->target][$view['settings']->code]) { $addModule = array(); - $addModule[] = PHP_EOL.PHP_EOL."\t/**"; + $addModule[] = PHP_EOL . PHP_EOL . "\t/**"; $addModule[] = "\t * Get the modules published in a position"; $addModule[] = "\t */"; $addModule[] = "\tpublic function getModules(\$position, \$seperator = '', \$class = '')"; $addModule[] = "\t{"; - $addModule[] = "\t\t//".$this->setLine(__LINE__)." set default"; + $addModule[] = "\t\t//" . $this->setLine(__LINE__) . " set default"; $addModule[] = "\t\t\$found = false;"; - $addModule[] = "\t\t//".$this->setLine(__LINE__)." check if we aleady have these modules loaded"; + $addModule[] = "\t\t//" . $this->setLine(__LINE__) . " check if we aleady have these modules loaded"; $addModule[] = "\t\tif (isset(\$this->setModules[\$position]))"; $addModule[] = "\t\t{"; $addModule[] = "\t\t\t\$found = true;"; $addModule[] = "\t\t}"; $addModule[] = "\t\telse"; $addModule[] = "\t\t{"; - $addModule[] = "\t\t\t//".$this->setLine(__LINE__)." this is where you want to load your module position"; + $addModule[] = "\t\t\t//" . $this->setLine(__LINE__) . " this is where you want to load your module position"; $addModule[] = "\t\t\t\$modules = JModuleHelper::getModules(\$position);"; $addModule[] = "\t\t\tif (\$modules)"; $addModule[] = "\t\t\t{"; - $addModule[] = "\t\t\t\t//".$this->setLine(__LINE__)." set the place holder"; + $addModule[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " set the place holder"; $addModule[] = "\t\t\t\t\$this->setModules[\$position] = array();"; $addModule[] = "\t\t\t\tforeach(\$modules as \$module)"; $addModule[] = "\t\t\t\t{"; @@ -3051,15 +3051,15 @@ class Interpretation extends Fields $addModule[] = "\t\t\t\t\$found = true;"; $addModule[] = "\t\t\t}"; $addModule[] = "\t\t}"; - $addModule[] = "\t\t//".$this->setLine(__LINE__)." check if modules were found"; - $addModule[] = "\t\tif (\$found && isset(\$this->setModules[\$position]) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$this->setModules[\$position]))"; + $addModule[] = "\t\t//" . $this->setLine(__LINE__) . " check if modules were found"; + $addModule[] = "\t\tif (\$found && isset(\$this->setModules[\$position]) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$this->setModules[\$position]))"; $addModule[] = "\t\t{"; - $addModule[] = "\t\t\t//".$this->setLine(__LINE__)." set class"; - $addModule[] = "\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkString(\$class))"; + $addModule[] = "\t\t\t//" . $this->setLine(__LINE__) . " set class"; + $addModule[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkString(\$class))"; $addModule[] = "\t\t\t{"; $addModule[] = "\t\t\t\t\$class = ' class=\"'.\$class.'\" ';"; $addModule[] = "\t\t\t}"; - $addModule[] = "\t\t\t//".$this->setLine(__LINE__)." set seperating return values"; + $addModule[] = "\t\t\t//" . $this->setLine(__LINE__) . " set seperating return values"; $addModule[] = "\t\t\tswitch(\$seperator)"; $addModule[] = "\t\t\t{"; $addModule[] = "\t\t\t\tcase 'none':"; @@ -3083,12 +3083,12 @@ class Interpretation extends Fields $addModule[] = "\t\t}"; $addModule[] = "\t\treturn false;"; $addModule[] = "\t}"; - - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_GET_MODULE_JIMPORT###'] = PHP_EOL."jimport('joomla.application.module.helper');"; - - return implode(PHP_EOL,$addModule); - } - $this->fileContentDynamic[$view['settings']->code]['###'.$TARGET.'_GET_MODULE_JIMPORT###'] = ''; + + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_GET_MODULE_JIMPORT###'] = PHP_EOL . "jimport('joomla.application.module.helper');"; + + return implode(PHP_EOL, $addModule); + } + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_GET_MODULE_JIMPORT###'] = ''; return ''; } @@ -3101,10 +3101,10 @@ class Interpretation extends Fields { if ($view['settings']->add_php_document == 1) { - $view['settings']->php_document = (array) explode(PHP_EOL,$view['settings']->php_document); + $view['settings']->php_document = (array) explode(PHP_EOL, $view['settings']->php_document); if (ComponentbuilderHelper::checkArray($view['settings']->php_document)) { - $_tmp = PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$view['settings']->php_document); + $_tmp = PHP_EOL . "\t\t" . implode(PHP_EOL . "\t\t", $view['settings']->php_document); return $this->setPlaceholders($_tmp, $this->placeholders); } } @@ -3114,21 +3114,21 @@ class Interpretation extends Fields public function setCustomButtons(&$view, $type = 1, $tab = '') { // ensure correct target is set - $TARGET = ComponentbuilderHelper::safeString($this->target,'U'); + $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); if (1 == $type || 2 == $type) { if (1 == $type) { - $viewName = $view['settings']->code; + $viewName = $view['settings']->code; } if (2 == $type) { - $viewName = ComponentbuilderHelper::safeString($view['settings']->name_single); + $viewName = ComponentbuilderHelper::safeString($view['settings']->name_single); } // set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER### - $this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER###'] = ''; + $this->fileContentDynamic[$viewName]['###' . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER###'] = ''; // set the custom buttons ###CUSTOM_BUTTONS_METHOD### - $this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD###'] = ''; + $this->fileContentDynamic[$viewName]['###' . $TARGET . '_CUSTOM_BUTTONS_METHOD###'] = ''; } elseif (3 == $type) { @@ -3136,9 +3136,9 @@ class Interpretation extends Fields $viewName = ComponentbuilderHelper::safeString($view['settings']->name_single); $viewsName = ComponentbuilderHelper::safeString($view['settings']->name_list); // set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER_LIST### - $this->fileContentDynamic[$viewsName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER_LIST###'] = ''; + $this->fileContentDynamic[$viewsName]['###' . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST###'] = ''; // set the custom buttons ###CUSTOM_BUTTONS_METHOD_LIST### - $this->fileContentDynamic[$viewsName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD_LIST###'] = ''; + $this->fileContentDynamic[$viewsName]['###' . $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST###'] = ''; } // if site add buttons to view if ($this->target === 'site') @@ -3169,9 +3169,8 @@ class Interpretation extends Fields case 5: // set buttons to buttom left of the view $this->placeholders['[[[SITE_TOOLBAR]]]'] = 'toolbar->render(); ?>'; - break; + break; } - } // check if custom button should be added if (isset($view['settings']->add_custom_button) && $view['settings']->add_custom_button == 1) @@ -3186,29 +3185,29 @@ class Interpretation extends Fields if (3 !== $type && ($custom_button['target'] != 2 || $this->target === 'site')) { // Load to lang - $keyLang = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($custom_button['name'],'U'); - $keyCode = ComponentbuilderHelper::safeString($custom_button['name']); + $keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($custom_button['name'], 'U'); + $keyCode = ComponentbuilderHelper::safeString($custom_button['name']); $this->langContent[$this->lang][$keyLang] = trim($custom_button['name']); // add cpanel button TODO does not work well on site with permissions if ($custom_button['target'] == 2) { - $buttons[] = "\t".$tab."\tif (\$this->user->authorise('".$viewName.".".$keyCode."'))"; + $buttons[] = "\t" . $tab . "\tif (\$this->user->authorise('" . $viewName . "." . $keyCode . "'))"; } else { - $buttons[] = "\t".$tab."\tif (\$this->canDo->get('".$viewName.".".$keyCode."'))"; + $buttons[] = "\t" . $tab . "\tif (\$this->canDo->get('" . $viewName . "." . $keyCode . "'))"; } - $buttons[] = "\t".$tab."\t{"; - $buttons[] = "\t".$tab."\t\t//".$this->setLine(__LINE__)." add ".$custom_button['name']." button."; - $buttons[] = "\t".$tab."\t\tJToolBarHelper::custom('".$viewName.".".$custom_button['method']."', '".$custom_button['icomoon']."', '', '".$keyLang."', false);"; - $buttons[] = "\t".$tab."\t}"; + $buttons[] = "\t" . $tab . "\t{"; + $buttons[] = "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; + $buttons[] = "\t" . $tab . "\t\tJToolBarHelper::custom('" . $viewName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; + $buttons[] = "\t" . $tab . "\t}"; } // load the list button elseif (3 == $type && $custom_button['target'] != 1) { // Load to lang - $keyLang = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($custom_button['name'],'U'); - $keyCode = ComponentbuilderHelper::safeString($custom_button['name']); + $keyLang = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($custom_button['name'], 'U'); + $keyCode = ComponentbuilderHelper::safeString($custom_button['name']); $this->langContent[$this->lang][$keyLang] = trim($custom_button['name']); // add cpanel button TODO does not work well on site with permissions if (isset($custom_button['type']) && $custom_button['type'] == 2) @@ -3217,19 +3216,19 @@ class Interpretation extends Fields { $this->onlyFunctionButton[$viewsName] = array(); } - $this->onlyFunctionButton[$viewsName][] = "\t".$tab."if (\$this->user->authorise('".$viewName.".".$keyCode."', 'com_".$this->fileContentStatic['###component###']."'))"; - $this->onlyFunctionButton[$viewsName][] = "\t".$tab."{"; - $this->onlyFunctionButton[$viewsName][] = "\t".$tab."\t//".$this->setLine(__LINE__)." add ".$custom_button['name']." button."; - $this->onlyFunctionButton[$viewsName][] = "\t".$tab."\tJToolBarHelper::custom('".$viewsName.".".$custom_button['method']."', '".$custom_button['icomoon']."', '', '".$keyLang."', false);"; - $this->onlyFunctionButton[$viewsName][] = "\t".$tab."}"; + $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "if (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "{"; + $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; + $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "\tJToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; + $this->onlyFunctionButton[$viewsName][] = "\t" . $tab . "}"; } else { - $buttons[] = "\t".$tab."\tif (\$this->user->authorise('".$viewName.".".$keyCode."', 'com_".$this->fileContentStatic['###component###']."'))"; - $buttons[] = "\t".$tab."\t{"; - $buttons[] = "\t".$tab."\t\t//".$this->setLine(__LINE__)." add ".$custom_button['name']." button."; - $buttons[] = "\t".$tab."\t\tJToolBarHelper::custom('".$viewsName.".".$custom_button['method']."', '".$custom_button['icomoon']."', '', '".$keyLang."', false);"; - $buttons[] = "\t".$tab."\t}"; + $buttons[] = "\t" . $tab . "\tif (\$this->user->authorise('" . $viewName . "." . $keyCode . "', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $buttons[] = "\t" . $tab . "\t{"; + $buttons[] = "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; + $buttons[] = "\t" . $tab . "\t\tJToolBarHelper::custom('" . $viewsName . "." . $custom_button['method'] . "', '" . $custom_button['icomoon'] . "', '', '" . $keyLang . "', false);"; + $buttons[] = "\t" . $tab . "\t}"; } } } @@ -3241,15 +3240,13 @@ class Interpretation extends Fields if (isset($view['settings']->php_controller_list) && ComponentbuilderHelper::checkString($view['settings']->php_controller_list) && $view['settings']->php_controller_list != '//') { // set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER### - $this->fileContentDynamic[$viewsName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER_LIST###'] = - PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_controller_list, $this->placeholders); + $this->fileContentDynamic[$viewsName]['###' . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER_LIST###'] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_controller_list, $this->placeholders); } // load the model if (isset($view['settings']->php_model_list) && ComponentbuilderHelper::checkString($view['settings']->php_model_list) && $view['settings']->php_model_list != '//') { // set the custom buttons ###CUSTOM_BUTTONS_METHOD### - $this->fileContentDynamic[$viewsName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD_LIST###'] = - PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_model_list, $this->placeholders); + $this->fileContentDynamic[$viewsName]['###' . $TARGET . '_CUSTOM_BUTTONS_METHOD_LIST###'] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_model_list, $this->placeholders); } } else @@ -3258,14 +3255,13 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkString($view['settings']->php_controller) && $view['settings']->php_controller != '//') { // set the custom buttons ###CUSTOM_BUTTONS_CONTROLLER### - $this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_CONTROLLER###'] = - PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_controller, $this->placeholders); + $this->fileContentDynamic[$viewName]['###' . $TARGET . '_CUSTOM_BUTTONS_CONTROLLER###'] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_controller, $this->placeholders); if ('site' === $this->target) { // add the controller for this view // build the file $target = array($this->target => $viewName); - $this->buildDynamique($target,'custom_form'); + $this->buildDynamique($target, 'custom_form'); ###GET_FORM_CUSTOM### } } @@ -3273,14 +3269,13 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkString($view['settings']->php_model) && $view['settings']->php_model != '//') { // set the custom buttons ###CUSTOM_BUTTONS_METHOD### - $this->fileContentDynamic[$viewName]['###'.$TARGET.'_CUSTOM_BUTTONS_METHOD###'] = - PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_model, $this->placeholders); + $this->fileContentDynamic[$viewName]['###' . $TARGET . '_CUSTOM_BUTTONS_METHOD###'] = PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_model, $this->placeholders); } } // return buttons if they were build if (ComponentbuilderHelper::checkArray($buttons)) { - return PHP_EOL.implode(PHP_EOL,$buttons); + return PHP_EOL . implode(PHP_EOL, $buttons); } } return ''; @@ -3291,7 +3286,7 @@ class Interpretation extends Fields // return buttons if they were build if (isset($this->onlyFunctionButton[$viewName_list]) && ComponentbuilderHelper::checkArray($this->onlyFunctionButton[$viewName_list])) { - return PHP_EOL.implode(PHP_EOL,$this->onlyFunctionButton[$viewName_list]); + return PHP_EOL . implode(PHP_EOL, $this->onlyFunctionButton[$viewName_list]); } return ''; } @@ -3312,27 +3307,55 @@ class Interpretation extends Fields { if ($view['settings']->add_css_document == 1) { - $view['settings']->css_document = (array) explode(PHP_EOL,$view['settings']->css_document); + $view['settings']->css_document = (array) explode(PHP_EOL, $view['settings']->css_document); if (ComponentbuilderHelper::checkArray($view['settings']->css_document)) { - $script = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the Custom CSS script to view".PHP_EOL."\t\t".'$this->document->addStyleDeclaration("'; - $cssDocument = PHP_EOL."\t\t\t".str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->css_document)); - return $script.$this->setPlaceholders($cssDocument, $this->placeholders).PHP_EOL."\t\t".'");'; + $script = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the Custom CSS script to view" . PHP_EOL . "\t\t" . '$this->document->addStyleDeclaration("'; + $cssDocument = PHP_EOL . "\t\t\t" . str_replace('"', '\"', implode(PHP_EOL . "\t\t\t", $view['settings']->css_document)); + return $script . $this->setPlaceholders($cssDocument, $this->placeholders) . PHP_EOL . "\t\t" . '");'; } } return ''; } + public function setJavaScriptFile(&$view, $TARGET) + { + if ($view['settings']->add_javascript_file == 1 && ComponentbuilderHelper::checkString($view['settings']->javascript_file)) + { + // get dates + $created = $this->getCreatedDate($view); + $modified = $this->getLastModifiedDate($view); + // add file to view + $target = array($this->target => $view['settings']->code); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $this->buildDynamique($target, 'javascript_file', false, $config); + // set path + if ('site' === $this->target) + { + $path = '/components/com_' . $this->fileContentStatic['###component###'] . '/assets/js/' . $view['settings']->code . '.js'; + } + else + { + $path = '/administrator/components/com_' . $this->fileContentStatic['###component###'] . '/assets/js/' . $view['settings']->code . '.js'; + } + // add script to file + $this->fileContentDynamic[$view['settings']->code]['###' . $TARGET . '_JAVASCRIPT_FILE###'] = $view['settings']->javascript_file; + // add script to view + return PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add View JavaScript File" . PHP_EOL . "\t\t" . $this->setIncludeLibScript($path); + } + return ''; + } + public function setDocumentCustomJS(&$view) { if ($view['settings']->add_js_document == 1) { - $view['settings']->js_document = (array) explode(PHP_EOL,$view['settings']->js_document); + $view['settings']->js_document = (array) explode(PHP_EOL, $view['settings']->js_document); if (ComponentbuilderHelper::checkArray($view['settings']->js_document)) { - $script = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the Custom JS script to view".PHP_EOL."\t\t".'$this->document->addScriptDeclaration("'; - $jsDocument = PHP_EOL."\t\t\t".str_replace('"', '\"', implode(PHP_EOL."\t\t\t",$view['settings']->js_document)); - return $script.$this->setPlaceholders($jsDocument, $this->placeholders).PHP_EOL."\t\t".'");'; + $script = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the Custom JS script to view" . PHP_EOL . "\t\t" . '$this->document->addScriptDeclaration("'; + $jsDocument = PHP_EOL . "\t\t\t" . str_replace('"', '\"', implode(PHP_EOL . "\t\t\t", $view['settings']->js_document)); + return $script . $this->setPlaceholders($jsDocument, $this->placeholders) . PHP_EOL . "\t\t" . '");'; } } return ''; @@ -3361,7 +3384,7 @@ class Interpretation extends Fields if (isset($view['settings']->custom_get) && ComponentbuilderHelper::checkArray($view['settings']->custom_get)) { $found = false; - $searchFor = 'get'.$view['settings']->Code; + $searchFor = 'get' . $view['settings']->Code; foreach ($view['settings']->custom_get as $custom_get) { if ($searchFor == $custom_get->getcustom) @@ -3387,46 +3410,46 @@ class Interpretation extends Fields } return ''; } - + public function setMetadataItem($item = 'item') { $meta = array(); - $meta[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." load the meta description"; - $meta[] = "\t\tif (isset(\$this->".$item."->metadesc) && \$this->".$item."->metadesc)"; + $meta[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " load the meta description"; + $meta[] = "\t\tif (isset(\$this->" . $item . "->metadesc) && \$this->" . $item . "->metadesc)"; $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setDescription(\$this->".$item."->metadesc);"; + $meta[] = "\t\t\t\$this->document->setDescription(\$this->" . $item . "->metadesc);"; $meta[] = "\t\t}"; $meta[] = "\t\telseif (\$this->params->get('menu-meta_description'))"; $meta[] = "\t\t{"; $meta[] = "\t\t\t\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; $meta[] = "\t\t}"; - $meta[] = "\t\t//".$this->setLine(__LINE__)." load the key words if set"; - $meta[] = "\t\tif (isset(\$this->".$item."->metakey) && \$this->".$item."->metakey)"; + $meta[] = "\t\t//" . $this->setLine(__LINE__) . " load the key words if set"; + $meta[] = "\t\tif (isset(\$this->" . $item . "->metakey) && \$this->" . $item . "->metakey)"; $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetadata('keywords', \$this->".$item."->metakey);"; + $meta[] = "\t\t\t\$this->document->setMetadata('keywords', \$this->" . $item . "->metakey);"; $meta[] = "\t\t}"; $meta[] = "\t\telseif (\$this->params->get('menu-meta_keywords'))"; $meta[] = "\t\t{"; $meta[] = "\t\t\t\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; $meta[] = "\t\t}"; - $meta[] = "\t\t//".$this->setLine(__LINE__)." check the robot params"; - $meta[] = "\t\tif (isset(\$this->".$item."->robots) && \$this->".$item."->robots)"; + $meta[] = "\t\t//" . $this->setLine(__LINE__) . " check the robot params"; + $meta[] = "\t\tif (isset(\$this->" . $item . "->robots) && \$this->" . $item . "->robots)"; $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetadata('robots', \$this->".$item."->robots);"; + $meta[] = "\t\t\t\$this->document->setMetadata('robots', \$this->" . $item . "->robots);"; $meta[] = "\t\t}"; $meta[] = "\t\telseif (\$this->params->get('robots'))"; $meta[] = "\t\t{"; $meta[] = "\t\t\t\$this->document->setMetadata('robots', \$this->params->get('robots'));"; $meta[] = "\t\t}"; - $meta[] = "\t\t//".$this->setLine(__LINE__)." check if autor is to be set"; - $meta[] = "\t\tif (isset(\$this->".$item."->created_by) && \$this->params->get('MetaAuthor') == '1')"; + $meta[] = "\t\t//" . $this->setLine(__LINE__) . " check if autor is to be set"; + $meta[] = "\t\tif (isset(\$this->" . $item . "->created_by) && \$this->params->get('MetaAuthor') == '1')"; $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$this->document->setMetaData('author', \$this->".$item."->created_by);"; + $meta[] = "\t\t\t\$this->document->setMetaData('author', \$this->" . $item . "->created_by);"; $meta[] = "\t\t}"; - $meta[] = "\t\t//".$this->setLine(__LINE__)." check if metadata is available"; - $meta[] = "\t\tif (isset(\$this->".$item."->metadata) && \$this->".$item."->metadata)"; + $meta[] = "\t\t//" . $this->setLine(__LINE__) . " check if metadata is available"; + $meta[] = "\t\tif (isset(\$this->" . $item . "->metadata) && \$this->" . $item . "->metadata)"; $meta[] = "\t\t{"; - $meta[] = "\t\t\t\$mdata = json_decode(\$this->".$item."->metadata,true);"; + $meta[] = "\t\t\t\$mdata = json_decode(\$this->" . $item . "->metadata,true);"; $meta[] = "\t\t\tforeach (\$mdata as \$k => \$v)"; $meta[] = "\t\t\t{"; $meta[] = "\t\t\t\tif (\$v)"; @@ -3436,29 +3459,29 @@ class Interpretation extends Fields $meta[] = "\t\t\t}"; $meta[] = "\t\t}"; - return implode(PHP_EOL,$meta); + return implode(PHP_EOL, $meta); } - + public function setMetadataList() { $meta = array(); - $meta[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." load the meta description"; + $meta[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " load the meta description"; $meta[] = "\t\tif (\$this->params->get('menu-meta_description'))"; $meta[] = "\t\t{"; $meta[] = "\t\t\t\$this->document->setDescription(\$this->params->get('menu-meta_description'));"; $meta[] = "\t\t}"; - $meta[] = "\t\t//".$this->setLine(__LINE__)." load the key words if set"; + $meta[] = "\t\t//" . $this->setLine(__LINE__) . " load the key words if set"; $meta[] = "\t\tif (\$this->params->get('menu-meta_keywords'))"; $meta[] = "\t\t{"; $meta[] = "\t\t\t\$this->document->setMetadata('keywords', \$this->params->get('menu-meta_keywords'));"; $meta[] = "\t\t}"; - $meta[] = "\t\t//".$this->setLine(__LINE__)." check the robot params"; + $meta[] = "\t\t//" . $this->setLine(__LINE__) . " check the robot params"; $meta[] = "\t\tif (\$this->params->get('robots'))"; $meta[] = "\t\t{"; $meta[] = "\t\t\t\$this->document->setMetadata('robots', \$this->params->get('robots'));"; $meta[] = "\t\t}"; - return implode(PHP_EOL,$meta); + return implode(PHP_EOL, $meta); } public function setGoogleChartLoader(&$view) @@ -3466,50 +3489,46 @@ class Interpretation extends Fields if (isset($this->googleChart[$this->target][$view['settings']->code]) && $this->googleChart[$this->target][$view['settings']->code]) { $chart = array(); - $chart[] = PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." add the google chart builder class."; + $chart[] = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " add the google chart builder class."; $chart[] = "\t\trequire_once JPATH_COMPONENT_ADMINISTRATOR.'/helpers/chartbuilder.php';"; - $chart[] = "\t\t//".$this->setLine(__LINE__)." load the google chart js."; - $chart[] = "\t\t\$this->document->addScript(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/js/google.jsapi.js');"; + $chart[] = "\t\t//" . $this->setLine(__LINE__) . " load the google chart js."; + $chart[] = "\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/js/google.jsapi.js');"; $chart[] = "\t\t\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/rgbcolor.js');"; $chart[] = "\t\t\$this->document->addScript('https://canvg.googlecode.com/svn/trunk/canvg.js');"; - return implode(PHP_EOL,$chart); + return implode(PHP_EOL, $chart); } return ''; } - + public function setLibrariesLoader($view) { // reset bucket $setter = ''; // allways load these in - $setter .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." always make sure jquery is loaded."; - $setter .= PHP_EOL."\t\tJHtml::_('jquery.framework');"; - $setter .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Load the header checker class."; + $setter .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " always make sure jquery is loaded."; + $setter .= PHP_EOL . "\t\tJHtml::_('jquery.framework');"; + $setter .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Load the header checker class."; if ($this->target === 'site') { - $setter .= PHP_EOL."\t\trequire_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );"; + $setter .= PHP_EOL . "\t\trequire_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );"; } else { - $setter .= PHP_EOL."\t\trequire_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );"; + $setter .= PHP_EOL . "\t\trequire_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' );"; } - $setter .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Initialize the header checker."; - $setter .= PHP_EOL."\t\t\$HeaderCheck = new ".$this->fileContentStatic['###component###']."HeaderCheck;"; + $setter .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Initialize the header checker."; + $setter .= PHP_EOL . "\t\t\$HeaderCheck = new " . $this->fileContentStatic['###component###'] . "HeaderCheck;"; // check if this view should get libraries - if (isset($this->libManager[$this->target][$view['settings']->code]) - && ComponentbuilderHelper::checkArray($this->libManager[$this->target][$view['settings']->code])) + if (isset($this->libManager[$this->target][$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->libManager[$this->target][$view['settings']->code])) { foreach ($this->libManager[$this->target][$view['settings']->code] as $id => $true) { - if (isset($this->libraries[$id]) && ComponentbuilderHelper::checkObject($this->libraries[$id]) - && isset($this->libraries[$id]->document) && ComponentbuilderHelper::checkString($this->libraries[$id]->document)) + if (isset($this->libraries[$id]) && ComponentbuilderHelper::checkObject($this->libraries[$id]) && isset($this->libraries[$id]->document) && ComponentbuilderHelper::checkString($this->libraries[$id]->document)) { - $setter .= PHP_EOL.PHP_EOL.$this->setPlaceholders( - str_replace('$document->', '$this->document->', $this->libraries[$id]->document), - $this->placeholders); + $setter .= PHP_EOL . PHP_EOL . $this->setPlaceholders( + str_replace('$document->', '$this->document->', $this->libraries[$id]->document), $this->placeholders); } - elseif (isset($this->libraries[$id]) && ComponentbuilderHelper::checkObject($this->libraries[$id]) - && isset($this->libraries[$id]->how)) + elseif (isset($this->libraries[$id]) && ComponentbuilderHelper::checkObject($this->libraries[$id]) && isset($this->libraries[$id]->how)) { $setter .= $this->setLibraryDocument($id); } @@ -3520,8 +3539,7 @@ class Interpretation extends Fields protected function setLibraryDocument($id) { - if (2 == $this->libraries[$id]->how && isset($this->libraries[$id]->conditions) - && ComponentbuilderHelper::checkArray($this->libraries[$id]->conditions)) + if (2 == $this->libraries[$id]->how && isset($this->libraries[$id]->conditions) && ComponentbuilderHelper::checkArray($this->libraries[$id]->conditions)) { // build document with the conditions values $this->setLibraryDocConditions($id, $this->setLibraryScripts($id, false)); @@ -3534,7 +3552,7 @@ class Interpretation extends Fields // check if the document was build if (isset($this->libraries[$id]->document) && ComponentbuilderHelper::checkString($this->libraries[$id]->document)) { - return PHP_EOL.PHP_EOL.$this->libraries[$id]->document; + return PHP_EOL . PHP_EOL . $this->libraries[$id]->document; } return ''; } @@ -3592,7 +3610,7 @@ class Interpretation extends Fields // set all the files foreach ($this->libraries[$id]->files as $file) { - $path = '/'.trim($file['path'], '/'); + $path = '/' . trim($file['path'], '/'); // check if path has new file name (has extetion) $pathInfo = pathinfo($path); // update the root path @@ -3605,7 +3623,7 @@ class Interpretation extends Fields else { // load document script - $scripts[md5($path.'/'.trim($file['file'],'/'))] = $this->setIncludeLibScript($_path.'/'.trim($file['file'],'/')); + $scripts[md5($path . '/' . trim($file['file'], '/'))] = $this->setIncludeLibScript($_path . '/' . trim($file['file'], '/')); } } } @@ -3617,18 +3635,18 @@ class Interpretation extends Fields { if (isset($folder['path']) && isset($folder['folder'])) { - $path = '/'.trim($folder['path'], '/'); + $path = '/' . trim($folder['path'], '/'); if (isset($folder['rename']) && 1 == $folder['rename']) { - if ($_paths = ComponentbuilderHelper::getAllFilePaths($this->componentPath.$path)) + if ($_paths = ComponentbuilderHelper::getAllFilePaths($this->componentPath . $path)) { $files[$path] = $_paths; } } else { - $path = $path.'/'.trim($folder['folder'], '/'); - if ($_paths = ComponentbuilderHelper::getAllFilePaths($this->componentPath.$path)) + $path = $path . '/' . trim($folder['folder'], '/'); + if ($_paths = ComponentbuilderHelper::getAllFilePaths($this->componentPath . $path)) { $files[$path] = $_paths; } @@ -3641,16 +3659,16 @@ class Interpretation extends Fields // update the root path $_root = $this->getScriptRootPath($root); // load per path - foreach($paths as $path) + foreach ($paths as $path) { - $scripts[md5($root.'/'.trim($path, '/'))] = $this->setIncludeLibScript($_root.'/'.trim($path, '/')); + $scripts[md5($root . '/' . trim($path, '/'))] = $this->setIncludeLibScript($_root . '/' . trim($path, '/')); } } } // if there was any code added to document then set globaly if ($buildDoc && ComponentbuilderHelper::checkArray($scripts)) { - $this->libraries[$id]->document = "\t\t//".$this->setLine(__LINE__)." always load these files.".PHP_EOL."\t\t".implode(PHP_EOL."\t\t", $scripts); + $this->libraries[$id]->document = "\t\t//" . $this->setLine(__LINE__) . " always load these files." . PHP_EOL . "\t\t" . implode(PHP_EOL . "\t\t", $scripts); // success return true; } @@ -3677,21 +3695,21 @@ class Interpretation extends Fields // use the path info to build the script if (isset($pathInfo['extension']) && $pathInfo['extension']) { - switch($pathInfo['extension']) + switch ($pathInfo['extension']) { case 'js': - return '$this->document->addScript('.$JURI.'"'.$path.'");'; - break; + return '$this->document->addScript(' . $JURI . '"' . $path . '");'; + break; case 'css': case 'less': - return '$this->document->addStyleSheet('.$JURI.'"'.$path.'");'; - break; + return '$this->document->addStyleSheet(' . $JURI . '"' . $path . '");'; + break; case 'php': if (strpos($path, 'http') === false) { - return 'require_once("'.$path.'");'; + return 'require_once("' . $path . '");'; } - break; + break; } } return ''; @@ -3701,15 +3719,15 @@ class Interpretation extends Fields { if (strpos($root, '/media/') !== false && strpos($root, '/admin/') === false && strpos($root, '/site/') === false) { - return str_replace('/media/', '/media/com_'.$this->fileContentStatic['###component###'] .'/', $root); + return str_replace('/media/', '/media/com_' . $this->fileContentStatic['###component###'] . '/', $root); } elseif (strpos($root, '/media/') === false && strpos($root, '/admin/') !== false && strpos($root, '/site/') === false) { - return str_replace('/admin/', '/administrator/components/com_'.$this->fileContentStatic['###component###'] .'/', $root); + return str_replace('/admin/', '/administrator/components/com_' . $this->fileContentStatic['###component###'] . '/', $root); } elseif (strpos($root, '/media/') === false && strpos($root, '/admin/') === false && strpos($root, '/site/') !== false) { - return str_replace('/site/', '/components/com_'.$this->fileContentStatic['###component###'] .'/', $root); + return str_replace('/site/', '/components/com_' . $this->fileContentStatic['###component###'] . '/', $root); } return $root; } @@ -3721,149 +3739,149 @@ class Interpretation extends Fields // load the defaults needed if ($this->uikit > 0) { - $setter .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Load uikit options."; - $setter .= PHP_EOL."\t\t\$uikit = \$this->params->get('uikit_load');"; - $setter .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set script size."; - $setter .= PHP_EOL."\t\t\$size = \$this->params->get('uikit_min');"; + $setter .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Load uikit options."; + $setter .= PHP_EOL . "\t\t\$uikit = \$this->params->get('uikit_load');"; + $setter .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set script size."; + $setter .= PHP_EOL . "\t\t\$size = \$this->params->get('uikit_min');"; $tabV = ""; // if both versions should be loaded then add some more logic if (2 == $this->uikit) { - $setter .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Load uikit version."; - $setter .= PHP_EOL."\t\t\$uikitVersion = \$this->params->get('uikit_version', 2);"; - $setter .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Use Uikit Version 2"; - $setter .= PHP_EOL."\t\tif (2 == \$uikitVersion)"; - $setter .= PHP_EOL."\t\t{"; + $setter .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Load uikit version."; + $setter .= PHP_EOL . "\t\t\$uikitVersion = \$this->params->get('uikit_version', 2);"; + $setter .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Use Uikit Version 2"; + $setter .= PHP_EOL . "\t\tif (2 == \$uikitVersion)"; + $setter .= PHP_EOL . "\t\t{"; $tabV = "\t"; } } // load the defaults needed if (2 == $this->uikit || 1 == $this->uikit) { - $setter .= PHP_EOL.$tabV."\t\t//".$this->setLine(__LINE__)." Set css style."; - $setter .= PHP_EOL.$tabV."\t\t\$style = \$this->params->get('uikit_style');"; + $setter .= PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " Set css style."; + $setter .= PHP_EOL . $tabV . "\t\t\$style = \$this->params->get('uikit_style');"; - $setter .= PHP_EOL.PHP_EOL.$tabV."\t\t//".$this->setLine(__LINE__)." The uikit css."; - $setter .= PHP_EOL.$tabV."\t\tif ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; - $setter .= PHP_EOL.$tabV."\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/css/uikit'.\$style.\$size.'.css');"; - $setter .= PHP_EOL.$tabV."\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t//".$this->setLine(__LINE__)." The uikit js."; - $setter .= PHP_EOL.$tabV."\t\tif ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; - $setter .= PHP_EOL.$tabV."\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/js/uikit'.\$size.'.js');"; - $setter .= PHP_EOL.$tabV."\t\t}"; + $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " The uikit css."; + $setter .= PHP_EOL . $tabV . "\t\tif ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . "\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/uikit'.\$style.\$size.'.css');"; + $setter .= PHP_EOL . $tabV . "\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " The uikit js."; + $setter .= PHP_EOL . $tabV . "\t\tif ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . "\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/uikit'.\$size.'.js');"; + $setter .= PHP_EOL . $tabV . "\t\t}"; } // load the components need if ((2 == $this->uikit || 1 == $this->uikit) && isset($this->uikitComp[$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->uikitComp[$view['settings']->code])) { - $setter .= PHP_EOL.PHP_EOL.$tabV."\t\t//".$this->setLine(__LINE__)." Load the script to find all uikit components needed."; - $setter .= PHP_EOL.$tabV."\t\tif (\$uikit != 2)"; - $setter .= PHP_EOL.$tabV."\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t//".$this->setLine(__LINE__)." Set the default uikit components in this view."; - $setter .= PHP_EOL.$tabV."\t\t\t\$uikitComp = array();"; + $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " Load the script to find all uikit components needed."; + $setter .= PHP_EOL . $tabV . "\t\tif (\$uikit != 2)"; + $setter .= PHP_EOL . $tabV . "\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " Set the default uikit components in this view."; + $setter .= PHP_EOL . $tabV . "\t\t\t\$uikitComp = array();"; foreach ($this->uikitComp[$view['settings']->code] as $class) { - $setter .= PHP_EOL.$tabV."\t\t\t\$uikitComp[] = '".$class."';"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$uikitComp[] = '" . $class . "';"; } // check content for more needed components if (isset($this->siteFieldData['uikit'][$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->siteFieldData['uikit'][$view['settings']->code])) { - $setter .= PHP_EOL.PHP_EOL.$tabV."\t\t\t//".$this->setLine(__LINE__)." Get field uikit components needed in this view."; - $setter .= PHP_EOL.$tabV."\t\t\t\$uikitFieldComp = \$this->get('UikitComp');"; - $setter .= PHP_EOL.$tabV."\t\t\tif (isset(\$uikitFieldComp) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$uikitFieldComp))"; - $setter .= PHP_EOL.$tabV."\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\tif (isset(\$uikitComp) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$uikitComp))"; - $setter .= PHP_EOL.$tabV."\t\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\$uikitComp = array_unique(\$uikitComp);"; - $setter .= PHP_EOL.$tabV."\t\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t\t\telse"; - $setter .= PHP_EOL.$tabV."\t\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\$uikitComp = \$uikitFieldComp;"; - $setter .= PHP_EOL.$tabV."\t\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t\t}"; + $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " Get field uikit components needed in this view."; + $setter .= PHP_EOL . $tabV . "\t\t\t\$uikitFieldComp = \$this->get('UikitComp');"; + $setter .= PHP_EOL . $tabV . "\t\t\tif (isset(\$uikitFieldComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uikitFieldComp))"; + $setter .= PHP_EOL . $tabV . "\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\tif (isset(\$uikitComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\$uikitComp = array_merge(\$uikitComp, \$uikitFieldComp);"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\$uikitComp = array_unique(\$uikitComp);"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t\t\telse"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\$uikitComp = \$uikitFieldComp;"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t\t}"; } - $setter .= PHP_EOL.$tabV."\t\t}"; - $setter .= PHP_EOL.PHP_EOL.$tabV."\t\t//".$this->setLine(__LINE__)." Load the needed uikit components in this view."; - $setter .= PHP_EOL.$tabV."\t\tif (\$uikit != 2 && isset(\$uikitComp) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$uikitComp))"; - $setter .= PHP_EOL.$tabV."\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t//".$this->setLine(__LINE__)." load just in case."; - $setter .= PHP_EOL.$tabV."\t\t\tjimport('joomla.filesystem.file');"; - $setter .= PHP_EOL.$tabV."\t\t\t//".$this->setLine(__LINE__)." loading..."; - $setter .= PHP_EOL.$tabV."\t\t\tforeach (\$uikitComp as \$class)"; - $setter .= PHP_EOL.$tabV."\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\tforeach (".$this->fileContentStatic['###Component###']."Helper::\$uk_components[\$class] as \$name)"; - $setter .= PHP_EOL.$tabV."\t\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t//".$this->setLine(__LINE__)." check if the CSS file exists."; - $setter .= PHP_EOL.$tabV."\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\t//".$this->setLine(__LINE__)." load the css."; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/css/components/'.\$name.\$style.\$size.'.css');"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t//".$this->setLine(__LINE__)." check if the JavaScript file exists."; - $setter .= PHP_EOL.$tabV."\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/js/components/'.\$name.\$size.'.js'))"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\t//".$this->setLine(__LINE__)." load the js."; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/js/components/'.\$name.\$size.'.js', 'text/javascript', true);"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t}"; + $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " Load the needed uikit components in this view."; + $setter .= PHP_EOL . $tabV . "\t\tif (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . "\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " load just in case."; + $setter .= PHP_EOL . $tabV . "\t\t\tjimport('joomla.filesystem.file');"; + $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " loading..."; + $setter .= PHP_EOL . $tabV . "\t\t\tforeach (\$uikitComp as \$class)"; + $setter .= PHP_EOL . $tabV . "\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\tforeach (" . $this->fileContentStatic['###Component###'] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " check if the CSS file exists."; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " load the css."; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css');"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " check if the JavaScript file exists."; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " load the js."; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/components/'.\$name.\$size.'.js', 'text/javascript', true);"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t}"; } elseif ((2 == $this->uikit || 1 == $this->uikit) && isset($this->siteFieldData['uikit'][$view['settings']->code]) && ComponentbuilderHelper::checkArray($this->siteFieldData['uikit'][$view['settings']->code])) { - $setter .= PHP_EOL.PHP_EOL.$tabV."\t\t//".$this->setLine(__LINE__)." Load the needed uikit components in this view."; - $setter .= PHP_EOL.$tabV."\t\t\$uikitComp = \$this->get('UikitComp');"; - $setter .= PHP_EOL.$tabV."\t\tif (\$uikit != 2 && isset(\$uikitComp) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$uikitComp))"; - $setter .= PHP_EOL.$tabV."\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t//".$this->setLine(__LINE__)." load just in case."; - $setter .= PHP_EOL.$tabV."\t\t\tjimport('joomla.filesystem.file');"; - $setter .= PHP_EOL.$tabV."\t\t\t//".$this->setLine(__LINE__)." loading..."; - $setter .= PHP_EOL.$tabV."\t\t\tforeach (\$uikitComp as \$class)"; - $setter .= PHP_EOL.$tabV."\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\tforeach (".$this->fileContentStatic['###Component###']."Helper::\$uk_components[\$class] as \$name)"; - $setter .= PHP_EOL.$tabV."\t\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t//".$this->setLine(__LINE__)." check if the CSS file exists."; - $setter .= PHP_EOL.$tabV."\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\t//".$this->setLine(__LINE__)." load the css."; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/css/components/'.\$name.\$style.\$size.'.css');"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t//".$this->setLine(__LINE__)." check if the JavaScript file exists."; - $setter .= PHP_EOL.$tabV."\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/js/components/'.\$name.\$size.'.js'))"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\t//".$this->setLine(__LINE__)." load the js."; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/uikit-v2/js/components/'.\$name.\$size.'.js', 'text/javascript', true);"; - $setter .= PHP_EOL.$tabV."\t\t\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t}"; - } + $setter .= PHP_EOL . PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " Load the needed uikit components in this view."; + $setter .= PHP_EOL . $tabV . "\t\t\$uikitComp = \$this->get('UikitComp');"; + $setter .= PHP_EOL . $tabV . "\t\tif (\$uikit != 2 && isset(\$uikitComp) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uikitComp))"; + $setter .= PHP_EOL . $tabV . "\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " load just in case."; + $setter .= PHP_EOL . $tabV . "\t\t\tjimport('joomla.filesystem.file');"; + $setter .= PHP_EOL . $tabV . "\t\t\t//" . $this->setLine(__LINE__) . " loading..."; + $setter .= PHP_EOL . $tabV . "\t\t\tforeach (\$uikitComp as \$class)"; + $setter .= PHP_EOL . $tabV . "\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\tforeach (" . $this->fileContentStatic['###Component###'] . "Helper::\$uk_components[\$class] as \$name)"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " check if the CSS file exists."; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " load the css."; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css');"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " check if the JavaScript file exists."; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\tif (JFile::exists(JPATH_ROOT.'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/components/'.\$name.\$size.'.js'))"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " load the js."; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v2/js/components/'.\$name.\$size.'.js', 'text/javascript', true);"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t}"; + } // now set the version 3 if (2 == $this->uikit || 3 == $this->uikit) { if (2 == $this->uikit) { - $setter .= PHP_EOL."\t\t}"; - $setter .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Use Uikit Version 3"; - $setter .= PHP_EOL."\t\telseif (3 == \$uikitVersion)"; - $setter .= PHP_EOL."\t\t{"; + $setter .= PHP_EOL . "\t\t}"; + $setter .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Use Uikit Version 3"; + $setter .= PHP_EOL . "\t\telseif (3 == \$uikitVersion)"; + $setter .= PHP_EOL . "\t\t{"; } // add version 3 fiels to page - $setter .= PHP_EOL.$tabV."\t\t//".$this->setLine(__LINE__)." The uikit css."; - $setter .= PHP_EOL.$tabV."\t\tif ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; - $setter .= PHP_EOL.$tabV."\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/uikit-v3/css/uikit'.\$size.'.css');"; - $setter .= PHP_EOL.$tabV."\t\t}"; - $setter .= PHP_EOL.$tabV."\t\t//".$this->setLine(__LINE__)." The uikit js."; - $setter .= PHP_EOL.$tabV."\t\tif ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; - $setter .= PHP_EOL.$tabV."\t\t{"; - $setter .= PHP_EOL.$tabV."\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_".$this->fileContentStatic['###component###']."/uikit-v3/js/uikit'.\$size.'.js');"; - $setter .= PHP_EOL.$tabV."\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " The uikit css."; + $setter .= PHP_EOL . $tabV . "\t\tif ((!\$HeaderCheck->css_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . "\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addStyleSheet(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v3/css/uikit'.\$size.'.css');"; + $setter .= PHP_EOL . $tabV . "\t\t}"; + $setter .= PHP_EOL . $tabV . "\t\t//" . $this->setLine(__LINE__) . " The uikit js."; + $setter .= PHP_EOL . $tabV . "\t\tif ((!\$HeaderCheck->js_loaded('uikit.min') || \$uikit == 1) && \$uikit != 2 && \$uikit != 3)"; + $setter .= PHP_EOL . $tabV . "\t\t{"; + $setter .= PHP_EOL . $tabV . "\t\t\t\$this->document->addScript(JURI::root(true) .'/media/com_" . $this->fileContentStatic['###component###'] . "/uikit-v3/js/uikit'.\$size.'.js');"; + $setter .= PHP_EOL . $tabV . "\t\t}"; if (2 == $this->uikit) { - $setter .= PHP_EOL."\t\t}"; + $setter .= PHP_EOL . "\t\t}"; } } return $setter; @@ -3873,7 +3891,7 @@ class Interpretation extends Fields { if ($view['settings']->add_php_jview == 1) { - return PHP_EOL.PHP_EOL.$this->setPlaceholders($view['settings']->php_jview, $this->placeholders); + return PHP_EOL . PHP_EOL . $this->setPlaceholders($view['settings']->php_jview, $this->placeholders); } return ''; } @@ -3892,32 +3910,31 @@ class Interpretation extends Fields $this->placeholders['[[[LIMITBOX]]]'] = 'pagination->getLimitBox(); ?>'; } $body[] = $this->setPlaceholders($view['settings']->default, $this->placeholders); - $body[] = PHP_EOL.'items) && isset($this->pagination) && isset($this->pagination->pagesTotal) && $this->pagination->pagesTotal > 1): ?>'; + $body[] = PHP_EOL . 'items) && isset($this->pagination) && isset($this->pagination->pagesTotal) && $this->pagination->pagesTotal > 1): ?>'; $body[] = '
'; - $body[] = "\t".''; $body[] = '
'; $body[] = ''; - - return implode(PHP_EOL,$body); + + return implode(PHP_EOL, $body); } else { - return PHP_EOL. $this->setPlaceholders($view['settings']->default, $this->placeholders); + return PHP_EOL . $this->setPlaceholders($view['settings']->default, $this->placeholders); } - } return ''; } @@ -3930,9 +3947,9 @@ class Interpretation extends Fields if (strpos($view['settings']->default, 'Joomla.submitbutton = function(task)') === false) { $script = array(); - $script[] = PHP_EOL.""; - + return implode(PHP_EOL, $script); } - } return ''; } @@ -3954,10 +3970,10 @@ class Interpretation extends Fields { if ($view['settings']->add_php_view == 1) { - $view['settings']->php_view = (array) explode(PHP_EOL,$view['settings']->php_view); + $view['settings']->php_view = (array) explode(PHP_EOL, $view['settings']->php_view); if (ComponentbuilderHelper::checkArray($view['settings']->php_view)) { - $_tmp = PHP_EOL.PHP_EOL.implode(PHP_EOL,$view['settings']->php_view); + $_tmp = PHP_EOL . PHP_EOL . implode(PHP_EOL, $view['settings']->php_view); return $this->setPlaceholders($_tmp, $this->placeholders); } } @@ -3974,14 +3990,14 @@ class Interpretation extends Fields { // build the file $target = array($this->target => $view['settings']->code); - $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version); - $this->buildDynamique($target,'template', $template, $config); + $config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version); + $this->buildDynamique($target, 'template', $template, $config); // set the file data - $TARGET = ComponentbuilderHelper::safeString($this->target,'U'); + $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); // ###SITE_TEMPLATE_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code.'_'.$template]['###'.$TARGET.'_TEMPLATE_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders); + $this->fileContentDynamic[$view['settings']->code . '_' . $template]['###' . $TARGET . '_TEMPLATE_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders); // ###SITE_TEMPLATE_CODE_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code.'_'.$template]['###'.$TARGET.'_TEMPLATE_CODE_BODY###'] = $this->setCustomViewTemplateCode($data['php_view']); + $this->fileContentDynamic[$view['settings']->code . '_' . $template]['###' . $TARGET . '_TEMPLATE_CODE_BODY###'] = $this->setCustomViewTemplateCode($data['php_view']); } } } @@ -3990,10 +4006,10 @@ class Interpretation extends Fields { if (ComponentbuilderHelper::checkString($php)) { - $php_view = (array) explode(PHP_EOL,$php); + $php_view = (array) explode(PHP_EOL, $php); if (ComponentbuilderHelper::checkArray($php_view)) { - $php_view = PHP_EOL.PHP_EOL.implode(PHP_EOL,$php_view); + $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); return $this->setPlaceholders($php_view, $this->placeholders); } } @@ -4008,23 +4024,22 @@ class Interpretation extends Fields { // build the file $target = array($this->target => $layout); - $this->buildDynamique($target,'layout'); + $this->buildDynamique($target, 'layout'); // set the file data - $TARGET = ComponentbuilderHelper::safeString($this->target,'U'); + $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); // ###SITE_LAYOUT_CODE### <<>> - $php_view = (array) explode(PHP_EOL,$data['php_view']); + $php_view = (array) explode(PHP_EOL, $data['php_view']); if (ComponentbuilderHelper::checkArray($php_view)) { - $php_view = PHP_EOL.PHP_EOL.implode(PHP_EOL,$php_view); - $this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_CODE###'] = $this->setPlaceholders($php_view, $this->placeholders); + $php_view = PHP_EOL . PHP_EOL . implode(PHP_EOL, $php_view); + $this->fileContentDynamic[$layout]['###' . $TARGET . '_LAYOUT_CODE###'] = $this->setPlaceholders($php_view, $this->placeholders); } else { - $this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_CODE###'] = ''; + $this->fileContentDynamic[$layout]['###' . $TARGET . '_LAYOUT_CODE###'] = ''; } // ###SITE_LAYOUT_BODY### <<>> - $this->fileContentDynamic[$layout]['###'.$TARGET.'_LAYOUT_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders); - + $this->fileContentDynamic[$layout]['###' . $TARGET . '_LAYOUT_BODY###'] = PHP_EOL . $this->setPlaceholders($data['html'], $this->placeholders); } } } @@ -4069,12 +4084,12 @@ class Interpretation extends Fields if ($type !== 'static') { //var_dump($replacment); echo PHP_EOL; - $echos[$replacment] = "###".$replacment."###
"; + $echos[$replacment] = "###" . $replacment . "###
"; } elseif ($type === 'static') { //var_dump($replacment); echo PHP_EOL; - $echos[$replacment] = "###".$replacment."###
"; + $echos[$replacment] = "###" . $replacment . "###
"; } } } @@ -4082,7 +4097,7 @@ class Interpretation extends Fields foreach ($echos as $echo) { - echo $echo.'
'; + echo $echo . '
'; } } @@ -4090,17 +4105,17 @@ class Interpretation extends Fields { $script = ''; // go from json to array - if(isset($this->jsonItemBuilder[$view]) && ComponentbuilderHelper::checkArray($this->jsonItemBuilder[$view])) + if (isset($this->jsonItemBuilder[$view]) && ComponentbuilderHelper::checkArray($this->jsonItemBuilder[$view])) { foreach ($this->jsonItemBuilder[$view] as $jsonItem) { - $script .= PHP_EOL.PHP_EOL."\t\t\tif (!empty(\$item->".$jsonItem."))"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Convert the ".$jsonItem." field to an array."; - $script .= PHP_EOL."\t\t\t\t\$".$jsonItem." = new Registry;"; - $script .= PHP_EOL."\t\t\t\t\$".$jsonItem."->loadString(\$item->".$jsonItem.");"; - $script .= PHP_EOL."\t\t\t\t\$item->".$jsonItem." = \$".$jsonItem."->toArray();"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $jsonItem . "))"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Convert the " . $jsonItem . " field to an array."; + $script .= PHP_EOL . "\t\t\t\t\$" . $jsonItem . " = new Registry;"; + $script .= PHP_EOL . "\t\t\t\t\$" . $jsonItem . "->loadString(\$item->" . $jsonItem . ");"; + $script .= PHP_EOL . "\t\t\t\t\$item->" . $jsonItem . " = \$" . $jsonItem . "->toArray();"; + $script .= PHP_EOL . "\t\t\t}"; } } // go from json to string @@ -4109,12 +4124,10 @@ class Interpretation extends Fields $makeArray = ''; foreach ($this->jsonStringBuilder[$view] as $jsonString) { - $script .= PHP_EOL.PHP_EOL."\t\t\tif (!empty(\$item->".$jsonString."))"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." JSON Decode ".$jsonString."."; - if (isset($this->jsonItemBuilderArray[$view]) - && ComponentbuilderHelper::checkArray($this->jsonItemBuilderArray[$view]) - && in_array($jsonString, $this->jsonItemBuilderArray[$view])) + $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $jsonString . "))"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " JSON Decode " . $jsonString . "."; + if (isset($this->jsonItemBuilderArray[$view]) && ComponentbuilderHelper::checkArray($this->jsonItemBuilderArray[$view]) && in_array($jsonString, $this->jsonItemBuilderArray[$view])) { $makeArray = ',true'; } @@ -4122,8 +4135,8 @@ class Interpretation extends Fields { $makeArray = ',true'; } - $script .= PHP_EOL."\t\t\t\t\$item->".$jsonString." = json_decode(\$item->".$jsonString.$makeArray.");"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . "\t\t\t\t\$item->" . $jsonString . " = json_decode(\$item->" . $jsonString . $makeArray . ");"; + $script .= PHP_EOL . "\t\t\t}"; } } // go from base64 to string @@ -4131,51 +4144,51 @@ class Interpretation extends Fields { foreach ($this->base64Builder[$view] as $baseString) { - $script .= PHP_EOL.PHP_EOL."\t\t\tif (!empty(\$item->".$baseString."))"; // TODO && base64_encode(base64_decode(\$item->".$baseString.", true)) === \$item->".$baseString.")"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." base64 Decode ".$baseString."."; - $script .= PHP_EOL."\t\t\t\t\$item->".$baseString." = base64_decode(\$item->".$baseString.");"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . "))"; // TODO && base64_encode(base64_decode(\$item->".$baseString.", true)) === \$item->".$baseString.")"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " base64 Decode " . $baseString . "."; + $script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = base64_decode(\$item->" . $baseString . ");"; + $script .= PHP_EOL . "\t\t\t}"; } } // decryption if ((isset($this->basicEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder[$view])) || (isset($this->advancedEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder[$view]))) { - $Component = $this->fileContentStatic['###Component###']; + $Component = $this->fileContentStatic['###Component###']; if (isset($this->basicEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder[$view])) { - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Get the basic encryption."; - $script .= PHP_EOL."\t\t\t\$basickey = ".$Component."Helper::getCryptKey('basic');"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t\t\t\$basic = new FOFEncryptAes(\$basickey, 128);"; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the basic encryption."; + $script .= PHP_EOL . "\t\t\t\$basickey = " . $Component . "Helper::getCryptKey('basic');"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t\t\t\$basic = new FOFEncryptAes(\$basickey, 128);"; foreach ($this->basicEncryptionBuilder[$view] as $baseString) { - $script .= PHP_EOL.PHP_EOL."\t\t\tif (!empty(\$item->".$baseString.") && \$basickey && !is_numeric(\$item->".$baseString.") && \$item->".$baseString." === base64_encode(base64_decode(\$item->".$baseString.", true)))"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." basic decrypt data ".$baseString."."; - $script .= PHP_EOL."\t\t\t\t\$item->".$baseString." = rtrim(\$basic->decryptString(\$item->".$baseString."), ".'"\0"'.");"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . ") && \$basickey && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " basic decrypt data " . $baseString . "."; + $script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = rtrim(\$basic->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");"; + $script .= PHP_EOL . "\t\t\t}"; } } if (isset($this->advancedEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder[$view])) { - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Get the advanced encryption key."; - $script .= PHP_EOL."\t\t\t\$advancedkey = ".$Component."Helper::getCryptKey('advanced');"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t\t\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the advanced encryption key."; + $script .= PHP_EOL . "\t\t\t\$advancedkey = " . $Component . "Helper::getCryptKey('advanced');"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t\t\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; foreach ($this->advancedEncryptionBuilder[$view] as $baseString) { - $script .= PHP_EOL.PHP_EOL."\t\t\tif (!empty(\$item->".$baseString.") && \$advancedkey && !is_numeric(\$item->".$baseString.") && \$item->".$baseString." === base64_encode(base64_decode(\$item->".$baseString.", true)))"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." advanced decrypt data ".$baseString."."; - $script .= PHP_EOL."\t\t\t\t\$item->".$baseString." = rtrim(\$advanced->decryptString(\$item->".$baseString."), ".'"\0"'.");"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t\tif (!empty(\$item->" . $baseString . ") && \$advancedkey && !is_numeric(\$item->" . $baseString . ") && \$item->" . $baseString . " === base64_encode(base64_decode(\$item->" . $baseString . ", true)))"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " advanced decrypt data " . $baseString . "."; + $script .= PHP_EOL . "\t\t\t\t\$item->" . $baseString . " = rtrim(\$advanced->decryptString(\$item->" . $baseString . "), " . '"\0"' . ");"; + $script .= PHP_EOL . "\t\t\t}"; } } } // add custom php to getitem method - $script .= $this->getCustomScriptBuilder('php_getitem', $view, PHP_EOL.PHP_EOL); + $script .= $this->getCustomScriptBuilder('php_getitem', $view, PHP_EOL . PHP_EOL); return $script; } @@ -4183,15 +4196,15 @@ class Interpretation extends Fields public function setCheckboxSave(&$view) { $script = ''; - if(isset($this->checkboxBuilder[$view]) && ComponentbuilderHelper::checkArray($this->checkboxBuilder[$view])) + if (isset($this->checkboxBuilder[$view]) && ComponentbuilderHelper::checkArray($this->checkboxBuilder[$view])) { foreach ($this->checkboxBuilder[$view] as $checkbox) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the empty ".$checkbox." item to data"; - $script .= PHP_EOL."\t\tif (!isset(\$data['".$checkbox."']))"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t\$data['".$checkbox."'] = '';"; - $script .= PHP_EOL."\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the empty " . $checkbox . " item to data"; + $script .= PHP_EOL . "\t\tif (!isset(\$data['" . $checkbox . "']))"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t\$data['" . $checkbox . "'] = '';"; + $script .= PHP_EOL . "\t\t}"; } } return $script; @@ -4201,87 +4214,87 @@ class Interpretation extends Fields { $script = ''; // check if there was script added before modeling of data - $script .= $this->getCustomScriptBuilder('php_before_save', $view, PHP_EOL.PHP_EOL); + $script .= $this->getCustomScriptBuilder('php_before_save', $view, PHP_EOL . PHP_EOL); // turn array into JSON string - if(isset($this->jsonItemBuilder[$view]) && ComponentbuilderHelper::checkArray($this->jsonItemBuilder[$view])) + if (isset($this->jsonItemBuilder[$view]) && ComponentbuilderHelper::checkArray($this->jsonItemBuilder[$view])) { foreach ($this->jsonItemBuilder[$view] as $jsonItem) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the ".$jsonItem." items to data."; - $script .= PHP_EOL."\t\tif (isset(\$data['".$jsonItem."']) && is_array(\$data['".$jsonItem."']))"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t\$".$jsonItem." = new JRegistry;"; - $script .= PHP_EOL."\t\t\t\$".$jsonItem."->loadArray(\$data['".$jsonItem."']);"; - $script .= PHP_EOL."\t\t\t\$data['".$jsonItem."'] = (string) \$".$jsonItem.";"; - $script .= PHP_EOL."\t\t}"; - $script .= PHP_EOL."\t\telseif (!isset(\$data['".$jsonItem."']))"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Set the empty ".$jsonItem." to data"; - $script .= PHP_EOL."\t\t\t\$data['".$jsonItem."'] = '';"; - $script .= PHP_EOL."\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the " . $jsonItem . " items to data."; + $script .= PHP_EOL . "\t\tif (isset(\$data['" . $jsonItem . "']) && is_array(\$data['" . $jsonItem . "']))"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t\$" . $jsonItem . " = new JRegistry;"; + $script .= PHP_EOL . "\t\t\t\$" . $jsonItem . "->loadArray(\$data['" . $jsonItem . "']);"; + $script .= PHP_EOL . "\t\t\t\$data['" . $jsonItem . "'] = (string) \$" . $jsonItem . ";"; + $script .= PHP_EOL . "\t\t}"; + $script .= PHP_EOL . "\t\telseif (!isset(\$data['" . $jsonItem . "']))"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Set the empty " . $jsonItem . " to data"; + $script .= PHP_EOL . "\t\t\t\$data['" . $jsonItem . "'] = '';"; + $script .= PHP_EOL . "\t\t}"; } } // turn string into json string - if(isset($this->jsonStringBuilder[$view]) && ComponentbuilderHelper::checkArray($this->jsonStringBuilder[$view])) + if (isset($this->jsonStringBuilder[$view]) && ComponentbuilderHelper::checkArray($this->jsonStringBuilder[$view])) { foreach ($this->jsonStringBuilder[$view] as $jsonString) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the ".$jsonString." string to JSON string."; - $script .= PHP_EOL."\t\tif (isset(\$data['".$jsonString."']))"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t\$data['".$jsonString."'] = (string) json_encode(\$data['".$jsonString."']);"; - $script .= PHP_EOL."\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the " . $jsonString . " string to JSON string."; + $script .= PHP_EOL . "\t\tif (isset(\$data['" . $jsonString . "']))"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t\$data['" . $jsonString . "'] = (string) json_encode(\$data['" . $jsonString . "']);"; + $script .= PHP_EOL . "\t\t}"; } } // turn string into base 64 string - if(isset($this->base64Builder[$view]) && ComponentbuilderHelper::checkArray($this->base64Builder[$view])) + if (isset($this->base64Builder[$view]) && ComponentbuilderHelper::checkArray($this->base64Builder[$view])) { foreach ($this->base64Builder[$view] as $baseString) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set the ".$baseString." string to base64 string."; - $script .= PHP_EOL."\t\tif (isset(\$data['".$baseString."']))"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t\$data['".$baseString."'] = base64_encode(\$data['".$baseString."']);"; - $script .= PHP_EOL."\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set the " . $baseString . " string to base64 string."; + $script .= PHP_EOL . "\t\tif (isset(\$data['" . $baseString . "']))"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t\$data['" . $baseString . "'] = base64_encode(\$data['" . $baseString . "']);"; + $script .= PHP_EOL . "\t\t}"; } } // turn string into encrypted string - if((isset($this->basicEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder[$view])) || (isset($this->advancedEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder[$view]))) + if ((isset($this->basicEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder[$view])) || (isset($this->advancedEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder[$view]))) { - $Component = $this->fileContentStatic['###Component###']; - if(isset($this->basicEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder[$view])) + $Component = $this->fileContentStatic['###Component###']; + if (isset($this->basicEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->basicEncryptionBuilder[$view])) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the basic encryption key."; - $script .= PHP_EOL."\t\t\$basickey = ".$Component."Helper::getCryptKey('basic');"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the encryption object"; - $script .= PHP_EOL."\t\t\$basic = new FOFEncryptAes(\$basickey, 128);"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the basic encryption key."; + $script .= PHP_EOL . "\t\t\$basickey = " . $Component . "Helper::getCryptKey('basic');"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object"; + $script .= PHP_EOL . "\t\t\$basic = new FOFEncryptAes(\$basickey, 128);"; foreach ($this->basicEncryptionBuilder[$view] as $baseString) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Encrypt data ".$baseString."."; - $script .= PHP_EOL."\t\tif (isset(\$data['".$baseString."']) && \$basickey)"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t\$data['".$baseString."'] = \$basic->encryptString(\$data['".$baseString."']);"; - $script .= PHP_EOL."\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Encrypt data " . $baseString . "."; + $script .= PHP_EOL . "\t\tif (isset(\$data['" . $baseString . "']) && \$basickey)"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t\$data['" . $baseString . "'] = \$basic->encryptString(\$data['" . $baseString . "']);"; + $script .= PHP_EOL . "\t\t}"; } } - if(isset($this->advancedEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder[$view])) + if (isset($this->advancedEncryptionBuilder[$view]) && ComponentbuilderHelper::checkArray($this->advancedEncryptionBuilder[$view])) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the advanced encryption key."; - $script .= PHP_EOL."\t\t\$advancedkey = ".$Component."Helper::getCryptKey('advanced');"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the encryption object"; - $script .= PHP_EOL."\t\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the advanced encryption key."; + $script .= PHP_EOL . "\t\t\$advancedkey = " . $Component . "Helper::getCryptKey('advanced');"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the encryption object"; + $script .= PHP_EOL . "\t\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; foreach ($this->advancedEncryptionBuilder[$view] as $baseString) { - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Encrypt data ".$baseString."."; - $script .= PHP_EOL."\t\tif (isset(\$data['".$baseString."']) && \$advancedkey)"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t\$data['".$baseString."'] = \$advanced->encryptString(\$data['".$baseString."']);"; - $script .= PHP_EOL."\t\t}"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Encrypt data " . $baseString . "."; + $script .= PHP_EOL . "\t\tif (isset(\$data['" . $baseString . "']) && \$advancedkey)"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t\$data['" . $baseString . "'] = \$advanced->encryptString(\$data['" . $baseString . "']);"; + $script .= PHP_EOL . "\t\t}"; } } } // add custom PHP to the save method - $script .= $this->getCustomScriptBuilder('php_save', $view, PHP_EOL.PHP_EOL); + $script .= $this->getCustomScriptBuilder('php_save', $view, PHP_EOL . PHP_EOL); return $script; } @@ -4290,18 +4303,18 @@ class Interpretation extends Fields // reset $oserver = ""; // set component name - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic['###component###']; // add the tags observer if (isset($this->tagsBuilder[$view]) && ComponentbuilderHelper::checkString($this->tagsBuilder[$view])) { - $oserver .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Adding Tag Options"; - $oserver .= PHP_EOL."\t\tJTableObserverTags::createObserver(\$this, array('typeAlias' => 'com_".$component.".".$view."'));"; + $oserver .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Adding Tag Options"; + $oserver .= PHP_EOL . "\t\tJTableObserverTags::createObserver(\$this, array('typeAlias' => 'com_" . $component . "." . $view . "'));"; } // add the history/version observer if (isset($this->historyBuilder[$view]) && ComponentbuilderHelper::checkString($this->historyBuilder[$view])) { - $oserver .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Adding History Options"; - $oserver .= PHP_EOL."\t\tJTableObserverContenthistory::createObserver(\$this, array('typeAlias' => 'com_".$component.".".$view."'));"; + $oserver .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Adding History Options"; + $oserver .= PHP_EOL . "\t\tJTableObserverContenthistory::createObserver(\$this, array('typeAlias' => 'com_" . $component . "." . $view . "'));"; } return $oserver; } @@ -4312,20 +4325,20 @@ class Interpretation extends Fields if (array_key_exists($view, $this->catCodeBuilder)) { $code = $this->catCodeBuilder[$view]['code']; - return ", '".$code."' => \$this->".$code; + return ", '" . $code . "' => \$this->" . $code; } return ''; } - + public function setComponentToContentTypes($action) { $script = ''; if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) { // set component name - $component = $this->fileContentStatic['###component###']; + $component = $this->fileContentStatic['###component###']; // reset - $dbStuff = array(); + $dbStuff = array(); // start loading the content type data foreach ($this->componentData->admin_views as $viewData) { @@ -4339,14 +4352,13 @@ class Interpretation extends Fields $checkViews = (isset($this->catCodeBuilder[$view]['views']) && ComponentbuilderHelper::checkString($this->catCodeBuilder[$view]['views'])) ? $this->catCodeBuilder[$view]['views'] : $views; if (ComponentbuilderHelper::checkArray($dbStuff[$view]) && array_key_exists($view, $this->catCodeBuilder) && ($checkViews == $views)) { - $dbStuff[$view.' category'] = $this->getCategoryContentType($view, $views, $component); + $dbStuff[$view . ' category'] = $this->getCategoryContentType($view, $views, $component); } - elseif(!isset($dbStuff[$view]) || !ComponentbuilderHelper::checkArray($dbStuff[$view])) + elseif (!isset($dbStuff[$view]) || !ComponentbuilderHelper::checkArray($dbStuff[$view])) { // remove if not array unset($dbStuff[$view]); } - } // build the db insert query if (ComponentbuilderHelper::checkArray($dbStuff)) @@ -4356,50 +4368,50 @@ class Interpretation extends Fields { $taabb = "\t"; } - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Get The Database object"; - $script .= PHP_EOL."\t\t\t\$db = JFactory::getDbo();"; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get The Database object"; + $script .= PHP_EOL . "\t\t\t\$db = JFactory::getDbo();"; foreach ($dbStuff as $name => $tables) { if (ComponentbuilderHelper::checkArray($tables)) { $code = ComponentbuilderHelper::safeString($name); - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Create the ".$name." content type object."; - $script .= PHP_EOL."\t\t\t\$".$code." = new stdClass();"; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create the " . $name . " content type object."; + $script .= PHP_EOL . "\t\t\t\$" . $code . " = new stdClass();"; foreach ($tables as $table => $data) { - $script .= PHP_EOL."\t\t\t\$".$code."->".$table." = '".$data."';"; + $script .= PHP_EOL . "\t\t\t\$" . $code . "->" . $table . " = '" . $data . "';"; } if ($action === 'update') { // we first load script to check if data exist - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Check if ".$name." type is already in content_type DB."; - $script .= PHP_EOL."\t\t\t\$".$code."_id = null;"; - $script .= PHP_EOL."\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\t\$query->select(\$db->quoteName(array('type_id')));"; - $script .= PHP_EOL."\t\t\t\$query->from(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL."\t\t\t\$query->where(\$db->quoteName('type_alias') . ' LIKE '. \$db->quote($".$code."->type_alias));"; - $script .= PHP_EOL."\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\t\$db->execute();"; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check if " . $name . " type is already in content_type DB."; + $script .= PHP_EOL . "\t\t\t\$" . $code . "_id = null;"; + $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\t\$query->select(\$db->quoteName(array('type_id')));"; + $script .= PHP_EOL . "\t\t\t\$query->from(\$db->quoteName('#__content_types'));"; + $script .= PHP_EOL . "\t\t\t\$query->where(\$db->quoteName('type_alias') . ' LIKE '. \$db->quote($" . $code . "->type_alias));"; + $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\t\$db->execute();"; } - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Set the object into the content types table."; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Set the object into the content types table."; if ($action === 'update') { - $script .= PHP_EOL."\t\t\tif (\$db->getNumRows())"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t\$".$code."->type_id = \$db->loadResult();"; - $script .= PHP_EOL."\t\t\t\t\$".$code."_Updated = \$db->updateObject('#__content_types', \$".$code.", 'type_id');"; - $script .= PHP_EOL."\t\t\t}"; - $script .= PHP_EOL."\t\t\telse"; - $script .= PHP_EOL."\t\t\t{"; + $script .= PHP_EOL . "\t\t\tif (\$db->getNumRows())"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t\$" . $code . "->type_id = \$db->loadResult();"; + $script .= PHP_EOL . "\t\t\t\t\$" . $code . "_Updated = \$db->updateObject('#__content_types', \$" . $code . ", 'type_id');"; + $script .= PHP_EOL . "\t\t\t}"; + $script .= PHP_EOL . "\t\t\telse"; + $script .= PHP_EOL . "\t\t\t{"; } - $script .= PHP_EOL."\t\t\t".$taabb."\$".$code."_Inserted = \$db->insertObject('#__content_types', \$".$code.");"; + $script .= PHP_EOL . "\t\t\t" . $taabb . "\$" . $code . "_Inserted = \$db->insertObject('#__content_types', \$" . $code . ");"; if ($action === 'update') { - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . "\t\t\t}"; } } } - $script .= PHP_EOL.PHP_EOL; + $script .= PHP_EOL . PHP_EOL; } } return $script; @@ -4409,93 +4421,93 @@ class Interpretation extends Fields { // reset script $script = $this->setComponentToContentTypes('install'); - + // set the component name $component = $this->fileContentStatic['###component###']; - + // add the assets table update for permissions rules if (isset($this->assetsRules) && ComponentbuilderHelper::checkArray($this->assetsRules)) { if (ComponentbuilderHelper::checkString($script)) { - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Install the global extenstion assets permission."; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Install the global extenstion assets permission."; } else { - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Install the global extenstion assets permission."; - $script .= PHP_EOL."\t\t\t\$db = JFactory::getDbo();"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Install the global extenstion assets permission."; + $script .= PHP_EOL . "\t\t\t\$db = JFactory::getDbo();"; } - $script .= PHP_EOL."\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Field to update."; - $script .= PHP_EOL."\t\t\t\$fields = array("; - $script .= PHP_EOL."\t\t\t\t\$db->quoteName('rules') . ' = ' . \$db->quote('{".implode(',', $this->assetsRules)."}'),"; - $script .= PHP_EOL."\t\t\t);"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Condition."; - $script .= PHP_EOL."\t\t\t\$conditions = array("; - $script .= PHP_EOL."\t\t\t\t\$db->quoteName('name') . ' = ' . \$db->quote('com_".$component."')"; - $script .= PHP_EOL."\t\t\t);"; - $script .= PHP_EOL."\t\t\t\$query->update(\$db->quoteName('#__assets'))->set(\$fields)->where(\$conditions);"; - $script .= PHP_EOL."\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\t\$allDone = \$db->execute();".PHP_EOL; + $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Field to update."; + $script .= PHP_EOL . "\t\t\t\$fields = array("; + $script .= PHP_EOL . "\t\t\t\t\$db->quoteName('rules') . ' = ' . \$db->quote('{" . implode(',', $this->assetsRules) . "}'),"; + $script .= PHP_EOL . "\t\t\t);"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Condition."; + $script .= PHP_EOL . "\t\t\t\$conditions = array("; + $script .= PHP_EOL . "\t\t\t\t\$db->quoteName('name') . ' = ' . \$db->quote('com_" . $component . "')"; + $script .= PHP_EOL . "\t\t\t);"; + $script .= PHP_EOL . "\t\t\t\$query->update(\$db->quoteName('#__assets'))->set(\$fields)->where(\$conditions);"; + $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\t\$allDone = \$db->execute();" . PHP_EOL; } // add the global params for the component global settings if (isset($this->extensionsParams) && ComponentbuilderHelper::checkArray($this->extensionsParams)) { if (ComponentbuilderHelper::checkString($script)) { - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Install the global extenstion params."; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Install the global extenstion params."; } else { - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Install the global extenstion params."; - $script .= PHP_EOL."\t\t\t\$db = JFactory::getDbo();"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Install the global extenstion params."; + $script .= PHP_EOL . "\t\t\t\$db = JFactory::getDbo();"; } - $script .= PHP_EOL."\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Field to update."; - $script .= PHP_EOL."\t\t\t\$fields = array("; - $script .= PHP_EOL."\t\t\t\t\$db->quoteName('params') . ' = ' . \$db->quote('{".implode(',', $this->extensionsParams)."}'),"; - $script .= PHP_EOL."\t\t\t);"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Condition."; - $script .= PHP_EOL."\t\t\t\$conditions = array("; - $script .= PHP_EOL."\t\t\t\t\$db->quoteName('element') . ' = ' . \$db->quote('com_".$component."')"; - $script .= PHP_EOL."\t\t\t);"; - $script .= PHP_EOL."\t\t\t\$query->update(\$db->quoteName('#__extensions'))->set(\$fields)->where(\$conditions);"; - $script .= PHP_EOL."\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\t\$allDone = \$db->execute();".PHP_EOL; + $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Field to update."; + $script .= PHP_EOL . "\t\t\t\$fields = array("; + $script .= PHP_EOL . "\t\t\t\t\$db->quoteName('params') . ' = ' . \$db->quote('{" . implode(',', $this->extensionsParams) . "}'),"; + $script .= PHP_EOL . "\t\t\t);"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Condition."; + $script .= PHP_EOL . "\t\t\t\$conditions = array("; + $script .= PHP_EOL . "\t\t\t\t\$db->quoteName('element') . ' = ' . \$db->quote('com_" . $component . "')"; + $script .= PHP_EOL . "\t\t\t);"; + $script .= PHP_EOL . "\t\t\t\$query->update(\$db->quoteName('#__extensions'))->set(\$fields)->where(\$conditions);"; + $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\t\$allDone = \$db->execute();" . PHP_EOL; } // add the custom script - $script .= $this->getCustomScriptBuilder('php_postflight', 'install', PHP_EOL.PHP_EOL, null, true); + $script .= $this->getCustomScriptBuilder('php_postflight', 'install', PHP_EOL . PHP_EOL, null, true); // add the component install notice if (ComponentbuilderHelper::checkString($script)) { - $script .= PHP_EOL."\t\t\t".'echo \''; - $script .= PHP_EOL."\t\t\t\t".''; - $script .= PHP_EOL."\t\t\t\t".'\';'; - + $script .= PHP_EOL . "\t\t\t" . 'echo \''; + $script .= PHP_EOL . "\t\t\t\t" . ''; + $script .= PHP_EOL . "\t\t\t\t" . '\';'; + return $script; } - return PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." noting to install."; + return PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " noting to install."; } - + public function setPostUpdateScript() { // reset script $script = $this->setComponentToContentTypes('update'); // add the custom script - $script .= $this->getCustomScriptBuilder('php_postflight', 'update', PHP_EOL.PHP_EOL, null, true); + $script .= $this->getCustomScriptBuilder('php_postflight', 'update', PHP_EOL . PHP_EOL, null, true); if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) { - $script .= PHP_EOL."\t\t\t".'echo \''; - $script .= PHP_EOL."\t\t\t\t".''; - $script .= PHP_EOL."\t\t\t\t".''; - $script .= PHP_EOL."\t\t\t\t

Upgrade to Version ".$this->fileContentStatic['###ACTUALVERSION###']." Was Successful! Let us know if anything is not working as expected.

';"; + $script .= PHP_EOL . "\t\t\t" . 'echo \''; + $script .= PHP_EOL . "\t\t\t\t" . ''; + $script .= PHP_EOL . "\t\t\t\t" . ''; + $script .= PHP_EOL . "\t\t\t\t

Upgrade to Version " . $this->fileContentStatic['###ACTUALVERSION###'] . " Was Successful! Let us know if anything is not working as expected.

';"; } if (ComponentbuilderHelper::checkString($script)) { return $script; } - return PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." noting to update."; + return PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " noting to update."; } public function setUninstallScript() @@ -4506,10 +4518,10 @@ class Interpretation extends Fields { $component = $this->fileContentStatic['###component###']; // start loading the data to delet - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get Application object"; - $script .= PHP_EOL."\t\t\$app = JFactory::getApplication();"; - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get The Database object"; - $script .= PHP_EOL."\t\t\$db = JFactory::getDbo();"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get Application object"; + $script .= PHP_EOL . "\t\t\$app = JFactory::getApplication();"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get The Database object"; + $script .= PHP_EOL . "\t\t\$db = JFactory::getDbo();"; foreach ($this->uninstallScriptBuilder as $viewName => $typeAlias) { @@ -4517,125 +4529,125 @@ class Interpretation extends Fields $view = ComponentbuilderHelper::safeString($viewName); // First check if data is till in table - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $script .= PHP_EOL."\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select id from content type table"; - $script .= PHP_EOL."\t\t\$query->select(\$db->quoteName('type_id'));"; - $script .= PHP_EOL."\t\t\$query->from(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Where ".$viewName." alias is found"; - $script .= PHP_EOL."\t\t\$query->where( \$db->quoteName('type_alias') . ' = '. \$db->quote('".$typeAlias."') );"; - $script .= PHP_EOL."\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Execute query to see if alias is found"; - $script .= PHP_EOL."\t\t\$db->execute();"; - $script .= PHP_EOL."\t\t\$".$view."_found = \$db->getNumRows();"; - $script .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Now check if there were any rows"; - $script .= PHP_EOL."\t\tif (\$".$view."_found)"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Since there are load the needed ".$view." type ids"; - $script .= PHP_EOL."\t\t\t\$".$view."_ids = \$db->loadColumn();"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select id from content type table"; + $script .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('type_id'));"; + $script .= PHP_EOL . "\t\t\$query->from(\$db->quoteName('#__content_types'));"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Where " . $viewName . " alias is found"; + $script .= PHP_EOL . "\t\t\$query->where( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; + $script .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Execute query to see if alias is found"; + $script .= PHP_EOL . "\t\t\$db->execute();"; + $script .= PHP_EOL . "\t\t\$" . $view . "_found = \$db->getNumRows();"; + $script .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Now check if there were any rows"; + $script .= PHP_EOL . "\t\tif (\$" . $view . "_found)"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Since there are load the needed " . $view . " type ids"; + $script .= PHP_EOL . "\t\t\t\$" . $view . "_ids = \$db->loadColumn();"; // Now remove the actual type entry - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Remove ".$viewName." from the content type table"; - $script .= PHP_EOL."\t\t\t\$".$view."_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('".$typeAlias."') );"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $script .= PHP_EOL."\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\t\$query->delete(\$db->quoteName('#__content_types'));"; - $script .= PHP_EOL."\t\t\t\$query->where(\$".$view."_condition);"; - $script .= PHP_EOL."\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Execute the query to remove ".$viewName." items"; - $script .= PHP_EOL."\t\t\t\$".$view."_done = \$db->execute();"; - $script .= PHP_EOL."\t\t\tif (\$".$view."_done);"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." If succesfully remove ".$viewName." add queued success message."; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " from the content type table"; + $script .= PHP_EOL . "\t\t\t\$" . $view . "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\t\$query->delete(\$db->quoteName('#__content_types'));"; + $script .= PHP_EOL . "\t\t\t\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . "\t\t\t\$" . $view . "_done = \$db->execute();"; + $script .= PHP_EOL . "\t\t\tif (\$" . $view . "_done);"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL."\t\t\t\t\$app->enqueueMessage(JText::_('The (".$typeAlias.") type alias was removed from the #__content_type table'));"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText::_('The (" . $typeAlias . ") type alias was removed from the #__content_type table'));"; + $script .= PHP_EOL . "\t\t\t}"; // Now remove the related items from contentitem tag map table - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Remove ".$viewName." items from the contentitem tag map table"; - $script .= PHP_EOL."\t\t\t\$".$view."_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('".$typeAlias."') );"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $script .= PHP_EOL."\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\t\$query->delete(\$db->quoteName('#__contentitem_tag_map'));"; - $script .= PHP_EOL."\t\t\t\$query->where(\$".$view."_condition);"; - $script .= PHP_EOL."\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Execute the query to remove ".$viewName." items"; - $script .= PHP_EOL."\t\t\t\$".$view."_done = \$db->execute();"; - $script .= PHP_EOL."\t\t\tif (\$".$view."_done);"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." If succesfully remove ".$viewName." add queued success message."; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the contentitem tag map table"; + $script .= PHP_EOL . "\t\t\t\$" . $view . "_condition = array( \$db->quoteName('type_alias') . ' = '. \$db->quote('" . $typeAlias . "') );"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\t\$query->delete(\$db->quoteName('#__contentitem_tag_map'));"; + $script .= PHP_EOL . "\t\t\t\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . "\t\t\t\$" . $view . "_done = \$db->execute();"; + $script .= PHP_EOL . "\t\t\tif (\$" . $view . "_done);"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL."\t\t\t\t\$app->enqueueMessage(JText::_('The (".$typeAlias.") type alias was removed from the #__contentitem_tag_map table'));"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText::_('The (" . $typeAlias . ") type alias was removed from the #__contentitem_tag_map table'));"; + $script .= PHP_EOL . "\t\t\t}"; // Now remove the related items from ucm content table - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Remove ".$viewName." items from the ucm content table"; - $script .= PHP_EOL."\t\t\t\$".$view."_condition = array( \$db->quoteName('core_type_alias') . ' = ' . \$db->quote('".$typeAlias."') );"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $script .= PHP_EOL."\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\t\$query->delete(\$db->quoteName('#__ucm_content'));"; - $script .= PHP_EOL."\t\t\t\$query->where(\$".$view."_condition);"; - $script .= PHP_EOL."\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Execute the query to remove ".$viewName." items"; - $script .= PHP_EOL."\t\t\t\$".$view."_done = \$db->execute();"; - $script .= PHP_EOL."\t\t\tif (\$".$view."_done);"; - $script .= PHP_EOL."\t\t\t{"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." If succesfully remove ".$viewName." add queued success message."; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm content table"; + $script .= PHP_EOL . "\t\t\t\$" . $view . "_condition = array( \$db->quoteName('core_type_alias') . ' = ' . \$db->quote('" . $typeAlias . "') );"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\t\$query->delete(\$db->quoteName('#__ucm_content'));"; + $script .= PHP_EOL . "\t\t\t\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . "\t\t\t\$" . $view . "_done = \$db->execute();"; + $script .= PHP_EOL . "\t\t\tif (\$" . $view . "_done);"; + $script .= PHP_EOL . "\t\t\t{"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $viewName . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL."\t\t\t\t\$app->enqueueMessage(JText::_('The (".$typeAlias.") type alias was removed from the #__ucm_content table'));"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . "\t\t\t\t\$app->enqueueMessage(JText::_('The (" . $typeAlias . ") type alias was removed from the #__ucm_content table'));"; + $script .= PHP_EOL . "\t\t\t}"; // setup the foreach loop of ids - $script .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Make sure that all the ".$viewName." items are cleared from DB"; - $script .= PHP_EOL."\t\t\tforeach (\$".$view."_ids as \$".$view."_id)"; - $script .= PHP_EOL."\t\t\t{"; + $script .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Make sure that all the " . $viewName . " items are cleared from DB"; + $script .= PHP_EOL . "\t\t\tforeach (\$" . $view . "_ids as \$" . $view . "_id)"; + $script .= PHP_EOL . "\t\t\t{"; // Now remove the related items from ucm base table - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Remove ".$viewName." items from the ucm base table"; - $script .= PHP_EOL."\t\t\t\t\$".$view."_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$".$view."_id);"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $script .= PHP_EOL."\t\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\t\t\$query->delete(\$db->quoteName('#__ucm_base'));"; - $script .= PHP_EOL."\t\t\t\t\$query->where(\$".$view."_condition);"; - $script .= PHP_EOL."\t\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Execute the query to remove ".$viewName." items"; - $script .= PHP_EOL."\t\t\t\t\$db->execute();"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm base table"; + $script .= PHP_EOL . "\t\t\t\t\$" . $view . "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$" . $view . "_id);"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . "\t\t\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\t\t\$query->delete(\$db->quoteName('#__ucm_base'));"; + $script .= PHP_EOL . "\t\t\t\t\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . "\t\t\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . "\t\t\t\t\$db->execute();"; // Now remove the related items from ucm history table - $script .= PHP_EOL.PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Remove ".$viewName." items from the ucm history table"; - $script .= PHP_EOL."\t\t\t\t\$".$view."_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$".$view."_id);"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $script .= PHP_EOL."\t\t\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\t\t\$query->delete(\$db->quoteName('#__ucm_history'));"; - $script .= PHP_EOL."\t\t\t\t\$query->where(\$".$view."_condition);"; - $script .= PHP_EOL."\t\t\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Execute the query to remove ".$viewName." items"; - $script .= PHP_EOL."\t\t\t\t\$db->execute();"; + $script .= PHP_EOL . PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Remove " . $viewName . " items from the ucm history table"; + $script .= PHP_EOL . "\t\t\t\t\$" . $view . "_condition = array( \$db->quoteName('ucm_type_id') . ' = ' . \$" . $view . "_id);"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . "\t\t\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\t\t\$query->delete(\$db->quoteName('#__ucm_history'));"; + $script .= PHP_EOL . "\t\t\t\t\$query->where(\$" . $view . "_condition);"; + $script .= PHP_EOL . "\t\t\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Execute the query to remove " . $viewName . " items"; + $script .= PHP_EOL . "\t\t\t\t\$db->execute();"; - $script .= PHP_EOL."\t\t\t}"; + $script .= PHP_EOL . "\t\t\t}"; - $script .= PHP_EOL."\t\t}"; + $script .= PHP_EOL . "\t\t}"; } - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." If All related items was removed queued success message."; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " If All related items was removed queued success message."; // TODO lang is not translated - $script .= PHP_EOL."\t\t\$app->enqueueMessage(JText::_('All related items was removed from the #__ucm_base table'));"; - $script .= PHP_EOL."\t\t\$app->enqueueMessage(JText::_('All related items was removed from the #__ucm_history table'));"; + $script .= PHP_EOL . "\t\t\$app->enqueueMessage(JText::_('All related items was removed from the #__ucm_base table'));"; + $script .= PHP_EOL . "\t\t\$app->enqueueMessage(JText::_('All related items was removed from the #__ucm_history table'));"; // finaly remove the assets from the assets table - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Remove ".$component." assets from the assets table"; - $script .= PHP_EOL."\t\t\$".$component."_condition = array( \$db->quoteName('name') . ' LIKE ' . \$db->quote('com_".$component."%') );"; - $script .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $script .= PHP_EOL."\t\t\$query = \$db->getQuery(true);"; - $script .= PHP_EOL."\t\t\$query->delete(\$db->quoteName('#__assets'));"; - $script .= PHP_EOL."\t\t\$query->where(\$".$component."_condition);"; - $script .= PHP_EOL."\t\t\$db->setQuery(\$query);"; - $script .= PHP_EOL."\t\t\$".$view."_done = \$db->execute();"; - $script .= PHP_EOL."\t\tif (\$".$view."_done);"; - $script .= PHP_EOL."\t\t{"; - $script .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." If succesfully remove ".$component." add queued success message."; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Remove " . $component . " assets from the assets table"; + $script .= PHP_EOL . "\t\t\$" . $component . "_condition = array( \$db->quoteName('name') . ' LIKE ' . \$db->quote('com_" . $component . "%') );"; + $script .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $script .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; + $script .= PHP_EOL . "\t\t\$query->delete(\$db->quoteName('#__assets'));"; + $script .= PHP_EOL . "\t\t\$query->where(\$" . $component . "_condition);"; + $script .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; + $script .= PHP_EOL . "\t\t\$" . $view . "_done = \$db->execute();"; + $script .= PHP_EOL . "\t\tif (\$" . $view . "_done);"; + $script .= PHP_EOL . "\t\t{"; + $script .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " If succesfully remove " . $component . " add queued success message."; // TODO lang is not translated - $script .= PHP_EOL."\t\t\t\$app->enqueueMessage(JText::_('All related items was removed from the #__assets table'));"; - $script .= PHP_EOL."\t\t}"; + $script .= PHP_EOL . "\t\t\t\$app->enqueueMessage(JText::_('All related items was removed from the #__assets table'));"; + $script .= PHP_EOL . "\t\t}"; // done $script .= PHP_EOL; } @@ -4652,20 +4664,20 @@ class Interpretation extends Fields // reset array $array = array(); // set needed defaults - $alias = (array_key_exists($view, $this->aliasBuilder)) ? $this->aliasBuilder[$view] : 'null'; - $title = (array_key_exists($view, $this->titleBuilder)) ? $this->titleBuilder[$view] : 'null'; - $category = (array_key_exists($view, $this->catCodeBuilder)) ? $this->catCodeBuilder[$view]['code'] : 'null'; - $categoryHistory = (array_key_exists($view, $this->catCodeBuilder)) ? - '{"sourceColumn": "'.$category.'","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},': ''; - $Component = ComponentbuilderHelper::safeString($component, 'F'); - $View = ComponentbuilderHelper::safeString($view, 'F'); - $maintext = (isset($this->maintextBuilder[$view]) && ComponentbuilderHelper::checkString($this->maintextBuilder[$view])) ? $this->maintextBuilder[$view] : 'null'; - $hiddenFields = (isset($this->hiddenFieldsBuilder[$view]) && ComponentbuilderHelper::checkString($this->hiddenFieldsBuilder[$view])) ? $this->hiddenFieldsBuilder[$view]: ''; - $dynamicfields = (isset($this->dynamicfieldsBuilder[$view]) && ComponentbuilderHelper::checkString($this->dynamicfieldsBuilder[$view])) ? $this->dynamicfieldsBuilder[$view] : ''; - $intFields = (isset($this->intFieldsBuilder[$view]) && ComponentbuilderHelper::checkString($this->intFieldsBuilder[$view])) ? $this->intFieldsBuilder[$view] : ''; - $customfieldlinks = (isset($this->customFieldLinksBuilder[$view]) && ComponentbuilderHelper::checkString($this->customFieldLinksBuilder[$view])) ? $this->customFieldLinksBuilder[$view] : ''; + $alias = (array_key_exists($view, $this->aliasBuilder)) ? $this->aliasBuilder[$view] : 'null'; + $title = (array_key_exists($view, $this->titleBuilder)) ? $this->titleBuilder[$view] : 'null'; + $category = (array_key_exists($view, $this->catCodeBuilder)) ? $this->catCodeBuilder[$view]['code'] : 'null'; + $categoryHistory = (array_key_exists($view, $this->catCodeBuilder)) ? + '{"sourceColumn": "' . $category . '","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},' : ''; + $Component = ComponentbuilderHelper::safeString($component, 'F'); + $View = ComponentbuilderHelper::safeString($view, 'F'); + $maintext = (isset($this->maintextBuilder[$view]) && ComponentbuilderHelper::checkString($this->maintextBuilder[$view])) ? $this->maintextBuilder[$view] : 'null'; + $hiddenFields = (isset($this->hiddenFieldsBuilder[$view]) && ComponentbuilderHelper::checkString($this->hiddenFieldsBuilder[$view])) ? $this->hiddenFieldsBuilder[$view] : ''; + $dynamicfields = (isset($this->dynamicfieldsBuilder[$view]) && ComponentbuilderHelper::checkString($this->dynamicfieldsBuilder[$view])) ? $this->dynamicfieldsBuilder[$view] : ''; + $intFields = (isset($this->intFieldsBuilder[$view]) && ComponentbuilderHelper::checkString($this->intFieldsBuilder[$view])) ? $this->intFieldsBuilder[$view] : ''; + $customfieldlinks = (isset($this->customFieldLinksBuilder[$view]) && ComponentbuilderHelper::checkString($this->customFieldLinksBuilder[$view])) ? $this->customFieldLinksBuilder[$view] : ''; // build uninstall script for content types - $this->uninstallScriptBuilder[$View] = 'com_'.$component.'.'.$view; + $this->uninstallScriptBuilder[$View] = 'com_' . $component . '.' . $view; // check if this view has metadata if (isset($this->metadataBuilder[$view]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view])) { @@ -4691,17 +4703,17 @@ class Interpretation extends Fields $accessHistory = ''; } // set the title - $array['type_title'] = $Component.' '.$View; + $array['type_title'] = $Component . ' ' . $View; // set the alias - $array['type_alias'] = 'com_'.$component.'.'.$view; + $array['type_alias'] = 'com_' . $component . '.' . $view; // set the table - $array['table'] = '{"special": {"dbtable": "#__'.$component.'_'.$view.'","key": "id","type": "'.$View.'","prefix": "'.$component.'Table","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $array['table'] = '{"special": {"dbtable": "#__' . $component . '_' . $view . '","key": "id","type": "' . $View . '","prefix": "' . $component . 'Table","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; // set field map - $array['field_mappings'] = '{"common": {"core_content_item_id": "id","core_title": "'.$title.'","core_state": "published","core_alias": "'.$alias.'","core_created_time": "created","core_modified_time": "modified","core_body": "'.$maintext.'","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "'.$core_access.'","core_params": "params","core_featured": "null","core_metadata": "'.$core_metadata.'","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "'.$core_metakey.'","core_metadesc": "'.$core_metadesc.'","core_catid": "'.$category.'","core_xreference": "null","asset_id": "asset_id"},"special": {'.$dynamicfields.'}}'; + $array['field_mappings'] = '{"common": {"core_content_item_id": "id","core_title": "' . $title . '","core_state": "published","core_alias": "' . $alias . '","core_created_time": "created","core_modified_time": "modified","core_body": "' . $maintext . '","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "' . $core_access . '","core_params": "params","core_featured": "null","core_metadata": "' . $core_metadata . '","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "' . $core_metakey . '","core_metadesc": "' . $core_metadesc . '","core_catid": "' . $category . '","core_xreference": "null","asset_id": "asset_id"},"special": {' . $dynamicfields . '}}'; // set the router class method - $array['router'] = $Component.'HelperRoute::get'.$View.'Route'; + $array['router'] = $Component . 'HelperRoute::get' . $View . 'Route'; // set content history - $array['content_history_options'] = '{"formFile": "administrator/components/com_'.$component.'/models/forms/'.$view.'.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"'.$hiddenFields.'],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"'.$intFields.'],"displayLookup": ['.$categoryHistory.'{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}'.$accessHistory.',{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}'.$customfieldlinks.']}'; + $array['content_history_options'] = '{"formFile": "administrator/components/com_' . $component . '/models/forms/' . $view . '.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"' . $hiddenFields . '],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"' . $intFields . '],"displayLookup": [' . $categoryHistory . '{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}' . $accessHistory . ',{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}' . $customfieldlinks . ']}'; return $array; } @@ -4710,21 +4722,21 @@ class Interpretation extends Fields public function getCategoryContentType($view, $views, $component) { - $category = $this->catCodeBuilder[$view]['code']; - $Component = ComponentbuilderHelper::safeString($component, 'F'); - $View = ComponentbuilderHelper::safeString($view, 'F'); + $category = $this->catCodeBuilder[$view]['code']; + $Component = ComponentbuilderHelper::safeString($component, 'F'); + $View = ComponentbuilderHelper::safeString($view, 'F'); // build uninstall script for content types - $this->uninstallScriptBuilder[$View.' '.$category] = 'com_'.$component.'.'.$views.'.category'; + $this->uninstallScriptBuilder[$View . ' ' . $category] = 'com_' . $component . '.' . $views . '.category'; // set the title - $array['type_title'] = $Component.' '.$View.' '.ComponentbuilderHelper::safeString($category, 'F'); + $array['type_title'] = $Component . ' ' . $View . ' ' . ComponentbuilderHelper::safeString($category, 'F'); // set the alias - $array['type_alias'] = 'com_'.$component.'.'.$views.'.category'; + $array['type_alias'] = 'com_' . $component . '.' . $views . '.category'; // set the table $array['table'] = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; // set field map $array['field_mappings'] = '{"common":{"core_content_item_id":"id","core_title":"title","core_state":"published","core_alias":"alias","core_created_time":"created_time","core_modified_time":"modified_time","core_body":"description", "core_hits":"hits","core_publish_up":"null","core_publish_down":"null","core_access":"access", "core_params":"params", "core_featured":"null", "core_metadata":"metadata", "core_language":"language", "core_images":"null", "core_urls":"null", "core_version":"version", "core_ordering":"null", "core_metakey":"metakey", "core_metadesc":"metadesc", "core_catid":"parent_id", "core_xreference":"null", "asset_id":"asset_id"}, "special":{"parent_id":"parent_id","lft":"lft","rgt":"rgt","level":"level","path":"path","extension":"extension","note":"note"}}'; // set the router class method - $array['router'] = $Component.'HelperRoute::getCategoryRoute'; + $array['router'] = $Component . 'HelperRoute::getCategoryRoute'; // set content history $array['content_history_options'] = '{"formFile":"administrator\/components\/com_categories\/models\/forms\/category.xml", "hideFields":["asset_id","checked_out","checked_out_time","version","lft","rgt","level","path","extension"], "ignoreChanges":["modified_user_id", "modified_time", "checked_out", "checked_out_time", "version", "hits", "path"],"convertToInt":["publish_up", "publish_down"], "displayLookup":[{"sourceColumn":"created_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"access","targetTable":"#__viewlevels","targetColumn":"id","displayColumn":"title"},{"sourceColumn":"modified_user_id","targetTable":"#__users","targetColumn":"id","displayColumn":"name"},{"sourceColumn":"parent_id","targetTable":"#__categories","targetColumn":"id","displayColumn":"title"}]}'; @@ -4734,46 +4746,46 @@ class Interpretation extends Fields public function setRouterHelp($viewName_single, $viewName_list, $front = false) { // add if tags is added, also for all front item views - if (((isset($this->tagsBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->tagsBuilder[$viewName_single])) || $front) && (!in_array($viewName_single,$this->setRouterHelpDone))) + if (((isset($this->tagsBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->tagsBuilder[$viewName_single])) || $front) && (!in_array($viewName_single, $this->setRouterHelpDone))) { // insure we load a view only once $this->setRouterHelpDone[] = $viewName_single; // build view route helper $View = ComponentbuilderHelper::safeString($viewName_single, 'F'); $routeHelper = array(); - $routeHelper[] = PHP_EOL.PHP_EOL."\t/**"; - $routeHelper[] = "\t* @param int The route of the ".$View; + $routeHelper[] = PHP_EOL . PHP_EOL . "\t/**"; + $routeHelper[] = "\t* @param int The route of the " . $View; $routeHelper[] = "\t*/"; if ('category' === $viewName_single || 'categories' === $viewName_single) { - $routeHelper[] = "\tpublic static function get".$View."Route(\$id = 0)"; + $routeHelper[] = "\tpublic static function get" . $View . "Route(\$id = 0)"; } else { - $routeHelper[] = "\tpublic static function get".$View."Route(\$id = 0, \$catid = 0)"; + $routeHelper[] = "\tpublic static function get" . $View . "Route(\$id = 0, \$catid = 0)"; } $routeHelper[] = "\t{"; $routeHelper[] = "\t\tif (\$id > 0)"; $routeHelper[] = "\t\t{"; - $routeHelper[] = "\t\t\t//".$this->setLine(__LINE__)." Initialize the needel array."; + $routeHelper[] = "\t\t\t//" . $this->setLine(__LINE__) . " Initialize the needel array."; $routeHelper[] = "\t\t\t\$needles = array("; - $routeHelper[] = "\t\t\t\t'".$viewName_single."' => array((int) \$id)"; + $routeHelper[] = "\t\t\t\t'" . $viewName_single . "' => array((int) \$id)"; $routeHelper[] = "\t\t\t);"; - $routeHelper[] = "\t\t\t//".$this->setLine(__LINE__)." Create the link"; - $routeHelper[] = "\t\t\t\$link = 'index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$viewName_single."&id='. \$id;"; + $routeHelper[] = "\t\t\t//" . $this->setLine(__LINE__) . " Create the link"; + $routeHelper[] = "\t\t\t\$link = 'index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_single . "&id='. \$id;"; $routeHelper[] = "\t\t}"; $routeHelper[] = "\t\telse"; $routeHelper[] = "\t\t{"; - $routeHelper[] = "\t\t\t//".$this->setLine(__LINE__)." Initialize the needel array."; + $routeHelper[] = "\t\t\t//" . $this->setLine(__LINE__) . " Initialize the needel array."; $routeHelper[] = "\t\t\t\$needles = array();"; - $routeHelper[] = "\t\t\t//".$this->setLine(__LINE__)."Create the link but don't add the id."; - $routeHelper[] = "\t\t\t\$link = 'index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$viewName_single."';"; - $routeHelper[] = "\t\t}"; + $routeHelper[] = "\t\t\t//" . $this->setLine(__LINE__) . "Create the link but don't add the id."; + $routeHelper[] = "\t\t\t\$link = 'index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_single . "';"; + $routeHelper[] = "\t\t}"; if ('category' != $viewName_single && 'categories' != $viewName_single) { $routeHelper[] = "\t\tif (\$catid > 1)"; $routeHelper[] = "\t\t{"; - $routeHelper[] = "\t\t\t\$categories = JCategories::getInstance('".$this->fileContentStatic['###component###'].".".$viewName_list."');"; + $routeHelper[] = "\t\t\t\$categories = JCategories::getInstance('" . $this->fileContentStatic['###component###'] . "." . $viewName_list . "');"; $routeHelper[] = "\t\t\t\$category = \$categories->get(\$catid);"; $routeHelper[] = "\t\t\tif (\$category)"; $routeHelper[] = "\t\t\t{"; @@ -4785,23 +4797,23 @@ class Interpretation extends Fields } if (isset($this->hasMenuGlobal[$viewName_single])) { - $routeHelper[] = PHP_EOL."\t\tif (\$item = self::_findItem(\$needles, '".$viewName_single."'))"; + $routeHelper[] = PHP_EOL . "\t\tif (\$item = self::_findItem(\$needles, '" . $viewName_single . "'))"; } else - { - $routeHelper[] = PHP_EOL."\t\tif (\$item = self::_findItem(\$needles))"; + { + $routeHelper[] = PHP_EOL . "\t\tif (\$item = self::_findItem(\$needles))"; } $routeHelper[] = "\t\t{"; $routeHelper[] = "\t\t\t\$link .= '&Itemid='.\$item;"; $routeHelper[] = "\t\t}"; - $routeHelper[] = PHP_EOL."\t\treturn \$link;"; + $routeHelper[] = PHP_EOL . "\t\treturn \$link;"; $routeHelper[] = "\t}"; - return implode(PHP_EOL,$routeHelper); + return implode(PHP_EOL, $routeHelper); } return ''; } - + public function routerParseSwitch(&$view, $viewArray = null, $aliasView = true, $idView = true) { $isCategory = ''; @@ -4823,16 +4835,13 @@ class Interpretation extends Fields { if ($get['as'] === 'a') { - if (isset($get['selection']) && ComponentbuilderHelper::checkArray($get['selection']) - && isset($get['selection']['select_gets']) - && ComponentbuilderHelper::checkArray($get['selection']['select_gets'])) + if (isset($get['selection']) && ComponentbuilderHelper::checkArray($get['selection']) && isset($get['selection']['select_gets']) && ComponentbuilderHelper::checkArray($get['selection']['select_gets'])) { if (isset($get['selection']['table'])) { - $viewTable = str_replace('#__'.$this->fileContentStatic['###component###'].'_', '', $get['selection']['table']); + $viewTable = str_replace('#__' . $this->fileContentStatic['###component###'] . '_', '', $get['selection']['table']); } } - } } } @@ -4842,9 +4851,9 @@ class Interpretation extends Fields { // build view route switch $routerSwitch = array(); - - $routerSwitch[] = PHP_EOL."\t\t\tcase '".$view."':"; - $routerSwitch[] = "\t\t\t\t\$vars['view'] = '".$view."';"; + + $routerSwitch[] = PHP_EOL . "\t\t\tcase '" . $view . "':"; + $routerSwitch[] = "\t\t\t\t\$vars['view'] = '" . $view . "';"; $routerSwitch[] = "\t\t\t\tif (is_numeric(\$segments[\$count-1]))"; $routerSwitch[] = "\t\t\t\t{"; $routerSwitch[] = "\t\t\t\t\t\$vars['id'] = (int) \$segments[\$count-1];"; @@ -4854,11 +4863,11 @@ class Interpretation extends Fields // we need to get from the table of this views main get the alias so we need the table name if ($viewTable) { - $routerSwitch[] = "\t\t\t\t\t\$id = \$this->getVar('".$viewTable."', \$segments[\$count-1], 'alias', 'id'".$isCategory.");"; + $routerSwitch[] = "\t\t\t\t\t\$id = \$this->getVar('" . $viewTable . "', \$segments[\$count-1], 'alias', 'id'" . $isCategory . ");"; } else { - $routerSwitch[] = "\t\t\t\t\t\$id = \$this->getVar('".$view."', \$segments[\$count-1], 'alias', 'id'".$isCategory.");"; + $routerSwitch[] = "\t\t\t\t\t\$id = \$this->getVar('" . $view . "', \$segments[\$count-1], 'alias', 'id'" . $isCategory . ");"; } $routerSwitch[] = "\t\t\t\t\tif(\$id)"; $routerSwitch[] = "\t\t\t\t\t{"; @@ -4867,59 +4876,59 @@ class Interpretation extends Fields $routerSwitch[] = "\t\t\t\t}"; $routerSwitch[] = "\t\t\t\tbreak;"; - return implode(PHP_EOL,$routerSwitch); + return implode(PHP_EOL, $routerSwitch); } elseif ($idView) { // build view route switch $routerSwitch = array(); - - $routerSwitch[] = PHP_EOL."\t\t\tcase '".$view."':"; - $routerSwitch[] = "\t\t\t\t\$vars['view'] = '".$view."';"; + + $routerSwitch[] = PHP_EOL . "\t\t\tcase '" . $view . "':"; + $routerSwitch[] = "\t\t\t\t\$vars['view'] = '" . $view . "';"; $routerSwitch[] = "\t\t\t\tif (is_numeric(\$segments[\$count-1]))"; $routerSwitch[] = "\t\t\t\t{"; $routerSwitch[] = "\t\t\t\t\t\$vars['id'] = (int) \$segments[\$count-1];"; $routerSwitch[] = "\t\t\t\t}"; $routerSwitch[] = "\t\t\t\tbreak;"; - return implode(PHP_EOL,$routerSwitch); + return implode(PHP_EOL, $routerSwitch); } else { // build view route switch $routerSwitch = array(); - - $routerSwitch[] = PHP_EOL."\t\t\tcase '".$view."':"; - $routerSwitch[] = "\t\t\t\t\$vars['view'] = '".$view."';"; + + $routerSwitch[] = PHP_EOL . "\t\t\tcase '" . $view . "':"; + $routerSwitch[] = "\t\t\t\t\$vars['view'] = '" . $view . "';"; $routerSwitch[] = "\t\t\t\tbreak;"; - return implode(PHP_EOL,$routerSwitch); + return implode(PHP_EOL, $routerSwitch); } return ''; } - + public function routerBuildViews(&$view) { if (isset($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']) && ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_BUILD_VIEWS###'])) { - return " || \$view === '".$view."'"; + return " || \$view === '" . $view . "'"; } else { - return "\$view === '".$view."'"; + return "\$view === '" . $view . "'"; } } public function setBatchMove($viewName_single) { // set needed defaults - $title = false; - $alias = false; - $category = false; - $batchmove = array(); - $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U'); + $title = false; + $alias = false; + $category = false; + $batchmove = array(); + $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U'); // component helper name - $Helper = $this->fileContentStatic['###Component###'].'Helper'; + $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) @@ -4930,22 +4939,22 @@ class Interpretation extends Fields // only load category if set in this view if (array_key_exists($viewName_single, $this->catCodeBuilder)) { - $category = $this->catCodeBuilder[$viewName_single]['code']; + $category = $this->catCodeBuilder[$viewName_single]['code']; } // only load alias if set in this view if (array_key_exists($viewName_single, $this->aliasBuilder)) { - $alias = $this->aliasBuilder[$viewName_single]; + $alias = $this->aliasBuilder[$viewName_single]; } // only load title if set in this view if (array_key_exists($viewName_single, $this->titleBuilder)) { - $title = $this->titleBuilder[$viewName_single]; + $title = $this->titleBuilder[$viewName_single]; } // prepare custom script - $customScript = $this->getCustomScriptBuilder('php_batchmove', $viewName_single, PHP_EOL.PHP_EOL, null, true); + $customScript = $this->getCustomScriptBuilder('php_batchmove', $viewName_single, PHP_EOL . PHP_EOL, null, true); - $batchmove[] = PHP_EOL."\t/**"; + $batchmove[] = PHP_EOL . "\t/**"; $batchmove[] = "\t * Batch move items to a new category"; $batchmove[] = "\t *"; $batchmove[] = "\t * @param integer \$value The new category ID."; @@ -4960,32 +4969,32 @@ class Interpretation extends Fields $batchmove[] = "\t{"; $batchmove[] = "\t\tif (empty(\$this->batchSet))"; $batchmove[] = "\t\t{"; - $batchmove[] = "\t\t\t//".$this->setLine(__LINE__)." Set some needed variables."; + $batchmove[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set some needed variables."; $batchmove[] = "\t\t\t\$this->user = JFactory::getUser();"; $batchmove[] = "\t\t\t\$this->table = \$this->getTable();"; $batchmove[] = "\t\t\t\$this->tableClassName = get_class(\$this->table);"; $batchmove[] = "\t\t\t\$this->contentType = new JUcmType;"; $batchmove[] = "\t\t\t\$this->type = \$this->contentType->getTypeByTable(\$this->tableClassName);"; - $batchmove[] = "\t\t\t\$this->canDo = ".$Helper."::getActions('".$viewName_single."');"; + $batchmove[] = "\t\t\t\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');"; $batchmove[] = "\t\t}"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) { - $batchmove[] = PHP_EOL."\t\tif (!\$this->canDo->get('".$core['core.edit']."') && !\$this->canDo->get('".$core['core.batch']."'))"; + $batchmove[] = PHP_EOL . "\t\tif (!\$this->canDo->get('" . $core['core.edit'] . "') && !\$this->canDo->get('" . $core['core.batch'] . "'))"; } else { - $batchmove[] = PHP_EOL."\t\tif (!\$this->canDo->get('core.edit') && !\$this->canDo->get('core.batch'))"; + $batchmove[] = PHP_EOL . "\t\tif (!\$this->canDo->get('core.edit') && !\$this->canDo->get('core.batch'))"; } $batchmove[] = "\t\t{"; $batchmove[] = "\t\t\t\$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; $batchmove[] = "\t\t\treturn false;"; - $batchmove[] = "\t\t}".$customScript; + $batchmove[] = "\t\t}" . $customScript; - $batchmove[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." make sure published only updates if user has the permission."; - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit.state']])) + $batchmove[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " make sure published only updates if user has the permission."; + if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $batchmove[] = "\t\tif (isset(\$values['published']) && !\$this->canDo->get('".$core['core.edit.state']."'))"; + $batchmove[] = "\t\tif (isset(\$values['published']) && !\$this->canDo->get('" . $core['core.edit.state'] . "'))"; } else { @@ -4995,33 +5004,33 @@ class Interpretation extends Fields $batchmove[] = "\t\t\tunset(\$values['published']);"; $batchmove[] = "\t\t}"; - $batchmove[] = "\t\t//".$this->setLine(__LINE__)." remove move_copy from array"; + $batchmove[] = "\t\t//" . $this->setLine(__LINE__) . " remove move_copy from array"; $batchmove[] = "\t\tunset(\$values['move_copy']);"; if ($category) { - $batchmove[] = PHP_EOL."\t\tif (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; + $batchmove[] = PHP_EOL . "\t\tif (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; $batchmove[] = "\t\t{"; $batchmove[] = "\t\t\treturn false;"; $batchmove[] = "\t\t}"; $batchmove[] = "\t\telseif (isset(\$values['category']) && (int) \$values['category'] > 0)"; $batchmove[] = "\t\t{"; - $batchmove[] = "\t\t\t//".$this->setLine(__LINE__)." move the category value to correct field name"; - $batchmove[] = "\t\t\t\$values['".$category."'] = \$values['category'];"; + $batchmove[] = "\t\t\t//" . $this->setLine(__LINE__) . " move the category value to correct field name"; + $batchmove[] = "\t\t\t\$values['" . $category . "'] = \$values['category'];"; $batchmove[] = "\t\t\tunset(\$values['category']);"; $batchmove[] = "\t\t}"; $batchmove[] = "\t\telseif (isset(\$values['category']))"; $batchmove[] = "\t\t{"; $batchmove[] = "\t\t\tunset(\$values['category']);"; - $batchmove[] = "\t\t}".PHP_EOL; + $batchmove[] = "\t\t}" . PHP_EOL; } - $batchmove[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Parent exists so we proceed"; + $batchmove[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Parent exists so we proceed"; $batchmove[] = "\t\tforeach (\$pks as \$pk)"; $batchmove[] = "\t\t{"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) { - $batchmove[] = "\t\t\tif (!\$this->user->authorise('".$core['core.edit']."', \$contexts[\$pk]))"; + $batchmove[] = "\t\t\tif (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; } else { @@ -5030,33 +5039,33 @@ class Interpretation extends Fields $batchmove[] = "\t\t\t{"; $batchmove[] = "\t\t\t\t\$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; - $batchmove[] = PHP_EOL."\t\t\t\treturn false;"; + $batchmove[] = PHP_EOL . "\t\t\t\treturn false;"; $batchmove[] = "\t\t\t}"; - $batchmove[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Check that the row actually exists"; + $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists"; $batchmove[] = "\t\t\tif (!\$this->table->load(\$pk))"; $batchmove[] = "\t\t\t{"; $batchmove[] = "\t\t\t\tif (\$error = \$this->table->getError())"; $batchmove[] = "\t\t\t\t{"; - $batchmove[] = "\t\t\t\t\t//".$this->setLine(__LINE__)." Fatal error"; + $batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fatal error"; $batchmove[] = "\t\t\t\t\t\$this->setError(\$error);"; - $batchmove[] = PHP_EOL."\t\t\t\t\treturn false;"; + $batchmove[] = PHP_EOL . "\t\t\t\t\treturn false;"; $batchmove[] = "\t\t\t\t}"; $batchmove[] = "\t\t\t\telse"; $batchmove[] = "\t\t\t\t{"; - $batchmove[] = "\t\t\t\t\t//".$this->setLine(__LINE__)." Not fatal error"; + $batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error"; $batchmove[] = "\t\t\t\t\t\$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; $batchmove[] = "\t\t\t\t\tcontinue;"; $batchmove[] = "\t\t\t\t}"; $batchmove[] = "\t\t\t}"; - $batchmove[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." insert all set values."; - $batchmove[] = "\t\t\tif (".$Helper."::checkArray(\$values))"; + $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " insert all set values."; + $batchmove[] = "\t\t\tif (" . $Helper . "::checkArray(\$values))"; $batchmove[] = "\t\t\t{"; $batchmove[] = "\t\t\t\tforeach (\$values as \$key => \$value)"; $batchmove[] = "\t\t\t\t{"; - $batchmove[] = "\t\t\t\t\t//".$this->setLine(__LINE__)." Do special action for access."; + $batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Do special action for access."; $batchmove[] = "\t\t\t\t\tif ('access' === \$key && strlen(\$value) > 0)"; $batchmove[] = "\t\t\t\t\t{"; $batchmove[] = "\t\t\t\t\t\t\$this->table->\$key = \$value;"; @@ -5066,49 +5075,49 @@ class Interpretation extends Fields $batchmove[] = "\t\t\t\t\t\t\$this->table->\$key = \$value;"; $batchmove[] = "\t\t\t\t\t}"; $batchmove[] = "\t\t\t\t}"; - $batchmove[] = "\t\t\t}".PHP_EOL; + $batchmove[] = "\t\t\t}" . PHP_EOL; - $batchmove[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Check the row."; + $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check the row."; $batchmove[] = "\t\t\tif (!\$this->table->check())"; $batchmove[] = "\t\t\t{"; $batchmove[] = "\t\t\t\t\$this->setError(\$this->table->getError());"; - $batchmove[] = PHP_EOL."\t\t\t\treturn false;"; + $batchmove[] = PHP_EOL . "\t\t\t\treturn false;"; $batchmove[] = "\t\t\t}"; - $batchmove[] = PHP_EOL."\t\t\tif (!empty(\$this->type))"; + $batchmove[] = PHP_EOL . "\t\t\tif (!empty(\$this->type))"; $batchmove[] = "\t\t\t{"; $batchmove[] = "\t\t\t\t\$this->createTagsHelper(\$this->tagsObserver, \$this->type, \$pk, \$this->typeAlias, \$this->table);"; $batchmove[] = "\t\t\t}"; - $batchmove[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Store the row."; + $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Store the row."; $batchmove[] = "\t\t\tif (!\$this->table->store())"; $batchmove[] = "\t\t\t{"; $batchmove[] = "\t\t\t\t\$this->setError(\$this->table->getError());"; - $batchmove[] = PHP_EOL."\t\t\t\treturn false;"; + $batchmove[] = PHP_EOL . "\t\t\t\treturn false;"; $batchmove[] = "\t\t\t}"; $batchmove[] = "\t\t}"; - $batchmove[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Clean the cache"; + $batchmove[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Clean the cache"; $batchmove[] = "\t\t\$this->cleanCache();"; - $batchmove[] = PHP_EOL."\t\treturn true;"; + $batchmove[] = PHP_EOL . "\t\treturn true;"; $batchmove[] = "\t}"; - return PHP_EOL.implode(PHP_EOL,$batchmove); + return PHP_EOL . implode(PHP_EOL, $batchmove); } public function setBatchCopy($viewName_single) { // set needed defaults - $title = false; - $alias = false; - $category = false; - $batchcopy = array(); - $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U'); + $title = false; + $alias = false; + $category = false; + $batchcopy = array(); + $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U'); // component helper name - $Helper = $this->fileContentStatic['###Component###'].'Helper'; + $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) @@ -5133,9 +5142,9 @@ class Interpretation extends Fields $title = $this->titleBuilder[$viewName_single]; } // prepare custom script - $customScript = $this->getCustomScriptBuilder('php_batchcopy', $viewName_single, PHP_EOL.PHP_EOL, null, true); + $customScript = $this->getCustomScriptBuilder('php_batchcopy', $viewName_single, PHP_EOL . PHP_EOL, null, true); - $batchcopy[] = PHP_EOL."\t/**"; + $batchcopy[] = PHP_EOL . "\t/**"; $batchcopy[] = "\t * Batch copy items to a new category or current."; $batchcopy[] = "\t *"; $batchcopy[] = "\t * @param integer \$values The new values."; @@ -5151,39 +5160,39 @@ class Interpretation extends Fields $batchcopy[] = "\t\tif (empty(\$this->batchSet))"; $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\t//".$this->setLine(__LINE__)." Set some needed variables."; + $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set some needed variables."; $batchcopy[] = "\t\t\t\$this->user = JFactory::getUser();"; $batchcopy[] = "\t\t\t\$this->table = \$this->getTable();"; $batchcopy[] = "\t\t\t\$this->tableClassName = get_class(\$this->table);"; $batchcopy[] = "\t\t\t\$this->contentType = new JUcmType;"; $batchcopy[] = "\t\t\t\$this->type = \$this->contentType->getTypeByTable(\$this->tableClassName);"; - $batchcopy[] = "\t\t\t\$this->canDo = ".$Helper."::getActions('".$viewName_single."');"; + $batchcopy[] = "\t\t\t\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');"; $batchcopy[] = "\t\t}"; - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) { - $batchcopy[] = PHP_EOL."\t\tif (!\$this->canDo->get('".$core['core.create']."') && !\$this->canDo->get('".$core['core.batch']."'))"; + $batchcopy[] = PHP_EOL . "\t\tif (!\$this->canDo->get('" . $core['core.create'] . "') && !\$this->canDo->get('" . $core['core.batch'] . "'))"; } else { - $batchcopy[] = PHP_EOL."\t\tif (!\$this->canDo->get('core.create') || !\$this->canDo->get('core.batch'))"; + $batchcopy[] = PHP_EOL . "\t\tif (!\$this->canDo->get('core.create') || !\$this->canDo->get('core.batch'))"; } $batchcopy[] = "\t\t{"; $batchcopy[] = "\t\t\treturn false;"; - $batchcopy[] = "\t\t}".$customScript; + $batchcopy[] = "\t\t}" . $customScript; - $batchcopy[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." get list of uniqe fields"; + $batchcopy[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get list of uniqe fields"; $batchcopy[] = "\t\t\$uniqeFields = \$this->getUniqeFields();"; - $batchcopy[] = "\t\t//".$this->setLine(__LINE__)." remove move_copy from array"; + $batchcopy[] = "\t\t//" . $this->setLine(__LINE__) . " remove move_copy from array"; $batchcopy[] = "\t\tunset(\$values['move_copy']);"; - $batchcopy[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." make sure published is set"; + $batchcopy[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " make sure published is set"; $batchcopy[] = "\t\tif (!isset(\$values['published']))"; $batchcopy[] = "\t\t{"; $batchcopy[] = "\t\t\t\$values['published'] = 0;"; $batchcopy[] = "\t\t}"; - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $batchcopy[] = "\t\telseif (isset(\$values['published']) && !\$this->canDo->get('".$core['core.edit.state']."'))"; + $batchcopy[] = "\t\telseif (isset(\$values['published']) && !\$this->canDo->get('" . $core['core.edit.state'] . "'))"; } else { @@ -5195,14 +5204,14 @@ class Interpretation extends Fields if ($category) { - $batchcopy[] = PHP_EOL."\t\tif (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; + $batchcopy[] = PHP_EOL . "\t\tif (isset(\$values['category']) && (int) \$values['category'] > 0 && !static::checkCategoryId(\$values['category']))"; $batchcopy[] = "\t\t{"; $batchcopy[] = "\t\t\treturn false;"; $batchcopy[] = "\t\t}"; $batchcopy[] = "\t\telseif (isset(\$values['category']) && (int) \$values['category'] > 0)"; $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\t//".$this->setLine(__LINE__)." move the category value to correct field name"; - $batchcopy[] = "\t\t\t\$values['".$category."'] = \$values['category'];"; + $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " move the category value to correct field name"; + $batchcopy[] = "\t\t\t\$values['" . $category . "'] = \$values['category'];"; $batchcopy[] = "\t\t\tunset(\$values['category']);"; $batchcopy[] = "\t\t}"; $batchcopy[] = "\t\telseif (isset(\$values['category']))"; @@ -5211,81 +5220,81 @@ class Interpretation extends Fields $batchcopy[] = "\t\t}"; } - $batchcopy[] = PHP_EOL."\t\t\$newIds = array();"; + $batchcopy[] = PHP_EOL . "\t\t\$newIds = array();"; - $batchcopy[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Parent exists so let's proceed"; + $batchcopy[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Parent exists so let's proceed"; $batchcopy[] = "\t\twhile (!empty(\$pks))"; $batchcopy[] = "\t\t{"; - $batchcopy[] = "\t\t\t//".$this->setLine(__LINE__)." Pop the first ID off the stack"; + $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " Pop the first ID off the stack"; $batchcopy[] = "\t\t\t\$pk = array_shift(\$pks);"; - $batchcopy[] = PHP_EOL."\t\t\t\$this->table->reset();"; + $batchcopy[] = PHP_EOL . "\t\t\t\$this->table->reset();"; - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." only allow copy if user may edit this item."; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit']])) + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " only allow copy if user may edit this item."; + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) { - $batchcopy[] = PHP_EOL."\t\t\tif (!\$this->user->authorise('".$core['core.edit']."', \$contexts[\$pk]))"; + $batchcopy[] = PHP_EOL . "\t\t\tif (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; } else { - $batchcopy[] = PHP_EOL."\t\t\tif (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; + $batchcopy[] = PHP_EOL . "\t\t\tif (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; } - $batchcopy[] = PHP_EOL."\t\t\t{"; - $batchcopy[] = PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Not fatal error"; - $batchcopy[] = PHP_EOL."\t\t\t\t\$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; - $batchcopy[] = PHP_EOL."\t\t\t\tcontinue;"; - $batchcopy[] = PHP_EOL."\t\t\t}"; + $batchcopy[] = PHP_EOL . "\t\t\t{"; + $batchcopy[] = PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error"; + $batchcopy[] = PHP_EOL . "\t\t\t\t\$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; + $batchcopy[] = PHP_EOL . "\t\t\t\tcontinue;"; + $batchcopy[] = PHP_EOL . "\t\t\t}"; - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Check that the row actually exists"; + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists"; $batchcopy[] = "\t\t\tif (!\$this->table->load(\$pk))"; $batchcopy[] = "\t\t\t{"; $batchcopy[] = "\t\t\t\tif (\$error = \$this->table->getError())"; $batchcopy[] = "\t\t\t\t{"; - $batchcopy[] = "\t\t\t\t\t//".$this->setLine(__LINE__)." Fatal error"; + $batchcopy[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fatal error"; $batchcopy[] = "\t\t\t\t\t\$this->setError(\$error);"; - $batchcopy[] = PHP_EOL."\t\t\t\t\treturn false;"; + $batchcopy[] = PHP_EOL . "\t\t\t\t\treturn false;"; $batchcopy[] = "\t\t\t\t}"; $batchcopy[] = "\t\t\t\telse"; $batchcopy[] = "\t\t\t\t{"; - $batchcopy[] = "\t\t\t\t\t//".$this->setLine(__LINE__)." Not fatal error"; + $batchcopy[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error"; $batchcopy[] = "\t\t\t\t\t\$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; $batchcopy[] = "\t\t\t\t\tcontinue;"; $batchcopy[] = "\t\t\t\t}"; $batchcopy[] = "\t\t\t}"; if ($category && $alias === 'alias' && $title === 'title') { - $batchcopy[] = PHP_EOL."\t\t\tif (isset(\$values['".$category."']))"; + $batchcopy[] = PHP_EOL . "\t\t\tif (isset(\$values['" . $category . "']))"; $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tstatic::generateTitle((int) \$values['".$category."'], \$this->table);"; + $batchcopy[] = "\t\t\t\tstatic::generateTitle((int) \$values['" . $category . "'], \$this->table);"; $batchcopy[] = "\t\t\t}"; $batchcopy[] = "\t\t\telse"; $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tstatic::generateTitle((int) \$this->table->".$category.", \$this->table);"; + $batchcopy[] = "\t\t\t\tstatic::generateTitle((int) \$this->table->" . $category . ", \$this->table);"; $batchcopy[] = "\t\t\t}"; } elseif ($category && $alias && $title) { - $batchcopy[] = PHP_EOL."\t\t\tif (isset(\$values['".$category."']))"; + $batchcopy[] = PHP_EOL . "\t\t\tif (isset(\$values['" . $category . "']))"; $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tlist(\$this->table->".$title.", \$this->table->".$alias.") = \$this->generateNewTitle(\$values['".$category."'], \$this->table->".$alias.", \$this->table->".$title.");"; + $batchcopy[] = "\t\t\t\tlist(\$this->table->" . $title . ", \$this->table->" . $alias . ") = \$this->generateNewTitle(\$values['" . $category . "'], \$this->table->" . $alias . ", \$this->table->" . $title . ");"; $batchcopy[] = "\t\t\t}"; $batchcopy[] = "\t\t\telse"; $batchcopy[] = "\t\t\t{"; - $batchcopy[] = "\t\t\t\tlist(\$this->table->".$title.", \$this->table->".$alias.") = \$this->generateNewTitle(\$this->table->".$category.", \$this->table->".$alias.", \$this->table->".$title.");"; + $batchcopy[] = "\t\t\t\tlist(\$this->table->" . $title . ", \$this->table->" . $alias . ") = \$this->generateNewTitle(\$this->table->" . $category . ", \$this->table->" . $alias . ", \$this->table->" . $title . ");"; $batchcopy[] = "\t\t\t}"; } elseif (!$category && $alias && $title) { - $batchcopy[] = PHP_EOL."\t\t\tlist(\$this->table->".$title.", \$this->table->".$alias.") = \$this->_generateNewTitle(\$this->table->".$alias.", \$this->table->".$title.");"; + $batchcopy[] = PHP_EOL . "\t\t\tlist(\$this->table->" . $title . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias . ", \$this->table->" . $title . ");"; } elseif (!$category && !$alias && $title && $title != 'user' && $title != 'jobnumber') // TODO [jobnumber] just for one project (not ideal) { - $batchcopy[] = PHP_EOL."\t\t\t\$this->table->".$title." = \$this->generateUniqe('".$title."',\$this->table->".$title.");"; + $batchcopy[] = PHP_EOL . "\t\t\t\$this->table->" . $title . " = \$this->generateUniqe('" . $title . "',\$this->table->" . $title . ");"; } - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." insert all set values"; - $batchcopy[] = "\t\t\tif (".$Helper."::checkArray(\$values))"; + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " insert all set values"; + $batchcopy[] = "\t\t\tif (" . $Helper . "::checkArray(\$values))"; $batchcopy[] = "\t\t\t{"; $batchcopy[] = "\t\t\t\tforeach (\$values as \$key => \$value)"; $batchcopy[] = "\t\t\t\t{"; @@ -5294,10 +5303,10 @@ class Interpretation extends Fields $batchcopy[] = "\t\t\t\t\t\t\$this->table->\$key = \$value;"; $batchcopy[] = "\t\t\t\t\t}"; $batchcopy[] = "\t\t\t\t}"; - $batchcopy[] = "\t\t\t}".PHP_EOL; + $batchcopy[] = "\t\t\t}" . PHP_EOL; - $batchcopy[] = "\t\t\t//".$this->setLine(__LINE__)." update all uniqe fields"; - $batchcopy[] = "\t\t\tif (".$Helper."::checkArray(\$uniqeFields))"; + $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " update all uniqe fields"; + $batchcopy[] = "\t\t\tif (" . $Helper . "::checkArray(\$uniqeFields))"; $batchcopy[] = "\t\t\t{"; $batchcopy[] = "\t\t\t\tforeach (\$uniqeFields as \$uniqeField)"; $batchcopy[] = "\t\t\t\t{"; @@ -5305,47 +5314,47 @@ class Interpretation extends Fields $batchcopy[] = "\t\t\t\t}"; $batchcopy[] = "\t\t\t}"; - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Reset the ID because we are making a copy"; + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Reset the ID because we are making a copy"; $batchcopy[] = "\t\t\t\$this->table->id = 0;"; - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." TODO: Deal with ordering?"; - $batchcopy[] = "\t\t\t//".$this->setLine(__LINE__)." \$this->table->ordering\t= 1;"; + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " TODO: Deal with ordering?"; + $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " \$this->table->ordering\t= 1;"; - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Check the row."; + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check the row."; $batchcopy[] = "\t\t\tif (!\$this->table->check())"; $batchcopy[] = "\t\t\t{"; $batchcopy[] = "\t\t\t\t\$this->setError(\$this->table->getError());"; - $batchcopy[] = PHP_EOL."\t\t\t\treturn false;"; + $batchcopy[] = PHP_EOL . "\t\t\t\treturn false;"; $batchcopy[] = "\t\t\t}"; - $batchcopy[] = PHP_EOL."\t\t\tif (!empty(\$this->type))"; + $batchcopy[] = PHP_EOL . "\t\t\tif (!empty(\$this->type))"; $batchcopy[] = "\t\t\t{"; $batchcopy[] = "\t\t\t\t\$this->createTagsHelper(\$this->tagsObserver, \$this->type, \$pk, \$this->typeAlias, \$this->table);"; $batchcopy[] = "\t\t\t}"; - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Store the row."; + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Store the row."; $batchcopy[] = "\t\t\tif (!\$this->table->store())"; $batchcopy[] = "\t\t\t{"; $batchcopy[] = "\t\t\t\t\$this->setError(\$this->table->getError());"; - $batchcopy[] = PHP_EOL."\t\t\t\treturn false;"; + $batchcopy[] = PHP_EOL . "\t\t\t\treturn false;"; $batchcopy[] = "\t\t\t}"; - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Get the new item ID"; + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the new item ID"; $batchcopy[] = "\t\t\t\$newId = \$this->table->get('id');"; - $batchcopy[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Add the new ID to the array"; + $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Add the new ID to the array"; $batchcopy[] = "\t\t\t\$newIds[\$pk] = \$newId;"; $batchcopy[] = "\t\t}"; - $batchcopy[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Clean the cache"; + $batchcopy[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Clean the cache"; $batchcopy[] = "\t\t\$this->cleanCache();"; - $batchcopy[] = PHP_EOL."\t\treturn \$newIds;"; + $batchcopy[] = PHP_EOL . "\t\treturn \$newIds;"; $batchcopy[] = "\t}"; - return PHP_EOL.implode(PHP_EOL,$batchcopy); + return PHP_EOL . implode(PHP_EOL, $batchcopy); } public function setAliasTitleFix($viewName_single) @@ -5355,75 +5364,75 @@ class Interpretation extends Fields if (array_key_exists($viewName_single, $this->aliasBuilder) && array_key_exists($viewName_single, $this->titleBuilder)) { // set needed defaults - $setCategory = false; - $alias = $this->aliasBuilder[$viewName_single]; - $title = $this->titleBuilder[$viewName_single]; - $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U'); + $setCategory = false; + $alias = $this->aliasBuilder[$viewName_single]; + $title = $this->titleBuilder[$viewName_single]; + $VIEW = ComponentbuilderHelper::safeString($viewName_single, 'U'); if (array_key_exists($viewName_single, $this->catCodeBuilder)) { - $category = $this->catCodeBuilder[$viewName_single]['code']; - $setCategory = true; + $category = $this->catCodeBuilder[$viewName_single]['code']; + $setCategory = true; } // start building the fix - $fixUniqe[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Alter the ".$title." for save as copy"; + $fixUniqe[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Alter the " . $title . " for save as copy"; $fixUniqe[] = "\t\tif (\$input->get('task') === 'save2copy')"; $fixUniqe[] = "\t\t{"; $fixUniqe[] = "\t\t\t\$origTable = clone \$this->getTable();"; $fixUniqe[] = "\t\t\t\$origTable->load(\$input->getInt('id'));"; - $fixUniqe[] = PHP_EOL."\t\t\tif (\$data['".$title."'] == \$origTable->".$title.")"; + $fixUniqe[] = PHP_EOL . "\t\t\tif (\$data['" . $title . "'] == \$origTable->" . $title . ")"; $fixUniqe[] = "\t\t\t{"; if ($setCategory) { - $fixUniqe[] = "\t\t\t\tlist(\$".$title.", \$".$alias.") = \$this->generateNewTitle(\$data['".$category."'], \$data['".$alias."'], \$data['".$title."']);"; + $fixUniqe[] = "\t\t\t\tlist(\$" . $title . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], \$data['" . $title . "']);"; } else { - $fixUniqe[] = "\t\t\t\tlist(\$".$title.", \$".$alias.") = \$this->_generateNewTitle(\$data['".$alias."'], \$data['".$title."']);"; + $fixUniqe[] = "\t\t\t\tlist(\$" . $title . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" . $alias . "'], \$data['" . $title . "']);"; } - $fixUniqe[] = "\t\t\t\t\$data['".$title."'] = \$".$title.";"; - $fixUniqe[] = "\t\t\t\t\$data['".$alias."'] = \$".$alias.";"; + $fixUniqe[] = "\t\t\t\t\$data['" . $title . "'] = \$" . $title . ";"; + $fixUniqe[] = "\t\t\t\t\$data['" . $alias . "'] = \$" . $alias . ";"; $fixUniqe[] = "\t\t\t}"; $fixUniqe[] = "\t\t\telse"; $fixUniqe[] = "\t\t\t{"; - $fixUniqe[] = "\t\t\t\tif (\$data['".$alias."'] == \$origTable->".$alias.")"; + $fixUniqe[] = "\t\t\t\tif (\$data['" . $alias . "'] == \$origTable->" . $alias . ")"; $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$data['".$alias."'] = '';"; + $fixUniqe[] = "\t\t\t\t\t\$data['" . $alias . "'] = '';"; $fixUniqe[] = "\t\t\t\t}"; $fixUniqe[] = "\t\t\t}"; - $fixUniqe[] = PHP_EOL."\t\t\t\$data['published'] = 0;"; + $fixUniqe[] = PHP_EOL . "\t\t\t\$data['published'] = 0;"; $fixUniqe[] = "\t\t}"; - $fixUniqe[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Automatic handling of ".$alias." for empty fields"; + $fixUniqe[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Automatic handling of " . $alias . " for empty fields"; $fixUniqe[] = "\t\tif (in_array(\$input->get('task'), array('apply', 'save', 'save2new')) && (int) \$input->get('id') == 0)"; $fixUniqe[] = "\t\t{"; - $fixUniqe[] = "\t\t\tif (\$data['".$alias."'] == null)"; + $fixUniqe[] = "\t\t\tif (\$data['" . $alias . "'] == null)"; $fixUniqe[] = "\t\t\t{"; $fixUniqe[] = "\t\t\t\tif (JFactory::getConfig()->get('unicodeslugs') == 1)"; $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$data['".$alias."'] = JFilterOutput::stringURLUnicodeSlug(\$data['".$title."']);"; + $fixUniqe[] = "\t\t\t\t\t\$data['" . $alias . "'] = JFilterOutput::stringURLUnicodeSlug(\$data['" . $title . "']);"; $fixUniqe[] = "\t\t\t\t}"; $fixUniqe[] = "\t\t\t\telse"; $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$data['".$alias."'] = JFilterOutput::stringURLSafe(\$data['".$title."']);"; + $fixUniqe[] = "\t\t\t\t\t\$data['" . $alias . "'] = JFilterOutput::stringURLSafe(\$data['" . $title . "']);"; $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = PHP_EOL."\t\t\t\t\$table = JTable::getInstance('".$viewName_single."', '".$this->fileContentStatic['###component###']."Table');"; + $fixUniqe[] = PHP_EOL . "\t\t\t\t\$table = JTable::getInstance('" . $viewName_single . "', '" . $this->fileContentStatic['###component###'] . "Table');"; if ($setCategory) { - $fixUniqe[] = PHP_EOL."\t\t\t\tif (\$table->load(array('".$alias."' => \$data['".$alias."'], '".$category."' => \$data['".$category."'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; + $fixUniqe[] = PHP_EOL . "\t\t\t\tif (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'], '" . $category . "' => \$data['" . $category . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$msg = JText::_('COM_".$this->fileContentStatic['###COMPONENT###']."_".$VIEW."_SAVE_WARNING');"; + $fixUniqe[] = "\t\t\t\t\t\$msg = JText::_('COM_" . $this->fileContentStatic['###COMPONENT###'] . "_" . $VIEW . "_SAVE_WARNING');"; $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = PHP_EOL."\t\t\t\tlist(\$".$title.", \$".$alias.") = \$this->generateNewTitle(\$data['".$category."'], \$data['".$alias."'], \$data['".$title."']);"; + $fixUniqe[] = PHP_EOL . "\t\t\t\tlist(\$" . $title . ", \$" . $alias . ") = \$this->generateNewTitle(\$data['" . $category . "'], \$data['" . $alias . "'], \$data['" . $title . "']);"; } else { - $fixUniqe[] = PHP_EOL."\t\t\t\tif (\$table->load(array('".$alias."' => \$data['".$alias."'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; + $fixUniqe[] = PHP_EOL . "\t\t\t\tif (\$table->load(array('" . $alias . "' => \$data['" . $alias . "'])) && (\$table->id != \$data['id'] || \$data['id'] == 0))"; $fixUniqe[] = "\t\t\t\t{"; - $fixUniqe[] = "\t\t\t\t\t\$msg = JText::_('COM_".$this->fileContentStatic['###COMPONENT###']."_".$VIEW."_SAVE_WARNING');"; + $fixUniqe[] = "\t\t\t\t\t\$msg = JText::_('COM_" . $this->fileContentStatic['###COMPONENT###'] . "_" . $VIEW . "_SAVE_WARNING');"; $fixUniqe[] = "\t\t\t\t}"; - $fixUniqe[] = PHP_EOL."\t\t\t\tlist(\$".$title.", \$".$alias.") = \$this->_generateNewTitle(\$data['".$alias."'], \$data['".$title."']);"; + $fixUniqe[] = PHP_EOL . "\t\t\t\tlist(\$" . $title . ", \$" . $alias . ") = \$this->_generateNewTitle(\$data['" . $alias . "'], \$data['" . $title . "']);"; } - $fixUniqe[] = "\t\t\t\t\$data['".$alias."'] = \$".$alias.";"; - $fixUniqe[] = PHP_EOL."\t\t\t\tif (isset(\$msg))"; + $fixUniqe[] = "\t\t\t\t\$data['" . $alias . "'] = \$" . $alias . ";"; + $fixUniqe[] = PHP_EOL . "\t\t\t\tif (isset(\$msg))"; $fixUniqe[] = "\t\t\t\t{"; $fixUniqe[] = "\t\t\t\t\tJFactory::getApplication()->enqueueMessage(\$msg, 'warning');"; $fixUniqe[] = "\t\t\t\t}"; @@ -5431,12 +5440,12 @@ class Interpretation extends Fields $fixUniqe[] = "\t\t}"; } // handel other uniqe fields - $fixUniqe[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Alter the uniqe field for save as copy"; + $fixUniqe[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Alter the uniqe field for save as copy"; $fixUniqe[] = "\t\tif (\$input->get('task') === 'save2copy')"; $fixUniqe[] = "\t\t{"; - $fixUniqe[] = "\t\t\t//".$this->setLine(__LINE__)." Automatic handling of other uniqe fields"; + $fixUniqe[] = "\t\t\t//" . $this->setLine(__LINE__) . " Automatic handling of other uniqe fields"; $fixUniqe[] = "\t\t\t\$uniqeFields = \$this->getUniqeFields();"; - $fixUniqe[] = "\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$uniqeFields))"; + $fixUniqe[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$uniqeFields))"; $fixUniqe[] = "\t\t\t{"; $fixUniqe[] = "\t\t\t\tforeach (\$uniqeFields as \$uniqeField)"; $fixUniqe[] = "\t\t\t\t{"; @@ -5445,7 +5454,7 @@ class Interpretation extends Fields $fixUniqe[] = "\t\t\t}"; $fixUniqe[] = "\t\t}"; - return PHP_EOL.implode(PHP_EOL,$fixUniqe); + return PHP_EOL . implode(PHP_EOL, $fixUniqe); } public function setGenerateNewTitle($viewName_single) @@ -5454,50 +5463,50 @@ class Interpretation extends Fields if (array_key_exists($viewName_single, $this->aliasBuilder) && array_key_exists($viewName_single, $this->titleBuilder)) { $newFunction = array(); - $newFunction[] = PHP_EOL.PHP_EOL."\t/**"; + $newFunction[] = PHP_EOL . PHP_EOL . "\t/**"; $newFunction[] = "\t* Method to change the title & alias."; $newFunction[] = "\t*"; $newFunction[] = "\t* @param string \$alias The alias."; $newFunction[] = "\t* @param string \$title The title."; - $newFunction[] = "\t*"; - $newFunction[] = "\t* @return array Contains the modified title and alias."; - $newFunction[] = "\t*"; + $newFunction[] = "\t*"; + $newFunction[] = "\t* @return array Contains the modified title and alias."; + $newFunction[] = "\t*"; $newFunction[] = "\t*/"; $newFunction[] = "\tprotected function _generateNewTitle(\$alias, \$title)"; $newFunction[] = "\t{"; - $newFunction[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Alter the title & alias"; + $newFunction[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Alter the title & alias"; $newFunction[] = "\t\t\$table = \$this->getTable();"; - $newFunction[] = PHP_EOL."\t\twhile (\$table->load(array('alias' => \$alias)))"; + $newFunction[] = PHP_EOL . "\t\twhile (\$table->load(array('alias' => \$alias)))"; $newFunction[] = "\t\t{"; $newFunction[] = "\t\t\t\$title = JString::increment(\$title);"; $newFunction[] = "\t\t\t\$alias = JString::increment(\$alias, 'dash');"; $newFunction[] = "\t\t}"; - $newFunction[] = PHP_EOL."\t\treturn array(\$title, \$alias);"; + $newFunction[] = PHP_EOL . "\t\treturn array(\$title, \$alias);"; $newFunction[] = "\t}"; - return implode(PHP_EOL,$newFunction); + return implode(PHP_EOL, $newFunction); } elseif (array_key_exists($viewName_single, $this->titleBuilder)) { $newFunction = array(); - $newFunction[] = PHP_EOL.PHP_EOL."\t/**"; + $newFunction[] = PHP_EOL . PHP_EOL . "\t/**"; $newFunction[] = "\t* Method to change the title & alias."; $newFunction[] = "\t*"; $newFunction[] = "\t* @param string \$title The title."; - $newFunction[] = "\t*"; - $newFunction[] = "\t* @return array Contains the modified title and alias."; - $newFunction[] = "\t*"; + $newFunction[] = "\t*"; + $newFunction[] = "\t* @return array Contains the modified title and alias."; + $newFunction[] = "\t*"; $newFunction[] = "\t*/"; $newFunction[] = "\tprotected function _generateNewTitle(\$title)"; $newFunction[] = "\t{"; - $newFunction[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Alter the title"; + $newFunction[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Alter the title"; $newFunction[] = "\t\t\$table = \$this->getTable();"; - $newFunction[] = PHP_EOL."\t\twhile (\$table->load(array('title' => \$title)))"; + $newFunction[] = PHP_EOL . "\t\twhile (\$table->load(array('title' => \$title)))"; $newFunction[] = "\t\t{"; $newFunction[] = "\t\t\t\$title = JString::increment(\$title);"; $newFunction[] = "\t\t}"; - $newFunction[] = PHP_EOL."\t\treturn \$title;"; + $newFunction[] = PHP_EOL . "\t\treturn \$title;"; $newFunction[] = "\t}"; - return implode(PHP_EOL,$newFunction); + return implode(PHP_EOL, $newFunction); } return ''; } @@ -5514,31 +5523,30 @@ class Interpretation extends Fields foreach ($this->queryBuilder as $view => $fields) { // build the uninstall array - $this->uninstallBuilder[] = "DROP TABLE IF EXISTS `#__".$component."_".$view."`;"; + $this->uninstallBuilder[] = "DROP TABLE IF EXISTS `#__" . $component . "_" . $view . "`;"; // setup the table DB string $db_ = ''; - $db_ .= "CREATE TABLE IF NOT EXISTS `#__".$component."_".$view."` ("; + $db_ .= "CREATE TABLE IF NOT EXISTS `#__" . $component . "_" . $view . "` ("; // check if the table name has changed if (isset($this->updateSQL['table_name']) && isset($this->updateSQL['table_name'][$view])) { $old_table_name = $this->updateSQL['table_name'][$view]['old']; - $this->updateSQLBuilder["RENAMETABLE`#__".$component."_".$old_table_name."`"] - = "RENAME TABLE `#__".$component."_".$old_table_name."` to `#__".$component."_".$view."`;"; + $this->updateSQLBuilder["RENAMETABLE`#__" . $component . "_" . $old_table_name . "`"] = "RENAME TABLE `#__" . $component . "_" . $old_table_name . "` to `#__" . $component . "_" . $view . "`;"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['id'])) { - $db_ .= PHP_EOL."\t`id` INT(11) NOT NULL AUTO_INCREMENT,"; + $db_ .= PHP_EOL . "\t`id` INT(11) NOT NULL AUTO_INCREMENT,"; } - $db_ .= PHP_EOL."\t`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',"; + $db_ .= PHP_EOL . "\t`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',"; ksort($fields); $last_name = 'asset_id'; foreach ($fields as $field => $data) { // set default $default = $data['default']; - if ( $default === 'Other' ) + if ($default === 'Other') { $default = $data['other']; } @@ -5548,17 +5556,17 @@ class Interpretation extends Fields } elseif ($default === 'DATETIME' || $default === 'CURRENT_TIMESTAMP') { - $default = $default.' '.$data['null_switch']; + $default = $default . ' ' . $data['null_switch']; } elseif ($default == 0 || $default) { if (is_numeric($default)) { - $default = $data['null_switch']." DEFAULT ".$default; + $default = $data['null_switch'] . " DEFAULT " . $default; } else { - $default = $data['null_switch']." DEFAULT '".$default."'"; + $default = $data['null_switch'] . " DEFAULT '" . $default . "'"; } } elseif ($data['null_switch'] === 'NULL') @@ -5567,27 +5575,24 @@ class Interpretation extends Fields } else { - $default = $data['null_switch']." DEFAULT ''"; + $default = $data['null_switch'] . " DEFAULT ''"; } // set the lenght $lenght = ''; if (isset($data['lenght']) && $data['lenght'] === 'Other' && isset($data['lenght_other']) && $data['lenght_other'] > 0) { - $lenght = '('.$data['lenght_other'].')'; + $lenght = '(' . $data['lenght_other'] . ')'; } elseif (isset($data['lenght']) && $data['lenght'] > 0) { - $lenght = '('.$data['lenght'].')'; + $lenght = '(' . $data['lenght'] . ')'; } // set the field to db - $db_ .= PHP_EOL."\t`".$field."` ".$data['type'].$lenght." ".$default.","; + $db_ .= PHP_EOL . "\t`" . $field . "` " . $data['type'] . $lenght . " " . $default . ","; // check if this a new field that should be added via SQL update - if (isset($this->addSQL['field']) && isset($this->addSQL['field'][$view]) - && ComponentbuilderHelper::checkArray($this->addSQL['field'][$view]) - && in_array($data['ID'], $this->addSQL['field'][$view])) + if (isset($this->addSQL['field']) && isset($this->addSQL['field'][$view]) && ComponentbuilderHelper::checkArray($this->addSQL['field'][$view]) && in_array($data['ID'], $this->addSQL['field'][$view])) { - $this->updateSQLBuilder["ALTERTABLE`#__".$component."_".$view."`ADD`".$field."`"] - = "ALTER TABLE `#__".$component."_".$view."` ADD `".$field."` ".$data['type'].$lenght." ".$default." AFTER `".$last_name."`;"; + $this->updateSQLBuilder["ALTERTABLE`#__" . $component . "_" . $view . "`ADD`" . $field . "`"] = "ALTER TABLE `#__" . $component . "_" . $view . "` ADD `" . $field . "` " . $data['type'] . $lenght . " " . $default . " AFTER `" . $last_name . "`;"; } // check if the field has changed name and/or data type and lenght elseif (0) @@ -5600,122 +5605,121 @@ class Interpretation extends Fields // check if default field was over written if (!isset($this->fieldsNames[$view]['params'])) { - $db_ .= PHP_EOL."\t`params` text NOT NULL DEFAULT '',"; + $db_ .= PHP_EOL . "\t`params` text NOT NULL DEFAULT '',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['published'])) { - $db_ .= PHP_EOL."\t`published` TINYINT(3) NOT NULL DEFAULT 1,"; + $db_ .= PHP_EOL . "\t`published` TINYINT(3) NOT NULL DEFAULT 1,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['created_by'])) { - $db_ .= PHP_EOL."\t`created_by` INT(10) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . "\t`created_by` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['modified_by'])) { - $db_ .= PHP_EOL."\t`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . "\t`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['created'])) { - $db_ .= PHP_EOL."\t`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; + $db_ .= PHP_EOL . "\t`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['modified'])) { - $db_ .= PHP_EOL."\t`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; + $db_ .= PHP_EOL . "\t`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['checked_out'])) { - $db_ .= PHP_EOL."\t`checked_out` int(11) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . "\t`checked_out` int(11) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['checked_out_time'])) { - $db_ .= PHP_EOL."\t`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; + $db_ .= PHP_EOL . "\t`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['version'])) { - $db_ .= PHP_EOL."\t`version` INT(10) unsigned NOT NULL DEFAULT 1,"; + $db_ .= PHP_EOL . "\t`version` INT(10) unsigned NOT NULL DEFAULT 1,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['hits'])) { - $db_ .= PHP_EOL."\t`hits` INT(10) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . "\t`hits` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if view has access if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $db_ .= PHP_EOL."\t`access` INT(10) unsigned NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . "\t`access` INT(10) unsigned NOT NULL DEFAULT 0,"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['ordering'])) { - $db_ .= PHP_EOL."\t`ordering` INT(11) NOT NULL DEFAULT 0,"; + $db_ .= PHP_EOL . "\t`ordering` INT(11) NOT NULL DEFAULT 0,"; } // check if metadata is added to this view if (isset($this->metadataBuilder[$view]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view])) { - $db_ .= PHP_EOL."\t`metakey` TEXT NOT NULL DEFAULT '',"; - $db_ .= PHP_EOL."\t`metadesc` TEXT NOT NULL DEFAULT '',"; - $db_ .= PHP_EOL."\t`metadata` TEXT NOT NULL DEFAULT '',"; + $db_ .= PHP_EOL . "\t`metakey` TEXT NOT NULL DEFAULT '',"; + $db_ .= PHP_EOL . "\t`metadesc` TEXT NOT NULL DEFAULT '',"; + $db_ .= PHP_EOL . "\t`metadata` TEXT NOT NULL DEFAULT '',"; } - $db_ .= PHP_EOL."\tPRIMARY KEY (`id`)"; + $db_ .= PHP_EOL . "\tPRIMARY KEY (`id`)"; if (isset($this->dbUniqueKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbUniqueKeys[$view])) { foreach ($this->dbUniqueKeys[$view] as $nr => $key) { - $db_ .= ",".PHP_EOL."\tUNIQUE KEY `idx_".$key."` (`".$key."`)"; + $db_ .= "," . PHP_EOL . "\tUNIQUE KEY `idx_" . $key . "` (`" . $key . "`)"; } } // check if view has access if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $db_ .= ",".PHP_EOL."\tKEY `idx_access` (`access`)"; + $db_ .= "," . PHP_EOL . "\tKEY `idx_access` (`access`)"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['checked_out'])) { - $db_ .= ",".PHP_EOL."\tKEY `idx_checkout` (`checked_out`)"; + $db_ .= "," . PHP_EOL . "\tKEY `idx_checkout` (`checked_out`)"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['created_by'])) { - $db_ .= ",".PHP_EOL."\tKEY `idx_createdby` (`created_by`)"; + $db_ .= "," . PHP_EOL . "\tKEY `idx_createdby` (`created_by`)"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['modified_by'])) { - $db_ .= ",".PHP_EOL."\tKEY `idx_modifiedby` (`modified_by`)"; + $db_ .= "," . PHP_EOL . "\tKEY `idx_modifiedby` (`modified_by`)"; } // check if default field was over written if (!isset($this->fieldsNames[$view]['published'])) { - $db_ .= ",".PHP_EOL."\tKEY `idx_state` (`published`)"; + $db_ .= "," . PHP_EOL . "\tKEY `idx_state` (`published`)"; } if (isset($this->dbKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbKeys[$view])) { foreach ($this->dbKeys[$view] as $nr => $key) { - $db_ .= ",".PHP_EOL."\tKEY `idx_".$key."` (`".$key."`)"; + $db_ .= "," . PHP_EOL . "\tKEY `idx_" . $key . "` (`" . $key . "`)"; } } - $db_ .= PHP_EOL.") ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;"; - + $db_ .= PHP_EOL . ") ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;"; + // check if this is a new table that should be added via update SQL - if (isset($this->addSQL['adminview']) && ComponentbuilderHelper::checkArray($this->addSQL['adminview']) - && in_array($view, $this->addSQL['adminview'])) + if (isset($this->addSQL['adminview']) && ComponentbuilderHelper::checkArray($this->addSQL['adminview']) && in_array($view, $this->addSQL['adminview'])) { // build the update array - $this->updateSQLBuilder["CREATETABLEIFNOTEXISTS`#__".$component."_".$view."`"] = $db_; + $this->updateSQLBuilder["CREATETABLEIFNOTEXISTS`#__" . $component . "_" . $view . "`"] = $db_; } - + // add to main DB string - $db .= $db_.PHP_EOL.PHP_EOL; + $db .= $db_ . PHP_EOL . PHP_EOL; } // add custom sql dump to the file if (isset($this->customScriptBuilder['sql']) && ComponentbuilderHelper::checkArray($this->customScriptBuilder['sql'])) @@ -5723,9 +5727,8 @@ class Interpretation extends Fields foreach ($this->customScriptBuilder['sql'] as $for => $customSql) { $placeholders = array('[[[component]]]' => $component, '[[[view]]]' => $for); - $db .= $this->setPlaceholders($customSql, $placeholders).PHP_EOL.PHP_EOL; + $db .= $this->setPlaceholders($customSql, $placeholders) . PHP_EOL . PHP_EOL; } - } return $db; } @@ -5739,7 +5742,7 @@ class Interpretation extends Fields $bd = ''; foreach ($this->uninstallBuilder as $line) { - $bd .= $line.PHP_EOL; + $bd .= $line . PHP_EOL; } return $bd; } @@ -5750,75 +5753,75 @@ class Interpretation extends Fields { // add final list of needed lang strings $componentName = JFilterOutput::cleanText($this->componentData->name); - $this->langContent['adminsys'][$this->langPrefix] = $componentName; - $this->langContent['adminsys'][$this->langPrefix.'_CONFIGURATION'] = $componentName.' Configuration'; - $this->langContent[$this->lang][$this->langPrefix] = $componentName; - $this->langContent['admin'][$this->langPrefix.'_BACK'] = 'Back'; - $this->langContent['admin'][$this->langPrefix.'_DASH'] = 'Dashboard'; - $this->langContent['admin'][$this->langPrefix.'_VERSION'] = 'Version'; - $this->langContent['admin'][$this->langPrefix.'_DATE'] = 'Date'; - $this->langContent['admin'][$this->langPrefix.'_AUTHOR'] = 'Author'; - $this->langContent['admin'][$this->langPrefix.'_WEBSITE'] = 'Website'; - $this->langContent['admin'][$this->langPrefix.'_LICENSE'] = 'License'; - $this->langContent['admin'][$this->langPrefix.'_CONTRIBUTORS'] = 'Contributors'; - $this->langContent['admin'][$this->langPrefix.'_CONTRIBUTOR'] = 'Contributor'; - $this->langContent['admin'][$this->langPrefix.'_DASHBOARD'] = $componentName.' Dashboard'; - $this->langContent['admin'][$this->langPrefix.'_SAVE_SUCCESS'] = "Great! Item successfully saved."; - $this->langContent['admin'][$this->langPrefix.'_SAVE_WARNING'] = "The value already existed so please select another."; - $this->langContent['admin'][$this->langPrefix.'_HELP_MANAGER'] = "Help"; - $this->langContent['admin'][$this->langPrefix.'_NEW'] = "New"; - $this->langContent['admin'][$this->langPrefix.'_CLOSE_NEW'] = "Close & New"; - $this->langContent['admin'][$this->langPrefix.'_CREATE_NEW_S'] = "Create New %s"; - $this->langContent['admin'][$this->langPrefix.'_EDIT_S'] = "Edit %s"; - $this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_STATE'] = "- Keep Original State -"; - $this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_ACCESS'] = "- Keep Original Access -"; - $this->langContent['admin'][$this->langPrefix.'_KEEP_ORIGINAL_CATEGORY'] = "- Keep Original Category -"; - $this->langContent['admin'][$this->langPrefix.'_PUBLISHED'] = 'Published'; - $this->langContent['admin'][$this->langPrefix.'_INACTIVE'] = 'Inactive'; - $this->langContent['admin'][$this->langPrefix.'_ARCHIVED'] = 'Archived'; - $this->langContent['admin'][$this->langPrefix.'_TRASHED'] = 'Trashed'; + $this->langContent['adminsys'][$this->langPrefix] = $componentName; + $this->langContent['adminsys'][$this->langPrefix . '_CONFIGURATION'] = $componentName . ' Configuration'; + $this->langContent[$this->lang][$this->langPrefix] = $componentName; + $this->langContent['admin'][$this->langPrefix . '_BACK'] = 'Back'; + $this->langContent['admin'][$this->langPrefix . '_DASH'] = 'Dashboard'; + $this->langContent['admin'][$this->langPrefix . '_VERSION'] = 'Version'; + $this->langContent['admin'][$this->langPrefix . '_DATE'] = 'Date'; + $this->langContent['admin'][$this->langPrefix . '_AUTHOR'] = 'Author'; + $this->langContent['admin'][$this->langPrefix . '_WEBSITE'] = 'Website'; + $this->langContent['admin'][$this->langPrefix . '_LICENSE'] = 'License'; + $this->langContent['admin'][$this->langPrefix . '_CONTRIBUTORS'] = 'Contributors'; + $this->langContent['admin'][$this->langPrefix . '_CONTRIBUTOR'] = 'Contributor'; + $this->langContent['admin'][$this->langPrefix . '_DASHBOARD'] = $componentName . ' Dashboard'; + $this->langContent['admin'][$this->langPrefix . '_SAVE_SUCCESS'] = "Great! Item successfully saved."; + $this->langContent['admin'][$this->langPrefix . '_SAVE_WARNING'] = "The value already existed so please select another."; + $this->langContent['admin'][$this->langPrefix . '_HELP_MANAGER'] = "Help"; + $this->langContent['admin'][$this->langPrefix . '_NEW'] = "New"; + $this->langContent['admin'][$this->langPrefix . '_CLOSE_NEW'] = "Close & New"; + $this->langContent['admin'][$this->langPrefix . '_CREATE_NEW_S'] = "Create New %s"; + $this->langContent['admin'][$this->langPrefix . '_EDIT_S'] = "Edit %s"; + $this->langContent['admin'][$this->langPrefix . '_KEEP_ORIGINAL_STATE'] = "- Keep Original State -"; + $this->langContent['admin'][$this->langPrefix . '_KEEP_ORIGINAL_ACCESS'] = "- Keep Original Access -"; + $this->langContent['admin'][$this->langPrefix . '_KEEP_ORIGINAL_CATEGORY'] = "- Keep Original Category -"; + $this->langContent['admin'][$this->langPrefix . '_PUBLISHED'] = 'Published'; + $this->langContent['admin'][$this->langPrefix . '_INACTIVE'] = 'Inactive'; + $this->langContent['admin'][$this->langPrefix . '_ARCHIVED'] = 'Archived'; + $this->langContent['admin'][$this->langPrefix . '_TRASHED'] = 'Trashed'; if ($this->componentData->add_license && $this->componentData->license_type == 3) { - $this->langContent['admin']['NIE_REG_NIE'] = "

License not set for ".$componentName.".

Notify your administrator!
The license can be obtained from ".$this->componentData->companyname.".

"; + $this->langContent['admin']['NIE_REG_NIE'] = "

License not set for " . $componentName . ".

Notify your administrator!
The license can be obtained from " . $this->componentData->companyname . ".

"; } // add the langug files needed to import and export data if ($this->addEximport) { - $this->langContent['admin'][$this->langPrefix.'_EXPORT_FAILED'] = "Export Failed"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_FAILED'] = "Import Failed"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_TITLE'] = "Data Importer"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_NO_IMPORT_TYPE_FOUND'] = "Import type not found."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'] = "Package to import not found."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_ERROR'] = "Import error."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_SUCCESS'] = "Great! Import successful."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_WARNIMPORTFILE'] = "Warning, import file error."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_NO_FILE_SELECTED'] = "No import file selected."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_PLEASE_SELECT_A_FILE'] = "Please select a file to import."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS'] = "Please link all columns."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY'] = "Please enter the file directory."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_WARNIMPORTUPLOADERROR'] = "Warning, import upload error."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'] = "Please enter the file directory."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'] = "Path does not have a valid file."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'] = "Does not have a valid file type."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_ENTER_A_URL'] = "Please enter a url."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_MSG_INVALID_URL'] = "Invalid url."; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_CONTINUE'] = "Continue"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_FROM_UPLOAD'] = "Upload"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_SELECT_FILE'] = "Select File"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_UPLOAD_BOTTON'] = "Upload File"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_FROM_DIRECTORY'] = "Directory"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_SELECT_FILE_DIRECTORY'] = "Set the path to file"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_GET_BOTTON'] = "Get File"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_FROM_URL'] = "URL"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_SELECT_FILE_URL'] = "Enter file URL"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_UPDATE_DATA'] = "Import Data"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_FORMATS_ACCEPTED'] = "formats accepted"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'] = "Link File to Table Columns"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_TABLE_COLUMNS'] = "Table Columns"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_FILE_COLUMNS'] = "File Columns"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_PLEASE_SELECT_COLUMN'] = "-- Please Select Column --"; - $this->langContent['admin'][$this->langPrefix.'_IMPORT_IGNORE_COLUMN'] = "-- Ignore This Column --"; - $this->langContent['admin'][$this->langPrefix.'_NO_ACCESS_GRANTED'] = "No Access Granted!"; + $this->langContent['admin'][$this->langPrefix . '_EXPORT_FAILED'] = "Export Failed"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_FAILED'] = "Import Failed"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_TITLE'] = "Data Importer"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_NO_IMPORT_TYPE_FOUND'] = "Import type not found."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'] = "Package to import not found."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_ERROR'] = "Import error."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_SUCCESS'] = "Great! Import successful."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_WARNIMPORTFILE'] = "Warning, import file error."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_NO_FILE_SELECTED'] = "No import file selected."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_PLEASE_SELECT_A_FILE'] = "Please select a file to import."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS'] = "Please link all columns."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY'] = "Please enter the file directory."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_WARNIMPORTUPLOADERROR'] = "Warning, import upload error."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'] = "Please enter the file directory."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'] = "Path does not have a valid file."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'] = "Does not have a valid file type."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_ENTER_A_URL'] = "Please enter a url."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_MSG_INVALID_URL'] = "Invalid url."; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_CONTINUE'] = "Continue"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_FROM_UPLOAD'] = "Upload"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_SELECT_FILE'] = "Select File"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_UPLOAD_BOTTON'] = "Upload File"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_FROM_DIRECTORY'] = "Directory"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_SELECT_FILE_DIRECTORY'] = "Set the path to file"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_GET_BOTTON'] = "Get File"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_FROM_URL'] = "URL"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_SELECT_FILE_URL'] = "Enter file URL"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_UPDATE_DATA'] = "Import Data"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_FORMATS_ACCEPTED'] = "formats accepted"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'] = "Link File to Table Columns"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_TABLE_COLUMNS'] = "Table Columns"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_FILE_COLUMNS'] = "File Columns"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_PLEASE_SELECT_COLUMN'] = "-- Please Select Column --"; + $this->langContent['admin'][$this->langPrefix . '_IMPORT_IGNORE_COLUMN'] = "-- Ignore This Column --"; + $this->langContent['admin'][$this->langPrefix . '_NO_ACCESS_GRANTED'] = "No Access Granted!"; } // check if the both array is set if (isset($this->langContent['both']) && ComponentbuilderHelper::checkArray($this->langContent['both'])) @@ -5843,7 +5846,7 @@ class Interpretation extends Fields $this->languages['en-GB']['admin'] = $this->langContent['admin']; // remove tmp array unset($this->langContent['admin']); - + return true; } return false; @@ -5852,26 +5855,26 @@ class Interpretation extends Fields public function setLangSite() { // add final list of needed lang strings - $this->langContent['site'][$this->langPrefix] = ComponentbuilderHelper::safeString($this->componentData->name,'W'); + $this->langContent['site'][$this->langPrefix] = ComponentbuilderHelper::safeString($this->componentData->name, 'W'); // some more defaults - $this->langContent['site']['JTOOLBAR_APPLY'] = "Save"; - $this->langContent['site']['JTOOLBAR_SAVE_AS_COPY'] = "Save as Copy"; - $this->langContent['site']['JTOOLBAR_SAVE'] = "Save & Close"; - $this->langContent['site']['JTOOLBAR_SAVE_AND_NEW'] = "Save & New"; - $this->langContent['site']['JTOOLBAR_CANCEL'] = "Cancel"; - $this->langContent['site']['JTOOLBAR_CLOSE'] = "Close"; - $this->langContent['site']['JTOOLBAR_HELP'] = "Help"; - $this->langContent['site']['JGLOBAL_FIELD_ID_LABEL'] = "ID"; - $this->langContent['site']['JGLOBAL_FIELD_ID_DESC'] = "Record number in the database."; - $this->langContent['site']['JGLOBAL_FIELD_MODIFIED_LABEL'] = "Modified Date"; - $this->langContent['site']['COM_CONTENT_FIELD_MODIFIED_DESC'] = "The last date this item was modified."; - $this->langContent['site']['JGLOBAL_FIELD_MODIFIED_BY_LABEL'] = "Modified By"; - $this->langContent['site']['JGLOBAL_FIELD_MODIFIED_BY_DESC'] = "The user who did the last modification."; - $this->langContent['site'][$this->langPrefix.'_NEW'] = "New"; - $this->langContent['site'][$this->langPrefix.'_CREATE_NEW_S'] = "Create New %s"; - $this->langContent['site'][$this->langPrefix.'_EDIT_S'] = "Edit %s"; - $this->langContent['site'][$this->langPrefix.'_NO_ACCESS_GRANTED'] = "No Access Granted!"; - + $this->langContent['site']['JTOOLBAR_APPLY'] = "Save"; + $this->langContent['site']['JTOOLBAR_SAVE_AS_COPY'] = "Save as Copy"; + $this->langContent['site']['JTOOLBAR_SAVE'] = "Save & Close"; + $this->langContent['site']['JTOOLBAR_SAVE_AND_NEW'] = "Save & New"; + $this->langContent['site']['JTOOLBAR_CANCEL'] = "Cancel"; + $this->langContent['site']['JTOOLBAR_CLOSE'] = "Close"; + $this->langContent['site']['JTOOLBAR_HELP'] = "Help"; + $this->langContent['site']['JGLOBAL_FIELD_ID_LABEL'] = "ID"; + $this->langContent['site']['JGLOBAL_FIELD_ID_DESC'] = "Record number in the database."; + $this->langContent['site']['JGLOBAL_FIELD_MODIFIED_LABEL'] = "Modified Date"; + $this->langContent['site']['COM_CONTENT_FIELD_MODIFIED_DESC'] = "The last date this item was modified."; + $this->langContent['site']['JGLOBAL_FIELD_MODIFIED_BY_LABEL'] = "Modified By"; + $this->langContent['site']['JGLOBAL_FIELD_MODIFIED_BY_DESC'] = "The user who did the last modification."; + $this->langContent['site'][$this->langPrefix . '_NEW'] = "New"; + $this->langContent['site'][$this->langPrefix . '_CREATE_NEW_S'] = "Create New %s"; + $this->langContent['site'][$this->langPrefix . '_EDIT_S'] = "Edit %s"; + $this->langContent['site'][$this->langPrefix . '_NO_ACCESS_GRANTED'] = "No Access Granted!"; + // check if the both array is set if (isset($this->langContent['both']) && ComponentbuilderHelper::checkArray($this->langContent['both'])) { @@ -5895,7 +5898,7 @@ class Interpretation extends Fields $this->languages['en-GB']['site'] = $this->langContent['site']; // remove tmp array unset($this->langContent['site']); - + return true; } return false; @@ -5904,8 +5907,8 @@ class Interpretation extends Fields public function setLangSiteSys() { // add final list of needed lang strings - $this->langContent['sitesys'][$this->langPrefix] = ComponentbuilderHelper::safeString($this->componentData->name,'W'); - $this->langContent['sitesys'][$this->langPrefix.'_NO_ACCESS_GRANTED'] = "No Access Granted!"; + $this->langContent['sitesys'][$this->langPrefix] = ComponentbuilderHelper::safeString($this->componentData->name, 'W'); + $this->langContent['sitesys'][$this->langPrefix . '_NO_ACCESS_GRANTED'] = "No Access Granted!"; // check if the both site array is set if (isset($this->langContent['bothsite']) && ComponentbuilderHelper::checkArray($this->langContent['bothsite'])) @@ -5922,7 +5925,7 @@ class Interpretation extends Fields $this->languages['en-GB']['sitesys'] = $this->langContent['sitesys']; // remove tmp array unset($this->langContent['sitesys']); - + return true; } return false; @@ -5945,13 +5948,13 @@ class Interpretation extends Fields $this->languages['en-GB']['adminsys'] = $this->langContent['adminsys']; // remove tmp array unset($this->langContent['adminsys']); - + return true; } return false; } - public function setCustomAdminViewListLink($view,$viewName_list) + public function setCustomAdminViewListLink($view, $viewName_list) { if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) { @@ -6003,12 +6006,12 @@ class Interpretation extends Fields } } - public function setListBody($viewName_single,$viewName_list) + public function setListBody($viewName_single, $viewName_list) { if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) { // component helper name - $Helper = $this->fileContentStatic['###Component###'].'Helper'; + $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; // setup correct core target $coreLoad = false; if (isset($this->permissionCore[$viewName_single])) @@ -6020,70 +6023,70 @@ class Interpretation extends Fields $firstTimeBeingAdded = true; // add the default $body = "items as \$i => \$item): ?>"; - $body .= PHP_EOL."\tuser->authorise('core.manage', 'com_checkin') || \$item->checked_out == \$this->user->id || \$item->checked_out == 0;"; - $body .= PHP_EOL."\t\t\$userChkOut = JFactory::getUser(\$item->checked_out);"; - $body .= PHP_EOL."\t\t\$canDo = ".$Helper."::getActions('".$viewName_single."',\$item,'".$viewName_list."');"; - $body .= PHP_EOL."\t?>"; - $body .= PHP_EOL."\t".''; + $body .= PHP_EOL . "\tuser->authorise('core.manage', 'com_checkin') || \$item->checked_out == \$this->user->id || \$item->checked_out == 0;"; + $body .= PHP_EOL . "\t\t\$userChkOut = JFactory::getUser(\$item->checked_out);"; + $body .= PHP_EOL . "\t\t\$canDo = " . $Helper . "::getActions('" . $viewName_single . "',\$item,'" . $viewName_list . "');"; + $body .= PHP_EOL . "\t?>"; + $body .= PHP_EOL . "\t" . ''; // only load if not over written if (!isset($this->fieldsNames[$viewName_single]['ordering'])) { - $body .= PHP_EOL."\t\t".''; + $body .= PHP_EOL . "\t\t" . ''; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $body .= PHP_EOL."\t\tget('".$core['core.edit.state']."')): ?>"; + $body .= PHP_EOL . "\t\tget('" . $core['core.edit.state'] . "')): ?>"; } else { - $body .= PHP_EOL."\t\tget('core.edit.state')): ?>"; + $body .= PHP_EOL . "\t\tget('core.edit.state')): ?>"; } - $body .= PHP_EOL."\t\t\tsaveOrder)"; - $body .= PHP_EOL."\t\t\t\t{"; - $body .= PHP_EOL."\t\t\t\t\t\$iconClass = ' inactive';"; - $body .= PHP_EOL."\t\t\t\t}"; - $body .= PHP_EOL."\t\t\t\telse"; - $body .= PHP_EOL."\t\t\t\t{"; - $body .= PHP_EOL."\t\t\t\t\t\$iconClass = ' inactive tip-top".'" hasTooltip" title="'."' . JHtml::tooltipText('JORDERINGDISABLED');"; - $body .= PHP_EOL."\t\t\t\t}"; - $body .= PHP_EOL."\t\t\t?>"; - $body .= PHP_EOL."\t\t\t".''; - $body .= PHP_EOL."\t\t\t\t".''; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\tsaveOrder) : ?>"; - $body .= PHP_EOL."\t\t\t\t".'ordering; ?>" class="width-20 text-area-order " />'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t\t⋮"; - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t\tsaveOrder)"; + $body .= PHP_EOL . "\t\t\t\t{"; + $body .= PHP_EOL . "\t\t\t\t\t\$iconClass = ' inactive';"; + $body .= PHP_EOL . "\t\t\t\t}"; + $body .= PHP_EOL . "\t\t\t\telse"; + $body .= PHP_EOL . "\t\t\t\t{"; + $body .= PHP_EOL . "\t\t\t\t\t\$iconClass = ' inactive tip-top" . '" hasTooltip" title="' . "' . JHtml::tooltipText('JORDERINGDISABLED');"; + $body .= PHP_EOL . "\t\t\t\t}"; + $body .= PHP_EOL . "\t\t\t?>"; + $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\tsaveOrder) : ?>"; + $body .= PHP_EOL . "\t\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t\t⋮"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t"; } - $body .= PHP_EOL."\t\t".''; + $body .= PHP_EOL . "\t\t" . ''; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) { - $body .= PHP_EOL."\t\tget('".$core['core.edit']."')): ?>"; + $body .= PHP_EOL . "\t\tget('" . $core['core.edit'] . "')): ?>"; } else { - $body .= PHP_EOL."\t\tget('core.edit')): ?>"; + $body .= PHP_EOL . "\t\tget('core.edit')): ?>"; } - $body .= PHP_EOL."\t\t\t\tchecked_out) : ?>"; - $body .= PHP_EOL."\t\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t\t\tid); ?>"; - $body .= PHP_EOL."\t\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t\t\t□"; - $body .= PHP_EOL."\t\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t\tid); ?>"; - $body .= PHP_EOL."\t\t\t\t"; - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t\t□"; - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t\t\tchecked_out) : ?>"; + $body .= PHP_EOL . "\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\t\tid); ?>"; + $body .= PHP_EOL . "\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\t\t□"; + $body .= PHP_EOL . "\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\tid); ?>"; + $body .= PHP_EOL . "\t\t\t\t"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t\t□"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t"; // check if this view has fields that should not be escaped $doNotEscape = false; if (isset($this->doNotEscape[$viewName_list])) @@ -6099,33 +6102,32 @@ class Interpretation extends Fields $item['id'] = $item['code']; if (!$item['multiple']) { - $item['code'] = $item['code'].'_'.$item['custom']['text']; + $item['code'] = $item['code'] . '_' . $item['custom']['text']; } } // check if translated value is used - if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) - && array_key_exists($item['code'],$this->selectionTranslationFixBuilder[$viewName_list])) + if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list])) { - $itemCode = ''.$item['code'].'); ?>'; + $itemCode = '' . $item['code'] . '); ?>'; } elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['text'] === 'user') { - $itemCode = ''.$item['code'].')->name; ?>'; + $itemCode = '' . $item['code'] . ')->name; ?>'; } elseif ($doNotEscape) { if (in_array($item['code'], $this->doNotEscape[$viewName_list])) { - $itemCode = ''.$item['code'].'; ?>'; + $itemCode = '' . $item['code'] . '; ?>'; } else { - $itemCode = 'escape($item->'.$item['code'].'); ?>'; + $itemCode = 'escape($item->' . $item['code'] . '); ?>'; } } else { - $itemCode = 'escape($item->'.$item['code'].'); ?>'; + $itemCode = 'escape($item->' . $item['code'] . '); ?>'; } if ($item['link']) { @@ -6136,25 +6138,25 @@ class Interpretation extends Fields { $otherViews = $this->catCodeBuilder[$viewName_single]['views']; // category and linked - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tuser->authorise('core.edit', 'com_".$this->fileContentStatic['###component###'].".".$otherViews.".category.' . (int)\$item->".$item['code'].")): ?>"; - $body .= PHP_EOL."\t\t\t\t".'escape($item->category_title); ?>'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'escape($item->category_title); ?>'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\tescape(\$item->category_title); ?>"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; } elseif ($item['type'] === 'user' && !$item['title']) { // user and linked - $body .= PHP_EOL."\t\t".$item['code']."); ?>"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL."\t\t\t\t".'name; ?>'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\tname; ?>"; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\tname; ?>"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; } else { @@ -6162,8 +6164,8 @@ class Interpretation extends Fields if (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] != 'user' && !$item['title']) { // link to that item instead - $link = 'index.php?option='.$item['custom']['component'].'&view='.$item['custom']['views'].'&task='.$item['custom']['view'].'.edit&id='.$item['id'].'; ?>&ref='.$viewName_list; - + $link = 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] . '.edit&id=' . $item['id'] . '; ?>&ref=' . $viewName_list; + $coreLoadLink = false; if (isset($this->permissionCore[$item['custom']['view']])) { @@ -6171,56 +6173,55 @@ class Interpretation extends Fields $coreLoadLink = true; } // check if the item has permissions. - if ($coreLoadLink && (isset($coreLink['core.edit']) && isset($this->permissionBuilder[$coreLink['core.edit']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'],$this->permissionBuilder[$coreLink['core.edit']])) + if ($coreLoadLink && (isset($coreLink['core.edit']) && isset($this->permissionBuilder[$coreLink['core.edit']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'], $this->permissionBuilder[$coreLink['core.edit']])) { - $accessCheck = "\$this->user->authorise('".$coreLink['core.edit']."', 'com_".$this->fileContentStatic['###component###'].".".$item['custom']['view'].".' . (int)\$item->".$item['id'].")"; + $accessCheck = "\$this->user->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; } else { - $accessCheck = "\$this->user->authorise('core.edit', 'com_".$this->fileContentStatic['###component###'].".".$item['custom']['view'].".' . (int)\$item->".$item['id'].")"; + $accessCheck = "\$this->user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; } } elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title']) { // user and linked - $body .= PHP_EOL."\t\t".$item['id']."); ?>"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL."\t\t\t\t".'name; ?>'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\tname; ?>"; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\tname; ?>"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; $add = false; } else { - // start building the links + // start building the links $link = '&id=id; ?>'; - // check if custom links should be added to this list views - if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list]) && $firstTimeBeingAdded) - { - // make sure the custom links are only added once - $firstTimeBeingAdded = false; - // start building the links - $customAdminView = PHP_EOL."\t\t\t".'
'; - foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView) - { - $customAdminView .= PHP_EOL."\t\t\tget('".$customLinkView['link'].".access')): ?>"; - $customAdminView .= PHP_EOL."\t\t\t\t".'fileContentStatic['###COMPONENT###'].'_'.$customLinkView['NAME']."'".'); ?>" >'; - $customAdminView .= PHP_EOL."\t\t\t"; - $customAdminView .= PHP_EOL."\t\t\t\t".'fileContentStatic['###COMPONENT###'].'_'.$customLinkView['NAME']."'".'); ?>">'; - $customAdminView .= PHP_EOL."\t\t\t"; - } - $customAdminView .= PHP_EOL."\t\t\t".'
'; - - } + // check if custom links should be added to this list views + if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list]) && $firstTimeBeingAdded) + { + // make sure the custom links are only added once + $firstTimeBeingAdded = false; + // start building the links + $customAdminView = PHP_EOL . "\t\t\t" . '
'; + foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView) + { + $customAdminView .= PHP_EOL . "\t\t\tget('" . $customLinkView['link'] . ".access')): ?>"; + $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; + $customAdminView .= PHP_EOL . "\t\t\t"; + $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; + $customAdminView .= PHP_EOL . "\t\t\t"; + } + $customAdminView .= PHP_EOL . "\t\t\t" . '
'; + } // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) { // set permissions. - $accessCheck = "\$canDo->get('".$core['core.edit']."')"; + $accessCheck = "\$canDo->get('" . $core['core.edit'] . "')"; } else { @@ -6234,21 +6235,21 @@ class Interpretation extends Fields if ($add) { // set as linked - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\t".'
'.PHP_EOL."\t\t\t\t\t".''.$itemCode.''; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t" . '
' . PHP_EOL . "\t\t\t\t\t" . '' . $itemCode . ''; if ($checkoutTriger) { - $body .= PHP_EOL."\t\t\t\t\tchecked_out): ?>"; - $body .= PHP_EOL."\t\t\t\t\t\tname, \$item->checked_out_time, '".$viewName_list.".', \$canCheckin); ?>"; - $body .= PHP_EOL."\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\tchecked_out): ?>"; + $body .= PHP_EOL . "\t\t\t\t\t\tname, \$item->checked_out_time, '" . $viewName_list . ".', \$canCheckin); ?>"; + $body .= PHP_EOL . "\t\t\t\t\t"; } - $body .= PHP_EOL."\t\t\t\t".'
'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\t".'
'.$itemCode.'
'; - $body .= PHP_EOL."\t\t\t"; - $body .= $customAdminView; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t\t\t" . '
'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t" . '
' . $itemCode . '
'; + $body .= PHP_EOL . "\t\t\t"; + $body .= $customAdminView; + $body .= PHP_EOL . "\t\t"; } } } @@ -6256,120 +6257,120 @@ class Interpretation extends Fields { if ($item['type'] === 'category') { - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t\tescape(\$item->category_title); ?>"; + $body .= PHP_EOL . "\t\t"; } elseif (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user') { // custom user and linked - $body .= PHP_EOL."\t\t".$item['id']."); ?>"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL."\t\t\t\t".'name; ?>'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\tname; ?>"; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\tname; ?>"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; } elseif ($item['type'] === 'user') { // user name only - $body .= PHP_EOL."\t\t".$item['code']."); ?>"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tname; ?>"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tname; ?>"; + $body .= PHP_EOL . "\t\t"; } else { // normal not linked - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t\t".$itemCode; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t\t" . $itemCode; + $body .= PHP_EOL . "\t\t"; } } } // add the defaults if (!isset($this->fieldsNames[$viewName_single]['published'])) { - $body .= PHP_EOL."\t\t".''; + $body .= PHP_EOL . "\t\t" . ''; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit.state']])) + if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']])) { - $body .= PHP_EOL."\t\tget('".$core['core.edit.state']."')) : ?>"; + $body .= PHP_EOL . "\t\tget('" . $core['core.edit.state'] . "')) : ?>"; } else { - $body .= PHP_EOL."\t\tget('core.edit.state')) : ?>"; + $body .= PHP_EOL . "\t\tget('core.edit.state')) : ?>"; } - $body .= PHP_EOL."\t\t\t\tchecked_out) : ?>"; - $body .= PHP_EOL."\t\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t\t\tpublished, \$i, '".$viewName_list.".', true, 'cb'); ?>"; - $body .= PHP_EOL."\t\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t\t\tpublished, \$i, '".$viewName_list.".', false, 'cb'); ?>"; - $body .= PHP_EOL."\t\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t\tpublished, \$i, '".$viewName_list.".', true, 'cb'); ?>"; - $body .= PHP_EOL."\t\t\t\t"; - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t\tpublished, \$i, '".$viewName_list.".', false, 'cb'); ?>"; - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t"; - } + $body .= PHP_EOL . "\t\t\t\tchecked_out) : ?>"; + $body .= PHP_EOL . "\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\t\tpublished, \$i, '" . $viewName_list . ".', true, 'cb'); ?>"; + $body .= PHP_EOL . "\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\t\tpublished, \$i, '" . $viewName_list . ".', false, 'cb'); ?>"; + $body .= PHP_EOL . "\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\tpublished, \$i, '" . $viewName_list . ".', true, 'cb'); ?>"; + $body .= PHP_EOL . "\t\t\t\t"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t\tpublished, \$i, '" . $viewName_list . ".', false, 'cb'); ?>"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t"; + } if (!isset($this->fieldsNames[$viewName_single]['id'])) { - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tid; ?>"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tid; ?>"; + $body .= PHP_EOL . "\t\t"; } - $body .= PHP_EOL."\t"; - $body .= PHP_EOL.""; + $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . ""; // return the build return $body; } return ''; } - public function setListHead($viewName_single,$viewName_list) + public function setListHead($viewName_single, $viewName_list) { if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) { // main lang prefix - $langView = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($viewName_single,'U'); + $langView = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($viewName_single, 'U'); // set status lang - $statusLangName = $langView.'_STATUS'; + $statusLangName = $langView . '_STATUS'; // set id lang - $idLangName = $langView.'_ID'; + $idLangName = $langView . '_ID'; // add to lang array if (!isset($this->langContent[$this->lang][$statusLangName])) { $this->langContent[$this->lang][$statusLangName] = 'Status'; } // add to lang array - if (!isset($this->langContent[$this->lang][$idLangName ])) + if (!isset($this->langContent[$this->lang][$idLangName])) { $this->langContent[$this->lang][$idLangName] = 'Id'; } // set default $head = ''; - $head .= PHP_EOL."\tcanEdit&& \$this->canState): ?>"; + $head .= PHP_EOL . "\tcanEdit&& \$this->canState): ?>"; if (!isset($this->fieldsNames[$viewName_single]['ordering'])) { - $head .= PHP_EOL."\t\t".''; - $head .= PHP_EOL."\t\t\t'."', 'ordering', \$this->listDirn, \$this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>"; - $head .= PHP_EOL."\t\t"; + $head .= PHP_EOL . "\t\t" . ''; + $head .= PHP_EOL . "\t\t\t' . "', 'ordering', \$this->listDirn, \$this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>"; + $head .= PHP_EOL . "\t\t"; } - $head .= PHP_EOL."\t\t".''; - $head .= PHP_EOL."\t\t\t"; - $head .= PHP_EOL."\t\t"; - $head .= PHP_EOL."\t"; - $head .= PHP_EOL."\t\t".''; - $head .= PHP_EOL."\t\t\t▾"; - $head .= PHP_EOL."\t\t"; - $head .= PHP_EOL."\t\t".''; - $head .= PHP_EOL."\t\t\t■"; - $head .= PHP_EOL."\t\t"; - $head .= PHP_EOL."\t"; + $head .= PHP_EOL . "\t\t" . ''; + $head .= PHP_EOL . "\t\t\t"; + $head .= PHP_EOL . "\t\t"; + $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . "\t\t" . ''; + $head .= PHP_EOL . "\t\t\t▾"; + $head .= PHP_EOL . "\t\t"; + $head .= PHP_EOL . "\t\t" . ''; + $head .= PHP_EOL . "\t\t\t■"; + $head .= PHP_EOL . "\t\t"; + $head .= PHP_EOL . "\t"; // set footer Column number $this->listColnrBuilder[$viewName_list] = 4; // build the dynamic fields @@ -6377,43 +6378,43 @@ class Interpretation extends Fields { if (ComponentbuilderHelper::checkArray($item['custom'])) { - $item['code'] = $item['code'].'_'.$item['custom']['text']; + $item['code'] = $item['code'] . '_' . $item['custom']['text']; } $class = 'nowrap hidden-phone'; if ($item['link']) { $class = 'nowrap'; } - $title = ""; + $title = ""; if ($item['sort']) { - $title = "listDirn, \$this->listOrder); ?>"; + $title = "listDirn, \$this->listOrder); ?>"; } - $head .= PHP_EOL."\t".''; - $head .= PHP_EOL."\t\t\t".$title; - $head .= PHP_EOL."\t"; - $this->listColnrBuilder[$viewName_list]++; + $head .= PHP_EOL . "\t" . ''; + $head .= PHP_EOL . "\t\t\t" . $title; + $head .= PHP_EOL . "\t"; + $this->listColnrBuilder[$viewName_list] ++; } // set default if (!isset($this->fieldsNames[$viewName_single]['published'])) { - $head .= PHP_EOL."\tcanState): ?>"; - $head .= PHP_EOL."\t\t".''; - $head .= PHP_EOL."\t\t\tlistDirn, \$this->listOrder); ?>"; - $head .= PHP_EOL."\t\t"; - $head .= PHP_EOL."\t"; - $head .= PHP_EOL."\t\t".''; - $head .= PHP_EOL."\t\t\t"; - $head .= PHP_EOL."\t\t"; - $head .= PHP_EOL."\t"; + $head .= PHP_EOL . "\tcanState): ?>"; + $head .= PHP_EOL . "\t\t" . ''; + $head .= PHP_EOL . "\t\t\tlistDirn, \$this->listOrder); ?>"; + $head .= PHP_EOL . "\t\t"; + $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . "\t\t" . ''; + $head .= PHP_EOL . "\t\t\t"; + $head .= PHP_EOL . "\t\t"; + $head .= PHP_EOL . "\t"; } if (!isset($this->fieldsNames[$viewName_single]['id'])) { - $head .= PHP_EOL."\t".''; - $head .= PHP_EOL."\t\t\tlistDirn, \$this->listOrder); ?>"; - $head .= PHP_EOL."\t"; + $head .= PHP_EOL . "\t" . ''; + $head .= PHP_EOL . "\t\t\tlistDirn, \$this->listOrder); ?>"; + $head .= PHP_EOL . "\t"; } - $head .= PHP_EOL.""; + $head .= PHP_EOL . ""; return $head; } @@ -6436,7 +6437,7 @@ class Interpretation extends Fields // alignment $alignmentNames = array(1 => 'left', 2 => 'right', 3 => 'fullwidth', 4 => 'above', 5 => 'under', 6 => 'leftside', 7 => 'rightside'); // main lang prefix - $langView = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($viewName_single,'U'); + $langView = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($viewName_single, 'U'); if (isset($this->layoutBuilder[$viewName_single]) && ComponentbuilderHelper::checkArray($this->layoutBuilder[$viewName_single])) { @@ -6459,11 +6460,11 @@ class Interpretation extends Fields $linkedTab[$linkedView['adminview']] = $linkedView['tab']; if (ComponentbuilderHelper::checkString($linkedView['key']) && ComponentbuilderHelper::checkString($linkedView['parentkey'])) { - $keys[$linkedView['adminview']] = array( 'key' => $linkedView['key'], 'parentKey' => $linkedView['parentkey']); + $keys[$linkedView['adminview']] = array('key' => $linkedView['key'], 'parentKey' => $linkedView['parentkey']); } else { - $keys[$linkedView['adminview']] = array( 'key' => null, 'parentKey' => null); + $keys[$linkedView['adminview']] = array('key' => null, 'parentKey' => null); } if (isset($linkedView['addnew'])) { @@ -6489,7 +6490,7 @@ class Interpretation extends Fields $tabWidth = 12; $lrCounter = 0; // set tab lang - $tabLangName = $langView.'_'.ComponentbuilderHelper::safeString($tabName,'U'); + $tabLangName = $langView . '_' . ComponentbuilderHelper::safeString($tabName, 'U'); // set tab code name $tabCodeName = ComponentbuilderHelper::safeString($tabName); // add to lang array @@ -6516,31 +6517,31 @@ class Interpretation extends Fields foreach ($alignments as $alignment => $names) { // set layout code name - $layoutCodeName = $tabCodeName.'_'.$alignmentNames[$alignment]; + $layoutCodeName = $tabCodeName . '_' . $alignmentNames[$alignment]; // reset each time - $items = ''; + $items = ''; $itemCounter = 0; ksort($names); foreach ($names as $nr => $name) { if ($itemCounter == 0) { - $items .= "'".$name."'"; + $items .= "'" . $name . "'"; } else { - $items .= ",".PHP_EOL."\t'".$name."'"; + $items .= "," . PHP_EOL . "\t'" . $name . "'"; } $itemCounter++; } - switch($alignment) + switch ($alignment) { case 1: // left case 2: // right // count $lrCounter++; // set as items layout - $this->setLayout($viewName_single,$layoutCodeName,$items,'layoutitems'); + $this->setLayout($viewName_single, $layoutCodeName, $items, 'layoutitems'); // set the lang to tab $bucket[$tabCodeName]['lang'] = $tabLangName; // load the body @@ -6548,11 +6549,11 @@ class Interpretation extends Fields { $bucket[$tabCodeName][(int) $alignment] = ''; } - $bucket[$tabCodeName][(int) $alignment] .= ""; - break; + $bucket[$tabCodeName][(int) $alignment] .= ""; + break; case 3: // fullwidth // set as items layout - $this->setLayout($viewName_single,$layoutCodeName,$items,'layoutfull'); + $this->setLayout($viewName_single, $layoutCodeName, $items, 'layoutfull'); // set the lang to tab $bucket[$tabCodeName]['lang'] = $tabLangName; // load the body @@ -6560,47 +6561,47 @@ class Interpretation extends Fields { $bucket[$tabCodeName][(int) $alignment] = ''; } - $bucket[$tabCodeName][(int) $alignment] .= ""; - break; + $bucket[$tabCodeName][(int) $alignment] .= ""; + break; case 4: // above // set as title layout $this->setLayout($viewName_single, $layoutCodeName, $items, 'layouttitle'); // load to header - $header .= PHP_EOL."\t"; - break; + $header .= PHP_EOL . "\t"; + break; case 5: // under // set as title layout $this->setLayout($viewName_single, $layoutCodeName, $items, 'layouttitle'); // load to footer - $footer .= PHP_EOL.PHP_EOL."
".PHP_EOL.""; - break; + $footer .= PHP_EOL . PHP_EOL . "
" . PHP_EOL . ""; + break; case 6: // left side $tabWidth = $tabWidth - 2; // set as items layout $this->setLayout($viewName_single, $layoutCodeName, $items, 'layoutitems'); // load the body - $leftside .= PHP_EOL."\t"; - break; + $leftside .= PHP_EOL . "\t"; + break; case 7: // right side $tabWidth = $tabWidth - 2; // set as items layout $this->setLayout($viewName_single, $layoutCodeName, $items, 'layoutitems'); // load the body - $rightside .= PHP_EOL."\t"; - break; + $rightside .= PHP_EOL . "\t"; + break; } } } else { // set layout code name - $layoutCodeName = $tabCodeName.'_fullwidth'; + $layoutCodeName = $tabCodeName . '_fullwidth'; // set identifiers $linkedViewIdentifier[$linkedViewId] = $tabCodeName; //set function name - $codeName = ComponentbuilderHelper::safeString($this->uniquekey(3).$tabCodeName); + $codeName = ComponentbuilderHelper::safeString($this->uniquekey(3) . $tabCodeName); // set as items layout - $this->setLayout($viewName_single,$layoutCodeName,$codeName,'layoutlinkedview'); + $this->setLayout($viewName_single, $layoutCodeName, $codeName, 'layoutlinkedview'); // set the lang to tab $bucket[$tabCodeName]['lang'] = $tabLangName; // set all the linked view stuff @@ -6617,7 +6618,7 @@ class Interpretation extends Fields { $bucket[$tabCodeName][3] = ''; } - $bucket[$tabCodeName][3] .= ""; + $bucket[$tabCodeName][3] .= ""; } // width calculator :) if ($tabWidth == 8) @@ -6638,13 +6639,13 @@ class Interpretation extends Fields $span = ''; if ($mainwidth != 12) { - $span = 'span'.$mainwidth; + $span = 'span' . $mainwidth; } // start building body - $body = PHP_EOL.'
'; + $body = PHP_EOL . '
'; if (ComponentbuilderHelper::checkString($span)) { - $body .= PHP_EOL."\t".'
'; + $body .= PHP_EOL . "\t" . '
'; } // now build the template foreach ($bucket as $tabCodeName => $posions) @@ -6654,51 +6655,51 @@ class Interpretation extends Fields // get lang string $tabLangName = $posions['lang']; // build main center - $main = ''; + $main = ''; $mainbottom = ''; foreach ($posions as $posion => $string) { if ($lrCounter == 2) { - switch($posion) + switch ($posion) { case 1: // left case 2: // right - $main .= PHP_EOL."\t\t\t".'
'; - $main .= PHP_EOL."\t\t\t\t".$string; - $main .= PHP_EOL."\t\t\t".'
'; - break; + $main .= PHP_EOL . "\t\t\t" . '
'; + $main .= PHP_EOL . "\t\t\t\t" . $string; + $main .= PHP_EOL . "\t\t\t" . '
'; + break; } } else { - switch($posion) + switch ($posion) { case 1: // left case 2: // right - $main .= PHP_EOL."\t\t\t".'
'; - $main .= PHP_EOL."\t\t\t\t".$string; - $main .= PHP_EOL."\t\t\t".'
'; - break; + $main .= PHP_EOL . "\t\t\t" . '
'; + $main .= PHP_EOL . "\t\t\t\t" . $string; + $main .= PHP_EOL . "\t\t\t" . '
'; + break; } } - switch($posion) + switch ($posion) { case 3: // fullwidth - $mainbottom .= PHP_EOL."\t\t\t".'
'; - $mainbottom .= PHP_EOL."\t\t\t\t".$string; - $mainbottom .= PHP_EOL."\t\t\t".'
'; - break; + $mainbottom .= PHP_EOL . "\t\t\t" . '
'; + $mainbottom .= PHP_EOL . "\t\t\t\t" . $string; + $mainbottom .= PHP_EOL . "\t\t\t" . '
'; + break; } } // set acctive tab if ($tabCounter == 0) { - $body .= PHP_EOL.PHP_EOL."\t '".$tabCodeName."')); ?>"; + $body .= PHP_EOL . PHP_EOL . "\t '" . $tabCodeName . "')); ?>"; } // if this is a linked view set permissions $closeIT = false; - if(isset($linkedViewIdentifier) && ComponentbuilderHelper::checkArray($linkedViewIdentifier) && in_array($tabCodeName,$linkedViewIdentifier)) + if (isset($linkedViewIdentifier) && ComponentbuilderHelper::checkArray($linkedViewIdentifier) && in_array($tabCodeName, $linkedViewIdentifier)) { // get view name $linkedViewId = array_search($tabCodeName, $linkedViewIdentifier); @@ -6712,9 +6713,9 @@ class Interpretation extends Fields $coreLoadLinked = true; } // check if the item has permissions. - if ($coreLoadLinked && isset($coreLinked['core.access']) && isset($this->permissionBuilder['global'][$coreLinked['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$coreLinked['core.access']]) && in_array($linkedCodeName,$this->permissionBuilder['global'][$coreLinked['core.access']])) + if ($coreLoadLinked && isset($coreLinked['core.access']) && isset($this->permissionBuilder['global'][$coreLinked['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$coreLinked['core.access']]) && in_array($linkedCodeName, $this->permissionBuilder['global'][$coreLinked['core.access']])) { - $body .= PHP_EOL.PHP_EOL."\tcanDo->get('".$coreLinked['core.access']."')) : ?>"; + $body .= PHP_EOL . PHP_EOL . "\tcanDo->get('" . $coreLinked['core.access'] . "')) : ?>"; $closeIT = true; } else @@ -6722,35 +6723,35 @@ class Interpretation extends Fields $body .= PHP_EOL; } // insure clear - unset($coreLoadLinked,$coreLinked,$linkedViewData); + unset($coreLoadLinked, $coreLinked, $linkedViewData); } else { $body .= PHP_EOL; } // start tab - $body .= PHP_EOL."\t"; + $body .= PHP_EOL . "\t"; // add the main - $body .= PHP_EOL."\t\t".'
'; + $body .= PHP_EOL . "\t\t" . '
'; $body .= $main; - $body .= PHP_EOL."\t\t
"; + $body .= PHP_EOL . "\t\t
"; if (strlen($mainbottom) > 0) { // add the main bottom - $body .= PHP_EOL."\t\t".'
'; + $body .= PHP_EOL . "\t\t" . '
'; $body .= $mainbottom; - $body .= PHP_EOL."\t\t
"; + $body .= PHP_EOL . "\t\t
"; } - $body .= PHP_EOL."\t"; - if($closeIT) + $body .= PHP_EOL . "\t"; + if ($closeIT) { - $body .= PHP_EOL."\t"; + $body .= PHP_EOL . "\t"; } // set counter $tabCounter++; } // set default publishing tab lang - $tabLangName = $langView.'_PUBLISHING'; + $tabLangName = $langView . '_PUBLISHING'; // add to lang array if (!isset($this->langContent[$this->lang][$tabLangName])) { @@ -6763,9 +6764,9 @@ class Interpretation extends Fields $fieldsAddedRight = false; if (isset($this->newPublishingFields[$viewName_single])) { - foreach($this->newPublishingFields[$viewName_single] as $df_alignment => $df_items) + foreach ($this->newPublishingFields[$viewName_single] as $df_alignment => $df_items) { - foreach($df_items as $df_order => $df_name) + foreach ($df_items as $df_order => $df_name) { if ($df_alignment == 2 || $df_alignment == 1) { @@ -6787,10 +6788,10 @@ class Interpretation extends Fields $loadDefaultFields = array( 'left' => array('created', 'created_by', 'modified', 'modified_by'), 'right' => array('published', 'ordering', 'access', 'version', 'hits', 'id') - ); + ); foreach ($loadDefaultFields as $d_alignment => $defaultFields) { - foreach($defaultFields as $defaultField) + foreach ($defaultFields as $defaultField) { if (!isset($this->movedPublishingFields[$viewName_single][$defaultField])) { @@ -6818,19 +6819,19 @@ class Interpretation extends Fields // load the items into one side if (ComponentbuilderHelper::checkArray($items['left'])) { - $items_one .= "'". implode("',".PHP_EOL."\t'", $items['left'])."'"; + $items_one .= "'" . implode("'," . PHP_EOL . "\t'", $items['left']) . "'"; } if (ComponentbuilderHelper::checkArray($items['right'])) { // there is already fields just add these if (strlen($items_one) > 3) { - $items_one .= ",".PHP_EOL."\t'". implode("',".PHP_EOL."\t'", $items['right'])."'"; + $items_one .= "," . PHP_EOL . "\t'" . implode("'," . PHP_EOL . "\t'", $items['right']) . "'"; } // no fields has been added yet else { - $items_one .= "'". implode("',".PHP_EOL."\t'", $items['right'])."'"; + $items_one .= "'" . implode("'," . PHP_EOL . "\t'", $items['right']) . "'"; } } // only triger the info notice if there were custom fields targeted to the right alignment position. @@ -6844,10 +6845,10 @@ class Interpretation extends Fields } else { - $items_one = false; + $items_one = false; } // set the metadata layout - $this->setLayout($viewName_single, $tabCodeNameRight, false, 'layoutmetadata'); + $this->setLayout($viewName_single, $tabCodeNameRight, false, 'layoutmetadata'); $items_two = true; } else @@ -6862,7 +6863,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($items['left'])) { // load all items - $items_one = "'". implode("',".PHP_EOL."\t'", $items['left'])."'"; + $items_one = "'" . implode("'," . PHP_EOL . "\t'", $items['left']) . "'"; // set the publishing layout $this->setLayout($viewName_single, $tabCodeNameLeft, $items_one, 'layoutpublished'); $items_one = true; @@ -6871,7 +6872,7 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($items['right'])) { // load all items - $items_two = "'". implode("',".PHP_EOL."\t'", $items['right'])."'"; + $items_two = "'" . implode("'," . PHP_EOL . "\t'", $items['right']) . "'"; // set the publishing layout $this->setLayout($viewName_single, $tabCodeNameRight, $items_two, 'layoutpublished'); $items_two = true; @@ -6880,7 +6881,7 @@ class Interpretation extends Fields else { $items_one = false; - $items_two = false; + $items_two = false; } } if ($items_one && $items_two) @@ -6896,45 +6897,45 @@ class Interpretation extends Fields { // check if the item has permissions. $publishingPer = array(); - $allToBeChekced = array('core.delete','core.edit.created_by','core.edit.state','core.edit.created'); + $allToBeChekced = array('core.delete', 'core.edit.created_by', 'core.edit.state', 'core.edit.created'); foreach ($allToBeChekced as $core_permission) { - if ($coreLoad && isset($core[$core_permission]) && isset($this->permissionBuilder['global'][$core[$core_permission]]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core[$core_permission]]) && in_array($viewName_single,$this->permissionBuilder['global'][$core[$core_permission]])) + if ($coreLoad && isset($core[$core_permission]) && isset($this->permissionBuilder['global'][$core[$core_permission]]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core[$core_permission]]) && in_array($viewName_single, $this->permissionBuilder['global'][$core[$core_permission]])) { // set permissions. - $publishingPer[] = "\$this->canDo->get('".$core[$core_permission]."')"; + $publishingPer[] = "\$this->canDo->get('" . $core[$core_permission] . "')"; } else { // set permissions. - $publishingPer[] = "\$this->canDo->get('".$core_permission."')"; + $publishingPer[] = "\$this->canDo->get('" . $core_permission . "')"; } } - $body .= PHP_EOL.PHP_EOL."\t"; + $body .= PHP_EOL . PHP_EOL . "\t"; // set the default publishing tab - $body .= PHP_EOL."\t"; - $body .= PHP_EOL."\t\t".'
'; + $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . "\t\t" . '
'; if ($items_one) { - $body .= PHP_EOL."\t\t\t".'
'; - $body .= PHP_EOL."\t\t\t\t"; - $body .= PHP_EOL."\t\t\t
"; + $body .= PHP_EOL . "\t\t\t" . '
'; + $body .= PHP_EOL . "\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t
"; } if ($items_two) { - $body .= PHP_EOL."\t\t\t".'
'; - $body .= PHP_EOL."\t\t\t\t"; - $body .= PHP_EOL."\t\t\t
"; + $body .= PHP_EOL . "\t\t\t" . '
'; + $body .= PHP_EOL . "\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t
"; } - $body .= PHP_EOL."\t\t
"; - $body .= PHP_EOL."\t"; - $body .= PHP_EOL."\t"; + $body .= PHP_EOL . "\t\t
"; + $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . "\t"; } // make sure we dont load it to a view with the name component if ($viewName_single != 'component') { // set permissions tab lang - $tabLangName = $langView.'_PERMISSION'; + $tabLangName = $langView . '_PERMISSION'; // set permissions tab code name $tabCodeName = 'permissions'; // add to lang array @@ -6943,57 +6944,57 @@ class Interpretation extends Fields $this->langContent[$this->lang][$tabLangName] = 'Permissions'; } // set the permissions tab - $body .= PHP_EOL.PHP_EOL."\tcanDo->get('core.admin')) : ?>"; - $body .= PHP_EOL."\t"; - $body .= PHP_EOL."\t\t".'
'; - $body .= PHP_EOL."\t\t\t".'
'; - $body .= PHP_EOL."\t\t\t\t".'
'; - $body .= PHP_EOL."\t\t\t\t\t".'
'; - $body .= PHP_EOL."\t\t\t\t\tform->getFieldset('accesscontrol') as \$field): ?>"; - $body .= PHP_EOL."\t\t\t\t\t\t
"; - $body .= PHP_EOL."\t\t\t\t\t\t\tlabel; echo \$field->input;?>"; - $body .= PHP_EOL."\t\t\t\t\t\t
"; - $body .= PHP_EOL."\t\t\t\t\t\t".'
'; - $body .= PHP_EOL."\t\t\t\t\t"; - $body .= PHP_EOL."\t\t\t\t\t
"; - $body .= PHP_EOL."\t\t\t\t
"; - $body .= PHP_EOL."\t\t\t
"; - $body .= PHP_EOL."\t\t
"; - $body .= PHP_EOL."\t"; - $body .= PHP_EOL."\t"; + $body .= PHP_EOL . PHP_EOL . "\tcanDo->get('core.admin')) : ?>"; + $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . "\t\t" . '
'; + $body .= PHP_EOL . "\t\t\t" . '
'; + $body .= PHP_EOL . "\t\t\t\t" . '
'; + $body .= PHP_EOL . "\t\t\t\t\t" . '
'; + $body .= PHP_EOL . "\t\t\t\t\tform->getFieldset('accesscontrol') as \$field): ?>"; + $body .= PHP_EOL . "\t\t\t\t\t\t
"; + $body .= PHP_EOL . "\t\t\t\t\t\t\tlabel; echo \$field->input;?>"; + $body .= PHP_EOL . "\t\t\t\t\t\t
"; + $body .= PHP_EOL . "\t\t\t\t\t\t" . '
'; + $body .= PHP_EOL . "\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\t
"; + $body .= PHP_EOL . "\t\t\t\t
"; + $body .= PHP_EOL . "\t\t\t
"; + $body .= PHP_EOL . "\t\t
"; + $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . "\t"; } // end the tab set - $body .= PHP_EOL.PHP_EOL."\t"; - $body .= PHP_EOL.PHP_EOL."\t
"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t
"; - $body .= PHP_EOL."\t
"; - $body .= PHP_EOL."
"; + $body .= PHP_EOL . PHP_EOL . "\t"; + $body .= PHP_EOL . PHP_EOL . "\t
"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t
"; + $body .= PHP_EOL . "\t
"; + $body .= PHP_EOL . "
"; // check if left has been set - if (strlen($leftside) > 0 ) + if (strlen($leftside) > 0) { - $left = '
'.$leftside.PHP_EOL."
"; + $left = '
' . $leftside . PHP_EOL . "
"; } else { $left = ''; } // check if right has been set - if (strlen($rightside) > 0 ) + if (strlen($rightside) > 0) { - $right = '
'.$rightside.PHP_EOL."
"; + $right = '
' . $rightside . PHP_EOL . "
"; } else { $right = ''; } // set active tab and return - return $header.$left.$body.$right.$footer; + return $header . $left . $body . $right . $footer; } return ''; } - + public function setFadeInEfect(&$view) { // check if we should load the fade in affect @@ -7004,7 +7005,7 @@ class Interpretation extends Fields $fadein[] = "\t// waiting spinner"; $fadein[] = "\tvar outerDiv = jQuery('body');"; $fadein[] = "\tjQuery('
')"; - $fadein[] = "\t\t.css(\"background\", \"rgba(255, 255, 255, .8) url('components/com_".$this->fileContentStatic['###component###']."/assets/images/import.gif') 50% 15% no-repeat\")"; + $fadein[] = "\t\t.css(\"background\", \"rgba(255, 255, 255, .8) url('components/com_" . $this->fileContentStatic['###component###'] . "/assets/images/import.gif') 50% 15% no-repeat\")"; $fadein[] = "\t\t.css(\"top\", outerDiv.position().top - jQuery(window).scrollTop())"; $fadein[] = "\t\t.css(\"left\", outerDiv.position().left - jQuery(window).scrollLeft())"; $fadein[] = "\t\t.css(\"width\", outerDiv.width())"; @@ -7018,15 +7019,15 @@ class Interpretation extends Fields $fadein[] = "\tjQuery('#loading').show();"; $fadein[] = "\t// when page is ready remove and show"; $fadein[] = "\tjQuery(window).load(function() {"; - $fadein[] = "\t\tjQuery('#".$this->fileContentStatic['###component###']."_loader').fadeIn('fast');"; + $fadein[] = "\t\tjQuery('#" . $this->fileContentStatic['###component###'] . "_loader').fadeIn('fast');"; $fadein[] = "\t\tjQuery('#loading').hide();"; $fadein[] = "\t});"; $fadein[] = ""; - $fadein[] = "
fileContentStatic['###component###']."_loader\" style=\"display: none;\">"; + $fadein[] = "
fileContentStatic['###component###'] . "_loader\" style=\"display: none;\">"; return implode(PHP_EOL, $fadein); } - return "
fileContentStatic['###component###']."_loader\">"; + return "
fileContentStatic['###component###'] . "_loader\">"; } /** @@ -7034,33 +7035,33 @@ class Interpretation extends Fields * @param $layoutName * @param $items * @param $type - */ + */ public function setLayout($viewName_single, $layoutName, $items, $type) { // first build the layout file $target = array('admin' => $viewName_single); - $this->buildDynamique($target,$type,$layoutName); + $this->buildDynamique($target, $type, $layoutName); // add to front if needed if ($this->lang === 'both') { $target = array('site' => $viewName_single); - $this->buildDynamique($target,$type,$layoutName); + $this->buildDynamique($target, $type, $layoutName); } if (ComponentbuilderHelper::checkString($items)) { // ###LAYOUTITEMS### <<>> - $this->fileContentDynamic[$viewName_single.'_'.$layoutName]['###LAYOUTITEMS###'] = $items; + $this->fileContentDynamic[$viewName_single . '_' . $layoutName]['###LAYOUTITEMS###'] = $items; } else { // ###LAYOUTITEMS### <<>> - $this->fileContentDynamic[$viewName_single.'_'.$layoutName]['###bogus###'] = 'boom'; + $this->fileContentDynamic[$viewName_single . '_' . $layoutName]['###bogus###'] = 'boom'; } } /** * @param $args - */ + */ public function setLinkedView($args) { /** @@ -7074,7 +7075,7 @@ class Interpretation extends Fields */ extract($args, EXTR_PREFIX_SAME, "oops"); $single = ''; - $list = ''; + $list = ''; foreach ($this->componentData->admin_views as $array) { if ($array['adminview'] == $viewId) @@ -7088,52 +7089,52 @@ class Interpretation extends Fields { $head = $this->setListHeadLinked($single, $list, $addNewButon, $viewName_single); $body = $this->setListBodyLinked($single, $list, $viewName_single); - $functionName = ComponentbuilderHelper::safeString($codeName,'F'); + $functionName = ComponentbuilderHelper::safeString($codeName, 'F'); // ###LAYOUTITEMSTABLE### <<>> - $this->fileContentDynamic[$viewName_single.'_'.$layoutCodeName]['###LAYOUTITEMSTABLE###'] = $head.$body; + $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSTABLE###'] = $head . $body; // ###LAYOUTITEMSHEADER### <<>> - $headerscript = '$edit = "index.php?option=com_'.$this->fileContentStatic['###component###'].'&view='.$list.'&task='.$single.'.edit";'; + $headerscript = '$edit = "index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $list . '&task=' . $single . '.edit";'; if ($addNewButon > 0) { // add the link for new if ($addNewButon == 1 || $addNewButon == 2) { - $headerscript .= PHP_EOL.'$ref = ($id) ? "&ref='.$viewName_single.'&refid=".$id : "";'; - $headerscript .= PHP_EOL.'$new = "index.php?option=com_'.$this->fileContentStatic['###component###'].'&view='.$single.'&layout=edit".$ref;'; + $headerscript .= PHP_EOL . '$ref = ($id) ? "&ref=' . $viewName_single . '&refid=".$id : "";'; + $headerscript .= PHP_EOL . '$new = "index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $single . '&layout=edit".$ref;'; } // and the link for close and new if ($addNewButon == 2 || $addNewButon == 3) { - $headerscript .= PHP_EOL.'$close_new = "index.php?option=com_'.$this->fileContentStatic['###component###'].'&view='.$single.'&layout=edit";'; + $headerscript .= PHP_EOL . '$close_new = "index.php?option=com_' . $this->fileContentStatic['###component###'] . '&view=' . $single . '&layout=edit";'; } - $headerscript .= PHP_EOL.'$can = '.$this->fileContentStatic['###Component###'].'Helper::getActions('."'".$single."'".');'; + $headerscript .= PHP_EOL . '$can = ' . $this->fileContentStatic['###Component###'] . 'Helper::getActions(' . "'" . $single . "'" . ');'; } - $this->fileContentDynamic[$viewName_single.'_'.$layoutCodeName]['###LAYOUTITEMSHEADER###'] = $headerscript; + $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSHEADER###'] = $headerscript; // ###LINKEDVIEWITEMS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get Linked view data".PHP_EOL."\t\t\$this->".$codeName."\t\t= \$this->get('".$functionName."');"; + $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get Linked view data" . PHP_EOL . "\t\t\$this->" . $codeName . "\t\t= \$this->get('" . $functionName . "');"; // ###LINKEDVIEWTABLESCRIPTS### <<>> $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = $this->setFootableScripts(); - if(strpos($parentKey, '-R>') !== false || strpos($parentKey, '-A>') !== false) + if (strpos($parentKey, '-R>') !== false || strpos($parentKey, '-A>') !== false) { - list($parent_key) = explode('-',$parentKey); + list($parent_key) = explode('-', $parentKey); } - elseif(strpos($parentKey, '-OR>') !== false) + elseif (strpos($parentKey, '-OR>') !== false) { // this is not good... (TODO) - $parent_keys = explode('-OR>',$parentKey); + $parent_keys = explode('-OR>', $parentKey); } else { $parent_key = $parentKey; } - - if(strpos($key, '-R>') !== false || strpos($key, '-A>') !== false) + + if (strpos($key, '-R>') !== false || strpos($key, '-A>') !== false) { - list($_key) = explode('-',$key); + list($_key) = explode('-', $key); } - elseif(strpos($key, '-OR>') !== false) + elseif (strpos($key, '-OR>') !== false) { - $_key = str_replace('-OR>', '',$key); + $_key = str_replace('-OR>', '', $key); } else { @@ -7145,23 +7146,23 @@ class Interpretation extends Fields $globalKey = array(); foreach ($parent_keys as $parent_key) { - $globalKey[$parent_key] = ComponentbuilderHelper::safeString($_key.$this->uniquekey(4)); - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] .= PHP_EOL."\t\t\$this->".$globalKey[$parent_key]." = \$item->".$parent_key.";"; + $globalKey[$parent_key] = ComponentbuilderHelper::safeString($_key . $this->uniquekey(4)); + $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] .= PHP_EOL . "\t\t\$this->" . $globalKey[$parent_key] . " = \$item->" . $parent_key . ";"; } } else { // set the global key - $globalKey = ComponentbuilderHelper::safeString($_key.$this->uniquekey(4)); - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] .= PHP_EOL."\t\t\$this->".$globalKey." = \$item->".$parent_key.";"; + $globalKey = ComponentbuilderHelper::safeString($_key . $this->uniquekey(4)); + $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] .= PHP_EOL . "\t\t\$this->" . $globalKey . " = \$item->" . $parent_key . ";"; } // ###LINKEDVIEWMETHODS### <<>> $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWMETHODS###'] .= $this->setListQueryLinked($single, $list, $functionName, $key, $_key, $parentKey, $parent_key, $globalKey); } else { - $this->fileContentDynamic[$viewName_single.'_'.$layoutCodeName]['###LAYOUTITEMSTABLE###'] = 'oops! error.....'; - $this->fileContentDynamic[$viewName_single.'_'.$layoutCodeName]['###LAYOUTITEMSHEADER###'] = ''; + $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSTABLE###'] = 'oops! error.....'; + $this->fileContentDynamic[$viewName_single . '_' . $layoutCodeName]['###LAYOUTITEMSHEADER###'] = ''; } } @@ -7173,41 +7174,41 @@ class Interpretation extends Fields { if (!isset($this->footableVersion) || 2 == $this->footableVersion) // loading version 2 { - $foo = PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Add the CSS for Footable."; - $foo .= PHP_EOL."\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v2/css/footable.core.min.css');"; - $foo .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Use the Metro Style"; - $foo .= PHP_EOL."\t\tif (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)"; - $foo .= PHP_EOL."\t\t{"; - $foo .= PHP_EOL."\t\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v2/css/footable.metro.min.css');"; - $foo .= PHP_EOL."\t\t}"; - $foo .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Use the Legacy Style."; - $foo .= PHP_EOL."\t\telseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)"; - $foo .= PHP_EOL."\t\t{"; - $foo .= PHP_EOL."\t\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v2/css/footable.standalone.min.css');"; - $foo .= PHP_EOL."\t\t}"; - $foo .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Add the JavaScript for Footable"; - $foo .= PHP_EOL."\t\t\$this->document->addScript(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v2/js/footable.js');"; - $foo .= PHP_EOL."\t\t\$this->document->addScript(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v2/js/footable.sort.js');"; - $foo .= PHP_EOL."\t\t\$this->document->addScript(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v2/js/footable.filter.js');"; - $foo .= PHP_EOL."\t\t\$this->document->addScript(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v2/js/footable.paginate.js');"; + $foo = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the CSS for Footable."; + $foo .= PHP_EOL . "\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/css/footable.core.min.css');"; + $foo .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Use the Metro Style"; + $foo .= PHP_EOL . "\t\tif (!isset(\$this->fooTableStyle) || 0 == \$this->fooTableStyle)"; + $foo .= PHP_EOL . "\t\t{"; + $foo .= PHP_EOL . "\t\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/css/footable.metro.min.css');"; + $foo .= PHP_EOL . "\t\t}"; + $foo .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Use the Legacy Style."; + $foo .= PHP_EOL . "\t\telseif (isset(\$this->fooTableStyle) && 1 == \$this->fooTableStyle)"; + $foo .= PHP_EOL . "\t\t{"; + $foo .= PHP_EOL . "\t\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/css/footable.standalone.min.css');"; + $foo .= PHP_EOL . "\t\t}"; + $foo .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/js/footable.js');"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/js/footable.sort.js');"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/js/footable.filter.js');"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v2/js/footable.paginate.js');"; if ($init) { - $foo .= PHP_EOL.PHP_EOL."\t\t".'$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('."'.footable'".').footable(); }); jQuery('."'.nav-tabs'".').on('."'click'".', '."'li'".', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery('."'.footable'".').trigger('."'footable_resize'".'); }";'; - $foo .= PHP_EOL."\t\t\$this->document->addScriptDeclaration(\$footable);".PHP_EOL; + $foo .= PHP_EOL . PHP_EOL . "\t\t" . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable(); }); jQuery(' . "'.nav-tabs'" . ').on(' . "'click'" . ', ' . "'li'" . ', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery(' . "'.footable'" . ').trigger(' . "'footable_resize'" . '); }";'; + $foo .= PHP_EOL . "\t\t\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; } } elseif (3 == $this->footableVersion) // loading version 3 { - - $foo = PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Add the CSS for Footable"; - $foo .= PHP_EOL."\t\t\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');"; - $foo .= PHP_EOL."\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v3/css/footable.standalone.min.css');"; - $foo .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Add the JavaScript for Footable (adding all funtions)"; - $foo .= PHP_EOL."\t\t\$this->document->addScript(JURI::root() .'media/com_".$this->fileContentStatic['###component###']."/footable-v3/js/footable.min.js');"; + + $foo = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the CSS for Footable"; + $foo .= PHP_EOL . "\t\t\$this->document->addStyleSheet('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');"; + $foo .= PHP_EOL . "\t\t\$this->document->addStyleSheet(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v3/css/footable.standalone.min.css');"; + $foo .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the JavaScript for Footable (adding all funtions)"; + $foo .= PHP_EOL . "\t\t\$this->document->addScript(JURI::root() .'media/com_" . $this->fileContentStatic['###component###'] . "/footable-v3/js/footable.min.js');"; if ($init) { - $foo .= PHP_EOL.PHP_EOL."\t\t".'$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('."'.footable'".').footable();});});";'; - $foo .= PHP_EOL."\t\t\$this->document->addScriptDeclaration(\$footable);".PHP_EOL; + $foo .= PHP_EOL . PHP_EOL . "\t\t" . '$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery(' . "'.footable'" . ').footable();});});";'; + $foo .= PHP_EOL . "\t\t\$this->document->addScriptDeclaration(\$footable);" . PHP_EOL; } } return $foo; @@ -7218,13 +7219,13 @@ class Interpretation extends Fields * @param $viewName_list * @param $refview * @return string - */ + */ public function setListBodyLinked($viewName_single, $viewName_list, $refview) { if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) { // component helper name - $Helper = $this->fileContentStatic['###Component###'].'Helper'; + $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; // make sure the custom links are only added once $firstTimeBeingAdded = true; // setup correct core target @@ -7236,14 +7237,14 @@ class Interpretation extends Fields } $counter = 0; // add the default - $body = PHP_EOL.""; - $body .= PHP_EOL." \$item): ?>"; - $body .= PHP_EOL."\tauthorise('core.manage', 'com_checkin') || \$item->checked_out == \$user->id || \$item->checked_out == 0;"; - $body .= PHP_EOL."\t\t\$userChkOut = JFactory::getUser(\$item->checked_out);"; - $body .= PHP_EOL."\t\t\$canDo = ".$Helper."::getActions('".$viewName_single."',\$item,'".$viewName_list."');"; - $body .= PHP_EOL."\t?>"; - $body .= PHP_EOL."\t".''; + $body = PHP_EOL . ""; + $body .= PHP_EOL . " \$item): ?>"; + $body .= PHP_EOL . "\tauthorise('core.manage', 'com_checkin') || \$item->checked_out == \$user->id || \$item->checked_out == 0;"; + $body .= PHP_EOL . "\t\t\$userChkOut = JFactory::getUser(\$item->checked_out);"; + $body .= PHP_EOL . "\t\t\$canDo = " . $Helper . "::getActions('" . $viewName_single . "',\$item,'" . $viewName_list . "');"; + $body .= PHP_EOL . "\t?>"; + $body .= PHP_EOL . "\t" . ''; // check if this view has fields that should not be escaped $doNotEscape = false; if (isset($this->doNotEscape[$viewName_list])) @@ -7260,33 +7261,32 @@ class Interpretation extends Fields $item['id'] = $item['code']; if (!$item['multiple']) { - $item['code'] = $item['code'].'_'.$item['custom']['text']; + $item['code'] = $item['code'] . '_' . $item['custom']['text']; } } // check if translated vlaue is used - if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) - && array_key_exists($item['code'],$this->selectionTranslationFixBuilder[$viewName_list])) + if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($item['code'], $this->selectionTranslationFixBuilder[$viewName_list])) { - $itemCode = ''.$item['code'].'); ?>'; + $itemCode = '' . $item['code'] . '); ?>'; } elseif ($item['custom']['text'] === 'user') { - $itemCode = ''.$item['code'].')->name; ?>'; + $itemCode = '' . $item['code'] . ')->name; ?>'; } elseif ($doNotEscape) { if (in_array($item['code'], $this->doNotEscape[$viewName_list])) { - $itemCode = ''.$item['code'].'; ?>'; + $itemCode = '' . $item['code'] . '; ?>'; } else { - $itemCode = 'escape($item->'.$item['code'].'); ?>'; + $itemCode = 'escape($item->' . $item['code'] . '); ?>'; } } else { - $itemCode = 'escape($item->'.$item['code'].'); ?>'; + $itemCode = 'escape($item->' . $item['code'] . '); ?>'; } if ($item['link']) @@ -7298,25 +7298,25 @@ class Interpretation extends Fields { $otherViews = $this->catCodeBuilder[$viewName_single]['views']; // category and linked - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tauthorise('core.edit', 'com_".$this->fileContentStatic['###component###'].".".$otherViews.".category.' . (int)\$item->".$item['code'].")): ?>"; - $body .= PHP_EOL."\t\t\t\t".'escape($item->category_title); ?>'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'escape($item->category_title); ?>'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\tescape(\$item->category_title); ?>"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; } elseif ($item['type'] === 'user' && !$item['title']) { // user and linked - $body .= PHP_EOL."\t\t".$item['code']."); ?>"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL."\t\t\t\t".'name; ?>'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\tname; ?>"; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\tname; ?>"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; } else { @@ -7326,18 +7326,18 @@ class Interpretation extends Fields if ($refview === $item['custom']['view']) { // normal not linked - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t\t".$itemCode; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t\t" . $itemCode; + $body .= PHP_EOL . "\t\t"; $add = false; } else { // link to that item instead - $link = 'index.php?option='.$item['custom']['component'].'&view='.$item['custom']['views'].'&task='.$item['custom']['view'].'.edit&id='.$item['id'].'; ?>&ref='.$refview.'&refid='; + $link = 'index.php?option=' . $item['custom']['component'] . '&view=' . $item['custom']['views'] . '&task=' . $item['custom']['view'] . '.edit&id=' . $item['id'] . '; ?>&ref=' . $refview . '&refid='; + - $coreLoadLink = false; if (isset($this->permissionCore[$item['custom']['view']])) { @@ -7345,56 +7345,55 @@ class Interpretation extends Fields $coreLoadLink = true; } // check if the item has permissions. - if ($coreLoadLink && isset($this->permissionBuilder[$coreLink['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'],$this->permissionBuilder[$coreLink['core.edit']])) + if ($coreLoadLink && isset($this->permissionBuilder[$coreLink['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$coreLink['core.edit']]) && in_array($item['custom']['view'], $this->permissionBuilder[$coreLink['core.edit']])) { - $accessCheck = "\$user->authorise('".$coreLink['core.edit']."', 'com_".$this->fileContentStatic['###component###'].".".$item['custom']['view'].".' . (int)\$item->".$item['id'].")"; + $accessCheck = "\$user->authorise('" . $coreLink['core.edit'] . "', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; } else { - $accessCheck = "\$user->authorise('core.edit', 'com_".$this->fileContentStatic['###component###'].".".$item['custom']['view'].".' . (int)\$item->".$item['id'].")"; + $accessCheck = "\$user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $item['custom']['view'] . ".' . (int)\$item->" . $item['id'] . ")"; } } } elseif (isset($item['custom']) && ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user' && !$item['title']) { // user and linked - $body .= PHP_EOL."\t\t".$item['id']."); ?>"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL."\t\t\t\t".'name; ?>'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\tname; ?>"; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\tname; ?>"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; $add = false; } else { - $link = '&id=id; ?>&ref='.$refview.'&refid='; + $link = '&id=id; ?>&ref=' . $refview . '&refid='; // check if custom links should be added to this list views if (isset($this->customAdminViewListLink[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customAdminViewListLink[$viewName_list]) && $firstTimeBeingAdded) { // make sure the custom links are only added once $firstTimeBeingAdded = false; // start building the links - $customAdminView = PHP_EOL."\t\t\t".'
'; + $customAdminView = PHP_EOL . "\t\t\t" . '
'; foreach ($this->customAdminViewListLink[$viewName_list] as $customLinkView) { - $customAdminView .= PHP_EOL."\t\t\tget('".$customLinkView['link'].".access')): ?>"; - $customAdminView .= PHP_EOL."\t\t\t\t".'fileContentStatic['###COMPONENT###'].'_'.$customLinkView['NAME']."'".'); ?>" >'; - $customAdminView .= PHP_EOL."\t\t\t"; - $customAdminView .= PHP_EOL."\t\t\t\t".'fileContentStatic['###COMPONENT###'].'_'.$customLinkView['NAME']."'".'); ?>">'; - $customAdminView .= PHP_EOL."\t\t\t"; + $customAdminView .= PHP_EOL . "\t\t\tget('" . $customLinkView['link'] . ".access')): ?>"; + $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>" >'; + $customAdminView .= PHP_EOL . "\t\t\t"; + $customAdminView .= PHP_EOL . "\t\t\t\t" . 'fileContentStatic['###COMPONENT###'] . '_' . $customLinkView['NAME'] . "'" . '); ?>">'; + $customAdminView .= PHP_EOL . "\t\t\t"; } - $customAdminView .= PHP_EOL."\t\t\t".'
'; - + $customAdminView .= PHP_EOL . "\t\t\t" . '
'; } // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']])) { // set permissions. - $accessCheck = "\$canDo->get('".$core['core.edit']."')"; + $accessCheck = "\$canDo->get('" . $core['core.edit'] . "')"; } else { @@ -7408,20 +7407,20 @@ class Interpretation extends Fields if ($add) { // set as linked - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\t".''.$itemCode.''; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t" . '' . $itemCode . ''; if ($checkoutTriger) { - $body .= PHP_EOL."\t\t\t\t\tchecked_out): ?>"; - $body .= PHP_EOL."\t\t\t\t\t\tname, \$item->checked_out_time, '".$viewName_list.".', \$canCheckin); ?>"; - $body .= PHP_EOL."\t\t\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t\tchecked_out): ?>"; + $body .= PHP_EOL . "\t\t\t\t\t\tname, \$item->checked_out_time, '" . $viewName_list . ".', \$canCheckin); ?>"; + $body .= PHP_EOL . "\t\t\t\t\t"; } - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\t".'
'.$itemCode.'
'; - $body .= PHP_EOL."\t\t\t"; - $body .= $customAdminView; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\t" . '
' . $itemCode . '
'; + $body .= PHP_EOL . "\t\t\t"; + $body .= $customAdminView; + $body .= PHP_EOL . "\t\t"; } } } @@ -7429,93 +7428,93 @@ class Interpretation extends Fields { if ($item['type'] === 'category') { - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t\tescape(\$item->category_title); ?>"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t\tescape(\$item->category_title); ?>"; + $body .= PHP_EOL . "\t\t"; } elseif (ComponentbuilderHelper::checkArray($item['custom']) && $item['custom']['extends'] === 'user') { // custom user and linked - $body .= PHP_EOL."\t\t".$item['id']."); ?>"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tauthorise('core.edit', 'com_users')): ?>"; - $body .= PHP_EOL."\t\t\t\t".'name; ?>'; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t\t\tname; ?>"; - $body .= PHP_EOL."\t\t\t"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; + $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t\t\tname; ?>"; + $body .= PHP_EOL . "\t\t\t"; + $body .= PHP_EOL . "\t\t"; } elseif ($item['type'] === 'user') { // user name only - $body .= PHP_EOL."\t\t".$item['code']."); ?>"; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tname; ?>"; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tname; ?>"; + $body .= PHP_EOL . "\t\t"; } else { // normal not linked - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t\t\t".$itemCode; - $body .= PHP_EOL."\t\t"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\t\t" . $itemCode; + $body .= PHP_EOL . "\t\t"; } } } $counter = $counter + 2; - $data_value = (3 == $this->footableVersion) ? 'data-sort-value':'data-value'; + $data_value = (3 == $this->footableVersion) ? 'data-sort-value' : 'data-value'; // add the defaults - $body .= PHP_EOL."\t\tpublished == 1):?>"; - $body .= PHP_EOL."\t\t\t".''; - $body .= PHP_EOL."\t\t\t\t".'langPrefix."_PUBLISHED'".'); ?>">'; - $body .= PHP_EOL."\t\t\t\t\t".'langPrefix."_PUBLISHED'".'); ?>'; - $body .= PHP_EOL."\t\t\t\t".''; - $body .= PHP_EOL."\t\t\t".''; + $body .= PHP_EOL . "\t\tpublished == 1):?>"; + $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t\t" . 'langPrefix . "_PUBLISHED'" . '); ?>">'; + $body .= PHP_EOL . "\t\t\t\t\t" . 'langPrefix . "_PUBLISHED'" . '); ?>'; + $body .= PHP_EOL . "\t\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL."\t\tpublished == 0):?>"; - $body .= PHP_EOL."\t\t\t".''; - $body .= PHP_EOL."\t\t\t\t".'langPrefix."_INACTIVE'".'); ?>">'; - $body .= PHP_EOL."\t\t\t\t\t".'langPrefix."_INACTIVE'".'); ?>'; - $body .= PHP_EOL."\t\t\t\t".''; - $body .= PHP_EOL."\t\t\t".''; + $body .= PHP_EOL . "\t\tpublished == 0):?>"; + $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t\t" . 'langPrefix . "_INACTIVE'" . '); ?>">'; + $body .= PHP_EOL . "\t\t\t\t\t" . 'langPrefix . "_INACTIVE'" . '); ?>'; + $body .= PHP_EOL . "\t\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL."\t\tpublished == 2):?>"; - $body .= PHP_EOL."\t\t\t".''; - $body .= PHP_EOL."\t\t\t\t".'langPrefix."_ARCHIVED'".'); ?>">'; - $body .= PHP_EOL."\t\t\t\t\t".'langPrefix."_ARCHIVED'".'); ?>'; - $body .= PHP_EOL."\t\t\t\t".''; - $body .= PHP_EOL."\t\t\t".''; + $body .= PHP_EOL . "\t\tpublished == 2):?>"; + $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t\t" . 'langPrefix . "_ARCHIVED'" . '); ?>">'; + $body .= PHP_EOL . "\t\t\t\t\t" . 'langPrefix . "_ARCHIVED'" . '); ?>'; + $body .= PHP_EOL . "\t\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t" . ''; - $body .= PHP_EOL."\t\tpublished == -2):?>"; - $body .= PHP_EOL."\t\t\t".''; - $body .= PHP_EOL."\t\t\t\t".'langPrefix."_TRASHED'".'); ?>">'; - $body .= PHP_EOL."\t\t\t\t\t".'langPrefix."_TRASHED'".'); ?>'; - $body .= PHP_EOL."\t\t\t\t".''; - $body .= PHP_EOL."\t\t\t".''; - $body .= PHP_EOL."\t\t".''; + $body .= PHP_EOL . "\t\tpublished == -2):?>"; + $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t\t" . 'langPrefix . "_TRASHED'" . '); ?>">'; + $body .= PHP_EOL . "\t\t\t\t\t" . 'langPrefix . "_TRASHED'" . '); ?>'; + $body .= PHP_EOL . "\t\t\t\t" . ''; + $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\tid; ?>"; - $body .= PHP_EOL."\t\t"; - $body .= PHP_EOL."\t"; - $body .= PHP_EOL.""; - $body .= PHP_EOL.""; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\tid; ?>"; + $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t"; + $body .= PHP_EOL . ""; + $body .= PHP_EOL . ""; if (2 == $this->footableVersion) { - $body .= PHP_EOL.''; - $body .= PHP_EOL."\t".''; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t\t\t".''; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t".''; - $body .= PHP_EOL.''; + $body .= PHP_EOL . ''; + $body .= PHP_EOL . "\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t" . ''; + $body .= PHP_EOL . ''; } - $body .= PHP_EOL.''; - $body .= PHP_EOL.''; - $body .= PHP_EOL."\t".'
'; - $body .= PHP_EOL."\t\t".''; - $body .= PHP_EOL."\t".'
'; - $body .= PHP_EOL.''; + $body .= PHP_EOL . ''; + $body .= PHP_EOL . ''; + $body .= PHP_EOL . "\t" . '
'; + $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t" . '
'; + $body .= PHP_EOL . ''; // return the build return $body; } @@ -7527,7 +7526,7 @@ class Interpretation extends Fields if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) { // component helper name - $Helper = $this->fileContentStatic['###Component###'].'Helper'; + $Helper = $this->fileContentStatic['###Component###'] . 'Helper'; $head = ''; // only add new button if set if ($addNewButon > 0) @@ -7540,10 +7539,10 @@ class Interpretation extends Fields $coreLoad = true; } // check if the item has permissions. - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) { // set permissions. - $accessCheck = "\$can->get('".$core['core.create']."')"; + $accessCheck = "\$can->get('" . $core['core.create'] . "')"; } else { @@ -7551,52 +7550,52 @@ class Interpretation extends Fields $accessCheck = "\$can->get('core.create')"; } // add a button for new - $head = ''; + $head = ''; // make group button if needed $tabB = ""; if ($addNewButon == 2) { - $head .= PHP_EOL."\t".'
'; + $head .= PHP_EOL . "\t" . '
'; $tabB = "\t"; } // add the new buttons if ($addNewButon == 1 || $addNewButon == 2) { - $head .= PHP_EOL.$tabB."\t".' langPrefix."_NEW'".'); ?>'; + $head .= PHP_EOL . $tabB . "\t" . ' langPrefix . "_NEW'" . '); ?>'; } // add the close and new button if ($addNewButon == 2 || $addNewButon == 3) { - $head .= PHP_EOL.$tabB."\t".' langPrefix."_CLOSE_NEW'".'); ?>'; + $head .= PHP_EOL . $tabB . "\t" . ' langPrefix . "_CLOSE_NEW'" . '); ?>'; } // close group button if needed if ($addNewButon == 2) { - $head .= PHP_EOL."\t".'


'; + $head .= PHP_EOL . "\t" . '


'; } else { $head .= '

'; } - $head .= PHP_EOL.''.PHP_EOL; + $head .= PHP_EOL . '' . PHP_EOL; } - $head .= ''; + $head .= ''; // set the style for V2 - $metro_blue = (2 == $this->footableVersion) ? ' metro-blue':''; + $metro_blue = (2 == $this->footableVersion) ? ' metro-blue' : ''; // set the toggle for V3 - $toggle = (3 == $this->footableVersion) ? ' data-show-toggle="true" data-toggle-column="first"':''; + $toggle = (3 == $this->footableVersion) ? ' data-show-toggle="true" data-toggle-column="first"' : ''; // set paging - $paging = (2 == $this->footableVersion) ?' data-page-size="20" data-filter="#filter_'.$viewName_list.'"':' data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true"'; + $paging = (2 == $this->footableVersion) ? ' data-page-size="20" data-filter="#filter_' . $viewName_list . '"' : ' data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true"'; // add html fix for V3 - $htmlFix = (3 == $this->footableVersion) ? ' data-type="html" data-sort-use="text"':''; - $head .= PHP_EOL.''; - $head .= PHP_EOL.""; + $htmlFix = (3 == $this->footableVersion) ? ' data-type="html" data-sort-use="text"' : ''; + $head .= PHP_EOL . '
'; + $head .= PHP_EOL . ""; // main lang prefix - $langView = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($viewName_single,'U'); + $langView = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($viewName_single, 'U'); // set status lang - $statusLangName = $langView.'_STATUS'; + $statusLangName = $langView . '_STATUS'; // set id lang - $idLangName = $langView.'_ID'; + $idLangName = $langView . '_ID'; // make sure only first link is used as togeler $firstLink = true; // add to lang array @@ -7605,17 +7604,17 @@ class Interpretation extends Fields $this->langContent[$this->lang][$statusLangName] = 'Status'; } // add to lang array - if (!isset($this->langContent[$this->lang][$idLangName ])) + if (!isset($this->langContent[$this->lang][$idLangName])) { $this->langContent[$this->lang][$idLangName] = 'Id'; } - $head .= PHP_EOL."\t"; + $head .= PHP_EOL . "\t"; // set controller for data hiding options $controller = 1; // build the dynamic fields foreach ($this->listBuilder[$viewName_list] as $item) { - $setin = (2 == $this->footableVersion) ? ' data-hide="phone"':' data-breakpoints="xs sm"'; + $setin = (2 == $this->footableVersion) ? ' data-hide="phone"' : ' data-breakpoints="xs sm"'; if ($controller > 3) { $setin = (2 == $this->footableVersion) ? ' data-hide="phone,tablet"' : ' data-breakpoints="xs sm md"'; @@ -7623,31 +7622,31 @@ class Interpretation extends Fields if ($controller > 6) { - $setin = (2 == $this->footableVersion) ? ' data-hide="all"':' data-breakpoints="all"'; + $setin = (2 == $this->footableVersion) ? ' data-hide="all"' : ' data-breakpoints="all"'; } if ($item['link'] && $firstLink) { - $setin = (2 == $this->footableVersion) ? ' data-toggle="true"':''; + $setin = (2 == $this->footableVersion) ? ' data-toggle="true"' : ''; $firstLink = false; } - $head .= PHP_EOL."\t\t"; - $head .= PHP_EOL."\t\t\t"; - $head .= PHP_EOL."\t\t"; + $head .= PHP_EOL . "\t\t"; + $head .= PHP_EOL . "\t\t\t"; + $head .= PHP_EOL . "\t\t"; $controller++; } // set some V3 attr $data_hide = (2 == $this->footableVersion) ? 'data-hide="phone,tablet"' : 'data-breakpoints="xs sm md"'; - $data_type = (2 == $this->footableVersion) ? 'data-type="numeric"':'data-type="number"'; + $data_type = (2 == $this->footableVersion) ? 'data-type="numeric"' : 'data-type="number"'; // set default - $head .= PHP_EOL."\t\t".'"; - $head .= PHP_EOL."\t\t".'"; - $head .= PHP_EOL."\t"; - $head .= PHP_EOL.""; + $head .= PHP_EOL . "\t\t" . '"; + $head .= PHP_EOL . "\t\t" . '"; + $head .= PHP_EOL . "\t"; + $head .= PHP_EOL . ""; return $head; } @@ -7677,60 +7676,60 @@ class Interpretation extends Fields { $addCategory = false; } - $query = PHP_EOL.PHP_EOL."\t/**"; - $query .= PHP_EOL."\t* Method to get list data."; - $query .= PHP_EOL."\t*"; - $query .= PHP_EOL."\t* @return mixed An array of data items on success, false on failure."; - $query .= PHP_EOL."\t*/"; - $query .= PHP_EOL."\tpublic function get".$functionName."()"; - $query .= PHP_EOL."\t{"; + $query = PHP_EOL . PHP_EOL . "\t/**"; + $query .= PHP_EOL . "\t* Method to get list data."; + $query .= PHP_EOL . "\t*"; + $query .= PHP_EOL . "\t* @return mixed An array of data items on success, false on failure."; + $query .= PHP_EOL . "\t*/"; + $query .= PHP_EOL . "\tpublic function get" . $functionName . "()"; + $query .= PHP_EOL . "\t{"; // setup the query - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the user object."; - $query .= PHP_EOL."\t\t\$user = JFactory::getUser();"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $query .= PHP_EOL."\t\t\$db = JFactory::getDBO();"; - $query .= PHP_EOL."\t\t\$query = \$db->getQuery(true);"; - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select some fields"; - $query .= PHP_EOL."\t\t\$query->select('a.*');"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the user object."; + $query .= PHP_EOL . "\t\t\$user = JFactory::getUser();"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . "\t\t\$db = JFactory::getDBO();"; + $query .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . "\t\t\$query->select('a.*');"; // add the category if ($addCategory) { - $query .= PHP_EOL."\t\t\$query->select(\$db->quoteName('c.title','category_title'));"; + $query .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('c.title','category_title'));"; } - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." From the ".$this->fileContentStatic['###component###']."_".$viewName_single." table"; - $query .= PHP_EOL."\t\t\$query->from(\$db->quoteName('#__".$this->fileContentStatic['###component###']."_".$viewName_single."', 'a'));"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic['###component###'] . "_" . $viewName_single . " table"; + $query .= PHP_EOL . "\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic['###component###'] . "_" . $viewName_single . "', 'a'));"; // add the category if ($addCategory) { - $query .= PHP_EOL."\t\t\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a.".$categoryCodeName."') . ' = ' . \$db->quoteName('c.id') . ')');"; + $query .= PHP_EOL . "\t\t\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; } // add custom filtering php - $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL.PHP_EOL); + $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL); // add the custom fields query $query .= $this->setCustomQuery($viewName_list, $viewName_single); if (ComponentbuilderHelper::checkString($globalKey) && - $key && strpos($key,'-R>') === false && strpos($key,'-A>') === false && strpos($key,'-OR>') === false && - $parentKey && strpos($parentKey,'-R>') === false && strpos($parentKey,'-A>') === false && strpos($parentKey,'-OR>') === false) + $key && strpos($key, '-R>') === false && strpos($key, '-A>') === false && strpos($key, '-OR>') === false && + $parentKey && strpos($parentKey, '-R>') === false && strpos($parentKey, '-A>') === false && strpos($parentKey, '-OR>') === false) { - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by ".$globalKey." global."; - $query .= PHP_EOL."\t\t\$".$globalKey." = \$this->".$globalKey.";"; - $query .= PHP_EOL."\t\tif (is_numeric(\$".$globalKey." ))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('a.".$key." = ' . (int) \$".$globalKey." );"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\telseif (is_string(\$".$globalKey."))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('a.".$key." = ' . \$db->quote(\$".$globalKey."));"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\telse"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('a.".$key." = -5');"; - $query .= PHP_EOL."\t\t}"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " global."; + $query .= PHP_EOL . "\t\t\$" . $globalKey . " = \$this->" . $globalKey . ";"; + $query .= PHP_EOL . "\t\tif (is_numeric(\$" . $globalKey . " ))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('a." . $key . " = ' . (int) \$" . $globalKey . " );"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\telseif (is_string(\$" . $globalKey . "))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('a." . $key . " = ' . \$db->quote(\$" . $globalKey . "));"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\telse"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('a." . $key . " = -5');"; + $query .= PHP_EOL . "\t\t}"; } - elseif (strpos($parentKey,'-OR>') !== false || strpos($key,'-OR>') !== false) + elseif (strpos($parentKey, '-OR>') !== false || strpos($key, '-OR>') !== false) { // get both strings - if (strpos($key,'-OR>') !== false) + if (strpos($key, '-OR>') !== false) { $ORarray = explode('-OR>', $key); } @@ -7750,214 +7749,213 @@ class Interpretation extends Fields $ORquery = array('s' => array(), 'i' => array()); foreach ($ORarray as $ORkey) { - $ORquery['i'][] = "a.".$ORkey." = ' . (int) \$".$_globalKey; - $ORquery['s'][] = "a.".$ORkey." = ' . \$db->quote(\$".$_globalKey.")"; + $ORquery['i'][] = "a." . $ORkey . " = ' . (int) \$" . $_globalKey; + $ORquery['s'][] = "a." . $ORkey . " = ' . \$db->quote(\$" . $_globalKey . ")"; } - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by ".$_globalKey." global."; - $query .= PHP_EOL."\t\t\$".$_globalKey." = \$this->".$_globalKey.";"; - $query .= PHP_EOL."\t\tif (is_numeric(\$".$_globalKey." ))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('" . implode(" . ' OR ", $ORquery['i']) . ", ' OR');"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\telseif (is_string(\$".$_globalKey."))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('" . implode(" . ' OR ", $ORquery['s']) . ", ' OR');"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\telse"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('a.".$ORkey." = -5');"; - $query .= PHP_EOL."\t\t}"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by " . $_globalKey . " global."; + $query .= PHP_EOL . "\t\t\$" . $_globalKey . " = \$this->" . $_globalKey . ";"; + $query .= PHP_EOL . "\t\tif (is_numeric(\$" . $_globalKey . " ))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('" . implode(" . ' OR ", $ORquery['i']) . ", ' OR');"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\telseif (is_string(\$" . $_globalKey . "))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('" . implode(" . ' OR ", $ORquery['s']) . ", ' OR');"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\telse"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('a." . $ORkey . " = -5');"; + $query .= PHP_EOL . "\t\t}"; } } if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) { - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Join over the asset groups."; - $query .= PHP_EOL."\t\t\$query->select('ag.title AS access_level');"; - $query .= PHP_EOL."\t\t\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by access level."; - $query .= PHP_EOL."\t\tif (\$access = \$this->getState('filter.access'))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('a.access = ' . (int) \$access);"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Implement View Level Access"; - $query .= PHP_EOL."\t\tif (!\$user->authorise('core.options', 'com_".$this->fileContentStatic['###component###']."'))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL."\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; - $query .= PHP_EOL."\t\t}"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Join over the asset groups."; + $query .= PHP_EOL . "\t\t\$query->select('ag.title AS access_level');"; + $query .= PHP_EOL . "\t\t\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by access level."; + $query .= PHP_EOL . "\t\tif (\$access = \$this->getState('filter.access'))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('a.access = ' . (int) \$access);"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Implement View Level Access"; + $query .= PHP_EOL . "\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . "\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . "\t\t}"; } - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Order the results by ordering"; - $query .= PHP_EOL."\t\t\$query->order('a.published ASC');"; - $query .= PHP_EOL."\t\t\$query->order('a.ordering ASC');"; - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Load the items"; - $query .= PHP_EOL."\t\t\$db->setQuery(\$query);"; - $query .= PHP_EOL."\t\t\$db->execute();"; - $query .= PHP_EOL."\t\tif (\$db->getNumRows())"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$items = \$db->loadObjectList();"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Order the results by ordering"; + $query .= PHP_EOL . "\t\t\$query->order('a.published ASC');"; + $query .= PHP_EOL . "\t\t\$query->order('a.ordering ASC');"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Load the items"; + $query .= PHP_EOL . "\t\t\$db->setQuery(\$query);"; + $query .= PHP_EOL . "\t\t\$db->execute();"; + $query .= PHP_EOL . "\t\tif (\$db->getNumRows())"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$items = \$db->loadObjectList();"; // ###STORE_METHOD_FIX### <<>> - $query .= $this->setGetItemsMethodStringFix($viewName_single,$this->fileContentStatic['###Component###'],"\t"); + $query .= $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###'], "\t"); // ###SELECTIONTRANSLATIONFIX### <<>> - $query .= $this->setSelectionTranslationFix($viewName_list,$this->fileContentStatic['###Component###'],"\t"); + $query .= $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic['###Component###'], "\t"); // filter by child repetable field values - if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($key,'-R>') !== false && strpos($key,'-A>') === false) + if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($key, '-R>') !== false && strpos($key, '-A>') === false) { - list($field,$target) = explode('-R>',$key); - $query .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Filter by ".$globalKey." in this Repetable Field"; - $query .= PHP_EOL."\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$items) && isset(\$this->".$globalKey."))"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\tforeach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL."\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\tif (isset(\$item->".$field.") && ".$this->fileContentStatic['###Component###']."Helper::checkJson(\$item->".$field."))"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\t\$tmpArray = json_decode(\$item->".$field.",true);"; - $query .= PHP_EOL."\t\t\t\t\t\tif (!isset(\$tmpArray['".$target."']) || !".$this->fileContentStatic['###Component###']."Helper::checkArray(\$tmpArray['".$target."']) || !in_array(\$this->".$globalKey.", \$tmpArray['".$target."']))"; - $query .= PHP_EOL."\t\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\telse"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t}"; - $query .= PHP_EOL."\t\t\telse"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\treturn false;"; - $query .= PHP_EOL."\t\t\t}"; + list($field, $target) = explode('-R>', $key); + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " in this Repetable Field"; + $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$items) && isset(\$this->" . $globalKey . "))"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . "\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\tif (isset(\$item->" . $field . ") && " . $this->fileContentStatic['###Component###'] . "Helper::checkJson(\$item->" . $field . "))"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\t\$tmpArray = json_decode(\$item->" . $field . ",true);"; + $query .= PHP_EOL . "\t\t\t\t\t\tif (!isset(\$tmpArray['" . $target . "']) || !" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$tmpArray['" . $target . "']) || !in_array(\$this->" . $globalKey . ", \$tmpArray['" . $target . "']))"; + $query .= PHP_EOL . "\t\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\telse"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . "\t\t\telse"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\treturn false;"; + $query .= PHP_EOL . "\t\t\t}"; } // filter by child array field values - if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($key,'-R>') === false && strpos($key,'-A>') !== false) + if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($key, '-R>') === false && strpos($key, '-A>') !== false) { - $query .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Filter by ".$globalKey." Array Field"; - $query .= PHP_EOL."\t\t\t\$".$globalKey." = \$this->".$globalKey.";"; - $query .= PHP_EOL."\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$items) && \$".$globalKey.")"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\tforeach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL."\t\t\t\t{"; - list($bin,$target) = explode('-A>',$key); + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " Array Field"; + $query .= PHP_EOL . "\t\t\t\$" . $globalKey . " = \$this->" . $globalKey . ";"; + $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$items) && \$" . $globalKey . ")"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . "\t\t\t\t{"; + list($bin, $target) = explode('-A>', $key); if (ComponentbuilderHelper::checkString($target)) - { - $query .= PHP_EOL."\t\t\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkJson(\$item->".$target."))"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\t\$item->".$target." = json_decode(\$item->".$target.", true);"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\telseif (!isset(\$item->".$target.") || !".$this->fileContentStatic['###Component###']."Helper::checkArray(\$item->".$target."))"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\tif (!in_array(\$".$globalKey.",\$item->".$target."))"; + { + $query .= PHP_EOL . "\t\t\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkJson(\$item->" . $target . "))"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\t\$item->" . $target . " = json_decode(\$item->" . $target . ", true);"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\telseif (!isset(\$item->" . $target . ") || !" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$item->" . $target . "))"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\tif (!in_array(\$" . $globalKey . ",\$item->" . $target . "))"; } else - { - $query .= PHP_EOL."\t\t\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkJson(\$item->".$_key."))"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\t\$item->".$_key." = json_decode(\$item->".$_key.", true);"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\telseif (!isset(\$item->".$_key.") || !".$this->fileContentStatic['###Component###']."Helper::checkArray(\$item->".$_key."))"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\tif (!in_array(\$".$globalKey.",\$item->".$_key."))"; + { + $query .= PHP_EOL . "\t\t\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkJson(\$item->" . $_key . "))"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\t\$item->" . $_key . " = json_decode(\$item->" . $_key . ", true);"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\telseif (!isset(\$item->" . $_key . ") || !" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$item->" . $_key . "))"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\tif (!in_array(\$" . $globalKey . ",\$item->" . $_key . "))"; } - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t}"; - $query .= PHP_EOL."\t\t\telse"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\treturn false;"; - $query .= PHP_EOL."\t\t\t}"; - + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . "\t\t\telse"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\treturn false;"; + $query .= PHP_EOL . "\t\t\t}"; } // filter by parent repetable field values - if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($parentKey,'-R>') !== false && strpos($parentKey,'-A>') === false) + if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($parentKey, '-R>') !== false && strpos($parentKey, '-A>') === false) { - list($bin,$target) = explode('-R>',$parentKey); - $query .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Filter by ".$_key." Repetable Field"; - $query .= PHP_EOL."\t\t\t\$".$globalKey." = json_decode(\$this->".$globalKey.",true);"; - $query .= PHP_EOL."\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$items) && isset(\$".$globalKey.") && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$".$globalKey."))"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\tforeach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL."\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\tif (\$item->".$_key." && isset(\$".$globalKey."['".$target."']) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$".$globalKey."['".$target."']))"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tif (!in_array(\$item->".$_key.",\$".$globalKey."['".$target."']))"; - $query .= PHP_EOL."\t\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\telse"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t}"; - $query .= PHP_EOL."\t\t\telse"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\treturn false;"; - $query .= PHP_EOL."\t\t\t}"; + list($bin, $target) = explode('-R>', $parentKey); + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Filter by " . $_key . " Repetable Field"; + $query .= PHP_EOL . "\t\t\t\$" . $globalKey . " = json_decode(\$this->" . $globalKey . ",true);"; + $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$items) && isset(\$" . $globalKey . ") && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$" . $globalKey . "))"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . "\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\tif (\$item->" . $_key . " && isset(\$" . $globalKey . "['" . $target . "']) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tif (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . "\t\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\telse"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . "\t\t\telse"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\treturn false;"; + $query .= PHP_EOL . "\t\t\t}"; } // filter by parent array field values - if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($parentKey,'-R>') === false && strpos($parentKey,'-A>') !== false) + if (ComponentbuilderHelper::checkString($globalKey) && $key && strpos($parentKey, '-R>') === false && strpos($parentKey, '-A>') !== false) { - $query .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Filter by ".$globalKey." Array Field"; - $query .= PHP_EOL."\t\t\t\$".$globalKey." = \$this->".$globalKey.";"; - $query .= PHP_EOL."\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$items) && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$".$globalKey."))"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\tforeach (\$items as \$nr => &\$item)"; - $query .= PHP_EOL."\t\t\t\t{"; - list($bin,$target) = explode('-A>',$parentKey); + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Filter by " . $globalKey . " Array Field"; + $query .= PHP_EOL . "\t\t\t\$" . $globalKey . " = \$this->" . $globalKey . ";"; + $query .= PHP_EOL . "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$items) && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$" . $globalKey . "))"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\tforeach (\$items as \$nr => &\$item)"; + $query .= PHP_EOL . "\t\t\t\t{"; + list($bin, $target) = explode('-A>', $parentKey); if (ComponentbuilderHelper::checkString($target)) { - $query .= PHP_EOL."\t\t\t\t\tif (\$item->".$_key." && ".$this->fileContentStatic['###Component###']."Helper::checkArray(\$".$globalKey."['".$target."']))"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tif (!in_array(\$item->".$_key.",\$".$globalKey."['".$target."']))"; + $query .= PHP_EOL . "\t\t\t\t\tif (\$item->" . $_key . " && " . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$" . $globalKey . "['" . $target . "']))"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tif (!in_array(\$item->" . $_key . ",\$" . $globalKey . "['" . $target . "']))"; } else { - $query .= PHP_EOL."\t\t\t\t\tif (\$item->".$_key.")"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tif (!in_array(\$item->".$_key.",\$".$globalKey."))"; + $query .= PHP_EOL . "\t\t\t\t\tif (\$item->" . $_key . ")"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tif (!in_array(\$item->" . $_key . ",\$" . $globalKey . "))"; } - $query .= PHP_EOL."\t\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t\telse"; - $query .= PHP_EOL."\t\t\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\t\tunset(\$items[\$nr]);"; - $query .= PHP_EOL."\t\t\t\t\t\tcontinue;"; - $query .= PHP_EOL."\t\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t\t}"; - $query .= PHP_EOL."\t\t\t}"; - $query .= PHP_EOL."\t\t\telse"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\treturn false;"; - $query .= PHP_EOL."\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t\telse"; + $query .= PHP_EOL . "\t\t\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\t\tunset(\$items[\$nr]);"; + $query .= PHP_EOL . "\t\t\t\t\t\tcontinue;"; + $query .= PHP_EOL . "\t\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t\t}"; + $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . "\t\t\telse"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\treturn false;"; + $query .= PHP_EOL . "\t\t\t}"; } - // add custom php to getitems method after all - $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL.PHP_EOL."\t"); + // add custom php to getitems method after all + $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL . PHP_EOL . "\t"); - $query .= PHP_EOL."\t\t\treturn \$items;"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\treturn false;"; - $query .= PHP_EOL."\t}"; + $query .= PHP_EOL . "\t\t\treturn \$items;"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\treturn false;"; + $query .= PHP_EOL . "\t}"; // ###SELECTIONTRANSLATIONFIXFUNC###<<>> - $query .= $this->setSelectionTranslationFixFunc($viewName_list,$this->fileContentStatic['###Component###']); + $query .= $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic['###Component###']); // fixe mothod name clash - $query = str_replace('selectionTranslation(','selectionTranslation'.$functionName.'(',$query); + $query = str_replace('selectionTranslation(', 'selectionTranslation' . $functionName . '(', $query); return $query; } @@ -7975,18 +7973,18 @@ class Interpretation extends Fields foreach ($this->customAdminDynamicButtons[$viewName_list] as $custom_button) { // Load to lang - $keyLang = $this->langPrefix.'_'.$custom_button['NAME']; - $this->langContent[$this->lang][$keyLang] = ComponentbuilderHelper::safeString($custom_button['name'],'Ww'); + $keyLang = $this->langPrefix . '_' . $custom_button['NAME']; + $this->langContent[$this->lang][$keyLang] = ComponentbuilderHelper::safeString($custom_button['name'], 'Ww'); // add cpanel button - $buttons[] = "\t\tif (\$this->canDo->get('".$custom_button['link'].".access'))"; + $buttons[] = "\t\tif (\$this->canDo->get('" . $custom_button['link'] . ".access'))"; $buttons[] = "\t\t{"; - $buttons[] = "\t\t\t//".$this->setLine(__LINE__)." add ".$custom_button['name']." button."; - $buttons[] = "\t\t\tJToolBarHelper::custom('".$viewName_list.".redirectTo".ComponentbuilderHelper::safeString($custom_button['link'],'F')."', '".$custom_button['icon']."', '', '".$keyLang."', true);"; + $buttons[] = "\t\t\t//" . $this->setLine(__LINE__) . " add " . $custom_button['name'] . " button."; + $buttons[] = "\t\t\tJToolBarHelper::custom('" . $viewName_list . ".redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "', '" . $custom_button['icon'] . "', '', '" . $keyLang . "', true);"; $buttons[] = "\t\t}"; } if (ComponentbuilderHelper::checkArray($buttons)) { - return implode(PHP_EOL,$buttons); + return implode(PHP_EOL, $buttons); } } return $buttons; @@ -8005,38 +8003,38 @@ class Interpretation extends Fields foreach ($this->customAdminDynamicButtons[$viewName_list] as $custom_button) { // add the custom redirect method - $method[] = PHP_EOL.PHP_EOL."\tpublic function redirectTo".ComponentbuilderHelper::safeString($custom_button['link'],'F')."()"; + $method[] = PHP_EOL . PHP_EOL . "\tpublic function redirectTo" . ComponentbuilderHelper::safeString($custom_button['link'], 'F') . "()"; $method[] = "\t{"; - $method[] = "\t\t//".$this->setLine(__LINE__)." Check for request forgeries"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries"; $method[] = "\t\tJSession::checkToken() or die(JText::_('JINVALID_TOKEN'));"; - $method[] = "\t\t//".$this->setLine(__LINE__)." check if export is allowed for this user."; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " check if export is allowed for this user."; $method[] = "\t\t\$user = JFactory::getUser();"; - $method[] = "\t\tif (\$user->authorise('".$custom_button['link'].".access', 'com_".$this->fileContentStatic['###component###']."'))"; + $method[] = "\t\tif (\$user->authorise('" . $custom_button['link'] . ".access', 'com_" . $this->fileContentStatic['###component###'] . "'))"; $method[] = "\t\t{"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Get the input"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the input"; $method[] = "\t\t\t\$input = JFactory::getApplication()->input;"; $method[] = "\t\t\t\$pks = \$input->post->get('cid', array(), 'array');"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Sanitize the input"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Sanitize the input"; $method[] = "\t\t\tJArrayHelper::toInteger(\$pks);"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." convert to string"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " convert to string"; $method[] = "\t\t\t\$ids = implode('_', \$pks);"; - $method[] = "\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$custom_button['link']."&cid='.\$ids, false));"; + $method[] = "\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $custom_button['link'] . "&cid='.\$ids, false));"; $method[] = "\t\t\treturn;"; $method[] = "\t\t}"; - $method[] = "\t\t//".$this->setLine(__LINE__)." Redirect to the list screen with error."; - $method[] = "\t\t\$message = JText::_('".$this->langPrefix."_ACCESS_TO_".$custom_button['NAME']."_FAILED');"; - $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$viewName_list."', false), \$message, 'error');"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; + $method[] = "\t\t\$message = JText::_('" . $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED');"; + $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');"; $method[] = "\t\treturn;"; $method[] = "\t}"; // add to lang array - $lankey = $this->langPrefix."_ACCESS_TO_".$custom_button['NAME']."_FAILED"; + $lankey = $this->langPrefix . "_ACCESS_TO_" . $custom_button['NAME'] . "_FAILED"; if (!isset($this->langContent[$this->lang][$lankey])) { - $this->langContent[$this->lang][$lankey] = 'Access to '.$custom_button['link'].' was denied.'; + $this->langContent[$this->lang][$lankey] = 'Access to ' . $custom_button['link'] . ' was denied.'; } } - return implode(PHP_EOL,$method); + return implode(PHP_EOL, $method); } return $method; } @@ -8051,83 +8049,83 @@ class Interpretation extends Fields $query = ''; if ($this->eximportView[$viewName_list]) { - $query = PHP_EOL.PHP_EOL."\t/**"; - $query .= PHP_EOL."\t* Method to get list export data."; - $query .= PHP_EOL."\t*"; - $query .= PHP_EOL."\t* @return mixed An array of data items on success, false on failure."; - $query .= PHP_EOL."\t*/"; - $query .= PHP_EOL."\tpublic function getExportData(\$pks)"; - $query .= PHP_EOL."\t{"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." setup the query"; - $query .= PHP_EOL."\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$pks))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Set a value to know this is exporting method."; - $query .= PHP_EOL."\t\t\t\$_export = true;"; - $query .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Get the user object."; - $query .= PHP_EOL."\t\t\t\$user = JFactory::getUser();"; - $query .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $query .= PHP_EOL."\t\t\t\$db = JFactory::getDBO();"; - $query .= PHP_EOL."\t\t\t\$query = \$db->getQuery(true);"; - $query .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Select some fields"; - $query .= PHP_EOL."\t\t\t\$query->select('a.*');"; - $query .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." From the ".$this->fileContentStatic['###component###']."_".$viewName_single." table"; - $query .= PHP_EOL."\t\t\t\$query->from(\$db->quoteName('#__".$this->fileContentStatic['###component###']."_".$viewName_single."', 'a'));"; - $query .= PHP_EOL."\t\t\t\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; + $query = PHP_EOL . PHP_EOL . "\t/**"; + $query .= PHP_EOL . "\t* Method to get list export data."; + $query .= PHP_EOL . "\t*"; + $query .= PHP_EOL . "\t* @return mixed An array of data items on success, false on failure."; + $query .= PHP_EOL . "\t*/"; + $query .= PHP_EOL . "\tpublic function getExportData(\$pks)"; + $query .= PHP_EOL . "\t{"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " setup the query"; + $query .= PHP_EOL . "\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$pks))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Set a value to know this is exporting method."; + $query .= PHP_EOL . "\t\t\t\$_export = true;"; + $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get the user object."; + $query .= PHP_EOL . "\t\t\t\$user = JFactory::getUser();"; + $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . "\t\t\t\$db = JFactory::getDBO();"; + $query .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . "\t\t\t\$query->select('a.*');"; + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic['###component###'] . "_" . $viewName_single . " table"; + $query .= PHP_EOL . "\t\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic['###component###'] . "_" . $viewName_single . "', 'a'));"; + $query .= PHP_EOL . "\t\t\t\$query->where('a.id IN (' . implode(',',\$pks) . ')');"; // add custom filtering php - $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL.PHP_EOL."\t"); - + $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL . "\t"); + if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) { - $query .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Implement View Level Access"; - $query .= PHP_EOL."\t\t\tif (!\$user->authorise('core.options', 'com_".$this->fileContentStatic['###component###']."'))"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL."\t\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; - $query .= PHP_EOL."\t\t\t}"; + $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Implement View Level Access"; + $query .= PHP_EOL . "\t\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . "\t\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . "\t\t\t}"; } - $query .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Order the results by ordering"; - $query .= PHP_EOL."\t\t\t\$query->order('a.ordering ASC');"; - $query .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Load the items"; - $query .= PHP_EOL."\t\t\t\$db->setQuery(\$query);"; - $query .= PHP_EOL."\t\t\t\$db->execute();"; - $query .= PHP_EOL."\t\t\tif (\$db->getNumRows())"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\$items = \$db->loadObjectList();"; + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Order the results by ordering"; + $query .= PHP_EOL . "\t\t\t\$query->order('a.ordering ASC');"; + $query .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Load the items"; + $query .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; + $query .= PHP_EOL . "\t\t\t\$db->execute();"; + $query .= PHP_EOL . "\t\t\tif (\$db->getNumRows())"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\$items = \$db->loadObjectList();"; $query .= $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###'], "\t\t", true); - // add custom php to getitems method after all - $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL.PHP_EOL."\t\t"); - $query .= PHP_EOL."\t\t\t\treturn \$items;"; - $query .= PHP_EOL."\t\t\t}"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\treturn false;"; - $query .= PHP_EOL."\t}"; + // add custom php to getitems method after all + $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL . PHP_EOL . "\t\t"); + $query .= PHP_EOL . "\t\t\t\treturn \$items;"; + $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\treturn false;"; + $query .= PHP_EOL . "\t}"; - $query .= PHP_EOL.PHP_EOL."\t/**"; - $query .= PHP_EOL."\t* Method to get header."; - $query .= PHP_EOL."\t*"; - $query .= PHP_EOL."\t* @return mixed An array of data items on success, false on failure."; - $query .= PHP_EOL."\t*/"; - $query .= PHP_EOL."\tpublic function getExImPortHeaders()"; - $query .= PHP_EOL."\t{"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get a db connection."; - $query .= PHP_EOL."\t\t\$db = JFactory::getDbo();"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." get the columns"; - $query .= PHP_EOL."\t\t\$columns = \$db->getTableColumns(".'"#__'.$this->fileContentStatic['###component###'].'_'.$viewName_single.'");'; - $query .= PHP_EOL."\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$columns))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." remove the headers you don't import/export."; - $query .= PHP_EOL."\t\t\tunset(\$columns['asset_id']);"; - $query .= PHP_EOL."\t\t\tunset(\$columns['checked_out']);"; - $query .= PHP_EOL."\t\t\tunset(\$columns['checked_out_time']);"; - $query .= PHP_EOL."\t\t\t\$headers = new stdClass();"; - $query .= PHP_EOL."\t\t\tforeach (\$columns as \$column => \$type)"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\$headers->{\$column} = \$column;"; - $query .= PHP_EOL."\t\t\t}"; - $query .= PHP_EOL."\t\t\treturn \$headers;"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\treturn false;"; - $query .= PHP_EOL."\t}"; + $query .= PHP_EOL . PHP_EOL . "\t/**"; + $query .= PHP_EOL . "\t* Method to get header."; + $query .= PHP_EOL . "\t*"; + $query .= PHP_EOL . "\t* @return mixed An array of data items on success, false on failure."; + $query .= PHP_EOL . "\t*/"; + $query .= PHP_EOL . "\tpublic function getExImPortHeaders()"; + $query .= PHP_EOL . "\t{"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; + $query .= PHP_EOL . "\t\t\$db = JFactory::getDbo();"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get the columns"; + $query .= PHP_EOL . "\t\t\$columns = \$db->getTableColumns(" . '"#__' . $this->fileContentStatic['###component###'] . '_' . $viewName_single . '");'; + $query .= PHP_EOL . "\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$columns))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " remove the headers you don't import/export."; + $query .= PHP_EOL . "\t\t\tunset(\$columns['asset_id']);"; + $query .= PHP_EOL . "\t\t\tunset(\$columns['checked_out']);"; + $query .= PHP_EOL . "\t\t\tunset(\$columns['checked_out_time']);"; + $query .= PHP_EOL . "\t\t\t\$headers = new stdClass();"; + $query .= PHP_EOL . "\t\t\tforeach (\$columns as \$column => \$type)"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\$headers->{\$column} = \$column;"; + $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . "\t\t\treturn \$headers;"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\treturn false;"; + $query .= PHP_EOL . "\t}"; } return $query; } @@ -8140,83 +8138,83 @@ class Interpretation extends Fields $method = array(); // add the export method - $method[] = PHP_EOL.PHP_EOL."\tpublic function exportData()"; + $method[] = PHP_EOL . PHP_EOL . "\tpublic function exportData()"; $method[] = "\t{"; - $method[] = "\t\t//".$this->setLine(__LINE__)." Check for request forgeries"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries"; $method[] = "\t\tJSession::checkToken() or die(JText::_('JINVALID_TOKEN'));"; - $method[] = "\t\t//".$this->setLine(__LINE__)." check if export is allowed for this user."; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " check if export is allowed for this user."; $method[] = "\t\t\$user = JFactory::getUser();"; - $method[] = "\t\tif (\$user->authorise('".$viewName_single.".export', 'com_".$this->fileContentStatic['###component###']."') && \$user->authorise('core.export', 'com_".$this->fileContentStatic['###component###']."'))"; + $method[] = "\t\tif (\$user->authorise('" . $viewName_single . ".export', 'com_" . $this->fileContentStatic['###component###'] . "') && \$user->authorise('core.export', 'com_" . $this->fileContentStatic['###component###'] . "'))"; $method[] = "\t\t{"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Get the input"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the input"; $method[] = "\t\t\t\$input = JFactory::getApplication()->input;"; $method[] = "\t\t\t\$pks = \$input->post->get('cid', array(), 'array');"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Sanitize the input"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Sanitize the input"; $method[] = "\t\t\tJArrayHelper::toInteger(\$pks);"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Get the model"; - $method[] = "\t\t\t\$model = \$this->getModel('".ComponentbuilderHelper::safeString($viewName_list,'F')."');"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." get the data to export"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the model"; + $method[] = "\t\t\t\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the data to export"; $method[] = "\t\t\t\$data = \$model->getExportData(\$pks);"; - $method[] = "\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkArray(\$data))"; + $method[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkArray(\$data))"; $method[] = "\t\t\t{"; - $method[] = "\t\t\t\t//".$this->setLine(__LINE__)." now set the data to the spreadsheet"; + $method[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " now set the data to the spreadsheet"; $method[] = "\t\t\t\t\$date = JFactory::getDate();"; - $method[] = "\t\t\t\t".$this->fileContentStatic['###Component###']."Helper::xls(\$data,'".ComponentbuilderHelper::safeString($viewName_list,'F')."_'.\$date->format('jS_F_Y'),'".ComponentbuilderHelper::safeString($viewName_list,'Ww')." exported ('.\$date->format('jS F, Y').')','".ComponentbuilderHelper::safeString($viewName_list,'w')."');"; + $method[] = "\t\t\t\t" . $this->fileContentStatic['###Component###'] . "Helper::xls(\$data,'" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "_'.\$date->format('jS_F_Y'),'" . ComponentbuilderHelper::safeString($viewName_list, 'Ww') . " exported ('.\$date->format('jS F, Y').')','" . ComponentbuilderHelper::safeString($viewName_list, 'w') . "');"; $method[] = "\t\t\t}"; $method[] = "\t\t}"; - $method[] = "\t\t//".$this->setLine(__LINE__)." Redirect to the list screen with error."; - $method[] = "\t\t\$message = JText::_('".$this->langPrefix."_EXPORT_FAILED');"; - $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$viewName_list."', false), \$message, 'error');"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; + $method[] = "\t\t\$message = JText::_('" . $this->langPrefix . "_EXPORT_FAILED');"; + $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');"; $method[] = "\t\treturn;"; $method[] = "\t}"; // add the import method - $method[] = PHP_EOL.PHP_EOL."\tpublic function importData()"; + $method[] = PHP_EOL . PHP_EOL . "\tpublic function importData()"; $method[] = "\t{"; - $method[] = "\t\t//".$this->setLine(__LINE__)." Check for request forgeries"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " Check for request forgeries"; $method[] = "\t\tJSession::checkToken() or die(JText::_('JINVALID_TOKEN'));"; - $method[] = "\t\t//".$this->setLine(__LINE__)." check if import is allowed for this user."; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " check if import is allowed for this user."; $method[] = "\t\t\$user = JFactory::getUser();"; - $method[] = "\t\tif (\$user->authorise('".$viewName_single.".import', 'com_".$this->fileContentStatic['###component###']."') && \$user->authorise('core.import', 'com_".$this->fileContentStatic['###component###']."'))"; + $method[] = "\t\tif (\$user->authorise('" . $viewName_single . ".import', 'com_" . $this->fileContentStatic['###component###'] . "') && \$user->authorise('core.import', 'com_" . $this->fileContentStatic['###component###'] . "'))"; $method[] = "\t\t{"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." Get the import model"; - $method[] = "\t\t\t\$model = \$this->getModel('".ComponentbuilderHelper::safeString($viewName_list,'F')."');"; - $method[] = "\t\t\t//".$this->setLine(__LINE__)." get the headers to import"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " Get the import model"; + $method[] = "\t\t\t\$model = \$this->getModel('" . ComponentbuilderHelper::safeString($viewName_list, 'F') . "');"; + $method[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the headers to import"; $method[] = "\t\t\t\$headers = \$model->getExImPortHeaders();"; - $method[] = "\t\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkObject(\$headers))"; + $method[] = "\t\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkObject(\$headers))"; $method[] = "\t\t\t{"; - $method[] = "\t\t\t\t//".$this->setLine(__LINE__)." Load headers to session."; + $method[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Load headers to session."; $method[] = "\t\t\t\t\$session = JFactory::getSession();"; $method[] = "\t\t\t\t\$headers = json_encode(\$headers);"; - $method[] = "\t\t\t\t\$session->set('".$viewName_single."_VDM_IMPORTHEADERS', \$headers);"; - $method[] = "\t\t\t\t\$session->set('backto_VDM_IMPORT', '".$viewName_list."');"; - $method[] = "\t\t\t\t\$session->set('dataType_VDM_IMPORTINTO', '".$viewName_single."');"; - $method[] = "\t\t\t\t//".$this->setLine(__LINE__)." Redirect to import view."; + $method[] = "\t\t\t\t\$session->set('" . $viewName_single . "_VDM_IMPORTHEADERS', \$headers);"; + $method[] = "\t\t\t\t\$session->set('backto_VDM_IMPORT', '" . $viewName_list . "');"; + $method[] = "\t\t\t\t\$session->set('dataType_VDM_IMPORTINTO', '" . $viewName_single . "');"; + $method[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Redirect to import view."; // add to lang array - $selectImportFileNote = $this->langPrefix."_IMPORT_SELECT_FILE_FOR_".ComponentbuilderHelper::safeString($viewName_list,'U'); + $selectImportFileNote = $this->langPrefix . "_IMPORT_SELECT_FILE_FOR_" . ComponentbuilderHelper::safeString($viewName_list, 'U'); if (!isset($this->langContent[$this->lang][$selectImportFileNote])) { - $this->langContent[$this->lang][$selectImportFileNote] = 'Select the file to import data to '.$viewName_list.'.'; + $this->langContent[$this->lang][$selectImportFileNote] = 'Select the file to import data to ' . $viewName_list . '.'; } - $method[] = "\t\t\t\t\$message = JText::_('".$selectImportFileNote."');"; + $method[] = "\t\t\t\t\$message = JText::_('" . $selectImportFileNote . "');"; // if this view has custom script it must have as custom import (model, veiw, controller) if (isset($this->importCustomScripts[$viewName_list]) && $this->importCustomScripts[$viewName_list]) { - $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=import_".$viewName_list."', false), \$message);"; + $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=import_" . $viewName_list . "', false), \$message);"; } else { - $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=import', false), \$message);"; + $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=import', false), \$message);"; } $method[] = "\t\t\t\treturn;"; $method[] = "\t\t\t}"; $method[] = "\t\t}"; - $method[] = "\t\t//".$this->setLine(__LINE__)." Redirect to the list screen with error."; - $method[] = "\t\t\$message = JText::_('".$this->langPrefix."_IMPORT_FAILED');"; - $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=".$viewName_list."', false), \$message, 'error');"; + $method[] = "\t\t//" . $this->setLine(__LINE__) . " Redirect to the list screen with error."; + $method[] = "\t\t\$message = JText::_('" . $this->langPrefix . "_IMPORT_FAILED');"; + $method[] = "\t\t\$this->setRedirect(JRoute::_('index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $viewName_list . "', false), \$message, 'error');"; $method[] = "\t\treturn;"; $method[] = "\t}"; - return implode(PHP_EOL,$method); + return implode(PHP_EOL, $method); } return $method; } @@ -8227,18 +8225,18 @@ class Interpretation extends Fields if (isset($this->eximportView[$viewName_list]) && $this->eximportView[$viewName_list]) { // main lang prefix - $langExport = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Export Data','U'); + $langExport = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Export Data', 'U'); // add to lang array if (!isset($this->langContent[$this->lang][$langExport])) { $this->langContent[$this->lang][$langExport] = 'Export Data'; } $button = array(); - $button[] = PHP_EOL.PHP_EOL."\t\t\tif (\$this->canDo->get('core.export') && \$this->canDo->get('".$viewName_single.".export'))"; + $button[] = PHP_EOL . PHP_EOL . "\t\t\tif (\$this->canDo->get('core.export') && \$this->canDo->get('" . $viewName_single . ".export'))"; $button[] = "\t\t\t{"; - $button[] = "\t\t\t\tJToolBarHelper::custom('".$viewName_list.".exportData', 'download', '', '".$langExport."', true);"; + $button[] = "\t\t\t\tJToolBarHelper::custom('" . $viewName_list . ".exportData', 'download', '', '" . $langExport . "', true);"; $button[] = "\t\t\t}"; - return implode(PHP_EOL,$button); + return implode(PHP_EOL, $button); } return $button; } @@ -8249,18 +8247,18 @@ class Interpretation extends Fields if (isset($this->eximportView[$viewName_list]) && $this->eximportView[$viewName_list]) { // main lang prefix - $langImport = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Import Data','U'); + $langImport = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Import Data', 'U'); // add to lang array if (!isset($this->langContent[$this->lang][$langImport])) { $this->langContent[$this->lang][$langImport] = 'Import Data'; } $button = array(); - $button[] = PHP_EOL.PHP_EOL."\t\tif (\$this->canDo->get('core.import') && \$this->canDo->get('".$viewName_single.".import'))"; + $button[] = PHP_EOL . PHP_EOL . "\t\tif (\$this->canDo->get('core.import') && \$this->canDo->get('" . $viewName_single . ".import'))"; $button[] = "\t\t{"; - $button[] = "\t\t\tJToolBarHelper::custom('".$viewName_list.".importData', 'upload', '', '".$langImport."', false);"; + $button[] = "\t\t\tJToolBarHelper::custom('" . $viewName_list . ".importData', 'upload', '', '" . $langImport . "', false);"; $button[] = "\t\t}"; - return implode(PHP_EOL,$button); + return implode(PHP_EOL, $button); } return $button; } @@ -8268,31 +8266,31 @@ class Interpretation extends Fields public function setImportCustomScripts($viewName_list) { // setup Ajax files - $target = array('admin' => 'import_'.$viewName_list); + $target = array('admin' => 'import_' . $viewName_list); $this->buildDynamique($target, 'customimport'); // load the custom script to the files // ###IMPORT_EXT_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_EXT_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_ext', 'import_'.$viewName_list, PHP_EOL, null, true); - // ###IMPORT_DISPLAY_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_DISPLAY_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_display', 'import_'.$viewName_list, PHP_EOL, null, true); - // ###IMPORT_SETDATE_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_SETDATE_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_setdata', 'import_'.$viewName_list, PHP_EOL, null, true); - // ###IMPORT_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import', 'import_'.$viewName_list, PHP_EOL, null, true); - // ###IMPORT_SAVE_METHOD_CUSTOM### <<>> - $this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_SAVE_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_save', 'import_'.$viewName_list, PHP_EOL, null, true); - // ###IMPORT_DEFAULT_VIEW_CUSTOM### <<>> - $this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_DEFAULT_VIEW_CUSTOM###'] = $this->getCustomScriptBuilder('html_import_view', 'import_'.$viewName_list, PHP_EOL, null, true); - + $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_EXT_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_ext', 'import_' . $viewName_list, PHP_EOL, null, true); + // ###IMPORT_DISPLAY_METHOD_CUSTOM### <<>> + $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_DISPLAY_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_display', 'import_' . $viewName_list, PHP_EOL, null, true); + // ###IMPORT_SETDATE_METHOD_CUSTOM### <<>> + $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_SETDATE_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_setdata', 'import_' . $viewName_list, PHP_EOL, null, true); + // ###IMPORT_METHOD_CUSTOM### <<>> + $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import', 'import_' . $viewName_list, PHP_EOL, null, true); + // ###IMPORT_SAVE_METHOD_CUSTOM### <<>> + $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_SAVE_METHOD_CUSTOM###'] = $this->getCustomScriptBuilder('php_import_save', 'import_' . $viewName_list, PHP_EOL, null, true); + // ###IMPORT_DEFAULT_VIEW_CUSTOM### <<>> + $this->fileContentDynamic['import_' . $viewName_list]['###IMPORT_DEFAULT_VIEW_CUSTOM###'] = $this->getCustomScriptBuilder('html_import_view', 'import_' . $viewName_list, PHP_EOL, null, true); + // insure we have the view placeholders setup - $this->fileContentDynamic['import_'.$viewName_list]['###VIEW###'] = 'IMPORT_'.$this->placeholders['###VIEWS###']; - $this->fileContentDynamic['import_'.$viewName_list]['###View###'] = 'Import_'.$this->placeholders['###views###']; - $this->fileContentDynamic['import_'.$viewName_list]['###view###'] = 'import_'.$this->placeholders['###views###']; - $this->fileContentDynamic['import_'.$viewName_list]['###VIEWS###'] = 'IMPORT_'.$this->placeholders['###VIEWS###']; - $this->fileContentDynamic['import_'.$viewName_list]['###Views###'] = 'Import_'.$this->placeholders['###views###']; - $this->fileContentDynamic['import_'.$viewName_list]['###views###'] = 'import_'.$this->placeholders['###views###']; + $this->fileContentDynamic['import_' . $viewName_list]['###VIEW###'] = 'IMPORT_' . $this->placeholders['###VIEWS###']; + $this->fileContentDynamic['import_' . $viewName_list]['###View###'] = 'Import_' . $this->placeholders['###views###']; + $this->fileContentDynamic['import_' . $viewName_list]['###view###'] = 'import_' . $this->placeholders['###views###']; + $this->fileContentDynamic['import_' . $viewName_list]['###VIEWS###'] = 'IMPORT_' . $this->placeholders['###VIEWS###']; + $this->fileContentDynamic['import_' . $viewName_list]['###Views###'] = 'Import_' . $this->placeholders['###views###']; + $this->fileContentDynamic['import_' . $viewName_list]['###views###'] = 'import_' . $this->placeholders['###views###']; } - + public function setListQuery($viewName_single, $viewName_list) { // check if this view has category added @@ -8306,55 +8304,55 @@ class Interpretation extends Fields $addCategory = false; } // setup the query - $query = "//".$this->setLine(__LINE__)." Get the user object."; - $query .= PHP_EOL."\t\t\$user = JFactory::getUser();"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Create a new query object."; - $query .= PHP_EOL."\t\t\$db = JFactory::getDBO();"; - $query .= PHP_EOL."\t\t\$query = \$db->getQuery(true);"; - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select some fields"; - $query .= PHP_EOL."\t\t\$query->select('a.*');"; + $query = "//" . $this->setLine(__LINE__) . " Get the user object."; + $query .= PHP_EOL . "\t\t\$user = JFactory::getUser();"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object."; + $query .= PHP_EOL . "\t\t\$db = JFactory::getDBO();"; + $query .= PHP_EOL . "\t\t\$query = \$db->getQuery(true);"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select some fields"; + $query .= PHP_EOL . "\t\t\$query->select('a.*');"; // add the category if ($addCategory) { - $query .= PHP_EOL."\t\t\$query->select(\$db->quoteName('c.title','category_title'));"; + $query .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('c.title','category_title'));"; } - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." From the ".$this->fileContentStatic['###component###']."_item table"; - $query .= PHP_EOL."\t\t\$query->from(\$db->quoteName('#__".$this->fileContentStatic['###component###']."_".$viewName_single."', 'a'));"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " From the " . $this->fileContentStatic['###component###'] . "_item table"; + $query .= PHP_EOL . "\t\t\$query->from(\$db->quoteName('#__" . $this->fileContentStatic['###component###'] . "_" . $viewName_single . "', 'a'));"; // add the category if ($addCategory) { - $query .= PHP_EOL."\t\t\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a.".$categoryCodeName."') . ' = ' . \$db->quoteName('c.id') . ')');"; + $query .= PHP_EOL . "\t\t\$query->join('LEFT', \$db->quoteName('#__categories', 'c') . ' ON (' . \$db->quoteName('a." . $categoryCodeName . "') . ' = ' . \$db->quoteName('c.id') . ')');"; } // add custom filtering php - $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL.PHP_EOL); + $query .= $this->getCustomScriptBuilder('php_getlistquery', $viewName_single, PHP_EOL . PHP_EOL); // add the custom fields query $query .= $this->setCustomQuery($viewName_list, $viewName_single); - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by published state"; - $query .= PHP_EOL."\t\t\$published = \$this->getState('filter.published');"; - $query .= PHP_EOL."\t\tif (is_numeric(\$published))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('a.published = ' . (int) \$published);"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\telseif (\$published === '')"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('(a.published = 0 OR a.published = 1)');"; - $query .= PHP_EOL."\t\t}"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by published state"; + $query .= PHP_EOL . "\t\t\$published = \$this->getState('filter.published');"; + $query .= PHP_EOL . "\t\tif (is_numeric(\$published))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('a.published = ' . (int) \$published);"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\telseif (\$published === '')"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('(a.published = 0 OR a.published = 1)');"; + $query .= PHP_EOL . "\t\t}"; if (isset($this->accessBuilder[$viewName_single]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName_single])) { - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Join over the asset groups."; - $query .= PHP_EOL."\t\t\$query->select('ag.title AS access_level');"; - $query .= PHP_EOL."\t\t\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by access level."; - $query .= PHP_EOL."\t\tif (\$access = \$this->getState('filter.access'))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->where('a.access = ' . (int) \$access);"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Implement View Level Access"; - $query .= PHP_EOL."\t\tif (!\$user->authorise('core.options', 'com_".$this->fileContentStatic['###component###']."'))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; - $query .= PHP_EOL."\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; - $query .= PHP_EOL."\t\t}"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Join over the asset groups."; + $query .= PHP_EOL . "\t\t\$query->select('ag.title AS access_level');"; + $query .= PHP_EOL . "\t\t\$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by access level."; + $query .= PHP_EOL . "\t\tif (\$access = \$this->getState('filter.access'))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->where('a.access = ' . (int) \$access);"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Implement View Level Access"; + $query .= PHP_EOL . "\t\tif (!\$user->authorise('core.options', 'com_" . $this->fileContentStatic['###component###'] . "'))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$groups = implode(',', \$user->getAuthorisedViewLevels());"; + $query .= PHP_EOL . "\t\t\t\$query->where('a.access IN (' . \$groups . ')');"; + $query .= PHP_EOL . "\t\t}"; } // set the search query $query .= $this->setSearchQuery($viewName_list); @@ -8363,37 +8361,37 @@ class Interpretation extends Fields // add the category if ($addCategory) { - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by a single or group of categories."; - $query .= PHP_EOL."\t\t\$baselevel = 1;"; - $query .= PHP_EOL."\t\t\$categoryId = \$this->getState('filter.category_id');"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by a single or group of categories."; + $query .= PHP_EOL . "\t\t\$baselevel = 1;"; + $query .= PHP_EOL . "\t\t\$categoryId = \$this->getState('filter.category_id');"; $query .= PHP_EOL; - $query .= PHP_EOL."\t\tif (is_numeric(\$categoryId))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$cat_tbl = JTable::getInstance('Category', 'JTable');"; - $query .= PHP_EOL."\t\t\t\$cat_tbl->load(\$categoryId);"; - $query .= PHP_EOL."\t\t\t\$rgt = \$cat_tbl->rgt;"; - $query .= PHP_EOL."\t\t\t\$lft = \$cat_tbl->lft;"; - $query .= PHP_EOL."\t\t\t\$baselevel = (int) \$cat_tbl->level;"; - $query .= PHP_EOL."\t\t\t\$query->where('c.lft >= ' . (int) \$lft)"; - $query .= PHP_EOL."\t\t\t\t->where('c.rgt <= ' . (int) \$rgt);"; - $query .= PHP_EOL."\t\t}"; - $query .= PHP_EOL."\t\telseif (is_array(\$categoryId))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\tJArrayHelper::toInteger(\$categoryId);"; - $query .= PHP_EOL."\t\t\t\$categoryId = implode(',', \$categoryId);"; - $query .= PHP_EOL."\t\t\t\$query->where('a.category IN (' . \$categoryId . ')');"; - $query .= PHP_EOL."\t\t}"; + $query .= PHP_EOL . "\t\tif (is_numeric(\$categoryId))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$cat_tbl = JTable::getInstance('Category', 'JTable');"; + $query .= PHP_EOL . "\t\t\t\$cat_tbl->load(\$categoryId);"; + $query .= PHP_EOL . "\t\t\t\$rgt = \$cat_tbl->rgt;"; + $query .= PHP_EOL . "\t\t\t\$lft = \$cat_tbl->lft;"; + $query .= PHP_EOL . "\t\t\t\$baselevel = (int) \$cat_tbl->level;"; + $query .= PHP_EOL . "\t\t\t\$query->where('c.lft >= ' . (int) \$lft)"; + $query .= PHP_EOL . "\t\t\t\t->where('c.rgt <= ' . (int) \$rgt);"; + $query .= PHP_EOL . "\t\t}"; + $query .= PHP_EOL . "\t\telseif (is_array(\$categoryId))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\tJArrayHelper::toInteger(\$categoryId);"; + $query .= PHP_EOL . "\t\t\t\$categoryId = implode(',', \$categoryId);"; + $query .= PHP_EOL . "\t\t\t\$query->where('a.category IN (' . \$categoryId . ')');"; + $query .= PHP_EOL . "\t\t}"; $query .= PHP_EOL; } - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Add the list ordering clause."; - $query .= PHP_EOL."\t\t\$orderCol = \$this->state->get('list.ordering', 'a.id');"; - $query .= PHP_EOL."\t\t\$orderDirn = \$this->state->get('list.direction', 'asc'); "; - $query .= PHP_EOL."\t\tif (\$orderCol != '')"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\t\$query->order(\$db->escape(\$orderCol . ' ' . \$orderDirn));"; - $query .= PHP_EOL."\t\t}"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add the list ordering clause."; + $query .= PHP_EOL . "\t\t\$orderCol = \$this->state->get('list.ordering', 'a.id');"; + $query .= PHP_EOL . "\t\t\$orderDirn = \$this->state->get('list.direction', 'asc'); "; + $query .= PHP_EOL . "\t\tif (\$orderCol != '')"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\t\$query->order(\$db->escape(\$orderCol . ' ' . \$orderDirn));"; + $query .= PHP_EOL . "\t\t}"; $query .= PHP_EOL; - $query .= PHP_EOL."\t\treturn \$query;"; + $query .= PHP_EOL . "\t\treturn \$query;"; return $query; } @@ -8409,37 +8407,37 @@ class Interpretation extends Fields // array( 'type' => $typeName, 'code' => $name, 'custom' => $custom, 'list' => $field['list']); if ($nr == 0) { - $search .= "a.".$array['code']." LIKE '.\$search.'"; + $search .= "a." . $array['code'] . " LIKE '.\$search.'"; if (ComponentbuilderHelper::checkArray($array['custom']) && 1 == $array['list']) { - $search .= " OR ".$array['custom']['db'].".".$array['custom']['text']." LIKE '.\$search.'"; + $search .= " OR " . $array['custom']['db'] . "." . $array['custom']['text'] . " LIKE '.\$search.'"; } } else { - $search .= " OR a.".$array['code']." LIKE '.\$search.'"; + $search .= " OR a." . $array['code'] . " LIKE '.\$search.'"; if (ComponentbuilderHelper::checkArray($array['custom']) && 1 == $array['list']) { - $search .= " OR ".$array['custom']['db'].".".$array['custom']['text']." LIKE '.\$search.'"; + $search .= " OR " . $array['custom']['db'] . "." . $array['custom']['text'] . " LIKE '.\$search.'"; } } } $search .= ")'"; // now setup query - $query = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by search."; - $query .= PHP_EOL."\t\t\$search = \$this->getState('filter.search');"; - $query .= PHP_EOL."\t\tif (!empty(\$search))"; - $query .= PHP_EOL."\t\t{"; - $query .= PHP_EOL."\t\t\tif (stripos(\$search, 'id:') === 0)"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\$query->where('a.id = ' . (int) substr(\$search, 3));"; - $query .= PHP_EOL."\t\t\t}"; - $query .= PHP_EOL."\t\t\telse"; - $query .= PHP_EOL."\t\t\t{"; - $query .= PHP_EOL."\t\t\t\t\$search = \$db->quote('%' . \$db->escape(\$search) . '%');"; - $query .= PHP_EOL."\t\t\t\t\$query->where(".$search.");"; - $query .= PHP_EOL."\t\t\t}"; - $query .= PHP_EOL."\t\t}"; + $query = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by search."; + $query .= PHP_EOL . "\t\t\$search = \$this->getState('filter.search');"; + $query .= PHP_EOL . "\t\tif (!empty(\$search))"; + $query .= PHP_EOL . "\t\t{"; + $query .= PHP_EOL . "\t\t\tif (stripos(\$search, 'id:') === 0)"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\$query->where('a.id = ' . (int) substr(\$search, 3));"; + $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . "\t\t\telse"; + $query .= PHP_EOL . "\t\t\t{"; + $query .= PHP_EOL . "\t\t\t\t\$search = \$db->quote('%' . \$db->escape(\$search) . '%');"; + $query .= PHP_EOL . "\t\t\t\t\$query->where(" . $search . ");"; + $query .= PHP_EOL . "\t\t\t}"; + $query .= PHP_EOL . "\t\t}"; $query .= PHP_EOL; return $query; @@ -8455,16 +8453,11 @@ class Interpretation extends Fields foreach ($this->customBuilder[$viewName_list] as $filter) { // only load this if table is set - if (isset($this->customBuilderList[$viewName_list]) - && ComponentbuilderHelper::checkArray($this->customBuilderList[$viewName_list]) - && in_array($filter['code'],$this->customBuilderList[$viewName_list]) - && isset($filter['custom']['table']) - && ComponentbuilderHelper::checkString($filter['custom']['table']) - && $filter['method'] == 0) + if (isset($this->customBuilderList[$viewName_list]) && ComponentbuilderHelper::checkArray($this->customBuilderList[$viewName_list]) && in_array($filter['code'], $this->customBuilderList[$viewName_list]) && isset($filter['custom']['table']) && ComponentbuilderHelper::checkString($filter['custom']['table']) && $filter['method'] == 0) { - $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." From the ".ComponentbuilderHelper::safeString(ComponentbuilderHelper::safeString($filter['custom']['table'],'w'))." table."; - $query .= PHP_EOL."\t\t\$query->select(\$db->quoteName('".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'));"; - $query .= PHP_EOL."\t\t\$query->join('LEFT', \$db->quoteName('".$filter['custom']['table']."', '".$filter['custom']['db']."') . ' ON (' . \$db->quoteName('a.".$filter['code']."') . ' = ' . \$db->quoteName('".$filter['custom']['db'].".".$filter['custom']['id']."') . ')');"; + $query .= PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " From the " . ComponentbuilderHelper::safeString(ComponentbuilderHelper::safeString($filter['custom']['table'], 'w')) . " table."; + $query .= PHP_EOL . "\t\t\$query->select(\$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "','" . $filter['code'] . "_" . $filter['custom']['text'] . "'));"; + $query .= PHP_EOL . "\t\t\$query->join('LEFT', \$db->quoteName('" . $filter['custom']['table'] . "', '" . $filter['custom']['db'] . "') . ' ON (' . \$db->quoteName('a." . $filter['code'] . "') . ' = ' . \$db->quoteName('" . $filter['custom']['db'] . "." . $filter['custom']['id'] . "') . ')');"; } // build the field type file $this->setCustomFieldTypeFile($filter, $viewName_list, $viewName_single); @@ -8473,10 +8466,10 @@ class Interpretation extends Fields } } - public function setAddButttonToListField($targetView,$targetViews) + public function setAddButttonToListField($targetView, $targetViews) { $addButton = array(); - $addButton[] = PHP_EOL."\t/**"; + $addButton[] = PHP_EOL . "\t/**"; $addButton[] = "\t * Override to add new button"; $addButton[] = "\t *"; $addButton[] = "\t * @return string The field input markup."; @@ -8485,35 +8478,35 @@ class Interpretation extends Fields $addButton[] = "\t */"; $addButton[] = "\tprotected function getInput()"; $addButton[] = "\t{"; - $addButton[] = "\t\t//".$this->setLine(__LINE__)." see if we should add buttons"; + $addButton[] = "\t\t//" . $this->setLine(__LINE__) . " see if we should add buttons"; $addButton[] = "\t\t\$setButton = \$this->getAttribute('button');"; - $addButton[] = "\t\t//".$this->setLine(__LINE__)." get html"; + $addButton[] = "\t\t//" . $this->setLine(__LINE__) . " get html"; $addButton[] = "\t\t\$html = parent::getInput();"; - $addButton[] = "\t\t//".$this->setLine(__LINE__)." if true set button"; + $addButton[] = "\t\t//" . $this->setLine(__LINE__) . " if true set button"; $addButton[] = "\t\tif (\$setButton === 'true')"; $addButton[] = "\t\t{"; $addButton[] = "\t\t\t\$button = array();"; $addButton[] = "\t\t\t\$script = array();"; $addButton[] = "\t\t\t\$buttonName = \$this->getAttribute('name');"; - $addButton[] = "\t\t\t//".$this->setLine(__LINE__)." get the input from url"; + $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the input from url"; $addButton[] = "\t\t\t\$app = JFactory::getApplication();"; $addButton[] = "\t\t\t\$jinput = \$app->input;"; - $addButton[] = "\t\t\t//".$this->setLine(__LINE__)." get the view name & id"; + $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " get the view name & id"; $addButton[] = "\t\t\t\$values = \$jinput->getArray(array("; $addButton[] = "\t\t\t\t'id' => 'int',"; $addButton[] = "\t\t\t\t'view' => 'word'"; $addButton[] = "\t\t\t));"; - $addButton[] = "\t\t\t//".$this->setLine(__LINE__)." check if new item"; + $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " check if new item"; $addButton[] = "\t\t\t\$ref = '';"; $addButton[] = "\t\t\t\$refJ = '';"; $addButton[] = "\t\t\tif (!is_null(\$values['id']) && strlen(\$values['view']))"; $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//".$this->setLine(__LINE__)." only load referal if not new item."; + $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " only load referal if not new item."; $addButton[] = "\t\t\t\t\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; $addButton[] = "\t\t\t\t\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];"; $addButton[] = "\t\t\t}"; $addButton[] = "\t\t\t\$user = JFactory::getUser();"; - $addButton[] = "\t\t\t//".$this->setLine(__LINE__)." only add if user allowed to create " . $targetView; + $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " only add if user allowed to create " . $targetView; // get core permissions $coreLoad = false; if (isset($this->permissionCore[$targetView])) @@ -8522,52 +8515,52 @@ class Interpretation extends Fields $coreLoad = true; } // check if the item has permissions. - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($targetView,$this->permissionBuilder['global'][$core['core.create']])) + if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($targetView, $this->permissionBuilder['global'][$core['core.create']])) { - $addButton[] = "\t\t\tif (\$user->authorise('".$core['core.create']."', 'com_".$this->fileContentStatic['###component###']."') && \$app->isAdmin()) // TODO for now only in admin area."; + $addButton[] = "\t\t\tif (\$user->authorise('" . $core['core.create'] . "', 'com_" . $this->fileContentStatic['###component###'] . "') && \$app->isAdmin()) // TODO for now only in admin area."; } else { - $addButton[] = "\t\t\tif (\$user->authorise('core.create', 'com_".$this->fileContentStatic['###component###']."') && \$app->isAdmin()) // TODO for now only in admin area."; + $addButton[] = "\t\t\tif (\$user->authorise('core.create', 'com_" . $this->fileContentStatic['###component###'] . "') && \$app->isAdmin()) // TODO for now only in admin area."; } $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//".$this->setLine(__LINE__)." build Create button"; + $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build Create button"; $addButton[] = "\t\t\t\t\$buttonNamee = trim(\$buttonName);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; + $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; + $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; + $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; $addButton[] = "\t\t\t\t\$buttonNamee = ucfirst(strtolower(\$buttonNamee));"; - $addButton[] = "\t\t\t\t\$button[] = 'langPrefix."_CREATE_NEW_S', \$buttonNamee).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; + $addButton[] = "\t\t\t\t\$button[] = 'langPrefix . "_CREATE_NEW_S', \$buttonNamee).'\" style=\"border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;\""; $addButton[] = "\t\t\t\t\thref=\"index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $targetView . "&layout=edit'.\$ref.'\" >"; $addButton[] = "\t\t\t\t\t';"; $addButton[] = "\t\t\t}"; - $addButton[] = "\t\t\t//".$this->setLine(__LINE__)." only add if user allowed to edit " . $targetView; + $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " only add if user allowed to edit " . $targetView; // check if the item has permissions. - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($targetView,$this->permissionBuilder['global'][$core['core.edit']])) + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($targetView, $this->permissionBuilder['global'][$core['core.edit']])) { - $addButton[] = "\t\t\tif ((\$buttonName === '".$targetView."' || \$buttonName === '".$targetViews."') && \$user->authorise('".$core['core.edit']."', 'com_".$this->fileContentStatic['###component###']."') && \$app->isAdmin()) // TODO for now only in admin area."; + $addButton[] = "\t\t\tif ((\$buttonName === '" . $targetView . "' || \$buttonName === '" . $targetViews . "') && \$user->authorise('" . $core['core.edit'] . "', 'com_" . $this->fileContentStatic['###component###'] . "') && \$app->isAdmin()) // TODO for now only in admin area."; } else { - $addButton[] = "\t\t\tif ((\$buttonName === '".$targetView."' || \$buttonName === '".$targetViews."') && \$user->authorise('core.edit', 'com_".$this->fileContentStatic['###component###']."') && \$app->isAdmin()) // TODO for now only in admin area."; + $addButton[] = "\t\t\tif ((\$buttonName === '" . $targetView . "' || \$buttonName === '" . $targetViews . "') && \$user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "') && \$app->isAdmin()) // TODO for now only in admin area."; } $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//".$this->setLine(__LINE__)." build edit button"; + $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build edit button"; $addButton[] = "\t\t\t\t\$buttonNamee = trim(\$buttonName);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; - $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; + $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/_+/', ' ', \$buttonNamee);"; + $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace('/\s+/', ' ', \$buttonNamee);"; + $addButton[] = "\t\t\t\t\$buttonNamee = preg_replace(\"/[^A-Za-z ]/\", '', \$buttonNamee);"; $addButton[] = "\t\t\t\t\$buttonNamee = ucfirst(strtolower(\$buttonNamee));"; - $addButton[] = "\t\t\t\t\$button[] = 'langPrefix."_EDIT_S', \$buttonNamee).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; + $addButton[] = "\t\t\t\t\$button[] = 'langPrefix . "_EDIT_S', \$buttonNamee).'\" style=\"display: none; padding: 4px 4px 4px 7px;\" href=\"#\" >"; $addButton[] = "\t\t\t\t\t';"; - $addButton[] = "\t\t\t\t//".$this->setLine(__LINE__)." build script"; + $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " build script"; $addButton[] = "\t\t\t\t\$script[] = \""; $addButton[] = "\t\t\t\t\tjQuery(document).ready(function() {"; $addButton[] = "\t\t\t\t\t\tjQuery('#adminForm').on('change', '#jform_\".\$buttonName.\"',function (e) {"; $addButton[] = "\t\t\t\t\t\t\te.preventDefault();"; $addButton[] = "\t\t\t\t\t\t\tvar \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();"; $addButton[] = "\t\t\t\t\t\t\t\".\$buttonName.\"Button(\".\$buttonName.\"Value);"; - $addButton[] = "\t\t\t\t\t\t});"; + $addButton[] = "\t\t\t\t\t\t});"; $addButton[] = "\t\t\t\t\t\tvar \".\$buttonName.\"Value = jQuery('#jform_\".\$buttonName.\"').val();"; $addButton[] = "\t\t\t\t\t\t\".\$buttonName.\"Button(\".\$buttonName.\"Value);"; $addButton[] = "\t\t\t\t\t});"; @@ -8577,7 +8570,7 @@ class Interpretation extends Fields $addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Create').hide();"; $addButton[] = "\t\t\t\t\t\t\t// show edit button"; $addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Edit').show();"; - $addButton[] = "\t\t\t\t\t\t\tvar url = 'index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=".$targetViews."&task=" . $targetView . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID + $addButton[] = "\t\t\t\t\t\t\tvar url = 'index.php?option=com_" . $this->fileContentStatic['###component###'] . "&view=" . $targetViews . "&task=" . $targetView . ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID $addButton[] = "\t\t\t\t\t\t\tjQuery('#\".\$buttonName.\"Edit').attr('href', url);"; $addButton[] = "\t\t\t\t\t\t} else {"; $addButton[] = "\t\t\t\t\t\t\t// show the create button"; @@ -8587,20 +8580,20 @@ class Interpretation extends Fields $addButton[] = "\t\t\t\t\t\t}"; $addButton[] = "\t\t\t\t\t}\";"; $addButton[] = "\t\t\t}"; - $addButton[] = "\t\t\t//".$this->setLine(__LINE__)." check if button was created for " . $targetView ." field."; + $addButton[] = "\t\t\t//" . $this->setLine(__LINE__) . " check if button was created for " . $targetView . " field."; $addButton[] = "\t\t\tif (is_array(\$button) && count(\$button) > 0)"; $addButton[] = "\t\t\t{"; - $addButton[] = "\t\t\t\t//".$this->setLine(__LINE__)." Load the needed script."; + $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Load the needed script."; $addButton[] = "\t\t\t\t\$document = JFactory::getDocument();"; $addButton[] = "\t\t\t\t\$document->addScriptDeclaration(implode(' ',\$script));"; - $addButton[] = "\t\t\t\t//".$this->setLine(__LINE__)." return the button attached to input field."; + $addButton[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " return the button attached to input field."; $addButton[] = "\t\t\t\treturn '
' .\$html . implode('',\$button).'
';"; $addButton[] = "\t\t\t}"; $addButton[] = "\t\t}"; $addButton[] = "\t\treturn \$html;"; $addButton[] = "\t}"; - return implode(PHP_EOL,$addButton); + return implode(PHP_EOL, $addButton); } public function setFilterQuery($viewName_list) @@ -8612,20 +8605,19 @@ class Interpretation extends Fields { if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom'])) { - $filterQuery .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by ".$filter['code']."."; - $filterQuery .= PHP_EOL."\t\tif (\$".$filter['code']." = \$this->getState('filter.".$filter['code']."'))"; - $filterQuery .= PHP_EOL."\t\t{"; - $filterQuery .= PHP_EOL."\t\t\t\$query->where('a.".$filter['code']." = ' . \$db->quote(\$db->escape(\$".$filter['code'].")));"; - $filterQuery .= PHP_EOL."\t\t}"; - + $filterQuery .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by " . $filter['code'] . "."; + $filterQuery .= PHP_EOL . "\t\tif (\$" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "'))"; + $filterQuery .= PHP_EOL . "\t\t{"; + $filterQuery .= PHP_EOL . "\t\t\t\$query->where('a." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] . ")));"; + $filterQuery .= PHP_EOL . "\t\t}"; } elseif ($filter['type'] != 'category') { - $filterQuery .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Filter by ".ucwords($filter['code'])."."; - $filterQuery .= PHP_EOL."\t\tif (\$".$filter['code']." = \$this->getState('filter.".$filter['code']."'))"; - $filterQuery .= PHP_EOL."\t\t{"; - $filterQuery .= PHP_EOL."\t\t\t\$query->where('a.".$filter['code']." = ' . \$db->quote(\$db->escape(\$".$filter['code'].")));"; - $filterQuery .= PHP_EOL."\t\t}"; + $filterQuery .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Filter by " . ucwords($filter['code']) . "."; + $filterQuery .= PHP_EOL . "\t\tif (\$" . $filter['code'] . " = \$this->getState('filter." . $filter['code'] . "'))"; + $filterQuery .= PHP_EOL . "\t\t{"; + $filterQuery .= PHP_EOL . "\t\t\t\$query->where('a." . $filter['code'] . " = ' . \$db->quote(\$db->escape(\$" . $filter['code'] . ")));"; + $filterQuery .= PHP_EOL . "\t\t}"; } } return $filterQuery; @@ -8641,18 +8633,18 @@ class Interpretation extends Fields if (isset($viewArray['settings']->conditions) && ComponentbuilderHelper::checkArray($viewArray['settings']->conditions)) { // reset defaults - $getValue = array(); - $ifValue = array(); - $targetControls = array(); - $functions = array(); + $getValue = array(); + $ifValue = array(); + $targetControls = array(); + $functions = array(); foreach ($viewArray['settings']->conditions as $condition) { if (isset($condition['match_name']) && ComponentbuilderHelper::checkString($condition['match_name'])) { - $uniqueVar = $this->uniquekey(7); - $matchName = $condition['match_name'].'_'.$uniqueVar; - $targetBehavior = ($condition['target_behavior'] == 1) ? 'show' : 'hide'; - $targetDefault = ($condition['target_behavior'] == 1) ? 'hide' : 'show'; + $uniqueVar = $this->uniquekey(7); + $matchName = $condition['match_name'] . '_' . $uniqueVar; + $targetBehavior = ($condition['target_behavior'] == 1) ? 'show' : 'hide'; + $targetDefault = ($condition['target_behavior'] == 1) ? 'hide' : 'show'; // make sure only one relation is set $firstTime = true; @@ -8660,41 +8652,41 @@ class Interpretation extends Fields if ($condition['target_relation'] && $firstTime) { // chain to other items of the same target - $relations = $this->getTargetRelationScript($viewArray['settings']->conditions,$condition,$viewName); + $relations = $this->getTargetRelationScript($viewArray['settings']->conditions, $condition, $viewName); if (ComponentbuilderHelper::checkArray($relations)) { // set behavior and default array - $behaviors[$matchName] = $targetBehavior; - $defaults[$matchName] = $targetDefault; + $behaviors[$matchName] = $targetBehavior; + $defaults[$matchName] = $targetDefault; // set the type buket - $typeBuket[$matchName] = $condition['match_type']; + $typeBuket[$matchName] = $condition['match_type']; // set function array - $functions[$uniqueVar][0] = $matchName; - $matchNames[$matchName] = $condition['match_name']; + $functions[$uniqueVar][0] = $matchName; + $matchNames[$matchName] = $condition['match_name']; // get the select value - $getValue[$matchName] = $this->getValueScript($condition['match_type'],$condition['match_name'],$condition['match_extends'],$uniqueVar); + $getValue[$matchName] = $this->getValueScript($condition['match_type'], $condition['match_name'], $condition['match_extends'], $uniqueVar); // get the options - $options = $this->getOptionsScript($condition['match_type'],$condition['match_options']); + $options = $this->getOptionsScript($condition['match_type'], $condition['match_options']); // set the if values - $ifValue[$matchName] = $this->ifValueScript($matchName,$condition['match_behavior'],$condition['match_type'],$options); + $ifValue[$matchName] = $this->ifValueScript($matchName, $condition['match_behavior'], $condition['match_type'], $options); // set the target controls - $targetControls[$matchName] = $this->setTargetControlsScript($condition['target_field'],$targetBehavior,$targetDefault,$uniqueVar,$viewName); + $targetControls[$matchName] = $this->setTargetControlsScript($condition['target_field'], $targetBehavior, $targetDefault, $uniqueVar, $viewName); $firstTime = false; - foreach($relations as $relation) + foreach ($relations as $relation) { if (ComponentbuilderHelper::checkString($relation['match_name'])) { - $relationName = $relation['match_name'].'_'.$uniqueVar; + $relationName = $relation['match_name'] . '_' . $uniqueVar; // set the type buket - $typeBuket[$relationName] = $relation['match_type']; + $typeBuket[$relationName] = $relation['match_type']; // set function array - $functions[$uniqueVar][] = $relationName; - $matchNames[$relationName] = $relation['match_name']; + $functions[$uniqueVar][] = $relationName; + $matchNames[$relationName] = $relation['match_name']; // get the relation option - $relationOptions = $this->getOptionsScript($relation['match_type'],$relation['match_options']); - $getValue[$relationName] = $this->getValueScript($relation['match_type'],$relation['match_name'],$condition['match_extends'],$uniqueVar); - $ifValue[$relationName] = $this->ifValueScript($relationName,$relation['match_behavior'],$relation['match_type'],$relationOptions); + $relationOptions = $this->getOptionsScript($relation['match_type'], $relation['match_options']); + $getValue[$relationName] = $this->getValueScript($relation['match_type'], $relation['match_name'], $condition['match_extends'], $uniqueVar); + $ifValue[$relationName] = $this->ifValueScript($relationName, $relation['match_behavior'], $relation['match_type'], $relationOptions); } } } @@ -8702,21 +8694,21 @@ class Interpretation extends Fields else { // set behavior and default array - $behaviors[$matchName] = $targetBehavior; - $defaults[$matchName] = $targetDefault; + $behaviors[$matchName] = $targetBehavior; + $defaults[$matchName] = $targetDefault; // set the type buket - $typeBuket[$matchName] = $condition['match_type']; + $typeBuket[$matchName] = $condition['match_type']; // set function array - $functions[$uniqueVar][0] = $matchName; - $matchNames[$matchName] = $condition['match_name']; + $functions[$uniqueVar][0] = $matchName; + $matchNames[$matchName] = $condition['match_name']; // get the select value - $getValue[$matchName] = $this->getValueScript($condition['match_type'],$condition['match_name'],$condition['match_extends'],$uniqueVar); + $getValue[$matchName] = $this->getValueScript($condition['match_type'], $condition['match_name'], $condition['match_extends'], $uniqueVar); // get the options - $options = $this->getOptionsScript($condition['match_type'],$condition['match_options']); + $options = $this->getOptionsScript($condition['match_type'], $condition['match_options']); // set the if values - $ifValue[$matchName] = $this->ifValueScript($matchName,$condition['match_behavior'],$condition['match_type'],$options); + $ifValue[$matchName] = $this->ifValueScript($matchName, $condition['match_behavior'], $condition['match_type'], $options); // set the target controls - $targetControls[$matchName] = $this->setTargetControlsScript($condition['target_field'],$targetBehavior,$targetDefault,$uniqueVar,$viewName); + $targetControls[$matchName] = $this->setTargetControlsScript($condition['target_field'], $targetBehavior, $targetDefault, $uniqueVar, $viewName); } } } @@ -8729,14 +8721,14 @@ class Interpretation extends Fields if (ComponentbuilderHelper::checkArray($functions)) { // now build the initial script - $initial .= "// Initial Script".PHP_EOL."jQuery(document).ready(function()"; - $initial .= PHP_EOL."{"; + $initial .= "// Initial Script" . PHP_EOL . "jQuery(document).ready(function()"; + $initial .= PHP_EOL . "{"; foreach ($functions as $function => $matchKeys) { - $func_call = $this->buildFunctionCall($function,$matchKeys,$getValue); + $func_call = $this->buildFunctionCall($function, $matchKeys, $getValue); $initial .= $func_call['code']; } - $initial .= "});".PHP_EOL; + $initial .= "});" . PHP_EOL; // for modal fields $modal = ''; // now build the listener scripts @@ -8745,41 +8737,41 @@ class Interpretation extends Fields $funcCall = ''; foreach ($l_matchKeys as $l_matchKey) { - $name = $matchNames[$l_matchKey]; - $matchTypeKey = $typeBuket[$l_matchKey]; - $funcCall = $this->buildFunctionCall($l_function,$l_matchKeys,$getValue); - - if(isset($this->setScriptMediaSwitch) && ComponentbuilderHelper::checkArray($this->setScriptMediaSwitch) && in_array($matchTypeKey,$this->setScriptMediaSwitch)) + $name = $matchNames[$l_matchKey]; + $matchTypeKey = $typeBuket[$l_matchKey]; + $funcCall = $this->buildFunctionCall($l_function, $l_matchKeys, $getValue); + + if (isset($this->setScriptMediaSwitch) && ComponentbuilderHelper::checkArray($this->setScriptMediaSwitch) && in_array($matchTypeKey, $this->setScriptMediaSwitch)) { $modal .= $funcCall['code']; } else { - if (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($matchTypeKey,$this->setScriptUserSwitch)) + if (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($matchTypeKey, $this->setScriptUserSwitch)) { - $name = $name.'_id'; + $name = $name . '_id'; } - $listener .= PHP_EOL."// #jform_".$name." listeners for ".$l_matchKey." function"; - $listener .= PHP_EOL."jQuery('#jform_".$name."').on('keyup',function()"; - $listener .= PHP_EOL."{"; + $listener .= PHP_EOL . "// #jform_" . $name . " listeners for " . $l_matchKey . " function"; + $listener .= PHP_EOL . "jQuery('#jform_" . $name . "').on('keyup',function()"; + $listener .= PHP_EOL . "{"; $listener .= $funcCall['code']; - $listener .= PHP_EOL."});"; - $listener .= PHP_EOL."jQuery('#adminForm').on('change', '#jform_".$name."',function (e)"; - $listener .= PHP_EOL."{"; - $listener .= PHP_EOL."\te.preventDefault();"; + $listener .= PHP_EOL . "});"; + $listener .= PHP_EOL . "jQuery('#adminForm').on('change', '#jform_" . $name . "',function (e)"; + $listener .= PHP_EOL . "{"; + $listener .= PHP_EOL . "\te.preventDefault();"; $listener .= $funcCall['code']; - $listener .= PHP_EOL."});".PHP_EOL; + $listener .= PHP_EOL . "});" . PHP_EOL; } } } if (ComponentbuilderHelper::checkString($modal)) { - $listener .= PHP_EOL."window.SqueezeBox.initialize({"; - $listener .= PHP_EOL."\tonClose:function(){"; + $listener .= PHP_EOL . "window.SqueezeBox.initialize({"; + $listener .= PHP_EOL . "\tonClose:function(){"; $listener .= $modal; - $listener .= PHP_EOL."\t}"; - $listener .= PHP_EOL."});".PHP_EOL; + $listener .= PHP_EOL . "\t}"; + $listener .= PHP_EOL . "});" . PHP_EOL; } // now build the function @@ -8790,14 +8782,14 @@ class Interpretation extends Fields $map = ''; // does this function require an array $addArray = false; - $func_ = $this->buildFunctionCall($f_function,$f_matchKeys,$getValue); + $func_ = $this->buildFunctionCall($f_function, $f_matchKeys, $getValue); // set array switch if ($func_['array']) { $addArray = true; } - $func .= PHP_EOL."// the ".$f_function." function"; - $func .= PHP_EOL."function ".$f_function."("; + $func .= PHP_EOL . "// the " . $f_function . " function"; + $func .= PHP_EOL . "function " . $f_function . "("; $fucounter = 0; foreach ($f_matchKeys as $fu_matchKey) { @@ -8809,43 +8801,43 @@ class Interpretation extends Fields } else { - $func .= ','.$fu_matchKey; + $func .= ',' . $fu_matchKey; } $fucounter++; } } $func .= ")"; - $func .= PHP_EOL."{"; + $func .= PHP_EOL . "{"; if ($addArray) { foreach ($f_matchKeys as $a_matchKey) { $name = $matchNames[$a_matchKey]; - $func .= PHP_EOL."\tif (isSet(".$a_matchKey.") && ".$a_matchKey.".constructor !== Array)".PHP_EOL."\t{".PHP_EOL."\t\tvar temp_".$f_function." = ".$a_matchKey.";".PHP_EOL."\t\tvar ".$a_matchKey." = [];".PHP_EOL."\t\t".$a_matchKey.".push(temp_".$f_function.");".PHP_EOL."\t}"; - $func .= PHP_EOL."\telse if (!isSet(".$a_matchKey."))".PHP_EOL."\t{"; - $func .= PHP_EOL."\t\tvar ".$a_matchKey." = [];"; - $func .= PHP_EOL."\t}"; - $func .= PHP_EOL."\tvar ".$name." = ".$a_matchKey.".some(".$a_matchKey."_SomeFunc);".PHP_EOL; + $func .= PHP_EOL . "\tif (isSet(" . $a_matchKey . ") && " . $a_matchKey . ".constructor !== Array)" . PHP_EOL . "\t{" . PHP_EOL . "\t\tvar temp_" . $f_function . " = " . $a_matchKey . ";" . PHP_EOL . "\t\tvar " . $a_matchKey . " = [];" . PHP_EOL . "\t\t" . $a_matchKey . ".push(temp_" . $f_function . ");" . PHP_EOL . "\t}"; + $func .= PHP_EOL . "\telse if (!isSet(" . $a_matchKey . "))" . PHP_EOL . "\t{"; + $func .= PHP_EOL . "\t\tvar " . $a_matchKey . " = [];"; + $func .= PHP_EOL . "\t}"; + $func .= PHP_EOL . "\tvar " . $name . " = " . $a_matchKey . ".some(" . $a_matchKey . "_SomeFunc);" . PHP_EOL; // setup the map function - $map .= PHP_EOL."// the ".$f_function." Some function"; - $map .= PHP_EOL."function ".$a_matchKey."_SomeFunc(".$a_matchKey.")"; - $map .= PHP_EOL."{"; - $map .= PHP_EOL."\t//".$this->setLine(__LINE__)." set the function logic"; - $map .= PHP_EOL."\tif ("; + $map .= PHP_EOL . "// the " . $f_function . " Some function"; + $map .= PHP_EOL . "function " . $a_matchKey . "_SomeFunc(" . $a_matchKey . ")"; + $map .= PHP_EOL . "{"; + $map .= PHP_EOL . "\t//" . $this->setLine(__LINE__) . " set the function logic"; + $map .= PHP_EOL . "\tif ("; $if = $ifValue[$a_matchKey]; if (ComponentbuilderHelper::checkString($if)) { $map .= $if; } $map .= ")"; - $map .= PHP_EOL."\t{"; - $map .= PHP_EOL."\t\treturn true;"; - $map .= PHP_EOL."\t}".PHP_EOL."\treturn false;"; - $map .= PHP_EOL."}".PHP_EOL; + $map .= PHP_EOL . "\t{"; + $map .= PHP_EOL . "\t\treturn true;"; + $map .= PHP_EOL . "\t}" . PHP_EOL . "\treturn false;"; + $map .= PHP_EOL . "}" . PHP_EOL; } - $func .= PHP_EOL.PHP_EOL."\t//".$this->setLine(__LINE__)." set this function logic"; - $func .= PHP_EOL."\tif ("; + $func .= PHP_EOL . PHP_EOL . "\t//" . $this->setLine(__LINE__) . " set this function logic"; + $func .= PHP_EOL . "\tif ("; // set if counter $aifcounter = 0; foreach ($f_matchKeys as $af_matchKey) @@ -8857,17 +8849,16 @@ class Interpretation extends Fields } else { - $func .= ' && '.$name; + $func .= ' && ' . $name; } $aifcounter++; } - $func .= ")".PHP_EOL."\t{"; - + $func .= ")" . PHP_EOL . "\t{"; } else { - $func .= PHP_EOL."\t//".$this->setLine(__LINE__)." set the function logic"; - $func .= PHP_EOL."\tif ("; + $func .= PHP_EOL . "\t//" . $this->setLine(__LINE__) . " set the function logic"; + $func .= PHP_EOL . "\tif ("; // set if counter $ifcounter = 0; foreach ($f_matchKeys as $f_matchKey) @@ -8881,12 +8872,12 @@ class Interpretation extends Fields } else { - $func .= ' && '.$if; + $func .= ' && ' . $if; } $ifcounter++; } } - $func .= ")".PHP_EOL."\t{"; + $func .= ")" . PHP_EOL . "\t{"; } // get the controles $controls = $targetControls[$f_matchKeys[0]]; @@ -8894,7 +8885,7 @@ class Interpretation extends Fields $targetBehavior = $behaviors[$f_matchKeys[0]]; $targetDefault = $defaults[$f_matchKeys[0]]; // load the target behavior - foreach($controls as $target => $action) + foreach ($controls as $target => $action) { $func .= $action['behavior']; if (ComponentbuilderHelper::checkString($action['hide'])) @@ -8903,8 +8894,8 @@ class Interpretation extends Fields $head .= $action['requiredVar']; } } - $func .= PHP_EOL."\t}".PHP_EOL."\telse".PHP_EOL."\t{"; - foreach($controls as $target => $action) + $func .= PHP_EOL . "\t}" . PHP_EOL . "\telse" . PHP_EOL . "\t{"; + foreach ($controls as $target => $action) { $func .= $action['default']; if (ComponentbuilderHelper::checkString($action['hide'])) @@ -8912,49 +8903,49 @@ class Interpretation extends Fields $func .= $action[$targetDefault]; } } - $func .= PHP_EOL."\t}".PHP_EOL."}".PHP_EOL.$map; + $func .= PHP_EOL . "\t}" . PHP_EOL . "}" . PHP_EOL . $map; } // add the needed validation to file if (isset($this->validationFixBuilder[$viewName]) && ComponentbuilderHelper::checkArray($this->validationFixBuilder[$viewName])) { - $validation .= PHP_EOL."// update required fields"; - $validation .= PHP_EOL."function updateFieldRequired(name,status)"; - $validation .= PHP_EOL."{"; - $validation .= PHP_EOL."\tvar not_required = jQuery('#jform_not_required').val();"; - $validation .= PHP_EOL.PHP_EOL."\tif(status == 1)"; - $validation .= PHP_EOL."\t{"; - $validation .= PHP_EOL."\t\tif (isSet(not_required) && not_required != 0)"; - $validation .= PHP_EOL."\t\t{"; - $validation .= PHP_EOL."\t\t\tnot_required = not_required+','+name;"; - $validation .= PHP_EOL."\t\t}"; - $validation .= PHP_EOL."\t\telse"; - $validation .= PHP_EOL."\t\t{"; - $validation .= PHP_EOL."\t\t\tnot_required = ','+name;"; - $validation .= PHP_EOL."\t\t}"; - $validation .= PHP_EOL."\t}"; - $validation .= PHP_EOL."\telse"; - $validation .= PHP_EOL."\t{"; - $validation .= PHP_EOL."\t\tif (isSet(not_required) && not_required != 0)"; - $validation .= PHP_EOL."\t\t{"; - $validation .= PHP_EOL."\t\t\tnot_required = not_required.replace(','+name,'');"; - $validation .= PHP_EOL."\t\t}"; - $validation .= PHP_EOL."\t}"; - $validation .= PHP_EOL.PHP_EOL."\tjQuery('#jform_not_required').val(not_required);"; - $validation .= PHP_EOL."}".PHP_EOL; + $validation .= PHP_EOL . "// update required fields"; + $validation .= PHP_EOL . "function updateFieldRequired(name,status)"; + $validation .= PHP_EOL . "{"; + $validation .= PHP_EOL . "\tvar not_required = jQuery('#jform_not_required').val();"; + $validation .= PHP_EOL . PHP_EOL . "\tif(status == 1)"; + $validation .= PHP_EOL . "\t{"; + $validation .= PHP_EOL . "\t\tif (isSet(not_required) && not_required != 0)"; + $validation .= PHP_EOL . "\t\t{"; + $validation .= PHP_EOL . "\t\t\tnot_required = not_required+','+name;"; + $validation .= PHP_EOL . "\t\t}"; + $validation .= PHP_EOL . "\t\telse"; + $validation .= PHP_EOL . "\t\t{"; + $validation .= PHP_EOL . "\t\t\tnot_required = ','+name;"; + $validation .= PHP_EOL . "\t\t}"; + $validation .= PHP_EOL . "\t}"; + $validation .= PHP_EOL . "\telse"; + $validation .= PHP_EOL . "\t{"; + $validation .= PHP_EOL . "\t\tif (isSet(not_required) && not_required != 0)"; + $validation .= PHP_EOL . "\t\t{"; + $validation .= PHP_EOL . "\t\t\tnot_required = not_required.replace(','+name,'');"; + $validation .= PHP_EOL . "\t\t}"; + $validation .= PHP_EOL . "\t}"; + $validation .= PHP_EOL . PHP_EOL . "\tjQuery('#jform_not_required').val(not_required);"; + $validation .= PHP_EOL . "}" . PHP_EOL; } // set the isSet function - $isSet = PHP_EOL."// the isSet function"; - $isSet .= PHP_EOL."function isSet(val)"; - $isSet .= PHP_EOL."{"; - $isSet .= PHP_EOL."\tif ((val != undefined) && (val != null) && 0 !== val.length){"; - $isSet .= PHP_EOL."\t\treturn true;"; - $isSet .= PHP_EOL."\t}"; - $isSet .= PHP_EOL."\treturn false;"; - $isSet .= PHP_EOL."}"; + $isSet = PHP_EOL . "// the isSet function"; + $isSet .= PHP_EOL . "function isSet(val)"; + $isSet .= PHP_EOL . "{"; + $isSet .= PHP_EOL . "\tif ((val != undefined) && (val != null) && 0 !== val.length){"; + $isSet .= PHP_EOL . "\t\treturn true;"; + $isSet .= PHP_EOL . "\t}"; + $isSet .= PHP_EOL . "\treturn false;"; + $isSet .= PHP_EOL . "}"; } // load to this buket - $fileScript = $initial.$func.$validation.$isSet; - $footerScript = $listener; + $fileScript = $initial . $func . $validation . $isSet; + $footerScript = $listener; } // add custom script to file if (isset($this->customScriptBuilder['view_file'][$viewName]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['view_file'][$viewName])) @@ -8963,13 +8954,13 @@ class Interpretation extends Fields { $fileScript = ''; } - $fileScript .= PHP_EOL.PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['view_file'][$viewName], $this->placeholders); + $fileScript .= PHP_EOL . PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['view_file'][$viewName], $this->placeholders); } // add custom script to footer if (isset($this->customScriptBuilder['view_footer'][$viewName]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['view_footer'][$viewName])) { - $customFooterScript = PHP_EOL.PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['view_footer'][$viewName], $this->placeholders); - if (strpos($customFooterScript,'setPlaceholders($this->customScriptBuilder['view_footer'][$viewName], $this->placeholders); + if (strpos($customFooterScript, 'params->get('minify') && isset($fileScript) && ComponentbuilderHelper::checkString($fileScript)) @@ -9003,7 +8993,7 @@ class Interpretation extends Fields // add the head script if set if (isset($head) && ComponentbuilderHelper::checkString($head)) { - $fileScript = "// Some Global Values".PHP_EOL.$head.PHP_EOL.$fileScript; + $fileScript = "// Some Global Values" . PHP_EOL . $head . PHP_EOL . $fileScript; } // load the script $this->editBodyViewScriptBuilder[$viewName]['fileScript'] = $fileScript; @@ -9021,28 +9011,28 @@ class Interpretation extends Fields if (isset($footerScript) && ComponentbuilderHelper::checkString($footerScript)) { // add the needed script tags - $footerScript = PHP_EOL.PHP_EOL.'"; + $footerScript = PHP_EOL . PHP_EOL . '"; $this->editBodyViewScriptBuilder[$viewName]['footerScript'] = $footerScript; } } - public function buildFunctionCall($function,$matchKeys,$getValue) + public function buildFunctionCall($function, $matchKeys, $getValue) { - $initial = ''; - $funcsets = array(); - $array = false; + $initial = ''; + $funcsets = array(); + $array = false; foreach ($matchKeys as $matchKey) { $value = $getValue[$matchKey]; if ($value['isArray']) { - $initial .= PHP_EOL."\t".$value['get']; + $initial .= PHP_EOL . "\t" . $value['get']; $funcsets[] = $matchKey; $array = true; } else { - $initial .= PHP_EOL."\t".$value['get']; + $initial .= PHP_EOL . "\t" . $value['get']; $funcsets[] = $matchKey; } } @@ -9050,14 +9040,14 @@ class Interpretation extends Fields // make sure that the function is loaded only once if (ComponentbuilderHelper::checkArray($funcsets)) { - $initial .= PHP_EOL."\t".$function."("; - $initial .= implode(',',$funcsets); - $initial .= ");".PHP_EOL; + $initial .= PHP_EOL . "\t" . $function . "("; + $initial .= implode(',', $funcsets); + $initial .= ");" . PHP_EOL; } return array('code' => $initial, 'array' => $array); } - public function getTargetRelationScript($relations,$condition,$view) + public function getTargetRelationScript($relations, $condition, $view) { // reset the buket $buket = array(); @@ -9070,7 +9060,7 @@ class Interpretation extends Fields } } // start the search - foreach($relations as $relation) + foreach ($relations as $relation) { // reset found $found = false; @@ -9078,13 +9068,13 @@ class Interpretation extends Fields { if (ComponentbuilderHelper::checkArray($relation['target_field'])) { - foreach($relation['target_field'] as $target) + foreach ($relation['target_field'] as $target) { - if (ComponentbuilderHelper::checkArray($target) && $this->checkRelationControl($target['name'],$relation['match_name'],$condition['match_name'],$view)) + if (ComponentbuilderHelper::checkArray($target) && $this->checkRelationControl($target['name'], $relation['match_name'], $condition['match_name'], $view)) { - if (in_array($target['name'],$currentTargets)) + if (in_array($target['name'], $currentTargets)) { - $this->targetRelationControl[$view][$target['name']] = array($relation['match_name'],$condition['match_name']); + $this->targetRelationControl[$view][$target['name']] = array($relation['match_name'], $condition['match_name']); $found = true; break; } @@ -9100,13 +9090,13 @@ class Interpretation extends Fields return $buket; } - public function checkRelationControl($targetName,$relationMatchName,$conditionMatchName,$view) + public function checkRelationControl($targetName, $relationMatchName, $conditionMatchName, $view) { - if(isset($this->targetRelationControl[$view]) && ComponentbuilderHelper::checkArray($this->targetRelationControl[$view])) + if (isset($this->targetRelationControl[$view]) && ComponentbuilderHelper::checkArray($this->targetRelationControl[$view])) { - if(isset($this->targetRelationControl[$view][$targetName]) && ComponentbuilderHelper::checkArray($this->targetRelationControl[$view][$targetName])) + if (isset($this->targetRelationControl[$view][$targetName]) && ComponentbuilderHelper::checkArray($this->targetRelationControl[$view][$targetName])) { - if (!in_array($relationMatchName,$this->targetRelationControl[$view][$targetName]) || !in_array($conditionMatchName,$this->targetRelationControl[$view][$targetName])) + if (!in_array($relationMatchName, $this->targetRelationControl[$view][$targetName]) || !in_array($conditionMatchName, $this->targetRelationControl[$view][$targetName])) { return true; } @@ -9123,20 +9113,20 @@ class Interpretation extends Fields return false; } - public function setTargetControlsScript($targets,$targetBehavior,$targetDefault,$uniqueVar,$viewName) + public function setTargetControlsScript($targets, $targetBehavior, $targetDefault, $uniqueVar, $viewName) { $bucket = array(); - if (ComponentbuilderHelper::checkArray($targets) && !in_array($uniqueVar,$this->targetControlsScriptChecker)) + if (ComponentbuilderHelper::checkArray($targets) && !in_array($uniqueVar, $this->targetControlsScriptChecker)) { - foreach($targets as $target) + foreach ($targets as $target) { if (ComponentbuilderHelper::checkArray($target)) { // set the required var - if($target['required'] === 'yes') + if ($target['required'] === 'yes') { - $unique = $uniqueVar.$this->uniquekey(3); - $bucket[$target['name']]['requiredVar'] = "jform_".$unique."_required = false;".PHP_EOL; + $unique = $uniqueVar . $this->uniquekey(3); + $bucket[$target['name']]['requiredVar'] = "jform_" . $unique . "_required = false;" . PHP_EOL; } else { @@ -9162,30 +9152,30 @@ class Interpretation extends Fields $targetType = "#jform_"; } // set the target behavior - $bucket[$target['name']]['behavior'] = PHP_EOL."\t\tjQuery('".$targetType.$target['name'].$targetTypeSufix."').closest('.control-group').".$targetBehavior."();"; + $bucket[$target['name']]['behavior'] = PHP_EOL . "\t\tjQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetBehavior . "();"; // set the target default - $bucket[$target['name']]['default'] = PHP_EOL."\t\tjQuery('".$targetType.$target['name'].$targetTypeSufix."').closest('.control-group').".$targetDefault."();"; + $bucket[$target['name']]['default'] = PHP_EOL . "\t\tjQuery('" . $targetType . $target['name'] . $targetTypeSufix . "').closest('.control-group')." . $targetDefault . "();"; // the hide required function - if($target['required'] === 'yes') + if ($target['required'] === 'yes') { - $hide = PHP_EOL."\t\tif (!jform_".$unique."_required)"; - $hide .= PHP_EOL."\t\t{"; - $hide .= PHP_EOL."\t\t\tupdateFieldRequired('".$target['name']."',1);"; - $hide .= PHP_EOL."\t\t\tjQuery('#jform_".$target['name']."').removeAttr('required');"; - $hide .= PHP_EOL."\t\t\tjQuery('#jform_".$target['name']."').removeAttr('aria-required');"; - $hide .= PHP_EOL."\t\t\tjQuery('#jform_".$target['name']."').removeClass('required');"; - $hide .= PHP_EOL."\t\t\tjform_".$unique."_required = true;"; - $hide .= PHP_EOL."\t\t}"; + $hide = PHP_EOL . "\t\tif (!jform_" . $unique . "_required)"; + $hide .= PHP_EOL . "\t\t{"; + $hide .= PHP_EOL . "\t\t\tupdateFieldRequired('" . $target['name'] . "',1);"; + $hide .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').removeAttr('required');"; + $hide .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').removeAttr('aria-required');"; + $hide .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').removeClass('required');"; + $hide .= PHP_EOL . "\t\t\tjform_" . $unique . "_required = true;"; + $hide .= PHP_EOL . "\t\t}"; $bucket[$target['name']]['hide'] = $hide; // the show required function - $show = PHP_EOL."\t\tif (jform_".$unique."_required)"; - $show .= PHP_EOL."\t\t{"; - $show .= PHP_EOL."\t\t\tupdateFieldRequired('".$target['name']."',0);"; - $show .= PHP_EOL."\t\t\tjQuery('#jform_".$target['name']."').prop('required','required');"; - $show .= PHP_EOL."\t\t\tjQuery('#jform_".$target['name']."').attr('aria-required',true);"; - $show .= PHP_EOL."\t\t\tjQuery('#jform_".$target['name']."').addClass('required');"; - $show .= PHP_EOL."\t\t\tjform_".$unique."_required = false;"; - $show .= PHP_EOL."\t\t}".PHP_EOL; + $show = PHP_EOL . "\t\tif (jform_" . $unique . "_required)"; + $show .= PHP_EOL . "\t\t{"; + $show .= PHP_EOL . "\t\t\tupdateFieldRequired('" . $target['name'] . "',0);"; + $show .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').prop('required','required');"; + $show .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').attr('aria-required',true);"; + $show .= PHP_EOL . "\t\t\tjQuery('#jform_" . $target['name'] . "').addClass('required');"; + $show .= PHP_EOL . "\t\t\tjform_" . $unique . "_required = false;"; + $show .= PHP_EOL . "\t\t}" . PHP_EOL; $bucket[$target['name']]['show'] = $show; // make sure that the axaj and other needed things for this view is loaded $this->validationFixBuilder[$viewName][] = $target['name']; @@ -9202,300 +9192,298 @@ class Interpretation extends Fields return $bucket; } - - public function ifValueScript($value,$behavior,$type,$options) + public function ifValueScript($value, $behavior, $type, $options) { // reset string $string = ''; switch ($behavior) { case 1: // Is - // only 4 list/radio/checkboxes - if(ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) - { - if (ComponentbuilderHelper::checkArray($options)) + // only 4 list/radio/checkboxes + if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) { - foreach ($options as $option) + if (ComponentbuilderHelper::checkArray($options)) { - if (!is_numeric($option)) + foreach ($options as $option) { - if($option != 'true' && $option != 'false') + if (!is_numeric($option)) { - $option = "'".$option."'"; + if ($option != 'true' && $option != 'false') + { + $option = "'" . $option . "'"; + } + } + if (ComponentbuilderHelper::checkString($string)) + { + $string .= ' || ' . $value . ' == ' . $option; + } + else + { + $string .= $value . ' == ' . $option; } } - if(ComponentbuilderHelper::checkString($string)) - { - $string .= ' || '.$value.' == '.$option; - } - else - { - $string .= $value.' == '.$option; - } + } + else + { + $string .= 'isSet(' . $value . ')'; } } - else - { - $string .= 'isSet('.$value.')'; - } - } - break; + break; case 2: // Is Not - // only 4 list/radio/checkboxes - if(ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) - { - if (ComponentbuilderHelper::checkArray($options)) + // only 4 list/radio/checkboxes + if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) { - foreach ($options as $option) + if (ComponentbuilderHelper::checkArray($options)) { - if (!is_numeric($option)) + foreach ($options as $option) { - if($option != 'true' && $option != 'false') + if (!is_numeric($option)) { - $option = "'".$option."'"; + if ($option != 'true' && $option != 'false') + { + $option = "'" . $option . "'"; + } + } + if (ComponentbuilderHelper::checkString($string)) + { + $string .= ' || ' . $value . ' != ' . $option; + } + else + { + $string .= $value . ' != ' . $option; } } - if(ComponentbuilderHelper::checkString($string)) - { - $string .= ' || '.$value.' != '.$option; - } - else - { - $string .= $value.' != '.$option; - } + } + else + { + $string .= '!isSet(' . $value . ')'; } } - else - { - $string .= '!isSet('.$value.')'; - } - } - break; + break; case 3: // Any Selection - // only 4 list/radio/checkboxes/dynamic_list - if(ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) - { - if (ComponentbuilderHelper::checkArray($options)) + // only 4 list/radio/checkboxes/dynamic_list + if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type)) { - foreach ($options as $option) + if (ComponentbuilderHelper::checkArray($options)) { - if (!is_numeric($option)) + foreach ($options as $option) { - if($option != 'true' && $option != 'false') + if (!is_numeric($option)) { - $option = "'".$option."'"; + if ($option != 'true' && $option != 'false') + { + $option = "'" . $option . "'"; + } + } + if (ComponentbuilderHelper::checkString($string)) + { + $string .= ' || ' . $value . ' == ' . $option; + } + else + { + $string .= $value . ' == ' . $option; } } - if(ComponentbuilderHelper::checkString($string)) - { - $string .= ' || '.$value.' == '.$option; - } - else - { - $string .= $value.' == '.$option; - } } - } - else - { - $userFix = ''; - if (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($type,$this->setScriptUserSwitch)) + else { - // TODO this needs a closer look, a bit buggy - $userFix = " && ".$value." != 0"; + $userFix = ''; + if (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($type, $this->setScriptUserSwitch)) + { + // TODO this needs a closer look, a bit buggy + $userFix = " && " . $value . " != 0"; + } + //echo '
'; var_dump($type);exit;
+						$string .= 'isSet(' . $value . ')' . $userFix;
 					}
-					//echo '
'; var_dump($type);exit;
-					$string .= 'isSet('.$value.')'.$userFix;
 				}
-			}
-			break;
+				break;
 			case 4: // Active (not empty)
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-			{
-				$string .= 'isSet('.$value.')';
-			}
-			break;
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
+				{
+					$string .= 'isSet(' . $value . ')';
+				}
+				break;
 			case 5: // Unactive (empty)
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-			{
-				$string .= '!isSet('.$value.')';
-			}
-			break;
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
+				{
+					$string .= '!isSet(' . $value . ')';
+				}
+				break;
 			case 6: // Key Word All (case-sensitive)
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-			{
-				if (ComponentbuilderHelper::checkArray($options['keywords']))
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
 				{
-					foreach ($options['keywords'] as $keyword)
+					if (ComponentbuilderHelper::checkArray($options['keywords']))
 					{
-						if(ComponentbuilderHelper::checkString($string))
+						foreach ($options['keywords'] as $keyword)
 						{
-							$string .= ' && '.$value.'.indexOf("'.$keyword.'") >= 0';
-						}
-						else
-						{
-							$string .= $value.'.indexOf("'.$keyword.'") >= 0';
+							if (ComponentbuilderHelper::checkString($string))
+							{
+								$string .= ' && ' . $value . '.indexOf("' . $keyword . '") >= 0';
+							}
+							else
+							{
+								$string .= $value . '.indexOf("' . $keyword . '") >= 0';
+							}
 						}
 					}
+					if (!ComponentbuilderHelper::checkString($string))
+					{
+						$string .= $value . ' == "error"';
+					}
 				}
-				if(!ComponentbuilderHelper::checkString($string))
-				{
-					$string .= $value.' == "error"';
-				}
-			}
-			break;
+				break;
 			case 7: // Key Word Any (case-sensitive)
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-			{
-				if (ComponentbuilderHelper::checkArray($options['keywords']))
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
 				{
-					foreach ($options['keywords'] as $keyword)
+					if (ComponentbuilderHelper::checkArray($options['keywords']))
 					{
-						if(ComponentbuilderHelper::checkString($string))
+						foreach ($options['keywords'] as $keyword)
 						{
-							$string .= ' || '.$value.'.indexOf("'.$keyword.'") >= 0';
-						}
-						else
-						{
-							$string .= $value.'.indexOf("'.$keyword.'") >= 0';
+							if (ComponentbuilderHelper::checkString($string))
+							{
+								$string .= ' || ' . $value . '.indexOf("' . $keyword . '") >= 0';
+							}
+							else
+							{
+								$string .= $value . '.indexOf("' . $keyword . '") >= 0';
+							}
 						}
 					}
+					if (!ComponentbuilderHelper::checkString($string))
+					{
+						$string .= $value . ' == "error"';
+					}
 				}
-				if(!ComponentbuilderHelper::checkString($string))
-				{
-					$string .= $value.' == "error"';
-				}
-			}
-			break;
+				break;
 			case 8: // Key Word All (case-insensitive)
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-			{
-				if (ComponentbuilderHelper::checkArray($options['keywords']))
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
 				{
-					foreach ($options['keywords'] as $keyword)
+					if (ComponentbuilderHelper::checkArray($options['keywords']))
 					{
-						$keyword = ComponentbuilderHelper::safeString($keyword, 'w');
-						if(ComponentbuilderHelper::checkString($string))
+						foreach ($options['keywords'] as $keyword)
 						{
-							$string .= ' && '.$value.'.toLowerCase().indexOf("'.$keyword.'") >= 0';
-						}
-						else
-						{
-							$string .= $value.'.toLowerCase().indexOf("'.$keyword.'") >= 0';
+							$keyword = ComponentbuilderHelper::safeString($keyword, 'w');
+							if (ComponentbuilderHelper::checkString($string))
+							{
+								$string .= ' && ' . $value . '.toLowerCase().indexOf("' . $keyword . '") >= 0';
+							}
+							else
+							{
+								$string .= $value . '.toLowerCase().indexOf("' . $keyword . '") >= 0';
+							}
 						}
 					}
+					if (!ComponentbuilderHelper::checkString($string))
+					{
+						$string .= $value . ' == "error"';
+					}
 				}
-				if(!ComponentbuilderHelper::checkString($string))
-				{
-					$string .= $value.' == "error"';
-				}
-			}
-			break;
+				break;
 			case 9: // Key Word Any (case-insensitive)
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-			{
-				if (ComponentbuilderHelper::checkArray($options['keywords']))
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
 				{
-					foreach ($options['keywords'] as $keyword)
+					if (ComponentbuilderHelper::checkArray($options['keywords']))
 					{
-						$keyword = ComponentbuilderHelper::safeString($keyword, 'w');
-						if(ComponentbuilderHelper::checkString($string))
+						foreach ($options['keywords'] as $keyword)
 						{
-							$string .= ' || '.$value.'.toLowerCase().indexOf("'.$keyword.'") >= 0';
-						}
-						else
-						{
-							$string .= $value.'.toLowerCase().indexOf("'.$keyword.'") >= 0';
+							$keyword = ComponentbuilderHelper::safeString($keyword, 'w');
+							if (ComponentbuilderHelper::checkString($string))
+							{
+								$string .= ' || ' . $value . '.toLowerCase().indexOf("' . $keyword . '") >= 0';
+							}
+							else
+							{
+								$string .= $value . '.toLowerCase().indexOf("' . $keyword . '") >= 0';
+							}
 						}
 					}
+					if (!ComponentbuilderHelper::checkString($string))
+					{
+						$string .= $value . ' == "error"';
+					}
 				}
-				if(!ComponentbuilderHelper::checkString($string))
-				{
-					$string .= $value.' == "error"';
-				}
-			}
-			break;
+				break;
 			case 10: // Min Length
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-			{
-				if (ComponentbuilderHelper::checkArray($options))
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
 				{
-					if ($options['length'])
+					if (ComponentbuilderHelper::checkArray($options))
 					{
-						$string .= $value.'.length >= '.(int) $options['length'];
+						if ($options['length'])
+						{
+							$string .= $value . '.length >= ' . (int) $options['length'];
+						}
+					}
+					if (!ComponentbuilderHelper::checkString($string))
+					{
+						$string .= $value . '.length >= 5';
 					}
 				}
-				if(!ComponentbuilderHelper::checkString($string))
-				{
-					$string .= $value.'.length >= 5';
-				}
-			}
-			break;
+				break;
 			case 11: // Max Length
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-
-			{
-				if (ComponentbuilderHelper::checkArray($options))
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
 				{
-					if ($options['length'])
+					if (ComponentbuilderHelper::checkArray($options))
 					{
-						$string .= $value.'.length <= '.(int) $options['length'];
+						if ($options['length'])
+						{
+							$string .= $value . '.length <= ' . (int) $options['length'];
+						}
+					}
+					if (!ComponentbuilderHelper::checkString($string))
+					{
+						$string .= $value . '.length <= 5';
 					}
 				}
-				if(!ComponentbuilderHelper::checkString($string))
-				{
-					$string .= $value.'.length <= 5';
-				}
-			}
-			break;
+				break;
 			case 12: // Exact Length
-			// only 4 text_field
-			if(ComponentbuilderHelper::typeField($type, 'text'))
-			{
-				if (ComponentbuilderHelper::checkArray($options))
+				// only 4 text_field
+				if (ComponentbuilderHelper::typeField($type, 'text'))
 				{
-					if ($options['length'])
+					if (ComponentbuilderHelper::checkArray($options))
 					{
-						$string .= $value.'.length == '.(int) $options['length'];
+						if ($options['length'])
+						{
+							$string .= $value . '.length == ' . (int) $options['length'];
+						}
+					}
+					if (!ComponentbuilderHelper::checkString($string))
+					{
+						$string .= $value . '.length == 5';
 					}
 				}
-				if(!ComponentbuilderHelper::checkString($string))
-				{
-					$string .= $value.'.length == 5';
-				}
-			}
-			break;
+				break;
 		}
-		if(!ComponentbuilderHelper::checkString($string))
+		if (!ComponentbuilderHelper::checkString($string))
 		{
 			$string = 0;
 		}
 		return $string;
 	}
 
-	public function getOptionsScript($type,$options)
+	public function getOptionsScript($type, $options)
 	{
 		$buket = array();
-		if(ComponentbuilderHelper::checkString($options))
+		if (ComponentbuilderHelper::checkString($options))
 		{
-			if(ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type))
+			if (ComponentbuilderHelper::typeField($type, 'list') || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type))
 			{
 				$optionsArray = explode(PHP_EOL, $options);
 				if (!ComponentbuilderHelper::checkArray($optionsArray))
 				{
 					$optionsArray[] = $optionsArray;
 				}
-				foreach($optionsArray as $option)
+				foreach ($optionsArray as $option)
 				{
-					if (strpos($option,'|') !== false)
+					if (strpos($option, '|') !== false)
 					{
 						list($option) = explode('|', $option);
 					}
@@ -9506,20 +9494,19 @@ class Interpretation extends Fields
 					}
 				}
 			}
-			elseif(ComponentbuilderHelper::typeField($type, 'text'))
+			elseif (ComponentbuilderHelper::typeField($type, 'text'))
 			{
 				// check to get the key words if set
-				$keywords = ComponentbuilderHelper::getBetween($options,'keywords="','"');
+				$keywords = ComponentbuilderHelper::getBetween($options, 'keywords="', '"');
 				if (ComponentbuilderHelper::checkString($keywords))
 				{
-					if (strpos($keywords,',') !== false)
+					if (strpos($keywords, ',') !== false)
 					{
 						$keywords = explode(',', $keywords);
-						foreach($keywords as $keyword)
+						foreach ($keywords as $keyword)
 						{
 							$buket['keywords'][] = trim($keyword);
 						}
-
 					}
 					else
 					{
@@ -9527,11 +9514,13 @@ class Interpretation extends Fields
 					}
 				}
 				// check to ket string length if set
-				$length = ComponentbuilderHelper::getBetween($options,'length="','"');
+				$length = ComponentbuilderHelper::getBetween($options, 'length="', '"');
 				if (ComponentbuilderHelper::checkString($length))
 				{
 					$buket['length'] = $length;
-				} else {
+				}
+				else
+				{
 					$buket['length'] = false;
 				}
 			}
@@ -9540,57 +9529,57 @@ class Interpretation extends Fields
 		return $buket;
 	}
 
-	public function getValueScript($type,$name,$extends,$unique)
+	public function getValueScript($type, $name, $extends, $unique)
 	{
-		$select		= '';
-		$isArray	= false;
-		$keyName	= $name.'_'.$unique;
+		$select = '';
+		$isArray = false;
+		$keyName = $name . '_' . $unique;
 		if ($type === 'checkboxes' || $extends === 'checkboxes')
 		{
-			$select =  "var ".$keyName." = [];".PHP_EOL."\tjQuery('#jform_".$name." input[type=checkbox]').each(function()".PHP_EOL."\t{".PHP_EOL."\t\tif (jQuery(this).is(':checked'))".PHP_EOL."\t\t{".PHP_EOL."\t\t\t".$keyName.".push(jQuery(this).prop('value'));".PHP_EOL."\t\t}".PHP_EOL."\t});";
+			$select = "var " . $keyName . " = [];" . PHP_EOL . "\tjQuery('#jform_" . $name . " input[type=checkbox]').each(function()" . PHP_EOL . "\t{" . PHP_EOL . "\t\tif (jQuery(this).is(':checked'))" . PHP_EOL . "\t\t{" . PHP_EOL . "\t\t\t" . $keyName . ".push(jQuery(this).prop('value'));" . PHP_EOL . "\t\t}" . PHP_EOL . "\t});";
 			$isArray = true;
 		}
-		elseif($type === 'checkbox')
+		elseif ($type === 'checkbox')
 		{
-			$select = 'var '.$keyName.' = jQuery("#jform_'.$name.'").prop(\'checked\');';
+			$select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").prop(\'checked\');';
 		}
 		elseif ($type === 'radio')
 		{
-			$select = 'var '.$keyName.' = jQuery("#jform_'.$name.' input[type=\'radio\']:checked").val();';
+			$select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . ' input[type=\'radio\']:checked").val();';
 		}
-		elseif (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($type,$this->setScriptUserSwitch))
+		elseif (isset($this->setScriptUserSwitch) && ComponentbuilderHelper::checkArray($this->setScriptUserSwitch) && in_array($type, $this->setScriptUserSwitch))
 		{
 			// this is only since 3.3.4
-			$select = 'var '.$keyName.' = jQuery("#jform_'.$name.'_id").val();';
+			$select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '_id").val();';
 		}
 		elseif ($type === 'list' || ComponentbuilderHelper::typeField($type, 'dynamic') || !ComponentbuilderHelper::typeField($type))
 		{
-			$select = 'var '.$keyName.' = jQuery("#jform_'.$name.'").val();';
+			$select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").val();';
 			$isArray = true;
 		}
-		elseif(ComponentbuilderHelper::typeField($type, 'text'))
+		elseif (ComponentbuilderHelper::typeField($type, 'text'))
 		{
-			$select = 'var '.$keyName.' = jQuery("#jform_'.$name.'").val();';
+			$select = 'var ' . $keyName . ' = jQuery("#jform_' . $name . '").val();';
 		}
-		return array( 'get' => $select, 'isArray' => $isArray);
+		return array('get' => $select, 'isArray' => $isArray);
 	}
 
-	public function clearValueScript($type,$name,$unique)
+	public function clearValueScript($type, $name, $unique)
 	{
-		$clear		= '';
-		$isArray	= false;
-		$keyName	= $name.'_'.$unique;
-		if($type === 'text' || $type === 'password' || $type === 'textarea')
+		$clear = '';
+		$isArray = false;
+		$keyName = $name . '_' . $unique;
+		if ($type === 'text' || $type === 'password' || $type === 'textarea')
 		{
-			$clear =  "jQuery('#jform_".$name."').value = '';";
+			$clear = "jQuery('#jform_" . $name . "').value = '';";
 		}
-		elseif($type === 'radio')
+		elseif ($type === 'radio')
 		{
-			$clear = "jQuery('#jform_".$name."').checked = false;";
+			$clear = "jQuery('#jform_" . $name . "').checked = false;";
 		}
-		elseif($type === 'checkboxes' || $type === 'checkbox' || $type === 'checkbox')
+		elseif ($type === 'checkboxes' || $type === 'checkbox' || $type === 'checkbox')
 		{
-			$clear = "jQuery('#jform_".$name."').selectedIndex = -1;";
+			$clear = "jQuery('#jform_" . $name . "').selectedIndex = -1;";
 		}
 		return $clear;
 	}
@@ -9613,46 +9602,46 @@ class Interpretation extends Fields
 		return '';
 	}
 
-	public function setValidationFix($view,$Component)
+	public function setValidationFix($view, $Component)
 	{
 		$fix = '';
 		if (isset($this->validationFixBuilder[$view]) && ComponentbuilderHelper::checkArray($this->validationFixBuilder[$view]))
 		{
-			$fix .= PHP_EOL.PHP_EOL."\t/**";
-			$fix .= PHP_EOL."\t* Method to validate the form data.";
-			$fix .= PHP_EOL."\t*";
-			$fix .= PHP_EOL."\t* @param   JForm   \$form   The form to validate against.";
-			$fix .= PHP_EOL."\t* @param   array   \$data   The data to validate.";
-			$fix .= PHP_EOL."\t* @param   string  \$group  The name of the field group to validate.";
-			$fix .= PHP_EOL."\t*";
-			$fix .= PHP_EOL."\t* @return  mixed  Array of filtered data if valid, false otherwise.";
-			$fix .= PHP_EOL."\t*";
-			$fix .= PHP_EOL."\t* @see     JFormRule";
-			$fix .= PHP_EOL."\t* @see     JFilterInput";
-			$fix .= PHP_EOL."\t* @since   12.2";
-			$fix .= PHP_EOL."\t*/";
-			$fix .= PHP_EOL."\tpublic function validate(\$form, \$data, \$group = null)";
-			$fix .= PHP_EOL."\t{";
-			$fix .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." check if the not_required field is set";
-			$fix .= PHP_EOL."\t\tif (".$Component."Helper::checkString(\$data['not_required']))";
-			$fix .= PHP_EOL."\t\t{";
-			$fix .= PHP_EOL."\t\t\t\$requiredFields = (array) explode(',',(string) \$data['not_required']);";
-			$fix .= PHP_EOL."\t\t\t\$requiredFields = array_unique(\$requiredFields);";
-			$fix .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." now change the required field attributes value";
-			$fix .= PHP_EOL."\t\t\tforeach (\$requiredFields as \$requiredField)";
-			$fix .= PHP_EOL."\t\t\t{";
-			$fix .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." make sure there is a string value";
-			$fix .= PHP_EOL."\t\t\t\tif (".$Component."Helper::checkString(\$requiredField))";
-			$fix .= PHP_EOL."\t\t\t\t{";
-			$fix .= PHP_EOL."\t\t\t\t\t//".$this->setLine(__LINE__)." change to false";
-			$fix .= PHP_EOL."\t\t\t\t\t\$form->setFieldAttribute(\$requiredField, 'required', 'false');";
-			$fix .= PHP_EOL."\t\t\t\t\t//".$this->setLine(__LINE__)." also clear the data set";
-			$fix .= PHP_EOL."\t\t\t\t\t\$data[\$requiredField] = '';";
-			$fix .= PHP_EOL."\t\t\t\t}";
-			$fix .= PHP_EOL."\t\t\t}";
-			$fix .= PHP_EOL."\t\t}";
-			$fix .= PHP_EOL."\t\treturn parent::validate(\$form, \$data, \$group);";
-			$fix .= PHP_EOL."\t}";
+			$fix .= PHP_EOL . PHP_EOL . "\t/**";
+			$fix .= PHP_EOL . "\t* Method to validate the form data.";
+			$fix .= PHP_EOL . "\t*";
+			$fix .= PHP_EOL . "\t* @param   JForm   \$form   The form to validate against.";
+			$fix .= PHP_EOL . "\t* @param   array   \$data   The data to validate.";
+			$fix .= PHP_EOL . "\t* @param   string  \$group  The name of the field group to validate.";
+			$fix .= PHP_EOL . "\t*";
+			$fix .= PHP_EOL . "\t* @return  mixed  Array of filtered data if valid, false otherwise.";
+			$fix .= PHP_EOL . "\t*";
+			$fix .= PHP_EOL . "\t* @see     JFormRule";
+			$fix .= PHP_EOL . "\t* @see     JFilterInput";
+			$fix .= PHP_EOL . "\t* @since   12.2";
+			$fix .= PHP_EOL . "\t*/";
+			$fix .= PHP_EOL . "\tpublic function validate(\$form, \$data, \$group = null)";
+			$fix .= PHP_EOL . "\t{";
+			$fix .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " check if the not_required field is set";
+			$fix .= PHP_EOL . "\t\tif (" . $Component . "Helper::checkString(\$data['not_required']))";
+			$fix .= PHP_EOL . "\t\t{";
+			$fix .= PHP_EOL . "\t\t\t\$requiredFields = (array) explode(',',(string) \$data['not_required']);";
+			$fix .= PHP_EOL . "\t\t\t\$requiredFields = array_unique(\$requiredFields);";
+			$fix .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " now change the required field attributes value";
+			$fix .= PHP_EOL . "\t\t\tforeach (\$requiredFields as \$requiredField)";
+			$fix .= PHP_EOL . "\t\t\t{";
+			$fix .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " make sure there is a string value";
+			$fix .= PHP_EOL . "\t\t\t\tif (" . $Component . "Helper::checkString(\$requiredField))";
+			$fix .= PHP_EOL . "\t\t\t\t{";
+			$fix .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " change to false";
+			$fix .= PHP_EOL . "\t\t\t\t\t\$form->setFieldAttribute(\$requiredField, 'required', 'false');";
+			$fix .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " also clear the data set";
+			$fix .= PHP_EOL . "\t\t\t\t\t\$data[\$requiredField] = '';";
+			$fix .= PHP_EOL . "\t\t\t\t}";
+			$fix .= PHP_EOL . "\t\t\t}";
+			$fix .= PHP_EOL . "\t\t}";
+			$fix .= PHP_EOL . "\t\treturn parent::validate(\$form, \$data, \$group);";
+			$fix .= PHP_EOL . "\t}";
 		}
 		return $fix;
 	}
@@ -9662,8 +9651,8 @@ class Interpretation extends Fields
 		$fix = '';
 		if (isset($this->customScriptBuilder['token'][$view]) && $this->customScriptBuilder['token'][$view])
 		{
-			$fix .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Add Ajax Token";
-			$fix .= PHP_EOL."\t\t\$this->document->addScriptDeclaration(\"var token = '\".JSession::getFormToken().\"';\");";
+			$fix .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Add Ajax Token";
+			$fix .= PHP_EOL . "\t\t\$this->document->addScriptDeclaration(\"var token = '\".JSession::getFormToken().\"';\");";
 		}
 		return $fix;
 	}
@@ -9685,7 +9674,7 @@ class Interpretation extends Fields
 			{
 				foreach ($taskArray as $name)
 				{
-					$tasks .= PHP_EOL."\t\t\$this->registerTask('".$name."', 'ajax');";
+					$tasks .= PHP_EOL . "\t\t\$this->registerTask('" . $name . "', 'ajax');";
 				}
 			}
 		}
@@ -9705,10 +9694,10 @@ class Interpretation extends Fields
 			{
 				foreach ($view as $task)
 				{
-					$input[$task['task_name']][] = PHP_EOL."\t\t\t\t\t\t\$".$task['value_name']."Value = \$jinput->get('".$task['value_name']."', ".$task['input_default'].", '".$task['input_filter']."');";
-					$valueArray[$task['task_name']][] = "\$".$task['value_name']."Value";
-					$getModel[$task['task_name']] = PHP_EOL."\t\t\t\t\t\t\t\$result = \$this->getModel('ajax')->".$task['method_name']."([[[valueArray]]]);";
-					
+					$input[$task['task_name']][] = PHP_EOL . "\t\t\t\t\t\t\$" . $task['value_name'] . "Value = \$jinput->get('" . $task['value_name'] . "', " . $task['input_default'] . ", '" . $task['input_filter'] . "');";
+					$valueArray[$task['task_name']][] = "\$" . $task['value_name'] . "Value";
+					$getModel[$task['task_name']] = PHP_EOL . "\t\t\t\t\t\t\t\$result = \$this->getModel('ajax')->" . $task['method_name'] . "([[[valueArray]]]);";
+
 					// see user check is needed
 					if (isset($task['user_check']) && 1 == $task['user_check'])
 					{
@@ -9726,52 +9715,52 @@ class Interpretation extends Fields
 			{
 				foreach ($getModel as $task => $getMethod)
 				{
-					$cases .= PHP_EOL."\t\t\t\tcase '".$task."':";
-					$cases .= PHP_EOL."\t\t\t\t\ttry";
-					$cases .= PHP_EOL."\t\t\t\t\t{";
-					$cases .= PHP_EOL."\t\t\t\t\t\t\$returnRaw = \$jinput->get('raw', false, 'BOOLEAN');";
+					$cases .= PHP_EOL . "\t\t\t\tcase '" . $task . "':";
+					$cases .= PHP_EOL . "\t\t\t\t\ttry";
+					$cases .= PHP_EOL . "\t\t\t\t\t{";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t\$returnRaw = \$jinput->get('raw', false, 'BOOLEAN');";
 					foreach ($input[$task] as $string)
 					{
 						$cases .= $string;
 					}
 					// set the values
-					$values = implode(', ',$valueArray[$task]);
-					$ifvalues = implode(' && ',$valueArray[$task]);
+					$values = implode(', ', $valueArray[$task]);
+					$ifvalues = implode(' && ', $valueArray[$task]);
 					// set the values to method
-					$getMethod = str_replace('[[[valueArray]]]',$values,$getMethod);
-					$cases .= PHP_EOL."\t\t\t\t\t\tif(".$ifvalues.$userCheck[$task].")";
-					$cases .= PHP_EOL."\t\t\t\t\t\t{";
+					$getMethod = str_replace('[[[valueArray]]]', $values, $getMethod);
+					$cases .= PHP_EOL . "\t\t\t\t\t\tif(" . $ifvalues . $userCheck[$task] . ")";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t{";
 					$cases .= $getMethod;
-					$cases .= PHP_EOL."\t\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\t\t\telse";
-					$cases .= PHP_EOL."\t\t\t\t\t\t{";
-					$cases .= PHP_EOL."\t\t\t\t\t\t\t\$result = false;";
-					$cases .= PHP_EOL."\t\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\t\t\tif(\$callback = \$jinput->get('callback', null, 'CMD'))";
-					$cases .= PHP_EOL."\t\t\t\t\t\t{";
-					$cases .= PHP_EOL."\t\t\t\t\t\t\techo \$callback . \"(\".json_encode(\$result).\");\";";
-					$cases .= PHP_EOL."\t\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\t\t\telseif(\$returnRaw)";
-					$cases .= PHP_EOL."\t\t\t\t\t\t{";
-					$cases .= PHP_EOL."\t\t\t\t\t\t\techo json_encode(\$result);";
-					$cases .= PHP_EOL."\t\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\t\t\telse";
-					$cases .= PHP_EOL."\t\t\t\t\t\t{";
-					$cases .= PHP_EOL."\t\t\t\t\t\t\techo \"(\".json_encode(\$result).\");\";";
-					$cases .= PHP_EOL."\t\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\t\tcatch(Exception \$e)";
-					$cases .= PHP_EOL."\t\t\t\t\t{";
-					$cases .= PHP_EOL."\t\t\t\t\t\tif(\$callback = \$jinput->get('callback', null, 'CMD'))";
-					$cases .= PHP_EOL."\t\t\t\t\t\t{";
-					$cases .= PHP_EOL."\t\t\t\t\t\t\techo \$callback.\"(\".json_encode(\$e).\");\";";
-					$cases .= PHP_EOL."\t\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\t\t\telse";
-					$cases .= PHP_EOL."\t\t\t\t\t\t{";
-					$cases .= PHP_EOL."\t\t\t\t\t\t\techo \"(\".json_encode(\$e).\");\";";
-					$cases .= PHP_EOL."\t\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\t\t}";
-					$cases .= PHP_EOL."\t\t\t\tbreak;";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\t\t\telse";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t{";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t\t\$result = false;";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\t\t\tif(\$callback = \$jinput->get('callback', null, 'CMD'))";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t{";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t\techo \$callback . \"(\".json_encode(\$result).\");\";";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\t\t\telseif(\$returnRaw)";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t{";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t\techo json_encode(\$result);";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\t\t\telse";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t{";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t\techo \"(\".json_encode(\$result).\");\";";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\t\tcatch(Exception \$e)";
+					$cases .= PHP_EOL . "\t\t\t\t\t{";
+					$cases .= PHP_EOL . "\t\t\t\t\t\tif(\$callback = \$jinput->get('callback', null, 'CMD'))";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t{";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t\techo \$callback.\"(\".json_encode(\$e).\");\";";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\t\t\telse";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t{";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t\techo \"(\".json_encode(\$e).\");\";";
+					$cases .= PHP_EOL . "\t\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\t\t}";
+					$cases .= PHP_EOL . "\t\t\t\tbreak;";
 				}
 			}
 		}
@@ -9785,15 +9774,14 @@ class Interpretation extends Fields
 		{
 			foreach ($this->customScriptBuilder[$target]['ajax_model'] as $view => $method)
 			{
-				$methods .= PHP_EOL.PHP_EOL."\t//".$this->setLine(__LINE__)." Used in ".$view.PHP_EOL;
+				$methods .= PHP_EOL . PHP_EOL . "\t//" . $this->setLine(__LINE__) . " Used in " . $view . PHP_EOL;
 				$methods .= $this->setPlaceholders($method, $this->placeholders);
 			}
 		}
 		return $methods;
 	}
 
-
-	public function setFilterFunctions($viewName_single,$viewName_list)
+	public function setFilterFunctions($viewName_single, $viewName_list)
 	{
 		if (isset($this->filterBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->filterBuilder[$viewName_list]))
 		{
@@ -9804,33 +9792,33 @@ class Interpretation extends Fields
 			{
 				if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom']) && $filter['custom']['extends'] === 'user')
 				{
-					$function[] = PHP_EOL."\tprotected function getThe".$filter['function'].ComponentbuilderHelper::safeString($filter['custom']['text'],'F')."Selections()";
+					$function[] = PHP_EOL . "\tprotected function getThe" . $filter['function'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F') . "Selections()";
 					$function[] = "\t{";
-					$function[] = "\t\t//".$this->setLine(__LINE__)." Get a db connection.";
+					$function[] = "\t\t//" . $this->setLine(__LINE__) . " Get a db connection.";
 					$function[] = "\t\t\$db = JFactory::getDbo();";
-					$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Create a new query object.";
+					$function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object.";
 					$function[] = "\t\t\$query = \$db->getQuery(true);";
-					$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select the text.";
-					$function[] = "\t\t\$query->select(\$db->quoteName(array('a.".$filter['custom']['id']."','a.".$filter['custom']['text']."')));";
-					$function[] = "\t\t\$query->from(\$db->quoteName('".$filter['custom']['table']."', 'a'));";
-					$function[] = "\t\t//".$this->setLine(__LINE__)." get the targeted groups";
-					$function[] = "\t\t\$groups= JComponentHelper::getParams('com_".$component."')->get('".$filter['type']."');";
+					$function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select the text.";
+					$function[] = "\t\t\$query->select(\$db->quoteName(array('a." . $filter['custom']['id'] . "','a." . $filter['custom']['text'] . "')));";
+					$function[] = "\t\t\$query->from(\$db->quoteName('" . $filter['custom']['table'] . "', 'a'));";
+					$function[] = "\t\t//" . $this->setLine(__LINE__) . " get the targeted groups";
+					$function[] = "\t\t\$groups= JComponentHelper::getParams('com_" . $component . "')->get('" . $filter['type'] . "');";
 					$function[] = "\t\tif (count(\$groups) > 0)";
 					$function[] = "\t\t{";
 					$function[] = "\t\t\t\$query->join('LEFT', \$db->quoteName('#__user_usergroup_map', 'group') . ' ON (' . \$db->quoteName('group.user_id') . ' = ' . \$db->quoteName('a.id') . ')');";
 					$function[] = "\t\t\t\$query->where('group.group_id IN (' . implode(',', \$groups) . ')');";
 					$function[] = "\t\t}";
-					$function[] = "\t\t\$query->order('a.".$filter['custom']['text']." ASC');";
-					$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Reset the query using our newly populated query object.";
+					$function[] = "\t\t\$query->order('a." . $filter['custom']['text'] . " ASC');";
+					$function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object.";
 					$function[] = "\t\t\$db->setQuery(\$query);";
-					$function[] = PHP_EOL."\t\t\$results = \$db->loadObjectList();";
+					$function[] = PHP_EOL . "\t\t\$results = \$db->loadObjectList();";
 					$function[] = "\t\tif (\$results)";
 					$function[] = "\t\t{";
 					$function[] = "\t\t\t\$filter = array();";
 					$function[] = "\t\t\t\$batch = array();";
 					$function[] = "\t\t\tforeach (\$results as \$result)";
 					$function[] = "\t\t\t{";
-					$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", \$result->".$filter['custom']['text'].");";
+					$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->" . $filter['custom']['id'] . ", \$result->" . $filter['custom']['text'] . ");";
 					$function[] = "\t\t\t}";
 					$function[] = "\t\t\treturn  \$filter;";
 					$function[] = "\t\t}";
@@ -9838,95 +9826,94 @@ class Interpretation extends Fields
 					$function[] = "\t}";
 
 					/* else
-					{
-						$function[] = PHP_EOL."\tprotected function getThe".$filter['function'].ComponentbuilderHelper::safeString($filter['custom']['text'],'F')."Selections()";
-						$function[] = "\t{";
-						$function[] = "\t\t//".$this->setLine(__LINE__)." Get a db connection.";
-						$function[] = "\t\t\$db = JFactory::getDbo();";
-						$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select the text.";
-						$function[] = "\t\t\$query = \$db->getQuery(true);";
-						$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select the text.";
-						$function[] = "\t\t\$query->select(\$db->quoteName(array('".$filter['custom']['id']."','".$filter['custom']['text']."')));";
-						$function[] = "\t\t\$query->from(\$db->quoteName('".$filter['custom']['table']."'));";
-						$function[] = "\t\t\$query->where(\$db->quoteName('published') . ' = 1');";
-						$function[] = "\t\t\$query->order(\$db->quoteName('".$filter['custom']['text']."') . ' ASC');";
-						$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Reset the query using our newly populated query object.";
-						$function[] = "\t\t\$db->setQuery(\$query);";
-						$function[] = PHP_EOL."\t\t\$results = \$db->loadObjectList();";
-						$function[] = PHP_EOL."\t\tif (\$results)";
-						$function[] = "\t\t{";
-						$function[] = "\t\t\t\$filter = array();";
-						$function[] = "\t\t\t\$batch = array();";
-						$function[] = "\t\t\tforeach (\$results as \$result)";
-						$function[] = "\t\t\t{";
-						if ($filter['custom']['text'] === 'user')
-						{
-							$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);";
-							$function[] = "\t\t\t\t\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);";
-						}
-						else
-						{
-							$function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", \$result->".$filter['custom']['text'].");";
-							$function[] = "\t\t\t\t\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", \$result->".$filter['custom']['text'].");";
-						}
-						$function[] = "\t\t\t}";
-						$function[] = "\t\t\treturn array('filter' => \$filter, 'batch' => \$batch);";
-						$function[] = "\t\t}";
-						$function[] = "\t\treturn false;";
-						$function[] = "\t}";
-					}*/
+					  {
+					  $function[] = PHP_EOL."\tprotected function getThe".$filter['function'].ComponentbuilderHelper::safeString($filter['custom']['text'],'F')."Selections()";
+					  $function[] = "\t{";
+					  $function[] = "\t\t//".$this->setLine(__LINE__)." Get a db connection.";
+					  $function[] = "\t\t\$db = JFactory::getDbo();";
+					  $function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select the text.";
+					  $function[] = "\t\t\$query = \$db->getQuery(true);";
+					  $function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select the text.";
+					  $function[] = "\t\t\$query->select(\$db->quoteName(array('".$filter['custom']['id']."','".$filter['custom']['text']."')));";
+					  $function[] = "\t\t\$query->from(\$db->quoteName('".$filter['custom']['table']."'));";
+					  $function[] = "\t\t\$query->where(\$db->quoteName('published') . ' = 1');";
+					  $function[] = "\t\t\$query->order(\$db->quoteName('".$filter['custom']['text']."') . ' ASC');";
+					  $function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Reset the query using our newly populated query object.";
+					  $function[] = "\t\t\$db->setQuery(\$query);";
+					  $function[] = PHP_EOL."\t\t\$results = \$db->loadObjectList();";
+					  $function[] = PHP_EOL."\t\tif (\$results)";
+					  $function[] = "\t\t{";
+					  $function[] = "\t\t\t\$filter = array();";
+					  $function[] = "\t\t\t\$batch = array();";
+					  $function[] = "\t\t\tforeach (\$results as \$result)";
+					  $function[] = "\t\t\t{";
+					  if ($filter['custom']['text'] === 'user')
+					  {
+					  $function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);";
+					  $function[] = "\t\t\t\t\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", JFactory::getUser(\$result->".$filter['custom']['text'].")->name);";
+					  }
+					  else
+					  {
+					  $function[] = "\t\t\t\t\$filter[] = JHtml::_('select.option', \$result->".$filter['custom']['text'].", \$result->".$filter['custom']['text'].");";
+					  $function[] = "\t\t\t\t\$batch[] = JHtml::_('select.option', \$result->".$filter['custom']['id'].", \$result->".$filter['custom']['text'].");";
+					  }
+					  $function[] = "\t\t\t}";
+					  $function[] = "\t\t\treturn array('filter' => \$filter, 'batch' => \$batch);";
+					  $function[] = "\t\t}";
+					  $function[] = "\t\treturn false;";
+					  $function[] = "\t}";
+					  } */
 				}
 				elseif ($filter['type'] != 'category' && !ComponentbuilderHelper::checkArray($filter['custom']))
 				{
 					$translation = false;
-					if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list])
-						&& array_key_exists($filter['code'],$this->selectionTranslationFixBuilder[$viewName_list]))
+					if (isset($this->selectionTranslationFixBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$viewName_list]) && array_key_exists($filter['code'], $this->selectionTranslationFixBuilder[$viewName_list]))
 					{
 						$translation = true;
 					}
-					$function[] = PHP_EOL."\tprotected function getThe".$filter['function']."Selections()";
+					$function[] = PHP_EOL . "\tprotected function getThe" . $filter['function'] . "Selections()";
 					$function[] = "\t{";
-					$function[] = "\t\t//".$this->setLine(__LINE__)." Get a db connection.";
+					$function[] = "\t\t//" . $this->setLine(__LINE__) . " Get a db connection.";
 					$function[] = "\t\t\$db = JFactory::getDbo();";
-					$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Create a new query object.";
+					$function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Create a new query object.";
 					$function[] = "\t\t\$query = \$db->getQuery(true);";
-					$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Select the text.";
-					$function[] = "\t\t\$query->select(\$db->quoteName('".$filter['code']."'));";
-					$function[] = "\t\t\$query->from(\$db->quoteName('#__".$component."_".$filter['database']."'));";
-					$function[] = "\t\t\$query->order(\$db->quoteName('".$filter['code']."') . ' ASC');";
-					$function[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Reset the query using our newly populated query object.";
+					$function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Select the text.";
+					$function[] = "\t\t\$query->select(\$db->quoteName('" . $filter['code'] . "'));";
+					$function[] = "\t\t\$query->from(\$db->quoteName('#__" . $component . "_" . $filter['database'] . "'));";
+					$function[] = "\t\t\$query->order(\$db->quoteName('" . $filter['code'] . "') . ' ASC');";
+					$function[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Reset the query using our newly populated query object.";
 					$function[] = "\t\t\$db->setQuery(\$query);";
-					$function[] = PHP_EOL."\t\t\$results = \$db->loadColumn();";
-					$function[] = PHP_EOL."\t\tif (\$results)";
+					$function[] = PHP_EOL . "\t\t\$results = \$db->loadColumn();";
+					$function[] = PHP_EOL . "\t\tif (\$results)";
 					$function[] = "\t\t{";
 					// check if translated vlaue is used
 					if ($translation)
 					{
-						$function[] = "\t\t\t//".$this->setLine(__LINE__)." get model";
+						$function[] = "\t\t\t//" . $this->setLine(__LINE__) . " get model";
 						$function[] = "\t\t\t\$model = \$this->getModel();";
 					}
 					$function[] = "\t\t\t\$results = array_unique(\$results);";
 					$function[] = "\t\t\t\$_filter = array();";
-					$function[] = "\t\t\tforeach (\$results as \$".$filter['code'].")";
+					$function[] = "\t\t\tforeach (\$results as \$" . $filter['code'] . ")";
 					$function[] = "\t\t\t{";
 
 					// check if translated vlaue is used
 					if ($translation)
 					{
-						$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Translate the ".$filter['code']." selection";
-						$function[] = "\t\t\t\t\$text = \$model->selectionTranslation(\$".$filter['code'].",'".$filter['code']."');";
-						$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
-						$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", JText::_(\$text));";
+						$function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Translate the " . $filter['code'] . " selection";
+						$function[] = "\t\t\t\t\$text = \$model->selectionTranslation(\$" . $filter['code'] . ",'" . $filter['code'] . "');";
+						$function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array";
+						$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JText::_(\$text));";
 					}
 					elseif ($filter['type'] === 'user')
 					{
-						$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
-						$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", JFactory::getUser(\$".$filter['code'].")->name);";
+						$function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array";
+						$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", JFactory::getUser(\$" . $filter['code'] . ")->name);";
 					}
 					else
 					{
-						$function[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now add the ".$filter['code']." and its text to the options array";
-						$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$".$filter['code'].", \$".$filter['code'].");";
+						$function[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Now add the " . $filter['code'] . " and its text to the options array";
+						$function[] = "\t\t\t\t\$_filter[] = JHtml::_('select.option', \$" . $filter['code'] . ", \$" . $filter['code'] . ");";
 					}
 					$function[] = "\t\t\t}";
 					$function[] = "\t\t\treturn \$_filter;";
@@ -9938,7 +9925,7 @@ class Interpretation extends Fields
 			if (ComponentbuilderHelper::checkArray($function))
 			{
 				// return the function
-				return PHP_EOL.implode(PHP_EOL,$function);
+				return PHP_EOL . implode(PHP_EOL, $function);
 			}
 		}
 		return '';
@@ -9947,7 +9934,7 @@ class Interpretation extends Fields
 	public function setUniqueFields(&$view)
 	{
 		$fields = array();
-		$fields[] = PHP_EOL.PHP_EOL."\t/**";
+		$fields[] = PHP_EOL . PHP_EOL . "\t/**";
 		$fields[] = "\t * Method to get the unique fields of this table.";
 		$fields[] = "\t *";
 		$fields[] = "\t * @return  mixed  An array of field names, boolean false if none is set.";
@@ -9958,7 +9945,7 @@ class Interpretation extends Fields
 		$fields[] = "\t{";
 		if (isset($this->dbUniqueKeys[$view]) && ComponentbuilderHelper::checkArray($this->dbUniqueKeys[$view]))
 		{
-			$fields[] = "\t\treturn array('".implode("','",$this->dbUniqueKeys[$view])."');";
+			$fields[] = "\t\treturn array('" . implode("','", $this->dbUniqueKeys[$view]) . "');";
 		}
 		else
 		{
@@ -9966,7 +9953,7 @@ class Interpretation extends Fields
 		}
 		$fields[] = "\t}";
 		// return the unique fields
-		return implode(PHP_EOL,$fields);
+		return implode(PHP_EOL, $fields);
 	}
 
 	public function setOtherFilter(&$view)
@@ -9978,27 +9965,27 @@ class Interpretation extends Fields
 			{
 				if ($filter['type'] != 'category' && ComponentbuilderHelper::checkArray($filter['custom']) && $filter['custom']['extends'] !== 'user')
 				{
-					$CodeName = ComponentbuilderHelper::safeString($filter['code'].' '.$filter['custom']['text'],'W');
-					$codeName = $filter['code'].ComponentbuilderHelper::safeString($filter['custom']['text'],'F');
-					$type = ComponentbuilderHelper::safeString($filter['custom']['type'],'F');
-					$otherFilter[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set ".$CodeName." Selection";
-					$otherFilter[] = "\t\t\$this->".$codeName."Options = JFormHelper::loadFieldType('".$type."')->getOptions();";
-					$otherFilter[] = "\t\tif (\$this->".$codeName."Options)";
+					$CodeName = ComponentbuilderHelper::safeString($filter['code'] . ' ' . $filter['custom']['text'], 'W');
+					$codeName = $filter['code'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F');
+					$type = ComponentbuilderHelper::safeString($filter['custom']['type'], 'F');
+					$otherFilter[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set " . $CodeName . " Selection";
+					$otherFilter[] = "\t\t\$this->" . $codeName . "Options = JFormHelper::loadFieldType('" . $type . "')->getOptions();";
+					$otherFilter[] = "\t\tif (\$this->" . $codeName . "Options)";
 					$otherFilter[] = "\t\t{";
-					$otherFilter[] = "\t\t\t//".$this->setLine(__LINE__)." ".$CodeName." Filter";
+					$otherFilter[] = "\t\t\t//" . $this->setLine(__LINE__) . " " . $CodeName . " Filter";
 					$otherFilter[] = "\t\t\tJHtmlSidebar::addFilter(";
-					$otherFilter[] = "\t\t\t\t'- Select '.JText::_('".$filter['lang']."').' -',";
-					$otherFilter[] = "\t\t\t\t'filter_".$filter['code']."',";
-					$otherFilter[] = "\t\t\t\tJHtml::_('select.options', \$this->".$codeName."Options, 'value', 'text', \$this->state->get('filter.".$filter['code']."'))";
+					$otherFilter[] = "\t\t\t\t'- Select '.JText::_('" . $filter['lang'] . "').' -',";
+					$otherFilter[] = "\t\t\t\t'filter_" . $filter['code'] . "',";
+					$otherFilter[] = "\t\t\t\tJHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))";
 					$otherFilter[] = "\t\t\t);";
 
-					$otherFilter[] = PHP_EOL."\t\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)";
+					$otherFilter[] = PHP_EOL . "\t\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)";
 					$otherFilter[] = "\t\t\t{";
-					$otherFilter[] = "\t\t\t\t//".$this->setLine(__LINE__)." ".$CodeName." Batch Selection";
+					$otherFilter[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $CodeName . " Batch Selection";
 					$otherFilter[] = "\t\t\t\tJHtmlBatch_::addListSelection(";
-					$otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText::_('".$filter['lang']."').' -',";
-					$otherFilter[] = "\t\t\t\t\t'batch[".$filter['code']."]',";
-					$otherFilter[] = "\t\t\t\t\tJHtml::_('select.options', \$this->".$codeName."Options, 'value', 'text')";
+					$otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText::_('" . $filter['lang'] . "').' -',";
+					$otherFilter[] = "\t\t\t\t\t'batch[" . $filter['code'] . "]',";
+					$otherFilter[] = "\t\t\t\t\tJHtml::_('select.options', \$this->" . $codeName . "Options, 'value', 'text')";
 					$otherFilter[] = "\t\t\t\t);";
 					$otherFilter[] = "\t\t\t}";
 
@@ -10006,33 +9993,33 @@ class Interpretation extends Fields
 				}
 				elseif ($filter['type'] != 'category')
 				{
-					$Codename = ComponentbuilderHelper::safeString($filter['code'],'W');
+					$Codename = ComponentbuilderHelper::safeString($filter['code'], 'W');
 					if (isset($filter['custom']) && ComponentbuilderHelper::checkArray($filter['custom']) && $filter['custom']['extends'] === 'user')
 					{
-						$functionName = "\$this->getThe".$filter['function'].ComponentbuilderHelper::safeString($filter['custom']['text'],'F')."Selections();";
+						$functionName = "\$this->getThe" . $filter['function'] . ComponentbuilderHelper::safeString($filter['custom']['text'], 'F') . "Selections();";
 					}
 					else
 					{
-						$functionName = "\$this->getThe".$filter['function']."Selections();";
+						$functionName = "\$this->getThe" . $filter['function'] . "Selections();";
 					}
-					$otherFilter[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Set ".$Codename." Selection";
-					$otherFilter[] = "\t\t\$this->".$filter['code']."Options = ".$functionName;
-					$otherFilter[] = "\t\tif (\$this->".$filter['code']."Options)";
+					$otherFilter[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Set " . $Codename . " Selection";
+					$otherFilter[] = "\t\t\$this->" . $filter['code'] . "Options = " . $functionName;
+					$otherFilter[] = "\t\tif (\$this->" . $filter['code'] . "Options)";
 					$otherFilter[] = "\t\t{";
-					$otherFilter[] = "\t\t\t//".$this->setLine(__LINE__)." ".$Codename." Filter";
+					$otherFilter[] = "\t\t\t//" . $this->setLine(__LINE__) . " " . $Codename . " Filter";
 					$otherFilter[] = "\t\t\tJHtmlSidebar::addFilter(";
-					$otherFilter[] = "\t\t\t\t'- Select '.JText::_('".$filter['lang']."').' -',";
-					$otherFilter[] = "\t\t\t\t'filter_".$filter['code']."',";
-					$otherFilter[] = "\t\t\t\tJHtml::_('select.options', \$this->".$filter['code']."Options, 'value', 'text', \$this->state->get('filter.".$filter['code']."'))";
+					$otherFilter[] = "\t\t\t\t'- Select '.JText::_('" . $filter['lang'] . "').' -',";
+					$otherFilter[] = "\t\t\t\t'filter_" . $filter['code'] . "',";
+					$otherFilter[] = "\t\t\t\tJHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text', \$this->state->get('filter." . $filter['code'] . "'))";
 					$otherFilter[] = "\t\t\t);";
 
-					$otherFilter[] = PHP_EOL."\t\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)";
+					$otherFilter[] = PHP_EOL . "\t\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)";
 					$otherFilter[] = "\t\t\t{";
-					$otherFilter[] = "\t\t\t\t//".$this->setLine(__LINE__)." ".$Codename." Batch Selection";
+					$otherFilter[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " " . $Codename . " Batch Selection";
 					$otherFilter[] = "\t\t\t\tJHtmlBatch_::addListSelection(";
-					$otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText::_('".$filter['lang']."').' -',";
-					$otherFilter[] = "\t\t\t\t\t'batch[".$filter['code']."]',";
-					$otherFilter[] = "\t\t\t\t\tJHtml::_('select.options', \$this->".$filter['code']."Options, 'value', 'text')";
+					$otherFilter[] = "\t\t\t\t\t'- Keep Original '.JText::_('" . $filter['lang'] . "').' -',";
+					$otherFilter[] = "\t\t\t\t\t'batch[" . $filter['code'] . "]',";
+					$otherFilter[] = "\t\t\t\t\tJHtml::_('select.options', \$this->" . $filter['code'] . "Options, 'value', 'text')";
 					$otherFilter[] = "\t\t\t\t);";
 					$otherFilter[] = "\t\t\t}";
 
@@ -10042,7 +10029,7 @@ class Interpretation extends Fields
 			if (ComponentbuilderHelper::checkArray($otherFilter))
 			{
 				// return the filter
-				return PHP_EOL.implode(PHP_EOL,$otherFilter);
+				return PHP_EOL . implode(PHP_EOL, $otherFilter);
 			}
 		}
 		return '';
@@ -10063,38 +10050,37 @@ class Interpretation extends Fields
 			}
 			// set component name
 			$component = ComponentbuilderHelper::safeString($this->componentData->name_code);
-			$COMONENT = ComponentbuilderHelper::safeString($this->componentData->name_code,'U');
+			$COMONENT = ComponentbuilderHelper::safeString($this->componentData->name_code, 'U');
 			// set filter
 			$filter = array();
-			$filter[] = PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." Category Filter.";
+			$filter[] = PHP_EOL . PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Category Filter.";
 			$filter[] = "\t\tJHtmlSidebar::addFilter(";
 			$filter[] = "\t\t\tJText::_('JOPTION_SELECT_CATEGORY'),";
 			$filter[] = "\t\t\t'filter_category_id',";
-			$filter[] = "\t\t\tJHtml::_('select.options', JHtml::_('category.options', 'com_".$component.".".$otherViews."'), 'value', 'text', \$this->state->get('filter.category_id'))";
+			$filter[] = "\t\t\tJHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text', \$this->state->get('filter.category_id'))";
 			$filter[] = "\t\t);";
 
 
-			$filter[] = PHP_EOL."\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)";
+			$filter[] = PHP_EOL . "\t\tif (\$this->canBatch && \$this->canCreate && \$this->canEdit)";
 			$filter[] = "\t\t{";
-			$filter[] = "\t\t\t//".$this->setLine(__LINE__)." Category Batch selection.";
+			$filter[] = "\t\t\t//" . $this->setLine(__LINE__) . " Category Batch selection.";
 			$filter[] = "\t\t\tJHtmlBatch_::addListSelection(";
-			$filter[] = "\t\t\t\tJText::_('COM_".$COMONENT."_KEEP_ORIGINAL_CATEGORY'),";
+			$filter[] = "\t\t\t\tJText::_('COM_" . $COMONENT . "_KEEP_ORIGINAL_CATEGORY'),";
 			$filter[] = "\t\t\t\t'batch[category]',";
-			$filter[] = "\t\t\t\tJHtml::_('select.options', JHtml::_('category.options', 'com_".$component.".".$otherViews."'), 'value', 'text')";
+			$filter[] = "\t\t\t\tJHtml::_('select.options', JHtml::_('category.options', 'com_" . $component . "." . $otherViews . "'), 'value', 'text')";
 			$filter[] = "\t\t\t);";
 			$filter[] = "\t\t}";
 
 			// return the filter
-			return implode(PHP_EOL,$filter);
+			return implode(PHP_EOL, $filter);
 		}
 		return '';
 	}
 
-
-
-	public function setRouterCategoryViews($viewName_single,$viewName_list)
+	public function setRouterCategoryViews($viewName_single, $viewName_list)
 	{
-		if(isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])){
+		if (isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))
+		{
 			// set component name
 			$component = ComponentbuilderHelper::safeString($this->componentData->name_code);
 			// check if category has another name
@@ -10109,45 +10095,44 @@ class Interpretation extends Fields
 				$otherView = $viewName_single;
 			}
 			// load the category helper details in not already loaded
-			if (!isset($this->fileContentDynamic['category'.$otherViews]['###view###']))
+			if (!isset($this->fileContentDynamic['category' . $otherViews]['###view###']))
 			{
 				// lets also set the category helper for this view
-				$target = array('site' => 'category'.$viewName_list);
+				$target = array('site' => 'category' . $viewName_list);
 				$this->buildDynamique($target, 'category');
 				// insure the file gets updated
-				$this->fileContentDynamic['category'.$otherViews]['###view###'] = $otherView;
-				$this->fileContentDynamic['category'.$otherViews]['###View###'] = ucfirst($otherView);
-				$this->fileContentDynamic['category'.$otherViews]['###views###'] = $otherViews;
-				$this->fileContentDynamic['category'.$otherViews]['###Views###'] = ucfirst($otherViews);
+				$this->fileContentDynamic['category' . $otherViews]['###view###'] = $otherView;
+				$this->fileContentDynamic['category' . $otherViews]['###View###'] = ucfirst($otherView);
+				$this->fileContentDynamic['category' . $otherViews]['###views###'] = $otherViews;
+				$this->fileContentDynamic['category' . $otherViews]['###Views###'] = ucfirst($otherViews);
 				// set script to global helper file
 				$includeHelper = array();
-				$includeHelper[] = "\n//".$this->setLine(__LINE__)."Insure this view category file is loaded.";
-				$includeHelper[] = "\$classname = '".$this->fileContentStatic['###component###'] . ucfirst($viewName_list) . "Categories';";
+				$includeHelper[] = "\n//" . $this->setLine(__LINE__) . "Insure this view category file is loaded.";
+				$includeHelper[] = "\$classname = '" . $this->fileContentStatic['###component###'] . ucfirst($viewName_list) . "Categories';";
 				$includeHelper[] = "if (!class_exists(\$classname))";
 				$includeHelper[] = "{";
-				$includeHelper[] = "\t\$path = JPATH_SITE . '/components/com_".$this->fileContentStatic['###component###']."/helpers/category" . $viewName_list . ".php';";
+				$includeHelper[] = "\t\$path = JPATH_SITE . '/components/com_" . $this->fileContentStatic['###component###'] . "/helpers/category" . $viewName_list . ".php';";
 				$includeHelper[] = "\tif (is_file(\$path))";
 				$includeHelper[] = "\t{";
 				$includeHelper[] = "\t\tinclude_once \$path;";
 				$includeHelper[] = "\t}";
 				$includeHelper[] = "}";
-				$this->fileContentStatic['###CATEGORY_CLASS_TREES###'] .= implode("\n",$includeHelper);
+				$this->fileContentStatic['###CATEGORY_CLASS_TREES###'] .= implode("\n", $includeHelper);
 			}
 			// return category view string
 			if (isset($this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###']) && ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###']))
 			{
-				return ",".PHP_EOL."\t\t\t".'"com_'.$component.'.'.$otherViews.'" => "'.$otherView.'"';
+				return "," . PHP_EOL . "\t\t\t" . '"com_' . $component . '.' . $otherViews . '" => "' . $otherView . '"';
 			}
 			else
 			{
-				return PHP_EOL."\t\t\t".'"com_'.$component.'.'.$otherViews.'" => "'.$otherView.'"';
+				return PHP_EOL . "\t\t\t" . '"com_' . $component . '.' . $otherViews . '" => "' . $otherView . '"';
 			}
 		}
 		return '';
-
 	}
 
-	public function setJcontrollerAllowAdd($viewName_single,$viewName_list)
+	public function setJcontrollerAllowAdd($viewName_single, $viewName_list)
 	{
 		$allow = array();
 		// set component name
@@ -10160,7 +10145,7 @@ class Interpretation extends Fields
 			$coreLoad = true;
 		}
 		// check if item has category
-		if(0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) <-- remove category from check
+		if (0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])) <-- remove category from check
 		{
 			// check if category has another name
 			if ($coreLoad && isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list]))
@@ -10174,13 +10159,13 @@ class Interpretation extends Fields
 				$otherView = $viewName_single;
 			}
 			// setup the category script
-			$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." get the user object";
+			$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get the user object";
 			$allow[] = "\t\t\$user = JFactory::getUser();";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($otherView,$this->permissionBuilder['global'][$core['core.access']]))
+			if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.access']]))
 			{
-				$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Access check.";
-				$allow[] = "\t\t\$access = \$user->authorise('".$core['core.access']."', 'com_".$component."');";
+				$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access check.";
+				$allow[] = "\t\t\$access = \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "');";
 				$allow[] = "\t\tif (!\$access)";
 				$allow[] = "\t\t{";
 				$allow[] = "\t\t\treturn false;";
@@ -10188,24 +10173,24 @@ class Interpretation extends Fields
 			}
 			$allow[] = "\t\t\$categoryId = JArrayHelper::getValue(\$data, 'catid', \$this->input->getInt('filter_category_id'), 'int');";
 			$allow[] = "\t\t\$allow = null;";
-			$allow[] = PHP_EOL."\t\tif (\$categoryId)";
+			$allow[] = PHP_EOL . "\t\tif (\$categoryId)";
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." If the category has been passed in the URL check it.";
-			$allow[] = "\t\t\t\$allow = \$user->authorise('core.create', \$this->option . '.".$otherViews.".category.' . \$categoryId);";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " If the category has been passed in the URL check it.";
+			$allow[] = "\t\t\t\$allow = \$user->authorise('core.create', \$this->option . '." . $otherViews . ".category.' . \$categoryId);";
 			$allow[] = "\t\t}";
-			$allow[] = PHP_EOL."\t\tif (\$allow === null)";
+			$allow[] = PHP_EOL . "\t\tif (\$allow === null)";
 			$allow[] = "\t\t{";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.create']]))
+			if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']]))
 			{
 				// setup the default script
-				$allow[] = "\t\t\t//".$this->setLine(__LINE__)." In the absense of better information, revert to the component permissions.";
-				$allow[] = "\t\t\treturn \$user->authorise('".$core['core.create']."', \$this->option);";
+				$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions.";
+				$allow[] = "\t\t\treturn \$user->authorise('" . $core['core.create'] . "', \$this->option);";
 			}
 			else
 			{
 				// setup the default script
-				$allow[] = "\t\t\t//".$this->setLine(__LINE__)." In the absense of better information, revert to the component permissions.";
+				$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions.";
 				$allow[] = "\t\t\treturn parent::allowAdd(\$data);";
 			}
 			$allow[] = "\t\t}";
@@ -10217,39 +10202,39 @@ class Interpretation extends Fields
 		else
 		{
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.access']]))
+			if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.access']]))
 			{
-				$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Access check.";
-				$allow[] = "\t\t\$access = JFactory::getUser()->authorise('".$core['core.access']."', 'com_".$component."');";
+				$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access check.";
+				$allow[] = "\t\t\$access = JFactory::getUser()->authorise('" . $core['core.access'] . "', 'com_" . $component . "');";
 				$allow[] = "\t\tif (!\$access)";
 				$allow[] = "\t\t{";
 				$allow[] = "\t\t\treturn false;";
 				$allow[] = "\t\t}";
 			}
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.create']]))
+			if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']]))
 			{
 				// setup the default script
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." In the absense of better information, revert to the component permissions.";
-				$allow[] = "\t\treturn JFactory::getUser()->authorise('".$core['core.create']."', \$this->option);";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions.";
+				$allow[] = "\t\treturn JFactory::getUser()->authorise('" . $core['core.create'] . "', \$this->option);";
 			}
 			else
 			{
 				// setup the default script
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." In the absense of better information, revert to the component permissions.";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions.";
 				$allow[] = "\t\treturn parent::allowAdd(\$data);";
 			}
 		}
-		return implode(PHP_EOL,$allow);
+		return implode(PHP_EOL, $allow);
 	}
 
-	public function setJcontrollerAllowEdit($viewName_single,$viewName_list)
+	public function setJcontrollerAllowEdit($viewName_single, $viewName_list)
 	{
 		$allow = array();
 		// set component name
 		$component = ComponentbuilderHelper::safeString($this->componentData->name_code);
 		// prepare custom permission script
-                $customAllow = $this->getCustomScriptBuilder('php_allowedit', $viewName_single, '', null, true);
+		$customAllow = $this->getCustomScriptBuilder('php_allowedit', $viewName_single, '', null, true);
 		// setup correct core target
 		$coreLoad = false;
 		if (isset($this->permissionCore[$viewName_single]))
@@ -10257,7 +10242,8 @@ class Interpretation extends Fields
 			$core = $this->permissionCore[$viewName_single];
 			$coreLoad = true;
 		}
-		if(isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list])){
+		if (isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))
+		{
 			// check if category has another name
 			if ($coreLoad && isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list]))
 			{
@@ -10270,69 +10256,69 @@ class Interpretation extends Fields
 				$otherView = $viewName_single;
 			}
 			// setup the category script
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." get user object.";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " get user object.";
 			$allow[] = "\t\t\$user\t\t= JFactory::getUser();";
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." get record id.";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " get record id.";
 			$allow[] = "\t\t\$recordId\t= (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
 			// load custom permission script
 			$allow[] = $customAllow;
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($otherView,$this->permissionBuilder['global'][$core['core.access']]))
+			if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.access']]))
 			{
-				$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Access check.";
-				$allow[] = "\t\t\$access = (\$user->authorise('".$core['core.access']."', 'com_".$component.".".$otherView.".' . (int) \$recordId) && \$user->authorise('".$core['core.access']."', 'com_".$component."'));";
+				$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access check.";
+				$allow[] = "\t\t\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));";
 				$allow[] = "\t\tif (!\$access)";
 				$allow[] = "\t\t{";
 				$allow[] = "\t\t\treturn false;";
 				$allow[] = "\t\t}";
 			}
-			$allow[] = PHP_EOL."\t\tif (\$recordId)";
+			$allow[] = PHP_EOL . "\t\tif (\$recordId)";
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." The record has been set. Check the record permissions.";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions.";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($otherView,$this->permissionBuilder[$core['core.edit']]))
+			if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($otherView, $this->permissionBuilder[$core['core.edit']]))
 			{
-				$allow[] = "\t\t\t\$permission = \$user->authorise('".$core['core.edit']."', 'com_".$component.".".$otherView.".' . (int) \$recordId);";
+				$allow[] = "\t\t\t\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);";
 			}
 			else
 			{
-				$allow[] = "\t\t\t\$permission = \$user->authorise('core.edit', 'com_".$component.".".$otherView.".' . (int) \$recordId);";
+				$allow[] = "\t\t\t\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $otherView . ".' . (int) \$recordId);";
 			}
 			$allow[] = "\t\t\tif (!\$permission)";
 			$allow[] = "\t\t\t{";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.own']]) && in_array($otherView,$this->permissionBuilder[$core['core.edit.own']]))
+			if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.own']]) && in_array($otherView, $this->permissionBuilder[$core['core.edit.own']]))
 			{
-				$allow[] = "\t\t\t\tif (\$user->authorise('".$core['core.edit.own']."', 'com_".$component.".".$otherView.".' . \$recordId))";
+				$allow[] = "\t\t\t\tif (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $otherView . ".' . \$recordId))";
 			}
 			else
 			{
-				$allow[] = "\t\t\t\tif (\$user->authorise('core.edit.own', 'com_".$component.".".$otherView.".' . \$recordId))";
+				$allow[] = "\t\t\t\tif (\$user->authorise('core.edit.own', 'com_" . $component . "." . $otherView . ".' . \$recordId))";
 			}
 			$allow[] = "\t\t\t\t{";
-			$allow[] = "\t\t\t\t\t//".$this->setLine(__LINE__)." Fallback on edit.own. Now test the owner is the user.";
+			$allow[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fallback on edit.own. Now test the owner is the user.";
 			$allow[] = "\t\t\t\t\t\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
 			$allow[] = "\t\t\t\t\tif (empty(\$ownerId))";
 			$allow[] = "\t\t\t\t\t{";
-			$allow[] = "\t\t\t\t\t\t//".$this->setLine(__LINE__)." Need to do a lookup from the model.";
+			$allow[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " Need to do a lookup from the model.";
 			$allow[] = "\t\t\t\t\t\t\$record = \$this->getModel()->getItem(\$recordId);";
-			$allow[] = PHP_EOL."\t\t\t\t\t\tif (empty(\$record))";
+			$allow[] = PHP_EOL . "\t\t\t\t\t\tif (empty(\$record))";
 			$allow[] = "\t\t\t\t\t\t{";
 			$allow[] = "\t\t\t\t\t\t\treturn false;";
 			$allow[] = "\t\t\t\t\t\t}";
 			$allow[] = "\t\t\t\t\t\t\$ownerId = \$record->created_by;";
 			$allow[] = "\t\t\t\t\t}";
-			$allow[] = PHP_EOL."\t\t\t\t\t//".$this->setLine(__LINE__)." If the owner matches 'me' then do the test.";
+			$allow[] = PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " If the owner matches 'me' then do the test.";
 			$allow[] = "\t\t\t\t\tif (\$ownerId == \$user->id)";
 			$allow[] = "\t\t\t\t\t{";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.own']]) && in_array($otherView,$this->permissionBuilder['global'][$core['core.edit.own']]))
+			if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.own']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.edit.own']]))
 			{
-				$allow[] = "\t\t\t\t\t\tif (\$user->authorise('".$core['core.edit.own']."', 'com_".$component."'))";
+				$allow[] = "\t\t\t\t\t\tif (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))";
 			}
 			else
 			{
-				$allow[] = "\t\t\t\t\t\tif (\$user->authorise('core.edit.own', 'com_".$component."'))";
+				$allow[] = "\t\t\t\t\t\tif (\$user->authorise('core.edit.own', 'com_" . $component . "'))";
 			}
 			$allow[] = "\t\t\t\t\t\t{";
 			$allow[] = "\t\t\t\t\t\t\treturn true;";
@@ -10352,83 +10338,83 @@ class Interpretation extends Fields
 //			$allow[] = "\t\t\t\t}";
 //			$allow[] = "\t\t\t}";
 			$allow[] = "\t\t}";
-			if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($otherView,$this->permissionBuilder['global'][$core['core.edit']]))
+			if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($otherView, $this->permissionBuilder['global'][$core['core.edit']]))
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." Since there is no permission, revert to the component permissions.";
-				$allow[] = "\t\treturn \$user->authorise('".$core['core.edit']."', \$this->option);";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions.";
+				$allow[] = "\t\treturn \$user->authorise('" . $core['core.edit'] . "', \$this->option);";
 			}
 			else
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." Since there is no permission, revert to the component permissions.";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions.";
 				$allow[] = "\t\treturn parent::allowEdit(\$data, \$key);";
 			}
 		}
 		else
 		{
 			// setup the category script
-			$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." get user object.";
+			$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " get user object.";
 			$allow[] = "\t\t\$user\t\t= JFactory::getUser();";
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." get record id.";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " get record id.";
 			$allow[] = "\t\t\$recordId\t= (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
 			// load custom permission script
 			$allow[] = $customAllow;
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.access']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.access']]))
+			if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.access']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.access']]))
 			{
-				$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Access check.";
-				$allow[] = "\t\t\$access = (\$user->authorise('".$core['core.access']."', 'com_".$component.".".$viewName_single.".' . (int) \$recordId) &&  \$user->authorise('".$core['core.access']."', 'com_".$component."'));";
+				$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access check.";
+				$allow[] = "\t\t\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId) &&  \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));";
 				$allow[] = "\t\tif (!\$access)";
 				$allow[] = "\t\t{";
 				$allow[] = "\t\t\treturn false;";
 				$allow[] = "\t\t}";
 			}
-			$allow[] = PHP_EOL."\t\tif (\$recordId)";
+			$allow[] = PHP_EOL . "\t\tif (\$recordId)";
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." The record has been set. Check the record permissions.";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions.";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit']]))
+			if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']]))
 			{
-				$allow[] = "\t\t\t\$permission = \$user->authorise('".$core['core.edit']."', 'com_".$component.".".$viewName_single.".' . (int) \$recordId);";
+				$allow[] = "\t\t\t\$permission = \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);";
 			}
 			else
 			{
-				$allow[] = "\t\t\t\$permission = \$user->authorise('core.edit', 'com_".$component.".".$viewName_single.".' . (int) \$recordId);";
+				$allow[] = "\t\t\t\$permission = \$user->authorise('core.edit', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);";
 			}
 			$allow[] = "\t\t\tif (!\$permission)";
 			$allow[] = "\t\t\t{";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.own']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit.own']]))
+			if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder[$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.own']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.own']]))
 			{
-				$allow[] = "\t\t\t\tif (\$user->authorise('".$core['core.edit.own']."', 'com_".$component.".".$viewName_single.".' . \$recordId))";
+				$allow[] = "\t\t\t\tif (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "." . $viewName_single . ".' . \$recordId))";
 			}
 			else
 			{
-				$allow[] = "\t\t\t\tif (\$user->authorise('core.edit.own', 'com_".$component.".".$viewName_single.".' . \$recordId))";
+				$allow[] = "\t\t\t\tif (\$user->authorise('core.edit.own', 'com_" . $component . "." . $viewName_single . ".' . \$recordId))";
 			}
 			$allow[] = "\t\t\t\t{";
-			$allow[] = "\t\t\t\t\t//".$this->setLine(__LINE__)." Now test the owner is the user.";
+			$allow[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Now test the owner is the user.";
 			$allow[] = "\t\t\t\t\t\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
 			$allow[] = "\t\t\t\t\tif (empty(\$ownerId))";
 			$allow[] = "\t\t\t\t\t{";
-			$allow[] = "\t\t\t\t\t\t//".$this->setLine(__LINE__)." Need to do a lookup from the model.";
+			$allow[] = "\t\t\t\t\t\t//" . $this->setLine(__LINE__) . " Need to do a lookup from the model.";
 			$allow[] = "\t\t\t\t\t\t\$record = \$this->getModel()->getItem(\$recordId);";
-			$allow[] = PHP_EOL."\t\t\t\t\t\tif (empty(\$record))";
+			$allow[] = PHP_EOL . "\t\t\t\t\t\tif (empty(\$record))";
 			$allow[] = "\t\t\t\t\t\t{";
 			$allow[] = "\t\t\t\t\t\t\treturn false;";
 			$allow[] = "\t\t\t\t\t\t}";
 			$allow[] = "\t\t\t\t\t\t\$ownerId = \$record->created_by;";
 			$allow[] = "\t\t\t\t\t}";
-			$allow[] = PHP_EOL."\t\t\t\t\t//".$this->setLine(__LINE__)." If the owner matches 'me' then allow.";
+			$allow[] = PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " If the owner matches 'me' then allow.";
 			$allow[] = "\t\t\t\t\tif (\$ownerId == \$user->id)";
 			$allow[] = "\t\t\t\t\t{";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.own']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit.own']]))
+			if ($coreLoad && isset($core['core.edit.own']) && isset($this->permissionBuilder['global'][$core['core.edit.own']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.own']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.own']]))
 			{
-				$allow[] = "\t\t\t\t\t\tif (\$user->authorise('".$core['core.edit.own']."', 'com_".$component."'))";
+				$allow[] = "\t\t\t\t\t\tif (\$user->authorise('" . $core['core.edit.own'] . "', 'com_" . $component . "'))";
 			}
 			else
 			{
-				$allow[] = "\t\t\t\t\t\tif (\$user->authorise('core.edit.own', 'com_".$component."'))";
+				$allow[] = "\t\t\t\t\t\tif (\$user->authorise('core.edit.own', 'com_" . $component . "'))";
 			}
 			$allow[] = "\t\t\t\t\t\t{";
 			$allow[] = "\t\t\t\t\t\t\treturn true;";
@@ -10438,30 +10424,30 @@ class Interpretation extends Fields
 			$allow[] = "\t\t\t\treturn false;";
 			$allow[] = "\t\t\t}";
 			$allow[] = "\t\t}";
-			if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit']]))
+			if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']]))
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." Since there is no permission, revert to the component permissions.";
-				$allow[] = "\t\treturn \$user->authorise('".$core['core.edit']."', \$this->option);";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions.";
+				$allow[] = "\t\treturn \$user->authorise('" . $core['core.edit'] . "', \$this->option);";
 			}
 			else
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." Since there is no permission, revert to the component permissions.";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Since there is no permission, revert to the component permissions.";
 				$allow[] = "\t\treturn parent::allowEdit(\$data, \$key);";
 			}
 		}
 
-		return implode(PHP_EOL,$allow);
+		return implode(PHP_EOL, $allow);
 	}
 
-	public function setJmodelAdminGetForm($viewName_single,$viewName_list)
+	public function setJmodelAdminGetForm($viewName_single, $viewName_list)
 	{
 		// set component name
 		$component = ComponentbuilderHelper::safeString($this->componentData->name_code);
 		// allways load these
 		$allow = array();
-		$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get the form.";
-		$allow[] = "\t\t\$form = \$this->loadForm('com_".$component.".".$viewName_single."', '".$viewName_single."', array('control' => 'jform', 'load_data' => \$loadData));";
-		$allow[] = PHP_EOL."\t\tif (empty(\$form))";
+		$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get the form.";
+		$allow[] = "\t\t\$form = \$this->loadForm('com_" . $component . "." . $viewName_single . "', '" . $viewName_single . "', array('control' => 'jform', 'load_data' => \$loadData));";
+		$allow[] = PHP_EOL . "\t\tif (empty(\$form))";
 		$allow[] = "\t\t{";
 		$allow[] = "\t\t\treturn false;";
 		$allow[] = "\t\t}";
@@ -10477,7 +10463,7 @@ class Interpretation extends Fields
 			$core = $this->permissionCore[$viewName_single];
 			$coreLoad = true;
 		}
-		if(0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))  <-- remove category from check
+		if (0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))  <-- remove category from check
 		{
 			// check if category has another name
 			if ($coreLoad && isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list]))
@@ -10491,138 +10477,138 @@ class Interpretation extends Fields
 				$otherView = $viewName_single;
 			}
 			// setup the category script
-			$allow[] = PHP_EOL."\t\t\$jinput = JFactory::getApplication()->input;";
-			$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.";
+			$allow[] = PHP_EOL . "\t\t\$jinput = JFactory::getApplication()->input;";
+			$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.";
 			$allow[] = "\t\tif (\$jinput->get('a_id'))";
 			$allow[] = "\t\t{";
 			$allow[] = "\t\t\t\$id = \$jinput->get('a_id', 0, 'INT');";
 			$allow[] = "\t\t}";
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." The back end uses id so we use that the rest of the time and set it to 0 by default.";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default.";
 			$allow[] = "\t\telse";
 			$allow[] = "\t\t{";
 			$allow[] = "\t\t\t\$id = \$jinput->get('id', 0, 'INT');";
 			$allow[] = "\t\t}";
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." Determine correct permissions to check.";
-			$allow[] = "\t\tif (\$this->getState('".$viewName_single.".id'))";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Determine correct permissions to check.";
+			$allow[] = "\t\tif (\$this->getState('" . $viewName_single . ".id'))";
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t\$id = \$this->getState('".$viewName_single.".id');";
-			$allow[] = PHP_EOL."\t\t\t\$catid = 0;";
+			$allow[] = "\t\t\t\$id = \$this->getState('" . $viewName_single . ".id');";
+			$allow[] = PHP_EOL . "\t\t\t\$catid = 0;";
 			$allow[] = "\t\t\tif (isset(\$this->getItem(\$id)->catid))";
 			$allow[] = "\t\t\t{";
-			$allow[] = "\t\t\t\t//".$this->setLine(__LINE__)." set category id";
+			$allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " set category id";
 			$allow[] = "\t\t\t\t\$catid = \$this->getItem(\$id)->catid;";
-			$allow[] = PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Existing record. Can only edit in selected categories.";
+			$allow[] = PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Existing record. Can only edit in selected categories.";
 			$allow[] = "\t\t\t\t\$form->setFieldAttribute('catid', 'action', 'core.edit');";
-			$allow[] = PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Existing record. Can only edit own items in selected categories.";
+			$allow[] = PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Existing record. Can only edit own items in selected categories.";
 			$allow[] = "\t\t\t\t\$form->setFieldAttribute('catid', 'action', 'core.edit.own');";
 			$allow[] = "\t\t\t}";
 			$allow[] = "\t\t}";
 			$allow[] = "\t\telse";
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." New record. Can only create in selected categories.";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " New record. Can only create in selected categories.";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('catid', 'action', 'core.create');";
 			$allow[] = "\t\t}";
-			$allow[] = PHP_EOL."\t\t\$user = JFactory::getUser();";
-			$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Check for existing item.";
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." Modify the form based on Edit State access controls.";
+			$allow[] = PHP_EOL . "\t\t\$user = JFactory::getUser();";
+			$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check for existing item.";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls.";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit.state']]))
+			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']]))
 			{
-				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('".$core['core.edit.state']."', 'com_".$component.".".$viewName_single.".' . (int) \$id))";
-				$allow[] = "\t\t\t|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_".$component.".".$viewName_list.".category.' . (int) \$catid))";
-				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('".$core['core.edit.state']."', 'com_".$component."')))";
+				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
+				$allow[] = "\t\t\t|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))";
+				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))";
 			}
 			else
 			{
-				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_".$component.".".$viewName_single.".' . (int) \$id))";
-				$allow[] = "\t\t\t|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_".$component.".".$viewName_list.".category.' . (int) \$catid))";
-				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_".$component."')))";
+				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
+				$allow[] = "\t\t\t|| (isset(\$catid) && \$catid != 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_list . ".category.' . (int) \$catid))";
+				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))";
 			}
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields for display.";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display.";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('ordering', 'disabled', 'true');";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('published', 'disabled', 'true');";
-			$allow[] = PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Disable fields while saving.";
+			$allow[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving.";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('ordering', 'filter', 'unset');";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('published', 'filter', 'unset');";
 			$allow[] = "\t\t}";
 		}
 		else
 		{
-			$allow[] = PHP_EOL."\t\t\$jinput = JFactory::getApplication()->input;";
-			$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.";
+			$allow[] = PHP_EOL . "\t\t\$jinput = JFactory::getApplication()->input;";
+			$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.";
 			$allow[] = "\t\tif (\$jinput->get('a_id'))";
 			$allow[] = "\t\t{";
 			$allow[] = "\t\t\t\$id = \$jinput->get('a_id', 0, 'INT');";
 			$allow[] = "\t\t}";
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." The back end uses id so we use that the rest of the time and set it to 0 by default.";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " The back end uses id so we use that the rest of the time and set it to 0 by default.";
 			$allow[] = "\t\telse";
 			$allow[] = "\t\t{";
 			$allow[] = "\t\t\t\$id = \$jinput->get('id', 0, 'INT');";
 			$allow[] = "\t\t}";
-			$allow[] = PHP_EOL."\t\t\$user = JFactory::getUser();";
-			$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Check for existing item.";
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." Modify the form based on Edit State access controls.";
+			$allow[] = PHP_EOL . "\t\t\$user = JFactory::getUser();";
+			$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check for existing item.";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit State access controls.";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit.state']]))
+			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']]))
 			{
-				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('".$core['core.edit.state']."', 'com_".$component.".".$viewName_single.".' . (int) \$id))";
-				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('".$core['core.edit.state']."', 'com_".$component."')))";
+				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
+				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "')))";
 			}
 			else
 			{
-				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_".$component.".".$viewName_single.".' . (int) \$id))";
-				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_".$component."')))";
+				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
+				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('core.edit.state', 'com_" . $component . "')))";
 			}
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields for display.";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display.";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('ordering', 'disabled', 'true');";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('published', 'disabled', 'true');";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields while saving.";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving.";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('ordering', 'filter', 'unset');";
 			$allow[] = "\t\t\t\$form->setFieldAttribute('published', 'filter', 'unset');";
 			$allow[] = "\t\t}";
-		}		
-		$allow[] = "\t\t//".$this->setLine(__LINE__)." If this is a new item insure the greated by is set.";
+		}
+		$allow[] = "\t\t//" . $this->setLine(__LINE__) . " If this is a new item insure the greated by is set.";
 		$allow[] = "\t\tif (0 == \$id)";
 		$allow[] = "\t\t{";
-		$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Set the created_by to this user";
+		$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set the created_by to this user";
 		$allow[] = "\t\t\t\$form->setValue('created_by', null, \$user->id);";
 		$allow[] = "\t\t}";
-		$allow[] = "\t\t//".$this->setLine(__LINE__)." Modify the form based on Edit Creaded By access controls.";
+		$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded By access controls.";
 		// check if the item has permissions.
-		if ($coreLoad && isset($core['core.edit.created_by']) && isset($this->permissionBuilder[$core['core.edit.created_by']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created_by']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit.created_by']]))
+		if ($coreLoad && isset($core['core.edit.created_by']) && isset($this->permissionBuilder[$core['core.edit.created_by']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created_by']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.created_by']]))
 		{
-			$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('".$core['core.edit.created_by']."', 'com_".$component.".".$viewName_single.".' . (int) \$id))";
-			$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('".$core['core.edit.created_by']."', 'com_".$component."')))";
+			$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
+			$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created_by'] . "', 'com_" . $component . "')))";
 		}
 		else
 		{
-			$allow[] = "\t\tif (!\$user->authorise('core.edit.created_by', 'com_".$component."'))";
+			$allow[] = "\t\tif (!\$user->authorise('core.edit.created_by', 'com_" . $component . "'))";
 		}
 		$allow[] = "\t\t{";
-		$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields for display.";
+		$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display.";
 		$allow[] = "\t\t\t\$form->setFieldAttribute('created_by', 'disabled', 'true');";
-		$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields for display.";
+		$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display.";
 		$allow[] = "\t\t\t\$form->setFieldAttribute('created_by', 'readonly', 'true');";
-		$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields while saving.";
+		$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving.";
 		$allow[] = "\t\t\t\$form->setFieldAttribute('created_by', 'filter', 'unset');";
 		$allow[] = "\t\t}";
-		$allow[] = "\t\t//".$this->setLine(__LINE__)." Modify the form based on Edit Creaded Date access controls.";
+		$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit Creaded Date access controls.";
 		// check if the item has permissions.
-		if ($coreLoad && isset($core['core.edit.created']) && isset($this->permissionBuilder[$core['core.edit.created']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit.created']]))
+		if ($coreLoad && isset($core['core.edit.created']) && isset($this->permissionBuilder[$core['core.edit.created']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.created']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.created']]))
 		{
-			$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('".$core['core.edit.created']."', 'com_".$component.".".$viewName_single.".' . (int) \$id))";
-			$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('".$core['core.edit.created']."', 'com_".$component."')))";
+			$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
+			$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $core['core.edit.created'] . "', 'com_" . $component . "')))";
 		}
 		else
 		{
-			$allow[] = "\t\tif (!\$user->authorise('core.edit.created', 'com_".$component."'))";
+			$allow[] = "\t\tif (!\$user->authorise('core.edit.created', 'com_" . $component . "'))";
 		}
 		$allow[] = "\t\t{";
-		$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields for display.";
+		$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display.";
 		$allow[] = "\t\t\t\$form->setFieldAttribute('created', 'disabled', 'true');";
-		$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields while saving.";
+		$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving.";
 		$allow[] = "\t\t\t\$form->setFieldAttribute('created', 'filter', 'unset');";
 		$allow[] = "\t\t}";
 		// handel the fields permissions
@@ -10630,57 +10616,57 @@ class Interpretation extends Fields
 		{
 			foreach ($this->permissionFields[$viewName_single] as $fieldName => $fieldType)
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." Modify the form based on Edit ".ComponentbuilderHelper::safeString($fieldName, 'W')." access controls.";
-				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('".$viewName_single.".edit.".$fieldName."', 'com_".$component.".".$viewName_single.".' . (int) \$id))";
-				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('".$viewName_single.".edit.".$fieldName."', 'com_".$component."')))";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Modify the form based on Edit " . ComponentbuilderHelper::safeString($fieldName, 'W') . " access controls.";
+				$allow[] = "\t\tif (\$id != 0 && (!\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$id))";
+				$allow[] = "\t\t\t|| (\$id == 0 && !\$user->authorise('" . $viewName_single . ".edit." . $fieldName . "', 'com_" . $component . "')))";
 				$allow[] = "\t\t{";
-				$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields for display.";
-				$allow[] = "\t\t\t\$form->setFieldAttribute('".$fieldName."', 'disabled', 'true');";
-				$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable fields for display.";
-				$allow[] = "\t\t\t\$form->setFieldAttribute('".$fieldName."', 'readonly', 'true');";
+				$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display.";
+				$allow[] = "\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'disabled', 'true');";
+				$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable fields for display.";
+				$allow[] = "\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'readonly', 'true');";
 				if ('radio' === $fieldType || 'repeatable' === $fieldType)
 				{
-					$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Disable radio button for display.";
-					$allow[] = "\t\t\t\$class = \$form->getFieldAttribute('".$fieldName."', 'class', '');";
-					$allow[] = "\t\t\t\$form->setFieldAttribute('".$fieldName."', 'class', \$class.' disabled no-click');";
+					$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Disable radio button for display.";
+					$allow[] = "\t\t\t\$class = \$form->getFieldAttribute('" . $fieldName . "', 'class', '');";
+					$allow[] = "\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'class', \$class.' disabled no-click');";
 				}
-				$allow[] = "\t\t\tif (!\$form->getValue('".$fieldName."'))";
+				$allow[] = "\t\t\tif (!\$form->getValue('" . $fieldName . "'))";
 				$allow[] = "\t\t\t{";
-				$allow[] = "\t\t\t\t//".$this->setLine(__LINE__)." Disable fields while saving.";
-				$allow[] = "\t\t\t\t\$form->setFieldAttribute('".$fieldName."', 'filter', 'unset');";
-				$allow[] = "\t\t\t\t//".$this->setLine(__LINE__)." Disable fields while saving.";
-				$allow[] = "\t\t\t\t\$form->setFieldAttribute('".$fieldName."', 'required', 'false');";
+				$allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving.";
+				$allow[] = "\t\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'filter', 'unset');";
+				$allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Disable fields while saving.";
+				$allow[] = "\t\t\t\t\$form->setFieldAttribute('" . $fieldName . "', 'required', 'false');";
 				$allow[] = "\t\t\t}";
 				$allow[] = "\t\t}";
 			}
 		}
 		// add the redirect trick to set the field of origin		
-		$allow[] = "\t\t//".$this->setLine(__LINE__)." Only load these values if no id is found";
+		$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Only load these values if no id is found";
 		$allow[] = "\t\tif (0 == \$id)";
-		$allow[] = "\t\t{";		
-		$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Set redirected field name";
+		$allow[] = "\t\t{";
+		$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set redirected field name";
 		$allow[] = "\t\t\t\$redirectedField = \$jinput->get('ref', null, 'STRING');";
-		$allow[] = "\t\t\t//".$this->setLine(__LINE__)." Set redirected field value";
+		$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " Set redirected field value";
 		$allow[] = "\t\t\t\$redirectedValue = \$jinput->get('refid', 0, 'INT');";
 		$allow[] = "\t\t\tif (0 != \$redirectedValue && \$redirectedField)";
 		$allow[] = "\t\t\t{";
-		$allow[] = "\t\t\t\t//".$this->setLine(__LINE__)." Now set the local-redirected field default value";
+		$allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Now set the local-redirected field default value";
 		$allow[] = "\t\t\t\t\$form->setValue(\$redirectedField, null, \$redirectedValue);";
 		$allow[] = "\t\t\t}";
 		$allow[] = "\t\t}";
 		// setup the default script
-		$allow[] = PHP_EOL."\t\treturn \$form;";
+		$allow[] = PHP_EOL . "\t\treturn \$form;";
 
-		return implode(PHP_EOL,$allow);
+		return implode(PHP_EOL, $allow);
 	}
 
-	public function setJmodelAdminAllowEdit($viewName_single,$viewName_list)
+	public function setJmodelAdminAllowEdit($viewName_single, $viewName_list)
 	{
 		$allow = array();
 		// set component name
 		$component = ComponentbuilderHelper::safeString($this->componentData->name_code);
 		// prepare custom permission script
-                $customAllow = $this->getCustomScriptBuilder('php_allowedit', $viewName_single, "\t\t\$recordId\t= (int) isset(\$data[\$key]) ? \$data[\$key] : 0;".PHP_EOL);
+		$customAllow = $this->getCustomScriptBuilder('php_allowedit', $viewName_single, "\t\t\$recordId\t= (int) isset(\$data[\$key]) ? \$data[\$key] : 0;" . PHP_EOL);
 		// setup correct core target
 		$coreLoad = false;
 		if (isset($this->permissionCore[$viewName_single]))
@@ -10689,30 +10675,30 @@ class Interpretation extends Fields
 			$coreLoad = true;
 		}
 		// check if the item has permissions.
-		if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit']]))
+		if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']]))
 		{
-			$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Check specific edit permission then general edit permission.";
+			$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission.";
 			$allow[] = "\t\t\$user = JFactory::getUser();";
 			// load custom permission script
 			$allow[] = $customAllow;
-			$allow[] = "\t\treturn \$user->authorise('".$core['core.edit']."', 'com_".$component.".".$viewName_single.".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or \$user->authorise('".$core['core.edit']."',  'com_".$component."');";
+			$allow[] = "\t\treturn \$user->authorise('" . $core['core.edit'] . "', 'com_" . $component . "." . $viewName_single . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or \$user->authorise('" . $core['core.edit'] . "',  'com_" . $component . "');";
 		}
 		else
 		{
-			$allow[] = PHP_EOL."\t\t//".$this->setLine(__LINE__)." Check specific edit permission then general edit permission.";
+			$allow[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Check specific edit permission then general edit permission.";
 			if (ComponentbuilderHelper::checkString($customAllow))
 			{
 				$allow[] = "\t\t\$user = JFactory::getUser();";
 			}
 			// load custom permission script
 			$allow[] = $customAllow;
-			$allow[] = "\t\treturn JFactory::getUser()->authorise('core.edit', 'com_".$component.".".$viewName_single.".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or parent::allowEdit(\$data, \$key);";
+			$allow[] = "\t\treturn JFactory::getUser()->authorise('core.edit', 'com_" . $component . "." . $viewName_single . ".'. ((int) isset(\$data[\$key]) ? \$data[\$key] : 0)) or parent::allowEdit(\$data, \$key);";
 		}
 
-		return implode(PHP_EOL,$allow);
+		return implode(PHP_EOL, $allow);
 	}
 
-	public function setJmodelAdminCanDelete($viewName_single,$viewName_list)
+	public function setJmodelAdminCanDelete($viewName_single, $viewName_list)
 	{
 		$allow = array();
 		// set component name
@@ -10724,7 +10710,7 @@ class Interpretation extends Fields
 			$core = $this->permissionCore[$viewName_single];
 			$coreLoad = true;
 		}
-		if(0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))  <-- remove category from check
+		if (0) //isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))  <-- remove category from check
 		{
 			// check if category has another name
 			if ($coreLoad && isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list]))
@@ -10738,29 +10724,29 @@ class Interpretation extends Fields
 				$otherView = $viewName_single;
 			}
 			// setup the category script
-			$allow[] = PHP_EOL."\t\tif (!empty(\$record->id))";
+			$allow[] = PHP_EOL . "\t\tif (!empty(\$record->id))";
 			$allow[] = "\t\t{";
 			$allow[] = "\t\t\tif (\$record->published != -2)";
 			$allow[] = "\t\t\t{";
 			$allow[] = "\t\t\t\treturn;";
 			$allow[] = "\t\t\t}";
-			$allow[] = PHP_EOL."\t\t\t\$user = JFactory::getUser();";
-			$allow[] = "\t\t\t\$allow = \$user->authorise('core.delete', 'com_".$component.".".$otherViews.".category.' . (int) \$record->catid);";
+			$allow[] = PHP_EOL . "\t\t\t\$user = JFactory::getUser();";
+			$allow[] = "\t\t\t\$allow = \$user->authorise('core.delete', 'com_" . $component . "." . $otherViews . ".category.' . (int) \$record->catid);";
 			// check if the item has permissions.
-			if ($coreLoad && isset($this->permissionBuilder[$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.delete']]) && in_array($otherView,$this->permissionBuilder[$core['core.delete']]))
+			if ($coreLoad && isset($this->permissionBuilder[$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.delete']]) && in_array($otherView, $this->permissionBuilder[$core['core.delete']]))
 			{
-				$allow[] = PHP_EOL."\t\t\tif (\$allow)";
+				$allow[] = PHP_EOL . "\t\t\tif (\$allow)";
 				$allow[] = "\t\t\t{";
-				$allow[] = "\t\t\t\t//".$this->setLine(__LINE__)." The record has been set. Check the record permissions.";
-				$allow[] = "\t\t\t\treturn \$user->authorise('".$core['core.delete']."', 'com_".$component.".".$otherView.".' . (int) \$record->id);";
+				$allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions.";
+				$allow[] = "\t\t\t\treturn \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);";
 				$allow[] = "\t\t\t}";
 			}
 			else
 			{
-				$allow[] = PHP_EOL."\t\t\tif (\$allow)";
+				$allow[] = PHP_EOL . "\t\t\tif (\$allow)";
 				$allow[] = "\t\t\t{";
-				$allow[] = "\t\t\t\t//".$this->setLine(__LINE__)." The record has been set. Check the record permissions.";
-				$allow[] = "\t\t\t\treturn \$user->authorise('core.delete', 'com_".$component.".".$otherView.".' . (int) \$record->id);";
+				$allow[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions.";
+				$allow[] = "\t\t\t\treturn \$user->authorise('core.delete', 'com_" . $component . "." . $otherView . ".' . (int) \$record->id);";
 				$allow[] = "\t\t\t}";
 			}
 			$allow[] = "\t\t\treturn \$allow;";
@@ -10770,33 +10756,33 @@ class Interpretation extends Fields
 		else
 		{
 			// setup the default script
-			$allow[] = PHP_EOL."\t\tif (!empty(\$record->id))";
+			$allow[] = PHP_EOL . "\t\tif (!empty(\$record->id))";
 			$allow[] = "\t\t{";
 			$allow[] = "\t\t\tif (\$record->published != -2)";
 			$allow[] = "\t\t\t{";
 			$allow[] = "\t\t\t\treturn;";
 			$allow[] = "\t\t\t}";
 			// check if the item has permissions.
-			if ($coreLoad && (isset($core['core.delete']) && isset($this->permissionBuilder[$core['core.delete']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.delete']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.delete']]))
+			if ($coreLoad && (isset($core['core.delete']) && isset($this->permissionBuilder[$core['core.delete']])) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.delete']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.delete']]))
 			{
-				$allow[] = PHP_EOL."\t\t\t\$user = JFactory::getUser();";
-				$allow[] = "\t\t\t//".$this->setLine(__LINE__)." The record has been set. Check the record permissions.";
-				$allow[] = "\t\t\treturn \$user->authorise('".$core['core.delete']."', 'com_".$component.".".$viewName_single.".' . (int) \$record->id);";
+				$allow[] = PHP_EOL . "\t\t\t\$user = JFactory::getUser();";
+				$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions.";
+				$allow[] = "\t\t\treturn \$user->authorise('" . $core['core.delete'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$record->id);";
 			}
 			else
 			{
-				$allow[] = PHP_EOL."\t\t\t\$user = JFactory::getUser();";
-				$allow[] = "\t\t\t//".$this->setLine(__LINE__)." The record has been set. Check the record permissions.";
-				$allow[] = "\t\t\treturn \$user->authorise('core.delete', 'com_".$component.".".$viewName_single.".' . (int) \$record->id);";
+				$allow[] = PHP_EOL . "\t\t\t\$user = JFactory::getUser();";
+				$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions.";
+				$allow[] = "\t\t\treturn \$user->authorise('core.delete', 'com_" . $component . "." . $viewName_single . ".' . (int) \$record->id);";
 			}
 			$allow[] = "\t\t}";
 			$allow[] = "\t\treturn false;";
 		}
 
-		return implode(PHP_EOL,$allow);
+		return implode(PHP_EOL, $allow);
 	}
 
-	public function setJmodelAdminCanEditState($viewName_single,$viewName_list)
+	public function setJmodelAdminCanEditState($viewName_single, $viewName_list)
 	{
 		$allow = array();
 		// set component name
@@ -10808,7 +10794,7 @@ class Interpretation extends Fields
 			$core = $this->permissionCore[$viewName_single];
 			$coreLoad = true;
 		}
-		if(0) // isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))  <-- remove category from check
+		if (0) // isset($this->categoryBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$viewName_list]))  <-- remove category from check
 		{
 			// check if category has another name
 			if (isset($this->catOtherName[$viewName_list]) && ComponentbuilderHelper::checkArray($this->catOtherName[$viewName_list]))
@@ -10821,19 +10807,19 @@ class Interpretation extends Fields
 				$otherViews = $viewName_list;
 				$otherView = $viewName_single;
 			}
-			$allow[] = PHP_EOL."\t\t\$user = JFactory::getUser();";
+			$allow[] = PHP_EOL . "\t\t\$user = JFactory::getUser();";
 			$allow[] = "\t\t\$recordId\t= (!empty(\$record->id)) ? \$record->id : 0;";
-			$allow[] = PHP_EOL."\t\tif (\$recordId)";
+			$allow[] = PHP_EOL . "\t\tif (\$recordId)";
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." The record has been set. Check the record permissions.";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions.";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit.state']]))
+			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']]))
 			{
-				$allow[] = "\t\t\t\$permission = \$user->authorise('".$core['core.edit.state']."', 'com_".$component.".".$viewName_single.".' . (int) \$recordId);";
+				$allow[] = "\t\t\t\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);";
 			}
 			else
 			{
-				$allow[] = "\t\t\t\$permission = \$user->authorise('core.edit.state', 'com_".$component.".".$viewName_single.".' . (int) \$recordId);";
+				$allow[] = "\t\t\t\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);";
 			}
 			$allow[] = "\t\t\tif (!\$permission && !is_null(\$permission))";
 			$allow[] = "\t\t\t{";
@@ -10841,65 +10827,63 @@ class Interpretation extends Fields
 			$allow[] = "\t\t\t}";
 			$allow[] = "\t\t}";
 			// setup the category script
-			$allow[] = "\t\t//".$this->setLine(__LINE__)." Check against the category.";
+			$allow[] = "\t\t//" . $this->setLine(__LINE__) . " Check against the category.";
 			$allow[] = "\t\tif (!empty(\$record->catid))";
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t\$catpermission = \$user->authorise('core.edit.state', 'com_".$component.".".$otherViews.".category.' . (int) \$record->catid);";
+			$allow[] = "\t\t\t\$catpermission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $otherViews . ".category.' . (int) \$record->catid);";
 			$allow[] = "\t\t\tif (!\$catpermission && !is_null(\$catpermission))";
 			$allow[] = "\t\t\t{";
 			$allow[] = "\t\t\t\treturn false;";
 			$allow[] = "\t\t\t}";
 			$allow[] = "\t\t}";
-			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit.state']]))
+			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']]))
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." In the absense of better information, revert to the component permissions.";
-				$allow[] = "\t\treturn \$user->authorise('".$core['core.edit.state']."', 'com_".$component."');";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions.";
+				$allow[] = "\t\treturn \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');";
 			}
 			else
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." In the absense of better information, revert to the component permissions.";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions.";
 				$allow[] = "\t\treturn parent::canEditState(\$record);";
 			}
 		}
 		else
 		{
 			// setup the default script
-			$allow[] = PHP_EOL."\t\t\$user = JFactory::getUser();";
+			$allow[] = PHP_EOL . "\t\t\$user = JFactory::getUser();";
 			$allow[] = "\t\t\$recordId\t= (!empty(\$record->id)) ? \$record->id : 0;";
-			$allow[] = PHP_EOL."\t\tif (\$recordId)";
+			$allow[] = PHP_EOL . "\t\tif (\$recordId)";
 			$allow[] = "\t\t{";
-			$allow[] = "\t\t\t//".$this->setLine(__LINE__)." The record has been set. Check the record permissions.";
+			$allow[] = "\t\t\t//" . $this->setLine(__LINE__) . " The record has been set. Check the record permissions.";
 			// check if the item has permissions.
-			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder[$core['core.edit.state']]))
+			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder[$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit.state']]))
 			{
-				$allow[] = "\t\t\t\$permission = \$user->authorise('".$core['core.edit.state']."', 'com_".$component.".".$viewName_single.".' . (int) \$recordId);";
+				$allow[] = "\t\t\t\$permission = \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);";
 			}
 			else
 			{
-				$allow[] = "\t\t\t\$permission = \$user->authorise('core.edit.state', 'com_".$component.".".$viewName_single.".' . (int) \$recordId);";
+				$allow[] = "\t\t\t\$permission = \$user->authorise('core.edit.state', 'com_" . $component . "." . $viewName_single . ".' . (int) \$recordId);";
 			}
 			$allow[] = "\t\t\tif (!\$permission && !is_null(\$permission))";
 			$allow[] = "\t\t\t{";
 			$allow[] = "\t\t\t\treturn false;";
 			$allow[] = "\t\t\t}";
 			$allow[] = "\t\t}";
-			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit.state']]))
+			if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']]))
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." In the absense of better information, revert to the component permissions.";
-				$allow[] = "\t\treturn \$user->authorise('".$core['core.edit.state']."', 'com_".$component."');";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions.";
+				$allow[] = "\t\treturn \$user->authorise('" . $core['core.edit.state'] . "', 'com_" . $component . "');";
 			}
 			else
 			{
-				$allow[] = "\t\t//".$this->setLine(__LINE__)." In the absense of better information, revert to the component permissions.";
+				$allow[] = "\t\t//" . $this->setLine(__LINE__) . " In the absense of better information, revert to the component permissions.";
 				$allow[] = "\t\treturn parent::canEditState(\$record);";
 			}
 		}
-		return implode(PHP_EOL,$allow);
+		return implode(PHP_EOL, $allow);
 	}
 
-
-
-	public function setJviewListCanDo($viewName_single,$viewName_list)
+	public function setJviewListCanDo($viewName_single, $viewName_list)
 	{
 		$allow = array();
 		// set component name
@@ -10912,52 +10896,52 @@ class Interpretation extends Fields
 			$coreLoad = true;
 		}
 		// check if the item has permissions for edit.
-		if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit']]))
+		if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit']]))
 		{
-			$allow[] = PHP_EOL."\t\t\$this->canEdit\t\t= \$this->canDo->get('".$core['core.edit']."');";
+			$allow[] = PHP_EOL . "\t\t\$this->canEdit\t\t= \$this->canDo->get('" . $core['core.edit'] . "');";
 		}
 		else
 		{
-			$allow[] = PHP_EOL."\t\t\$this->canEdit\t\t= \$this->canDo->get('core.edit');";
+			$allow[] = PHP_EOL . "\t\t\$this->canEdit\t\t= \$this->canDo->get('core.edit');";
 		}
 		// check if the item has permissions for edit state.
-		if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.edit.state']]))
+		if ($coreLoad && isset($core['core.edit.state']) && isset($this->permissionBuilder['global'][$core['core.edit.state']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit.state']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.edit.state']]))
 		{
-			$allow[] = "\t\t\$this->canState\t\t= \$this->canDo->get('".$core['core.edit.state']."');";
+			$allow[] = "\t\t\$this->canState\t\t= \$this->canDo->get('" . $core['core.edit.state'] . "');";
 		}
 		else
 		{
 			$allow[] = "\t\t\$this->canState\t\t= \$this->canDo->get('core.edit.state');";
 		}
 		// check if the item has permissions for create.
-		if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.create']]))
+		if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']]))
 		{
-			$allow[] = "\t\t\$this->canCreate\t= \$this->canDo->get('".$core['core.create']."');";
+			$allow[] = "\t\t\$this->canCreate\t= \$this->canDo->get('" . $core['core.create'] . "');";
 		}
 		else
 		{
 			$allow[] = "\t\t\$this->canCreate\t= \$this->canDo->get('core.create');";
 		}
 		// check if the item has permissions for delete.
-		if ($coreLoad && isset($core['core.delete']) && isset($this->permissionBuilder['global'][$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.delete']]) && in_array($viewName_single,$this->permissionBuilder['global'][$core['core.delete']]))
+		if ($coreLoad && isset($core['core.delete']) && isset($this->permissionBuilder['global'][$core['core.delete']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.delete']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.delete']]))
 		{
-			$allow[] = "\t\t\$this->canDelete\t= \$this->canDo->get('".$core['core.delete']."');";
+			$allow[] = "\t\t\$this->canDelete\t= \$this->canDo->get('" . $core['core.delete'] . "');";
 		}
 		else
 		{
 			$allow[] = "\t\t\$this->canDelete\t= \$this->canDo->get('core.delete');";
 		}
 		// check if the item has permissions for batch.
-		if ($coreLoad && isset($core['core.batch']) && isset($this->permissionBuilder['global']['global'][$core['core.batch']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global']['global'][$core['core.batch']]) && in_array($viewName_single,$this->permissionBuilder['global']['global'][$core['core.delete']]))
+		if ($coreLoad && isset($core['core.batch']) && isset($this->permissionBuilder['global']['global'][$core['core.batch']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global']['global'][$core['core.batch']]) && in_array($viewName_single, $this->permissionBuilder['global']['global'][$core['core.delete']]))
 		{
-			$allow[] = "\t\t\$this->canBatch\t= (\$this->canDo->get('".$core['core.batch']."') && \$this->canDo->get('core.batch'));";
+			$allow[] = "\t\t\$this->canBatch\t= (\$this->canDo->get('" . $core['core.batch'] . "') && \$this->canDo->get('core.batch'));";
 		}
 		else
 		{
 			$allow[] = "\t\t\$this->canBatch\t= \$this->canDo->get('core.batch');";
 		}
 
-		return implode(PHP_EOL,$allow);
+		return implode(PHP_EOL, $allow);
 	}
 
 	public function setFieldSetAccessControl(&$view)
@@ -10968,29 +10952,29 @@ class Interpretation extends Fields
 			// set component name
 			$component = ComponentbuilderHelper::safeString($this->componentData->name_code);
 			// set label
-			$label = 'Permissions in relation to this '.$view;
+			$label = 'Permissions in relation to this ' . $view;
 			// set the access fieldset
-			$access = "";
-			$access .= PHP_EOL."\t".'
'; - $access .= PHP_EOL."\t\t"; - $access .= PHP_EOL."\t\t".''; - $access .= PHP_EOL."\t\t"; - $access .= PHP_EOL."\t\t".''; - $access .= PHP_EOL."\t".'
'; + $access = ""; + $access .= PHP_EOL . "\t" . '
'; + $access .= PHP_EOL . "\t\t"; + $access .= PHP_EOL . "\t\t" . ''; + $access .= PHP_EOL . "\t\t"; + $access .= PHP_EOL . "\t\t" . ''; + $access .= PHP_EOL . "\t" . '
'; } // return access field set return $access; @@ -10999,42 +10983,42 @@ class Interpretation extends Fields public function setFilterFields(&$view) { // keep track of all fields already added - $donelist = array('id','search','published','access','created_by','modified_by'); + $donelist = array('id', 'search', 'published', 'access', 'created_by', 'modified_by'); // default filter fields $fields = "'a.id','id'"; - $fields .= ",".PHP_EOL."\t\t\t\t'a.published','published'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'a.published','published'"; if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $fields .= ",".PHP_EOL."\t\t\t\t'a.access','access'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'a.access','access'"; } - $fields .= ",".PHP_EOL."\t\t\t\t'a.ordering','ordering'"; - $fields .= ",".PHP_EOL."\t\t\t\t'a.created_by','created_by'"; - $fields .= ",".PHP_EOL."\t\t\t\t'a.modified_by','modified_by'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'a.ordering','ordering'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'a.created_by','created_by'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'a.modified_by','modified_by'"; // add the rest of the set filters if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) { foreach ($this->sortBuilder[$view] as $filter) { - if (!in_array($filter['code'],$donelist)) + if (!in_array($filter['code'], $donelist)) { if ($filter['type'] === 'category') { - $fields .= ",".PHP_EOL."\t\t\t\t'c.title','category_title'"; - $fields .= ",".PHP_EOL."\t\t\t\t'c.id', 'category_id'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'c.title','category_title'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'c.id', 'category_id'"; if ($filter['code'] != 'category') { - $fields .= ",".PHP_EOL."\t\t\t\t'a.".$filter['code']."', '".$filter['code']."'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'a." . $filter['code'] . "', '" . $filter['code'] . "'"; } } else { // check if custom field is set - /*if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $fields .= ",".PHP_EOL."\t\t\t\t'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; - }*/ - $fields .= ",".PHP_EOL."\t\t\t\t'a.".$filter['code']."','".$filter['code']."'"; + /* if (ComponentbuilderHelper::checkArray($filter['custom'])) + { + $fields .= ",".PHP_EOL."\t\t\t\t'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; + } */ + $fields .= "," . PHP_EOL . "\t\t\t\t'a." . $filter['code'] . "','" . $filter['code'] . "'"; } $donelist[] = $filter['code']; } @@ -11045,25 +11029,25 @@ class Interpretation extends Fields { foreach ($this->filterBuilder[$view] as $filter) { - if (!in_array($filter['code'],$donelist)) + if (!in_array($filter['code'], $donelist)) { if ($filter['type'] === 'category') { - $fields .= ",".PHP_EOL."\t\t\t\t'c.title','category_title'"; - $fields .= ",".PHP_EOL."\t\t\t\t'c.id', 'category_id'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'c.title','category_title'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'c.id', 'category_id'"; if ($filter['code'] != 'category') { - $fields .= ",".PHP_EOL."\t\t\t\t'a.".$filter['code']."', '".$filter['code']."'"; + $fields .= "," . PHP_EOL . "\t\t\t\t'a." . $filter['code'] . "', '" . $filter['code'] . "'"; } } else { // check if custom field is set - /*if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $fields .= ",".PHP_EOL."\t\t\t\t'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; - }*/ - $fields .= ",".PHP_EOL."\t\t\t\t'a.".$filter['code']."','".$filter['code']."'"; + /* if (ComponentbuilderHelper::checkArray($filter['custom'])) + { + $fields .= ",".PHP_EOL."\t\t\t\t'".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'"; + } */ + $fields .= "," . PHP_EOL . "\t\t\t\t'a." . $filter['code'] . "','" . $filter['code'] . "'"; } $donelist[] = $filter['code']; } @@ -11075,43 +11059,43 @@ class Interpretation extends Fields public function setStoredId(&$view) { // keep track of all fields already added - $donelist = array('id','search','published','access','created_by','modified_by'); + $donelist = array('id', 'search', 'published', 'access', 'created_by', 'modified_by'); // set the defaults first - $stored = "//".$this->setLine(__LINE__)." Compile the store id."; - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.id');"; - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.search');"; - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.published');"; + $stored = "//" . $this->setLine(__LINE__) . " Compile the store id."; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.id');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.search');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.published');"; if (isset($this->accessBuilder[$view]) && ComponentbuilderHelper::checkString($this->accessBuilder[$view])) { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.access');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.access');"; } - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.ordering');"; - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.created_by');"; - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.modified_by');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.ordering');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.created_by');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.modified_by');"; // add the rest of the set filters if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) { foreach ($this->sortBuilder[$view] as $filter) { - if (!in_array($filter['code'],$donelist)) + if (!in_array($filter['code'], $donelist)) { if ($filter['type'] === 'category') { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.category_id');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.category');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.category_id');"; if ($filter['code'] != 'category') { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } } else { // check if custom field is set - /*if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; - }*/ - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."');"; + /* if (ComponentbuilderHelper::checkArray($filter['custom'])) + { + $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; + } */ + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } $donelist[] = $filter['code']; } @@ -11122,25 +11106,25 @@ class Interpretation extends Fields { foreach ($this->filterBuilder[$view] as $filter) { - if (!in_array($filter['code'],$donelist)) + if (!in_array($filter['code'], $donelist)) { if ($filter['type'] === 'category') { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.category');"; - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.category_id');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.category');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter.category_id');"; if ($filter['code'] != 'category') { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."');"; + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } } else { // check if custom field is set - /*if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; - }*/ - $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."');"; + /* if (ComponentbuilderHelper::checkArray($filter['custom'])) + { + $stored .= PHP_EOL."\t\t\$id .= ':' . \$this->getState('filter.".$filter['code']."_".$filter['custom']['text']."');"; + } */ + $stored .= PHP_EOL . "\t\t\$id .= ':' . \$this->getState('filter." . $filter['code'] . "');"; } $donelist[] = $filter['code']; } @@ -11164,160 +11148,160 @@ class Interpretation extends Fields if ($view['settings']->type == 2) { // set lang strings - $viewNameLang_readonly = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($view['settings']->name_single.' readonly','U'); + $viewNameLang_readonly = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_single . ' readonly', 'U'); // load to lang - $this->langContent[$this->lang][$viewNameLang_readonly] = $view['settings']->name_single.' :: Readonly'; + $this->langContent[$this->lang][$viewNameLang_readonly] = $view['settings']->name_single . ' :: Readonly'; // build toolbar $toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);"; - $toolBar .= PHP_EOL."\t\tJToolBarHelper::title(JText::_('".$viewNameLang_readonly."'), '".$viewName."');"; - $toolBar .= PHP_EOL."\t\tJToolBarHelper::cancel('".$viewName.".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar .= PHP_EOL . "\t\tJToolBarHelper::title(JText::_('" . $viewNameLang_readonly . "'), '" . $viewName . "');"; + $toolBar .= PHP_EOL . "\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; } else { // set lang strings - $viewNameLang_new = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($view['settings']->name_single.' New','U'); - $viewNameLang_edit = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($view['settings']->name_single.' Edit','U'); + $viewNameLang_new = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_single . ' New', 'U'); + $viewNameLang_edit = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($view['settings']->name_single . ' Edit', 'U'); // load to lang - $this->langContent[$this->lang][$viewNameLang_new] = 'A New '.$view['settings']->name_single; - $this->langContent[$this->lang][$viewNameLang_edit] = 'Editing the '.$view['settings']->name_single; + $this->langContent[$this->lang][$viewNameLang_new] = 'A New ' . $view['settings']->name_single; + $this->langContent[$this->lang][$viewNameLang_edit] = 'Editing the ' . $view['settings']->name_single; // build toolbar $toolBar = "JFactory::getApplication()->input->set('hidemainmenu', true);"; - $toolBar .= PHP_EOL."\t\t\$user = JFactory::getUser();"; - $toolBar .= PHP_EOL."\t\t\$userId = \$user->id;"; - $toolBar .= PHP_EOL."\t\t\$isNew = \$this->item->id == 0;"; - $toolBar .= PHP_EOL.PHP_EOL."\t\tJToolbarHelper::title( JText::_(\$isNew ? '".$viewNameLang_new."' : '".$viewNameLang_edit."'), 'pencil-2 article-add');"; - $toolBar .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Built the actions for new and existing records."; - $toolBar .= PHP_EOL."\t\tif (\$this->refid || \$this->ref)"; - $toolBar .= PHP_EOL."\t\t{"; - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName,$this->permissionBuilder['global'][$core['core.create']])) + $toolBar .= PHP_EOL . "\t\t\$user = JFactory::getUser();"; + $toolBar .= PHP_EOL . "\t\t\$userId = \$user->id;"; + $toolBar .= PHP_EOL . "\t\t\$isNew = \$this->item->id == 0;"; + $toolBar .= PHP_EOL . PHP_EOL . "\t\tJToolbarHelper::title( JText::_(\$isNew ? '" . $viewNameLang_new . "' : '" . $viewNameLang_edit . "'), 'pencil-2 article-add');"; + $toolBar .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Built the actions for new and existing records."; + $toolBar .= PHP_EOL . "\t\tif (\$this->refid || \$this->ref)"; + $toolBar .= PHP_EOL . "\t\t{"; + if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) { - $toolBar .= PHP_EOL."\t\t\tif (\$this->canDo->get('".$core['core.create']."') && \$isNew)"; + $toolBar .= PHP_EOL . "\t\t\tif (\$this->canDo->get('" . $core['core.create'] . "') && \$isNew)"; } else { - $toolBar .= PHP_EOL."\t\t\tif (\$this->canDo->get('core.create') && \$isNew)"; + $toolBar .= PHP_EOL . "\t\t\tif (\$this->canDo->get('core.create') && \$isNew)"; } - $toolBar .= PHP_EOL."\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." We can create the record."; - $toolBar .= PHP_EOL."\t\t\t\tJToolBarHelper::save('".$viewName.".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL."\t\t\t}"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName,$this->permissionBuilder['global'][$core['core.edit']])) + $toolBar .= PHP_EOL . "\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " We can create the record."; + $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . "\t\t\t}"; + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) { - $toolBar .= PHP_EOL."\t\t\telseif (\$this->canDo->get('".$core['core.edit']."'))"; + $toolBar .= PHP_EOL . "\t\t\telseif (\$this->canDo->get('" . $core['core.edit'] . "'))"; } else { - $toolBar .= PHP_EOL."\t\t\telseif (\$this->canDo->get('core.edit'))"; + $toolBar .= PHP_EOL . "\t\t\telseif (\$this->canDo->get('core.edit'))"; } - $toolBar .= PHP_EOL."\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." We can save the record."; - $toolBar .= PHP_EOL."\t\t\t\tJToolBarHelper::save('".$viewName.".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL."\t\t\t}"; - $toolBar .= PHP_EOL."\t\t\tif (\$isNew)"; - $toolBar .= PHP_EOL."\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Do not creat but cancel."; - $toolBar .= PHP_EOL."\t\t\t\tJToolBarHelper::cancel('".$viewName.".cancel', 'JTOOLBAR_CANCEL');"; - $toolBar .= PHP_EOL."\t\t\t}"; - $toolBar .= PHP_EOL."\t\t\telse"; - $toolBar .= PHP_EOL."\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." We can close it."; - $toolBar .= PHP_EOL."\t\t\t\tJToolBarHelper::cancel('".$viewName.".cancel', 'JTOOLBAR_CLOSE');"; - $toolBar .= PHP_EOL."\t\t\t}"; - $toolBar .= PHP_EOL."\t\t}"; - $toolBar .= PHP_EOL."\t\telse"; - $toolBar .= PHP_EOL."\t\t{"; - $toolBar .= PHP_EOL."\t\t\tif (\$isNew)"; - $toolBar .= PHP_EOL."\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." For new records, check the create permission."; - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName,$this->permissionBuilder['global'][$core['core.create']])) + $toolBar .= PHP_EOL . "\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " We can save the record."; + $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . "\t\t\t}"; + $toolBar .= PHP_EOL . "\t\t\tif (\$isNew)"; + $toolBar .= PHP_EOL . "\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Do not creat but cancel."; + $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; + $toolBar .= PHP_EOL . "\t\t\t}"; + $toolBar .= PHP_EOL . "\t\t\telse"; + $toolBar .= PHP_EOL . "\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " We can close it."; + $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar .= PHP_EOL . "\t\t\t}"; + $toolBar .= PHP_EOL . "\t\t}"; + $toolBar .= PHP_EOL . "\t\telse"; + $toolBar .= PHP_EOL . "\t\t{"; + $toolBar .= PHP_EOL . "\t\t\tif (\$isNew)"; + $toolBar .= PHP_EOL . "\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " For new records, check the create permission."; + if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) { - $toolBar .= PHP_EOL."\t\t\t\tif (\$this->canDo->get('".$core['core.create']."'))"; + $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('" . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL."\t\t\t\tif (\$this->canDo->get('core.create'))"; + $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('core.create'))"; } - $toolBar .= PHP_EOL."\t\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t\tJToolBarHelper::apply('".$viewName.".apply', 'JTOOLBAR_APPLY');"; - $toolBar .= PHP_EOL."\t\t\t\t\tJToolBarHelper::save('".$viewName.".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL."\t\t\t\t\tJToolBarHelper::custom('".$viewName.".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; - $toolBar .= PHP_EOL."\t\t\t\t};"; - $toolBar .= PHP_EOL."\t\t\t\tJToolBarHelper::cancel('".$viewName.".cancel', 'JTOOLBAR_CANCEL');"; - $toolBar .= PHP_EOL."\t\t\t}"; - $toolBar .= PHP_EOL."\t\t\telse"; - $toolBar .= PHP_EOL."\t\t\t{"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName,$this->permissionBuilder['global'][$core['core.edit']])) + $toolBar .= PHP_EOL . "\t\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::apply('" . $viewName . ".apply', 'JTOOLBAR_APPLY');"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::custom('" . $viewName . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; + $toolBar .= PHP_EOL . "\t\t\t\t};"; + $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CANCEL');"; + $toolBar .= PHP_EOL . "\t\t\t}"; + $toolBar .= PHP_EOL . "\t\t\telse"; + $toolBar .= PHP_EOL . "\t\t\t{"; + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) { - $toolBar .= PHP_EOL."\t\t\t\tif (\$this->canDo->get('".$core['core.edit']."'))"; + $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('" . $core['core.edit'] . "'))"; } else { - $toolBar .= PHP_EOL."\t\t\t\tif (\$this->canDo->get('core.edit'))"; + $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('core.edit'))"; } - $toolBar .= PHP_EOL."\t\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t\t//".$this->setLine(__LINE__)." We can save the new record"; - $toolBar .= PHP_EOL."\t\t\t\t\tJToolBarHelper::apply('".$viewName.".apply', 'JTOOLBAR_APPLY');"; - $toolBar .= PHP_EOL."\t\t\t\t\tJToolBarHelper::save('".$viewName.".save', 'JTOOLBAR_SAVE');"; - $toolBar .= PHP_EOL."\t\t\t\t\t//".$this->setLine(__LINE__)." We can save this record, but check the create permission to see"; - $toolBar .= PHP_EOL."\t\t\t\t\t//".$this->setLine(__LINE__)." if we can return to make a new one."; - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName,$this->permissionBuilder['global'][$core['core.create']])) + $toolBar .= PHP_EOL . "\t\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " We can save the new record"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::apply('" . $viewName . ".apply', 'JTOOLBAR_APPLY');"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::save('" . $viewName . ".save', 'JTOOLBAR_SAVE');"; + $toolBar .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " We can save this record, but check the create permission to see"; + $toolBar .= PHP_EOL . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " if we can return to make a new one."; + if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) { - $toolBar .= PHP_EOL."\t\t\t\t\tif (\$this->canDo->get('".$core['core.create']."'))"; + $toolBar .= PHP_EOL . "\t\t\t\t\tif (\$this->canDo->get('" . $core['core.create'] . "'))"; } else { - $toolBar .= PHP_EOL."\t\t\t\t\tif (\$this->canDo->get('core.create'))"; + $toolBar .= PHP_EOL . "\t\t\t\t\tif (\$this->canDo->get('core.create'))"; } - $toolBar .= PHP_EOL."\t\t\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t\t\tJToolBarHelper::custom('".$viewName.".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; - $toolBar .= PHP_EOL."\t\t\t\t\t}"; - $toolBar .= PHP_EOL."\t\t\t\t}"; - if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName,$this->permissionBuilder['global'][$core['core.edit']])) - { - if ($coreLoad && isset($this->historyBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->historyBuilder[$viewName])) - { - $toolBar .= PHP_EOL."\t\t\t\t\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('".$core['core.version']."'));"; - $toolBar .= PHP_EOL."\t\t\t\tif (\$this->state->params->get('save_history', 1) && \$this->canDo->get('".$core['core.edit']."') && \$canVersion)"; - $toolBar .= PHP_EOL."\t\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t\tJToolbarHelper::versions('com_".$this->fileContentStatic['###component###'].".".$viewName."', \$this->item->id);"; - $toolBar .= PHP_EOL."\t\t\t\t}"; - } - } - else - { - if ($coreLoad && isset($this->historyBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->historyBuilder[$viewName])) - { - $toolBar .= PHP_EOL."\t\t\t\t\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('".$core['core.version']."'));"; - $toolBar .= PHP_EOL."\t\t\t\tif (\$this->state->params->get('save_history', 1) && \$this->canDo->get('core.edit') && \$canVersion)"; - $toolBar .= PHP_EOL."\t\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t\tJToolbarHelper::versions('com_".$this->fileContentStatic['###component###'].".".$viewName."', \$this->item->id);"; - $toolBar .= PHP_EOL."\t\t\t\t}"; - } - } - if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName,$this->permissionBuilder['global'][$core['core.create']])) + $toolBar .= PHP_EOL . "\t\t\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t\t\tJToolBarHelper::custom('" . $viewName . ".save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);"; + $toolBar .= PHP_EOL . "\t\t\t\t\t}"; + $toolBar .= PHP_EOL . "\t\t\t\t}"; + if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder['global'][$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.edit']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.edit']])) { - $toolBar .= PHP_EOL."\t\t\t\tif (\$this->canDo->get('".$core['core.create']."'))"; + if ($coreLoad && isset($this->historyBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->historyBuilder[$viewName])) + { + $toolBar .= PHP_EOL . "\t\t\t\t\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; + $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->state->params->get('save_history', 1) && \$this->canDo->get('" . $core['core.edit'] . "') && \$canVersion)"; + $toolBar .= PHP_EOL . "\t\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolbarHelper::versions('com_" . $this->fileContentStatic['###component###'] . "." . $viewName . "', \$this->item->id);"; + $toolBar .= PHP_EOL . "\t\t\t\t}"; + } } else { - $toolBar .= PHP_EOL."\t\t\t\tif (\$this->canDo->get('core.create'))"; + if ($coreLoad && isset($this->historyBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->historyBuilder[$viewName])) + { + $toolBar .= PHP_EOL . "\t\t\t\t\$canVersion = (\$this->canDo->get('core.version') && \$this->canDo->get('" . $core['core.version'] . "'));"; + $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->state->params->get('save_history', 1) && \$this->canDo->get('core.edit') && \$canVersion)"; + $toolBar .= PHP_EOL . "\t\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolbarHelper::versions('com_" . $this->fileContentStatic['###component###'] . "." . $viewName . "', \$this->item->id);"; + $toolBar .= PHP_EOL . "\t\t\t\t}"; + } } - $toolBar .= PHP_EOL."\t\t\t\t{"; - $toolBar .= PHP_EOL."\t\t\t\t\tJToolBarHelper::custom('".$viewName.".save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);"; - $toolBar .= PHP_EOL."\t\t\t\t}"; - // add custom buttons - $toolBar .= $this->setCustomButtons($view, 2, "\t\t"); - $toolBar .= PHP_EOL."\t\t\t\tJToolBarHelper::cancel('".$viewName.".cancel', 'JTOOLBAR_CLOSE');"; - $toolBar .= PHP_EOL."\t\t\t}"; - $toolBar .= PHP_EOL."\t\t}"; - $toolBar .= PHP_EOL."\t\tJToolbarHelper::divider();"; - $toolBar .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." set help url for this view if found"; - $toolBar .= PHP_EOL."\t\t\$help_url = ".$this->fileContentStatic['###Component###']."Helper::getHelpUrl('".$viewName."');"; - $toolBar .= PHP_EOL."\t\tif (".$this->fileContentStatic['###Component###']."Helper::checkString(\$help_url))"; - $toolBar .= PHP_EOL."\t\t{"; - $toolBar .= PHP_EOL."\t\t\tJToolbarHelper::help('".$this->langPrefix."_HELP_MANAGER', false, \$help_url);"; - $toolBar .= PHP_EOL."\t\t}"; + if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName, $this->permissionBuilder['global'][$core['core.create']])) + { + $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('" . $core['core.create'] . "'))"; + } + else + { + $toolBar .= PHP_EOL . "\t\t\t\tif (\$this->canDo->get('core.create'))"; + } + $toolBar .= PHP_EOL . "\t\t\t\t{"; + $toolBar .= PHP_EOL . "\t\t\t\t\tJToolBarHelper::custom('" . $viewName . ".save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);"; + $toolBar .= PHP_EOL . "\t\t\t\t}"; + // add custom buttons + $toolBar .= $this->setCustomButtons($view, 2, "\t\t"); + $toolBar .= PHP_EOL . "\t\t\t\tJToolBarHelper::cancel('" . $viewName . ".cancel', 'JTOOLBAR_CLOSE');"; + $toolBar .= PHP_EOL . "\t\t\t}"; + $toolBar .= PHP_EOL . "\t\t}"; + $toolBar .= PHP_EOL . "\t\tJToolbarHelper::divider();"; + $toolBar .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " set help url for this view if found"; + $toolBar .= PHP_EOL . "\t\t\$help_url = " . $this->fileContentStatic['###Component###'] . "Helper::getHelpUrl('" . $viewName . "');"; + $toolBar .= PHP_EOL . "\t\tif (" . $this->fileContentStatic['###Component###'] . "Helper::checkString(\$help_url))"; + $toolBar .= PHP_EOL . "\t\t{"; + $toolBar .= PHP_EOL . "\t\t\tJToolbarHelper::help('" . $this->langPrefix . "_HELP_MANAGER', false, \$help_url);"; + $toolBar .= PHP_EOL . "\t\t}"; } return $toolBar; } @@ -11334,7 +11318,7 @@ class Interpretation extends Fields { foreach ($this->sortBuilder[$view] as $filter) { - if (!in_array($filter['code'],$donelist)) + if (!in_array($filter['code'], $donelist)) { if ($filter['type'] === 'category') { @@ -11344,16 +11328,16 @@ class Interpretation extends Fields } else { - $spacer = PHP_EOL.PHP_EOL."\t\t"; + $spacer = PHP_EOL . PHP_EOL . "\t\t"; } - $state .= $spacer."\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.category', \$category);"; - $state .= PHP_EOL.PHP_EOL."\t\t\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.category_id', \$categoryId);"; + $state .= $spacer . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; + $state .= PHP_EOL . "\t\t\$this->setState('filter.category', \$category);"; + $state .= PHP_EOL . PHP_EOL . "\t\t\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; + $state .= PHP_EOL . "\t\t\$this->setState('filter.category_id', \$categoryId);"; if ($filter['code'] != 'category') { - $state .= PHP_EOL.PHP_EOL."\t\t\$".$filter['code']." = \$app->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."', 'filter_".$filter['code']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."', \$".$filter['code'].");"; + $state .= PHP_EOL . PHP_EOL . "\t\t\$" . $filter['code'] . " = \$app->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; + $state .= PHP_EOL . "\t\t\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } } else @@ -11364,17 +11348,17 @@ class Interpretation extends Fields } else { - $spacer = PHP_EOL.PHP_EOL."\t\t"; + $spacer = PHP_EOL . PHP_EOL . "\t\t"; } // check if custom field is set - /*if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $state .= $spacer."\$".$filter['code']."_".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."_".$filter['custom']['text']."', 'filter_".$filter['code']."_".$filter['custom']['text']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; - $spacer = PHP_EOL.PHP_EOL."\t\t"; - }*/ - $state .= $spacer."\$".$filter['code']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."', 'filter_".$filter['code']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."', \$".$filter['code'].");"; + /* if (ComponentbuilderHelper::checkArray($filter['custom'])) + { + $state .= $spacer."\$".$filter['code']."_".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."_".$filter['custom']['text']."', 'filter_".$filter['code']."_".$filter['custom']['text']."');"; + $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; + $spacer = PHP_EOL.PHP_EOL."\t\t"; + } */ + $state .= $spacer . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; + $state .= PHP_EOL . "\t\t\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } $donelist[] = $filter['code']; } @@ -11385,7 +11369,7 @@ class Interpretation extends Fields { foreach ($this->filterBuilder[$view] as $filter) { - if (!in_array($filter['code'],$donelist)) + if (!in_array($filter['code'], $donelist)) { if ($filter['type'] === 'category') { @@ -11395,16 +11379,16 @@ class Interpretation extends Fields } else { - $spacer = PHP_EOL.PHP_EOL."\t\t"; + $spacer = PHP_EOL . PHP_EOL . "\t\t"; } - $state .= $spacer."\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.category', \$category);"; - $state .= PHP_EOL.PHP_EOL."\t\t\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.category_id', \$categoryId);"; + $state .= $spacer . "\$category = \$app->getUserStateFromRequest(\$this->context . '.filter.category', 'filter_category');"; + $state .= PHP_EOL . "\t\t\$this->setState('filter.category', \$category);"; + $state .= PHP_EOL . PHP_EOL . "\t\t\$categoryId = \$this->getUserStateFromRequest(\$this->context . '.filter.category_id', 'filter_category_id');"; + $state .= PHP_EOL . "\t\t\$this->setState('filter.category_id', \$categoryId);"; if ($filter['code'] != 'category') { - $state .= PHP_EOL.PHP_EOL."\t\t\$".$filter['code']." = \$app->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."', 'filter_".$filter['code']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."', \$".$filter['code'].");"; + $state .= PHP_EOL . PHP_EOL . "\t\t\$" . $filter['code'] . " = \$app->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; + $state .= PHP_EOL . "\t\t\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } } else @@ -11415,19 +11399,19 @@ class Interpretation extends Fields } else { - $spacer = PHP_EOL.PHP_EOL."\t\t"; + $spacer = PHP_EOL . PHP_EOL . "\t\t"; } // check if custom field is set - /*if (ComponentbuilderHelper::checkArray($filter['custom'])) - { - $state .= $spacer."\$".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['custom']['text']."', 'filter_".$filter['custom']['text']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['custom']['text']."', \$".$filter['custom']['text'].");"; - $state .= PHP_EOL."\t\t\$".$filter['code']."_".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."_".$filter['custom']['text']."', 'filter_".$filter['code']."_".$filter['custom']['text']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; - $spacer = PHP_EOL.PHP_EOL."\t\t"; - }*/ - $state .= $spacer."\$".$filter['code']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."', 'filter_".$filter['code']."');"; - $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."', \$".$filter['code'].");"; + /* if (ComponentbuilderHelper::checkArray($filter['custom'])) + { + $state .= $spacer."\$".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['custom']['text']."', 'filter_".$filter['custom']['text']."');"; + $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['custom']['text']."', \$".$filter['custom']['text'].");"; + $state .= PHP_EOL."\t\t\$".$filter['code']."_".$filter['custom']['text']." = \$this->getUserStateFromRequest(\$this->context . '.filter.".$filter['code']."_".$filter['custom']['text']."', 'filter_".$filter['code']."_".$filter['custom']['text']."');"; + $state .= PHP_EOL."\t\t\$this->setState('filter.".$filter['code']."_".$filter['custom']['text']."', \$".$filter['code']."_".$filter['custom']['text'].");"; + $spacer = PHP_EOL.PHP_EOL."\t\t"; + } */ + $state .= $spacer . "\$" . $filter['code'] . " = \$this->getUserStateFromRequest(\$this->context . '.filter." . $filter['code'] . "', 'filter_" . $filter['code'] . "');"; + $state .= PHP_EOL . "\t\t\$this->setState('filter." . $filter['code'] . "', \$" . $filter['code'] . ");"; } $donelist[] = $filter['code']; } @@ -11439,11 +11423,11 @@ class Interpretation extends Fields public function setSortFields(&$view) { // keep track of all fields already added - $donelist = array('sorting','published'); + $donelist = array('sorting', 'published'); // set the default first $fields = "return array("; - $fields .= PHP_EOL."\t\t\t'a.sorting' => JText::_('JGRID_HEADING_ORDERING')"; - $fields .= ",".PHP_EOL."\t\t\t'a.published' => JText::_('JSTATUS')"; + $fields .= PHP_EOL . "\t\t\t'a.sorting' => JText::_('JGRID_HEADING_ORDERING')"; + $fields .= "," . PHP_EOL . "\t\t\t'a.published' => JText::_('JSTATUS')"; // add the rest of the set filters if (isset($this->sortBuilder[$view]) && ComponentbuilderHelper::checkArray($this->sortBuilder[$view])) @@ -11454,80 +11438,80 @@ class Interpretation extends Fields { if ($filter['type'] === 'category') { - $fields .= ",".PHP_EOL."\t\t\t'c.category_title' => JText::_('".$filter['lang']."')"; + $fields .= "," . PHP_EOL . "\t\t\t'c.category_title' => JText::_('" . $filter['lang'] . "')"; } elseif (ComponentbuilderHelper::checkArray($filter['custom'])) { - $fields .= ",".PHP_EOL."\t\t\t'".$filter['custom']['db'].".".$filter['custom']['text']."' => JText::_('".$filter['lang']."')"; + $fields .= "," . PHP_EOL . "\t\t\t'" . $filter['custom']['db'] . "." . $filter['custom']['text'] . "' => JText::_('" . $filter['lang'] . "')"; } else { - $fields .= ",".PHP_EOL."\t\t\t'a.".$filter['code']."' => JText::_('".$filter['lang']."')"; + $fields .= "," . PHP_EOL . "\t\t\t'a." . $filter['code'] . "' => JText::_('" . $filter['lang'] . "')"; } } } } - $fields .= ",".PHP_EOL."\t\t\t'a.id' => JText::_('JGRID_HEADING_ID')"; - $fields .= PHP_EOL."\t\t);"; + $fields .= "," . PHP_EOL . "\t\t\t'a.id' => JText::_('JGRID_HEADING_ID')"; + $fields .= PHP_EOL . "\t\t);"; // return fields return $fields; } public function setCheckinCall() { - $call = PHP_EOL."\t\t//".$this->setLine(__LINE__)." check in items"; - $call .= PHP_EOL."\t\t\$this->checkInNow();".PHP_EOL; + $call = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " check in items"; + $call .= PHP_EOL . "\t\t\$this->checkInNow();" . PHP_EOL; return $call; } - public function setAutoCheckin($view,$component) + public function setAutoCheckin($view, $component) { - $checkin = PHP_EOL.PHP_EOL."\t/**"; - $checkin .= PHP_EOL."\t* Build an SQL query to checkin all items left checked out longer then a set time."; - $checkin .= PHP_EOL."\t*"; - $checkin .= PHP_EOL."\t* @return a bool"; - $checkin .= PHP_EOL."\t*"; - $checkin .= PHP_EOL."\t*/"; - $checkin .= PHP_EOL."\tprotected function checkInNow()"; - $checkin .= PHP_EOL."\t{"; - $checkin .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Get set check in time"; - $checkin .= PHP_EOL."\t\t\$time = JComponentHelper::getParams('com_".$component."')->get('check_in');"; - $checkin .= PHP_EOL."\t\t"; - $checkin .= PHP_EOL."\t\tif (\$time)"; - $checkin .= PHP_EOL."\t\t{"; - $checkin .= PHP_EOL.PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Get a db connection."; - $checkin .= PHP_EOL."\t\t\t\$db = JFactory::getDbo();"; - $checkin .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." reset query"; - $checkin .= PHP_EOL."\t\t\t\$query = \$db->getQuery(true);"; - $checkin .= PHP_EOL."\t\t\t\$query->select('*');"; - $checkin .= PHP_EOL."\t\t\t\$query->from(\$db->quoteName('#__".$component."_".$view."'));"; - $checkin .= PHP_EOL."\t\t\t\$db->setQuery(\$query);"; - $checkin .= PHP_EOL."\t\t\t\$db->execute();"; - $checkin .= PHP_EOL."\t\t\tif (\$db->getNumRows())"; - $checkin .= PHP_EOL."\t\t\t{"; - $checkin .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Get Yesterdays date"; - $checkin .= PHP_EOL."\t\t\t\t\$date = JFactory::getDate()->modify(\$time)->toSql();"; - $checkin .= PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." reset query"; - $checkin .= PHP_EOL."\t\t\t\t\$query = \$db->getQuery(true);"; - $checkin .= PHP_EOL.PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Fields to update."; - $checkin .= PHP_EOL."\t\t\t\t\$fields = array("; - $checkin .= PHP_EOL."\t\t\t\t\t\$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',"; - $checkin .= PHP_EOL."\t\t\t\t\t\$db->quoteName('checked_out') . '=0'"; - $checkin .= PHP_EOL."\t\t\t\t);"; - $checkin .= PHP_EOL.PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Conditions for which records should be updated."; - $checkin .= PHP_EOL."\t\t\t\t\$conditions = array("; - $checkin .= PHP_EOL."\t\t\t\t\t\$db->quoteName('checked_out') . '!=0', "; - $checkin .= PHP_EOL."\t\t\t\t\t\$db->quoteName('checked_out_time') . '<\''.\$date.'\''"; - $checkin .= PHP_EOL."\t\t\t\t);"; - $checkin .= PHP_EOL.PHP_EOL."\t\t\t\t//".$this->setLine(__LINE__)." Check table"; - $checkin .= PHP_EOL."\t\t\t\t\$query->update(\$db->quoteName('#__".$component."_".$view."'))->set(\$fields)->where(\$conditions); "; - $checkin .= PHP_EOL.PHP_EOL."\t\t\t\t\$db->setQuery(\$query);"; - $checkin .= PHP_EOL.PHP_EOL."\t\t\t\t\$db->execute();"; - $checkin .= PHP_EOL."\t\t\t}"; - $checkin .= PHP_EOL."\t\t}"; - $checkin .= PHP_EOL.PHP_EOL."\t\treturn false;"; - $checkin .= PHP_EOL."\t}"; + $checkin = PHP_EOL . PHP_EOL . "\t/**"; + $checkin .= PHP_EOL . "\t* Build an SQL query to checkin all items left checked out longer then a set time."; + $checkin .= PHP_EOL . "\t*"; + $checkin .= PHP_EOL . "\t* @return a bool"; + $checkin .= PHP_EOL . "\t*"; + $checkin .= PHP_EOL . "\t*/"; + $checkin .= PHP_EOL . "\tprotected function checkInNow()"; + $checkin .= PHP_EOL . "\t{"; + $checkin .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Get set check in time"; + $checkin .= PHP_EOL . "\t\t\$time = JComponentHelper::getParams('com_" . $component . "')->get('check_in');"; + $checkin .= PHP_EOL . "\t\t"; + $checkin .= PHP_EOL . "\t\tif (\$time)"; + $checkin .= PHP_EOL . "\t\t{"; + $checkin .= PHP_EOL . PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Get a db connection."; + $checkin .= PHP_EOL . "\t\t\t\$db = JFactory::getDbo();"; + $checkin .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " reset query"; + $checkin .= PHP_EOL . "\t\t\t\$query = \$db->getQuery(true);"; + $checkin .= PHP_EOL . "\t\t\t\$query->select('*');"; + $checkin .= PHP_EOL . "\t\t\t\$query->from(\$db->quoteName('#__" . $component . "_" . $view . "'));"; + $checkin .= PHP_EOL . "\t\t\t\$db->setQuery(\$query);"; + $checkin .= PHP_EOL . "\t\t\t\$db->execute();"; + $checkin .= PHP_EOL . "\t\t\tif (\$db->getNumRows())"; + $checkin .= PHP_EOL . "\t\t\t{"; + $checkin .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Get Yesterdays date"; + $checkin .= PHP_EOL . "\t\t\t\t\$date = JFactory::getDate()->modify(\$time)->toSql();"; + $checkin .= PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " reset query"; + $checkin .= PHP_EOL . "\t\t\t\t\$query = \$db->getQuery(true);"; + $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Fields to update."; + $checkin .= PHP_EOL . "\t\t\t\t\$fields = array("; + $checkin .= PHP_EOL . "\t\t\t\t\t\$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',"; + $checkin .= PHP_EOL . "\t\t\t\t\t\$db->quoteName('checked_out') . '=0'"; + $checkin .= PHP_EOL . "\t\t\t\t);"; + $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Conditions for which records should be updated."; + $checkin .= PHP_EOL . "\t\t\t\t\$conditions = array("; + $checkin .= PHP_EOL . "\t\t\t\t\t\$db->quoteName('checked_out') . '!=0', "; + $checkin .= PHP_EOL . "\t\t\t\t\t\$db->quoteName('checked_out_time') . '<\''.\$date.'\''"; + $checkin .= PHP_EOL . "\t\t\t\t);"; + $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Check table"; + $checkin .= PHP_EOL . "\t\t\t\t\$query->update(\$db->quoteName('#__" . $component . "_" . $view . "'))->set(\$fields)->where(\$conditions); "; + $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t\$db->setQuery(\$query);"; + $checkin .= PHP_EOL . PHP_EOL . "\t\t\t\t\$db->execute();"; + $checkin .= PHP_EOL . "\t\t\t}"; + $checkin .= PHP_EOL . "\t\t}"; + $checkin .= PHP_EOL . PHP_EOL . "\t\treturn false;"; + $checkin .= PHP_EOL . "\t}"; return $checkin; } @@ -11548,24 +11532,23 @@ class Interpretation extends Fields } $component = ComponentbuilderHelper::safeString($Component); // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.access']]) && in_array($view,$this->permissionBuilder[$core['core.access']])) + if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder[$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.access']]) && in_array($view, $this->permissionBuilder[$core['core.access']])) { - $fix .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." set values to display correctly."; - $fix .= PHP_EOL."\t".$tab."\tif (".$Component."Helper::checkArray(\$items))"; - $fix .= PHP_EOL."\t".$tab."\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t//".$this->setLine(__LINE__)." get user object."; - $fix .= PHP_EOL."\t".$tab."\t\t\$user = JFactory::getUser();"; - $fix .= PHP_EOL."\t".$tab."\t\tforeach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL."\t".$tab."\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$access = (\$user->authorise('".$core['core.access']."', 'com_".$component.".".$view.".' . (int) \$item->id) && \$user->authorise('".$core['core.access']."', 'com_".$component."'));"; - $fix .= PHP_EOL."\t".$tab."\t\t\tif (!\$access)"; - $fix .= PHP_EOL."\t".$tab."\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\tunset(\$items[\$nr]);"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\tcontinue;"; - $fix .= PHP_EOL."\t".$tab."\t\t\t}".PHP_EOL; - + $fix .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set values to display correctly."; + $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkArray(\$items))"; + $fix .= PHP_EOL . "\t" . $tab . "\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t//" . $this->setLine(__LINE__) . " get user object."; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\$user = JFactory::getUser();"; + $fix .= PHP_EOL . "\t" . $tab . "\t\tforeach (\$items as \$nr => &\$item)"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$access = (\$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "." . $view . ".' . (int) \$item->id) && \$user->authorise('" . $core['core.access'] . "', 'com_" . $component . "'));"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (!\$access)"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tunset(\$items[\$nr]);"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tcontinue;"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}" . PHP_EOL; } - + if (!$export) { $methodName = 'getItemsMethodListStringFixBuilder'; @@ -11574,105 +11557,105 @@ class Interpretation extends Fields { $methodName = 'getItemsMethodEximportStringFixBuilder'; } - + if (isset($this->{$methodName}[$view]) && ComponentbuilderHelper::checkArray($this->{$methodName}[$view])) { if (!ComponentbuilderHelper::checkString($fix)) { - $fix .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." set values to display correctly."; - $fix .= PHP_EOL."\t".$tab."\tif (".$Component."Helper::checkArray(\$items))"; - $fix .= PHP_EOL."\t".$tab."\t{"; - $fix .= PHP_EOL."\t".$tab."\t\tforeach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL."\t".$tab."\t\t{"; + $fix .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set values to display correctly."; + $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkArray(\$items))"; + $fix .= PHP_EOL . "\t" . $tab . "\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\tforeach (\$items as \$nr => &\$item)"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t{"; } - + foreach ($this->{$methodName}[$view] as $item) { switch ($item['method']) { case 1: - // JSON_STRING_ENCODE - $decode = 'json_decode'; - $suffix_decode = ', true'; - break; + // JSON_STRING_ENCODE + $decode = 'json_decode'; + $suffix_decode = ', true'; + break; case 2: - // BASE_SIXTY_FOUR - $decode = 'base64_decode'; - $suffix_decode = ''; - break; + // BASE_SIXTY_FOUR + $decode = 'base64_decode'; + $suffix_decode = ''; + break; case 3: - // BASIC_ENCRYPTION_LOCALKEY - $decode = '$basic->decryptString'; - $basicCrypt = true; - $suffix_decode = ''; - break; + // BASIC_ENCRYPTION_LOCALKEY + $decode = '$basic->decryptString'; + $basicCrypt = true; + $suffix_decode = ''; + break; case 4: - // ADVANCE_ENCRYPTION_VDMKEY - $decode = '$advanced->decryptString'; - $advancedCrypt = true; - $suffix_decode = ''; - break; + // ADVANCE_ENCRYPTION_VDMKEY + $decode = '$advanced->decryptString'; + $advancedCrypt = true; + $suffix_decode = ''; + break; default: - // JSON_ARRAY_ENCODE - $decode = 'json_decode'; - $suffix_decode = ', true'; - break; + // JSON_ARRAY_ENCODE + $decode = 'json_decode'; + $suffix_decode = ', true'; + break; } - + if ($item['type'] === 'usergroup' && !$export) { - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." decode ".$item['name']; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; - $fix .= PHP_EOL."\t".$tab."\t\t\tif (".$Component."Helper::checkArray(\$".$item['name']."Array))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$".$item['name']."Names = '';"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$counter = 0;"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\tforeach (\$".$item['name']."Array as \$".$item['name'].")"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\tif (\$counter == 0)"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t\t\$".$item['name']."Names .= ".$Component."Helper::getGroupName(\$".$item['name'].");"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\telse"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t\t\$".$item['name']."Names .= ', '.".$Component."Helper::getGroupName(\$".$item['name'].");"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t\$counter++;"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$item->".$item['name']." = \$".$item['name']."Names;"; - $fix .= PHP_EOL."\t".$tab."\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " decode " . $item['name']; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$" . $item['name'] . "Names = '';"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$counter = 0;"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tforeach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tif (\$counter == 0)"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= " . $Component . "Helper::getGroupName(\$" . $item['name'] . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\telse"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= ', '." . $Component . "Helper::getGroupName(\$" . $item['name'] . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\$counter++;"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$item->" . $item['name'] . " = \$" . $item['name'] . "Names;"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}"; } - /*elseif ($item['type'] === 'usergroup' && $export) - { - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." decode ".$item['name']; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; - $fix .= PHP_EOL."\t".$tab."\t\t\tif (".$Component."Helper::checkArray(\$".$item['name']."Array))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$item->".$item['name']." = implode('|',\$".$item['name']."Array);"; - $fix .= PHP_EOL."\t".$tab."\t\t\t}"; - }*/ + /* elseif ($item['type'] === 'usergroup' && $export) + { + $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." decode ".$item['name']; + $fix .= PHP_EOL."\t".$tab."\t\t\t\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; + $fix .= PHP_EOL."\t".$tab."\t\t\tif (".$Component."Helper::checkArray(\$".$item['name']."Array))"; + $fix .= PHP_EOL."\t".$tab."\t\t\t{"; + $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$item->".$item['name']." = implode('|',\$".$item['name']."Array);"; + $fix .= PHP_EOL."\t".$tab."\t\t\t}"; + } */ elseif ($item['translation'] && !$export) { - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." convert ".$item['name']; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; - $fix .= PHP_EOL."\t".$tab."\t\t\tif (".$Component."Helper::checkArray(\$".$item['name']."Array))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$".$item['name']."Names = '';"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$counter = 0;"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\tforeach (\$".$item['name']."Array as \$".$item['name'].")"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\tif (\$counter == 0)"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t\t\$".$item['name']."Names .= JText::_(\$this->selectionTranslation(\$".$item['name'].", '".$item['name']."'));"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\telse"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t\t\$".$item['name']."Names .= ', '.JText::_(\$this->selectionTranslation(\$".$item['name'].", '".$item['name']."'));"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t\$counter++;"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$item->".$item['name']." = \$".$item['name']."Names;"; - $fix .= PHP_EOL."\t".$tab."\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " convert " . $item['name']; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$" . $item['name'] . "Names = '';"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$counter = 0;"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tforeach (\$" . $item['name'] . "Array as \$" . $item['name'] . ")"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tif (\$counter == 0)"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= JText::_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\telse"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$" . $item['name'] . "Names .= ', '.JText::_(\$this->selectionTranslation(\$" . $item['name'] . ", '" . $item['name'] . "'));"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\$counter++;"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$item->" . $item['name'] . " = \$" . $item['name'] . "Names;"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}"; } else { @@ -11682,70 +11665,70 @@ class Interpretation extends Fields if ($item['method'] == 3) { $taber = "\t"; - $fix .= PHP_EOL."\t".$tab."\t\t\tif (\$basickey && !is_numeric(\$item->".$item['name'].") && \$item->".$item['name']." === base64_encode(base64_decode(\$item->".$item['name'].", true)))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (\$basickey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; } if ($item['method'] == 4) { $taber = "\t"; - $fix .= PHP_EOL."\t".$tab."\t\t\tif (\$advancedkey && !is_numeric(\$item->".$item['name'].") && \$item->".$item['name']." === base64_encode(base64_decode(\$item->".$item['name'].", true)))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (\$advancedkey && !is_numeric(\$item->" . $item['name'] . ") && \$item->" . $item['name'] . " === base64_encode(base64_decode(\$item->" . $item['name'] . ", true)))"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; } if ($item['method'] == 3 || $item['method'] == 4) { - $fix .= PHP_EOL."\t".$tab."\t\t\t\t//".$this->setLine(__LINE__)." decrypt ".$item['name']; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t//" . $this->setLine(__LINE__) . " decrypt " . $item['name']; } else { - $fix .= PHP_EOL."\t".$tab.$taber."\t\t\t//".$this->setLine(__LINE__)." decode ".$item['name']; + $fix .= PHP_EOL . "\t" . $tab . $taber . "\t\t\t//" . $this->setLine(__LINE__) . " decode " . $item['name']; } - $fix .= PHP_EOL."\t".$tab.$taber."\t\t\t\$item->".$item['name']." = ".$decode."(\$item->".$item['name'].");"; + $fix .= PHP_EOL . "\t" . $tab . $taber . "\t\t\t\$item->" . $item['name'] . " = " . $decode . "(\$item->" . $item['name'] . ");"; if ($item['method'] == 3 || $item['method'] == 4) { - $fix .= PHP_EOL."\t".$tab."\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}"; } } else { if ($export && $item['type'] === 'repeatable') { - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." decode repeatable ".$item['name']; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");"; - $fix .= PHP_EOL."\t".$tab."\t\t\tif (".$Component."Helper::checkArray(\$".$item['name']."Array))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\$bucket".$item['name']." = array();"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\tforeach (\$".$item['name']."Array as \$".$item['name']."FieldName => \$".$item['name'].")"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\tif (".$Component."Helper::checkArray(\$".$item['name']."))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t\t\$bucket".$item['name']."[] = \$".$item['name']."FieldName . '<||VDM||>' . implode('<|VDM|>',\$".$item['name'].");"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t//".$this->setLine(__LINE__)." make sure the bucket has values."; - $fix .= PHP_EOL."\t".$tab."\t\t\t\tif (".$Component."Helper::checkArray(\$bucket".$item['name']."))"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t{"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t//".$this->setLine(__LINE__)." clear the repeatable field."; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\tunset(\$item->".$item['name'].");"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t//".$this->setLine(__LINE__)." set repeatable field for export."; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t\$item->".$item['name']." = implode('<|||VDM|||>',\$bucket".$item['name'].");"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\t//".$this->setLine(__LINE__)." unset the bucket."; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t\tunset(\$bucket".$item['name'].");"; - $fix .= PHP_EOL."\t".$tab."\t\t\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " decode repeatable " . $item['name']; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$" . $item['name'] . "Array = " . $decode . "(\$item->" . $item['name'] . $suffix_decode . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tif (" . $Component . "Helper::checkArray(\$" . $item['name'] . "Array))"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\$bucket" . $item['name'] . " = array();"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tforeach (\$" . $item['name'] . "Array as \$" . $item['name'] . "FieldName => \$" . $item['name'] . ")"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tif (" . $Component . "Helper::checkArray(\$" . $item['name'] . "))"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\t\$bucket" . $item['name'] . "[] = \$" . $item['name'] . "FieldName . '<||VDM||>' . implode('<|VDM|>',\$" . $item['name'] . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t//" . $this->setLine(__LINE__) . " make sure the bucket has values."; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\tif (" . $Component . "Helper::checkArray(\$bucket" . $item['name'] . "))"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " clear the repeatable field."; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tunset(\$item->" . $item['name'] . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " set repeatable field for export."; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t\$item->" . $item['name'] . " = implode('<|||VDM|||>',\$bucket" . $item['name'] . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\t//" . $this->setLine(__LINE__) . " unset the bucket."; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t\tunset(\$bucket" . $item['name'] . ");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t}"; } elseif ($item['method'] == 1 && !$export) { // TODO we check if this works well. - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." convert ".$item['name']; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " convert " . $item['name']; if (isset($item['custom']['table'])) { - $keyTableNAme = str_replace('#__'.$this->fileContentStatic['###component###'] .'_', '', $item['custom']['table']); - $fix .= PHP_EOL."\t".$tab."\t\t\t\$item->".$item['name']." = ".$Component."Helper::jsonToString(\$item->".$item['name'].", ', ', '".$keyTableNAme."');"; + $keyTableNAme = str_replace('#__' . $this->fileContentStatic['###component###'] . '_', '', $item['custom']['table']); + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" . $keyTableNAme . "');"; } else { - $fix .= PHP_EOL."\t".$tab."\t\t\t\$item->".$item['name']." = ".$Component."Helper::jsonToString(\$item->".$item['name'].", ', ', '".$item['name']."');"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ", ', ', '" . $item['name'] . "');"; } } else @@ -11753,8 +11736,8 @@ class Interpretation extends Fields if (!$export) { // For thos we have not cached yet. - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." convert ".$item['name']; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$item->".$item['name']." = ".$Component."Helper::jsonToString(\$item->".$item['name'].");"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " convert " . $item['name']; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$item->" . $item['name'] . " = " . $Component . "Helper::jsonToString(\$item->" . $item['name'] . ");"; } } } @@ -11765,11 +11748,11 @@ class Interpretation extends Fields // close the foreach if needed if (!ComponentbuilderHelper::checkString($fix) && $export) { - $fix .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." set values to display correctly."; - $fix .= PHP_EOL."\t".$tab."\tif (".$Component."Helper::checkArray(\$items))"; - $fix .= PHP_EOL."\t".$tab."\t{"; - $fix .= PHP_EOL."\t".$tab."\t\tforeach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL."\t".$tab."\t\t{"; + $fix .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set values to display correctly."; + $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkArray(\$items))"; + $fix .= PHP_EOL . "\t" . $tab . "\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\tforeach (\$items as \$nr => &\$item)"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t{"; } // close the foreach if needed if (ComponentbuilderHelper::checkString($fix)) @@ -11777,43 +11760,43 @@ class Interpretation extends Fields // remove these values if export if ($export) { - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." unset the values we don't want exported."; - $fix .= PHP_EOL."\t".$tab."\t\t\tunset(\$item->asset_id);"; - $fix .= PHP_EOL."\t".$tab."\t\t\tunset(\$item->checked_out);"; - $fix .= PHP_EOL."\t".$tab."\t\t\tunset(\$item->checked_out_time);"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " unset the values we don't want exported."; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tunset(\$item->asset_id);"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tunset(\$item->checked_out);"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\tunset(\$item->checked_out_time);"; } - $fix .= PHP_EOL."\t".$tab."\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t}"; if ($export) { - $fix .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Add headers to items array."; - $fix .= PHP_EOL."\t".$tab."\t\$headers = \$this->getExImPortHeaders();"; - $fix .= PHP_EOL."\t".$tab."\tif (".$Component."Helper::checkObject(\$headers))"; - $fix .= PHP_EOL."\t".$tab."\t{"; - $fix .= PHP_EOL."\t".$tab."\t\tarray_unshift(\$items,\$headers);"; - $fix .= PHP_EOL."\t".$tab."\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Add headers to items array."; + $fix .= PHP_EOL . "\t" . $tab . "\t\$headers = \$this->getExImPortHeaders();"; + $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkObject(\$headers))"; + $fix .= PHP_EOL . "\t" . $tab . "\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\tarray_unshift(\$items,\$headers);"; + $fix .= PHP_EOL . "\t" . $tab . "\t}"; } } // add custom php to getitems method - $fix .= $this->getCustomScriptBuilder('php_getitems', $view, PHP_EOL.PHP_EOL.$tab); + $fix .= $this->getCustomScriptBuilder('php_getitems', $view, PHP_EOL . PHP_EOL . $tab); if ($basicCrypt) { - $script = PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get the basic encryption key."; - $script .= PHP_EOL."\t".$tab."\t\$basickey = ".$Component."Helper::getCryptKey('basic');"; - $script .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t".$tab."\t\$basic = new FOFEncryptAes(\$basickey, 128);"; + $script = PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the basic encryption key."; + $script .= PHP_EOL . "\t" . $tab . "\t\$basickey = " . $Component . "Helper::getCryptKey('basic');"; + $script .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t" . $tab . "\t\$basic = new FOFEncryptAes(\$basickey, 128);"; // add the encryption script $fix = $script . $fix; } if ($advancedCrypt) { - $script = PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get the advanced encryption key."; - $script .= PHP_EOL."\t".$tab."\t\$advancedkey = ".$Component."Helper::getCryptKey('advanced');"; - $script .= PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." Get the encryption object."; - $script .= PHP_EOL."\t".$tab."\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; + $script = PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the advanced encryption key."; + $script .= PHP_EOL . "\t" . $tab . "\t\$advancedkey = " . $Component . "Helper::getCryptKey('advanced');"; + $script .= PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " Get the encryption object."; + $script .= PHP_EOL . "\t" . $tab . "\t\$advanced = new FOFEncryptAes(\$advancedkey, 256);"; // add the encryption script $fix = $script . $fix; } @@ -11821,56 +11804,56 @@ class Interpretation extends Fields return $fix; } - public function setSelectionTranslationFix($views,$Component,$tab = '') + public function setSelectionTranslationFix($views, $Component, $tab = '') { // add the fix if this view has the need for it $fix = ''; if (isset($this->selectionTranslationFixBuilder[$views]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$views])) { - $fix .= PHP_EOL.PHP_EOL."\t".$tab."\t//".$this->setLine(__LINE__)." set selection value to a translatable value"; - $fix .= PHP_EOL."\t".$tab."\tif (".$Component."Helper::checkArray(\$items))"; - $fix .= PHP_EOL."\t".$tab."\t{"; - $fix .= PHP_EOL."\t".$tab."\t\tforeach (\$items as \$nr => &\$item)"; - $fix .= PHP_EOL."\t".$tab."\t\t{"; + $fix .= PHP_EOL . PHP_EOL . "\t" . $tab . "\t//" . $this->setLine(__LINE__) . " set selection value to a translatable value"; + $fix .= PHP_EOL . "\t" . $tab . "\tif (" . $Component . "Helper::checkArray(\$items))"; + $fix .= PHP_EOL . "\t" . $tab . "\t{"; + $fix .= PHP_EOL . "\t" . $tab . "\t\tforeach (\$items as \$nr => &\$item)"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t{"; foreach ($this->selectionTranslationFixBuilder[$views] as $name => $values) { - $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." convert ".$name; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$item->".$name." = \$this->selectionTranslation(\$item->".$name.", '".$name."');"; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t//" . $this->setLine(__LINE__) . " convert " . $name; + $fix .= PHP_EOL . "\t" . $tab . "\t\t\t\$item->" . $name . " = \$this->selectionTranslation(\$item->" . $name . ", '" . $name . "');"; } - $fix .= PHP_EOL."\t".$tab."\t\t}"; - $fix .= PHP_EOL."\t".$tab."\t}".PHP_EOL; + $fix .= PHP_EOL . "\t" . $tab . "\t\t}"; + $fix .= PHP_EOL . "\t" . $tab . "\t}" . PHP_EOL; } return $fix; } - public function setSelectionTranslationFixFunc($views,$Component) + public function setSelectionTranslationFixFunc($views, $Component) { // add the fix if this view has the need for it $fix = ''; - if (isset( $this->selectionTranslationFixBuilder[$views]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$views])) + if (isset($this->selectionTranslationFixBuilder[$views]) && ComponentbuilderHelper::checkArray($this->selectionTranslationFixBuilder[$views])) { - $fix .= PHP_EOL.PHP_EOL."\t/**"; - $fix .= PHP_EOL."\t* Method to convert selection values to translatable string."; - $fix .= PHP_EOL."\t*"; - $fix .= PHP_EOL."\t* @return translatable string"; - $fix .= PHP_EOL."\t*/"; - $fix .= PHP_EOL."\tpublic function selectionTranslation(\$value,\$name)"; - $fix .= PHP_EOL."\t{"; + $fix .= PHP_EOL . PHP_EOL . "\t/**"; + $fix .= PHP_EOL . "\t* Method to convert selection values to translatable string."; + $fix .= PHP_EOL . "\t*"; + $fix .= PHP_EOL . "\t* @return translatable string"; + $fix .= PHP_EOL . "\t*/"; + $fix .= PHP_EOL . "\tpublic function selectionTranslation(\$value,\$name)"; + $fix .= PHP_EOL . "\t{"; foreach ($this->selectionTranslationFixBuilder[$views] as $name => $values) { if (ComponentbuilderHelper::checkArray($values)) { - $fix .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Array of ".$name." language strings"; - $fix .= PHP_EOL."\t\tif (\$name === '".$name."')"; - $fix .= PHP_EOL."\t\t{"; - $fix .= PHP_EOL."\t\t\t\$".$name."Array = array("; + $fix .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Array of " . $name . " language strings"; + $fix .= PHP_EOL . "\t\tif (\$name === '" . $name . "')"; + $fix .= PHP_EOL . "\t\t{"; + $fix .= PHP_EOL . "\t\t\t\$" . $name . "Array = array("; $counter = 0; foreach ($values as $value => $translang) { // only add quotes to strings if (ComponentbuilderHelper::checkString($value)) { - $key = "'".$value."'"; + $key = "'" . $value . "'"; } else { @@ -11882,25 +11865,25 @@ class Interpretation extends Fields } if ($counter == 0) { - $fix .= PHP_EOL."\t\t\t\t".$key." => '".$translang."'"; + $fix .= PHP_EOL . "\t\t\t\t" . $key . " => '" . $translang . "'"; } else { - $fix .= ",".PHP_EOL."\t\t\t\t".$key." => '".$translang."'"; + $fix .= "," . PHP_EOL . "\t\t\t\t" . $key . " => '" . $translang . "'"; } $counter++; } - $fix .= PHP_EOL."\t\t\t);"; - $fix .= PHP_EOL."\t\t\t//".$this->setLine(__LINE__)." Now check if value is found in this array"; - $fix .= PHP_EOL."\t\t\tif (isset(\$".$name."Array[\$value]) && ".$Component."Helper::checkString(\$".$name."Array[\$value]))"; - $fix .= PHP_EOL."\t\t\t{"; - $fix .= PHP_EOL."\t\t\t\treturn \$".$name."Array[\$value];"; - $fix .= PHP_EOL."\t\t\t}"; - $fix .= PHP_EOL."\t\t}"; + $fix .= PHP_EOL . "\t\t\t);"; + $fix .= PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Now check if value is found in this array"; + $fix .= PHP_EOL . "\t\t\tif (isset(\$" . $name . "Array[\$value]) && " . $Component . "Helper::checkString(\$" . $name . "Array[\$value]))"; + $fix .= PHP_EOL . "\t\t\t{"; + $fix .= PHP_EOL . "\t\t\t\treturn \$" . $name . "Array[\$value];"; + $fix .= PHP_EOL . "\t\t\t}"; + $fix .= PHP_EOL . "\t\t}"; } } - $fix .= PHP_EOL."\t\treturn \$value;"; - $fix .= PHP_EOL."\t}"; + $fix .= PHP_EOL . "\t\treturn \$value;"; + $fix .= PHP_EOL . "\t}"; } return $fix; } @@ -11909,16 +11892,15 @@ class Interpretation extends Fields { if (strlen($viewName) > 0) { - $router = PHP_EOL."\t\tcase '".$viewName."':"; - $router .= PHP_EOL."\t\t\t\$id = explode(':', \$segments[$count-1]);"; - $router .= PHP_EOL."\t\t\t\$vars['id'] = (int) \$id[0];"; - $router .= PHP_EOL."\t\t\t\$vars['view'] = '".$viewName."';"; - $router .= PHP_EOL."\t\tbreak;"; + $router = PHP_EOL . "\t\tcase '" . $viewName . "':"; + $router .= PHP_EOL . "\t\t\t\$id = explode(':', \$segments[$count-1]);"; + $router .= PHP_EOL . "\t\t\t\$vars['id'] = (int) \$id[0];"; + $router .= PHP_EOL . "\t\t\t\$vars['view'] = '" . $viewName . "';"; + $router .= PHP_EOL . "\t\tbreak;"; return $router; } return ''; - } public function setComponentImageType($path) @@ -11926,9 +11908,9 @@ class Interpretation extends Fields $type = ComponentbuilderHelper::imageInfo($path); if ($type) { - $imagePath = $this->componentPath.'/admin/assets/images'; + $imagePath = $this->componentPath . '/admin/assets/images'; // move the image to its place - JFile::copy(JPATH_SITE.'/'.$path, $imagePath.'/vdm-component.'.$type,'',true); + JFile::copy(JPATH_SITE . '/' . $path, $imagePath . '/vdm-component.' . $type, '', true); // now set the type to global for re-use $this->componentImageType = $type; // return image type @@ -11943,12 +11925,11 @@ class Interpretation extends Fields if (isset($this->permissionDashboard) && ComponentbuilderHelper::checkArray($this->permissionDashboard)) { $this->permissionDashboard = array_unique($this->permissionDashboard); - return PHP_EOL."\t\t//".$this->setLine(__LINE__)." view access array".PHP_EOL."\t\t\$viewAccess = array(".PHP_EOL."\t\t\t".implode(",".PHP_EOL."\t\t\t",$this->permissionDashboard).");"; + return PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " view access array" . PHP_EOL . "\t\t\$viewAccess = array(" . PHP_EOL . "\t\t\t" . implode("," . PHP_EOL . "\t\t\t", $this->permissionDashboard) . ");"; } return ''; - } - + public function setDashboardIcons() { if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) @@ -11961,15 +11942,15 @@ class Interpretation extends Fields $name_single = ComponentbuilderHelper::safeString($view['settings']->name_single); $name_list = ComponentbuilderHelper::safeString($view['settings']->name_list); - $icons .= $this->addCustomDashboardIcons($view,$counter); + $icons .= $this->addCustomDashboardIcons($view, $counter); if (isset($view['dashboard_add']) && $view['dashboard_add'] == 1) { $type = ComponentbuilderHelper::imageInfo($view['settings']->icon_add); if ($type) { - $type = $type."."; + $type = $type . "."; // icon builder loader - $this->iconBuilder[$type.$name_single.".add"] = $view['settings']->icon_add; + $this->iconBuilder[$type . $name_single . ".add"] = $view['settings']->icon_add; } else { @@ -11977,15 +11958,15 @@ class Interpretation extends Fields } if ($counter == 0) { - $icons .= "'".$type.$name_single.".add'"; + $icons .= "'" . $type . $name_single . ".add'"; } else { - $icons .= ", '".$type.$name_single.".add'"; + $icons .= ", '" . $type . $name_single . ".add'"; } // build lang - $langName = 'Add '.ComponentbuilderHelper::safeString($view['settings']->name_single, 'W').'

'; - $langKey = $this->langPrefix.'_DASHBOARD_'.ComponentbuilderHelper::safeString($view['settings']->name_single,'U').'_ADD'; + $langName = 'Add ' . ComponentbuilderHelper::safeString($view['settings']->name_single, 'W') . '

'; + $langKey = $this->langPrefix . '_DASHBOARD_' . ComponentbuilderHelper::safeString($view['settings']->name_single, 'U') . '_ADD'; // add to lang $this->langContent[$this->lang][$langKey] = $langName; $counter++; @@ -11995,9 +11976,9 @@ class Interpretation extends Fields $type = ComponentbuilderHelper::imageInfo($view['settings']->icon); if ($type) { - $type = $type."."; + $type = $type . "."; // icon builder loader - $this->iconBuilder[$type.$name_list] = $view['settings']->icon; + $this->iconBuilder[$type . $name_list] = $view['settings']->icon; } else { @@ -12005,15 +11986,15 @@ class Interpretation extends Fields } if ($counter == 0) { - $icons .= "'".$type.$name_list."'"; + $icons .= "'" . $type . $name_list . "'"; } else { - $icons .= ", '".$type.$name_list."'"; + $icons .= ", '" . $type . $name_list . "'"; } // build lang - $langName = ComponentbuilderHelper::safeString($view['settings']->name_list, 'W').'

'; - $langKey = $this->langPrefix.'_DASHBOARD_'.ComponentbuilderHelper::safeString($view['settings']->name_list,'U'); + $langName = ComponentbuilderHelper::safeString($view['settings']->name_list, 'W') . '

'; + $langKey = $this->langPrefix . '_DASHBOARD_' . ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); // add to lang $this->langContent[$this->lang][$langKey] = $langName; $counter++; @@ -12034,20 +12015,20 @@ class Interpretation extends Fields { $otherViews = $name_list; // build lang - $langName = 'Category  For
'.ComponentbuilderHelper::safeString($otherViews, 'W'); + $langName = 'Category  For
' . ComponentbuilderHelper::safeString($otherViews, 'W'); } - if(!in_array($otherViews,$catArray)) + if (!in_array($otherViews, $catArray)) { // add to lang - $langKey = $this->langPrefix.'_DASHBOARD_'.ComponentbuilderHelper::safeString($otherViews,'U').'_'.ComponentbuilderHelper::safeString($catCode,'U'); + $langKey = $this->langPrefix . '_DASHBOARD_' . ComponentbuilderHelper::safeString($otherViews, 'U') . '_' . ComponentbuilderHelper::safeString($catCode, 'U'); $this->langContent[$this->lang][$langKey] = $langName; // get image type $type = ComponentbuilderHelper::imageInfo($view['settings']->icon_category); if ($type) { - $type = $type."."; + $type = $type . "."; // icon builder loader - $this->iconBuilder[$type.$otherViews.".".$catCode] = $view['settings']->icon_category; + $this->iconBuilder[$type . $otherViews . "." . $catCode] = $view['settings']->icon_category; } else { @@ -12055,11 +12036,11 @@ class Interpretation extends Fields } if ($counter == 0) { - $icons .= "'".$type.$otherViews.".".$catCode."'"; + $icons .= "'" . $type . $otherViews . "." . $catCode . "'"; } else { - $icons .= ", '".$type.$otherViews.".".$catCode."'"; + $icons .= ", '" . $type . $otherViews . "." . $catCode . "'"; } $counter++; // make sure we add a category only once @@ -12077,7 +12058,7 @@ class Interpretation extends Fields } if (isset($this->iconBuilder) && ComponentbuilderHelper::checkArray($this->iconBuilder)) { - $imagePath = $this->componentPath.'/admin/assets/images/icons'; + $imagePath = $this->componentPath . '/admin/assets/images/icons'; foreach ($this->iconBuilder as $icon => $path) { $array_buket = explode('.', $icon); @@ -12093,34 +12074,34 @@ class Interpretation extends Fields // set the new image name if ($action) { - $imageName = $name.'_'.$action.'.'.$type; + $imageName = $name . '_' . $action . '.' . $type; } else { - $imageName = $name.'.'.$type; + $imageName = $name . '.' . $type; } // move the image to its place - JFile::copy(JPATH_SITE.'/'.$path, $imagePath.'/'.$imageName,'',true); + JFile::copy(JPATH_SITE . '/' . $path, $imagePath . '/' . $imageName, '', true); } } return $icons; } return false; } - + public function setDashboardModelMethods() { if ($this->componentData->add_php_dashboard_methods) { // get all the mothods that should load date to the view - $this->DashboardGetCustomData = ComponentbuilderHelper::getAllBetween($this->componentData->php_dashboard_methods,'public function get','()'); + $this->DashboardGetCustomData = ComponentbuilderHelper::getAllBetween($this->componentData->php_dashboard_methods, 'public function get', '()'); // return the methods - return PHP_EOL.PHP_EOL.$this->setPlaceholders($this->componentData->php_dashboard_methods, $this->placeholders); + return PHP_EOL . PHP_EOL . $this->setPlaceholders($this->componentData->php_dashboard_methods, $this->placeholders); } return ''; } - + public function setDashboardGetCustomData() { if (ComponentbuilderHelper::checkArray($this->DashboardGetCustomData)) @@ -12128,18 +12109,18 @@ class Interpretation extends Fields // gets array reset $gets = array(); // set dashboard gets - foreach($this->DashboardGetCustomData as $get) + foreach ($this->DashboardGetCustomData as $get) { $string = ComponentbuilderHelper::safeString($get); $tabs = (\strlen($string) < 8) ? "\t\t\t" : (\strlen($string) < 16) ? "\t\t" : (\strlen($string) < 24) ? "\t" : ' '; - $gets[] = "\$this->".$string.$tabs."= \$this->get('".$get."');"; + $gets[] = "\$this->" . $string . $tabs . "= \$this->get('" . $get . "');"; } // return the gets - return PHP_EOL."\t\t".implode(PHP_EOL."\t\t",$gets); + return PHP_EOL . "\t\t" . implode(PHP_EOL . "\t\t", $gets); } return ''; } - + public function setDashboardDisplayData() { // display array reset @@ -12158,10 +12139,10 @@ class Interpretation extends Fields } // since we have custom tabs we must load the tab structure around the cpanel $display[] = '
'; - $display[] = "\t".'
'; + $display[] = "\t" . '
'; $display[] = "\t 'cpanel')); ?>"; - $display[] = PHP_EOL."\t\t"; - $display[] = "\t\t".'
'; + $display[] = PHP_EOL . "\t\t"; + $display[] = "\t\t" . '
'; // set the tab to insure correct spacing $tab = "\t\t\t"; // change the name of the main tab @@ -12173,68 +12154,68 @@ class Interpretation extends Fields $display[] = '
'; } // set dashboard display - $display[] = $tab.'
'; - $display[] = $tab."\t 'main')); ?>"; - $display[] = $tab."\t\t"; - $display[] = $tab."\t\t\tloadTemplate('main');?>"; - $display[] = $tab."\t\t"; - $display[] = $tab."\t"; - $display[] = $tab."
"; - $display[] = $tab.'
'; - $display[] = $tab."\t 'vdm')); ?>"; - $display[] = $tab."\t\tfileContentStatic['###COMPANYNAME###']."', 'vdm'); ?>"; - $display[] = $tab."\t\t\tloadTemplate('vdm');?>"; - $display[] = $tab."\t\t"; - $display[] = $tab."\t"; - $display[] = $tab."
"; - + $display[] = $tab . '
'; + $display[] = $tab . "\t 'main')); ?>"; + $display[] = $tab . "\t\t"; + $display[] = $tab . "\t\t\tloadTemplate('main');?>"; + $display[] = $tab . "\t\t"; + $display[] = $tab . "\t"; + $display[] = $tab . "
"; + $display[] = $tab . '
'; + $display[] = $tab . "\t 'vdm')); ?>"; + $display[] = $tab . "\t\tfileContentStatic['###COMPANYNAME###'] . "', 'vdm'); ?>"; + $display[] = $tab . "\t\t\tloadTemplate('vdm');?>"; + $display[] = $tab . "\t\t"; + $display[] = $tab . "\t"; + $display[] = $tab . "
"; + if ($loadTabs) { $display[] = "\t\t
"; - $display[] = "\t\t"; + $display[] = "\t\t"; // load the new tabs - foreach($builder as $tabname => $accordians) + foreach ($builder as $tabname => $accordians) { $alias = ComponentbuilderHelper::safeString($tabname); - $display[] = PHP_EOL."\t\t"; - $display[] = "\t\t".'
'; - $display[] = $tab.'
'; - $display[] = $tab."\t '".$alias."_one')); ?>"; + $display[] = PHP_EOL . "\t\t"; + $display[] = "\t\t" . '
'; + $display[] = $tab . '
'; + $display[] = $tab . "\t '" . $alias . "_one')); ?>"; $slidecounter = 1; - foreach($accordians as $accordianname => $html) + foreach ($accordians as $accordianname => $html) { $ac_alias = ComponentbuilderHelper::safeString($accordianname); $counterName = ComponentbuilderHelper::safeString($slidecounter); - $tempName = $alias.'_'.$ac_alias; - $display[] = $tab."\t\t"; - $display[] = $tab."\t\t\tloadTemplate('".$tempName."');?>"; - $display[] = $tab."\t\t"; + $tempName = $alias . '_' . $ac_alias; + $display[] = $tab . "\t\t"; + $display[] = $tab . "\t\t\tloadTemplate('" . $tempName . "');?>"; + $display[] = $tab . "\t\t"; $slidecounter++; // build the template file $target = array('custom_admin' => $this->fileContentStatic['###component###']); - $this->buildDynamique($target,'template',$tempName); + $this->buildDynamique($target, 'template', $tempName); // set the file data - $TARGET = ComponentbuilderHelper::safeString($this->target,'U'); + $TARGET = ComponentbuilderHelper::safeString($this->target, 'U'); // ###SITE_TEMPLATE_BODY### <<>> - $this->fileContentDynamic[$this->fileContentStatic['###component###'].'_'.$tempName]['###CUSTOM_ADMIN_TEMPLATE_BODY###'] = PHP_EOL.$html; + $this->fileContentDynamic[$this->fileContentStatic['###component###'] . '_' . $tempName]['###CUSTOM_ADMIN_TEMPLATE_BODY###'] = PHP_EOL . $html; // ###SITE_TEMPLATE_CODE_BODY### <<>> - $this->fileContentDynamic[$this->fileContentStatic['###component###'].'_'.$tempName]['###CUSTOM_ADMIN_TEMPLATE_CODE_BODY###'] = ''; + $this->fileContentDynamic[$this->fileContentStatic['###component###'] . '_' . $tempName]['###CUSTOM_ADMIN_TEMPLATE_CODE_BODY###'] = ''; } - $display[] = $tab."\t"; - $display[] = $tab."
"; + $display[] = $tab . "\t"; + $display[] = $tab . "
"; $display[] = "\t\t
"; - $display[] = "\t\t"; + $display[] = "\t\t"; } - - $display[] = PHP_EOL."\t"; + + $display[] = PHP_EOL . "\t"; $display[] = "\t
"; } $display[] = "
"; // return the display - return PHP_EOL.implode(PHP_EOL,$display); + return PHP_EOL . implode(PHP_EOL, $display); } - public function addCustomDashboardIcons(&$view,&$counter) + public function addCustomDashboardIcons(&$view, &$counter) { $icon = ''; if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) @@ -12246,51 +12227,51 @@ class Interpretation extends Fields $type = ComponentbuilderHelper::imageInfo($menu['settings']->icon); if ($type) { - $type = $type."."; + $type = $type . "."; // icon builder loader - $this->iconBuilder[$type.$menu['settings']->code] = $menu['settings']->icon; + $this->iconBuilder[$type . $menu['settings']->code] = $menu['settings']->icon; } else { $type = 'png.'; } // build lang - $langName = $menu['settings']->name.'

'; - $langKey = $this->langPrefix.'_DASHBOARD_'.$menu['settings']->CODE; + $langName = $menu['settings']->name . '

'; + $langKey = $this->langPrefix . '_DASHBOARD_' . $menu['settings']->CODE; // add to lang $this->langContent[$this->lang][$langKey] = $langName; // set icon if ($counter == 0) { $counter++; - $icon .= "'".$type.$menu['settings']->code."'"; + $icon .= "'" . $type . $menu['settings']->code . "'"; } else { $counter++; - $icon .= ", '".$type.$menu['settings']->code."'"; + $icon .= ", '" . $type . $menu['settings']->code . "'"; } } - elseif(!isset($this->customAdminAdded[$menu['settings']->code]) && $menu['dashboard_list'] == 1 && empty($menu['before'])) + elseif (!isset($this->customAdminAdded[$menu['settings']->code]) && $menu['dashboard_list'] == 1 && empty($menu['before'])) { $type = ComponentbuilderHelper::imageInfo($menu['settings']->icon); if ($type) { - $type = $type."."; + $type = $type . "."; // icon builder loader - $this->iconBuilder[$type.$menu['settings']->code] = $menu['settings']->icon; + $this->iconBuilder[$type . $menu['settings']->code] = $menu['settings']->icon; } else { $type = 'png.'; } // build lang - $langName = $menu['settings']->name.'

'; - $langKey = $this->langPrefix.'_DASHBOARD_'.$menu['settings']->CODE; + $langName = $menu['settings']->name . '

'; + $langKey = $this->langPrefix . '_DASHBOARD_' . $menu['settings']->CODE; // add to lang $this->langContent[$this->lang][$langKey] = $langName; // set icon - $this->lastCustomDashboardIcon[$nr] = ", '".$type.$menu['settings']->code."'"; + $this->lastCustomDashboardIcon[$nr] = ", '" . $type . $menu['settings']->code . "'"; } } } @@ -12299,9 +12280,9 @@ class Interpretation extends Fields { foreach ($this->componentData->custommenus as $nr => $menu) { - $nr = $nr + 100; - $nameList = ComponentbuilderHelper::safeString($menu['name_code']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); + $nr = $nr + 100; + $nameList = ComponentbuilderHelper::safeString($menu['name_code']); + $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); if ($menu['dashboard_list'] == 1 && $view['adminview'] == $menu['before']) { if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) @@ -12311,36 +12292,36 @@ class Interpretation extends Fields } else { - $type = ComponentbuilderHelper::imageInfo('images/'.$menu['icon']); + $type = ComponentbuilderHelper::imageInfo('images/' . $menu['icon']); if ($type) { - $type = $type."."; + $type = $type . "."; // icon builder loader - $this->iconBuilder[$type.$nameList] = 'images/'.$menu['icon']; + $this->iconBuilder[$type . $nameList] = 'images/' . $menu['icon']; } else { $type = 'png.'; } // build lang - $langName = $menu['name'].'

'; - $langKey = $this->langPrefix.'_DASHBOARD_'.$nameUpper; + $langName = $menu['name'] . '

'; + $langKey = $this->langPrefix . '_DASHBOARD_' . $nameUpper; // add to lang $this->langContent[$this->lang][$langKey] = $langName; // set icon if ($counter == 0) { $counter++; - $icon .= "'".$type.$nameList."'"; + $icon .= "'" . $type . $nameList . "'"; } else { $counter++; - $icon .= ", '".$type.$nameList."'"; + $icon .= ", '" . $type . $nameList . "'"; } } } - elseif($menu['dashboard_list'] == 1 && empty($menu['before'])) + elseif ($menu['dashboard_list'] == 1 && empty($menu['before'])) { if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) { @@ -12349,24 +12330,24 @@ class Interpretation extends Fields } else { - $type = ComponentbuilderHelper::imageInfo('images/'.$menu['icon']); + $type = ComponentbuilderHelper::imageInfo('images/' . $menu['icon']); if ($type) { - $type = $type."."; + $type = $type . "."; // icon builder loader - $this->iconBuilder[$type.$nameList] = 'images/'.$menu['icon']; + $this->iconBuilder[$type . $nameList] = 'images/' . $menu['icon']; } else { $type = 'png.'; } // build lang - $langName = $menu['name'].'

'; - $langKey = $this->langPrefix.'_DASHBOARD_'.$nameUpper; + $langName = $menu['name'] . '

'; + $langKey = $this->langPrefix . '_DASHBOARD_' . $nameUpper; // add to lang $this->langContent[$this->lang][$langKey] = $langName; // set icon - $this->lastCustomDashboardIcon[$nr] = ", '".$type.$nameList."'"; + $this->lastCustomDashboardIcon[$nr] = ", '" . $type . $nameList . "'"; } } } @@ -12380,17 +12361,17 @@ class Interpretation extends Fields { $menus = ''; // main lang prefix - $lang = $this->langPrefix.'_SUBMENU'; + $lang = $this->langPrefix . '_SUBMENU'; // set the code name $codeName = ComponentbuilderHelper::safeString($this->componentData->name_code); // set dashboard - $menus .= "JHtmlSidebar::addEntry(JText::_('".$lang."_DASHBOARD'), 'index.php?option=com_".$codeName."&view=".$codeName."', \$submenu === '".$codeName."');"; - $this->langContent[$this->lang][$lang.'_DASHBOARD'] = 'Dashboard'; + $menus .= "JHtmlSidebar::addEntry(JText::_('" . $lang . "_DASHBOARD'), 'index.php?option=com_" . $codeName . "&view=" . $codeName . "', \$submenu === '" . $codeName . "');"; + $this->langContent[$this->lang][$lang . '_DASHBOARD'] = 'Dashboard'; $catArray = array(); foreach ($this->componentData->admin_views as $view) { // set custom menu - $menus .= $this->addCustomSubMenu($view,$codeName,$lang); + $menus .= $this->addCustomSubMenu($view, $codeName, $lang); if (isset($view['submenu']) && $view['submenu'] == 1) { // setup access defaults @@ -12403,17 +12384,17 @@ class Interpretation extends Fields $coreLoad = true; } // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle,$this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) { - $menus .= PHP_EOL."\t\tif (\$user->authorise('".$core['core.access']."', 'com_".$codeName."') && \$user->authorise('".$nameSingle.".submenu', 'com_".$codeName."'))"; - $menus .= PHP_EOL."\t\t{"; + $menus .= PHP_EOL . "\t\tif (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $menus .= PHP_EOL . "\t\t{"; // add tab to lines to follow $tab = "\t"; } - $nameList = ComponentbuilderHelper::safeString($view['settings']->name_list); - $nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); - $menus .= PHP_EOL."\t\t".$tab."JHtmlSidebar::addEntry(JText::_('".$lang."_".$nameUpper."'), 'index.php?option=com_".$codeName."&view=".$nameList."', \$submenu === '".$nameList."');"; - $this->langContent[$this->lang][$lang."_".$nameUpper] = $view['settings']->name_list; + $nameList = ComponentbuilderHelper::safeString($view['settings']->name_list); + $nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); + $menus .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; + $this->langContent[$this->lang][$lang . "_" . $nameUpper] = $view['settings']->name_list; // check if category has another name if (isset($this->catOtherName[$nameList]) && ComponentbuilderHelper::checkArray($this->catOtherName[$nameList])) { @@ -12423,16 +12404,16 @@ class Interpretation extends Fields { $otherViews = $nameList; } - if (isset($this->categoryBuilder[$nameList]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameList]) && !in_array($otherViews,$catArray)) + if (isset($this->categoryBuilder[$nameList]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameList]) && !in_array($otherViews, $catArray)) { - $menus .= PHP_EOL."\t\t".$tab."JHtmlSidebar::addEntry(JText::_('".$this->categoryBuilder[$nameList]['name']."'), 'index.php?option=com_categories&view=categories&extension=com_".$codeName.".".$otherViews."', \$submenu === 'categories.".$otherViews."');"; + $menus .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $this->categoryBuilder[$nameList]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=com_" . $codeName . "." . $otherViews . "', \$submenu === 'categories." . $otherViews . "');"; // make sure we add a category only once $catArray[] = $otherViews; } // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle,$this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) { - $menus .= PHP_EOL."\t\t}"; + $menus .= PHP_EOL . "\t\t}"; } } } @@ -12449,7 +12430,7 @@ class Interpretation extends Fields return false; } - public function addCustomSubMenu(&$view,&$codeName,&$lang) + public function addCustomSubMenu(&$view, &$codeName, &$lang) { // see if we should have custom menus $custom = ''; @@ -12459,7 +12440,7 @@ class Interpretation extends Fields { if (!isset($this->customAdminAdded[$menu['settings']->code])) { - if ($custom = $this->setCustomAdminSubMenu($view,$codeName,$lang,$nr,$menu,'customView')) + if ($custom = $this->setCustomAdminSubMenu($view, $codeName, $lang, $nr, $menu, 'customView')) { break; } @@ -12470,39 +12451,38 @@ class Interpretation extends Fields { foreach ($this->componentData->custommenus as $nr => $menu) { - if ($custom2 = $this->setCustomAdminSubMenu($view,$codeName,$lang,$nr,$menu,'customMenu')) + if ($custom2 = $this->setCustomAdminSubMenu($view, $codeName, $lang, $nr, $menu, 'customMenu')) { - $custom = $custom.$custom2; + $custom = $custom . $custom2; break; } } } return $custom; - } - - public function setCustomAdminSubMenu(&$view,&$codeName,&$lang,&$nr,&$menu,$type) + + public function setCustomAdminSubMenu(&$view, &$codeName, &$lang, &$nr, &$menu, $type) { if ($type === 'customMenu') { - $name = $menu['name']; - $nameSingle = ComponentbuilderHelper::safeString($menu['name']); - $nameList = ComponentbuilderHelper::safeString($menu['name']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); + $name = $menu['name']; + $nameSingle = ComponentbuilderHelper::safeString($menu['name']); + $nameList = ComponentbuilderHelper::safeString($menu['name']); + $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); } elseif ($type === 'customView') { - $name = $menu['settings']->name; - $nameSingle = $menu['settings']->code; - $nameList = $menu['settings']->code; - $nameUpper = $menu['settings']->CODE; + $name = $menu['settings']->name; + $nameSingle = $menu['settings']->code; + $nameList = $menu['settings']->code; + $nameUpper = $menu['settings']->CODE; } - + if ($menu['submenu'] == 1 && $view['adminview'] == $menu['before']) { // setup access defaults $tab = ""; - + $coreLoad = false; if (isset($this->permissionCore[$nameSingle])) { @@ -12511,45 +12491,45 @@ class Interpretation extends Fields } $custom = ''; // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle,$this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) { - $custom .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Access control (".$core['core.access']." && ".$nameSingle.".submenu)."; - $custom .= PHP_EOL."\t\tif (\$user->authorise('".$core['core.access']."', 'com_".$codeName."') && \$user->authorise('".$nameSingle.".submenu', 'com_".$codeName."'))"; - $custom .= PHP_EOL."\t\t{"; + $custom .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access control (" . $core['core.access'] . " && " . $nameSingle . ".submenu)."; + $custom .= PHP_EOL . "\t\tif (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $custom .= PHP_EOL . "\t\t{"; // add tab to lines to follow $tab = "\t"; } else { - $custom .= PHP_EOL."\t\t//".$this->setLine(__LINE__)." Access control (".$nameSingle.".submenu)."; - $custom .= PHP_EOL."\t\tif (\$user->authorise('".$nameSingle.".submenu', 'com_".$codeName."'))"; - $custom .= PHP_EOL."\t\t{"; + $custom .= PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Access control (" . $nameSingle . ".submenu)."; + $custom .= PHP_EOL . "\t\tif (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $custom .= PHP_EOL . "\t\t{"; // add tab to lines to follow $tab = "\t"; } if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) { - - $this->langContent[$this->lang][$lang.'_'.$nameUpper] = $name; + + $this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name; // add custom menu - $custom .= PHP_EOL."\t\t".$tab."JHtmlSidebar::addEntry(JText::_('".$lang."_".$nameUpper."'), '".$menu['link']."', \$submenu === '".$nameList."');"; + $custom .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; } else { - $this->langContent[$this->lang][$lang.'_'.$nameUpper] = $name; + $this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name; // add custom menu - $custom .= PHP_EOL."\t\t".$tab."JHtmlSidebar::addEntry(JText::_('".$lang."_".$nameUpper."'), 'index.php?option=com_".$codeName."&view=".$nameList."', \$submenu === '".$nameList."');"; + $custom .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; } // check if the item has permissions. - $custom .= PHP_EOL."\t\t}"; + $custom .= PHP_EOL . "\t\t}"; return $custom; } - elseif($menu['submenu'] == 1 && empty($menu['before'])) + elseif ($menu['submenu'] == 1 && empty($menu['before'])) { // setup access defaults $tab = ""; - $nameSingle = ComponentbuilderHelper::safeString($name); + $nameSingle = ComponentbuilderHelper::safeString($name); $coreLoad = false; if (isset($this->permissionCore[$nameSingle])) { @@ -12558,34 +12538,34 @@ class Interpretation extends Fields } $this->lastCustomSubMenu[$nr] = ''; // check if the item has permissions. - if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle,$this->permissionBuilder['global'][$core['core.access']])) + if ($coreLoad && isset($core['core.access']) && isset($this->permissionBuilder['global'][$core['core.access']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.access']]) && in_array($nameSingle, $this->permissionBuilder['global'][$core['core.access']])) { - $this->lastCustomSubMenu[$nr] .= PHP_EOL."\t\tif (\$user->authorise('".$core['core.access']."', 'com_".$codeName."') && \$user->authorise('".$nameSingle.".submenu', 'com_".$codeName."'))"; - $this->lastCustomSubMenu[$nr] .= PHP_EOL."\t\t{"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\tif (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName . "') && \$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t{"; // add tab to lines to follow $tab = "\t"; } else { - $this->lastCustomSubMenu[$nr] .= PHP_EOL."\t\tif (\$user->authorise('".$nameSingle.".submenu', 'com_".$codeName."'))"; - $this->lastCustomSubMenu[$nr] .= PHP_EOL."\t\t{"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\tif (\$user->authorise('" . $nameSingle . ".submenu', 'com_" . $codeName . "'))"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t{"; // add tab to lines to follow $tab = "\t"; } if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) { - $this->langContent[$this->lang][$lang.'_'.$nameUpper] = $name; + $this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name; // add custom menu - $this->lastCustomSubMenu[$nr] .= PHP_EOL."\t\t".$tab."JHtmlSidebar::addEntry(JText::_('".$lang."_".$nameUpper."'), '".$menu['link']."', \$submenu === '".$nameList."');"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), '" . $menu['link'] . "', \$submenu === '" . $nameList . "');"; } else { - $this->langContent[$this->lang][$lang.'_'.$nameUpper] = $name; + $this->langContent[$this->lang][$lang . '_' . $nameUpper] = $name; // add custom menu - $this->lastCustomSubMenu[$nr] .= PHP_EOL."\t\t".$tab."JHtmlSidebar::addEntry(JText::_('".$lang."_".$nameUpper."'), 'index.php?option=com_".$codeName."&view=".$nameList."', \$submenu === '".$nameList."');"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t" . $tab . "JHtmlSidebar::addEntry(JText::_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName . "&view=" . $nameList . "', \$submenu === '" . $nameList . "');"; } // check if the item has permissions. - $this->lastCustomSubMenu[$nr] .= PHP_EOL."\t\t}"; + $this->lastCustomSubMenu[$nr] .= PHP_EOL . "\t\t}"; } return false; } @@ -12596,21 +12576,21 @@ class Interpretation extends Fields { $menus = ''; // main lang prefix - $lang = $this->langPrefix.'_MENU'; + $lang = $this->langPrefix . '_MENU'; // set the code name $codeName = ComponentbuilderHelper::safeString($this->componentData->name_code); // set main menu name to lang - $this->langContent['adminsys'][$lang] = '» '.$this->componentData->name; + $this->langContent['adminsys'][$lang] = '» ' . $this->componentData->name; foreach ($this->componentData->admin_views as $view) { // set custom menu - $menus .= $this->addCustomMainMenu($view,$codeName,$lang); + $menus .= $this->addCustomMainMenu($view, $codeName, $lang); if (isset($view['mainmenu']) && $view['mainmenu'] == 1) { - $nameList = ComponentbuilderHelper::safeString($view['settings']->name_list); - $nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); - $menus .= PHP_EOL."\t\t\t".''.$lang.'_'.$nameUpper.''; - $this->langContent['adminsys'][$lang.'_'.$nameUpper] = $view['settings']->name_list; + $nameList = ComponentbuilderHelper::safeString($view['settings']->name_list); + $nameUpper = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); + $menus .= PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; + $this->langContent['adminsys'][$lang . '_' . $nameUpper] = $view['settings']->name_list; } } if (isset($this->lastCustomMainMenu) && ComponentbuilderHelper::checkArray($this->lastCustomMainMenu)) @@ -12626,7 +12606,7 @@ class Interpretation extends Fields return false; } - public function addCustomMainMenu(&$view,&$codeName,&$lang) + public function addCustomMainMenu(&$view, &$codeName, &$lang) { $customMenu = ''; // see if we should have custom admin views @@ -12638,15 +12618,15 @@ class Interpretation extends Fields { if ($menu['mainmenu'] == 1 && $view['adminview'] == $menu['before']) { - $this->langContent['adminsys'][$lang.'_'.$menu['settings']->CODE] = $menu['settings']->name; + $this->langContent['adminsys'][$lang . '_' . $menu['settings']->CODE] = $menu['settings']->name; // add custom menu - $customMenu .= PHP_EOL."\t\t\t".''.$lang.'_'.$menu['settings']->CODE.''; + $customMenu .= PHP_EOL . "\t\t\t" . '' . $lang . '_' . $menu['settings']->CODE . ''; } - elseif($menu['mainmenu'] == 1 && empty($menu['before'])) + elseif ($menu['mainmenu'] == 1 && empty($menu['before'])) { - $this->langContent['adminsys'][$lang.'_'.$menu['settings']->CODE] = $menu['settings']->name; + $this->langContent['adminsys'][$lang . '_' . $menu['settings']->CODE] = $menu['settings']->name; // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL."\t\t\t".''.$lang.'_'.$menu['settings']->CODE.''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . "\t\t\t" . '' . $lang . '_' . $menu['settings']->CODE . ''; } } } @@ -12661,60 +12641,59 @@ class Interpretation extends Fields { if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) { - $nameList = ComponentbuilderHelper::safeString($menu['name']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); - $this->langContent['adminsys'][$lang.'_'.$nameUpper] = $menu['name']; + $nameList = ComponentbuilderHelper::safeString($menu['name']); + $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); + $this->langContent['adminsys'][$lang . '_' . $nameUpper] = $menu['name']; // urlencode - $menu['link'] = htmlspecialchars($menu['link'], ENT_XML1, 'UTF-8'); + $menu['link'] = htmlspecialchars($menu['link'], ENT_XML1, 'UTF-8'); // add custom menu - $customMenu .= PHP_EOL."\t\t\t".''.$lang.'_'.$nameUpper.''; + $customMenu .= PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; } else { - $nameList = ComponentbuilderHelper::safeString($menu['name_code']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); - $this->langContent['adminsys'][$lang.'_'.$nameUpper] = $menu['name']; + $nameList = ComponentbuilderHelper::safeString($menu['name_code']); + $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); + $this->langContent['adminsys'][$lang . '_' . $nameUpper] = $menu['name']; // add custom menu - $customMenu .= PHP_EOL."\t\t\t".''.$lang.'_'.$nameUpper.''; + $customMenu .= PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; } } - elseif($menu['mainmenu'] == 1 && empty($menu['before'])) + elseif ($menu['mainmenu'] == 1 && empty($menu['before'])) { if (isset($menu['link']) && ComponentbuilderHelper::checkString($menu['link'])) { - $nameList = ComponentbuilderHelper::safeString($menu['name']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); - $this->langContent['adminsys'][$lang.'_'.$nameUpper] = $menu['name']; + $nameList = ComponentbuilderHelper::safeString($menu['name']); + $nameUpper = ComponentbuilderHelper::safeString($menu['name'], 'U'); + $this->langContent['adminsys'][$lang . '_' . $nameUpper] = $menu['name']; // urlencode - $menu['link'] = htmlspecialchars($menu['link'], ENT_XML1, 'UTF-8'); + $menu['link'] = htmlspecialchars($menu['link'], ENT_XML1, 'UTF-8'); // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL."\t\t\t".''.$lang.'_'.$nameUpper.''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; } else { - $nameList = ComponentbuilderHelper::safeString($menu['name_code']); - $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); - $this->langContent['adminsys'][$lang.'_'.$nameUpper] = $menu['name']; + $nameList = ComponentbuilderHelper::safeString($menu['name_code']); + $nameUpper = ComponentbuilderHelper::safeString($menu['name_code'], 'U'); + $this->langContent['adminsys'][$lang . '_' . $nameUpper] = $menu['name']; // add custom menu - $this->lastCustomMainMenu[$nr] = PHP_EOL."\t\t\t".''.$lang.'_'.$nameUpper.''; + $this->lastCustomMainMenu[$nr] = PHP_EOL . "\t\t\t" . '' . $lang . '_' . $nameUpper . ''; } } } } return $customMenu; - } public function setConfigFieldsets($timer = 0) { // main lang prefix - $lang = $this->langPrefix.'_CONFIG'; + $lang = $this->langPrefix . '_CONFIG'; if (1 == $timer) // this is before the admin views are build { // start loading Global params $autorName = ComponentbuilderHelper::htmlEscape($this->componentData->author); $autorEmail = ComponentbuilderHelper::htmlEscape($this->componentData->email); - $this->extensionsParams[] = '"autorName":"'.$autorName.'","autorEmail":"'.$autorEmail.'"'; + $this->extensionsParams[] = '"autorName":"' . $autorName . '","autorEmail":"' . $autorEmail . '"'; // set the custom fields if (isset($this->componentData->config) && ComponentbuilderHelper::checkArray($this->componentData->config)) { @@ -12722,9 +12701,9 @@ class Interpretation extends Fields $viewName = 'config'; $listViewName = 'configs'; $placeholders = array( - '###component###' => $component, - '###view###' => $viewName, - '###views###' => $listViewName); + '###component###' => $component, + '###view###' => $viewName, + '###views###' => $listViewName); $spacerCounter = 'a'; $view = ''; $viewType = 0; @@ -12737,40 +12716,39 @@ class Interpretation extends Fields if (isset($newxmlField->fieldXML)) { $xmlField = dom_import_simplexml($newxmlField->fieldXML); - $xmlField = PHP_EOL."\t'.PHP_EOL."\t".$this->xmlPrettyPrint($xmlField, 'field'); + $xmlField = PHP_EOL . "\t' . PHP_EOL . "\t" . $this->xmlPrettyPrint($xmlField, 'field'); } if (isset($xmlField) && ComponentbuilderHelper::checkString($xmlField)) { $this->configFieldSetsCustomField[$field['tabname']][] = $xmlField; // set global params to db on install - $fieldName = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xmlField,'name="','"')); - $fieldDefault = ComponentbuilderHelper::getBetween($xmlField,'default="','"'); + $fieldName = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xmlField, 'name="', '"')); + $fieldDefault = ComponentbuilderHelper::getBetween($xmlField, 'default="', '"'); if (isset($field['custom_value']) && ComponentbuilderHelper::checkString($field['custom_value'])) { // add array if found if ((strpos($field['custom_value'], '["') !== false) && (strpos($field['custom_value'], '"]') !== false)) { // load the Global checkin defautls - $this->extensionsParams[] = '"'.$fieldName.'":'.$field['custom_value']; + $this->extensionsParams[] = '"' . $fieldName . '":' . $field['custom_value']; } else { // load the Global checkin defautls - $this->extensionsParams[] = '"'.$fieldName.'":"'.$field['custom_value'].'"'; + $this->extensionsParams[] = '"' . $fieldName . '":"' . $field['custom_value'] . '"'; } } elseif (ComponentbuilderHelper::checkString($fieldDefault)) { // load the Global checkin defautls - $this->extensionsParams[] = '"'.$fieldName.'":"'.$fieldDefault.'"'; + $this->extensionsParams[] = '"' . $fieldName . '":"' . $fieldDefault . '"'; } } } } // first run we must set the globals - $this->setGlobalConfigFieldsets($lang,$autorName,$autorEmail); + $this->setGlobalConfigFieldsets($lang, $autorName, $autorEmail); $this->setSiteControlConfigFieldsets($lang); - } elseif (2 == $timer) // this is after the admin views are build { @@ -12786,7 +12764,7 @@ class Interpretation extends Fields } // we cad add more event (timers as we need) } - + public function setSiteControlConfigFieldsets($lang) { $front_end = array(); @@ -12806,62 +12784,62 @@ class Interpretation extends Fields { foreach ($this->configFieldSetsCustomField as $tab => &$tabFields) { - $tabCode = ComponentbuilderHelper::safeString($tab).'_custom_config'; - $tabUpper = ComponentbuilderHelper::safeString($tab,'U'); + $tabCode = ComponentbuilderHelper::safeString($tab) . '_custom_config'; + $tabUpper = ComponentbuilderHelper::safeString($tab, 'U'); $tabLower = ComponentbuilderHelper::safeString($tab); // load the request id setters for menu views - $viewRequest = 'name="'.$tabLower.'_request_id'; - foreach($tabFields as $et => $id_field) + $viewRequest = 'name="' . $tabLower . '_request_id'; + foreach ($tabFields as $et => $id_field) { - if(strpos($id_field,$viewRequest) !== false) + if (strpos($id_field, $viewRequest) !== false) { $this->setRequestValues($tabLower, $id_field, $viewRequest, 'id', 'hasIdRequest'); unset($tabFields[$et]); } - elseif (strpos($id_field,'_request_id') !== false) + elseif (strpos($id_field, '_request_id') !== false) { // not loaded to a tab "view" name - $_viewRequest = ComponentbuilderHelper::getBetween($id_field,'name="','_request_id'); - $searchIdKe = 'name="'.$_viewRequest.'_request_id'; + $_viewRequest = ComponentbuilderHelper::getBetween($id_field, 'name="', '_request_id'); + $searchIdKe = 'name="' . $_viewRequest . '_request_id'; $this->setRequestValues($_viewRequest, $id_field, $searchIdKe, 'id', 'hasIdRequest'); unset($tabFields[$et]); } } // load the request catid setters for menu views - $viewRequestC = 'name="'.$tabLower.'_request_catid'; - foreach($tabFields as $ci => $catid_field) + $viewRequestC = 'name="' . $tabLower . '_request_catid'; + foreach ($tabFields as $ci => $catid_field) { - if(strpos($catid_field,$viewRequestC) !== false) + if (strpos($catid_field, $viewRequestC) !== false) { - + $this->setRequestValues($tabLower, $catid_field, $viewRequestC, 'catid', 'hasCatIdRequest'); unset($tabFields[$ci]); } - elseif (strpos($catid_field,'_request_catid') !== false) + elseif (strpos($catid_field, '_request_catid') !== false) { // not loaded to a tab "view" name - $_viewRequestC = ComponentbuilderHelper::getBetween($catid_field,'name="','_request_catid'); - $searchCatidKe = 'name="'.$_viewRequestC.'_request_catid'; + $_viewRequestC = ComponentbuilderHelper::getBetween($catid_field, 'name="', '_request_catid'); + $searchCatidKe = 'name="' . $_viewRequestC . '_request_catid'; $this->setRequestValues($_viewRequestC, $catid_field, $searchCatidKe, 'catid', 'hasCatIdRequest'); unset($tabFields[$ci]); } } // load the global menu setters for single fields - $menuSetter = $tabLower.'_menu'; + $menuSetter = $tabLower . '_menu'; $pageSettings = array(); - foreach($tabFields as $ct => $field) + foreach ($tabFields as $ct => $field) { - if(strpos($field,$menuSetter) !== false) + if (strpos($field, $menuSetter) !== false) { // set the values needed to insure route is done correclty $this->hasMenuGlobal[$tabLower] = $menuSetter; } - elseif (strpos($field,'_menu"') !== false) + elseif (strpos($field, '_menu"') !== false) { // not loaded to a tab "view" name - $_tabLower = ComponentbuilderHelper::getBetween($field,'name="','_menu"'); + $_tabLower = ComponentbuilderHelper::getBetween($field, 'name="', '_menu"'); // set the values needed to insure route is done correclty - $this->hasMenuGlobal[$_tabLower] = $_tabLower.'_menu'; + $this->hasMenuGlobal[$_tabLower] = $_tabLower . '_menu'; } else { @@ -12869,14 +12847,14 @@ class Interpretation extends Fields } } // insure we load the needed params - if (in_array($tab,$front_end)) + if (in_array($tab, $front_end)) { $this->frontEndParams[$tab] = $pageSettings; } } } } - + protected function setRequestValues($view, $field, $search, $target, $store) { $key = ComponentbuilderHelper::getBetween($field, $search, '"'); @@ -12885,12 +12863,12 @@ class Interpretation extends Fields // is not having special var $key = $target; // update field - $field = str_replace($search . '"', 'name="'. $key . '"', $field); + $field = str_replace($search . '"', 'name="' . $key . '"', $field); } else { // update field - $field = str_replace($search . $key . '"', 'name="'. $key . '"', $field); + $field = str_replace($search . $key . '"', 'name="' . $key . '"', $field); } if (!isset($this->{$store}[$view])) { @@ -12907,15 +12885,15 @@ class Interpretation extends Fields { foreach ($this->configFieldSetsCustomField as $tab => $tabFields) { - $tabCode = ComponentbuilderHelper::safeString($tab).'_custom_config'; - $tabUpper = ComponentbuilderHelper::safeString($tab,'U'); + $tabCode = ComponentbuilderHelper::safeString($tab) . '_custom_config'; + $tabUpper = ComponentbuilderHelper::safeString($tab, 'U'); $tabLower = ComponentbuilderHelper::safeString($tab); // setup lang - $this->langContent[$this->lang][$lang.'_'.$tabUpper] = $tab; + $this->langContent[$this->lang][$lang . '_' . $tabUpper] = $tab; // start field set $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\t".'name="'.$tabCode.'"'; - $this->configFieldSets[] = "\t\t".'label="'.$lang.'_'.$tabUpper.'">'; + $this->configFieldSets[] = "\t\t" . 'name="' . $tabCode . '"'; + $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_' . $tabUpper . '">'; // remove display targeted fields $bucket = array(); foreach ($tabFields as $tabField) @@ -12928,7 +12906,7 @@ class Interpretation extends Fields } } // set the fields - $this->configFieldSets[] = implode("\t\t",$bucket); + $this->configFieldSets[] = implode("\t\t", $bucket); // close field set $this->configFieldSets[] = "\t"; // remove after loading @@ -12936,7 +12914,7 @@ class Interpretation extends Fields } } } - + public function setGroupControlConfigFieldsets($lang) { // start loading Group control params if needed @@ -12944,29 +12922,29 @@ class Interpretation extends Fields { // start building field set for config $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\t".'name="group_config"'; - $this->configFieldSets[] = "\t\t".'label="'.$lang.'_GROUPS_LABEL"'; - $this->configFieldSets[] = "\t\t".'description="'.$lang.'_GROUPS_DESC">'; + $this->configFieldSets[] = "\t\t" . 'name="group_config"'; + $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_GROUPS_LABEL"'; + $this->configFieldSets[] = "\t\t" . 'description="' . $lang . '_GROUPS_DESC">'; // setup lang - $this->langContent[$this->lang][$lang.'_GROUPS_LABEL'] = "Target Groups"; - $this->langContent[$this->lang][$lang.'_GROUPS_DESC'] = "The Parameters for the targeted groups are set here."; - $this->langContent[$this->lang][$lang.'_TARGET_GROUP_DESC'] = "Set the group/s being targeted by this user type."; + $this->langContent[$this->lang][$lang . '_GROUPS_LABEL'] = "Target Groups"; + $this->langContent[$this->lang][$lang . '_GROUPS_DESC'] = "The Parameters for the targeted groups are set here."; + $this->langContent[$this->lang][$lang . '_TARGET_GROUP_DESC'] = "Set the group/s being targeted by this user type."; foreach ($this->setGroupControl as $selector => $label) { - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="usergroup"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$label.'"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_TARGET_GROUP_DESC"'; - $this->configFieldSets[] = "\t\t\t".'multiple="true"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="usergroup"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $label . '"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_TARGET_GROUP_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'multiple="true"'; $this->configFieldSets[] = "\t\t/>"; // set params defaults - $this->extensionsParams[] = '"'.$selector.'":["2"]'; + $this->extensionsParams[] = '"' . $selector . '":["2"]'; } // add custom Target Groups fields if (isset($this->configFieldSetsCustomField['Target Groups']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Target Groups'])) { - $this->configFieldSets[] = implode("\t\t",$this->configFieldSetsCustomField['Target Groups']); + $this->configFieldSets[] = implode("\t\t", $this->configFieldSetsCustomField['Target Groups']); unset($this->configFieldSetsCustomField['Target Groups']); } // close that fieldse @@ -12983,14 +12961,14 @@ class Interpretation extends Fields { // set component name $component = ComponentbuilderHelper::safeString($this->componentData->name_code); - + // start building field set for config $this->configFieldSets[] = 'configFieldSets[] = "\t\t".'addrulepath="/administrator/components/com_'.$component.'/models/rules"'; - $this->configFieldSets[] = "\t\t".'addfieldpath="/administrator/components/com_'.$component.'/models/fields"'; - $this->configFieldSets[] = "\t\t".'name="global_config"'; - $this->configFieldSets[] = "\t\t".'label="'.$lang.'_GLOBAL_LABEL"'; - $this->configFieldSets[] = "\t\t".'description="'.$lang.'_GLOBAL_DESC">'; + $this->configFieldSets[] = "\t\t" . 'addrulepath="/administrator/components/com_' . $component . '/models/rules"'; + $this->configFieldSets[] = "\t\t" . 'addfieldpath="/administrator/components/com_' . $component . '/models/fields"'; + $this->configFieldSets[] = "\t\t" . 'name="global_config"'; + $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_GLOBAL_LABEL"'; + $this->configFieldSets[] = "\t\t" . 'description="' . $lang . '_GLOBAL_DESC">'; // set application update License Key if ($this->componentData->add_license && 1 != $this->componentData->license_type) { @@ -12999,67 +12977,67 @@ class Interpretation extends Fields { case 2: // for updates - $this->langContent[$this->lang][$lang.'_LICENSE_KEY_NOTE_LABEL']= "Your License Key"; - $this->langContent[$this->lang][$lang.'_LICENSE_KEY_NOTE_DESC'] = "To get updates you must add the license key here that you recieved from ".$this->componentData->companyname; + $this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_LABEL'] = "Your License Key"; + $this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_DESC'] = "To get updates you must add the license key here that you recieved from " . $this->componentData->companyname; // set the field - $this->configFieldSets[] = "\t\t".''; + $this->configFieldSets[] = "\t\t" . ''; break; case 3: // with vdm to lock down ownership - $this->langContent[$this->lang][$lang.'_LICENSE_KEY_NOTE_LABEL']= "Your License Key"; - $this->langContent[$this->lang][$lang.'_LICENSE_KEY_NOTE_DESC'] = "To use this component you must add the license key here that you recieved from ".$this->componentData->companyname; + $this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_LABEL'] = "Your License Key"; + $this->langContent[$this->lang][$lang . '_LICENSE_KEY_NOTE_DESC'] = "To use this component you must add the license key here that you recieved from " . $this->componentData->companyname; // set the field - $this->configFieldSets[] = "\t\t".''; + $this->configFieldSets[] = "\t\t" . ''; break; } // setup lang - $this->langContent[$this->lang][$lang.'_LICENSE_KEY_LABEL'] = "License Key"; - $this->langContent[$this->lang][$lang.'_LICENSE_KEY_DESC'] = "Add your license key here."; + $this->langContent[$this->lang][$lang . '_LICENSE_KEY_LABEL'] = "License Key"; + $this->langContent[$this->lang][$lang . '_LICENSE_KEY_DESC'] = "Add your license key here."; // add the field - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_LICENSE_KEY_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_LICENSE_KEY_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default=""'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_LICENSE_KEY_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_LICENSE_KEY_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default=""'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".''; + $this->configFieldSets[] = "\t\t" . ''; } // setup lang - $this->langContent[$this->lang][$lang.'_GLOBAL_LABEL'] = "Global"; - $this->langContent[$this->lang][$lang.'_GLOBAL_DESC'] = "The Global Parameters"; + $this->langContent[$this->lang][$lang . '_GLOBAL_LABEL'] = "Global"; + $this->langContent[$this->lang][$lang . '_GLOBAL_DESC'] = "The Global Parameters"; // add auto checin if required if ($this->addCheckin) { $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\t".'name="check_in"'; - $this->configFieldSets[] = "\t\t\t".'type="list"'; - $this->configFieldSets[] = "\t\t\t".'default="0"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_CHECK_TIMER_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_CHECK_TIMER_DESC">'; - $this->configFieldSets[] = "\t\t\t".'configFieldSets[] = "\t\t\t\t".'value="-5 hours">'.$lang.'_CHECK_TIMER_OPTION_ONE'; - $this->configFieldSets[] = "\t\t\t".'configFieldSets[] = "\t\t\t\t".'value="-12 hours">'.$lang.'_CHECK_TIMER_OPTION_TWO'; - $this->configFieldSets[] = "\t\t\t".'configFieldSets[] = "\t\t\t\t".'value="-1 day">'.$lang.'_CHECK_TIMER_OPTION_THREE'; - $this->configFieldSets[] = "\t\t\t".'configFieldSets[] = "\t\t\t\t".'value="-2 day">'.$lang.'_CHECK_TIMER_OPTION_FOUR'; - $this->configFieldSets[] = "\t\t\t".'configFieldSets[] = "\t\t\t\t".'value="-1 week">'.$lang.'_CHECK_TIMER_OPTION_FIVE'; - $this->configFieldSets[] = "\t\t\t".'configFieldSets[] = "\t\t\t\t".'value="0">'.$lang.'_CHECK_TIMER_OPTION_SIX'; + $this->configFieldSets[] = "\t\t\t" . 'name="check_in"'; + $this->configFieldSets[] = "\t\t\t" . 'type="list"'; + $this->configFieldSets[] = "\t\t\t" . 'default="0"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_CHECK_TIMER_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_CHECK_TIMER_DESC">'; + $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-5 hours">' . $lang . '_CHECK_TIMER_OPTION_ONE'; + $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-12 hours">' . $lang . '_CHECK_TIMER_OPTION_TWO'; + $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-1 day">' . $lang . '_CHECK_TIMER_OPTION_THREE'; + $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-2 day">' . $lang . '_CHECK_TIMER_OPTION_FOUR'; + $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="-1 week">' . $lang . '_CHECK_TIMER_OPTION_FIVE'; + $this->configFieldSets[] = "\t\t\t" . 'configFieldSets[] = "\t\t\t\t" . 'value="0">' . $lang . '_CHECK_TIMER_OPTION_SIX'; $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t".''; + $this->configFieldSets[] = "\t\t" . ''; // setup lang - $this->langContent[$this->lang][$lang.'_CHECK_TIMER_LABEL'] = "Check in timer"; - $this->langContent[$this->lang][$lang.'_CHECK_TIMER_DESC'] = "Set the intervals for the auto checkin fuction of tables that checks out the items to an user."; - $this->langContent[$this->lang][$lang.'_CHECK_TIMER_OPTION_ONE'] = "Every five hours"; - $this->langContent[$this->lang][$lang.'_CHECK_TIMER_OPTION_TWO'] = "Every twelve hours"; - $this->langContent[$this->lang][$lang.'_CHECK_TIMER_OPTION_THREE'] = "Once a day"; - $this->langContent[$this->lang][$lang.'_CHECK_TIMER_OPTION_FOUR'] = "Every second day"; - $this->langContent[$this->lang][$lang.'_CHECK_TIMER_OPTION_FIVE'] = "Once a week"; - $this->langContent[$this->lang][$lang.'_CHECK_TIMER_OPTION_SIX'] = "Never"; + $this->langContent[$this->lang][$lang . '_CHECK_TIMER_LABEL'] = "Check in timer"; + $this->langContent[$this->lang][$lang . '_CHECK_TIMER_DESC'] = "Set the intervals for the auto checkin fuction of tables that checks out the items to an user."; + $this->langContent[$this->lang][$lang . '_CHECK_TIMER_OPTION_ONE'] = "Every five hours"; + $this->langContent[$this->lang][$lang . '_CHECK_TIMER_OPTION_TWO'] = "Every twelve hours"; + $this->langContent[$this->lang][$lang . '_CHECK_TIMER_OPTION_THREE'] = "Once a day"; + $this->langContent[$this->lang][$lang . '_CHECK_TIMER_OPTION_FOUR'] = "Every second day"; + $this->langContent[$this->lang][$lang . '_CHECK_TIMER_OPTION_FIVE'] = "Once a week"; + $this->langContent[$this->lang][$lang . '_CHECK_TIMER_OPTION_SIX'] = "Never"; // load the Global checkin defautls $this->extensionsParams[] = '"check_in":"-1 day"'; } @@ -13067,65 +13045,65 @@ class Interpretation extends Fields if ($this->setTagHistory) { $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\t".'name="save_history"'; - $this->configFieldSets[] = "\t\t\t".'type="radio"'; - $this->configFieldSets[] = "\t\t\t".'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = "\t\t\t".'default="1"'; - $this->configFieldSets[] = "\t\t\t".'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'name="save_history"'; + $this->configFieldSets[] = "\t\t\t" . 'type="radio"'; + $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = "\t\t\t" . 'default="1"'; + $this->configFieldSets[] = "\t\t\t" . 'label="JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="JGLOBAL_SAVE_HISTORY_OPTIONS_DESC"'; $this->configFieldSets[] = "\t\t\t>"; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\t".'name="history_limit"'; - $this->configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'filter="integer"'; - $this->configFieldSets[] = "\t\t\t".'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'; - $this->configFieldSets[] = "\t\t\t".'default="10"'; + $this->configFieldSets[] = "\t\t\t" . 'name="history_limit"'; + $this->configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'filter="integer"'; + $this->configFieldSets[] = "\t\t\t" . 'label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'default="10"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".''; + $this->configFieldSets[] = "\t\t" . ''; // load the Global checkin defautls $this->extensionsParams[] = '"save_history":"1","history_limit":"10"'; } // add custom global fields if (isset($this->configFieldSetsCustomField['Global']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Global'])) { - $this->configFieldSets[] = implode("\t\t",$this->configFieldSetsCustomField['Global']); + $this->configFieldSets[] = implode("\t\t", $this->configFieldSetsCustomField['Global']); unset($this->configFieldSetsCustomField['Global']); } // set the author details - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="spacer"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_AUTHOR"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="spacer"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_AUTHOR"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_AUTHOR_NAME_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_AUTHOR_NAME_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default="'.$autorName.'"'; - $this->configFieldSets[] = "\t\t\t".'readonly="true"'; - $this->configFieldSets[] = "\t\t\t".'class="readonly"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_AUTHOR_NAME_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_AUTHOR_NAME_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default="' . $autorName . '"'; + $this->configFieldSets[] = "\t\t\t" . 'readonly="true"'; + $this->configFieldSets[] = "\t\t\t" . 'class="readonly"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="email"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_AUTHOR_EMAIL_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_AUTHOR_EMAIL_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default="'.$autorEmail.'"'; - $this->configFieldSets[] = "\t\t\t".'readonly="true"'; - $this->configFieldSets[] = "\t\t\t".'class="readonly"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="email"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_AUTHOR_EMAIL_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_AUTHOR_EMAIL_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default="' . $autorEmail . '"'; + $this->configFieldSets[] = "\t\t\t" . 'readonly="true"'; + $this->configFieldSets[] = "\t\t\t" . 'class="readonly"'; $this->configFieldSets[] = "\t\t/>"; // setup lang - $this->langContent[$this->lang][$lang.'_AUTHOR'] = "Author Info"; - $this->langContent[$this->lang][$lang.'_AUTHOR_NAME_LABEL'] = "Author Name"; - $this->langContent[$this->lang][$lang.'_AUTHOR_NAME_DESC'] = "The name of the author of this component."; - $this->langContent[$this->lang][$lang.'_AUTHOR_EMAIL_LABEL'] = "Author Email"; - $this->langContent[$this->lang][$lang.'_AUTHOR_EMAIL_DESC'] = "The email address of the author of this component."; + $this->langContent[$this->lang][$lang . '_AUTHOR'] = "Author Info"; + $this->langContent[$this->lang][$lang . '_AUTHOR_NAME_LABEL'] = "Author Name"; + $this->langContent[$this->lang][$lang . '_AUTHOR_NAME_DESC'] = "The name of the author of this component."; + $this->langContent[$this->lang][$lang . '_AUTHOR_EMAIL_LABEL'] = "Author Email"; + $this->langContent[$this->lang][$lang . '_AUTHOR_EMAIL_DESC'] = "The email address of the author of this component."; // set if contributors were added - $langCont = $lang.'_CONTRIBUTOR'; + $langCont = $lang . '_CONTRIBUTOR'; if (isset($this->addContributors) && $this->addContributors && isset($this->componentData->contributors) && ComponentbuilderHelper::checkArray($this->componentData->contributors)) { foreach ($this->componentData->contributors as $counter => $contributor) @@ -13133,84 +13111,85 @@ class Interpretation extends Fields // make sure we dont use 0 $counter++; // get the word for this number - $COUNTER = ComponentbuilderHelper::safeString($counter,'U'); + $COUNTER = ComponentbuilderHelper::safeString($counter, 'U'); // set the dynamic values - $cbTitle = htmlspecialchars($contributor['title'], ENT_XML1, 'UTF-8'); - $cbName = htmlspecialchars($contributor['name'], ENT_XML1, 'UTF-8'); - $cbEmail = htmlspecialchars($contributor['email'], ENT_XML1, 'UTF-8'); - $cbWebsite = htmlspecialchars($contributor['website'], ENT_XML1, 'UTF-8'); // ComponentbuilderHelper::htmlEscape($contributor['website']); + $cbTitle = htmlspecialchars($contributor['title'], ENT_XML1, 'UTF-8'); + $cbName = htmlspecialchars($contributor['name'], ENT_XML1, 'UTF-8'); + $cbEmail = htmlspecialchars($contributor['email'], ENT_XML1, 'UTF-8'); + $cbWebsite = htmlspecialchars($contributor['website'], ENT_XML1, 'UTF-8'); // ComponentbuilderHelper::htmlEscape($contributor['website']); // load to the $fieldsets - $this->configFieldSets[] = "\t\t".''; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="spacer"'; - $this->configFieldSets[] = "\t\t\t".'class="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_'.$COUNTER.'"'; + $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="spacer"'; + $this->configFieldSets[] = "\t\t\t" . 'class="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_' . $COUNTER . '"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_TITLE_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_TITLE_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default="'.$cbTitle.'"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_TITLE_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_TITLE_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default="' . $cbTitle . '"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_NAME_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_NAME_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default="'.$cbName.'"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_NAME_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_NAME_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default="' . $cbName . '"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="email"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_EMAIL_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_EMAIL_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default="'.$cbEmail.'"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="email"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_EMAIL_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_EMAIL_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default="' . $cbEmail . '"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="url"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_LINK_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_LINK_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default="'.$cbWebsite.'"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="url"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_LINK_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_LINK_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default="' . $cbWebsite . '"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="list"'; - $this->configFieldSets[] = "\t\t\t".'default="'.(int) $contributor['use'].'"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_USE_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_USE_DESC">'; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="list"'; + $this->configFieldSets[] = "\t\t\t" . 'default="' . (int) $contributor['use'] . '"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_USE_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_USE_DESC">'; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="list"'; - $this->configFieldSets[] = "\t\t\t".'default="'.(int) $contributor['show'].'"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_SHOW_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_SHOW_DESC">'; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="list"'; + $this->configFieldSets[] = "\t\t\t" . 'default="' . (int) $contributor['show'] . '"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_SHOW_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_SHOW_DESC">'; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; $this->configFieldSets[] = "\t\t"; // add the contributor - $this->theContributors .= PHP_EOL."\t@".strtolower($contributor['title'])."\t\t".$contributor['name'].' <'.$contributor['website'].'>'; + $this->theContributors .= PHP_EOL . "\t@" . strtolower($contributor['title']) . "\t\t" . $contributor['name'] . ' <' . $contributor['website'] . '>'; // setup lang - $Counter = ComponentbuilderHelper::safeString($counter,'Ww'); - $this->langContent[$this->lang][$langCont.'_'.$COUNTER] = "Contributor ".$Counter; + $Counter = ComponentbuilderHelper::safeString($counter, 'Ww'); + $this->langContent[$this->lang][$langCont . '_' . $COUNTER] = "Contributor " . $Counter; // load the Global checkin defautls - $this->extensionsParams[] = '"titleContributor'.$counter.'":"'.$cbTitle.'"'; - $this->extensionsParams[] = '"nameContributor'.$counter.'":"'.$cbName.'"'; - $this->extensionsParams[] = '"emailContributor'.$counter.'":"'.$cbEmail.'"'; - $this->extensionsParams[] = '"linkContributor'.$counter.'":"'.$cbWebsite.'"'; - $this->extensionsParams[] = '"useContributor'.$counter.'":"'.(int) $contributor['use'].'"'; - $this->extensionsParams[] = '"showContributor'.$counter.'":"'.(int) $contributor['show'].'"'; + $this->extensionsParams[] = '"titleContributor' . $counter . '":"' . $cbTitle . '"'; + $this->extensionsParams[] = '"nameContributor' . $counter . '":"' . $cbName . '"'; + $this->extensionsParams[] = '"emailContributor' . $counter . '":"' . $cbEmail . '"'; + $this->extensionsParams[] = '"linkContributor' . $counter . '":"' . $cbWebsite . '"'; + $this->extensionsParams[] = '"useContributor' . $counter . '":"' . (int) $contributor['use'] . '"'; + $this->extensionsParams[] = '"showContributor' . $counter . '":"' . (int) $contributor['show'] . '"'; } } // add more contributors if required if (1 == $this->componentData->emptycontributors) { - if (isset($counter)){ + if (isset($counter)) + { $min = $counter + 1; unset($counter); } @@ -13219,229 +13198,229 @@ class Interpretation extends Fields $min = 1; } $max = $min + $this->componentData->number - 1; - $moreContributerFields = range($min,$max, 1); + $moreContributerFields = range($min, $max, 1); foreach ($moreContributerFields as $counter) { - $COUNTER = ComponentbuilderHelper::safeString($counter,'U'); + $COUNTER = ComponentbuilderHelper::safeString($counter, 'U'); - $this->configFieldSets[] = "\t\t".''; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="spacer"'; - $this->configFieldSets[] = "\t\t\t".'class="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_'.$COUNTER.'"'; + $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="spacer"'; + $this->configFieldSets[] = "\t\t\t" . 'class="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_' . $COUNTER . '"'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_TITLE_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_TITLE_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default=""'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_TITLE_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_TITLE_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default=""'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_NAME_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_NAME_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default=""'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_NAME_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_NAME_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default=""'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="email"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_EMAIL_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_EMAIL_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default=""'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="email"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_EMAIL_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_EMAIL_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default=""'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="url"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_LINK_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_LINK_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default=""'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="url"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_LINK_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_LINK_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default=""'; $this->configFieldSets[] = "\t\t/>"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="list"'; - $this->configFieldSets[] = "\t\t\t".'default="0"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_USE_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_USE_DESC">'; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="list"'; + $this->configFieldSets[] = "\t\t\t" . 'default="0"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_USE_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_USE_DESC">'; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="list"'; - $this->configFieldSets[] = "\t\t\t".'default="0"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$langCont.'_SHOW_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$langCont.'_SHOW_DESC">'; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".''; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="list"'; + $this->configFieldSets[] = "\t\t\t" . 'default="0"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $langCont . '_SHOW_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $langCont . '_SHOW_DESC">'; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . ''; $this->configFieldSets[] = "\t\t"; // setup lang - $Counter = ComponentbuilderHelper::safeString($counter,'Ww'); - $this->langContent[$this->lang][$langCont.'_'.$COUNTER] = "Contributor ".$Counter; + $Counter = ComponentbuilderHelper::safeString($counter, 'Ww'); + $this->langContent[$this->lang][$langCont . '_' . $COUNTER] = "Contributor " . $Counter; } } if ($this->addContributors || $this->componentData->emptycontributors == 1) { // setup lang - $this->langContent[$this->lang][$langCont.'_TITLE_LABEL'] = "Contributor Job Title"; - $this->langContent[$this->lang][$langCont.'_TITLE_DESC'] = "The job title that best describes the contributor's relationship to this component."; - $this->langContent[$this->lang][$langCont.'_NAME_LABEL'] = "Contributor Name"; - $this->langContent[$this->lang][$langCont.'_NAME_DESC'] = "The name of this contributor."; - $this->langContent[$this->lang][$langCont.'_EMAIL_LABEL'] = "Contributor Email"; - $this->langContent[$this->lang][$langCont.'_EMAIL_DESC'] = "The email of this contributor."; - $this->langContent[$this->lang][$langCont.'_LINK_LABEL'] = "Contributor Website"; - $this->langContent[$this->lang][$langCont.'_LINK_DESC'] = "The link to this contributor's website."; - $this->langContent[$this->lang][$langCont.'_USE_LABEL'] = "Use"; - $this->langContent[$this->lang][$langCont.'_USE_DESC'] = "How should we link to this contributor."; - $this->langContent[$this->lang][$langCont.'_USE_NONE'] = "None"; - $this->langContent[$this->lang][$langCont.'_USE_EMAIL'] = "Email"; - $this->langContent[$this->lang][$langCont.'_USE_WWW'] = "Website"; - $this->langContent[$this->lang][$langCont.'_SHOW_LABEL'] = "Show"; - $this->langContent[$this->lang][$langCont.'_SHOW_DESC'] = "Select where you want this contributor's details to show in the component."; - $this->langContent[$this->lang][$langCont.'_SHOW_NONE'] = "Hide"; - $this->langContent[$this->lang][$langCont.'_SHOW_BACK'] = "Back-end"; - $this->langContent[$this->lang][$langCont.'_SHOW_FRONT'] = "Front-end"; - $this->langContent[$this->lang][$langCont.'_SHOW_ALL'] = "Both Front & Back-end"; + $this->langContent[$this->lang][$langCont . '_TITLE_LABEL'] = "Contributor Job Title"; + $this->langContent[$this->lang][$langCont . '_TITLE_DESC'] = "The job title that best describes the contributor's relationship to this component."; + $this->langContent[$this->lang][$langCont . '_NAME_LABEL'] = "Contributor Name"; + $this->langContent[$this->lang][$langCont . '_NAME_DESC'] = "The name of this contributor."; + $this->langContent[$this->lang][$langCont . '_EMAIL_LABEL'] = "Contributor Email"; + $this->langContent[$this->lang][$langCont . '_EMAIL_DESC'] = "The email of this contributor."; + $this->langContent[$this->lang][$langCont . '_LINK_LABEL'] = "Contributor Website"; + $this->langContent[$this->lang][$langCont . '_LINK_DESC'] = "The link to this contributor's website."; + $this->langContent[$this->lang][$langCont . '_USE_LABEL'] = "Use"; + $this->langContent[$this->lang][$langCont . '_USE_DESC'] = "How should we link to this contributor."; + $this->langContent[$this->lang][$langCont . '_USE_NONE'] = "None"; + $this->langContent[$this->lang][$langCont . '_USE_EMAIL'] = "Email"; + $this->langContent[$this->lang][$langCont . '_USE_WWW'] = "Website"; + $this->langContent[$this->lang][$langCont . '_SHOW_LABEL'] = "Show"; + $this->langContent[$this->lang][$langCont . '_SHOW_DESC'] = "Select where you want this contributor's details to show in the component."; + $this->langContent[$this->lang][$langCont . '_SHOW_NONE'] = "Hide"; + $this->langContent[$this->lang][$langCont . '_SHOW_BACK'] = "Back-end"; + $this->langContent[$this->lang][$langCont . '_SHOW_FRONT'] = "Front-end"; + $this->langContent[$this->lang][$langCont . '_SHOW_ALL'] = "Both Front & Back-end"; } // close that fieldset $this->configFieldSets[] = "\t"; } - + public function setUikitConfigFieldsets($lang) { if ($this->uikit > 0) { // main lang prefix - $lang = $lang.''; + $lang = $lang . ''; // start building field set for uikit functions $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\t".'name="uikit_config"'; - $this->configFieldSets[] = "\t\t".'label="'.$lang.'_UIKIT_LABEL"'; - $this->configFieldSets[] = "\t\t".'description="'.$lang.'_UIKIT_DESC">'; + $this->configFieldSets[] = "\t\t" . 'name="uikit_config"'; + $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_UIKIT_LABEL"'; + $this->configFieldSets[] = "\t\t" . 'description="' . $lang . '_UIKIT_DESC">'; // set tab lang if (1 == $this->uikit) { - $this->langContent[$this->lang][$lang.'_UIKIT_LABEL'] = "Uikit2 Settings"; - $this->langContent[$this->lang][$lang.'_UIKIT_DESC'] = "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework + $this->langContent[$this->lang][$lang . '_UIKIT_LABEL'] = "Uikit2 Settings"; + $this->langContent[$this->lang][$lang . '_UIKIT_DESC'] = "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework for developing fast and powerful web interfaces. For more info visit https://getuikit.com/v2/"; } - elseif (2 == $this->uikit) + elseif (2 == $this->uikit) { - $this->langContent[$this->lang][$lang.'_UIKIT_LABEL'] = "Uikit2 and Uikit3 Settings"; - $this->langContent[$this->lang][$lang.'_UIKIT_DESC'] = "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework + $this->langContent[$this->lang][$lang . '_UIKIT_LABEL'] = "Uikit2 and Uikit3 Settings"; + $this->langContent[$this->lang][$lang . '_UIKIT_DESC'] = "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework for developing fast and powerful web interfaces. For more info visit version 2 or version 3"; } - elseif (3 == $this->uikit) + elseif (3 == $this->uikit) { - $this->langContent[$this->lang][$lang.'_UIKIT_LABEL'] = "Uikit3 Settings"; - $this->langContent[$this->lang][$lang.'_UIKIT_DESC'] = "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework + $this->langContent[$this->lang][$lang . '_UIKIT_LABEL'] = "Uikit3 Settings"; + $this->langContent[$this->lang][$lang . '_UIKIT_DESC'] = "The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework for developing fast and powerful web interfaces. For more info visit https://getuikit.com/"; } - + // add version selection if (2 == $this->uikit) { // set field lang - $this->langContent[$this->lang][$lang.'_UIKIT_VERSION_LABEL'] = "Uikit Versions"; - $this->langContent[$this->lang][$lang.'_UIKIT_VERSION_DESC'] = "Select what version you would like to use"; - $this->langContent[$this->lang][$lang.'_UIKIT_V2'] = "Version 2"; - $this->langContent[$this->lang][$lang.'_UIKIT_V3'] = "Version 3"; + $this->langContent[$this->lang][$lang . '_UIKIT_VERSION_LABEL'] = "Uikit Versions"; + $this->langContent[$this->lang][$lang . '_UIKIT_VERSION_DESC'] = "Select what version you would like to use"; + $this->langContent[$this->lang][$lang . '_UIKIT_V2'] = "Version 2"; + $this->langContent[$this->lang][$lang . '_UIKIT_V3'] = "Version 3"; // set the field - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="radio"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_UIKIT_VERSION_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_UIKIT_VERSION_DESC"'; - $this->configFieldSets[] = "\t\t\t".'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = "\t\t\t".'default="2">'; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".'"'; - $this->configFieldSets[] = "\t\t\t".'"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="radio"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_UIKIT_VERSION_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_UIKIT_VERSION_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = "\t\t\t" . 'default="2">'; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . '"'; + $this->configFieldSets[] = "\t\t\t" . '"'; $this->configFieldSets[] = "\t\t"; // set params defaults $this->extensionsParams[] = '"uikit_version":"2"'; } - + // set field lang - $this->langContent[$this->lang][$lang.'_UIKIT_LOAD_LABEL'] = "Loading Options"; - $this->langContent[$this->lang][$lang.'_UIKIT_LOAD_DESC'] = "Set the uikit loading option."; - $this->langContent[$this->lang][$lang.'_AUTO_LOAD'] = "Auto"; - $this->langContent[$this->lang][$lang.'_FORCE_LOAD'] = "Force"; - $this->langContent[$this->lang][$lang.'_DONT_LOAD'] = "Not"; - $this->langContent[$this->lang][$lang.'_ONLY_EXTRA'] = "Only Extra"; + $this->langContent[$this->lang][$lang . '_UIKIT_LOAD_LABEL'] = "Loading Options"; + $this->langContent[$this->lang][$lang . '_UIKIT_LOAD_DESC'] = "Set the uikit loading option."; + $this->langContent[$this->lang][$lang . '_AUTO_LOAD'] = "Auto"; + $this->langContent[$this->lang][$lang . '_FORCE_LOAD'] = "Force"; + $this->langContent[$this->lang][$lang . '_DONT_LOAD'] = "Not"; + $this->langContent[$this->lang][$lang . '_ONLY_EXTRA'] = "Only Extra"; // set the field - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="radio"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_UIKIT_LOAD_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_UIKIT_LOAD_DESC"'; - $this->configFieldSets[] = "\t\t\t".'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = "\t\t\t".'default="">'; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".'"'; - $this->configFieldSets[] = "\t\t\t".'"'; - if (2 == $this->uikit || 1 == $this->uikit) + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="radio"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_UIKIT_LOAD_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_UIKIT_LOAD_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = "\t\t\t" . 'default="">'; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . '"'; + $this->configFieldSets[] = "\t\t\t" . '"'; + if (2 == $this->uikit || 1 == $this->uikit) { - $this->configFieldSets[] = "\t\t\t".'"'; + $this->configFieldSets[] = "\t\t\t" . '"'; } - $this->configFieldSets[] = "\t\t\t".'"'; + $this->configFieldSets[] = "\t\t\t" . '"'; $this->configFieldSets[] = "\t\t"; // set params defaults $this->extensionsParams[] = '"uikit_load":"1"'; - + // set field lang - $this->langContent[$this->lang][$lang.'_UIKIT_MIN_LABEL'] = "Load Minified"; - $this->langContent[$this->lang][$lang.'_UIKIT_MIN_DESC'] = "Should the minified version of uikit files be loaded?"; - $this->langContent[$this->lang][$lang.'_YES'] = "Yes"; - $this->langContent[$this->lang][$lang.'_NO'] = "No"; + $this->langContent[$this->lang][$lang . '_UIKIT_MIN_LABEL'] = "Load Minified"; + $this->langContent[$this->lang][$lang . '_UIKIT_MIN_DESC'] = "Should the minified version of uikit files be loaded?"; + $this->langContent[$this->lang][$lang . '_YES'] = "Yes"; + $this->langContent[$this->lang][$lang . '_NO'] = "No"; // set the field - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="radio"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_UIKIT_MIN_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_UIKIT_MIN_DESC"'; - $this->configFieldSets[] = "\t\t\t".'class="btn-group btn-group-yesno"'; - $this->configFieldSets[] = "\t\t\t".'default="">'; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".'"'; - $this->configFieldSets[] = "\t\t\t".'"'; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="radio"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_UIKIT_MIN_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_UIKIT_MIN_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; + $this->configFieldSets[] = "\t\t\t" . 'default="">'; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . '"'; + $this->configFieldSets[] = "\t\t\t" . '"'; $this->configFieldSets[] = "\t\t"; // set params defaults $this->extensionsParams[] = '"uikit_min":""'; - - if (2 == $this->uikit || 1 == $this->uikit) + + if (2 == $this->uikit || 1 == $this->uikit) { // set field lang - $this->langContent[$this->lang][$lang.'_UIKIT_STYLE_LABEL'] = "css Style"; - $this->langContent[$this->lang][$lang.'_UIKIT_STYLE_DESC'] = "Set the css style that should be used."; - $this->langContent[$this->lang][$lang.'_FLAT_LOAD'] = "Flat"; - $this->langContent[$this->lang][$lang.'_ALMOST_FLAT_LOAD'] = "Almost Flat"; - $this->langContent[$this->lang][$lang.'_GRADIANT_LOAD'] = "Gradient"; + $this->langContent[$this->lang][$lang . '_UIKIT_STYLE_LABEL'] = "css Style"; + $this->langContent[$this->lang][$lang . '_UIKIT_STYLE_DESC'] = "Set the css style that should be used."; + $this->langContent[$this->lang][$lang . '_FLAT_LOAD'] = "Flat"; + $this->langContent[$this->lang][$lang . '_ALMOST_FLAT_LOAD'] = "Almost Flat"; + $this->langContent[$this->lang][$lang . '_GRADIANT_LOAD'] = "Gradient"; // set the field - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="radio"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_UIKIT_STYLE_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_UIKIT_STYLE_DESC"'; - $this->configFieldSets[] = "\t\t\t".'class="btn-group btn-group-yesno"'; - if (2 == $this->uikit) + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="radio"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_UIKIT_STYLE_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_UIKIT_STYLE_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'class="btn-group btn-group-yesno"'; + if (2 == $this->uikit) { - $this->configFieldSets[] = "\t\t\t".'showon="uikit_version:2"'; + $this->configFieldSets[] = "\t\t\t" . 'showon="uikit_version:2"'; } - $this->configFieldSets[] = "\t\t\t".'default="">'; - $this->configFieldSets[] = "\t\t\t".''; - $this->configFieldSets[] = "\t\t\t".'"'; - $this->configFieldSets[] = "\t\t\t".'"'; - $this->configFieldSets[] = "\t\t\t".'"'; + $this->configFieldSets[] = "\t\t\t" . 'default="">'; + $this->configFieldSets[] = "\t\t\t" . ''; + $this->configFieldSets[] = "\t\t\t" . '"'; + $this->configFieldSets[] = "\t\t\t" . '"'; + $this->configFieldSets[] = "\t\t\t" . '"'; $this->configFieldSets[] = "\t\t"; // set params defaults $this->extensionsParams[] = '"uikit_style":""'; @@ -13449,319 +13428,318 @@ for developing fast and powerful web interfaces. For more info visit configFieldSetsCustomField['Uikit Settings']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Uikit Settings'])) { - $this->configFieldSets[] = implode("\t\t",$this->configFieldSetsCustomField['Uikit Settings']); + $this->configFieldSets[] = implode("\t\t", $this->configFieldSetsCustomField['Uikit Settings']); unset($this->configFieldSetsCustomField['Uikit Settings']); } // close that fieldset $this->configFieldSets[] = "\t"; } - } - + public function setEmailHelperConfigFieldsets($lang) { if (isset($this->componentData->add_email_helper) && $this->componentData->add_email_helper) { // main lang prefix - $lang = $lang.''; + $lang = $lang . ''; // set main lang string - $this->langContent[$this->lang][$lang.'_MAIL_CONFIGURATION'] = "Mail Configuration"; - $this->langContent[$this->lang][$lang.'_DKIM'] = "DKIM"; + $this->langContent[$this->lang][$lang . '_MAIL_CONFIGURATION'] = "Mail Configuration"; + $this->langContent[$this->lang][$lang . '_DKIM'] = "DKIM"; // start building field set for email helper functions - $this->configFieldSets[] = PHP_EOL."\tconfigFieldSets[] = PHP_EOL . "\tconfigFieldSets[] = "\t\tname=\"mail_configuration_custom_config\""; - $this->configFieldSets[] = "\t\tlabel=\"".$lang."_MAIL_CONFIGURATION\">"; + $this->configFieldSets[] = "\t\tlabel=\"" . $lang . "_MAIL_CONFIGURATION\">"; // add custom Mail Configurations if (isset($this->configFieldSetsCustomField['Mail Configuration']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Mail Configuration'])) { - $this->configFieldSets[] = implode("\t\t",$this->configFieldSetsCustomField['Mail Configuration']); + $this->configFieldSets[] = implode("\t\t", $this->configFieldSetsCustomField['Mail Configuration']); unset($this->configFieldSetsCustomField['Mail Configuration']); } else { // set all the laguage strings - $this->langContent[$this->lang][$lang.'_MAILONLINE_LABEL'] = "Mailer Status"; - $this->langContent[$this->lang][$lang.'_MAILONLINE_DESCRIPTION'] = "Warning this will stop all emails from going out."; - $this->langContent[$this->lang][$lang.'_ON'] = "On"; - $this->langContent[$this->lang][$lang.'_OFF'] = "Off"; - $this->langContent[$this->lang][$lang.'_MAILER_LABEL'] = "Mailer"; - $this->langContent[$this->lang][$lang.'_MAILER_DESCRIPTION'] = "Select what mailer you would like to use to send emails."; - $this->langContent[$this->lang][$lang.'_GLOBAL'] = "Global"; - $this->langContent[$this->lang][$lang.'_PHP_MAIL'] = "PHP Mail"; - $this->langContent[$this->lang][$lang.'_SENDMAIL'] = "Sendmail"; - $this->langContent[$this->lang][$lang.'_SMTP'] = "SMTP"; - $this->langContent[$this->lang][$lang.'_EMAILFROM_LABEL'] = " From Email"; - $this->langContent[$this->lang][$lang.'_EMAILFROM_DESCRIPTION'] = "The global email address that will be used to send system email."; - $this->langContent[$this->lang][$lang.'_EMAILFROM_HINT'] = "Email Address Here"; - $this->langContent[$this->lang][$lang.'_FROMNAME_LABEL'] = "From Name"; - $this->langContent[$this->lang][$lang.'_FROMNAME_DESCRIPTION'] = "Text displayed in the header "From:" field when sending a site email. Usually the site name."; - $this->langContent[$this->lang][$lang.'_FROMNAME_HINT'] = "From Name Here"; - $this->langContent[$this->lang][$lang.'_EMAILREPLY_LABEL'] = " Reply to Email"; - $this->langContent[$this->lang][$lang.'_EMAILREPLY_DESCRIPTION'] = "The global email address that will be used to set as the reply email. (leave blank for none)"; - $this->langContent[$this->lang][$lang.'_EMAILREPLY_HINT'] = "Email Address Here"; - $this->langContent[$this->lang][$lang.'_REPLYNAME_LABEL'] = "Reply to Name"; - $this->langContent[$this->lang][$lang.'_REPLYNAME_DESCRIPTION'] = "Text displayed in the header "Reply To:" field when replying to the site email. Usually the the person that receives the response. (leave blank for none)"; - $this->langContent[$this->lang][$lang.'_REPLYNAME_HINT'] = "Reply Name Here"; - $this->langContent[$this->lang][$lang.'_SENDMAIL_LABEL'] = "Sendmail Path"; - $this->langContent[$this->lang][$lang.'_SENDMAIL_DESCRIPTION'] = "Enter the path to the sendmail program directory on your host server."; - $this->langContent[$this->lang][$lang.'_SENDMAIL_HINT'] = "/usr/sbin/sendmail"; - $this->langContent[$this->lang][$lang.'_SMTPAUTH_LABEL'] = "SMTP Authentication"; - $this->langContent[$this->lang][$lang.'_SMTPAUTH_DESCRIPTION'] = "Select yes if your SMTP host requires SMTP Authentication."; - $this->langContent[$this->lang][$lang.'_YES'] = "Yes"; - $this->langContent[$this->lang][$lang.'_NO'] = "No"; - $this->langContent[$this->lang][$lang.'_SMTPSECURE_LABEL'] = "SMTP Security"; - $this->langContent[$this->lang][$lang.'_SMTPSECURE_DESCRIPTION'] = "Select the security model that your SMTP server uses."; - $this->langContent[$this->lang][$lang.'_NONE'] = "None"; - $this->langContent[$this->lang][$lang.'_SSL'] = "SSL"; - $this->langContent[$this->lang][$lang.'_TLS'] = "TLS"; - $this->langContent[$this->lang][$lang.'_SMTPPORT_LABEL'] = "SMTP Port"; - $this->langContent[$this->lang][$lang.'_SMTPPORT_DESCRIPTION'] = "Enter the port number of your SMTP server. Use 25 for most unsecured servers and 465 for most secure servers."; - $this->langContent[$this->lang][$lang.'_SMTPPORT_HINT'] = "25"; - $this->langContent[$this->lang][$lang.'_SMTPUSER_LABEL'] = "SMTP Username"; - $this->langContent[$this->lang][$lang.'_SMTPUSER_DESCRIPTION'] = "Enter the username for access to the SMTP host."; - $this->langContent[$this->lang][$lang.'_SMTPUSER_HINT'] = "email@demo.com"; - $this->langContent[$this->lang][$lang.'_SMTPPASS_LABEL'] = "SMTP Password"; - $this->langContent[$this->lang][$lang.'_SMTPPASS_DESCRIPTION'] = "Enter the password for access to the SMTP host."; - $this->langContent[$this->lang][$lang.'_SMTPHOST_LABEL'] = "SMTP Host"; - $this->langContent[$this->lang][$lang.'_SMTPHOST_DESCRIPTION'] = "Enter the name of the SMTP host."; - $this->langContent[$this->lang][$lang.'_SMTPHOST_HINT'] = "localhost"; + $this->langContent[$this->lang][$lang . '_MAILONLINE_LABEL'] = "Mailer Status"; + $this->langContent[$this->lang][$lang . '_MAILONLINE_DESCRIPTION'] = "Warning this will stop all emails from going out."; + $this->langContent[$this->lang][$lang . '_ON'] = "On"; + $this->langContent[$this->lang][$lang . '_OFF'] = "Off"; + $this->langContent[$this->lang][$lang . '_MAILER_LABEL'] = "Mailer"; + $this->langContent[$this->lang][$lang . '_MAILER_DESCRIPTION'] = "Select what mailer you would like to use to send emails."; + $this->langContent[$this->lang][$lang . '_GLOBAL'] = "Global"; + $this->langContent[$this->lang][$lang . '_PHP_MAIL'] = "PHP Mail"; + $this->langContent[$this->lang][$lang . '_SENDMAIL'] = "Sendmail"; + $this->langContent[$this->lang][$lang . '_SMTP'] = "SMTP"; + $this->langContent[$this->lang][$lang . '_EMAILFROM_LABEL'] = " From Email"; + $this->langContent[$this->lang][$lang . '_EMAILFROM_DESCRIPTION'] = "The global email address that will be used to send system email."; + $this->langContent[$this->lang][$lang . '_EMAILFROM_HINT'] = "Email Address Here"; + $this->langContent[$this->lang][$lang . '_FROMNAME_LABEL'] = "From Name"; + $this->langContent[$this->lang][$lang . '_FROMNAME_DESCRIPTION'] = "Text displayed in the header "From:" field when sending a site email. Usually the site name."; + $this->langContent[$this->lang][$lang . '_FROMNAME_HINT'] = "From Name Here"; + $this->langContent[$this->lang][$lang . '_EMAILREPLY_LABEL'] = " Reply to Email"; + $this->langContent[$this->lang][$lang . '_EMAILREPLY_DESCRIPTION'] = "The global email address that will be used to set as the reply email. (leave blank for none)"; + $this->langContent[$this->lang][$lang . '_EMAILREPLY_HINT'] = "Email Address Here"; + $this->langContent[$this->lang][$lang . '_REPLYNAME_LABEL'] = "Reply to Name"; + $this->langContent[$this->lang][$lang . '_REPLYNAME_DESCRIPTION'] = "Text displayed in the header "Reply To:" field when replying to the site email. Usually the the person that receives the response. (leave blank for none)"; + $this->langContent[$this->lang][$lang . '_REPLYNAME_HINT'] = "Reply Name Here"; + $this->langContent[$this->lang][$lang . '_SENDMAIL_LABEL'] = "Sendmail Path"; + $this->langContent[$this->lang][$lang . '_SENDMAIL_DESCRIPTION'] = "Enter the path to the sendmail program directory on your host server."; + $this->langContent[$this->lang][$lang . '_SENDMAIL_HINT'] = "/usr/sbin/sendmail"; + $this->langContent[$this->lang][$lang . '_SMTPAUTH_LABEL'] = "SMTP Authentication"; + $this->langContent[$this->lang][$lang . '_SMTPAUTH_DESCRIPTION'] = "Select yes if your SMTP host requires SMTP Authentication."; + $this->langContent[$this->lang][$lang . '_YES'] = "Yes"; + $this->langContent[$this->lang][$lang . '_NO'] = "No"; + $this->langContent[$this->lang][$lang . '_SMTPSECURE_LABEL'] = "SMTP Security"; + $this->langContent[$this->lang][$lang . '_SMTPSECURE_DESCRIPTION'] = "Select the security model that your SMTP server uses."; + $this->langContent[$this->lang][$lang . '_NONE'] = "None"; + $this->langContent[$this->lang][$lang . '_SSL'] = "SSL"; + $this->langContent[$this->lang][$lang . '_TLS'] = "TLS"; + $this->langContent[$this->lang][$lang . '_SMTPPORT_LABEL'] = "SMTP Port"; + $this->langContent[$this->lang][$lang . '_SMTPPORT_DESCRIPTION'] = "Enter the port number of your SMTP server. Use 25 for most unsecured servers and 465 for most secure servers."; + $this->langContent[$this->lang][$lang . '_SMTPPORT_HINT'] = "25"; + $this->langContent[$this->lang][$lang . '_SMTPUSER_LABEL'] = "SMTP Username"; + $this->langContent[$this->lang][$lang . '_SMTPUSER_DESCRIPTION'] = "Enter the username for access to the SMTP host."; + $this->langContent[$this->lang][$lang . '_SMTPUSER_HINT'] = "email@demo.com"; + $this->langContent[$this->lang][$lang . '_SMTPPASS_LABEL'] = "SMTP Password"; + $this->langContent[$this->lang][$lang . '_SMTPPASS_DESCRIPTION'] = "Enter the password for access to the SMTP host."; + $this->langContent[$this->lang][$lang . '_SMTPHOST_LABEL'] = "SMTP Host"; + $this->langContent[$this->lang][$lang . '_SMTPHOST_DESCRIPTION'] = "Enter the name of the SMTP host."; + $this->langContent[$this->lang][$lang . '_SMTPHOST_HINT'] = "localhost"; // set the mailer fields - $this->configFieldSets[] = PHP_EOL."\t\t"; + $this->configFieldSets[] = PHP_EOL . "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"radio\""; $this->configFieldSets[] = "\t\t\tname=\"mailonline\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_MAILONLINE_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_MAILONLINE_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_MAILONLINE_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_MAILONLINE_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"btn-group btn-group-yesno\""; $this->configFieldSets[] = "\t\t\tdefault=\"1\">"; - $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_ON"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_OFF"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"list\""; $this->configFieldSets[] = "\t\t\tname=\"mailer\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_MAILER_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_MAILER_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_MAILER_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_MAILER_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"list_class\""; $this->configFieldSets[] = "\t\t\tmultiple=\"false\""; $this->configFieldSets[] = "\t\t\tfilter=\"WORD\""; $this->configFieldSets[] = "\t\t\trequired=\"true\""; $this->configFieldSets[] = "\t\t\tdefault=\"global\">"; - $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_GLOBAL"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_PHP_MAIL"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_SENDMAIL"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_SMTP"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"emailfrom\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_EMAILFROM_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_EMAILFROM_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_EMAILFROM_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_EMAILFROM_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tvalidate=\"email\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add email address here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_EMAILFROM_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_EMAILFROM_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp,sendmail,default\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"fromname\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_FROMNAME_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_FROMNAME_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_FROMNAME_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_FROMNAME_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add some name here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_FROMNAME_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_FROMNAME_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp,sendmail,default\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"replyto\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_EMAILREPLY_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_EMAILREPLY_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_EMAILREPLY_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_EMAILREPLY_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tvalidate=\"email\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add email address here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_EMAILREPLY_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_EMAILREPLY_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp,sendmail,default\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"replytoname\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_REPLYNAME_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_REPLYNAME_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_REPLYNAME_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_REPLYNAME_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add some name here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_REPLYNAME_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_REPLYNAME_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp,sendmail,default\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"sendmail\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_SENDMAIL_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SENDMAIL_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_SENDMAIL_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SENDMAIL_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\trequired=\"false\""; $this->configFieldSets[] = "\t\t\tfilter=\"PATH\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add path to you local sendmail here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_SENDMAIL_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_SENDMAIL_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:sendmail\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"radio\""; $this->configFieldSets[] = "\t\t\tname=\"smtpauth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_SMTPAUTH_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_SMTPAUTH_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPAUTH_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPAUTH_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"btn-group btn-group-yesno\""; $this->configFieldSets[] = "\t\t\tdefault=\"0\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\">"; - $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_YES"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_NO"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"list\""; $this->configFieldSets[] = "\t\t\tname=\"smtpsecure\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_SMTPSECURE_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_SMTPSECURE_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPSECURE_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPSECURE_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"list_class\""; $this->configFieldSets[] = "\t\t\tmultiple=\"false\""; $this->configFieldSets[] = "\t\t\tfilter=\"WORD\""; $this->configFieldSets[] = "\t\t\tdefault=\"none\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\">"; - $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_NONE"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_SSL"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_TLS"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"smtpport\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_SMTPPORT_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPPORT_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; $this->configFieldSets[] = "\t\t\tdefault=\"25\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_SMTPPORT_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPPORT_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add the port number of your SMTP server here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_SMTPPORT_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_SMTPPORT_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"smtpuser\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_SMTPUSER_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPUSER_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_SMTPUSER_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPUSER_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add the username for SMTP server here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_SMTPUSER_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_SMTPUSER_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"password\""; $this->configFieldSets[] = "\t\t\tname=\"smtppass\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_SMTPPASS_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPPASS_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_SMTPPASS_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPPASS_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"raw\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add the password for SMTP server here.\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"smtphost\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_SMTPHOST_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_SMTPHOST_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; $this->configFieldSets[] = "\t\t\tdefault=\"localhost\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_SMTPHOST_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_SMTPHOST_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add the name of the SMTP host here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_SMTPHOST_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_SMTPHOST_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"mailer:smtp\""; $this->configFieldSets[] = "\t\t/>"; } // close that fieldset $this->configFieldSets[] = "\t"; - + // start dkim field set $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\tname=\"dkim_custom_config\""; - $this->configFieldSets[] = "\t\tlabel=\"".$lang."_DKIM\">"; + $this->configFieldSets[] = "\t\tlabel=\"" . $lang . "_DKIM\">"; // add custom DKIM fields if (isset($this->configFieldSetsCustomField['DKIM']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['DKIM'])) { - $this->configFieldSets[] = implode("\t\t",$this->configFieldSetsCustomField['DKIM']); + $this->configFieldSets[] = implode("\t\t", $this->configFieldSetsCustomField['DKIM']); unset($this->configFieldSetsCustomField['DKIM']); } else { - $this->langContent[$this->lang][$lang.'_DKIM_LABEL'] = "Enable DKIM"; - $this->langContent[$this->lang][$lang.'_DKIM_DESCRIPTION'] = "Set this option to Yes if you want to sign your emails using DKIM."; - $this->langContent[$this->lang][$lang.'_YES'] = "Yes"; - $this->langContent[$this->lang][$lang.'_NO'] = "No"; - $this->langContent[$this->lang][$lang.'_DKIM_DOMAIN_LABEL'] = "Domain"; - $this->langContent[$this->lang][$lang.'_DKIM_DOMAIN_DESCRIPTION'] = "Set the domain. Eg. domain.com"; - $this->langContent[$this->lang][$lang.'_DKIM_DOMAIN_HINT'] = "domain.com"; - $this->langContent[$this->lang][$lang.'_DKIM_SELECTOR_LABEL'] = "Selector"; - $this->langContent[$this->lang][$lang.'_DKIM_SELECTOR_DESCRIPTION'] = "Set your DKIM/DNS selector."; - $this->langContent[$this->lang][$lang.'_DKIM_SELECTOR_HINT'] = "vdm"; - $this->langContent[$this->lang][$lang.'_DKIM_PASSPHRASE_LABEL'] = "Passphrase"; - $this->langContent[$this->lang][$lang.'_DKIM_PASSPHRASE_DESCRIPTION'] = "Enter your passphrase here."; - $this->langContent[$this->lang][$lang.'_DKIM_IDENTITY_LABEL'] = "Identity"; - $this->langContent[$this->lang][$lang.'_DKIM_IDENTITY_DESCRIPTION'] = "Set DKIM identity. This can be in the format of an email address 'you@yourdomain.com' typically used as the source of the email."; - $this->langContent[$this->lang][$lang.'_DKIM_IDENTITY_HINT'] = "you@yourdomain.com"; - $this->langContent[$this->lang][$lang.'_DKIM_PRIVATE_KEY_LABEL'] = "Private key"; - $this->langContent[$this->lang][$lang.'_DKIM_PRIVATE_KEY_DESCRIPTION'] = "set private key"; - $this->langContent[$this->lang][$lang.'_DKIM_PUBLIC_KEY_LABEL'] = "Public key"; - $this->langContent[$this->lang][$lang.'_DKIM_PUBLIC_KEY_DESCRIPTION'] = "set public key"; - $this->langContent[$this->lang][$lang.'_NOTE_DKIM_USE_LABEL'] = "Server Configuration"; - $this->langContent[$this->lang][$lang.'_NOTE_DKIM_USE_DESCRIPTION'] = "

Using the below details, you need to configure your DNS by adding a TXT record on your domain:

+ $this->langContent[$this->lang][$lang . '_DKIM_LABEL'] = "Enable DKIM"; + $this->langContent[$this->lang][$lang . '_DKIM_DESCRIPTION'] = "Set this option to Yes if you want to sign your emails using DKIM."; + $this->langContent[$this->lang][$lang . '_YES'] = "Yes"; + $this->langContent[$this->lang][$lang . '_NO'] = "No"; + $this->langContent[$this->lang][$lang . '_DKIM_DOMAIN_LABEL'] = "Domain"; + $this->langContent[$this->lang][$lang . '_DKIM_DOMAIN_DESCRIPTION'] = "Set the domain. Eg. domain.com"; + $this->langContent[$this->lang][$lang . '_DKIM_DOMAIN_HINT'] = "domain.com"; + $this->langContent[$this->lang][$lang . '_DKIM_SELECTOR_LABEL'] = "Selector"; + $this->langContent[$this->lang][$lang . '_DKIM_SELECTOR_DESCRIPTION'] = "Set your DKIM/DNS selector."; + $this->langContent[$this->lang][$lang . '_DKIM_SELECTOR_HINT'] = "vdm"; + $this->langContent[$this->lang][$lang . '_DKIM_PASSPHRASE_LABEL'] = "Passphrase"; + $this->langContent[$this->lang][$lang . '_DKIM_PASSPHRASE_DESCRIPTION'] = "Enter your passphrase here."; + $this->langContent[$this->lang][$lang . '_DKIM_IDENTITY_LABEL'] = "Identity"; + $this->langContent[$this->lang][$lang . '_DKIM_IDENTITY_DESCRIPTION'] = "Set DKIM identity. This can be in the format of an email address 'you@yourdomain.com' typically used as the source of the email."; + $this->langContent[$this->lang][$lang . '_DKIM_IDENTITY_HINT'] = "you@yourdomain.com"; + $this->langContent[$this->lang][$lang . '_DKIM_PRIVATE_KEY_LABEL'] = "Private key"; + $this->langContent[$this->lang][$lang . '_DKIM_PRIVATE_KEY_DESCRIPTION'] = "set private key"; + $this->langContent[$this->lang][$lang . '_DKIM_PUBLIC_KEY_LABEL'] = "Public key"; + $this->langContent[$this->lang][$lang . '_DKIM_PUBLIC_KEY_DESCRIPTION'] = "set public key"; + $this->langContent[$this->lang][$lang . '_NOTE_DKIM_USE_LABEL'] = "Server Configuration"; + $this->langContent[$this->lang][$lang . '_NOTE_DKIM_USE_DESCRIPTION'] = "

Using the below details, you need to configure your DNS by adding a TXT record on your domain:

"; - $this->langContent[$this->lang][$lang.'_DKIM_KEY_LABEL'] = "Key"; - $this->langContent[$this->lang][$lang.'_DKIM_KEY_DESCRIPTION'] = "This is the KEY to use in the DNS record."; - $this->langContent[$this->lang][$lang.'_DKIM_KEY_HINT'] = "vdm._domainkey"; - $this->langContent[$this->lang][$lang.'_DKIM_VALUE_LABEL'] = "Value"; - $this->langContent[$this->lang][$lang.'_DKIM_VALUE_DESCRIPTION'] = "This is the TXT value to use in the DNS. Replace the PUBLICKEY with your public key."; - $this->langContent[$this->lang][$lang.'_DKIM_VALUE_HINT'] = "v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY"; + $this->langContent[$this->lang][$lang . '_DKIM_KEY_LABEL'] = "Key"; + $this->langContent[$this->lang][$lang . '_DKIM_KEY_DESCRIPTION'] = "This is the KEY to use in the DNS record."; + $this->langContent[$this->lang][$lang . '_DKIM_KEY_HINT'] = "vdm._domainkey"; + $this->langContent[$this->lang][$lang . '_DKIM_VALUE_LABEL'] = "Value"; + $this->langContent[$this->lang][$lang . '_DKIM_VALUE_DESCRIPTION'] = "This is the TXT value to use in the DNS. Replace the PUBLICKEY with your public key."; + $this->langContent[$this->lang][$lang . '_DKIM_VALUE_HINT'] = "v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY"; - $this->configFieldSets[] = PHP_EOL."\t\t"; + $this->configFieldSets[] = PHP_EOL . "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"radio\""; $this->configFieldSets[] = "\t\t\tname=\"dkim\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"btn-group btn-group-yesno\""; $this->configFieldSets[] = "\t\t\tdefault=\"0\""; $this->configFieldSets[] = "\t\t\trequired=\"true\">"; - $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_YES"; $this->configFieldSets[] = "\t\t\t"; + $this->configFieldSets[] = "\t\t\t\t" . $lang . "_NO"; $this->configFieldSets[] = "\t\t
\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"dkim_domain\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_DOMAIN_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_DOMAIN_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_DOMAIN_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_DOMAIN_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add DKIM Domain here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_DKIM_DOMAIN_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_DOMAIN_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; $this->configFieldSets[] = "\t\t\tonchange=\"vdm_dkim();\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"dkim_selector\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_SELECTOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_SELECTOR_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; $this->configFieldSets[] = "\t\t\tdefault=\"vdm\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_SELECTOR_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_SELECTOR_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add DKIM/DNS selector here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_DKIM_SELECTOR_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_SELECTOR_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; $this->configFieldSets[] = "\t\t\tonchange=\"vdm_dkim();\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"password\""; $this->configFieldSets[] = "\t\t\tname=\"dkim_passphrase\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_PASSPHRASE_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_PASSPHRASE_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_PASSPHRASE_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_PASSPHRASE_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"raw\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add passphrase here.\""; $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"dkim_identity\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_IDENTITY_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_IDENTITY_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"60\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_IDENTITY_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_IDENTITY_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"raw\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add DKIM Identity here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_DKIM_IDENTITY_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_IDENTITY_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"textarea\""; $this->configFieldSets[] = "\t\t\tname=\"dkim_private_key\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_PRIVATE_KEY_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_PRIVATE_KEY_LABEL\""; $this->configFieldSets[] = "\t\t\trows=\"15\""; $this->configFieldSets[] = "\t\t\tcols=\"5\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_PRIVATE_KEY_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_PRIVATE_KEY_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"input-xxlarge span12\""; $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"textarea\""; $this->configFieldSets[] = "\t\t\tname=\"dkim_public_key\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_PUBLIC_KEY_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_PUBLIC_KEY_LABEL\""; $this->configFieldSets[] = "\t\t\trows=\"5\""; $this->configFieldSets[] = "\t\t\tcols=\"5\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_PUBLIC_KEY_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_PUBLIC_KEY_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"input-xxlarge span12\""; $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; $this->configFieldSets[] = "\t\t\tonchange=\"vdm_dkim();\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"dkim_key\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_KEY_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_KEY_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"40\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"150\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_KEY_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_KEY_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add KEY here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_DKIM_KEY_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_KEY_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"dkim_value\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_DKIM_VALUE_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_DKIM_VALUE_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"80\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"350\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_DKIM_VALUE_DESCRIPTION\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_DKIM_VALUE_DESCRIPTION\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"STRING\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add TXT record here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_DKIM_VALUE_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_DKIM_VALUE_HINT\""; $this->configFieldSets[] = "\t\t\tshowon=\"dkim:1\""; $this->configFieldSets[] = "\t\t/>"; } // close that fieldset $this->configFieldSets[] = "\t"; } - } - + public function setGooglechartConfigFieldsets($lang) { if ($this->googlechart) { - $this->configFieldSets[] = PHP_EOL."\tconfigFieldSets[] = PHP_EOL . "\tconfigFieldSets[] = "\t\tname=\"googlechart_config\""; - $this->configFieldSets[] = "\t\tlabel=\"".$lang."_CHART_SETTINGS_LABEL\""; - $this->configFieldSets[] = "\t\tdescription=\"".$lang."_CHART_SETTINGS_DESC\">"; + $this->configFieldSets[] = "\t\tlabel=\"" . $lang . "_CHART_SETTINGS_LABEL\""; + $this->configFieldSets[] = "\t\tdescription=\"" . $lang . "_CHART_SETTINGS_DESC\">"; $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"admin_chartbackground\""; $this->configFieldSets[] = "\t\t\tdefault=\"#F7F7FA\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_CHARTBACKGROUND_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_CHARTBACKGROUND_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTBACKGROUND_DESC\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"admin_mainwidth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_MAINWIDTH_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_MAINWIDTH_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_MAINWIDTH_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_MAINWIDTH_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add area width here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_MAINWIDTH_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_MAINWIDTH_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"admin_chartareatop\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_CHARTAREATOP_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREATOP_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_CHARTAREATOP_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREATOP_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add top spacing here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_CHARTAREATOP_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREATOP_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"admin_chartarealeft\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_CHARTAREALEFT_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREALEFT_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_CHARTAREALEFT_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREALEFT_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add left spacing here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_CHARTAREALEFT_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREALEFT_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"admin_chartareawidth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_CHARTAREAWIDTH_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_CHARTAREAWIDTH_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add chart width here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_CHARTAREAWIDTH_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"admin_legendtextstylefontcolor\""; $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"admin_legendtextstylefontsize\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_LEGENDTEXTSTYLEFONTSIZE_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add size of the legend here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_LEGENDTEXTSTYLEFONTSIZE_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"admin_vaxistextstylefontcolor\""; $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_VAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"admin_haxistextstylefontcolor\""; $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_HAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"admin_haxistitletextstylefontcolor\""; $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = "\t\t/>"; $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"site_chartbackground\""; $this->configFieldSets[] = "\t\t\tdefault=\"#F7F7FA\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_CHARTBACKGROUND_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_CHARTBACKGROUND_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTBACKGROUND_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTBACKGROUND_DESC\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"site_mainwidth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_MAINWIDTH_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_MAINWIDTH_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_MAINWIDTH_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_MAINWIDTH_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add area width here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_MAINWIDTH_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_MAINWIDTH_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"site_chartareatop\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_CHARTAREATOP_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREATOP_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_CHARTAREATOP_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREATOP_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add top spacing here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_CHARTAREATOP_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREATOP_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"site_chartarealeft\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_CHARTAREALEFT_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREALEFT_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_CHARTAREALEFT_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREALEFT_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add left spacing here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_CHARTAREALEFT_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREALEFT_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"site_chartareawidth\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_CHARTAREAWIDTH_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_CHARTAREAWIDTH_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_CHARTAREAWIDTH_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_CHARTAREAWIDTH_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add chart width here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_CHARTAREAWIDTH_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_CHARTAREAWIDTH_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"site_legendtextstylefontcolor\""; $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_LEGENDTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"text\""; $this->configFieldSets[] = "\t\t\tname=\"site_legendtextstylefontsize\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_LABEL\""; $this->configFieldSets[] = "\t\t\tsize=\"20\""; $this->configFieldSets[] = "\t\t\tmaxlength=\"50\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_LEGENDTEXTSTYLEFONTSIZE_DESC\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_DESC\""; $this->configFieldSets[] = "\t\t\tclass=\"text_area\""; $this->configFieldSets[] = "\t\t\tfilter=\"INT\""; $this->configFieldSets[] = "\t\t\tmessage=\"Error! Please add size of the legend here.\""; - $this->configFieldSets[] = "\t\t\thint=\"".$lang."_LEGENDTEXTSTYLEFONTSIZE_HINT\""; + $this->configFieldSets[] = "\t\t\thint=\"" . $lang . "_LEGENDTEXTSTYLEFONTSIZE_HINT\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"site_vaxistextstylefontcolor\""; $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_VAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_VAXISTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\t\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"site_haxistextstylefontcolor\""; $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_HAXISTEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_HAXISTEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = "\t\t/>\t\t"; - $this->configFieldSets[] = "\t\t"; + $this->configFieldSets[] = "\t\t"; $this->configFieldSets[] = "\t\tconfigFieldSets[] = "\t\t\ttype=\"color\""; $this->configFieldSets[] = "\t\t\tname=\"site_haxistitletextstylefontcolor\""; $this->configFieldSets[] = "\t\t\tdefault=\"#63B1F2\""; - $this->configFieldSets[] = "\t\t\tlabel=\"".$lang."_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; - $this->configFieldSets[] = "\t\t\tdescription=\"".$lang."_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; + $this->configFieldSets[] = "\t\t\tlabel=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL\""; + $this->configFieldSets[] = "\t\t\tdescription=\"" . $lang . "_HAXISTITLETEXTSTYLEFONTCOLOR_DESC\""; $this->configFieldSets[] = "\t\t/>"; - + // add custom Encryption Settings fields if (isset($this->configFieldSetsCustomField['Chart Settings']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Chart Settings'])) { - $this->configFieldSets[] = implode("\t\t",$this->configFieldSetsCustomField['Chart Settings']); + $this->configFieldSets[] = implode("\t\t", $this->configFieldSetsCustomField['Chart Settings']); unset($this->configFieldSetsCustomField['Chart Settings']); } - + $this->configFieldSets[] = "\t"; // set params defaults $this->extensionsParams[] = '"admin_chartbackground":"#F7F7FA","admin_mainwidth":"1000","admin_chartareatop":"20","admin_chartarealeft":"20","admin_chartareawidth":"170","admin_legendtextstylefontcolor":"10","admin_legendtextstylefontsize":"20","admin_vaxistextstylefontcolor":"#63B1F2","admin_haxistextstylefontcolor":"#63B1F2","admin_haxistitletextstylefontcolor":"#63B1F2","site_chartbackground":"#F7F7FA","site_mainwidth":"1000","site_chartareatop":"20","site_chartarealeft":"20","site_chartareawidth":"170","site_legendtextstylefontcolor":"10","site_legendtextstylefontsize":"20","site_vaxistextstylefontcolor":"#63B1F2","site_haxistextstylefontcolor":"#63B1F2","site_haxistitletextstylefontcolor":"#63B1F2"'; // set field lang - $this->langContent[$this->lang][$lang.'_CHART_SETTINGS_LABEL'] = "Chart Settings"; - $this->langContent[$this->lang][$lang.'_CHART_SETTINGS_DESC'] = "The Google Chart Display Settings Are Made Here."; - $this->langContent[$this->lang][$lang.'_ADMIN_CHART_NOTE_LABEL'] = "Admin Settings"; - $this->langContent[$this->lang][$lang.'_ADMIN_CHART_NOTE_DESC'] = "The following settings are used on the back-end of the site called (admin)."; - $this->langContent[$this->lang][$lang.'_SITE_CHART_NOTE_LABEL'] = "Site Settings"; - $this->langContent[$this->lang][$lang.'_SITE_CHART_NOTE_DESC'] = "The following settings are used on the front-end of the site called (site)."; + $this->langContent[$this->lang][$lang . '_CHART_SETTINGS_LABEL'] = "Chart Settings"; + $this->langContent[$this->lang][$lang . '_CHART_SETTINGS_DESC'] = "The Google Chart Display Settings Are Made Here."; + $this->langContent[$this->lang][$lang . '_ADMIN_CHART_NOTE_LABEL'] = "Admin Settings"; + $this->langContent[$this->lang][$lang . '_ADMIN_CHART_NOTE_DESC'] = "The following settings are used on the back-end of the site called (admin)."; + $this->langContent[$this->lang][$lang . '_SITE_CHART_NOTE_LABEL'] = "Site Settings"; + $this->langContent[$this->lang][$lang . '_SITE_CHART_NOTE_DESC'] = "The following settings are used on the front-end of the site called (site)."; - $this->langContent[$this->lang][$lang.'_CHARTAREALEFT_DESC'] = "Set in pixels the spacing from the left of the chart area to the beginning of the chart it self. Please don't add the px sign"; - $this->langContent[$this->lang][$lang.'_CHARTAREALEFT_HINT'] = "170"; - $this->langContent[$this->lang][$lang.'_CHARTAREALEFT_LABEL'] = "Left Spacing"; - $this->langContent[$this->lang][$lang.'_CHARTAREATOP_DESC'] = "Set in pixels the spacing from the top of the chart area to the beginning of the chart it self. Please don't add the px sign"; - $this->langContent[$this->lang][$lang.'_CHARTAREATOP_HINT'] = "20"; - $this->langContent[$this->lang][$lang.'_CHARTAREATOP_LABEL'] = "Top Spacing"; - $this->langContent[$this->lang][$lang.'_CHARTAREAWIDTH_DESC'] = "Set in % the width of the chart it self inside the chart area. Please don't add the % sign"; - $this->langContent[$this->lang][$lang.'_CHARTAREAWIDTH_HINT'] = "60"; - $this->langContent[$this->lang][$lang.'_CHARTAREAWIDTH_LABEL'] = "Chart Width"; - $this->langContent[$this->lang][$lang.'_CHARTBACKGROUND_DESC'] = "Select the chart background color here."; - $this->langContent[$this->lang][$lang.'_CHARTBACKGROUND_LABEL'] = "Chart Background"; - $this->langContent[$this->lang][$lang.'_HAXISTEXTSTYLEFONTCOLOR_DESC'] = "Select the horizontal axis font color."; - $this->langContent[$this->lang][$lang.'_HAXISTEXTSTYLEFONTCOLOR_LABEL'] = "hAxis Font Color"; - $this->langContent[$this->lang][$lang.'_HAXISTITLETEXTSTYLEFONTCOLOR_DESC'] = "Select the horizontal axis title's font color."; - $this->langContent[$this->lang][$lang.'_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL'] = "hAxis Title Font Color"; - $this->langContent[$this->lang][$lang.'_LEGENDTEXTSTYLEFONTCOLOR_DESC'] = "Select the legend font color."; - $this->langContent[$this->lang][$lang.'_LEGENDTEXTSTYLEFONTCOLOR_LABEL'] = "Legend Font Color"; - $this->langContent[$this->lang][$lang.'_LEGENDTEXTSTYLEFONTSIZE_DESC'] = "Set in pixels the font size of the legend"; - $this->langContent[$this->lang][$lang.'_LEGENDTEXTSTYLEFONTSIZE_HINT'] = "10"; - $this->langContent[$this->lang][$lang.'_LEGENDTEXTSTYLEFONTSIZE_LABEL'] = "Legend Font Size"; - $this->langContent[$this->lang][$lang.'_MAINWIDTH_DESC'] = "Set the width of the entire chart area"; - $this->langContent[$this->lang][$lang.'_MAINWIDTH_HINT'] = "1000"; - $this->langContent[$this->lang][$lang.'_MAINWIDTH_LABEL'] = "Chart Area Width"; - $this->langContent[$this->lang][$lang.'_VAXISTEXTSTYLEFONTCOLOR_DESC'] = "Select the vertical axis font color."; - $this->langContent[$this->lang][$lang.'_VAXISTEXTSTYLEFONTCOLOR_LABEL'] = "vAxis Font Color"; + $this->langContent[$this->lang][$lang . '_CHARTAREALEFT_DESC'] = "Set in pixels the spacing from the left of the chart area to the beginning of the chart it self. Please don't add the px sign"; + $this->langContent[$this->lang][$lang . '_CHARTAREALEFT_HINT'] = "170"; + $this->langContent[$this->lang][$lang . '_CHARTAREALEFT_LABEL'] = "Left Spacing"; + $this->langContent[$this->lang][$lang . '_CHARTAREATOP_DESC'] = "Set in pixels the spacing from the top of the chart area to the beginning of the chart it self. Please don't add the px sign"; + $this->langContent[$this->lang][$lang . '_CHARTAREATOP_HINT'] = "20"; + $this->langContent[$this->lang][$lang . '_CHARTAREATOP_LABEL'] = "Top Spacing"; + $this->langContent[$this->lang][$lang . '_CHARTAREAWIDTH_DESC'] = "Set in % the width of the chart it self inside the chart area. Please don't add the % sign"; + $this->langContent[$this->lang][$lang . '_CHARTAREAWIDTH_HINT'] = "60"; + $this->langContent[$this->lang][$lang . '_CHARTAREAWIDTH_LABEL'] = "Chart Width"; + $this->langContent[$this->lang][$lang . '_CHARTBACKGROUND_DESC'] = "Select the chart background color here."; + $this->langContent[$this->lang][$lang . '_CHARTBACKGROUND_LABEL'] = "Chart Background"; + $this->langContent[$this->lang][$lang . '_HAXISTEXTSTYLEFONTCOLOR_DESC'] = "Select the horizontal axis font color."; + $this->langContent[$this->lang][$lang . '_HAXISTEXTSTYLEFONTCOLOR_LABEL'] = "hAxis Font Color"; + $this->langContent[$this->lang][$lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_DESC'] = "Select the horizontal axis title's font color."; + $this->langContent[$this->lang][$lang . '_HAXISTITLETEXTSTYLEFONTCOLOR_LABEL'] = "hAxis Title Font Color"; + $this->langContent[$this->lang][$lang . '_LEGENDTEXTSTYLEFONTCOLOR_DESC'] = "Select the legend font color."; + $this->langContent[$this->lang][$lang . '_LEGENDTEXTSTYLEFONTCOLOR_LABEL'] = "Legend Font Color"; + $this->langContent[$this->lang][$lang . '_LEGENDTEXTSTYLEFONTSIZE_DESC'] = "Set in pixels the font size of the legend"; + $this->langContent[$this->lang][$lang . '_LEGENDTEXTSTYLEFONTSIZE_HINT'] = "10"; + $this->langContent[$this->lang][$lang . '_LEGENDTEXTSTYLEFONTSIZE_LABEL'] = "Legend Font Size"; + $this->langContent[$this->lang][$lang . '_MAINWIDTH_DESC'] = "Set the width of the entire chart area"; + $this->langContent[$this->lang][$lang . '_MAINWIDTH_HINT'] = "1000"; + $this->langContent[$this->lang][$lang . '_MAINWIDTH_LABEL'] = "Chart Area Width"; + $this->langContent[$this->lang][$lang . '_VAXISTEXTSTYLEFONTCOLOR_DESC'] = "Select the vertical axis font color."; + $this->langContent[$this->lang][$lang . '_VAXISTEXTSTYLEFONTCOLOR_LABEL'] = "vAxis Font Color"; } } /** * @param $lang - */ + */ public function setEncryptionConfigFieldsets($lang) { // Add encryption if needed @@ -14226,52 +14203,52 @@ function vdm_dkim() { { // start building field set for encryption functions $this->configFieldSets[] = "\tconfigFieldSets[] = "\t\t".'name="encryption_config"'; - $this->configFieldSets[] = "\t\t".'label="'.$lang.'_ENCRYPTION_LABEL"'; - $this->configFieldSets[] = "\t\t".'description="'.$lang.'_ENCRYPTION_DESC">'; + $this->configFieldSets[] = "\t\t" . 'name="encryption_config"'; + $this->configFieldSets[] = "\t\t" . 'label="' . $lang . '_ENCRYPTION_LABEL"'; + $this->configFieldSets[] = "\t\t" . 'description="' . $lang . '_ENCRYPTION_DESC">'; // set tab lang - $this->langContent[$this->lang][$lang.'_ENCRYPTION_LABEL'] = "Encryption Settings"; - $this->langContent[$this->lang][$lang.'_ENCRYPTION_DESC'] = "The encryption key for the field encryption is set here."; + $this->langContent[$this->lang][$lang . '_ENCRYPTION_LABEL'] = "Encryption Settings"; + $this->langContent[$this->lang][$lang . '_ENCRYPTION_DESC'] = "The encryption key for the field encryption is set here."; if (isset($this->basicEncryption) && $this->basicEncryption) { // set field lang - $this->langContent[$this->lang][$lang.'_BASIC_KEY_LABEL'] = "Basic Key (basic encryption)"; - $this->langContent[$this->lang][$lang.'_BASIC_KEY_DESC'] = "Set the basic local key here."; - $this->langContent[$this->lang][$lang.'_BASIC_KEY_NOTE_LABEL'] = "Basic Encryption"; - $this->langContent[$this->lang][$lang.'_BASIC_KEY_NOTE_DESC'] = "When using the basic encryption please use a 32 character passphrase.
Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!"; + $this->langContent[$this->lang][$lang . '_BASIC_KEY_LABEL'] = "Basic Key (basic encryption)"; + $this->langContent[$this->lang][$lang . '_BASIC_KEY_DESC'] = "Set the basic local key here."; + $this->langContent[$this->lang][$lang . '_BASIC_KEY_NOTE_LABEL'] = "Basic Encryption"; + $this->langContent[$this->lang][$lang . '_BASIC_KEY_NOTE_DESC'] = "When using the basic encryption please use a 32 character passphrase.
Never change this passphrase once it is set! DATA WILL GET CORRUPTED IF YOU DO!"; // set the field - $this->configFieldSets[] = "\t\t".''; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_BASIC_KEY_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_BASIC_KEY_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default=""'; + $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_BASIC_KEY_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_BASIC_KEY_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default=""'; $this->configFieldSets[] = "\t\t/>"; } if (isset($this->advancedEncryption) && $this->advancedEncryption) { // set field lang - $this->langContent[$this->lang][$lang.'_VDM_KEY_LABEL'] = "Advanced Key (advanced encryption)"; - $this->langContent[$this->lang][$lang.'_VDM_KEY_DESC'] = "Add the advanced key here."; - $this->langContent[$this->lang][$lang.'_VDM_KEY_NOTE_LABEL'] = "Advanced Encryption"; - $this->langContent[$this->lang][$lang.'_VDM_KEY_NOTE_DESC'] = "When using the advanced encryption you need to get an advanced key from ".$this->componentData->companyname.".
Never change this advanced key once it is set! DATA WILL GET CORRUPTED IF YOU DO!"; + $this->langContent[$this->lang][$lang . '_VDM_KEY_LABEL'] = "Advanced Key (advanced encryption)"; + $this->langContent[$this->lang][$lang . '_VDM_KEY_DESC'] = "Add the advanced key here."; + $this->langContent[$this->lang][$lang . '_VDM_KEY_NOTE_LABEL'] = "Advanced Encryption"; + $this->langContent[$this->lang][$lang . '_VDM_KEY_NOTE_DESC'] = "When using the advanced encryption you need to get an advanced key from " . $this->componentData->companyname . ".
Never change this advanced key once it is set! DATA WILL GET CORRUPTED IF YOU DO!"; // set the field - $this->configFieldSets[] = "\t\t".''; - $this->configFieldSets[] = "\t\t".'configFieldSets[] = "\t\t\t".'type="text"'; - $this->configFieldSets[] = "\t\t\t".'label="'.$lang.'_VDM_KEY_LABEL"'; - $this->configFieldSets[] = "\t\t\t".'description="'.$lang.'_VDM_KEY_DESC"'; - $this->configFieldSets[] = "\t\t\t".'size="60"'; - $this->configFieldSets[] = "\t\t\t".'default=""'; + $this->configFieldSets[] = "\t\t" . ''; + $this->configFieldSets[] = "\t\t" . 'configFieldSets[] = "\t\t\t" . 'type="text"'; + $this->configFieldSets[] = "\t\t\t" . 'label="' . $lang . '_VDM_KEY_LABEL"'; + $this->configFieldSets[] = "\t\t\t" . 'description="' . $lang . '_VDM_KEY_DESC"'; + $this->configFieldSets[] = "\t\t\t" . 'size="60"'; + $this->configFieldSets[] = "\t\t\t" . 'default=""'; $this->configFieldSets[] = "\t\t/>"; } // add custom Encryption Settings fields if (isset($this->configFieldSetsCustomField['Encryption Settings']) && ComponentbuilderHelper::checkArray($this->configFieldSetsCustomField['Encryption Settings'])) { - $this->configFieldSets[] = implode("\t\t",$this->configFieldSetsCustomField['Encryption Settings']); + $this->configFieldSets[] = implode("\t\t", $this->configFieldSetsCustomField['Encryption Settings']); unset($this->configFieldSetsCustomField['Encryption Settings']); } // close that fieldset @@ -14288,13 +14265,13 @@ function vdm_dkim() { $otherViews = $this->catCodeBuilder[$viewName_single]['views']; if ($otherViews == $viewName_list) { - $component .= PHP_EOL."\t".'
'; - $component .= PHP_EOL."\t\t".''; - $component .= PHP_EOL."\t\t".''; - $component .= PHP_EOL."\t\t".''; - $component .= PHP_EOL."\t\t".''; - $component .= PHP_EOL."\t\t".''; - $component .= PHP_EOL."\t
"; + $component .= PHP_EOL . "\t" . '
'; + $component .= PHP_EOL . "\t\t" . ''; + $component .= PHP_EOL . "\t\t" . ''; + $component .= PHP_EOL . "\t\t" . ''; + $component .= PHP_EOL . "\t\t" . ''; + $component .= PHP_EOL . "\t\t" . ''; + $component .= PHP_EOL . "\t
"; } } return $component; @@ -14303,79 +14280,79 @@ function vdm_dkim() { public function setAccessSections() { // set the default component access values - $this->componentHead = array(); - $this->componentGlobal = array(); - $this->permissionViews = array(); - + $this->componentHead = array(); + $this->componentGlobal = array(); + $this->permissionViews = array(); + $this->componentHead[] = '
'; - $this->componentHead[] = "\t\t".''; - $this->componentHead[] = "\t\t".''; - $this->componentHead[] = "\t\t".''; + $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = "\t\t" . ''; if ($this->addEximport) { - $exportTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Export Data','U'); - $exportDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Export Data','U').'_DESC'; - $this->langContent['bothadmin'][$exportTitle] = 'Export Data'; - $this->langContent['bothadmin'][$exportDesc] = ' Allows users in this group to export data.'; - $this->componentHead[] = "\t\t".''; + $exportTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Export Data', 'U'); + $exportDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Export Data', 'U') . '_DESC'; + $this->langContent['bothadmin'][$exportTitle] = 'Export Data'; + $this->langContent['bothadmin'][$exportDesc] = ' Allows users in this group to export data.'; + $this->componentHead[] = "\t\t" . ''; - $importTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Import Data','U'); - $importDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Import Data','U').'_DESC'; - $this->langContent['bothadmin'][$importTitle] = 'Import Data'; - $this->langContent['bothadmin'][$importDesc] = ' Allows users in this group to import data.'; - $this->componentHead[] = "\t\t".''; + $importTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Import Data', 'U'); + $importDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Import Data', 'U') . '_DESC'; + $this->langContent['bothadmin'][$importTitle] = 'Import Data'; + $this->langContent['bothadmin'][$importDesc] = ' Allows users in this group to import data.'; + $this->componentHead[] = "\t\t" . ''; } // version permission - $batchTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Use Batch','U'); - $batchDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Use Batch','U').'_DESC'; - $this->langContent['bothadmin'][$batchTitle] = 'Use Batch'; - $this->langContent['bothadmin'][$batchDesc] = ' Allows users in this group to use batch copy/update method.'; - $this->componentHead[] = "\t\t".''; + $batchTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Use Batch', 'U'); + $batchDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Use Batch', 'U') . '_DESC'; + $this->langContent['bothadmin'][$batchTitle] = 'Use Batch'; + $this->langContent['bothadmin'][$batchDesc] = ' Allows users in this group to use batch copy/update method.'; + $this->componentHead[] = "\t\t" . ''; // version permission - $importTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Edit Versions','U'); - $importDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Edit Versions','U').'_DESC'; - $this->langContent['bothadmin'][$importTitle] = 'Edit Version'; - $this->langContent['bothadmin'][$importDesc] = ' Allows users in this group to edit versions.'; - $this->componentHead[] = "\t\t".''; + $importTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Versions', 'U'); + $importDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Versions', 'U') . '_DESC'; + $this->langContent['bothadmin'][$importTitle] = 'Edit Version'; + $this->langContent['bothadmin'][$importDesc] = ' Allows users in this group to edit versions.'; + $this->componentHead[] = "\t\t" . ''; // set the defaults - $this->componentHead[] = "\t\t".''; - $this->componentHead[] = "\t\t".''; - $this->componentHead[] = "\t\t".''; - $this->componentHead[] = "\t\t".''; - $this->componentHead[] = "\t\t".''; + $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = "\t\t" . ''; + $this->componentHead[] = "\t\t" . ''; // new custom created by permissions - $created_byTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Edit Created By','U'); - $created_byDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Edit Created By','U').'_DESC'; - $this->langContent['bothadmin'][$created_byTitle] = 'Edit Created By'; - $this->langContent['bothadmin'][$created_byDesc] = ' Allows users in this group to edit created by.'; - $this->componentHead[] = "\t\t".''; + $created_byTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created By', 'U'); + $created_byDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created By', 'U') . '_DESC'; + $this->langContent['bothadmin'][$created_byTitle] = 'Edit Created By'; + $this->langContent['bothadmin'][$created_byDesc] = ' Allows users in this group to edit created by.'; + $this->componentHead[] = "\t\t" . ''; // new custom created date permissions - $createdTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Edit Created Date','U'); - $createdDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString('Edit Created Date','U').'_DESC'; - $this->langContent['bothadmin'][$createdTitle] = 'Edit Created Date'; - $this->langContent['bothadmin'][$createdDesc] = ' Allows users in this group to edit created date.'; - $this->componentHead[] = "\t\t".''; - + $createdTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created Date', 'U'); + $createdDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString('Edit Created Date', 'U') . '_DESC'; + $this->langContent['bothadmin'][$createdTitle] = 'Edit Created Date'; + $this->langContent['bothadmin'][$createdDesc] = ' Allows users in this group to edit created date.'; + $this->componentHead[] = "\t\t" . ''; + // set the menu controller lookup - $menuControllers = array('access','submenu','dashboard_list','dashboard_add'); - // set the custom admin views permissions + $menuControllers = array('access', 'submenu', 'dashboard_list', 'dashboard_add'); + // set the custom admin views permissions if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) { - foreach ($this->componentData->custom_admin_views as $custom_admin_view) + foreach ($this->componentData->custom_admin_views as $custom_admin_view) { - // new custom permissions to access this view - $customAdminName = $custom_admin_view['settings']->name; - $customAdminCode = $custom_admin_view['settings']->code; - $customAdminTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($customAdminName.' Access','U'); - $customAdminDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($customAdminName.' Access','U').'_DESC'; - $sortKey = ComponentbuilderHelper::safeString($customAdminName.' Access'); - $this->langContent['bothadmin'][$customAdminTitle] = $customAdminName.' Access'; - $this->langContent['bothadmin'][$customAdminDesc] = ' Allows the users in this group to access '.ComponentbuilderHelper::safeString($customAdminName,'w').'.'; - $this->componentGlobal[$sortKey] = "\t\t".''; - // add the custom permissions to use the buttons of this view - $this->addCustomButtonPermissions($custom_admin_view['settings'], $customAdminName, $customAdminCode); + // new custom permissions to access this view + $customAdminName = $custom_admin_view['settings']->name; + $customAdminCode = $custom_admin_view['settings']->code; + $customAdminTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($customAdminName . ' Access', 'U'); + $customAdminDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($customAdminName . ' Access', 'U') . '_DESC'; + $sortKey = ComponentbuilderHelper::safeString($customAdminName . ' Access'); + $this->langContent['bothadmin'][$customAdminTitle] = $customAdminName . ' Access'; + $this->langContent['bothadmin'][$customAdminDesc] = ' Allows the users in this group to access ' . ComponentbuilderHelper::safeString($customAdminName, 'w') . '.'; + $this->componentGlobal[$sortKey] = "\t\t" . ''; + // add the custom permissions to use the buttons of this view + $this->addCustomButtonPermissions($custom_admin_view['settings'], $customAdminName, $customAdminCode); // add menu controll view that has menus options - foreach ($menuControllers as $menuController) + foreach ($menuControllers as $menuController) { // add menu controll view that has menus options if (isset($custom_admin_view[$menuController]) && $custom_admin_view[$menuController]) @@ -14386,11 +14363,11 @@ function vdm_dkim() { $targetView_ = 'view.'; } // menucontroller - $menucontrollerView['action'] = $targetView_.$menuController; + $menucontrollerView['action'] = $targetView_ . $menuController; $menucontrollerView['implementation'] = '2'; if (isset($custom_admin_view['settings']->permissions) && ComponentbuilderHelper::checkArray($custom_admin_view['settings']->permissions)) { - array_push($custom_admin_view['settings']->permissions,$menucontrollerView); + array_push($custom_admin_view['settings']->permissions, $menucontrollerView); } else { @@ -14401,36 +14378,36 @@ function vdm_dkim() { } } $this->buildPermissions($custom_admin_view, $customAdminCode, $customAdminCode, $menuControllers, 'customAdmin'); - } - } + } + } // set the site views permissions if (isset($this->componentData->site_views) && ComponentbuilderHelper::checkArray($this->componentData->site_views)) { - foreach ($this->componentData->site_views as $site_view) + foreach ($this->componentData->site_views as $site_view) { - // new custom permissions to access this view - $siteName = $site_view['settings']->name; - $siteCode = $site_view['settings']->code; - $siteTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($siteName.' Access Site','U'); - $siteDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($siteName.' Access Site','U').'_DESC'; - $sortKey = ComponentbuilderHelper::safeString($siteName.' Access Site'); + // new custom permissions to access this view + $siteName = $site_view['settings']->name; + $siteCode = $site_view['settings']->code; + $siteTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($siteName . ' Access Site', 'U'); + $siteDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($siteName . ' Access Site', 'U') . '_DESC'; + $sortKey = ComponentbuilderHelper::safeString($siteName . ' Access Site'); if (isset($site_view['access']) && $site_view['access'] == 1) { - $this->langContent['bothadmin'][$siteTitle] = $siteName.' (Site) Access'; - $this->langContent['bothadmin'][$siteDesc] = ' Allows the users in this group to access site '.ComponentbuilderHelper::safeString($siteName,'w').'.'; - $this->componentGlobal[$sortKey] = "\t\t".''; - + $this->langContent['bothadmin'][$siteTitle] = $siteName . ' (Site) Access'; + $this->langContent['bothadmin'][$siteDesc] = ' Allows the users in this group to access site ' . ComponentbuilderHelper::safeString($siteName, 'w') . '.'; + $this->componentGlobal[$sortKey] = "\t\t" . ''; + // check if this site view requires access rule to default to public if (isset($site_view['public']) && $site_view['public'] == 1) { // we use one as public group (TODO we see if we run into any issues) - $this->assetsRules[] = '"site.'.$siteCode.'.access":{"1":1}'; + $this->assetsRules[] = '"site.' . $siteCode . '.access":{"1":1}'; } } // add the custom permissions to use the buttons of this view $this->addCustomButtonPermissions($site_view['settings'], $siteName, $siteCode); - } - } + } + } if (isset($this->componentData->admin_views) && ComponentbuilderHelper::checkArray($this->componentData->admin_views)) { foreach ($this->componentData->admin_views as $view) @@ -14438,13 +14415,13 @@ function vdm_dkim() { // set view name $nameView = ComponentbuilderHelper::safeString($view['settings']->name_single); $nameViews = ComponentbuilderHelper::safeString($view['settings']->name_list); - // add the custom permissions to use the buttons of this view - $this->addCustomButtonPermissions($view['settings'], $view['settings']->name_single, $nameView); + // add the custom permissions to use the buttons of this view + $this->addCustomButtonPermissions($view['settings'], $view['settings']->name_single, $nameView); if ($nameView != 'component') { // add menu controll view that has menus options - foreach ($menuControllers as $menuController) + foreach ($menuControllers as $menuController) { // add menu controll view that has menus options if (isset($view[$menuController]) && $view[$menuController]) @@ -14455,11 +14432,11 @@ function vdm_dkim() { $targetView_ = 'view.'; } // menucontroller - $menucontrollerView['action'] = $targetView_.$menuController; + $menucontrollerView['action'] = $targetView_ . $menuController; $menucontrollerView['implementation'] = '2'; if (isset($view['settings']->permissions) && ComponentbuilderHelper::checkArray($view['settings']->permissions)) { - array_push($view['settings']->permissions,$menucontrollerView); + array_push($view['settings']->permissions, $menucontrollerView); } else { @@ -14473,7 +14450,7 @@ function vdm_dkim() { if (ComponentbuilderHelper::checkArray($view['settings']->fields)) { // check the fields for their permission settings - foreach($view['settings']->fields as $field) + foreach ($view['settings']->fields as $field) { // see if field require permissions to be set if (isset($field['permission']) && $field['permission']) @@ -14487,15 +14464,15 @@ function vdm_dkim() { $propertyType = $property; } } - $fieldType = $this->getFieldType($field['settings']->type_name,$field['settings']->xml,$propertyType); - $fieldName = $this->getFieldName($fieldType,$field['settings']->xml,$field['alias']); + $fieldType = $this->getFieldType($field['settings']->type_name, $field['settings']->xml, $propertyType); + $fieldName = $this->getFieldName($fieldType, $field['settings']->xml, $field['alias']); $fieldView = array(); // set the permission for this field - $fieldView['action'] = 'view.edit.'.$fieldName; + $fieldView['action'] = 'view.edit.' . $fieldName; $fieldView['implementation'] = '3'; if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) { - array_push($view['settings']->permissions,$fieldView); + array_push($view['settings']->permissions, $fieldView); } else { @@ -14520,51 +14497,51 @@ function vdm_dkim() { { foreach ($this->permissionViews as $viewName => $actions) { - $componentViews[] = "\t".'
'; + $componentViews[] = "\t" . '
'; foreach ($actions as $action) { - $componentViews[] = "\t\t".$action; + $componentViews[] = "\t\t" . $action; } $componentViews[] = "\t
"; } } /// now build the section - $component = implode(PHP_EOL,$this->componentHead); + $component = implode(PHP_EOL, $this->componentHead); // sort the array to insure easy search - ksort($this->componentGlobal,SORT_STRING); + ksort($this->componentGlobal, SORT_STRING); // add global to the compnent section - $component .= PHP_EOL.implode(PHP_EOL,$this->componentGlobal).PHP_EOL."\t
"; + $component .= PHP_EOL . implode(PHP_EOL, $this->componentGlobal) . PHP_EOL . "\t
"; // add views to the compnent section - $component .= PHP_EOL.implode(PHP_EOL,$componentViews); + $component .= PHP_EOL . implode(PHP_EOL, $componentViews); // be sure to reset again. (memory) - $this->componentHead = null; - $this->componentGlobal = null; - $this->permissionViews = null; + $this->componentHead = null; + $this->componentGlobal = null; + $this->permissionViews = null; // return the build return $component; } return false; } - - protected function addCustomButtonPermissions($settings, $nameView, $code) - { - // add the custom permissions to use the buttons of this view + + protected function addCustomButtonPermissions($settings, $nameView, $code) + { + // add the custom permissions to use the buttons of this view if (isset($settings->custom_buttons) && ComponentbuilderHelper::checkArray($settings->custom_buttons)) { foreach ($settings->custom_buttons as $custom_buttons) { - $customButtonName = $custom_buttons['name']; - $customButtonCode = ComponentbuilderHelper::safeString($customButtonName); - $customButtonTitle = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($nameView.' '.$customButtonName.' Button Access','U'); - $customButtonDesc = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($nameView.' '.$customButtonName.' Button Access','U').'_DESC'; - $sortButtonKey = ComponentbuilderHelper::safeString($nameView.' '.$customButtonName.' Button Access'); - $this->langContent['bothadmin'][$customButtonTitle] = $nameView.' '.$customButtonName.' Button Access'; - $this->langContent['bothadmin'][$customButtonDesc] = ' Allows the users in this group to access the '.ComponentbuilderHelper::safeString($customButtonName,'w').' button.'; - $this->componentGlobal[$sortButtonKey] = "\t\t".''; + $customButtonName = $custom_buttons['name']; + $customButtonCode = ComponentbuilderHelper::safeString($customButtonName); + $customButtonTitle = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($nameView . ' ' . $customButtonName . ' Button Access', 'U'); + $customButtonDesc = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($nameView . ' ' . $customButtonName . ' Button Access', 'U') . '_DESC'; + $sortButtonKey = ComponentbuilderHelper::safeString($nameView . ' ' . $customButtonName . ' Button Access'); + $this->langContent['bothadmin'][$customButtonTitle] = $nameView . ' ' . $customButtonName . ' Button Access'; + $this->langContent['bothadmin'][$customButtonDesc] = ' Allows the users in this group to access the ' . ComponentbuilderHelper::safeString($customButtonName, 'w') . ' button.'; + $this->componentGlobal[$sortButtonKey] = "\t\t" . ''; } } - } - + } + public function buildPermissions(&$view, $nameView, $nameViews, $menuControllers, $type = 'admin') { if (isset($view['settings']->permissions) && ComponentbuilderHelper::checkArray($view['settings']->permissions) || (isset($view['port']) && $view['port']) || (isset($view['history']) && $view['history'])) @@ -14577,7 +14554,7 @@ function vdm_dkim() { $exportView['implementation'] = '2'; if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) { - array_push($view['settings']->permissions,$exportView); + array_push($view['settings']->permissions, $exportView); } else { @@ -14589,7 +14566,7 @@ function vdm_dkim() { $importView['implementation'] = '2'; if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) { - array_push($view['settings']->permissions,$importView); + array_push($view['settings']->permissions, $importView); } else { @@ -14605,7 +14582,7 @@ function vdm_dkim() { $versionView['implementation'] = '3'; if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) { - array_push($view['settings']->permissions,$versionView); + array_push($view['settings']->permissions, $versionView); } else { @@ -14620,7 +14597,7 @@ function vdm_dkim() { $batchView['implementation'] = '2'; if (ComponentbuilderHelper::checkArray($view['settings']->permissions)) { - array_push($view['settings']->permissions,$batchView); + array_push($view['settings']->permissions, $batchView); } else { @@ -14631,12 +14608,12 @@ function vdm_dkim() { foreach ($view['settings']->permissions as $permission) { // set acction name - $arr = explode('.',trim($permission['action'])); + $arr = explode('.', trim($permission['action'])); if ($arr[0] != 'core' || $arr[0] === 'view') { array_shift($arr); - $actionMain = implode('.',$arr); - $action = $nameView.'.'.$actionMain; + $actionMain = implode('.', $arr); + $action = $nameView . '.' . $actionMain; } else { @@ -14648,124 +14625,124 @@ function vdm_dkim() { $action = $permission['action']; } // build action name - $actionNameBuilder = explode('.',trim($permission['action'])); + $actionNameBuilder = explode('.', trim($permission['action'])); array_shift($actionNameBuilder); - $nameBuilder = trim(implode('___',$actionNameBuilder)); - $customName = trim(implode(' ',$actionNameBuilder)); + $nameBuilder = trim(implode('___', $actionNameBuilder)); + $customName = trim(implode(' ', $actionNameBuilder)); if ($type === 'admin') { $W_NameList = ComponentbuilderHelper::safeString($view['settings']->name_list, 'W'); - $w_NameList = ComponentbuilderHelper::safeString($customName.' '.$view['settings']->name_list, 'w'); + $w_NameList = ComponentbuilderHelper::safeString($customName . ' ' . $view['settings']->name_list, 'w'); $w_NameSingle = ComponentbuilderHelper::safeString($view['settings']->name_single, 'w'); } elseif ($type === 'customAdmin') { $W_NameList = ComponentbuilderHelper::safeString($view['settings']->name, 'W'); - $w_NameList = $view['settings']->name; + $w_NameList = $view['settings']->name; $w_NameSingle = $view['settings']->name; } switch ($nameBuilder) { case 'edit': - // set edit title - $permission['title'] = $W_NameList . ' Edit'; - // set edit description - $permission['description'] = ' Allows the users in this group to edit the ' . $w_NameSingle; - break; + // set edit title + $permission['title'] = $W_NameList . ' Edit'; + // set edit description + $permission['description'] = ' Allows the users in this group to edit the ' . $w_NameSingle; + break; case 'edit___own': - // set edit title - $permission['title'] = $W_NameList . ' Edit Own'; - // set edit description - $permission['description'] = ' Allows the users in this group to edit ' . $w_NameList . ' created by them'; - break; + // set edit title + $permission['title'] = $W_NameList . ' Edit Own'; + // set edit description + $permission['description'] = ' Allows the users in this group to edit ' . $w_NameList . ' created by them'; + break; case 'edit___state': - // set edit title - $permission['title'] = $W_NameList . ' Edit State'; - // set edit description - $permission['description'] = ' Allows the users in this group to update the state of the ' . $w_NameSingle; - break; + // set edit title + $permission['title'] = $W_NameList . ' Edit State'; + // set edit description + $permission['description'] = ' Allows the users in this group to update the state of the ' . $w_NameSingle; + break; case 'edit___created_by': - // set edit title - $permission['title'] = $W_NameList . ' Edit Created By'; - // set edit description - $permission['description'] = ' Allows the users in this group to update the created by of the ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Edit Created By'; + // set edit description + $permission['description'] = ' Allows the users in this group to update the created by of the ' . $w_NameList; + break; case 'edit___created': - // set edit title - $permission['title'] = $W_NameList . ' Edit Created Date'; - // set edit description - $permission['description'] = ' Allows the users in this group to update the created date of the ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Edit Created Date'; + // set edit description + $permission['description'] = ' Allows the users in this group to update the created date of the ' . $w_NameList; + break; case 'create': - // set edit title - $permission['title'] = $W_NameList . ' Create'; - // set edit description - $permission['description'] = ' Allows the users in this group to create ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Create'; + // set edit description + $permission['description'] = ' Allows the users in this group to create ' . $w_NameList; + break; case 'delete': - // set edit title - $permission['title'] = $W_NameList . ' Delete'; - // set edit description - $permission['description'] = ' Allows the users in this group to delete ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Delete'; + // set edit description + $permission['description'] = ' Allows the users in this group to delete ' . $w_NameList; + break; case 'access': - // set edit title - $permission['title'] = $W_NameList . ' Access'; - // set edit description - $permission['description'] = ' Allows the users in this group to access ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Access'; + // set edit description + $permission['description'] = ' Allows the users in this group to access ' . $w_NameList; + break; case 'export': - // set edit title - $permission['title'] = $W_NameList . ' Export'; - // set edit description - $permission['description'] = ' Allows the users in this group to export ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Export'; + // set edit description + $permission['description'] = ' Allows the users in this group to export ' . $w_NameList; + break; case 'import': - // set edit title - $permission['title'] = $W_NameList . ' Import'; - // set edit description - $permission['description'] = ' Allows the users in this group to import ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Import'; + // set edit description + $permission['description'] = ' Allows the users in this group to import ' . $w_NameList; + break; case 'version': - // set edit title - $permission['title'] = $W_NameList . ' Edit Version'; - // set edit description - $permission['description'] = ' Allows users in this group to edit versions of ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Edit Version'; + // set edit description + $permission['description'] = ' Allows users in this group to edit versions of ' . $w_NameList; + break; case 'batch': - // set edit title - $permission['title'] = $W_NameList . ' Batch Use'; - // set edit description - $permission['description'] = ' Allows users in this group to use batch copy/update method of ' . $w_NameList; - break; + // set edit title + $permission['title'] = $W_NameList . ' Batch Use'; + // set edit description + $permission['description'] = ' Allows users in this group to use batch copy/update method of ' . $w_NameList; + break; default: - // set edit title - $permission['title'] = $W_NameList . ' ' . ComponentbuilderHelper::safeString($customName, 'W'); - // set edit description - $permission['description'] = ' Allows the users in this group to update the ' . ComponentbuilderHelper::safeString($customName, 'w') . ' of the ' . $w_NameSingle; - break; + // set edit title + $permission['title'] = $W_NameList . ' ' . ComponentbuilderHelper::safeString($customName, 'W'); + // set edit description + $permission['description'] = ' Allows the users in this group to update the ' . ComponentbuilderHelper::safeString($customName, 'w') . ' of the ' . $w_NameSingle; + break; } // if core is not used update all core strings - $coreCheck = explode('.',$action); + $coreCheck = explode('.', $action); $coreCheck[0] = 'core'; - $coreTarget = implode('.',$coreCheck); + $coreTarget = implode('.', $coreCheck); $this->permissionCore[$nameView][$coreTarget] = $action; // set array sort name $sortKey = ComponentbuilderHelper::safeString($permission['title']); // set title - $title = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($permission['title'],'U'); + $title = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($permission['title'], 'U'); // load the actions if ($permission['implementation'] == 1) { // only related to view - $this->permissionViews[$nameView][] = ''; + $this->permissionViews[$nameView][] = ''; // load permission to action $this->permissionBuilder[$action][$nameView] = $nameView; } elseif ($permission['implementation'] == 2) { // relation to whole component - $this->componentGlobal[$sortKey] = "\t\t".''; + $this->componentGlobal[$sortKey] = "\t\t" . ''; // build permission switch $this->permissionBuilder['global'][$action][$nameView] = $nameView; // dashboard icon checker @@ -14779,17 +14756,17 @@ function vdm_dkim() { $this->permissionDashboard[] = "'" . $nameView . ".create' => '" . $action . "'"; } // add menu controll view that has menus options - foreach ($menuControllers as $menuController) + foreach ($menuControllers as $menuController) { - if ($coreTarget === 'core.'.$menuController) + if ($coreTarget === 'core.' . $menuController) { if ($menuController === 'dashboard_add') { - $this->permissionDashboard[] = "'" . $nameView . ".".$menuController."' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameView . "." . $menuController . "' => '" . $action . "'"; } else { - $this->permissionDashboard[] = "'" . $nameViews . ".".$menuController."' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameViews . "." . $menuController . "' => '" . $action . "'"; } } } @@ -14797,11 +14774,11 @@ function vdm_dkim() { elseif ($permission['implementation'] == 3) { // only related to view - $this->permissionViews[$nameView][] = ''; + $this->permissionViews[$nameView][] = ''; // load permission to action $this->permissionBuilder[$action][$nameView] = $nameView; // relation to whole component - $this->componentGlobal[$sortKey] = "\t\t".''; + $this->componentGlobal[$sortKey] = "\t\t" . ''; // build permission switch $this->permissionBuilder['global'][$action][$nameView] = $nameView; // dashboard icon checker @@ -14815,35 +14792,34 @@ function vdm_dkim() { $this->permissionDashboard[] = "'" . $nameView . ".create' => '" . $action . "'"; } // add menu controll view that has menus options - foreach ($menuControllers as $menuController) + foreach ($menuControllers as $menuController) { - if ($coreTarget === 'core.'.$menuController) + if ($coreTarget === 'core.' . $menuController) { if ($menuController === 'dashboard_add') { - $this->permissionDashboard[] = "'" . $nameView . ".".$menuController."' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameView . "." . $menuController . "' => '" . $action . "'"; } else { - $this->permissionDashboard[] = "'" . $nameViews . ".".$menuController."' => '" . $action . "'"; + $this->permissionDashboard[] = "'" . $nameViews . "." . $menuController . "' => '" . $action . "'"; } } } } // set to language file - $this->langContent['bothadmin'][$title] = trim($permission['title']); - $this->langContent['bothadmin'][$title.'_DESC'] = trim($permission['description']); + $this->langContent['bothadmin'][$title] = trim($permission['title']); + $this->langContent['bothadmin'][$title . '_DESC'] = trim($permission['description']); } } } - public function getFieldName($typeName,$xml,$alias) + public function getFieldName($typeName, $xml, $alias) { // if category then name must be catid (only one per view) if ($typeName === 'category') { return 'catid'; - } // if tag is set then enable all tag options for this view (only one per view) elseif ($typeName === 'tag') @@ -14862,18 +14838,18 @@ function vdm_dkim() { } else { - return ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml,'name="','"')); + return ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml, 'name="', '"')); } } - public function getFieldType($typeName,$xml,$property) + public function getFieldType($typeName, $xml, $property) { // make sure its lower case $typeName = ComponentbuilderHelper::safeString($typeName); if ($typeName === 'custom' || $typeName === 'customuser') { - $xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml,'type="','"')); + $xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml, 'type="', '"')); } // use field core type only if not found elseif (ComponentbuilderHelper::checkString($typeName)) @@ -14888,7 +14864,7 @@ function vdm_dkim() { // fall back on the xml settings else { - $xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml,'type="','"')); + $xmlValue = ComponentbuilderHelper::safeString(ComponentbuilderHelper::getBetween($xml, 'type="', '"')); } // check if the value is set @@ -14911,4 +14887,5 @@ function vdm_dkim() { preg_match_all($regex, $str, $matches); return $matches[1]; } + } diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index eea174690..0e31f77aa 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -1,27 +1,28 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| + /-------------------------------------------------------------------------------------------------------------------------------/ + + @version 2.6.x + @created 30th April, 2015 + @package Component Builder + @subpackage compiler.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + + /----------------------------------------------------------------------------------------------------------------------------- */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); @@ -42,7 +43,7 @@ class Infusion extends Interpretation /** * Constructor */ - public function __construct($config = array ()) + public function __construct($config = array()) { // first we run the perent constructor if (parent::__construct($config)) @@ -52,7 +53,7 @@ class Infusion extends Interpretation } return false; } - + /** * Set the line number in comments * @@ -65,11 +66,11 @@ class Infusion extends Interpretation { if ($this->debugLinenr) { - return ' [Infusion '.$nr.']'; + return ' [Infusion ' . $nr . ']'; } return ''; } - + /** * Build the content for the structure * @@ -92,15 +93,15 @@ class Infusion extends Interpretation // ###COMPANYNAME### $this->fileContentStatic['###COMPANYNAME###'] = trim(JFilterOutput::cleanText($this->componentData->companyname)); - + // ###CREATIONDATE### $this->fileContentStatic['###CREATIONDATE###'] = JFactory::getDate($this->componentData->created)->format('jS F, Y'); $this->fileContentStatic['###CREATIONDATE###GLOBAL'] = $this->fileContentStatic['###CREATIONDATE###']; - + // ###BUILDDATE### $this->fileContentStatic['###BUILDDATE###'] = JFactory::getDate()->format('jS F, Y'); $this->fileContentStatic['###BUILDDATE###GLOBAL'] = $this->fileContentStatic['###BUILDDATE###']; - + // ###AUTHOR### $this->fileContentStatic['###AUTHOR###'] = trim(JFilterOutput::cleanText($this->componentData->author)); @@ -120,12 +121,12 @@ class Infusion extends Interpretation $this->fileContentStatic['###VERSION###'] = trim($this->componentData->component_version); // set the actual global version $this->fileContentStatic['###ACTUALVERSION###'] = $this->fileContentStatic['###VERSION###']; - + // do some Tweaks to the version based on selected options if (strpos($this->fileContentStatic['###VERSION###'], '.') !== false) { $versionArray = explode('.', $this->fileContentStatic['###VERSION###']); - } + } // load only first two values if (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 2) { @@ -134,10 +135,10 @@ class Infusion extends Interpretation // load only the first value elseif (isset($versionArray) && ComponentbuilderHelper::checkArray($versionArray) && $this->componentData->mvc_versiondate == 3) { - $this->fileContentStatic['###VERSION###'] = $versionArray[0]. '.x.x'; + $this->fileContentStatic['###VERSION###'] = $versionArray[0] . '.x.x'; } unset($versionArray); - + // set the global version in case $this->fileContentStatic['###VERSION###GLOBAL'] = $this->fileContentStatic['###VERSION###']; @@ -155,68 +156,64 @@ class Infusion extends Interpretation // ###ACCESS_SECTIONS### $this->fileContentStatic['###ACCESS_SECTIONS###'] = $this->setAccessSections(); - + // ###CONFIG_FIELDSETS### $keepLang = $this->lang; $this->lang = 'admin'; - + // start loading the category tree scripts - $this->fileContentStatic['###CATEGORY_CLASS_TREES###'] = ''; + $this->fileContentStatic['###CATEGORY_CLASS_TREES###'] = ''; // run the field sets for first time $this->setConfigFieldsets(1); $this->lang = $keepLang; - + // ###ADMINJS### $this->fileContentStatic['###ADMINJS###'] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders); // ###SITEJS### $this->fileContentStatic['###SITEJS###'] = $this->setPlaceholders($this->customScriptBuilder['component_js'], $this->placeholders); - + // ###ADMINCSS### $this->fileContentStatic['###ADMINCSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css'], $this->placeholders); // ###SITECSS### $this->fileContentStatic['###SITECSS###'] = $this->setPlaceholders($this->customScriptBuilder['component_css'], $this->placeholders); // ###CUSTOM_HELPER_SCRIPT### - $this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] - = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders); - + $this->fileContentStatic['###CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_admin'], $this->placeholders); + // ###BOTH_CUSTOM_HELPER_SCRIPT### - $this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] - = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders); - + $this->fileContentStatic['###BOTH_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_both'], $this->placeholders); + // ###ADMIN_GLOBAL_EVENT_HELPER### $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = ''; - + // ###ADMIN_GLOBAL_EVENT### $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = ''; - + // set incase no extra admin files are loaded $this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] = ''; - + // now load the data for the global event if needed if ($this->componentData->add_admin_event == 1) { // ###ADMIN_GLOBAL_EVENT### - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = PHP_EOL.PHP_EOL.'// Triger the Global Admin Event'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] - .= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] = PHP_EOL . PHP_EOL . '// Triger the Global Admin Event'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT###'] .= PHP_EOL . $this->fileContentStatic['###Component###'] . 'Helper::globalEvent($document);'; // ###ADMIN_GLOBAL_EVENT_HELPER### - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = PHP_EOL.PHP_EOL."\t".'/**'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'* The Global Admin Event Method.'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'public static function globalEvent($document)'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{'; - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] - .= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders); - $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] = PHP_EOL . PHP_EOL . "\t" . '/**'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '* The Global Admin Event Method.'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '**/'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . 'public static function globalEvent($document)'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '{'; + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_admin_event'], $this->placeholders); + $this->fileContentStatic['###ADMIN_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '}'; } - + // now load the readme file if needed if ($this->componentData->addreadme == 1) { - $this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] .= PHP_EOL."\t\t\tREADME.txt"; + $this->fileContentStatic['###EXSTRA_ADMIN_FILES###'] .= PHP_EOL . "\t\t\tREADME.txt"; } - + // ###HELPER_CREATEUSER### $this->fileContentStatic['###HELPER_CREATEUSER###'] = $this->setCreateUserHelperMethod($this->componentData->creatuserhelper); @@ -229,699 +226,638 @@ class Infusion extends Interpretation $this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] = ''; // build route views $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = ''; - + // add the helper emailer if set $this->fileContentStatic['###HELPER_EMAIL###'] = $this->addEmailHelper(); // reset view array - $viewarray = array(); - $site_edit_view_array = array(); - // start dynamic build - foreach ($this->componentData->admin_views as $view) - { + $viewarray = array(); + $site_edit_view_array = array(); + // start dynamic build + foreach ($this->componentData->admin_views as $view) + { // just to be safe, lets clear the view placeholders $this->clearFromPlaceHolders('view'); // set the target - $this->target = 'admin'; - $this->lang = 'admin'; - // set main keys - $viewName_single = ComponentbuilderHelper::safeString($view['settings']->name_single); - $viewName_list = ComponentbuilderHelper::safeString($view['settings']->name_list); - // set site edit view array - if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) - { - $site_edit_view_array[] = "\t\t\t\t'".$viewName_single."'"; - $this->lang = 'both'; - } - // check if help is being loaded - $this->checkHelp($viewName_single); - // set custom admin view list links - $this->setCustomAdminViewListLink($view,$viewName_list); + $this->target = 'admin'; + $this->lang = 'admin'; + // set main keys + $viewName_single = ComponentbuilderHelper::safeString($view['settings']->name_single); + $viewName_list = ComponentbuilderHelper::safeString($view['settings']->name_list); + // set site edit view array + if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) + { + $site_edit_view_array[] = "\t\t\t\t'" . $viewName_single . "'"; + $this->lang = 'both'; + } + // check if help is being loaded + $this->checkHelp($viewName_single); + // set custom admin view list links + $this->setCustomAdminViewListLink($view, $viewName_list); - // set view array - $viewarray[] = "\t\t\t\t'".$viewName_single."' => '".$viewName_list."'"; - // set the view names - if ($view['settings']->name_single != 'null') - { - // ###VIEW### <<>> - $viewName_u = ComponentbuilderHelper::safeString($view['settings']->name_single,'U'); - $this->fileContentDynamic[$viewName_single]['###VIEW###'] = $viewName_u; - $this->fileContentDynamic[$viewName_list]['###VIEW###'] = $viewName_u; + // set view array + $viewarray[] = "\t\t\t\t'" . $viewName_single . "' => '" . $viewName_list . "'"; + // set the view names + if ($view['settings']->name_single != 'null') + { + // ###VIEW### <<>> + $viewName_u = ComponentbuilderHelper::safeString($view['settings']->name_single, 'U'); + $this->fileContentDynamic[$viewName_single]['###VIEW###'] = $viewName_u; + $this->fileContentDynamic[$viewName_list]['###VIEW###'] = $viewName_u; - // ###View### <<>> - $viewName_f = ComponentbuilderHelper::safeString($view['settings']->name_single,'F'); - $this->fileContentDynamic[$viewName_single]['###View###'] = $viewName_f; - $this->fileContentDynamic[$viewName_list]['###View###'] = $viewName_f; + // ###View### <<>> + $viewName_f = ComponentbuilderHelper::safeString($view['settings']->name_single, 'F'); + $this->fileContentDynamic[$viewName_single]['###View###'] = $viewName_f; + $this->fileContentDynamic[$viewName_list]['###View###'] = $viewName_f; - // ###view### <<>> - $this->fileContentDynamic[$viewName_single]['###view###'] = $viewName_single; - $this->fileContentDynamic[$viewName_list]['###view###'] = $viewName_single; + // ###view### <<>> + $this->fileContentDynamic[$viewName_single]['###view###'] = $viewName_single; + $this->fileContentDynamic[$viewName_list]['###view###'] = $viewName_single; - // set some place holder for the views - $this->placeholders['###view###'] = $viewName_single; - $this->placeholders['###View###'] = $viewName_f; - $this->placeholders['###VIEW###'] = $viewName_u; - $this->placeholders['[[[view]]]'] = $viewName_single; - $this->placeholders['[[[View]]]'] = $viewName_f; - $this->placeholders['[[[VIEW]]]'] = $viewName_u; + // set some place holder for the views + $this->placeholders['###view###'] = $viewName_single; + $this->placeholders['###View###'] = $viewName_f; + $this->placeholders['###VIEW###'] = $viewName_u; + $this->placeholders['[[[view]]]'] = $viewName_single; + $this->placeholders['[[[View]]]'] = $viewName_f; + $this->placeholders['[[[VIEW]]]'] = $viewName_u; - // set license per view if needed - $this->setLockLicensePer($viewName_single, $this->target); - $this->setLockLicensePer($viewName_list, $this->target); + // set license per view if needed + $this->setLockLicensePer($viewName_single, $this->target); + $this->setLockLicensePer($viewName_list, $this->target); - // ###FIELDSETS### <<>> - $this->fileContentDynamic[$viewName_single]['###FIELDSETS###'] - = $this->setFieldSet($view, $this->fileContentStatic['###component###']); + // ###FIELDSETS### <<>> + $this->fileContentDynamic[$viewName_single]['###FIELDSETS###'] = $this->setFieldSet($view, $this->fileContentStatic['###component###']); - // ###ACCESSCONTROL### <<>> - $this->fileContentDynamic[$viewName_single]['###ACCESSCONTROL###'] = $this->setFieldSetAccessControl($viewName_single); + // ###ACCESSCONTROL### <<>> + $this->fileContentDynamic[$viewName_single]['###ACCESSCONTROL###'] = $this->setFieldSetAccessControl($viewName_single); - // ###LINKEDVIEWITEMS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] = ''; + // ###LINKEDVIEWITEMS### <<>> + $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWITEMS###'] = ''; - // ###ADDTOOLBAR### <<>> - $this->fileContentDynamic[$viewName_single]['###ADDTOOLBAR###'] = $this->setAddToolBar($view); + // ###ADDTOOLBAR### <<>> + $this->fileContentDynamic[$viewName_single]['###ADDTOOLBAR###'] = $this->setAddToolBar($view); - // set the script for this view - $this->buildTheViewScript($view); + // set the script for this view + $this->buildTheViewScript($view); - // ###VIEW_SCRIPT### - $this->fileContentDynamic[$viewName_single]['###VIEW_SCRIPT###'] = $this->setViewScript($viewName_single); + // ###VIEW_SCRIPT### + $this->fileContentDynamic[$viewName_single]['###VIEW_SCRIPT###'] = $this->setViewScript($viewName_single); - // ###EDITBODYSCRIPT### - $this->fileContentDynamic[$viewName_single]['###EDITBODYSCRIPT###'] = $this->setEditBodyScript($viewName_single); + // ###EDITBODYSCRIPT### + $this->fileContentDynamic[$viewName_single]['###EDITBODYSCRIPT###'] = $this->setEditBodyScript($viewName_single); - // ###AJAXTOKE### <<>> - $this->fileContentDynamic[$viewName_single]['###AJAXTOKE###'] = $this->setAjaxToke($viewName_single); + // ###AJAXTOKE### <<>> + $this->fileContentDynamic[$viewName_single]['###AJAXTOKE###'] = $this->setAjaxToke($viewName_single); - if (isset($this->customScriptBuilder['php_document'][$viewName_single]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder['php_document'][$viewName_single])) - { - // ###DOCUMENT_CUSTOM_PHP### <<>> + if (isset($this->customScriptBuilder['php_document'][$viewName_single]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['php_document'][$viewName_single])) + { + // ###DOCUMENT_CUSTOM_PHP### <<>> $this->customScriptBuilder['php_document'][$viewName_single] = str_replace('$document->', '$this->document->', $this->customScriptBuilder['php_document'][$viewName_single]); - $this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] - = PHP_EOL.$this->setPlaceholders( - $this->customScriptBuilder['php_document'][$viewName_single], - $this->placeholders); - // clear some memory - unset($this->customScriptBuilder['php_document'][$viewName_single]); - } - else - { - $this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = ''; - } + $this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = PHP_EOL . $this->setPlaceholders( + $this->customScriptBuilder['php_document'][$viewName_single], $this->placeholders); + // clear some memory + unset($this->customScriptBuilder['php_document'][$viewName_single]); + } + else + { + $this->fileContentDynamic[$viewName_single]['###DOCUMENT_CUSTOM_PHP###'] = ''; + } - // ###LINKEDVIEWTABLESCRIPTS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = ''; + // ###LINKEDVIEWTABLESCRIPTS### <<>> + $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWTABLESCRIPTS###'] = ''; - // ###VALIDATEFIX### <<>> - $this->fileContentDynamic[$viewName_single]['###VALIDATIONFIX###'] - = $this->setValidationFix($viewName_single, $this->fileContentStatic['###Component###']); + // ###VALIDATEFIX### <<>> + $this->fileContentDynamic[$viewName_single]['###VALIDATIONFIX###'] = $this->setValidationFix($viewName_single, $this->fileContentStatic['###Component###']); - // ###EDITBODY### <<>> - $this->fileContentDynamic[$viewName_single]['###EDITBODY###'] = $this->setEditBody($view); + // ###EDITBODY### <<>> + $this->fileContentDynamic[$viewName_single]['###EDITBODY###'] = $this->setEditBody($view); - // ###EDITBODY### <<>> - $this->fileContentDynamic[$viewName_single]['###EDITBODYFADEIN###'] = $this->setFadeInEfect($view); + // ###EDITBODY### <<>> + $this->fileContentDynamic[$viewName_single]['###EDITBODYFADEIN###'] = $this->setFadeInEfect($view); - // ###JTABLECONSTRUCTOR### <<>> - $this->fileContentDynamic[$viewName_single]['###JTABLECONSTRUCTOR###'] = $this->setJtableConstructor($viewName_single); + // ###JTABLECONSTRUCTOR### <<>> + $this->fileContentDynamic[$viewName_single]['###JTABLECONSTRUCTOR###'] = $this->setJtableConstructor($viewName_single); - // ###JTABLEALIASCATEGORY### <<>> - $this->fileContentDynamic[$viewName_single]['###JTABLEALIASCATEGORY###'] = $this->setJtableAliasCategory($viewName_single); + // ###JTABLEALIASCATEGORY### <<>> + $this->fileContentDynamic[$viewName_single]['###JTABLEALIASCATEGORY###'] = $this->setJtableAliasCategory($viewName_single); - // ###METHOD_GET_ITEM### <<>> - $this->fileContentDynamic[$viewName_single]['###METHOD_GET_ITEM###'] = $this->setMethodGetItem($viewName_single); + // ###METHOD_GET_ITEM### <<>> + $this->fileContentDynamic[$viewName_single]['###METHOD_GET_ITEM###'] = $this->setMethodGetItem($viewName_single); - // ###LINKEDVIEWGLOBAL### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] = ''; + // ###LINKEDVIEWGLOBAL### <<>> + $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWGLOBAL###'] = ''; - // ###LINKEDVIEWMETHODS### <<>> - $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWMETHODS###'] = ''; + // ###LINKEDVIEWMETHODS### <<>> + $this->fileContentDynamic[$viewName_single]['###LINKEDVIEWMETHODS###'] = ''; - // ###JMODELADMIN_BEFORE_DELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_DELETE###'] - = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL); + // ###JMODELADMIN_BEFORE_DELETE### <<>> + $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_DELETE###'] = $this->getCustomScriptBuilder('php_before_delete', $viewName_single, PHP_EOL); - // ###JMODELADMIN_AFTER_DELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_DELETE###'] - = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL.PHP_EOL); + // ###JMODELADMIN_AFTER_DELETE### <<>> + $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_DELETE###'] = $this->getCustomScriptBuilder('php_after_delete', $viewName_single, PHP_EOL . PHP_EOL); - // ###JMODELADMIN_BEFORE_DELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_PUBLISH###'] - = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL); + // ###JMODELADMIN_BEFORE_DELETE### <<>> + $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_BEFORE_PUBLISH###'] = $this->getCustomScriptBuilder('php_before_publish', $viewName_single, PHP_EOL); - // ###JMODELADMIN_AFTER_DELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_PUBLISH###'] - = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL.PHP_EOL); + // ###JMODELADMIN_AFTER_DELETE### <<>> + $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_AFTER_PUBLISH###'] = $this->getCustomScriptBuilder('php_after_publish', $viewName_single, PHP_EOL . PHP_EOL); - // ###CHECKBOX_SAVE### <<>> - $this->fileContentDynamic[$viewName_single]['###CHECKBOX_SAVE###'] = $this->setCheckboxSave($viewName_single); + // ###CHECKBOX_SAVE### <<>> + $this->fileContentDynamic[$viewName_single]['###CHECKBOX_SAVE###'] = $this->setCheckboxSave($viewName_single); - // ###METHOD_ITEM_SAVE### <<>> - $this->fileContentDynamic[$viewName_single]['###METHOD_ITEM_SAVE###'] = $this->setMethodItemSave($viewName_single); + // ###METHOD_ITEM_SAVE### <<>> + $this->fileContentDynamic[$viewName_single]['###METHOD_ITEM_SAVE###'] = $this->setMethodItemSave($viewName_single); - // ###POSTSAVEHOOK### <<>> - $this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###'] - = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, - PHP_EOL."\t\treturn;", PHP_EOL.PHP_EOL."\t\treturn;"); + // ###POSTSAVEHOOK### <<>> + $this->fileContentDynamic[$viewName_single]['###POSTSAVEHOOK###'] = $this->getCustomScriptBuilder('php_postsavehook', $viewName_single, PHP_EOL, null, true, PHP_EOL . "\t\treturn;", PHP_EOL . PHP_EOL . "\t\treturn;"); - if (isset($this->customScriptBuilder['css_view'][$viewName_single]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_view'][$viewName_single])) - { - // ###VIEWCSS### <<>> - $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] - = $this->setPlaceholders($this->customScriptBuilder['css_view'][$viewName_single], $this->placeholders); - // clear some memory - unset($this->customScriptBuilder['css_view'][$viewName_single]); - } - else - { - // ###VIEWCSS### <<>> - $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = ''; - } - // add css to front end - if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) - { - $this->fileContentDynamic[$viewName_single]['###SITE_VIEWCSS###'] - = $this->fileContentDynamic[$viewName_single]['###VIEWCSS###']; - } - } - // set the views names - if ($view['settings']->name_list != 'null') - { - $this->lang = 'admin'; - // ###VIEWS### <<>> - $viewsName_u = ComponentbuilderHelper::safeString($view['settings']->name_list,'U'); - $this->fileContentDynamic[$viewName_list]['###VIEWS###'] = $viewsName_u; - $this->fileContentDynamic[$viewName_single]['###VIEWS###'] = $viewsName_u; + if (isset($this->customScriptBuilder['css_view'][$viewName_single]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_view'][$viewName_single])) + { + // ###VIEWCSS### <<>> + $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = $this->setPlaceholders($this->customScriptBuilder['css_view'][$viewName_single], $this->placeholders); + // clear some memory + unset($this->customScriptBuilder['css_view'][$viewName_single]); + } + else + { + // ###VIEWCSS### <<>> + $this->fileContentDynamic[$viewName_single]['###VIEWCSS###'] = ''; + } + // add css to front end + if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) + { + $this->fileContentDynamic[$viewName_single]['###SITE_VIEWCSS###'] = $this->fileContentDynamic[$viewName_single]['###VIEWCSS###']; + } + } + // set the views names + if ($view['settings']->name_list != 'null') + { + $this->lang = 'admin'; + // ###VIEWS### <<>> + $viewsName_u = ComponentbuilderHelper::safeString($view['settings']->name_list, 'U'); + $this->fileContentDynamic[$viewName_list]['###VIEWS###'] = $viewsName_u; + $this->fileContentDynamic[$viewName_single]['###VIEWS###'] = $viewsName_u; - // ###Views### <<>> - $viewsName_f = ComponentbuilderHelper::safeString($view['settings']->name_list,'F'); - $this->fileContentDynamic[$viewName_list]['###Views###'] = $viewsName_f; - $this->fileContentDynamic[$viewName_single]['###Views###'] = $viewsName_f; + // ###Views### <<>> + $viewsName_f = ComponentbuilderHelper::safeString($view['settings']->name_list, 'F'); + $this->fileContentDynamic[$viewName_list]['###Views###'] = $viewsName_f; + $this->fileContentDynamic[$viewName_single]['###Views###'] = $viewsName_f; - // ###views### <<>> - $this->fileContentDynamic[$viewName_list]['###views###'] = $viewName_list; - $this->fileContentDynamic[$viewName_single]['###views###'] = $viewName_list; - // ###ICOMOON### <<>> - $this->fileContentDynamic[$viewName_list]['###ICOMOON###'] = $view['icomoon']; + // ###views### <<>> + $this->fileContentDynamic[$viewName_list]['###views###'] = $viewName_list; + $this->fileContentDynamic[$viewName_single]['###views###'] = $viewName_list; + // ###ICOMOON### <<>> + $this->fileContentDynamic[$viewName_list]['###ICOMOON###'] = $view['icomoon']; - // set some place holder for the views - $this->placeholders['###views###'] = $viewName_list; - $this->placeholders['###Views###'] = $viewsName_f; - $this->placeholders['###VIEWS###'] = $viewsName_u; - $this->placeholders['[[[views]]]'] = $viewName_list; - $this->placeholders['[[[Views]]]'] = $viewsName_f; - $this->placeholders['[[[VIEWS]]]'] = $viewsName_u; + // set some place holder for the views + $this->placeholders['###views###'] = $viewName_list; + $this->placeholders['###Views###'] = $viewsName_f; + $this->placeholders['###VIEWS###'] = $viewsName_u; + $this->placeholders['[[[views]]]'] = $viewName_list; + $this->placeholders['[[[Views]]]'] = $viewsName_f; + $this->placeholders['[[[VIEWS]]]'] = $viewsName_u; - // set the export/import option - if (isset($view['port']) && $view['port']) - { - $this->eximportView[$viewName_list] = true; - if (1 == $view['settings']->add_custom_import) - { - // this view has custom import scripting - $this->importCustomScripts[$viewName_list] = true; - $this->setImportCustomScripts($viewName_list); - } - } - else - { - $this->eximportView[$viewName_list] = false; - } + // set the export/import option + if (isset($view['port']) && $view['port']) + { + $this->eximportView[$viewName_list] = true; + if (1 == $view['settings']->add_custom_import) + { + // this view has custom import scripting + $this->importCustomScripts[$viewName_list] = true; + $this->setImportCustomScripts($viewName_list); + } + } + else + { + $this->eximportView[$viewName_list] = false; + } - // set Autocheckin function - if (isset($view['checkin']) && $view['checkin'] == 1) - { - // ###AUTOCHECKIN### <<>> - $this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] - = $this->setAutoCheckin($viewName_single,$this->fileContentStatic['###component###']); - // ###CHECKINCALL### <<>> - $this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] - = $this->setCheckinCall(); - } - else - { - // ###AUTOCHECKIN### <<>> - $this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] = ''; - // ###CHECKINCALL### <<>> - $this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = ''; - } + // set Autocheckin function + if (isset($view['checkin']) && $view['checkin'] == 1) + { + // ###AUTOCHECKIN### <<>> + $this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] = $this->setAutoCheckin($viewName_single, $this->fileContentStatic['###component###']); + // ###CHECKINCALL### <<>> + $this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = $this->setCheckinCall(); + } + else + { + // ###AUTOCHECKIN### <<>> + $this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###'] = ''; + // ###CHECKINCALL### <<>> + $this->fileContentDynamic[$viewName_list]['###CHECKINCALL###'] = ''; + } // ###ADMIN_CUSTOM_BUTTONS_LIST### - $this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_BUTTONS_LIST###'] - = $this->setCustomButtons($view, 3, "\t"); - $this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST###'] - = $this->setFunctionOnlyButtons($viewName_list); + $this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_BUTTONS_LIST###'] = $this->setCustomButtons($view, 3, "\t"); + $this->fileContentDynamic[$viewName_list]['###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST###'] = $this->setFunctionOnlyButtons($viewName_list); - // ###GET_ITEMS_METHOD_STRING_FIX### <<>> - $this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_STRING_FIX###'] - = $this->setGetItemsMethodStringFix($viewName_single,$this->fileContentStatic['###Component###']); + // ###GET_ITEMS_METHOD_STRING_FIX### <<>> + $this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_STRING_FIX###'] = $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###']); - // ###GET_ITEMS_METHOD_AFTER_ALL### <<>> - $this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_AFTER_ALL###'] - = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL); + // ###GET_ITEMS_METHOD_AFTER_ALL### <<>> + $this->fileContentDynamic[$viewName_list]['###GET_ITEMS_METHOD_AFTER_ALL###'] = $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL); - // ###SELECTIONTRANSLATIONFIX### <<>> - $this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIX###'] - = $this->setSelectionTranslationFix($viewName_list,$this->fileContentStatic['###Component###']); + // ###SELECTIONTRANSLATIONFIX### <<>> + $this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIX###'] = $this->setSelectionTranslationFix($viewName_list, $this->fileContentStatic['###Component###']); - // ###SELECTIONTRANSLATIONFIXFUNC### <<>> - $this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIXFUNC###'] - = $this->setSelectionTranslationFixFunc($viewName_list,$this->fileContentStatic['###Component###']); + // ###SELECTIONTRANSLATIONFIXFUNC### <<>> + $this->fileContentDynamic[$viewName_list]['###SELECTIONTRANSLATIONFIXFUNC###'] = $this->setSelectionTranslationFixFunc($viewName_list, $this->fileContentStatic['###Component###']); - // ###FILTER_FIELDS### <<>> - $this->fileContentDynamic[$viewName_list]['###FILTER_FIELDS###'] = $this->setFilterFields($viewName_list); + // ###FILTER_FIELDS### <<>> + $this->fileContentDynamic[$viewName_list]['###FILTER_FIELDS###'] = $this->setFilterFields($viewName_list); - // ###STOREDID### <<>> - $this->fileContentDynamic[$viewName_list]['###STOREDID###'] = $this->setStoredId($viewName_list); + // ###STOREDID### <<>> + $this->fileContentDynamic[$viewName_list]['###STOREDID###'] = $this->setStoredId($viewName_list); - // ###POPULATESTATE### <<>> - $this->fileContentDynamic[$viewName_list]['###POPULATESTATE###'] = $this->setPopulateState($viewName_list); + // ###POPULATESTATE### <<>> + $this->fileContentDynamic[$viewName_list]['###POPULATESTATE###'] = $this->setPopulateState($viewName_list); - // ###SORTFIELDS### <<>> - $this->fileContentDynamic[$viewName_list]['###SORTFIELDS###'] = $this->setSortFields($viewName_list); + // ###SORTFIELDS### <<>> + $this->fileContentDynamic[$viewName_list]['###SORTFIELDS###'] = $this->setSortFields($viewName_list); - // ###CATEGORYFILTER### <<>> - $this->fileContentDynamic[$viewName_list]['###CATEGORYFILTER###'] = $this->setCategoryFilter($viewName_list); + // ###CATEGORYFILTER### <<>> + $this->fileContentDynamic[$viewName_list]['###CATEGORYFILTER###'] = $this->setCategoryFilter($viewName_list); - // ###CATEGORY_VIEWS### - if (!isset($this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'])) - { - $this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] = ''; - } - $this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] - .= $this->setRouterCategoryViews($viewName_single,$viewName_list); + // ###CATEGORY_VIEWS### + if (!isset($this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'])) + { + $this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] = ''; + } + $this->fileContentStatic['###ROUTER_CATEGORY_VIEWS###'] .= $this->setRouterCategoryViews($viewName_single, $viewName_list); - // ###OTHERFILTERS### <<>> - $this->fileContentDynamic[$viewName_list]['###OTHERFILTERS###'] = $this->setOtherFilter($viewName_list); + // ###OTHERFILTERS### <<>> + $this->fileContentDynamic[$viewName_list]['###OTHERFILTERS###'] = $this->setOtherFilter($viewName_list); - // ###FILTERFUNCTIONS### <<>> - $this->fileContentDynamic[$viewName_list]['###FILTERFUNCTIONS###'] - = $this->setFilterFunctions($viewName_single,$viewName_list); + // ###FILTERFUNCTIONS### <<>> + $this->fileContentDynamic[$viewName_list]['###FILTERFUNCTIONS###'] = $this->setFilterFunctions($viewName_single, $viewName_list); - // ###LISTQUERY### <<>> - $this->fileContentDynamic[$viewName_list]['###LISTQUERY###'] = $this->setListQuery($viewName_single,$viewName_list); + // ###LISTQUERY### <<>> + $this->fileContentDynamic[$viewName_list]['###LISTQUERY###'] = $this->setListQuery($viewName_single, $viewName_list); - // ###MODELEXPORTMETHOD### <<>> - $this->fileContentDynamic[$viewName_list]['###MODELEXPORTMETHOD###'] - = $this->setModelExportMethod($viewName_single, $viewName_list); + // ###MODELEXPORTMETHOD### <<>> + $this->fileContentDynamic[$viewName_list]['###MODELEXPORTMETHOD###'] = $this->setModelExportMethod($viewName_single, $viewName_list); - // ###MODELEXIMPORTMETHOD### <<>> - $this->fileContentDynamic[$viewName_list]['###CONTROLLEREXIMPORTMETHOD###'] - = $this->setControllerEximportMethod($viewName_single, $viewName_list); + // ###MODELEXIMPORTMETHOD### <<>> + $this->fileContentDynamic[$viewName_list]['###CONTROLLEREXIMPORTMETHOD###'] = $this->setControllerEximportMethod($viewName_single, $viewName_list); - // ###EXPORTBUTTON### <<>> - $this->fileContentDynamic[$viewName_list]['###EXPORTBUTTON###'] - = $this->setExportButton($viewName_single, $viewName_list); + // ###EXPORTBUTTON### <<>> + $this->fileContentDynamic[$viewName_list]['###EXPORTBUTTON###'] = $this->setExportButton($viewName_single, $viewName_list); - // ###IMPORTBUTTON### <<>> - $this->fileContentDynamic[$viewName_list]['###IMPORTBUTTON###'] - = $this->setImportButton($viewName_single, $viewName_list); + // ###IMPORTBUTTON### <<>> + $this->fileContentDynamic[$viewName_list]['###IMPORTBUTTON###'] = $this->setImportButton($viewName_single, $viewName_list); - // ###LISTHEAD### <<>> - $this->fileContentDynamic[$viewName_list]['###LISTHEAD###'] = $this->setListHead($viewName_single,$viewName_list); + // ###LISTHEAD### <<>> + $this->fileContentDynamic[$viewName_list]['###LISTHEAD###'] = $this->setListHead($viewName_single, $viewName_list); - // ###LISTBODY### <<>> - $this->fileContentDynamic[$viewName_list]['###LISTBODY###'] = $this->setListBody($viewName_single,$viewName_list); + // ###LISTBODY### <<>> + $this->fileContentDynamic[$viewName_list]['###LISTBODY###'] = $this->setListBody($viewName_single, $viewName_list); - // ###LISTCOLNR### <<>> - $this->fileContentDynamic[$viewName_list]['###LISTCOLNR###'] = $this->setListColnr($viewName_list); + // ###LISTCOLNR### <<>> + $this->fileContentDynamic[$viewName_list]['###LISTCOLNR###'] = $this->setListColnr($viewName_list); - // ###JVIEWLISTCANDO### <<>> - $this->fileContentDynamic[$viewName_list]['###JVIEWLISTCANDO###'] - = $this->setJviewListCanDo($viewName_single,$viewName_list); + // ###JVIEWLISTCANDO### <<>> + $this->fileContentDynamic[$viewName_list]['###JVIEWLISTCANDO###'] = $this->setJviewListCanDo($viewName_single, $viewName_list); - if (isset($this->customScriptBuilder['css_views'][$viewName_list]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_views'][$viewName_list])) - { - // ###VIEWCSS### <<>> - $this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] - = $this->setPlaceholders($this->customScriptBuilder['css_views'][$viewName_list], $this->placeholders); - // clear some memory - unset($this->customScriptBuilder['css_views'][$viewName_list]); - } - else - { - // ###VIEWCSS### <<>> - $this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] = ''; - } - } + if (isset($this->customScriptBuilder['css_views'][$viewName_list]) && ComponentbuilderHelper::checkString($this->customScriptBuilder['css_views'][$viewName_list])) + { + // ###VIEWCSS### <<>> + $this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] = $this->setPlaceholders($this->customScriptBuilder['css_views'][$viewName_list], $this->placeholders); + // clear some memory + unset($this->customScriptBuilder['css_views'][$viewName_list]); + } + else + { + // ###VIEWCSS### <<>> + $this->fileContentDynamic[$viewName_list]['###VIEWSCSS###'] = ''; + } + } - // set u fields used in batch - $this->fileContentDynamic[$viewName_single]['###UNIQUEFIELDS###'] = $this->setUniqueFields($viewName_single); + // set u fields used in batch + $this->fileContentDynamic[$viewName_single]['###UNIQUEFIELDS###'] = $this->setUniqueFields($viewName_single); - // ###TITLEALIASFIX### <<>> - $this->fileContentDynamic[$viewName_single]['###TITLEALIASFIX###'] = $this->setAliasTitleFix($viewName_single); + // ###TITLEALIASFIX### <<>> + $this->fileContentDynamic[$viewName_single]['###TITLEALIASFIX###'] = $this->setAliasTitleFix($viewName_single); - // ###GENERATENEWTITLE### <<>> - $this->fileContentDynamic[$viewName_single]['###GENERATENEWTITLE###'] = $this->setGenerateNewTitle($viewName_single); + // ###GENERATENEWTITLE### <<>> + $this->fileContentDynamic[$viewName_single]['###GENERATENEWTITLE###'] = $this->setGenerateNewTitle($viewName_single); - // ###MODEL_BATCH_COPY### <<>> - $this->fileContentDynamic[$viewName_single]['###MODEL_BATCH_COPY###'] = $this->setBatchCopy($viewName_single); + // ###MODEL_BATCH_COPY### <<>> + $this->fileContentDynamic[$viewName_single]['###MODEL_BATCH_COPY###'] = $this->setBatchCopy($viewName_single); - // ###MODEL_BATCH_MOVE### <<>> - $this->fileContentDynamic[$viewName_single]['###MODEL_BATCH_MOVE###'] = $this->setBatchMove($viewName_single); + // ###MODEL_BATCH_MOVE### <<>> + $this->fileContentDynamic[$viewName_single]['###MODEL_BATCH_MOVE###'] = $this->setBatchMove($viewName_single); - // ###BATCH_ONCLICK_CANCEL_SCRIPT### <<>> - $this->fileContentDynamic[$viewName_list]['###BATCH_ONCLICK_CANCEL_SCRIPT###'] = ''; // TODO <-- must still be build + // ###BATCH_ONCLICK_CANCEL_SCRIPT### <<>> + $this->fileContentDynamic[$viewName_list]['###BATCH_ONCLICK_CANCEL_SCRIPT###'] = ''; // TODO <-- must still be build + // ###JCONTROLLERFORM_ALLOWADD### <<>> + $this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWADD###'] = $this->setJcontrollerAllowAdd($viewName_single, $viewName_list); - // ###JCONTROLLERFORM_ALLOWADD### <<>> - $this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWADD###'] - = $this->setJcontrollerAllowAdd($viewName_single,$viewName_list); + // ###JCONTROLLERFORM_ALLOWEDIT### <<>> + $this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWEDIT###'] = $this->setJcontrollerAllowEdit($viewName_single, $viewName_list); - // ###JCONTROLLERFORM_ALLOWEDIT### <<>> - $this->fileContentDynamic[$viewName_single]['###JCONTROLLERFORM_ALLOWEDIT###'] - = $this->setJcontrollerAllowEdit($viewName_single,$viewName_list); + // ###JMODELADMIN_GETFORM### <<>> + $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_GETFORM###'] = $this->setJmodelAdminGetForm($viewName_single, $viewName_list); - // ###JMODELADMIN_GETFORM### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_GETFORM###'] - = $this->setJmodelAdminGetForm($viewName_single,$viewName_list); + // ###JMODELADMIN_ALLOWEDIT### <<>> + $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_ALLOWEDIT###'] = $this->setJmodelAdminAllowEdit($viewName_single, $viewName_list); - // ###JMODELADMIN_ALLOWEDIT### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_ALLOWEDIT###'] - = $this->setJmodelAdminAllowEdit($viewName_single,$viewName_list); + // ###JMODELADMIN_CANDELETE### <<>> + $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANDELETE###'] = $this->setJmodelAdminCanDelete($viewName_single, $viewName_list); - // ###JMODELADMIN_CANDELETE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANDELETE###'] - = $this->setJmodelAdminCanDelete($viewName_single,$viewName_list); + // ###JMODELADMIN_CANEDITSTATE### <<>> + $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANEDITSTATE###'] = $this->setJmodelAdminCanEditState($viewName_single, $viewName_list); - // ###JMODELADMIN_CANEDITSTATE### <<>> - $this->fileContentDynamic[$viewName_single]['###JMODELADMIN_CANEDITSTATE###'] - = $this->setJmodelAdminCanEditState($viewName_single,$viewName_list); + // set custom admin view Toolbare buttons + // ###CUSTOM_ADMIN_DYNAMIC_BUTTONS### <<>> + $this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS###'] = $this->setCustomAdminDynamicButton($viewName_list); + // ###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER### <<>> + $this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER###'] = $this->setCustomAdminDynamicButtonController($viewName_list); - // set custom admin view Toolbare buttons - // ###CUSTOM_ADMIN_DYNAMIC_BUTTONS### <<>> - $this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS###'] - = $this->setCustomAdminDynamicButton($viewName_list); - // ###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER### <<>> - $this->fileContentDynamic[$viewName_list]['###CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER###'] - = $this->setCustomAdminDynamicButtonController($viewName_list); + // set helper router + if (!isset($this->fileContentStatic['###ROUTEHELPER###'])) + { + $this->fileContentStatic['###ROUTEHELPER###'] = ''; + } + $this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($viewName_single, $viewName_list); - // set helper router - if (!isset($this->fileContentStatic['###ROUTEHELPER###'])) - { - $this->fileContentStatic['###ROUTEHELPER###'] = ''; - } - $this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($viewName_single, $viewName_list); + if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) + { + // add needed router stuff for front edit views + $this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($viewName_single, null, false); + $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($viewName_single); + } - if (isset($view['edit_create_site_view']) && $view['edit_create_site_view']) - { - // add needed router stuff for front edit views - $this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($viewName_single, null, false); - $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($viewName_single); - } + // ###ACCESS_SECTIONS### + if (!isset($this->fileContentStatic['###ACCESS_SECTIONS###'])) + { + $this->fileContentStatic['###ACCESS_SECTIONS###'] = ''; + } + $this->fileContentStatic['###ACCESS_SECTIONS###'] .= $this->setAccessSectionsCategory($viewName_single, $viewName_list); - // ###ACCESS_SECTIONS### - if (!isset($this->fileContentStatic['###ACCESS_SECTIONS###'])) - { - $this->fileContentStatic['###ACCESS_SECTIONS###'] = ''; - } - $this->fileContentStatic['###ACCESS_SECTIONS###'] .= $this->setAccessSectionsCategory($viewName_single, $viewName_list); + // ###HELPER_EXEL### + $this->fileContentStatic['###HELPER_EXEL###'] = $this->setExelHelperMethods(); + } - // ###HELPER_EXEL### - $this->fileContentStatic['###HELPER_EXEL###'] = $this->setExelHelperMethods(); + // setup custom_admin_views and all needed stuff for the site + if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) + { + $this->target = 'custom_admin'; + $this->lang = 'admin'; + // var_dump($this->componentData->custom_admin_views);exit; + // start dynamic build + foreach ($this->componentData->custom_admin_views as $view) + { + // for single views + $this->fileContentDynamic[$view['settings']->code]['###SView###'] = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code]['###sview###'] = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code]['###SVIEW###'] = $view['settings']->CODE; + // for list views + $this->fileContentDynamic[$view['settings']->code]['###SViews###'] = $view['settings']->Code; + $this->fileContentDynamic[$view['settings']->code]['###sviews###'] = $view['settings']->code; + $this->fileContentDynamic[$view['settings']->code]['###SVIEWS###'] = $view['settings']->CODE; + // add to lang array + if (!isset($this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE])) + { + $this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE] = $view['settings']->name; + } + if (!isset($this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC'])) + { + $this->langContent[$this->lang][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC'] = $view['settings']->description; + } + // ###ICOMOON### <<>> + $this->fileContentDynamic[$view['settings']->code]['###ICOMOON###'] = $view['icomoon']; - } + // set placeholders + $this->placeholders['###SView###'] = $view['settings']->Code; + $this->placeholders['###sview###'] = $view['settings']->code; + $this->placeholders['###SVIEW###'] = $view['settings']->CODE; + $this->placeholders['[[[SView]]]'] = $view['settings']->Code; + $this->placeholders['[[[sview]]]'] = $view['settings']->code; + $this->placeholders['[[[SVIEW]]]'] = $view['settings']->CODE; + $this->placeholders['###SViews###'] = $view['settings']->Code; + $this->placeholders['###sviews###'] = $view['settings']->code; + $this->placeholders['###SVIEWS###'] = $view['settings']->CODE; + $this->placeholders['[[[SViews]]]'] = $view['settings']->Code; + $this->placeholders['[[[sviews]]]'] = $view['settings']->code; + $this->placeholders['[[[SVIEWS]]]'] = $view['settings']->CODE; - // setup custom_admin_views and all needed stuff for the site - if (isset($this->componentData->custom_admin_views) && ComponentbuilderHelper::checkArray($this->componentData->custom_admin_views)) - { - $this->target = 'custom_admin'; - $this->lang = 'admin'; - // var_dump($this->componentData->custom_admin_views);exit; - // start dynamic build - foreach ($this->componentData->custom_admin_views as $view) - { - // for single views - $this->fileContentDynamic[$view['settings']->code]['###SView###'] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code]['###sview###'] = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code]['###SVIEW###'] = $view['settings']->CODE; - // for list views - $this->fileContentDynamic[$view['settings']->code]['###SViews###'] = $view['settings']->Code; - $this->fileContentDynamic[$view['settings']->code]['###sviews###'] = $view['settings']->code; - $this->fileContentDynamic[$view['settings']->code]['###SVIEWS###'] = $view['settings']->CODE; - // add to lang array - if (!isset($this->langContent[$this->lang][$this->langPrefix.'_'.$view['settings']->CODE])) - { - $this->langContent[$this->lang][$this->langPrefix.'_'.$view['settings']->CODE] = $view['settings']->name; - } - if (!isset($this->langContent[$this->lang][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC'])) - { - $this->langContent[$this->lang][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC'] - = $view['settings']->description; - } - // ###ICOMOON### <<>> - $this->fileContentDynamic[$view['settings']->code]['###ICOMOON###'] = $view['icomoon']; + // set license per view if needed + $this->setLockLicensePer($view['settings']->code, $this->target); - // set placeholders - $this->placeholders['###SView###'] = $view['settings']->Code; - $this->placeholders['###sview###'] = $view['settings']->code; - $this->placeholders['###SVIEW###'] = $view['settings']->CODE; - $this->placeholders['[[[SView]]]'] = $view['settings']->Code; - $this->placeholders['[[[sview]]]'] = $view['settings']->code; - $this->placeholders['[[[SVIEW]]]'] = $view['settings']->CODE; - $this->placeholders['###SViews###'] = $view['settings']->Code; - $this->placeholders['###sviews###'] = $view['settings']->code; - $this->placeholders['###SVIEWS###'] = $view['settings']->CODE; - $this->placeholders['[[[SViews]]]'] = $view['settings']->Code; - $this->placeholders['[[[sviews]]]'] = $view['settings']->code; - $this->placeholders['[[[SVIEWS]]]'] = $view['settings']->CODE; + if ($view['settings']->main_get->gettype == 1) + { + // check if there is any custom script + if (isset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code])) + { + // ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] = $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code], $this->placeholders); + // clear some memory + unset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]); + } + else + { + // ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] = ''; + } - // set license per view if needed - $this->setLockLicensePer($view['settings']->code, $this->target); + // ###CUSTOM_ADMIN_GET_ITEM### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t"); - if ($view['settings']->main_get->gettype == 1) - { - // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code])) - { - // ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] - = $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code], $this->placeholders); - // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]); - } - else - { - // ###CUSTOM_ADMIN_BEFORE_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEM###'] = ''; - } + // check if there is any custom script + if (isset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code])) + { + // ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] = $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code], $this->placeholders); + // clear some memory + unset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]); + } + else + { + // ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] = ''; + } + } + elseif ($view['settings']->main_get->gettype == 2) + { + // ###CUSTOM_ADMIN_GET_LIST_QUERY### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); - // ###CUSTOM_ADMIN_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEM###'] - = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code,"\t\t"); + // check if there is any custom script + if (isset($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view['settings']->code])) + { + // ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view['settings']->code], $this->placeholders); + // clear some memory + unset($this->customScriptBuilder[$this->target . '_php_getlistquery'][$view['settings']->code]); + } + else + { + // ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] = ''; + } - // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code])) - { - // ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] - = $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code], $this->placeholders); - // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]); - } - else - { - // ###CUSTOM_ADMIN_AFTER_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEM###'] = ''; - } - } - elseif ($view['settings']->main_get->gettype == 2) - { - // ###CUSTOM_ADMIN_GET_LIST_QUERY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_LIST_QUERY###'] - = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); + // check if there is any custom script + if (isset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code])) + { + // ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code], $this->placeholders); + // clear some memory + unset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]); + } + else + { + // ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] = ''; + } - // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code])) - { - // ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] - = PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code], $this->placeholders); - // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_getlistquery'][$view['settings']->code]); - } - else - { - // ###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_BEFORE_LIST_QUERY###'] = ''; - } + // ###CUSTOM_ADMIN_GET_ITEMS### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); - // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code])) - { - // ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] - = PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code], $this->placeholders); - // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]); - } - else - { - // ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BEFORE_GET_ITEMS###'] = ''; - } + // check if there is any custom script + if (isset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code])) + { + // ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code], $this->placeholders); + // clear some memory + unset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]); + } + else + { + // ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] = ''; + } + } - // ###CUSTOM_ADMIN_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_GET_ITEMS###'] - = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); + // ###CUSTOM_ADMIN_CUSTOM_METHODS### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] .= $this->setCustomViewCustomMethods($view, $view['settings']->code); + // ###CUSTOM_ADMIN_DIPLAY_METHOD### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_DIPLAY_METHOD###'] = $this->setCustomViewDisplayMethod($view); + // set document details + $this->setPrepareDocument($view); + // ###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###'] = $this->setCustomViewExtraDisplayMethods($view); + // ###CUSTOM_ADMIN_CODE_BODY### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CODE_BODY###'] = $this->setCustomViewCodeBody($view); + // ###CUSTOM_ADMIN_BODY### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BODY###'] = $this->setCustomViewBody($view); + // ###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### <<>> + $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###'] = $this->setCustomViewSubmitButtonScript($view); - // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code])) - { - // ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] - = PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code], $this->placeholders); - // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]); - } - else - { - // ###CUSTOM_ADMIN_AFTER_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_AFTER_GET_ITEMS###'] = ''; - } - } + // setup the templates + $this->setCustomViewTemplateBody($view); + } - // ###CUSTOM_ADMIN_CUSTOM_METHODS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] - = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CUSTOM_METHODS###'] - .= $this->setCustomViewCustomMethods($view, $view['settings']->code); - // ###CUSTOM_ADMIN_DIPLAY_METHOD### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_DIPLAY_METHOD###'] - = $this->setCustomViewDisplayMethod($view); - // set document details - $this->setPrepareDocument($view); - // ###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###'] - = $this->setCustomViewExtraDisplayMethods($view); - // ###CUSTOM_ADMIN_CODE_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_CODE_BODY###'] = $this->setCustomViewCodeBody($view); - // ###CUSTOM_ADMIN_BODY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_BODY###'] = $this->setCustomViewBody($view); - // ###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### <<>> - $this->fileContentDynamic[$view['settings']->code]['###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###'] - = $this->setCustomViewSubmitButtonScript($view); + // setup the layouts + $this->setCustomViewLayouts(); + } - // setup the templates - $this->setCustomViewTemplateBody($view); - } + // ###VIEWARRAY### + $this->fileContentStatic['###VIEWARRAY###'] = PHP_EOL . implode("," . PHP_EOL, $viewarray); - // setup the layouts - $this->setCustomViewLayouts(); - } + // ###CUSTOM_ADMIN_EDIT_VIEW_ARRAY### + $this->fileContentStatic['###SITE_EDIT_VIEW_ARRAY###'] = PHP_EOL . implode("," . PHP_EOL, $site_edit_view_array); - // ###VIEWARRAY### - $this->fileContentStatic['###VIEWARRAY###'] = PHP_EOL.implode(",".PHP_EOL,$viewarray); + // ###MAINMENUS### + $this->fileContentStatic['###MAINMENUS###'] = $this->setMainMenus(); - // ###CUSTOM_ADMIN_EDIT_VIEW_ARRAY### - $this->fileContentStatic['###SITE_EDIT_VIEW_ARRAY###'] = PHP_EOL.implode(",".PHP_EOL,$site_edit_view_array); + // ###SUBMENU### + $this->fileContentStatic['###SUBMENU###'] = $this->setSubMenus(); - // ###MAINMENUS### - $this->fileContentStatic['###MAINMENUS###'] = $this->setMainMenus(); + // ###GET_CRYPT_KEY### + $this->fileContentStatic['###GET_CRYPT_KEY###'] = $this->setGetCryptKey(); - // ###SUBMENU### - $this->fileContentStatic['###SUBMENU###'] = $this->setSubMenus(); + // set the license locker + $this->setLockLicense(); - // ###GET_CRYPT_KEY### - $this->fileContentStatic['###GET_CRYPT_KEY###'] = $this->setGetCryptKey(); + // ###CONTRIBUTORS### + $this->fileContentStatic['###CONTRIBUTORS###'] = $this->theContributors; - // set the license locker - $this->setLockLicense(); + // ###INSTALL### + $this->fileContentStatic['###INSTALL###'] = $this->setInstall(); - // ###CONTRIBUTORS### - $this->fileContentStatic['###CONTRIBUTORS###'] = $this->theContributors; + // ###UNINSTALL### + $this->fileContentStatic['###UNINSTALL###'] = $this->setUninstall(); - // ###INSTALL### - $this->fileContentStatic['###INSTALL###'] = $this->setInstall(); - - // ###UNINSTALL### - $this->fileContentStatic['###UNINSTALL###'] = $this->setUninstall(); - // ###UPDATE_VERSION_MYSQL### $this->setVersionController(); - // ###DASHBOARDICONS### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONS###'] = $this->setDashboardIcons(); + // ###DASHBOARDICONS### + $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONS###'] = $this->setDashboardIcons(); - // ###DASHBOARDICONACCESS### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONACCESS###'] = $this->setDashboardIconAccess(); + // ###DASHBOARDICONACCESS### + $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASHBOARDICONACCESS###'] = $this->setDashboardIconAccess(); - // ###DASH_MODEL_METHODS### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_MODEL_METHODS###'] = $this->setDashboardModelMethods(); + // ###DASH_MODEL_METHODS### + $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_MODEL_METHODS###'] = $this->setDashboardModelMethods(); - // ###DASH_GET_CUSTOM_DATA### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_GET_CUSTOM_DATA###'] = $this->setDashboardGetCustomData(); + // ###DASH_GET_CUSTOM_DATA### + $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_GET_CUSTOM_DATA###'] = $this->setDashboardGetCustomData(); - // ###DASH_DISPLAY_DATA### - $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_DISPLAY_DATA###'] = $this->setDashboardDisplayData(); + // ###DASH_DISPLAY_DATA### + $this->fileContentDynamic[$this->fileContentStatic['###component###']]['###DASH_DISPLAY_DATA###'] = $this->setDashboardDisplayData(); - // add import - if (isset($this->addEximport) && $this->addEximport) - { - // setup import files - $target = array('admin' => 'import'); - $this->buildDynamique($target,'import'); - // set the controller - $this->fileContentDynamic['import']['###BLABLABLA###'] = ''; - } + // add import + if (isset($this->addEximport) && $this->addEximport) + { + // setup import files + $target = array('admin' => 'import'); + $this->buildDynamique($target, 'import'); + // set the controller + $this->fileContentDynamic['import']['###BLABLABLA###'] = ''; + } - // ensure that the ajax model and controller is set if needed - if (isset($this->addAjax) && $this->addAjax) - { - // setup Ajax files - $target = array('admin' => 'ajax'); - $this->buildDynamique($target,'ajax'); - // set the controller - $this->fileContentDynamic['ajax']['###REGISTER_AJAX_TASK###'] = $this->setRegisterAjaxTask('admin'); - $this->fileContentDynamic['ajax']['###AJAX_INPUT_RETURN###'] = $this->setAjaxInputReturn('admin'); - // set the module - $this->fileContentDynamic['ajax']['###AJAX_MODEL_METHODS###'] = $this->setAjaxModelMethods('admin'); - } + // ensure that the ajax model and controller is set if needed + if (isset($this->addAjax) && $this->addAjax) + { + // setup Ajax files + $target = array('admin' => 'ajax'); + $this->buildDynamique($target, 'ajax'); + // set the controller + $this->fileContentDynamic['ajax']['###REGISTER_AJAX_TASK###'] = $this->setRegisterAjaxTask('admin'); + $this->fileContentDynamic['ajax']['###AJAX_INPUT_RETURN###'] = $this->setAjaxInputReturn('admin'); + // set the module + $this->fileContentDynamic['ajax']['###AJAX_MODEL_METHODS###'] = $this->setAjaxModelMethods('admin'); + } - // ensure that the site ajax model and controller is set if needed - if (isset($this->addSiteAjax) && $this->addSiteAjax) - { - // setup Ajax files - $target = array('site' => 'ajax'); - $this->buildDynamique($target,'ajax'); - // set the controller - $this->fileContentDynamic['ajax']['###REGISTER_SITE_AJAX_TASK###'] = $this->setRegisterAjaxTask('site' ); - $this->fileContentDynamic['ajax']['###AJAX_SITE_INPUT_RETURN###'] = $this->setAjaxInputReturn('site' ); - // set the module - $this->fileContentDynamic['ajax']['###AJAX_SITE_MODEL_METHODS###'] = $this->setAjaxModelMethods('site'); - } + // ensure that the site ajax model and controller is set if needed + if (isset($this->addSiteAjax) && $this->addSiteAjax) + { + // setup Ajax files + $target = array('site' => 'ajax'); + $this->buildDynamique($target, 'ajax'); + // set the controller + $this->fileContentDynamic['ajax']['###REGISTER_SITE_AJAX_TASK###'] = $this->setRegisterAjaxTask('site'); + $this->fileContentDynamic['ajax']['###AJAX_SITE_INPUT_RETURN###'] = $this->setAjaxInputReturn('site'); + // set the module + $this->fileContentDynamic['ajax']['###AJAX_SITE_MODEL_METHODS###'] = $this->setAjaxModelMethods('site'); + } - // run the second run if needed - if (isset($this->secondRunAdmin) && ComponentbuilderHelper::checkArray($this->secondRunAdmin)) - { - // start dynamic build - foreach ($this->secondRunAdmin as $function => $arrays) - { - if (ComponentbuilderHelper::checkArray($arrays) && ComponentbuilderHelper::checkString($function)) - { - foreach ($arrays as $array) - { - $this->{$function}($array); - } - } - } + // run the second run if needed + if (isset($this->secondRunAdmin) && ComponentbuilderHelper::checkArray($this->secondRunAdmin)) + { + // start dynamic build + foreach ($this->secondRunAdmin as $function => $arrays) + { + if (ComponentbuilderHelper::checkArray($arrays) && ComponentbuilderHelper::checkString($function)) + { + foreach ($arrays as $array) + { + $this->{$function}($array); + } + } + } + } - } + // ###CONFIG_FIELDSETS### + $keepLang = $this->lang; + $this->lang = 'admin'; + // run field sets for second time + $this->setConfigFieldsets(2); + $this->lang = $keepLang; - // ###CONFIG_FIELDSETS### - $keepLang = $this->lang; - $this->lang = 'admin'; - // run field sets for second time - $this->setConfigFieldsets(2); - $this->lang = $keepLang; - // setup front-views and all needed stuff for the site if (isset($this->componentData->site_views) && ComponentbuilderHelper::checkArray($this->componentData->site_views)) { @@ -950,10 +886,10 @@ class Infusion extends Interpretation $this->placeholders['[[[SViews]]]'] = $view['settings']->Code; $this->placeholders['[[[sviews]]]'] = $view['settings']->code; $this->placeholders['[[[SVIEWS]]]'] = $view['settings']->CODE; - + // set license per view if needed $this->setLockLicensePer($view['settings']->code, $this->target); - + // set the site default view if (isset($view['default_view']) && $view['default_view'] == 1) { @@ -965,28 +901,24 @@ class Infusion extends Interpretation // ###SITE_MENU_XML### <<>> $this->fileContentDynamic[$view['settings']->code]['###SITE_MENU_XML###'] = $this->setCustomViewMenu($view); } - + // insure the needed route helper is loaded - $this->fileContentStatic['###ROUTEHELPER###'] - .= $this->setRouterHelp($view['settings']->code,$view['settings']->code, true); + $this->fileContentStatic['###ROUTEHELPER###'] .= $this->setRouterHelp($view['settings']->code, $view['settings']->code, true); // build route details $this->fileContentStatic['###ROUTER_PARSE_SWITCH###'] .= $this->routerParseSwitch($view['settings']->code, $view); $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] .= $this->routerBuildViews($view['settings']->code); - + if ($view['settings']->main_get->gettype == 1) { // set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] - = $this->setUserPermissionCheckAccess($view, 1); + $this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 1); // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code])) + if (isset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code])) { // ###SITE_BEFORE_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###'] - = $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code], $this->placeholders); + $this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEM###'] = $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code], $this->placeholders); // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_before_getitem'][$view['settings']->code]); + unset($this->customScriptBuilder[$this->target . '_php_before_getitem'][$view['settings']->code]); } else { @@ -995,18 +927,15 @@ class Infusion extends Interpretation } // ###SITE_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEM###'] - = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code,"\t\t"); + $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEM###'] = $this->setCustomViewGetItem($view['settings']->main_get, $view['settings']->code, "\t\t"); // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code])) + if (isset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code])) { // ###SITE_AFTER_GET_ITEM### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###'] - = $this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code], $this->placeholders); + $this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEM###'] = $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code], $this->placeholders); // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_after_getitem'][$view['settings']->code]); + unset($this->customScriptBuilder[$this->target . '_php_after_getitem'][$view['settings']->code]); } else { @@ -1017,41 +946,34 @@ class Infusion extends Interpretation elseif ($view['settings']->main_get->gettype == 2) { // set user permission access check ###USER_PERMISSION_CHECK_ACCESS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] - = $this->setUserPermissionCheckAccess($view, 2); + $this->fileContentDynamic[$view['settings']->code]['###USER_PERMISSION_CHECK_ACCESS###'] = $this->setUserPermissionCheckAccess($view, 2); // ###SITE_GET_LIST_QUERY### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_LIST_QUERY###'] - = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_LIST_QUERY###'] = $this->setCustomViewListQuery($view['settings']->main_get, $view['settings']->code); // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code])) + if (isset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code])) { // ###SITE_BEFORE_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###'] - = PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code], $this->placeholders); + $this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code], $this->placeholders); // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_before_getitems'][$view['settings']->code]); + unset($this->customScriptBuilder[$this->target . '_php_before_getitems'][$view['settings']->code]); } else { // ###SITE_BEFORE_GET_ITEMS### <<>> $this->fileContentDynamic[$view['settings']->code]['###SITE_BEFORE_GET_ITEMS###'] = ''; } - + // ###SITE_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEMS###'] - = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); - + $this->fileContentDynamic[$view['settings']->code]['###SITE_GET_ITEMS###'] = $this->setCustomViewGetItems($view['settings']->main_get, $view['settings']->code); + // check if there is any custom script - if (isset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]) - && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code])) + if (isset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]) && ComponentbuilderHelper::checkString($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code])) { // ###SITE_AFTER_GET_ITEMS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###'] - = PHP_EOL.$this->setPlaceholders($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code], $this->placeholders); + $this->fileContentDynamic[$view['settings']->code]['###SITE_AFTER_GET_ITEMS###'] = PHP_EOL . $this->setPlaceholders($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code], $this->placeholders); // clear some memory - unset($this->customScriptBuilder[$this->target.'_php_after_getitems'][$view['settings']->code]); + unset($this->customScriptBuilder[$this->target . '_php_after_getitems'][$view['settings']->code]); } else { @@ -1060,28 +982,23 @@ class Infusion extends Interpretation } } // add to lang array - if (!isset($this->langContent['site'][$this->langPrefix.'_'.$view['settings']->CODE])) + if (!isset($this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE])) { - $this->langContent['site'][$this->langPrefix.'_'.$view['settings']->CODE] = $view['settings']->name; + $this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE] = $view['settings']->name; } - if (!isset($this->langContent['site'][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC'])) + if (!isset($this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC'])) { - $this->langContent['site'][$this->langPrefix.'_'.$view['settings']->CODE.'_DESC'] - = $view['settings']->description; + $this->langContent['site'][$this->langPrefix . '_' . $view['settings']->CODE . '_DESC'] = $view['settings']->description; } // ###SITE_CUSTOM_METHODS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] - = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); - $this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] - .= $this->setCustomViewCustomMethods($view, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] = $this->setCustomViewCustomItemMethods($view['settings']->main_get, $view['settings']->code); + $this->fileContentDynamic[$view['settings']->code]['###SITE_CUSTOM_METHODS###'] .= $this->setCustomViewCustomMethods($view, $view['settings']->code); // ###SITE_DIPLAY_METHOD### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_DIPLAY_METHOD###'] - = $this->setCustomViewDisplayMethod($view); + $this->fileContentDynamic[$view['settings']->code]['###SITE_DIPLAY_METHOD###'] = $this->setCustomViewDisplayMethod($view); // set document details $this->setPrepareDocument($view); // ###SITE_EXTRA_DIPLAY_METHODS### <<>> - $this->fileContentDynamic[$view['settings']->code]['###SITE_EXTRA_DIPLAY_METHODS###'] - = $this->setCustomViewExtraDisplayMethods($view); + $this->fileContentDynamic[$view['settings']->code]['###SITE_EXTRA_DIPLAY_METHODS###'] = $this->setCustomViewExtraDisplayMethods($view); // ###SITE_CODE_BODY### <<>> $this->fileContentDynamic[$view['settings']->code]['###SITE_CODE_BODY###'] = $this->setCustomViewCodeBody($view); // ###SITE_BODY### <<>> @@ -1097,8 +1014,7 @@ class Infusion extends Interpretation } // set site custom script to helper class // ###SITE_CUSTOM_HELPER_SCRIPT### - $this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] - = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders); + $this->fileContentStatic['###SITE_CUSTOM_HELPER_SCRIPT###'] = $this->setPlaceholders($this->customScriptBuilder['component_php_helper_site'], $this->placeholders); // ###SITE_GLOBAL_EVENT_HELPER### $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = ''; // ###SITE_GLOBAL_EVENT### @@ -1106,19 +1022,16 @@ class Infusion extends Interpretation // now load the data for the global event if needed if ($this->componentData->add_site_event == 1) { - $this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = PHP_EOL.PHP_EOL.'// Triger the Global Site Event'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT###'] - .= PHP_EOL.$this->fileContentStatic['###Component###'].'Helper::globalEvent($document);'; + $this->fileContentStatic['###SITE_GLOBAL_EVENT###'] = PHP_EOL . PHP_EOL . '// Triger the Global Site Event'; + $this->fileContentStatic['###SITE_GLOBAL_EVENT###'] .= PHP_EOL . $this->fileContentStatic['###Component###'] . 'Helper::globalEvent($document);'; // ###SITE_GLOBAL_EVENT_HELPER### - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = PHP_EOL.PHP_EOL."\t".'/**'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'* The Global Site Event Method.'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'**/'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] - .= PHP_EOL."\t".'public static function globalEvent($document)'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'{'; - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] - .= PHP_EOL.$this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders); - $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL."\t".'}'; + $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] = PHP_EOL . PHP_EOL . "\t" . '/**'; + $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '* The Global Site Event Method.'; + $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '**/'; + $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . 'public static function globalEvent($document)'; + $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '{'; + $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . $this->setPlaceholders($this->customScriptBuilder['component_php_site_event'], $this->placeholders); + $this->fileContentStatic['###SITE_GLOBAL_EVENT_HELPER###'] .= PHP_EOL . "\t" . '}'; } // setup the layouts $this->setCustomViewLayouts(); @@ -1143,24 +1056,23 @@ class Infusion extends Interpretation // ###UNINSTALLSCRIPT### $this->fileContentStatic['###UNINSTALLSCRIPT###'] = $this->setUninstallScript(); - + // ###HELPER_UIKIT### $this->fileContentStatic['###HELPER_UIKIT###'] = $this->setUikitHelperMethods(); - + // ###CONFIG_FIELDSETS### - $this->fileContentStatic['###CONFIG_FIELDSETS###'] = implode(PHP_EOL,$this->configFieldSets); - + $this->fileContentStatic['###CONFIG_FIELDSETS###'] = implode(PHP_EOL, $this->configFieldSets); + // check if this has been set - if (!isset($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']) - || !ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_BUILD_VIEWS###'])) + if (!isset($this->fileContentStatic['###ROUTER_BUILD_VIEWS###']) || !ComponentbuilderHelper::checkString($this->fileContentStatic['###ROUTER_BUILD_VIEWS###'])) { $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = 0; } else { - $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = '('.$this->fileContentStatic['###ROUTER_BUILD_VIEWS###'].')'; + $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] = '(' . $this->fileContentStatic['###ROUTER_BUILD_VIEWS###'] . ')'; } - + // ###README### if ($this->componentData->addreadme) { @@ -1170,7 +1082,7 @@ class Infusion extends Interpretation } return false; } - + /** * Build the lang values and insert to fiel * @@ -1260,7 +1172,7 @@ class Infusion extends Interpretation $t = '.sys'; } // build the path to to place the lang file - $path = $this->componentPath.'/'.$p.'/language/'.$tag; + $path = $this->componentPath . '/' . $p . '/language/' . $tag; if (!JFolder::exists($path)) { JFolder::create($path); @@ -1270,17 +1182,17 @@ class Infusion extends Interpretation // build the file name $fileName = $tag . '.com_' . $this->componentCodeName . $t . '.ini'; // move the file to its place - JFile::copy($getPAth, $path.'/'.$fileName); + JFile::copy($getPAth, $path . '/' . $fileName); // count the file created $this->fileCount++; // add content to it $lang = ''; foreach ($languageStrings as $place => $string) { - $lang .= $place.'="'.$string.'"'.PHP_EOL; + $lang .= $place . '="' . $string . '"' . PHP_EOL; } // add to language file - $this->writeFile($path.'/'.$fileName, $lang); + $this->writeFile($path . '/' . $fileName, $lang); // set the line counter $this->lineCount = $this->lineCount + substr_count($lang, PHP_EOL); // build xml strings @@ -1288,7 +1200,7 @@ class Infusion extends Interpretation { $langXML[$p] = array(); } - $langXML[$p][] = 'language/'.$tag.'/'.$fileName.''; + $langXML[$p][] = 'language/' . $tag . '/' . $fileName . ''; } } // load the lang xml @@ -1297,21 +1209,22 @@ class Infusion extends Interpretation $replace = array(); if (isset($langXML['admin']) && ComponentbuilderHelper::checkArray($langXML['admin'])) { - $replace['###ADMIN_LANGUAGES###'] = implode(PHP_EOL."\t\t\t", $langXML['admin']); + $replace['###ADMIN_LANGUAGES###'] = implode(PHP_EOL . "\t\t\t", $langXML['admin']); } if (!$this->removeSiteFolder && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site'])) { - $replace['###SITE_LANGUAGES###'] = implode(PHP_EOL."\t\t", $langXML['site']); + $replace['###SITE_LANGUAGES###'] = implode(PHP_EOL . "\t\t", $langXML['site']); } // build xml path - $xmlPath = $this->componentPath . '/'. $this->fileContentStatic['###component###']. '.xml'; + $xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml'; // get the content in xml $componentXML = ComponentbuilderHelper::getFileContents($xmlPath); // update the xml content $componentXML = $this->setPlaceholders($componentXML, $replace); // store the values back to xml - $this->writeFile($xmlPath,$componentXML); + $this->writeFile($xmlPath, $componentXML); } } } + } diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 3c58621a3..25c22f49a 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -2460,6 +2460,9 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CSS_DOCUMENT_LABEL="Add CSS (custom d COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CSS_LABEL="Add CSS" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CUSTOM_BUTTON="Add Custom Button" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL="Add Custom Button" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JAVASCRIPT_FILE="Add Javascript File" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JAVASCRIPT_FILE_DESCRIPTION="Add JavaScript to the JavaScript file linked to this view." +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JAVASCRIPT_FILE_LABEL="Add JavaScript (file)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JS_DOCUMENT="Add Js Document" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_DOCUMENT="Add Php Document" @@ -2551,7 +2554,6 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_BUTTON_LABEL="Custom Buttons" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_GET="Custom Get" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_GET_DESCRIPTION="Select the custom get methods" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_GET_LABEL="Custom Gets" -COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_SCRIPT="Custom Script" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DASHBOARD="Dashboard" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DATABASE="Database" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DEFAULT="Default" @@ -2624,6 +2626,11 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_IMAGE="Image" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_IMAGES="Images" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_INFO="Info" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_INFO_CIRCLE="Info Circle" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JAVASCRIPT_CSS="JavaScript & CSS" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JAVASCRIPT_FILE="Javascript File" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JAVASCRIPT_FILE_DESCRIPTION="Add your JavaScript here! [Do not add the script tags]" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JAVASCRIPT_FILE_HINT="// JavaScript for the view that is loaded in the header via a JS file" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JAVASCRIPT_FILE_LABEL="Javascript" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JOOMLA="Joomla" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT="Js Document" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_DESCRIPTION="JS script to the document method." @@ -2693,6 +2700,7 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PENCIL_TWO="Pencil 2" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PERMISSION="Permissions" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHONE="Phone" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHONE_TWO="Phone 2" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP="PHP" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_CONTROLLER="Php Controller" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_CONTROLLER_DESCRIPTION="Add your PHP here! [Do not add the php tags]" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_CONTROLLER_HINT="// PHP methods for the controller that the button will target" @@ -5209,6 +5217,9 @@ COM_COMPONENTBUILDER_SITE_VIEW_ADD_CSS_DOCUMENT_LABEL="Add CSS (custom document COM_COMPONENTBUILDER_SITE_VIEW_ADD_CSS_LABEL="Add CSS" COM_COMPONENTBUILDER_SITE_VIEW_ADD_CUSTOM_BUTTON="Add Custom Button" COM_COMPONENTBUILDER_SITE_VIEW_ADD_CUSTOM_BUTTON_LABEL="Add Custom Button" +COM_COMPONENTBUILDER_SITE_VIEW_ADD_JAVASCRIPT_FILE="Add Javascript File" +COM_COMPONENTBUILDER_SITE_VIEW_ADD_JAVASCRIPT_FILE_DESCRIPTION="Add JavaScript to the JavaScript file linked to this view." +COM_COMPONENTBUILDER_SITE_VIEW_ADD_JAVASCRIPT_FILE_LABEL="Add JavaScript (file)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_JS_DOCUMENT="Add Js Document" COM_COMPONENTBUILDER_SITE_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_AJAX="Add Php Ajax" @@ -5394,6 +5405,10 @@ COM_COMPONENTBUILDER_SITE_VIEW_INPUT_FILTER_DESCRIPTION="Select the filter used COM_COMPONENTBUILDER_SITE_VIEW_INPUT_FILTER_LABEL="Select a Filter" COM_COMPONENTBUILDER_SITE_VIEW_INT="INT" COM_COMPONENTBUILDER_SITE_VIEW_JAVASCRIPT_CSS="JavaScript & CSS" +COM_COMPONENTBUILDER_SITE_VIEW_JAVASCRIPT_FILE="Javascript File" +COM_COMPONENTBUILDER_SITE_VIEW_JAVASCRIPT_FILE_DESCRIPTION="Add your JavaScript here! [Do not add the script tags]" +COM_COMPONENTBUILDER_SITE_VIEW_JAVASCRIPT_FILE_HINT="// JavaScript for the view that is loaded in the header via a JS file" +COM_COMPONENTBUILDER_SITE_VIEW_JAVASCRIPT_FILE_LABEL="Javascript" COM_COMPONENTBUILDER_SITE_VIEW_JOOMLA="Joomla" COM_COMPONENTBUILDER_SITE_VIEW_JS_DOCUMENT="Js Document" COM_COMPONENTBUILDER_SITE_VIEW_JS_DOCUMENT_DESCRIPTION="JS script to the document method." diff --git a/admin/layouts/custom_admin_view/javascript_css_fullwidth.php b/admin/layouts/custom_admin_view/javascript_css_fullwidth.php new file mode 100644 index 000000000..c71c80ad6 --- /dev/null +++ b/admin/layouts/custom_admin_view/javascript_css_fullwidth.php @@ -0,0 +1,55 @@ + + @github Joomla Component Builder + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'add_js_document', + 'js_document', + 'add_javascript_file', + 'javascript_file', + 'add_css_document', + 'css_document', + 'add_css', + 'css' +); + +?> +
+ +
+
+ getLabel($field); ?> +
+
+ getInput($field); ?> +
+
+ +
diff --git a/admin/layouts/custom_admin_view/custom_script_fullwidth.php b/admin/layouts/custom_admin_view/php_fullwidth.php similarity index 92% rename from admin/layouts/custom_admin_view/custom_script_fullwidth.php rename to admin/layouts/custom_admin_view/php_fullwidth.php index 714ba66df..331339196 100644 --- a/admin/layouts/custom_admin_view/custom_script_fullwidth.php +++ b/admin/layouts/custom_admin_view/php_fullwidth.php @@ -13,7 +13,7 @@ @version 2.6.x @created 30th April, 2015 @package Component Builder - @subpackage custom_script_fullwidth.php + @subpackage php_fullwidth.php @author Llewellyn van der Merwe @github Joomla Component Builder @copyright Copyright (C) 2015. All Rights Reserved @@ -37,13 +37,7 @@ $fields = $displayData->get('fields') ?: array( 'add_php_jview_display', 'php_jview_display', 'add_php_jview', - 'php_jview', - 'add_js_document', - 'js_document', - 'add_css_document', - 'css_document', - 'add_css', - 'css' + 'php_jview' ); ?> diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index 71b6b89dc..268cf602e 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vzwfields; +$items = $displayData->vzyfields; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; diff --git a/admin/layouts/ftp/linked_components_fullwidth.php b/admin/layouts/ftp/linked_components_fullwidth.php index cb7feed10..c06437cf8 100644 --- a/admin/layouts/ftp/linked_components_fullwidth.php +++ b/admin/layouts/ftp/linked_components_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vzxlinked_components; +$items = $displayData->vzzlinked_components; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; diff --git a/admin/layouts/site_view/javascript_css_fullwidth.php b/admin/layouts/site_view/javascript_css_fullwidth.php index 4f3840002..7dc1ed78b 100644 --- a/admin/layouts/site_view/javascript_css_fullwidth.php +++ b/admin/layouts/site_view/javascript_css_fullwidth.php @@ -30,6 +30,8 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( + 'add_javascript_file', + 'javascript_file', 'add_js_document', 'js_document', 'add_css_document', diff --git a/admin/models/compiler.php b/admin/models/compiler.php index ab7ce803c..813ebdee9 100644 --- a/admin/models/compiler.php +++ b/admin/models/compiler.php @@ -34,16 +34,16 @@ jimport('joomla.application.component.modellist'); */ class ComponentbuilderModelCompiler extends JModelList { - /** + /** * Model user data. * - * @var strings + * @var strings */ - protected $user; - protected $userId; - protected $guest; - protected $groups; - protected $levels; + protected $user; + protected $userId; + protected $guest; + protected $groups; + protected $levels; protected $app; protected $input; protected $uikitComp; @@ -55,14 +55,14 @@ class ComponentbuilderModelCompiler extends JModelList */ protected function getListQuery() { - // Get the current user for authorisation checks - $this->user = JFactory::getUser(); + // Get the current user for authorisation checks + $this->user = JFactory::getUser(); $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); - $this->groups = $this->user->get('groups'); - $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->levels = $this->user->getAuthorisedViewLevels(); - $this->app = JFactory::getApplication(); + $this->app = JFactory::getApplication(); $this->input = $this->app->input; $this->initSet = true; // Make sure all records load, since no pagination allowed. @@ -94,16 +94,16 @@ class ComponentbuilderModelCompiler extends JModelList */ public function getItems() { - $user = JFactory::getUser(); - // check if this user has permission to access items - if (!$user->authorise('compiler.access', 'com_componentbuilder')) - { + $user = JFactory::getUser(); + // check if this user has permission to access items + if (!$user->authorise('compiler.access', 'com_componentbuilder')) + { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) $app->redirect('index.php?option=com_componentbuilder'); return false; - } + } // load parent items $items = parent::getItems(); diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php index 7c91fe535..60770e68d 100644 --- a/admin/models/custom_admin_view.php +++ b/admin/models/custom_admin_view.php @@ -103,14 +103,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->libraries = $libraries->toArray(); } - if (!empty($item->custom_button)) - { - // Convert the custom_button field to an array. - $custom_button = new Registry; - $custom_button->loadString($item->custom_button); - $item->custom_button = $custom_button->toArray(); - } - if (!empty($item->custom_get)) { // Convert the custom_get field to an array. @@ -119,6 +111,14 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->custom_get = $custom_get->toArray(); } + if (!empty($item->custom_button)) + { + // Convert the custom_button field to an array. + $custom_button = new Registry; + $custom_button->loadString($item->custom_button); + $item->custom_button = $custom_button->toArray(); + } + if (!empty($item->php_controller)) { // base64 Decode php_controller. @@ -137,6 +137,30 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->php_model = base64_decode($item->php_model); } + if (!empty($item->js_document)) + { + // base64 Decode js_document. + $item->js_document = base64_decode($item->js_document); + } + + if (!empty($item->javascript_file)) + { + // base64 Decode javascript_file. + $item->javascript_file = base64_decode($item->javascript_file); + } + + if (!empty($item->css_document)) + { + // base64 Decode css_document. + $item->css_document = base64_decode($item->css_document); + } + + if (!empty($item->css)) + { + // base64 Decode css. + $item->css = base64_decode($item->css); + } + if (!empty($item->php_document)) { // base64 Decode php_document. @@ -161,24 +185,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->php_jview = base64_decode($item->php_jview); } - if (!empty($item->js_document)) - { - // base64 Decode js_document. - $item->js_document = base64_decode($item->js_document); - } - - if (!empty($item->css_document)) - { - // base64 Decode css_document. - $item->css_document = base64_decode($item->css_document); - } - - if (!empty($item->css)) - { - // base64 Decode css. - $item->css = base64_decode($item->css); - } - // check what type of custom_button array we have here (should be subform... but just incase) // This could happen due to huge data sets if (isset($item->custom_button) && isset($item->custom_button['name'])) @@ -939,19 +945,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $data['libraries'] = ''; } - // Set the custom_button items to data. - if (isset($data['custom_button']) && is_array($data['custom_button'])) - { - $custom_button = new JRegistry; - $custom_button->loadArray($data['custom_button']); - $data['custom_button'] = (string) $custom_button; - } - elseif (!isset($data['custom_button'])) - { - // Set the empty custom_button to data - $data['custom_button'] = ''; - } - // Set the custom_get items to data. if (isset($data['custom_get']) && is_array($data['custom_get'])) { @@ -965,6 +958,19 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $data['custom_get'] = ''; } + // Set the custom_button items to data. + if (isset($data['custom_button']) && is_array($data['custom_button'])) + { + $custom_button = new JRegistry; + $custom_button->loadArray($data['custom_button']); + $data['custom_button'] = (string) $custom_button; + } + elseif (!isset($data['custom_button'])) + { + // Set the empty custom_button to data + $data['custom_button'] = ''; + } + // Set the php_controller string to base64 string. if (isset($data['php_controller'])) { @@ -983,6 +989,30 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $data['php_model'] = base64_encode($data['php_model']); } + // Set the js_document string to base64 string. + if (isset($data['js_document'])) + { + $data['js_document'] = base64_encode($data['js_document']); + } + + // Set the javascript_file string to base64 string. + if (isset($data['javascript_file'])) + { + $data['javascript_file'] = base64_encode($data['javascript_file']); + } + + // Set the css_document string to base64 string. + if (isset($data['css_document'])) + { + $data['css_document'] = base64_encode($data['css_document']); + } + + // Set the css string to base64 string. + if (isset($data['css'])) + { + $data['css'] = base64_encode($data['css']); + } + // Set the php_document string to base64 string. if (isset($data['php_document'])) { @@ -1005,24 +1035,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin if (isset($data['php_jview'])) { $data['php_jview'] = base64_encode($data['php_jview']); - } - - // Set the js_document string to base64 string. - if (isset($data['js_document'])) - { - $data['js_document'] = base64_encode($data['js_document']); - } - - // Set the css_document string to base64 string. - if (isset($data['css_document'])) - { - $data['css_document'] = base64_encode($data['css_document']); - } - - // Set the css string to base64 string. - if (isset($data['css'])) - { - $data['css'] = base64_encode($data['css']); } // Set the Params Items to data diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php index b7197b039..0488a949f 100644 --- a/admin/models/custom_admin_views.php +++ b/admin/models/custom_admin_views.php @@ -272,6 +272,14 @@ class ComponentbuilderModelCustom_admin_views extends JModelList $item->default = base64_decode($item->default); // decode php_model $item->php_model = base64_decode($item->php_model); + // decode js_document + $item->js_document = base64_decode($item->js_document); + // decode javascript_file + $item->javascript_file = base64_decode($item->javascript_file); + // decode css_document + $item->css_document = base64_decode($item->css_document); + // decode css + $item->css = base64_decode($item->css); // decode php_document $item->php_document = base64_decode($item->php_document); // decode php_view @@ -280,12 +288,6 @@ class ComponentbuilderModelCustom_admin_views extends JModelList $item->php_jview_display = base64_decode($item->php_jview_display); // decode php_jview $item->php_jview = base64_decode($item->php_jview); - // decode js_document - $item->js_document = base64_decode($item->js_document); - // decode css_document - $item->css_document = base64_decode($item->css_document); - // decode css - $item->css = base64_decode($item->css); // unset the values we don't want exported. unset($item->asset_id); unset($item->checked_out); diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index b7a7378e4..06ccd53d2 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -139,7 +139,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVzwfields() + public function getVzyfields() { // Get the user object. $user = JFactory::getUser(); @@ -223,13 +223,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin foreach ($items as $nr => &$item) { // convert datatype - $item->datatype = $this->selectionTranslationVzwfields($item->datatype, 'datatype'); + $item->datatype = $this->selectionTranslationVzyfields($item->datatype, 'datatype'); // convert indexes - $item->indexes = $this->selectionTranslationVzwfields($item->indexes, 'indexes'); + $item->indexes = $this->selectionTranslationVzyfields($item->indexes, 'indexes'); // convert null_switch - $item->null_switch = $this->selectionTranslationVzwfields($item->null_switch, 'null_switch'); + $item->null_switch = $this->selectionTranslationVzyfields($item->null_switch, 'null_switch'); // convert store - $item->store = $this->selectionTranslationVzwfields($item->store, 'store'); + $item->store = $this->selectionTranslationVzyfields($item->store, 'store'); } } @@ -243,7 +243,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return translatable string */ - public function selectionTranslationVzwfields($value,$name) + public function selectionTranslationVzyfields($value,$name) { // Array of datatype language strings if ($name === 'datatype') diff --git a/admin/models/forms/custom_admin_view.js b/admin/models/forms/custom_admin_view.js index f9e24be51..0dfdfd10a 100644 --- a/admin/models/forms/custom_admin_view.js +++ b/admin/models/forms/custom_admin_view.js @@ -30,8 +30,9 @@ jform_vvvvvydvxy_required = false; jform_vvvvvyevxz_required = false; jform_vvvvvyfvya_required = false; jform_vvvvvygvyb_required = false; -jform_vvvvvygvyc_required = false; +jform_vvvvvyhvyc_required = false; jform_vvvvvyhvyd_required = false; +jform_vvvvvyivye_required = false; // Initial Script jQuery(document).ready(function() @@ -51,14 +52,17 @@ jQuery(document).ready(function() var add_css_document_vvvvvye = jQuery("#jform_add_css_document input[type='radio']:checked").val(); vvvvvye(add_css_document_vvvvvye); - var add_js_document_vvvvvyf = jQuery("#jform_add_js_document input[type='radio']:checked").val(); - vvvvvyf(add_js_document_vvvvvyf); + var add_javascript_file_vvvvvyf = jQuery("#jform_add_javascript_file input[type='radio']:checked").val(); + vvvvvyf(add_javascript_file_vvvvvyf); - var add_custom_button_vvvvvyg = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); - vvvvvyg(add_custom_button_vvvvvyg); + var add_js_document_vvvvvyg = jQuery("#jform_add_js_document input[type='radio']:checked").val(); + vvvvvyg(add_js_document_vvvvvyg); - var add_css_vvvvvyh = jQuery("#jform_add_css input[type='radio']:checked").val(); - vvvvvyh(add_css_vvvvvyh); + var add_custom_button_vvvvvyh = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); + vvvvvyh(add_custom_button_vvvvvyh); + + var add_css_vvvvvyi = jQuery("#jform_add_css input[type='radio']:checked").val(); + vvvvvyi(add_css_vvvvvyi); }); // the vvvvvya function @@ -217,61 +221,92 @@ function vvvvvye(add_css_document_vvvvvye) } // the vvvvvyf function -function vvvvvyf(add_js_document_vvvvvyf) +function vvvvvyf(add_javascript_file_vvvvvyf) { // set the function logic - if (add_js_document_vvvvvyf == 1) + if (add_javascript_file_vvvvvyf == 1) { - jQuery('#jform_js_document').closest('.control-group').show(); + jQuery('#jform_javascript_file').closest('.control-group').show(); if (jform_vvvvvyfvya_required) { - updateFieldRequired('js_document',0); - jQuery('#jform_js_document').prop('required','required'); - jQuery('#jform_js_document').attr('aria-required',true); - jQuery('#jform_js_document').addClass('required'); + updateFieldRequired('javascript_file',0); + jQuery('#jform_javascript_file').prop('required','required'); + jQuery('#jform_javascript_file').attr('aria-required',true); + jQuery('#jform_javascript_file').addClass('required'); jform_vvvvvyfvya_required = false; } } else { - jQuery('#jform_js_document').closest('.control-group').hide(); + jQuery('#jform_javascript_file').closest('.control-group').hide(); if (!jform_vvvvvyfvya_required) { - updateFieldRequired('js_document',1); - jQuery('#jform_js_document').removeAttr('required'); - jQuery('#jform_js_document').removeAttr('aria-required'); - jQuery('#jform_js_document').removeClass('required'); + updateFieldRequired('javascript_file',1); + jQuery('#jform_javascript_file').removeAttr('required'); + jQuery('#jform_javascript_file').removeAttr('aria-required'); + jQuery('#jform_javascript_file').removeClass('required'); jform_vvvvvyfvya_required = true; } } } // the vvvvvyg function -function vvvvvyg(add_custom_button_vvvvvyg) +function vvvvvyg(add_js_document_vvvvvyg) { // set the function logic - if (add_custom_button_vvvvvyg == 1) + if (add_js_document_vvvvvyg == 1) + { + jQuery('#jform_js_document').closest('.control-group').show(); + if (jform_vvvvvygvyb_required) + { + updateFieldRequired('js_document',0); + jQuery('#jform_js_document').prop('required','required'); + jQuery('#jform_js_document').attr('aria-required',true); + jQuery('#jform_js_document').addClass('required'); + jform_vvvvvygvyb_required = false; + } + + } + else + { + jQuery('#jform_js_document').closest('.control-group').hide(); + if (!jform_vvvvvygvyb_required) + { + updateFieldRequired('js_document',1); + jQuery('#jform_js_document').removeAttr('required'); + jQuery('#jform_js_document').removeAttr('aria-required'); + jQuery('#jform_js_document').removeClass('required'); + jform_vvvvvygvyb_required = true; + } + } +} + +// the vvvvvyh function +function vvvvvyh(add_custom_button_vvvvvyh) +{ + // set the function logic + if (add_custom_button_vvvvvyh == 1) { jQuery('#jform_custom_button-lbl').closest('.control-group').show(); jQuery('#jform_php_controller').closest('.control-group').show(); - if (jform_vvvvvygvyb_required) + if (jform_vvvvvyhvyc_required) { updateFieldRequired('php_controller',0); jQuery('#jform_php_controller').prop('required','required'); jQuery('#jform_php_controller').attr('aria-required',true); jQuery('#jform_php_controller').addClass('required'); - jform_vvvvvygvyb_required = false; + jform_vvvvvyhvyc_required = false; } jQuery('#jform_php_model').closest('.control-group').show(); - if (jform_vvvvvygvyc_required) + if (jform_vvvvvyhvyd_required) { updateFieldRequired('php_model',0); jQuery('#jform_php_model').prop('required','required'); jQuery('#jform_php_model').attr('aria-required',true); jQuery('#jform_php_model').addClass('required'); - jform_vvvvvygvyc_required = false; + jform_vvvvvyhvyd_required = false; } } @@ -279,53 +314,53 @@ function vvvvvyg(add_custom_button_vvvvvyg) { jQuery('#jform_custom_button-lbl').closest('.control-group').hide(); jQuery('#jform_php_controller').closest('.control-group').hide(); - if (!jform_vvvvvygvyb_required) + if (!jform_vvvvvyhvyc_required) { updateFieldRequired('php_controller',1); jQuery('#jform_php_controller').removeAttr('required'); jQuery('#jform_php_controller').removeAttr('aria-required'); jQuery('#jform_php_controller').removeClass('required'); - jform_vvvvvygvyb_required = true; + jform_vvvvvyhvyc_required = true; } jQuery('#jform_php_model').closest('.control-group').hide(); - if (!jform_vvvvvygvyc_required) + if (!jform_vvvvvyhvyd_required) { updateFieldRequired('php_model',1); jQuery('#jform_php_model').removeAttr('required'); jQuery('#jform_php_model').removeAttr('aria-required'); jQuery('#jform_php_model').removeClass('required'); - jform_vvvvvygvyc_required = true; + jform_vvvvvyhvyd_required = true; } } } -// the vvvvvyh function -function vvvvvyh(add_css_vvvvvyh) +// the vvvvvyi function +function vvvvvyi(add_css_vvvvvyi) { // set the function logic - if (add_css_vvvvvyh == 1) + if (add_css_vvvvvyi == 1) { jQuery('#jform_css').closest('.control-group').show(); - if (jform_vvvvvyhvyd_required) + if (jform_vvvvvyivye_required) { updateFieldRequired('css',0); jQuery('#jform_css').prop('required','required'); jQuery('#jform_css').attr('aria-required',true); jQuery('#jform_css').addClass('required'); - jform_vvvvvyhvyd_required = false; + jform_vvvvvyivye_required = false; } } else { jQuery('#jform_css').closest('.control-group').hide(); - if (!jform_vvvvvyhvyd_required) + if (!jform_vvvvvyivye_required) { updateFieldRequired('css',1); jQuery('#jform_css').removeAttr('required'); jQuery('#jform_css').removeAttr('aria-required'); jQuery('#jform_css').removeClass('required'); - jform_vvvvvyhvyd_required = true; + jform_vvvvvyivye_required = true; } } } diff --git a/admin/models/forms/custom_admin_view.xml b/admin/models/forms/custom_admin_view.xml index f127649a2..952e2ac8b 100644 --- a/admin/models/forms/custom_admin_view.xml +++ b/admin/models/forms/custom_admin_view.xml @@ -138,30 +138,10 @@ multiple="false" required="false" button="true" /> - - - - - - - + @@ -169,10 +149,16 @@ - + + + @@ -191,6 +177,31 @@ + + + + + + + + + + - + + + + + + + + + @@ -223,27 +251,10 @@ filter="raw" hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_CONTROLLER_HINT" required="false" /> - + - - - - - - - - @@ -257,6 +268,159 @@ label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_SNIPPET_USAGE_LABEL" heading="h4" class="snippet-usage note_snippet_usage" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/admin/models/forms/custom_code.js b/admin/models/forms/custom_code.js index 397eddabe..51ab02bb6 100644 --- a/admin/models/forms/custom_code.js +++ b/admin/models/forms/custom_code.js @@ -23,43 +23,43 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvzqvzi_required = false; -jform_vvvvvzrvzj_required = false; -jform_vvvvvzrvzk_required = false; -jform_vvvvvzrvzl_required = false; +jform_vvvvvzsvzk_required = false; +jform_vvvvvztvzl_required = false; +jform_vvvvvztvzm_required = false; +jform_vvvvvztvzn_required = false; // Initial Script jQuery(document).ready(function() { - var target_vvvvvzq = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvvzq(target_vvvvvzq); - - var target_vvvvvzr = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvvzr(target_vvvvvzr); - var target_vvvvvzs = jQuery("#jform_target input[type='radio']:checked").val(); - var type_vvvvvzs = jQuery("#jform_type input[type='radio']:checked").val(); - vvvvvzs(target_vvvvvzs,type_vvvvvzs); + vvvvvzs(target_vvvvvzs); - var type_vvvvvzt = jQuery("#jform_type input[type='radio']:checked").val(); var target_vvvvvzt = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvvzt(type_vvvvvzt,target_vvvvvzt); + vvvvvzt(target_vvvvvzt); + + var target_vvvvvzu = jQuery("#jform_target input[type='radio']:checked").val(); + var type_vvvvvzu = jQuery("#jform_type input[type='radio']:checked").val(); + vvvvvzu(target_vvvvvzu,type_vvvvvzu); + + var type_vvvvvzv = jQuery("#jform_type input[type='radio']:checked").val(); + var target_vvvvvzv = jQuery("#jform_target input[type='radio']:checked").val(); + vvvvvzv(type_vvvvvzv,target_vvvvvzv); }); -// the vvvvvzq function -function vvvvvzq(target_vvvvvzq) +// the vvvvvzs function +function vvvvvzs(target_vvvvvzs) { // set the function logic - if (target_vvvvvzq == 2) + if (target_vvvvvzs == 2) { jQuery('#jform_function_name').closest('.control-group').show(); - if (jform_vvvvvzqvzi_required) + if (jform_vvvvvzsvzk_required) { updateFieldRequired('function_name',0); jQuery('#jform_function_name').prop('required','required'); jQuery('#jform_function_name').attr('aria-required',true); jQuery('#jform_function_name').addClass('required'); - jform_vvvvvzqvzi_required = false; + jform_vvvvvzsvzk_required = false; } jQuery('.note_jcb_placeholder').closest('.control-group').show(); @@ -68,99 +68,99 @@ function vvvvvzq(target_vvvvvzq) else { jQuery('#jform_function_name').closest('.control-group').hide(); - if (!jform_vvvvvzqvzi_required) + if (!jform_vvvvvzsvzk_required) { updateFieldRequired('function_name',1); jQuery('#jform_function_name').removeAttr('required'); jQuery('#jform_function_name').removeAttr('aria-required'); jQuery('#jform_function_name').removeClass('required'); - jform_vvvvvzqvzi_required = true; + jform_vvvvvzsvzk_required = true; } jQuery('.note_jcb_placeholder').closest('.control-group').hide(); jQuery('#jform_system_name').closest('.control-group').hide(); } } -// the vvvvvzr function -function vvvvvzr(target_vvvvvzr) +// the vvvvvzt function +function vvvvvzt(target_vvvvvzt) { // set the function logic - if (target_vvvvvzr == 1) + if (target_vvvvvzt == 1) { jQuery('#jform_component').closest('.control-group').show(); - if (jform_vvvvvzrvzj_required) + if (jform_vvvvvztvzl_required) { updateFieldRequired('component',0); jQuery('#jform_component').prop('required','required'); jQuery('#jform_component').attr('aria-required',true); jQuery('#jform_component').addClass('required'); - jform_vvvvvzrvzj_required = false; + jform_vvvvvztvzl_required = false; } jQuery('#jform_path').closest('.control-group').show(); - if (jform_vvvvvzrvzk_required) + if (jform_vvvvvztvzm_required) { updateFieldRequired('path',0); jQuery('#jform_path').prop('required','required'); jQuery('#jform_path').attr('aria-required',true); jQuery('#jform_path').addClass('required'); - jform_vvvvvzrvzk_required = false; + jform_vvvvvztvzm_required = false; } jQuery('#jform_from_line').closest('.control-group').show(); jQuery('#jform_hashtarget').closest('.control-group').show(); jQuery('#jform_to_line').closest('.control-group').show(); jQuery('#jform_type').closest('.control-group').show(); - if (jform_vvvvvzrvzl_required) + if (jform_vvvvvztvzn_required) { updateFieldRequired('type',0); jQuery('#jform_type').prop('required','required'); jQuery('#jform_type').attr('aria-required',true); jQuery('#jform_type').addClass('required'); - jform_vvvvvzrvzl_required = false; + jform_vvvvvztvzn_required = false; } } else { jQuery('#jform_component').closest('.control-group').hide(); - if (!jform_vvvvvzrvzj_required) + if (!jform_vvvvvztvzl_required) { updateFieldRequired('component',1); jQuery('#jform_component').removeAttr('required'); jQuery('#jform_component').removeAttr('aria-required'); jQuery('#jform_component').removeClass('required'); - jform_vvvvvzrvzj_required = true; + jform_vvvvvztvzl_required = true; } jQuery('#jform_path').closest('.control-group').hide(); - if (!jform_vvvvvzrvzk_required) + if (!jform_vvvvvztvzm_required) { updateFieldRequired('path',1); jQuery('#jform_path').removeAttr('required'); jQuery('#jform_path').removeAttr('aria-required'); jQuery('#jform_path').removeClass('required'); - jform_vvvvvzrvzk_required = true; + jform_vvvvvztvzm_required = true; } jQuery('#jform_from_line').closest('.control-group').hide(); jQuery('#jform_hashtarget').closest('.control-group').hide(); jQuery('#jform_to_line').closest('.control-group').hide(); jQuery('#jform_type').closest('.control-group').hide(); - if (!jform_vvvvvzrvzl_required) + if (!jform_vvvvvztvzn_required) { updateFieldRequired('type',1); jQuery('#jform_type').removeAttr('required'); jQuery('#jform_type').removeAttr('aria-required'); jQuery('#jform_type').removeClass('required'); - jform_vvvvvzrvzl_required = true; + jform_vvvvvztvzn_required = true; } } } -// the vvvvvzs function -function vvvvvzs(target_vvvvvzs,type_vvvvvzs) +// the vvvvvzu function +function vvvvvzu(target_vvvvvzu,type_vvvvvzu) { // set the function logic - if (target_vvvvvzs == 1 && type_vvvvvzs == 1) + if (target_vvvvvzu == 1 && type_vvvvvzu == 1) { jQuery('#jform_hashendtarget').closest('.control-group').show(); jQuery('#jform_to_line').closest('.control-group').show(); @@ -172,11 +172,11 @@ function vvvvvzs(target_vvvvvzs,type_vvvvvzs) } } -// the vvvvvzt function -function vvvvvzt(type_vvvvvzt,target_vvvvvzt) +// the vvvvvzv function +function vvvvvzv(type_vvvvvzv,target_vvvvvzv) { // set the function logic - if (type_vvvvvzt == 1 && target_vvvvvzt == 1) + if (type_vvvvvzv == 1 && target_vvvvvzv == 1) { jQuery('#jform_hashendtarget').closest('.control-group').show(); jQuery('#jform_to_line').closest('.control-group').show(); diff --git a/admin/models/forms/dynamic_get.js b/admin/models/forms/dynamic_get.js index 293c5a5e4..158c82b3c 100644 --- a/admin/models/forms/dynamic_get.js +++ b/admin/models/forms/dynamic_get.js @@ -23,36 +23,30 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvyuvyq_required = false; -jform_vvvvvyvvyr_required = false; jform_vvvvvywvys_required = false; jform_vvvvvyxvyt_required = false; jform_vvvvvyyvyu_required = false; jform_vvvvvyzvyv_required = false; -jform_vvvvvzevyw_required = false; -jform_vvvvvzgvyx_required = false; -jform_vvvvvzhvyy_required = false; -jform_vvvvvzjvyz_required = false; +jform_vvvvvzavyw_required = false; +jform_vvvvvzbvyx_required = false; +jform_vvvvvzgvyy_required = false; +jform_vvvvvzivyz_required = false; jform_vvvvvzjvza_required = false; -jform_vvvvvzkvzb_required = false; +jform_vvvvvzlvzb_required = false; jform_vvvvvzlvzc_required = false; jform_vvvvvzmvzd_required = false; -jform_vvvvvzovze_required = false; +jform_vvvvvznvze_required = false; jform_vvvvvzovzf_required = false; -jform_vvvvvzovzg_required = false; -jform_vvvvvzpvzh_required = false; +jform_vvvvvzqvzg_required = false; +jform_vvvvvzqvzh_required = false; +jform_vvvvvzqvzi_required = false; +jform_vvvvvzrvzj_required = false; // Initial Script jQuery(document).ready(function() { - var gettype_vvvvvyu = jQuery("#jform_gettype").val(); - vvvvvyu(gettype_vvvvvyu); - - var main_source_vvvvvyv = jQuery("#jform_main_source").val(); - vvvvvyv(main_source_vvvvvyv); - - var main_source_vvvvvyw = jQuery("#jform_main_source").val(); - vvvvvyw(main_source_vvvvvyw); + var gettype_vvvvvyw = jQuery("#jform_gettype").val(); + vvvvvyw(gettype_vvvvvyw); var main_source_vvvvvyx = jQuery("#jform_main_source").val(); vvvvvyx(main_source_vvvvvyx); @@ -60,212 +54,108 @@ jQuery(document).ready(function() var main_source_vvvvvyy = jQuery("#jform_main_source").val(); vvvvvyy(main_source_vvvvvyy); - var addcalculation_vvvvvyz = jQuery("#jform_addcalculation input[type='radio']:checked").val(); - vvvvvyz(addcalculation_vvvvvyz); + var main_source_vvvvvyz = jQuery("#jform_main_source").val(); + vvvvvyz(main_source_vvvvvyz); - var addcalculation_vvvvvza = jQuery("#jform_addcalculation input[type='radio']:checked").val(); - var gettype_vvvvvza = jQuery("#jform_gettype").val(); - vvvvvza(addcalculation_vvvvvza,gettype_vvvvvza); + var main_source_vvvvvza = jQuery("#jform_main_source").val(); + vvvvvza(main_source_vvvvvza); var addcalculation_vvvvvzb = jQuery("#jform_addcalculation input[type='radio']:checked").val(); - var gettype_vvvvvzb = jQuery("#jform_gettype").val(); - vvvvvzb(addcalculation_vvvvvzb,gettype_vvvvvzb); + vvvvvzb(addcalculation_vvvvvzb); - var main_source_vvvvvze = jQuery("#jform_main_source").val(); - vvvvvze(main_source_vvvvvze); + var addcalculation_vvvvvzc = jQuery("#jform_addcalculation input[type='radio']:checked").val(); + var gettype_vvvvvzc = jQuery("#jform_gettype").val(); + vvvvvzc(addcalculation_vvvvvzc,gettype_vvvvvzc); - var main_source_vvvvvzf = jQuery("#jform_main_source").val(); - vvvvvzf(main_source_vvvvvzf); + var addcalculation_vvvvvzd = jQuery("#jform_addcalculation input[type='radio']:checked").val(); + var gettype_vvvvvzd = jQuery("#jform_gettype").val(); + vvvvvzd(addcalculation_vvvvvzd,gettype_vvvvvzd); - var add_php_before_getitem_vvvvvzg = jQuery("#jform_add_php_before_getitem input[type='radio']:checked").val(); - var gettype_vvvvvzg = jQuery("#jform_gettype").val(); - vvvvvzg(add_php_before_getitem_vvvvvzg,gettype_vvvvvzg); + var main_source_vvvvvzg = jQuery("#jform_main_source").val(); + vvvvvzg(main_source_vvvvvzg); - var add_php_after_getitem_vvvvvzh = jQuery("#jform_add_php_after_getitem input[type='radio']:checked").val(); - var gettype_vvvvvzh = jQuery("#jform_gettype").val(); - vvvvvzh(add_php_after_getitem_vvvvvzh,gettype_vvvvvzh); + var main_source_vvvvvzh = jQuery("#jform_main_source").val(); + vvvvvzh(main_source_vvvvvzh); + var add_php_before_getitem_vvvvvzi = jQuery("#jform_add_php_before_getitem input[type='radio']:checked").val(); + var gettype_vvvvvzi = jQuery("#jform_gettype").val(); + vvvvvzi(add_php_before_getitem_vvvvvzi,gettype_vvvvvzi); + + var add_php_after_getitem_vvvvvzj = jQuery("#jform_add_php_after_getitem input[type='radio']:checked").val(); var gettype_vvvvvzj = jQuery("#jform_gettype").val(); - vvvvvzj(gettype_vvvvvzj); + vvvvvzj(add_php_after_getitem_vvvvvzj,gettype_vvvvvzj); - var add_php_getlistquery_vvvvvzk = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val(); - var gettype_vvvvvzk = jQuery("#jform_gettype").val(); - vvvvvzk(add_php_getlistquery_vvvvvzk,gettype_vvvvvzk); - - var add_php_before_getitems_vvvvvzl = jQuery("#jform_add_php_before_getitems input[type='radio']:checked").val(); var gettype_vvvvvzl = jQuery("#jform_gettype").val(); - vvvvvzl(add_php_before_getitems_vvvvvzl,gettype_vvvvvzl); + vvvvvzl(gettype_vvvvvzl); - var add_php_after_getitems_vvvvvzm = jQuery("#jform_add_php_after_getitems input[type='radio']:checked").val(); + var add_php_getlistquery_vvvvvzm = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val(); var gettype_vvvvvzm = jQuery("#jform_gettype").val(); - vvvvvzm(add_php_after_getitems_vvvvvzm,gettype_vvvvvzm); + vvvvvzm(add_php_getlistquery_vvvvvzm,gettype_vvvvvzm); + var add_php_before_getitems_vvvvvzn = jQuery("#jform_add_php_before_getitems input[type='radio']:checked").val(); + var gettype_vvvvvzn = jQuery("#jform_gettype").val(); + vvvvvzn(add_php_before_getitems_vvvvvzn,gettype_vvvvvzn); + + var add_php_after_getitems_vvvvvzo = jQuery("#jform_add_php_after_getitems input[type='radio']:checked").val(); var gettype_vvvvvzo = jQuery("#jform_gettype").val(); - vvvvvzo(gettype_vvvvvzo); + vvvvvzo(add_php_after_getitems_vvvvvzo,gettype_vvvvvzo); - var gettype_vvvvvzp = jQuery("#jform_gettype").val(); - vvvvvzp(gettype_vvvvvzp); + var gettype_vvvvvzq = jQuery("#jform_gettype").val(); + vvvvvzq(gettype_vvvvvzq); + + var gettype_vvvvvzr = jQuery("#jform_gettype").val(); + vvvvvzr(gettype_vvvvvzr); }); -// the vvvvvyu function -function vvvvvyu(gettype_vvvvvyu) +// the vvvvvyw function +function vvvvvyw(gettype_vvvvvyw) { - if (isSet(gettype_vvvvvyu) && gettype_vvvvvyu.constructor !== Array) + if (isSet(gettype_vvvvvyw) && gettype_vvvvvyw.constructor !== Array) { - var temp_vvvvvyu = gettype_vvvvvyu; - var gettype_vvvvvyu = []; - gettype_vvvvvyu.push(temp_vvvvvyu); + var temp_vvvvvyw = gettype_vvvvvyw; + var gettype_vvvvvyw = []; + gettype_vvvvvyw.push(temp_vvvvvyw); } - else if (!isSet(gettype_vvvvvyu)) + else if (!isSet(gettype_vvvvvyw)) { - var gettype_vvvvvyu = []; + var gettype_vvvvvyw = []; } - var gettype = gettype_vvvvvyu.some(gettype_vvvvvyu_SomeFunc); + var gettype = gettype_vvvvvyw.some(gettype_vvvvvyw_SomeFunc); // set this function logic if (gettype) { jQuery('#jform_getcustom').closest('.control-group').show(); - if (jform_vvvvvyuvyq_required) + if (jform_vvvvvywvys_required) { updateFieldRequired('getcustom',0); jQuery('#jform_getcustom').prop('required','required'); jQuery('#jform_getcustom').attr('aria-required',true); jQuery('#jform_getcustom').addClass('required'); - jform_vvvvvyuvyq_required = false; - } - - } - else - { - jQuery('#jform_getcustom').closest('.control-group').hide(); - if (!jform_vvvvvyuvyq_required) - { - updateFieldRequired('getcustom',1); - jQuery('#jform_getcustom').removeAttr('required'); - jQuery('#jform_getcustom').removeAttr('aria-required'); - jQuery('#jform_getcustom').removeClass('required'); - jform_vvvvvyuvyq_required = true; - } - } -} - -// the vvvvvyu Some function -function gettype_vvvvvyu_SomeFunc(gettype_vvvvvyu) -{ - // set the function logic - if (gettype_vvvvvyu == 3 || gettype_vvvvvyu == 4) - { - return true; - } - return false; -} - -// the vvvvvyv function -function vvvvvyv(main_source_vvvvvyv) -{ - if (isSet(main_source_vvvvvyv) && main_source_vvvvvyv.constructor !== Array) - { - var temp_vvvvvyv = main_source_vvvvvyv; - var main_source_vvvvvyv = []; - main_source_vvvvvyv.push(temp_vvvvvyv); - } - else if (!isSet(main_source_vvvvvyv)) - { - var main_source_vvvvvyv = []; - } - var main_source = main_source_vvvvvyv.some(main_source_vvvvvyv_SomeFunc); - - - // set this function logic - if (main_source) - { - jQuery('#jform_view_table_main').closest('.control-group').show(); - if (jform_vvvvvyvvyr_required) - { - updateFieldRequired('view_table_main',0); - jQuery('#jform_view_table_main').prop('required','required'); - jQuery('#jform_view_table_main').attr('aria-required',true); - jQuery('#jform_view_table_main').addClass('required'); - jform_vvvvvyvvyr_required = false; - } - - } - else - { - jQuery('#jform_view_table_main').closest('.control-group').hide(); - if (!jform_vvvvvyvvyr_required) - { - updateFieldRequired('view_table_main',1); - jQuery('#jform_view_table_main').removeAttr('required'); - jQuery('#jform_view_table_main').removeAttr('aria-required'); - jQuery('#jform_view_table_main').removeClass('required'); - jform_vvvvvyvvyr_required = true; - } - } -} - -// the vvvvvyv Some function -function main_source_vvvvvyv_SomeFunc(main_source_vvvvvyv) -{ - // set the function logic - if (main_source_vvvvvyv == 1) - { - return true; - } - return false; -} - -// the vvvvvyw function -function vvvvvyw(main_source_vvvvvyw) -{ - if (isSet(main_source_vvvvvyw) && main_source_vvvvvyw.constructor !== Array) - { - var temp_vvvvvyw = main_source_vvvvvyw; - var main_source_vvvvvyw = []; - main_source_vvvvvyw.push(temp_vvvvvyw); - } - else if (!isSet(main_source_vvvvvyw)) - { - var main_source_vvvvvyw = []; - } - var main_source = main_source_vvvvvyw.some(main_source_vvvvvyw_SomeFunc); - - - // set this function logic - if (main_source) - { - jQuery('#jform_view_selection').closest('.control-group').show(); - if (jform_vvvvvywvys_required) - { - updateFieldRequired('view_selection',0); - jQuery('#jform_view_selection').prop('required','required'); - jQuery('#jform_view_selection').attr('aria-required',true); - jQuery('#jform_view_selection').addClass('required'); jform_vvvvvywvys_required = false; } } else { - jQuery('#jform_view_selection').closest('.control-group').hide(); + jQuery('#jform_getcustom').closest('.control-group').hide(); if (!jform_vvvvvywvys_required) { - updateFieldRequired('view_selection',1); - jQuery('#jform_view_selection').removeAttr('required'); - jQuery('#jform_view_selection').removeAttr('aria-required'); - jQuery('#jform_view_selection').removeClass('required'); + updateFieldRequired('getcustom',1); + jQuery('#jform_getcustom').removeAttr('required'); + jQuery('#jform_getcustom').removeAttr('aria-required'); + jQuery('#jform_getcustom').removeClass('required'); jform_vvvvvywvys_required = true; } } } // the vvvvvyw Some function -function main_source_vvvvvyw_SomeFunc(main_source_vvvvvyw) +function gettype_vvvvvyw_SomeFunc(gettype_vvvvvyw) { // set the function logic - if (main_source_vvvvvyw == 1) + if (gettype_vvvvvyw == 3 || gettype_vvvvvyw == 4) { return true; } @@ -291,26 +181,26 @@ function vvvvvyx(main_source_vvvvvyx) // set this function logic if (main_source) { - jQuery('#jform_db_table_main').closest('.control-group').show(); + jQuery('#jform_view_table_main').closest('.control-group').show(); if (jform_vvvvvyxvyt_required) { - updateFieldRequired('db_table_main',0); - jQuery('#jform_db_table_main').prop('required','required'); - jQuery('#jform_db_table_main').attr('aria-required',true); - jQuery('#jform_db_table_main').addClass('required'); + updateFieldRequired('view_table_main',0); + jQuery('#jform_view_table_main').prop('required','required'); + jQuery('#jform_view_table_main').attr('aria-required',true); + jQuery('#jform_view_table_main').addClass('required'); jform_vvvvvyxvyt_required = false; } } else { - jQuery('#jform_db_table_main').closest('.control-group').hide(); + jQuery('#jform_view_table_main').closest('.control-group').hide(); if (!jform_vvvvvyxvyt_required) { - updateFieldRequired('db_table_main',1); - jQuery('#jform_db_table_main').removeAttr('required'); - jQuery('#jform_db_table_main').removeAttr('aria-required'); - jQuery('#jform_db_table_main').removeClass('required'); + updateFieldRequired('view_table_main',1); + jQuery('#jform_view_table_main').removeAttr('required'); + jQuery('#jform_view_table_main').removeAttr('aria-required'); + jQuery('#jform_view_table_main').removeClass('required'); jform_vvvvvyxvyt_required = true; } } @@ -320,7 +210,7 @@ function vvvvvyx(main_source_vvvvvyx) function main_source_vvvvvyx_SomeFunc(main_source_vvvvvyx) { // set the function logic - if (main_source_vvvvvyx == 2) + if (main_source_vvvvvyx == 1) { return true; } @@ -346,26 +236,26 @@ function vvvvvyy(main_source_vvvvvyy) // set this function logic if (main_source) { - jQuery('#jform_db_selection').closest('.control-group').show(); + jQuery('#jform_view_selection').closest('.control-group').show(); if (jform_vvvvvyyvyu_required) { - updateFieldRequired('db_selection',0); - jQuery('#jform_db_selection').prop('required','required'); - jQuery('#jform_db_selection').attr('aria-required',true); - jQuery('#jform_db_selection').addClass('required'); + updateFieldRequired('view_selection',0); + jQuery('#jform_view_selection').prop('required','required'); + jQuery('#jform_view_selection').attr('aria-required',true); + jQuery('#jform_view_selection').addClass('required'); jform_vvvvvyyvyu_required = false; } } else { - jQuery('#jform_db_selection').closest('.control-group').hide(); + jQuery('#jform_view_selection').closest('.control-group').hide(); if (!jform_vvvvvyyvyu_required) { - updateFieldRequired('db_selection',1); - jQuery('#jform_db_selection').removeAttr('required'); - jQuery('#jform_db_selection').removeAttr('aria-required'); - jQuery('#jform_db_selection').removeClass('required'); + updateFieldRequired('view_selection',1); + jQuery('#jform_view_selection').removeAttr('required'); + jQuery('#jform_view_selection').removeAttr('aria-required'); + jQuery('#jform_view_selection').removeClass('required'); jform_vvvvvyyvyu_required = true; } } @@ -375,7 +265,7 @@ function vvvvvyy(main_source_vvvvvyy) function main_source_vvvvvyy_SomeFunc(main_source_vvvvvyy) { // set the function logic - if (main_source_vvvvvyy == 2) + if (main_source_vvvvvyy == 1) { return true; } @@ -383,62 +273,172 @@ function main_source_vvvvvyy_SomeFunc(main_source_vvvvvyy) } // the vvvvvyz function -function vvvvvyz(addcalculation_vvvvvyz) +function vvvvvyz(main_source_vvvvvyz) { - // set the function logic - if (addcalculation_vvvvvyz == 1) + if (isSet(main_source_vvvvvyz) && main_source_vvvvvyz.constructor !== Array) { - jQuery('#jform_php_calculation').closest('.control-group').show(); + var temp_vvvvvyz = main_source_vvvvvyz; + var main_source_vvvvvyz = []; + main_source_vvvvvyz.push(temp_vvvvvyz); + } + else if (!isSet(main_source_vvvvvyz)) + { + var main_source_vvvvvyz = []; + } + var main_source = main_source_vvvvvyz.some(main_source_vvvvvyz_SomeFunc); + + + // set this function logic + if (main_source) + { + jQuery('#jform_db_table_main').closest('.control-group').show(); if (jform_vvvvvyzvyv_required) { - updateFieldRequired('php_calculation',0); - jQuery('#jform_php_calculation').prop('required','required'); - jQuery('#jform_php_calculation').attr('aria-required',true); - jQuery('#jform_php_calculation').addClass('required'); + updateFieldRequired('db_table_main',0); + jQuery('#jform_db_table_main').prop('required','required'); + jQuery('#jform_db_table_main').attr('aria-required',true); + jQuery('#jform_db_table_main').addClass('required'); jform_vvvvvyzvyv_required = false; } } else { - jQuery('#jform_php_calculation').closest('.control-group').hide(); + jQuery('#jform_db_table_main').closest('.control-group').hide(); if (!jform_vvvvvyzvyv_required) { - updateFieldRequired('php_calculation',1); - jQuery('#jform_php_calculation').removeAttr('required'); - jQuery('#jform_php_calculation').removeAttr('aria-required'); - jQuery('#jform_php_calculation').removeClass('required'); + updateFieldRequired('db_table_main',1); + jQuery('#jform_db_table_main').removeAttr('required'); + jQuery('#jform_db_table_main').removeAttr('aria-required'); + jQuery('#jform_db_table_main').removeClass('required'); jform_vvvvvyzvyv_required = true; } } } -// the vvvvvza function -function vvvvvza(addcalculation_vvvvvza,gettype_vvvvvza) +// the vvvvvyz Some function +function main_source_vvvvvyz_SomeFunc(main_source_vvvvvyz) { - if (isSet(addcalculation_vvvvvza) && addcalculation_vvvvvza.constructor !== Array) + // set the function logic + if (main_source_vvvvvyz == 2) { - var temp_vvvvvza = addcalculation_vvvvvza; - var addcalculation_vvvvvza = []; - addcalculation_vvvvvza.push(temp_vvvvvza); + return true; } - else if (!isSet(addcalculation_vvvvvza)) - { - var addcalculation_vvvvvza = []; - } - var addcalculation = addcalculation_vvvvvza.some(addcalculation_vvvvvza_SomeFunc); + return false; +} - if (isSet(gettype_vvvvvza) && gettype_vvvvvza.constructor !== Array) +// the vvvvvza function +function vvvvvza(main_source_vvvvvza) +{ + if (isSet(main_source_vvvvvza) && main_source_vvvvvza.constructor !== Array) { - var temp_vvvvvza = gettype_vvvvvza; - var gettype_vvvvvza = []; - gettype_vvvvvza.push(temp_vvvvvza); + var temp_vvvvvza = main_source_vvvvvza; + var main_source_vvvvvza = []; + main_source_vvvvvza.push(temp_vvvvvza); } - else if (!isSet(gettype_vvvvvza)) + else if (!isSet(main_source_vvvvvza)) { - var gettype_vvvvvza = []; + var main_source_vvvvvza = []; } - var gettype = gettype_vvvvvza.some(gettype_vvvvvza_SomeFunc); + var main_source = main_source_vvvvvza.some(main_source_vvvvvza_SomeFunc); + + + // set this function logic + if (main_source) + { + jQuery('#jform_db_selection').closest('.control-group').show(); + if (jform_vvvvvzavyw_required) + { + updateFieldRequired('db_selection',0); + jQuery('#jform_db_selection').prop('required','required'); + jQuery('#jform_db_selection').attr('aria-required',true); + jQuery('#jform_db_selection').addClass('required'); + jform_vvvvvzavyw_required = false; + } + + } + else + { + jQuery('#jform_db_selection').closest('.control-group').hide(); + if (!jform_vvvvvzavyw_required) + { + updateFieldRequired('db_selection',1); + jQuery('#jform_db_selection').removeAttr('required'); + jQuery('#jform_db_selection').removeAttr('aria-required'); + jQuery('#jform_db_selection').removeClass('required'); + jform_vvvvvzavyw_required = true; + } + } +} + +// the vvvvvza Some function +function main_source_vvvvvza_SomeFunc(main_source_vvvvvza) +{ + // set the function logic + if (main_source_vvvvvza == 2) + { + return true; + } + return false; +} + +// the vvvvvzb function +function vvvvvzb(addcalculation_vvvvvzb) +{ + // set the function logic + if (addcalculation_vvvvvzb == 1) + { + jQuery('#jform_php_calculation').closest('.control-group').show(); + if (jform_vvvvvzbvyx_required) + { + updateFieldRequired('php_calculation',0); + jQuery('#jform_php_calculation').prop('required','required'); + jQuery('#jform_php_calculation').attr('aria-required',true); + jQuery('#jform_php_calculation').addClass('required'); + jform_vvvvvzbvyx_required = false; + } + + } + else + { + jQuery('#jform_php_calculation').closest('.control-group').hide(); + if (!jform_vvvvvzbvyx_required) + { + updateFieldRequired('php_calculation',1); + jQuery('#jform_php_calculation').removeAttr('required'); + jQuery('#jform_php_calculation').removeAttr('aria-required'); + jQuery('#jform_php_calculation').removeClass('required'); + jform_vvvvvzbvyx_required = true; + } + } +} + +// the vvvvvzc function +function vvvvvzc(addcalculation_vvvvvzc,gettype_vvvvvzc) +{ + if (isSet(addcalculation_vvvvvzc) && addcalculation_vvvvvzc.constructor !== Array) + { + var temp_vvvvvzc = addcalculation_vvvvvzc; + var addcalculation_vvvvvzc = []; + addcalculation_vvvvvzc.push(temp_vvvvvzc); + } + else if (!isSet(addcalculation_vvvvvzc)) + { + var addcalculation_vvvvvzc = []; + } + var addcalculation = addcalculation_vvvvvzc.some(addcalculation_vvvvvzc_SomeFunc); + + if (isSet(gettype_vvvvvzc) && gettype_vvvvvzc.constructor !== Array) + { + var temp_vvvvvzc = gettype_vvvvvzc; + var gettype_vvvvvzc = []; + gettype_vvvvvzc.push(temp_vvvvvzc); + } + else if (!isSet(gettype_vvvvvzc)) + { + var gettype_vvvvvzc = []; + } + var gettype = gettype_vvvvvzc.some(gettype_vvvvvzc_SomeFunc); // set this function logic @@ -452,54 +452,54 @@ function vvvvvza(addcalculation_vvvvvza,gettype_vvvvvza) } } -// the vvvvvza Some function -function addcalculation_vvvvvza_SomeFunc(addcalculation_vvvvvza) +// the vvvvvzc Some function +function addcalculation_vvvvvzc_SomeFunc(addcalculation_vvvvvzc) { // set the function logic - if (addcalculation_vvvvvza == 1) + if (addcalculation_vvvvvzc == 1) { return true; } return false; } -// the vvvvvza Some function -function gettype_vvvvvza_SomeFunc(gettype_vvvvvza) +// the vvvvvzc Some function +function gettype_vvvvvzc_SomeFunc(gettype_vvvvvzc) { // set the function logic - if (gettype_vvvvvza == 1 || gettype_vvvvvza == 3) + if (gettype_vvvvvzc == 1 || gettype_vvvvvzc == 3) { return true; } return false; } -// the vvvvvzb function -function vvvvvzb(addcalculation_vvvvvzb,gettype_vvvvvzb) +// the vvvvvzd function +function vvvvvzd(addcalculation_vvvvvzd,gettype_vvvvvzd) { - if (isSet(addcalculation_vvvvvzb) && addcalculation_vvvvvzb.constructor !== Array) + if (isSet(addcalculation_vvvvvzd) && addcalculation_vvvvvzd.constructor !== Array) { - var temp_vvvvvzb = addcalculation_vvvvvzb; - var addcalculation_vvvvvzb = []; - addcalculation_vvvvvzb.push(temp_vvvvvzb); + var temp_vvvvvzd = addcalculation_vvvvvzd; + var addcalculation_vvvvvzd = []; + addcalculation_vvvvvzd.push(temp_vvvvvzd); } - else if (!isSet(addcalculation_vvvvvzb)) + else if (!isSet(addcalculation_vvvvvzd)) { - var addcalculation_vvvvvzb = []; + var addcalculation_vvvvvzd = []; } - var addcalculation = addcalculation_vvvvvzb.some(addcalculation_vvvvvzb_SomeFunc); + var addcalculation = addcalculation_vvvvvzd.some(addcalculation_vvvvvzd_SomeFunc); - if (isSet(gettype_vvvvvzb) && gettype_vvvvvzb.constructor !== Array) + if (isSet(gettype_vvvvvzd) && gettype_vvvvvzd.constructor !== Array) { - var temp_vvvvvzb = gettype_vvvvvzb; - var gettype_vvvvvzb = []; - gettype_vvvvvzb.push(temp_vvvvvzb); + var temp_vvvvvzd = gettype_vvvvvzd; + var gettype_vvvvvzd = []; + gettype_vvvvvzd.push(temp_vvvvvzd); } - else if (!isSet(gettype_vvvvvzb)) + else if (!isSet(gettype_vvvvvzd)) { - var gettype_vvvvvzb = []; + var gettype_vvvvvzd = []; } - var gettype = gettype_vvvvvzb.some(gettype_vvvvvzb_SomeFunc); + var gettype = gettype_vvvvvzd.some(gettype_vvvvvzd_SomeFunc); // set this function logic @@ -513,97 +513,97 @@ function vvvvvzb(addcalculation_vvvvvzb,gettype_vvvvvzb) } } -// the vvvvvzb Some function -function addcalculation_vvvvvzb_SomeFunc(addcalculation_vvvvvzb) +// the vvvvvzd Some function +function addcalculation_vvvvvzd_SomeFunc(addcalculation_vvvvvzd) { // set the function logic - if (addcalculation_vvvvvzb == 1) + if (addcalculation_vvvvvzd == 1) { return true; } return false; } -// the vvvvvzb Some function -function gettype_vvvvvzb_SomeFunc(gettype_vvvvvzb) +// the vvvvvzd Some function +function gettype_vvvvvzd_SomeFunc(gettype_vvvvvzd) { // set the function logic - if (gettype_vvvvvzb == 2 || gettype_vvvvvzb == 4) + if (gettype_vvvvvzd == 2 || gettype_vvvvvzd == 4) { return true; } return false; } -// the vvvvvze function -function vvvvvze(main_source_vvvvvze) +// the vvvvvzg function +function vvvvvzg(main_source_vvvvvzg) { - if (isSet(main_source_vvvvvze) && main_source_vvvvvze.constructor !== Array) + if (isSet(main_source_vvvvvzg) && main_source_vvvvvzg.constructor !== Array) { - var temp_vvvvvze = main_source_vvvvvze; - var main_source_vvvvvze = []; - main_source_vvvvvze.push(temp_vvvvvze); + var temp_vvvvvzg = main_source_vvvvvzg; + var main_source_vvvvvzg = []; + main_source_vvvvvzg.push(temp_vvvvvzg); } - else if (!isSet(main_source_vvvvvze)) + else if (!isSet(main_source_vvvvvzg)) { - var main_source_vvvvvze = []; + var main_source_vvvvvzg = []; } - var main_source = main_source_vvvvvze.some(main_source_vvvvvze_SomeFunc); + var main_source = main_source_vvvvvzg.some(main_source_vvvvvzg_SomeFunc); // set this function logic if (main_source) { jQuery('#jform_php_custom_get').closest('.control-group').show(); - if (jform_vvvvvzevyw_required) + if (jform_vvvvvzgvyy_required) { updateFieldRequired('php_custom_get',0); jQuery('#jform_php_custom_get').prop('required','required'); jQuery('#jform_php_custom_get').attr('aria-required',true); jQuery('#jform_php_custom_get').addClass('required'); - jform_vvvvvzevyw_required = false; + jform_vvvvvzgvyy_required = false; } } else { jQuery('#jform_php_custom_get').closest('.control-group').hide(); - if (!jform_vvvvvzevyw_required) + if (!jform_vvvvvzgvyy_required) { updateFieldRequired('php_custom_get',1); jQuery('#jform_php_custom_get').removeAttr('required'); jQuery('#jform_php_custom_get').removeAttr('aria-required'); jQuery('#jform_php_custom_get').removeClass('required'); - jform_vvvvvzevyw_required = true; + jform_vvvvvzgvyy_required = true; } } } -// the vvvvvze Some function -function main_source_vvvvvze_SomeFunc(main_source_vvvvvze) +// the vvvvvzg Some function +function main_source_vvvvvzg_SomeFunc(main_source_vvvvvzg) { // set the function logic - if (main_source_vvvvvze == 3) + if (main_source_vvvvvzg == 3) { return true; } return false; } -// the vvvvvzf function -function vvvvvzf(main_source_vvvvvzf) +// the vvvvvzh function +function vvvvvzh(main_source_vvvvvzh) { - if (isSet(main_source_vvvvvzf) && main_source_vvvvvzf.constructor !== Array) + if (isSet(main_source_vvvvvzh) && main_source_vvvvvzh.constructor !== Array) { - var temp_vvvvvzf = main_source_vvvvvzf; - var main_source_vvvvvzf = []; - main_source_vvvvvzf.push(temp_vvvvvzf); + var temp_vvvvvzh = main_source_vvvvvzh; + var main_source_vvvvvzh = []; + main_source_vvvvvzh.push(temp_vvvvvzh); } - else if (!isSet(main_source_vvvvvzf)) + else if (!isSet(main_source_vvvvvzh)) { - var main_source_vvvvvzf = []; + var main_source_vvvvvzh = []; } - var main_source = main_source_vvvvvzf.some(main_source_vvvvvzf_SomeFunc); + var main_source = main_source_vvvvvzh.some(main_source_vvvvvzh_SomeFunc); // set this function logic @@ -627,167 +627,89 @@ function vvvvvzf(main_source_vvvvvzf) } } -// the vvvvvzf Some function -function main_source_vvvvvzf_SomeFunc(main_source_vvvvvzf) +// the vvvvvzh Some function +function main_source_vvvvvzh_SomeFunc(main_source_vvvvvzh) { // set the function logic - if (main_source_vvvvvzf == 1 || main_source_vvvvvzf == 2) + if (main_source_vvvvvzh == 1 || main_source_vvvvvzh == 2) { return true; } return false; } -// the vvvvvzg function -function vvvvvzg(add_php_before_getitem_vvvvvzg,gettype_vvvvvzg) +// the vvvvvzi function +function vvvvvzi(add_php_before_getitem_vvvvvzi,gettype_vvvvvzi) { - if (isSet(add_php_before_getitem_vvvvvzg) && add_php_before_getitem_vvvvvzg.constructor !== Array) + if (isSet(add_php_before_getitem_vvvvvzi) && add_php_before_getitem_vvvvvzi.constructor !== Array) { - var temp_vvvvvzg = add_php_before_getitem_vvvvvzg; - var add_php_before_getitem_vvvvvzg = []; - add_php_before_getitem_vvvvvzg.push(temp_vvvvvzg); + var temp_vvvvvzi = add_php_before_getitem_vvvvvzi; + var add_php_before_getitem_vvvvvzi = []; + add_php_before_getitem_vvvvvzi.push(temp_vvvvvzi); } - else if (!isSet(add_php_before_getitem_vvvvvzg)) + else if (!isSet(add_php_before_getitem_vvvvvzi)) { - var add_php_before_getitem_vvvvvzg = []; + var add_php_before_getitem_vvvvvzi = []; } - var add_php_before_getitem = add_php_before_getitem_vvvvvzg.some(add_php_before_getitem_vvvvvzg_SomeFunc); + var add_php_before_getitem = add_php_before_getitem_vvvvvzi.some(add_php_before_getitem_vvvvvzi_SomeFunc); - if (isSet(gettype_vvvvvzg) && gettype_vvvvvzg.constructor !== Array) + if (isSet(gettype_vvvvvzi) && gettype_vvvvvzi.constructor !== Array) { - var temp_vvvvvzg = gettype_vvvvvzg; - var gettype_vvvvvzg = []; - gettype_vvvvvzg.push(temp_vvvvvzg); + var temp_vvvvvzi = gettype_vvvvvzi; + var gettype_vvvvvzi = []; + gettype_vvvvvzi.push(temp_vvvvvzi); } - else if (!isSet(gettype_vvvvvzg)) + else if (!isSet(gettype_vvvvvzi)) { - var gettype_vvvvvzg = []; + var gettype_vvvvvzi = []; } - var gettype = gettype_vvvvvzg.some(gettype_vvvvvzg_SomeFunc); + var gettype = gettype_vvvvvzi.some(gettype_vvvvvzi_SomeFunc); // set this function logic if (add_php_before_getitem && gettype) { jQuery('#jform_php_before_getitem').closest('.control-group').show(); - if (jform_vvvvvzgvyx_required) + if (jform_vvvvvzivyz_required) { updateFieldRequired('php_before_getitem',0); jQuery('#jform_php_before_getitem').prop('required','required'); jQuery('#jform_php_before_getitem').attr('aria-required',true); jQuery('#jform_php_before_getitem').addClass('required'); - jform_vvvvvzgvyx_required = false; + jform_vvvvvzivyz_required = false; } } else { jQuery('#jform_php_before_getitem').closest('.control-group').hide(); - if (!jform_vvvvvzgvyx_required) + if (!jform_vvvvvzivyz_required) { updateFieldRequired('php_before_getitem',1); jQuery('#jform_php_before_getitem').removeAttr('required'); jQuery('#jform_php_before_getitem').removeAttr('aria-required'); jQuery('#jform_php_before_getitem').removeClass('required'); - jform_vvvvvzgvyx_required = true; + jform_vvvvvzivyz_required = true; } } } -// the vvvvvzg Some function -function add_php_before_getitem_vvvvvzg_SomeFunc(add_php_before_getitem_vvvvvzg) +// the vvvvvzi Some function +function add_php_before_getitem_vvvvvzi_SomeFunc(add_php_before_getitem_vvvvvzi) { // set the function logic - if (add_php_before_getitem_vvvvvzg == 1) + if (add_php_before_getitem_vvvvvzi == 1) { return true; } return false; } -// the vvvvvzg Some function -function gettype_vvvvvzg_SomeFunc(gettype_vvvvvzg) +// the vvvvvzi Some function +function gettype_vvvvvzi_SomeFunc(gettype_vvvvvzi) { // set the function logic - if (gettype_vvvvvzg == 1 || gettype_vvvvvzg == 3) - { - return true; - } - return false; -} - -// the vvvvvzh function -function vvvvvzh(add_php_after_getitem_vvvvvzh,gettype_vvvvvzh) -{ - if (isSet(add_php_after_getitem_vvvvvzh) && add_php_after_getitem_vvvvvzh.constructor !== Array) - { - var temp_vvvvvzh = add_php_after_getitem_vvvvvzh; - var add_php_after_getitem_vvvvvzh = []; - add_php_after_getitem_vvvvvzh.push(temp_vvvvvzh); - } - else if (!isSet(add_php_after_getitem_vvvvvzh)) - { - var add_php_after_getitem_vvvvvzh = []; - } - var add_php_after_getitem = add_php_after_getitem_vvvvvzh.some(add_php_after_getitem_vvvvvzh_SomeFunc); - - if (isSet(gettype_vvvvvzh) && gettype_vvvvvzh.constructor !== Array) - { - var temp_vvvvvzh = gettype_vvvvvzh; - var gettype_vvvvvzh = []; - gettype_vvvvvzh.push(temp_vvvvvzh); - } - else if (!isSet(gettype_vvvvvzh)) - { - var gettype_vvvvvzh = []; - } - var gettype = gettype_vvvvvzh.some(gettype_vvvvvzh_SomeFunc); - - - // set this function logic - if (add_php_after_getitem && gettype) - { - jQuery('#jform_php_after_getitem').closest('.control-group').show(); - if (jform_vvvvvzhvyy_required) - { - updateFieldRequired('php_after_getitem',0); - jQuery('#jform_php_after_getitem').prop('required','required'); - jQuery('#jform_php_after_getitem').attr('aria-required',true); - jQuery('#jform_php_after_getitem').addClass('required'); - jform_vvvvvzhvyy_required = false; - } - - } - else - { - jQuery('#jform_php_after_getitem').closest('.control-group').hide(); - if (!jform_vvvvvzhvyy_required) - { - updateFieldRequired('php_after_getitem',1); - jQuery('#jform_php_after_getitem').removeAttr('required'); - jQuery('#jform_php_after_getitem').removeAttr('aria-required'); - jQuery('#jform_php_after_getitem').removeClass('required'); - jform_vvvvvzhvyy_required = true; - } - } -} - -// the vvvvvzh Some function -function add_php_after_getitem_vvvvvzh_SomeFunc(add_php_after_getitem_vvvvvzh) -{ - // set the function logic - if (add_php_after_getitem_vvvvvzh == 1) - { - return true; - } - return false; -} - -// the vvvvvzh Some function -function gettype_vvvvvzh_SomeFunc(gettype_vvvvvzh) -{ - // set the function logic - if (gettype_vvvvvzh == 1 || gettype_vvvvvzh == 3) + if (gettype_vvvvvzi == 1 || gettype_vvvvvzi == 3) { return true; } @@ -795,8 +717,20 @@ function gettype_vvvvvzh_SomeFunc(gettype_vvvvvzh) } // the vvvvvzj function -function vvvvvzj(gettype_vvvvvzj) +function vvvvvzj(add_php_after_getitem_vvvvvzj,gettype_vvvvvzj) { + if (isSet(add_php_after_getitem_vvvvvzj) && add_php_after_getitem_vvvvvzj.constructor !== Array) + { + var temp_vvvvvzj = add_php_after_getitem_vvvvvzj; + var add_php_after_getitem_vvvvvzj = []; + add_php_after_getitem_vvvvvzj.push(temp_vvvvvzj); + } + else if (!isSet(add_php_after_getitem_vvvvvzj)) + { + var add_php_after_getitem_vvvvvzj = []; + } + var add_php_after_getitem = add_php_after_getitem_vvvvvzj.some(add_php_after_getitem_vvvvvzj_SomeFunc); + if (isSet(gettype_vvvvvzj) && gettype_vvvvvzj.constructor !== Array) { var temp_vvvvvzj = gettype_vvvvvzj; @@ -811,52 +745,44 @@ function vvvvvzj(gettype_vvvvvzj) // set this function logic - if (gettype) + if (add_php_after_getitem && gettype) { - jQuery('#jform_add_php_after_getitem').closest('.control-group').show(); - if (jform_vvvvvzjvyz_required) - { - updateFieldRequired('add_php_after_getitem',0); - jQuery('#jform_add_php_after_getitem').prop('required','required'); - jQuery('#jform_add_php_after_getitem').attr('aria-required',true); - jQuery('#jform_add_php_after_getitem').addClass('required'); - jform_vvvvvzjvyz_required = false; - } - - jQuery('#jform_add_php_before_getitem').closest('.control-group').show(); + jQuery('#jform_php_after_getitem').closest('.control-group').show(); if (jform_vvvvvzjvza_required) { - updateFieldRequired('add_php_before_getitem',0); - jQuery('#jform_add_php_before_getitem').prop('required','required'); - jQuery('#jform_add_php_before_getitem').attr('aria-required',true); - jQuery('#jform_add_php_before_getitem').addClass('required'); + updateFieldRequired('php_after_getitem',0); + jQuery('#jform_php_after_getitem').prop('required','required'); + jQuery('#jform_php_after_getitem').attr('aria-required',true); + jQuery('#jform_php_after_getitem').addClass('required'); jform_vvvvvzjvza_required = false; } } else { - jQuery('#jform_add_php_after_getitem').closest('.control-group').hide(); - if (!jform_vvvvvzjvyz_required) - { - updateFieldRequired('add_php_after_getitem',1); - jQuery('#jform_add_php_after_getitem').removeAttr('required'); - jQuery('#jform_add_php_after_getitem').removeAttr('aria-required'); - jQuery('#jform_add_php_after_getitem').removeClass('required'); - jform_vvvvvzjvyz_required = true; - } - jQuery('#jform_add_php_before_getitem').closest('.control-group').hide(); + jQuery('#jform_php_after_getitem').closest('.control-group').hide(); if (!jform_vvvvvzjvza_required) { - updateFieldRequired('add_php_before_getitem',1); - jQuery('#jform_add_php_before_getitem').removeAttr('required'); - jQuery('#jform_add_php_before_getitem').removeAttr('aria-required'); - jQuery('#jform_add_php_before_getitem').removeClass('required'); + updateFieldRequired('php_after_getitem',1); + jQuery('#jform_php_after_getitem').removeAttr('required'); + jQuery('#jform_php_after_getitem').removeAttr('aria-required'); + jQuery('#jform_php_after_getitem').removeClass('required'); jform_vvvvvzjvza_required = true; } } } +// the vvvvvzj Some function +function add_php_after_getitem_vvvvvzj_SomeFunc(add_php_after_getitem_vvvvvzj) +{ + // set the function logic + if (add_php_after_getitem_vvvvvzj == 1) + { + return true; + } + return false; +} + // the vvvvvzj Some function function gettype_vvvvvzj_SomeFunc(gettype_vvvvvzj) { @@ -868,99 +794,9 @@ function gettype_vvvvvzj_SomeFunc(gettype_vvvvvzj) return false; } -// the vvvvvzk function -function vvvvvzk(add_php_getlistquery_vvvvvzk,gettype_vvvvvzk) -{ - if (isSet(add_php_getlistquery_vvvvvzk) && add_php_getlistquery_vvvvvzk.constructor !== Array) - { - var temp_vvvvvzk = add_php_getlistquery_vvvvvzk; - var add_php_getlistquery_vvvvvzk = []; - add_php_getlistquery_vvvvvzk.push(temp_vvvvvzk); - } - else if (!isSet(add_php_getlistquery_vvvvvzk)) - { - var add_php_getlistquery_vvvvvzk = []; - } - var add_php_getlistquery = add_php_getlistquery_vvvvvzk.some(add_php_getlistquery_vvvvvzk_SomeFunc); - - if (isSet(gettype_vvvvvzk) && gettype_vvvvvzk.constructor !== Array) - { - var temp_vvvvvzk = gettype_vvvvvzk; - var gettype_vvvvvzk = []; - gettype_vvvvvzk.push(temp_vvvvvzk); - } - else if (!isSet(gettype_vvvvvzk)) - { - var gettype_vvvvvzk = []; - } - var gettype = gettype_vvvvvzk.some(gettype_vvvvvzk_SomeFunc); - - - // set this function logic - if (add_php_getlistquery && gettype) - { - jQuery('#jform_php_getlistquery').closest('.control-group').show(); - if (jform_vvvvvzkvzb_required) - { - updateFieldRequired('php_getlistquery',0); - jQuery('#jform_php_getlistquery').prop('required','required'); - jQuery('#jform_php_getlistquery').attr('aria-required',true); - jQuery('#jform_php_getlistquery').addClass('required'); - jform_vvvvvzkvzb_required = false; - } - - } - else - { - jQuery('#jform_php_getlistquery').closest('.control-group').hide(); - if (!jform_vvvvvzkvzb_required) - { - updateFieldRequired('php_getlistquery',1); - jQuery('#jform_php_getlistquery').removeAttr('required'); - jQuery('#jform_php_getlistquery').removeAttr('aria-required'); - jQuery('#jform_php_getlistquery').removeClass('required'); - jform_vvvvvzkvzb_required = true; - } - } -} - -// the vvvvvzk Some function -function add_php_getlistquery_vvvvvzk_SomeFunc(add_php_getlistquery_vvvvvzk) -{ - // set the function logic - if (add_php_getlistquery_vvvvvzk == 1) - { - return true; - } - return false; -} - -// the vvvvvzk Some function -function gettype_vvvvvzk_SomeFunc(gettype_vvvvvzk) -{ - // set the function logic - if (gettype_vvvvvzk == 2 || gettype_vvvvvzk == 4) - { - return true; - } - return false; -} - // the vvvvvzl function -function vvvvvzl(add_php_before_getitems_vvvvvzl,gettype_vvvvvzl) +function vvvvvzl(gettype_vvvvvzl) { - if (isSet(add_php_before_getitems_vvvvvzl) && add_php_before_getitems_vvvvvzl.constructor !== Array) - { - var temp_vvvvvzl = add_php_before_getitems_vvvvvzl; - var add_php_before_getitems_vvvvvzl = []; - add_php_before_getitems_vvvvvzl.push(temp_vvvvvzl); - } - else if (!isSet(add_php_before_getitems_vvvvvzl)) - { - var add_php_before_getitems_vvvvvzl = []; - } - var add_php_before_getitems = add_php_before_getitems_vvvvvzl.some(add_php_before_getitems_vvvvvzl_SomeFunc); - if (isSet(gettype_vvvvvzl) && gettype_vvvvvzl.constructor !== Array) { var temp_vvvvvzl = gettype_vvvvvzl; @@ -975,49 +811,57 @@ function vvvvvzl(add_php_before_getitems_vvvvvzl,gettype_vvvvvzl) // set this function logic - if (add_php_before_getitems && gettype) + if (gettype) { - jQuery('#jform_php_before_getitems').closest('.control-group').show(); + jQuery('#jform_add_php_after_getitem').closest('.control-group').show(); + if (jform_vvvvvzlvzb_required) + { + updateFieldRequired('add_php_after_getitem',0); + jQuery('#jform_add_php_after_getitem').prop('required','required'); + jQuery('#jform_add_php_after_getitem').attr('aria-required',true); + jQuery('#jform_add_php_after_getitem').addClass('required'); + jform_vvvvvzlvzb_required = false; + } + + jQuery('#jform_add_php_before_getitem').closest('.control-group').show(); if (jform_vvvvvzlvzc_required) { - updateFieldRequired('php_before_getitems',0); - jQuery('#jform_php_before_getitems').prop('required','required'); - jQuery('#jform_php_before_getitems').attr('aria-required',true); - jQuery('#jform_php_before_getitems').addClass('required'); + updateFieldRequired('add_php_before_getitem',0); + jQuery('#jform_add_php_before_getitem').prop('required','required'); + jQuery('#jform_add_php_before_getitem').attr('aria-required',true); + jQuery('#jform_add_php_before_getitem').addClass('required'); jform_vvvvvzlvzc_required = false; } } else { - jQuery('#jform_php_before_getitems').closest('.control-group').hide(); + jQuery('#jform_add_php_after_getitem').closest('.control-group').hide(); + if (!jform_vvvvvzlvzb_required) + { + updateFieldRequired('add_php_after_getitem',1); + jQuery('#jform_add_php_after_getitem').removeAttr('required'); + jQuery('#jform_add_php_after_getitem').removeAttr('aria-required'); + jQuery('#jform_add_php_after_getitem').removeClass('required'); + jform_vvvvvzlvzb_required = true; + } + jQuery('#jform_add_php_before_getitem').closest('.control-group').hide(); if (!jform_vvvvvzlvzc_required) { - updateFieldRequired('php_before_getitems',1); - jQuery('#jform_php_before_getitems').removeAttr('required'); - jQuery('#jform_php_before_getitems').removeAttr('aria-required'); - jQuery('#jform_php_before_getitems').removeClass('required'); + updateFieldRequired('add_php_before_getitem',1); + jQuery('#jform_add_php_before_getitem').removeAttr('required'); + jQuery('#jform_add_php_before_getitem').removeAttr('aria-required'); + jQuery('#jform_add_php_before_getitem').removeClass('required'); jform_vvvvvzlvzc_required = true; } } } -// the vvvvvzl Some function -function add_php_before_getitems_vvvvvzl_SomeFunc(add_php_before_getitems_vvvvvzl) -{ - // set the function logic - if (add_php_before_getitems_vvvvvzl == 1) - { - return true; - } - return false; -} - // the vvvvvzl Some function function gettype_vvvvvzl_SomeFunc(gettype_vvvvvzl) { // set the function logic - if (gettype_vvvvvzl == 2 || gettype_vvvvvzl == 4) + if (gettype_vvvvvzl == 1 || gettype_vvvvvzl == 3) { return true; } @@ -1025,19 +869,19 @@ function gettype_vvvvvzl_SomeFunc(gettype_vvvvvzl) } // the vvvvvzm function -function vvvvvzm(add_php_after_getitems_vvvvvzm,gettype_vvvvvzm) +function vvvvvzm(add_php_getlistquery_vvvvvzm,gettype_vvvvvzm) { - if (isSet(add_php_after_getitems_vvvvvzm) && add_php_after_getitems_vvvvvzm.constructor !== Array) + if (isSet(add_php_getlistquery_vvvvvzm) && add_php_getlistquery_vvvvvzm.constructor !== Array) { - var temp_vvvvvzm = add_php_after_getitems_vvvvvzm; - var add_php_after_getitems_vvvvvzm = []; - add_php_after_getitems_vvvvvzm.push(temp_vvvvvzm); + var temp_vvvvvzm = add_php_getlistquery_vvvvvzm; + var add_php_getlistquery_vvvvvzm = []; + add_php_getlistquery_vvvvvzm.push(temp_vvvvvzm); } - else if (!isSet(add_php_after_getitems_vvvvvzm)) + else if (!isSet(add_php_getlistquery_vvvvvzm)) { - var add_php_after_getitems_vvvvvzm = []; + var add_php_getlistquery_vvvvvzm = []; } - var add_php_after_getitems = add_php_after_getitems_vvvvvzm.some(add_php_after_getitems_vvvvvzm_SomeFunc); + var add_php_getlistquery = add_php_getlistquery_vvvvvzm.some(add_php_getlistquery_vvvvvzm_SomeFunc); if (isSet(gettype_vvvvvzm) && gettype_vvvvvzm.constructor !== Array) { @@ -1053,38 +897,38 @@ function vvvvvzm(add_php_after_getitems_vvvvvzm,gettype_vvvvvzm) // set this function logic - if (add_php_after_getitems && gettype) + if (add_php_getlistquery && gettype) { - jQuery('#jform_php_after_getitems').closest('.control-group').show(); + jQuery('#jform_php_getlistquery').closest('.control-group').show(); if (jform_vvvvvzmvzd_required) { - updateFieldRequired('php_after_getitems',0); - jQuery('#jform_php_after_getitems').prop('required','required'); - jQuery('#jform_php_after_getitems').attr('aria-required',true); - jQuery('#jform_php_after_getitems').addClass('required'); + updateFieldRequired('php_getlistquery',0); + jQuery('#jform_php_getlistquery').prop('required','required'); + jQuery('#jform_php_getlistquery').attr('aria-required',true); + jQuery('#jform_php_getlistquery').addClass('required'); jform_vvvvvzmvzd_required = false; } } else { - jQuery('#jform_php_after_getitems').closest('.control-group').hide(); + jQuery('#jform_php_getlistquery').closest('.control-group').hide(); if (!jform_vvvvvzmvzd_required) { - updateFieldRequired('php_after_getitems',1); - jQuery('#jform_php_after_getitems').removeAttr('required'); - jQuery('#jform_php_after_getitems').removeAttr('aria-required'); - jQuery('#jform_php_after_getitems').removeClass('required'); + updateFieldRequired('php_getlistquery',1); + jQuery('#jform_php_getlistquery').removeAttr('required'); + jQuery('#jform_php_getlistquery').removeAttr('aria-required'); + jQuery('#jform_php_getlistquery').removeClass('required'); jform_vvvvvzmvzd_required = true; } } } // the vvvvvzm Some function -function add_php_after_getitems_vvvvvzm_SomeFunc(add_php_after_getitems_vvvvvzm) +function add_php_getlistquery_vvvvvzm_SomeFunc(add_php_getlistquery_vvvvvzm) { // set the function logic - if (add_php_after_getitems_vvvvvzm == 1) + if (add_php_getlistquery_vvvvvzm == 1) { return true; } @@ -1102,9 +946,99 @@ function gettype_vvvvvzm_SomeFunc(gettype_vvvvvzm) return false; } -// the vvvvvzo function -function vvvvvzo(gettype_vvvvvzo) +// the vvvvvzn function +function vvvvvzn(add_php_before_getitems_vvvvvzn,gettype_vvvvvzn) { + if (isSet(add_php_before_getitems_vvvvvzn) && add_php_before_getitems_vvvvvzn.constructor !== Array) + { + var temp_vvvvvzn = add_php_before_getitems_vvvvvzn; + var add_php_before_getitems_vvvvvzn = []; + add_php_before_getitems_vvvvvzn.push(temp_vvvvvzn); + } + else if (!isSet(add_php_before_getitems_vvvvvzn)) + { + var add_php_before_getitems_vvvvvzn = []; + } + var add_php_before_getitems = add_php_before_getitems_vvvvvzn.some(add_php_before_getitems_vvvvvzn_SomeFunc); + + if (isSet(gettype_vvvvvzn) && gettype_vvvvvzn.constructor !== Array) + { + var temp_vvvvvzn = gettype_vvvvvzn; + var gettype_vvvvvzn = []; + gettype_vvvvvzn.push(temp_vvvvvzn); + } + else if (!isSet(gettype_vvvvvzn)) + { + var gettype_vvvvvzn = []; + } + var gettype = gettype_vvvvvzn.some(gettype_vvvvvzn_SomeFunc); + + + // set this function logic + if (add_php_before_getitems && gettype) + { + jQuery('#jform_php_before_getitems').closest('.control-group').show(); + if (jform_vvvvvznvze_required) + { + updateFieldRequired('php_before_getitems',0); + jQuery('#jform_php_before_getitems').prop('required','required'); + jQuery('#jform_php_before_getitems').attr('aria-required',true); + jQuery('#jform_php_before_getitems').addClass('required'); + jform_vvvvvznvze_required = false; + } + + } + else + { + jQuery('#jform_php_before_getitems').closest('.control-group').hide(); + if (!jform_vvvvvznvze_required) + { + updateFieldRequired('php_before_getitems',1); + jQuery('#jform_php_before_getitems').removeAttr('required'); + jQuery('#jform_php_before_getitems').removeAttr('aria-required'); + jQuery('#jform_php_before_getitems').removeClass('required'); + jform_vvvvvznvze_required = true; + } + } +} + +// the vvvvvzn Some function +function add_php_before_getitems_vvvvvzn_SomeFunc(add_php_before_getitems_vvvvvzn) +{ + // set the function logic + if (add_php_before_getitems_vvvvvzn == 1) + { + return true; + } + return false; +} + +// the vvvvvzn Some function +function gettype_vvvvvzn_SomeFunc(gettype_vvvvvzn) +{ + // set the function logic + if (gettype_vvvvvzn == 2 || gettype_vvvvvzn == 4) + { + return true; + } + return false; +} + +// the vvvvvzo function +function vvvvvzo(add_php_after_getitems_vvvvvzo,gettype_vvvvvzo) +{ + if (isSet(add_php_after_getitems_vvvvvzo) && add_php_after_getitems_vvvvvzo.constructor !== Array) + { + var temp_vvvvvzo = add_php_after_getitems_vvvvvzo; + var add_php_after_getitems_vvvvvzo = []; + add_php_after_getitems_vvvvvzo.push(temp_vvvvvzo); + } + else if (!isSet(add_php_after_getitems_vvvvvzo)) + { + var add_php_after_getitems_vvvvvzo = []; + } + var add_php_after_getitems = add_php_after_getitems_vvvvvzo.some(add_php_after_getitems_vvvvvzo_SomeFunc); + if (isSet(gettype_vvvvvzo) && gettype_vvvvvzo.constructor !== Array) { var temp_vvvvvzo = gettype_vvvvvzo; @@ -1119,71 +1053,44 @@ function vvvvvzo(gettype_vvvvvzo) // set this function logic - if (gettype) + if (add_php_after_getitems && gettype) { - jQuery('#jform_add_php_after_getitems').closest('.control-group').show(); - if (jform_vvvvvzovze_required) - { - updateFieldRequired('add_php_after_getitems',0); - jQuery('#jform_add_php_after_getitems').prop('required','required'); - jQuery('#jform_add_php_after_getitems').attr('aria-required',true); - jQuery('#jform_add_php_after_getitems').addClass('required'); - jform_vvvvvzovze_required = false; - } - - jQuery('#jform_add_php_before_getitems').closest('.control-group').show(); + jQuery('#jform_php_after_getitems').closest('.control-group').show(); if (jform_vvvvvzovzf_required) { - updateFieldRequired('add_php_before_getitems',0); - jQuery('#jform_add_php_before_getitems').prop('required','required'); - jQuery('#jform_add_php_before_getitems').attr('aria-required',true); - jQuery('#jform_add_php_before_getitems').addClass('required'); + updateFieldRequired('php_after_getitems',0); + jQuery('#jform_php_after_getitems').prop('required','required'); + jQuery('#jform_php_after_getitems').attr('aria-required',true); + jQuery('#jform_php_after_getitems').addClass('required'); jform_vvvvvzovzf_required = false; } - jQuery('#jform_add_php_getlistquery').closest('.control-group').show(); - if (jform_vvvvvzovzg_required) - { - updateFieldRequired('add_php_getlistquery',0); - jQuery('#jform_add_php_getlistquery').prop('required','required'); - jQuery('#jform_add_php_getlistquery').attr('aria-required',true); - jQuery('#jform_add_php_getlistquery').addClass('required'); - jform_vvvvvzovzg_required = false; - } - } else { - jQuery('#jform_add_php_after_getitems').closest('.control-group').hide(); - if (!jform_vvvvvzovze_required) - { - updateFieldRequired('add_php_after_getitems',1); - jQuery('#jform_add_php_after_getitems').removeAttr('required'); - jQuery('#jform_add_php_after_getitems').removeAttr('aria-required'); - jQuery('#jform_add_php_after_getitems').removeClass('required'); - jform_vvvvvzovze_required = true; - } - jQuery('#jform_add_php_before_getitems').closest('.control-group').hide(); + jQuery('#jform_php_after_getitems').closest('.control-group').hide(); if (!jform_vvvvvzovzf_required) { - updateFieldRequired('add_php_before_getitems',1); - jQuery('#jform_add_php_before_getitems').removeAttr('required'); - jQuery('#jform_add_php_before_getitems').removeAttr('aria-required'); - jQuery('#jform_add_php_before_getitems').removeClass('required'); + updateFieldRequired('php_after_getitems',1); + jQuery('#jform_php_after_getitems').removeAttr('required'); + jQuery('#jform_php_after_getitems').removeAttr('aria-required'); + jQuery('#jform_php_after_getitems').removeClass('required'); jform_vvvvvzovzf_required = true; } - jQuery('#jform_add_php_getlistquery').closest('.control-group').hide(); - if (!jform_vvvvvzovzg_required) - { - updateFieldRequired('add_php_getlistquery',1); - jQuery('#jform_add_php_getlistquery').removeAttr('required'); - jQuery('#jform_add_php_getlistquery').removeAttr('aria-required'); - jQuery('#jform_add_php_getlistquery').removeClass('required'); - jform_vvvvvzovzg_required = true; - } } } +// the vvvvvzo Some function +function add_php_after_getitems_vvvvvzo_SomeFunc(add_php_after_getitems_vvvvvzo) +{ + // set the function logic + if (add_php_after_getitems_vvvvvzo == 1) + { + return true; + } + return false; +} + // the vvvvvzo Some function function gettype_vvvvvzo_SomeFunc(gettype_vvvvvzo) { @@ -1195,55 +1102,148 @@ function gettype_vvvvvzo_SomeFunc(gettype_vvvvvzo) return false; } -// the vvvvvzp function -function vvvvvzp(gettype_vvvvvzp) +// the vvvvvzq function +function vvvvvzq(gettype_vvvvvzq) { - if (isSet(gettype_vvvvvzp) && gettype_vvvvvzp.constructor !== Array) + if (isSet(gettype_vvvvvzq) && gettype_vvvvvzq.constructor !== Array) { - var temp_vvvvvzp = gettype_vvvvvzp; - var gettype_vvvvvzp = []; - gettype_vvvvvzp.push(temp_vvvvvzp); + var temp_vvvvvzq = gettype_vvvvvzq; + var gettype_vvvvvzq = []; + gettype_vvvvvzq.push(temp_vvvvvzq); } - else if (!isSet(gettype_vvvvvzp)) + else if (!isSet(gettype_vvvvvzq)) { - var gettype_vvvvvzp = []; + var gettype_vvvvvzq = []; } - var gettype = gettype_vvvvvzp.some(gettype_vvvvvzp_SomeFunc); + var gettype = gettype_vvvvvzq.some(gettype_vvvvvzq_SomeFunc); + + + // set this function logic + if (gettype) + { + jQuery('#jform_add_php_after_getitems').closest('.control-group').show(); + if (jform_vvvvvzqvzg_required) + { + updateFieldRequired('add_php_after_getitems',0); + jQuery('#jform_add_php_after_getitems').prop('required','required'); + jQuery('#jform_add_php_after_getitems').attr('aria-required',true); + jQuery('#jform_add_php_after_getitems').addClass('required'); + jform_vvvvvzqvzg_required = false; + } + + jQuery('#jform_add_php_before_getitems').closest('.control-group').show(); + if (jform_vvvvvzqvzh_required) + { + updateFieldRequired('add_php_before_getitems',0); + jQuery('#jform_add_php_before_getitems').prop('required','required'); + jQuery('#jform_add_php_before_getitems').attr('aria-required',true); + jQuery('#jform_add_php_before_getitems').addClass('required'); + jform_vvvvvzqvzh_required = false; + } + + jQuery('#jform_add_php_getlistquery').closest('.control-group').show(); + if (jform_vvvvvzqvzi_required) + { + updateFieldRequired('add_php_getlistquery',0); + jQuery('#jform_add_php_getlistquery').prop('required','required'); + jQuery('#jform_add_php_getlistquery').attr('aria-required',true); + jQuery('#jform_add_php_getlistquery').addClass('required'); + jform_vvvvvzqvzi_required = false; + } + + } + else + { + jQuery('#jform_add_php_after_getitems').closest('.control-group').hide(); + if (!jform_vvvvvzqvzg_required) + { + updateFieldRequired('add_php_after_getitems',1); + jQuery('#jform_add_php_after_getitems').removeAttr('required'); + jQuery('#jform_add_php_after_getitems').removeAttr('aria-required'); + jQuery('#jform_add_php_after_getitems').removeClass('required'); + jform_vvvvvzqvzg_required = true; + } + jQuery('#jform_add_php_before_getitems').closest('.control-group').hide(); + if (!jform_vvvvvzqvzh_required) + { + updateFieldRequired('add_php_before_getitems',1); + jQuery('#jform_add_php_before_getitems').removeAttr('required'); + jQuery('#jform_add_php_before_getitems').removeAttr('aria-required'); + jQuery('#jform_add_php_before_getitems').removeClass('required'); + jform_vvvvvzqvzh_required = true; + } + jQuery('#jform_add_php_getlistquery').closest('.control-group').hide(); + if (!jform_vvvvvzqvzi_required) + { + updateFieldRequired('add_php_getlistquery',1); + jQuery('#jform_add_php_getlistquery').removeAttr('required'); + jQuery('#jform_add_php_getlistquery').removeAttr('aria-required'); + jQuery('#jform_add_php_getlistquery').removeClass('required'); + jform_vvvvvzqvzi_required = true; + } + } +} + +// the vvvvvzq Some function +function gettype_vvvvvzq_SomeFunc(gettype_vvvvvzq) +{ + // set the function logic + if (gettype_vvvvvzq == 2 || gettype_vvvvvzq == 4) + { + return true; + } + return false; +} + +// the vvvvvzr function +function vvvvvzr(gettype_vvvvvzr) +{ + if (isSet(gettype_vvvvvzr) && gettype_vvvvvzr.constructor !== Array) + { + var temp_vvvvvzr = gettype_vvvvvzr; + var gettype_vvvvvzr = []; + gettype_vvvvvzr.push(temp_vvvvvzr); + } + else if (!isSet(gettype_vvvvvzr)) + { + var gettype_vvvvvzr = []; + } + var gettype = gettype_vvvvvzr.some(gettype_vvvvvzr_SomeFunc); // set this function logic if (gettype) { jQuery('#jform_pagination').closest('.control-group').show(); - if (jform_vvvvvzpvzh_required) + if (jform_vvvvvzrvzj_required) { updateFieldRequired('pagination',0); jQuery('#jform_pagination').prop('required','required'); jQuery('#jform_pagination').attr('aria-required',true); jQuery('#jform_pagination').addClass('required'); - jform_vvvvvzpvzh_required = false; + jform_vvvvvzrvzj_required = false; } } else { jQuery('#jform_pagination').closest('.control-group').hide(); - if (!jform_vvvvvzpvzh_required) + if (!jform_vvvvvzrvzj_required) { updateFieldRequired('pagination',1); jQuery('#jform_pagination').removeAttr('required'); jQuery('#jform_pagination').removeAttr('aria-required'); jQuery('#jform_pagination').removeClass('required'); - jform_vvvvvzpvzh_required = true; + jform_vvvvvzrvzj_required = true; } } } -// the vvvvvzp Some function -function gettype_vvvvvzp_SomeFunc(gettype_vvvvvzp) +// the vvvvvzr Some function +function gettype_vvvvvzr_SomeFunc(gettype_vvvvvzr) { // set the function logic - if (gettype_vvvvvzp == 2) + if (gettype_vvvvvzr == 2) { return true; } diff --git a/admin/models/forms/field.js b/admin/models/forms/field.js index 2242df424..6d607116e 100644 --- a/admin/models/forms/field.js +++ b/admin/models/forms/field.js @@ -23,210 +23,96 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvwacvzo_required = false; -jform_vvvvwadvzp_required = false; jform_vvvvwaevzq_required = false; jform_vvvvwafvzr_required = false; -jform_vvvvwaivzs_required = false; -jform_vvvvwajvzt_required = false; +jform_vvvvwagvzs_required = false; +jform_vvvvwahvzt_required = false; jform_vvvvwakvzu_required = false; jform_vvvvwalvzv_required = false; +jform_vvvvwamvzw_required = false; +jform_vvvvwanvzx_required = false; // Initial Script jQuery(document).ready(function() { - var datalenght_vvvvwac = jQuery("#jform_datalenght").val(); - vvvvwac(datalenght_vvvvwac); + var datalenght_vvvvwae = jQuery("#jform_datalenght").val(); + vvvvwae(datalenght_vvvvwae); - var datadefault_vvvvwad = jQuery("#jform_datadefault").val(); - vvvvwad(datadefault_vvvvwad); + var datadefault_vvvvwaf = jQuery("#jform_datadefault").val(); + vvvvwaf(datadefault_vvvvwaf); - var datatype_vvvvwae = jQuery("#jform_datatype").val(); - vvvvwae(datatype_vvvvwae); - - var datatype_vvvvwaf = jQuery("#jform_datatype").val(); - vvvvwaf(datatype_vvvvwaf); - - var store_vvvvwag = jQuery("#jform_store").val(); var datatype_vvvvwag = jQuery("#jform_datatype").val(); - vvvvwag(store_vvvvwag,datatype_vvvvwag); + vvvvwag(datatype_vvvvwag); - var add_css_view_vvvvwai = jQuery("#jform_add_css_view input[type='radio']:checked").val(); - vvvvwai(add_css_view_vvvvwai); + var datatype_vvvvwah = jQuery("#jform_datatype").val(); + vvvvwah(datatype_vvvvwah); - var add_css_views_vvvvwaj = jQuery("#jform_add_css_views input[type='radio']:checked").val(); - vvvvwaj(add_css_views_vvvvwaj); + var store_vvvvwai = jQuery("#jform_store").val(); + var datatype_vvvvwai = jQuery("#jform_datatype").val(); + vvvvwai(store_vvvvwai,datatype_vvvvwai); - var add_javascript_view_footer_vvvvwak = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val(); - vvvvwak(add_javascript_view_footer_vvvvwak); + var add_css_view_vvvvwak = jQuery("#jform_add_css_view input[type='radio']:checked").val(); + vvvvwak(add_css_view_vvvvwak); - var add_javascript_views_footer_vvvvwal = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val(); - vvvvwal(add_javascript_views_footer_vvvvwal); + var add_css_views_vvvvwal = jQuery("#jform_add_css_views input[type='radio']:checked").val(); + vvvvwal(add_css_views_vvvvwal); + + var add_javascript_view_footer_vvvvwam = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val(); + vvvvwam(add_javascript_view_footer_vvvvwam); + + var add_javascript_views_footer_vvvvwan = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val(); + vvvvwan(add_javascript_views_footer_vvvvwan); }); -// the vvvvwac function -function vvvvwac(datalenght_vvvvwac) +// the vvvvwae function +function vvvvwae(datalenght_vvvvwae) { - if (isSet(datalenght_vvvvwac) && datalenght_vvvvwac.constructor !== Array) + if (isSet(datalenght_vvvvwae) && datalenght_vvvvwae.constructor !== Array) { - var temp_vvvvwac = datalenght_vvvvwac; - var datalenght_vvvvwac = []; - datalenght_vvvvwac.push(temp_vvvvwac); + var temp_vvvvwae = datalenght_vvvvwae; + var datalenght_vvvvwae = []; + datalenght_vvvvwae.push(temp_vvvvwae); } - else if (!isSet(datalenght_vvvvwac)) + else if (!isSet(datalenght_vvvvwae)) { - var datalenght_vvvvwac = []; + var datalenght_vvvvwae = []; } - var datalenght = datalenght_vvvvwac.some(datalenght_vvvvwac_SomeFunc); + var datalenght = datalenght_vvvvwae.some(datalenght_vvvvwae_SomeFunc); // set this function logic if (datalenght) { jQuery('#jform_datalenght_other').closest('.control-group').show(); - if (jform_vvvvwacvzo_required) + if (jform_vvvvwaevzq_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_vvvvwacvzo_required = false; - } - - } - else - { - jQuery('#jform_datalenght_other').closest('.control-group').hide(); - if (!jform_vvvvwacvzo_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_vvvvwacvzo_required = true; - } - } -} - -// the vvvvwac Some function -function datalenght_vvvvwac_SomeFunc(datalenght_vvvvwac) -{ - // set the function logic - if (datalenght_vvvvwac == 'Other') - { - return true; - } - return false; -} - -// the vvvvwad function -function vvvvwad(datadefault_vvvvwad) -{ - if (isSet(datadefault_vvvvwad) && datadefault_vvvvwad.constructor !== Array) - { - var temp_vvvvwad = datadefault_vvvvwad; - var datadefault_vvvvwad = []; - datadefault_vvvvwad.push(temp_vvvvwad); - } - else if (!isSet(datadefault_vvvvwad)) - { - var datadefault_vvvvwad = []; - } - var datadefault = datadefault_vvvvwad.some(datadefault_vvvvwad_SomeFunc); - - - // set this function logic - if (datadefault) - { - jQuery('#jform_datadefault_other').closest('.control-group').show(); - if (jform_vvvvwadvzp_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_vvvvwadvzp_required = false; - } - - } - else - { - jQuery('#jform_datadefault_other').closest('.control-group').hide(); - if (!jform_vvvvwadvzp_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_vvvvwadvzp_required = true; - } - } -} - -// the vvvvwad Some function -function datadefault_vvvvwad_SomeFunc(datadefault_vvvvwad) -{ - // set the function logic - if (datadefault_vvvvwad == 'Other') - { - return true; - } - return false; -} - -// the vvvvwae function -function vvvvwae(datatype_vvvvwae) -{ - if (isSet(datatype_vvvvwae) && datatype_vvvvwae.constructor !== Array) - { - var temp_vvvvwae = datatype_vvvvwae; - var datatype_vvvvwae = []; - datatype_vvvvwae.push(temp_vvvvwae); - } - else if (!isSet(datatype_vvvvwae)) - { - var datatype_vvvvwae = []; - } - var datatype = datatype_vvvvwae.some(datatype_vvvvwae_SomeFunc); - - - // set this function logic - if (datatype) - { - jQuery('#jform_datadefault').closest('.control-group').show(); - jQuery('#jform_datalenght').closest('.control-group').show(); - jQuery('#jform_indexes').closest('.control-group').show(); - if (jform_vvvvwaevzq_required) - { - updateFieldRequired('indexes',0); - jQuery('#jform_indexes').prop('required','required'); - jQuery('#jform_indexes').attr('aria-required',true); - jQuery('#jform_indexes').addClass('required'); jform_vvvvwaevzq_required = false; } } else { - jQuery('#jform_datadefault').closest('.control-group').hide(); - jQuery('#jform_datalenght').closest('.control-group').hide(); - jQuery('#jform_indexes').closest('.control-group').hide(); + jQuery('#jform_datalenght_other').closest('.control-group').hide(); if (!jform_vvvvwaevzq_required) { - updateFieldRequired('indexes',1); - jQuery('#jform_indexes').removeAttr('required'); - jQuery('#jform_indexes').removeAttr('aria-required'); - jQuery('#jform_indexes').removeClass('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_vvvvwaevzq_required = true; } } } // the vvvvwae Some function -function datatype_vvvvwae_SomeFunc(datatype_vvvvwae) +function datalenght_vvvvwae_SomeFunc(datalenght_vvvvwae) { // set the function logic - if (datatype_vvvvwae == 'CHAR' || datatype_vvvvwae == 'VARCHAR' || datatype_vvvvwae == 'DATETIME' || datatype_vvvvwae == 'DATE' || datatype_vvvvwae == 'TIME' || datatype_vvvvwae == 'INT' || datatype_vvvvwae == 'TINYINT' || datatype_vvvvwae == 'BIGINT' || datatype_vvvvwae == 'FLOAT' || datatype_vvvvwae == 'DECIMAL' || datatype_vvvvwae == 'DOUBLE') + if (datalenght_vvvvwae == 'Other') { return true; } @@ -234,54 +120,54 @@ function datatype_vvvvwae_SomeFunc(datatype_vvvvwae) } // the vvvvwaf function -function vvvvwaf(datatype_vvvvwaf) +function vvvvwaf(datadefault_vvvvwaf) { - if (isSet(datatype_vvvvwaf) && datatype_vvvvwaf.constructor !== Array) + if (isSet(datadefault_vvvvwaf) && datadefault_vvvvwaf.constructor !== Array) { - var temp_vvvvwaf = datatype_vvvvwaf; - var datatype_vvvvwaf = []; - datatype_vvvvwaf.push(temp_vvvvwaf); + var temp_vvvvwaf = datadefault_vvvvwaf; + var datadefault_vvvvwaf = []; + datadefault_vvvvwaf.push(temp_vvvvwaf); } - else if (!isSet(datatype_vvvvwaf)) + else if (!isSet(datadefault_vvvvwaf)) { - var datatype_vvvvwaf = []; + var datadefault_vvvvwaf = []; } - var datatype = datatype_vvvvwaf.some(datatype_vvvvwaf_SomeFunc); + var datadefault = datadefault_vvvvwaf.some(datadefault_vvvvwaf_SomeFunc); // set this function logic - if (datatype) + if (datadefault) { - jQuery('#jform_store').closest('.control-group').show(); + jQuery('#jform_datadefault_other').closest('.control-group').show(); if (jform_vvvvwafvzr_required) { - updateFieldRequired('store',0); - jQuery('#jform_store').prop('required','required'); - jQuery('#jform_store').attr('aria-required',true); - jQuery('#jform_store').addClass('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_vvvvwafvzr_required = false; } } else { - jQuery('#jform_store').closest('.control-group').hide(); + jQuery('#jform_datadefault_other').closest('.control-group').hide(); if (!jform_vvvvwafvzr_required) { - updateFieldRequired('store',1); - jQuery('#jform_store').removeAttr('required'); - jQuery('#jform_store').removeAttr('aria-required'); - jQuery('#jform_store').removeClass('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_vvvvwafvzr_required = true; } } } // the vvvvwaf Some function -function datatype_vvvvwaf_SomeFunc(datatype_vvvvwaf) +function datadefault_vvvvwaf_SomeFunc(datadefault_vvvvwaf) { // set the function logic - if (datatype_vvvvwaf == 'CHAR' || datatype_vvvvwaf == 'VARCHAR' || datatype_vvvvwaf == 'TEXT' || datatype_vvvvwaf == 'MEDIUMTEXT' || datatype_vvvvwaf == 'LONGTEXT') + if (datadefault_vvvvwaf == 'Other') { return true; } @@ -289,20 +175,8 @@ function datatype_vvvvwaf_SomeFunc(datatype_vvvvwaf) } // the vvvvwag function -function vvvvwag(store_vvvvwag,datatype_vvvvwag) +function vvvvwag(datatype_vvvvwag) { - if (isSet(store_vvvvwag) && store_vvvvwag.constructor !== Array) - { - var temp_vvvvwag = store_vvvvwag; - var store_vvvvwag = []; - store_vvvvwag.push(temp_vvvvwag); - } - else if (!isSet(store_vvvvwag)) - { - var store_vvvvwag = []; - } - var store = store_vvvvwag.some(store_vvvvwag_SomeFunc); - if (isSet(datatype_vvvvwag) && datatype_vvvvwag.constructor !== Array) { var temp_vvvvwag = datatype_vvvvwag; @@ -316,6 +190,132 @@ function vvvvwag(store_vvvvwag,datatype_vvvvwag) var datatype = datatype_vvvvwag.some(datatype_vvvvwag_SomeFunc); + // set this function logic + if (datatype) + { + jQuery('#jform_datadefault').closest('.control-group').show(); + jQuery('#jform_datalenght').closest('.control-group').show(); + jQuery('#jform_indexes').closest('.control-group').show(); + if (jform_vvvvwagvzs_required) + { + updateFieldRequired('indexes',0); + jQuery('#jform_indexes').prop('required','required'); + jQuery('#jform_indexes').attr('aria-required',true); + jQuery('#jform_indexes').addClass('required'); + jform_vvvvwagvzs_required = false; + } + + } + else + { + jQuery('#jform_datadefault').closest('.control-group').hide(); + jQuery('#jform_datalenght').closest('.control-group').hide(); + jQuery('#jform_indexes').closest('.control-group').hide(); + if (!jform_vvvvwagvzs_required) + { + updateFieldRequired('indexes',1); + jQuery('#jform_indexes').removeAttr('required'); + jQuery('#jform_indexes').removeAttr('aria-required'); + jQuery('#jform_indexes').removeClass('required'); + jform_vvvvwagvzs_required = true; + } + } +} + +// the vvvvwag Some function +function datatype_vvvvwag_SomeFunc(datatype_vvvvwag) +{ + // set the function logic + if (datatype_vvvvwag == 'CHAR' || datatype_vvvvwag == 'VARCHAR' || datatype_vvvvwag == 'DATETIME' || datatype_vvvvwag == 'DATE' || datatype_vvvvwag == 'TIME' || datatype_vvvvwag == 'INT' || datatype_vvvvwag == 'TINYINT' || datatype_vvvvwag == 'BIGINT' || datatype_vvvvwag == 'FLOAT' || datatype_vvvvwag == 'DECIMAL' || datatype_vvvvwag == 'DOUBLE') + { + return true; + } + return false; +} + +// the vvvvwah function +function vvvvwah(datatype_vvvvwah) +{ + if (isSet(datatype_vvvvwah) && datatype_vvvvwah.constructor !== Array) + { + var temp_vvvvwah = datatype_vvvvwah; + var datatype_vvvvwah = []; + datatype_vvvvwah.push(temp_vvvvwah); + } + else if (!isSet(datatype_vvvvwah)) + { + var datatype_vvvvwah = []; + } + var datatype = datatype_vvvvwah.some(datatype_vvvvwah_SomeFunc); + + + // set this function logic + if (datatype) + { + jQuery('#jform_store').closest('.control-group').show(); + if (jform_vvvvwahvzt_required) + { + updateFieldRequired('store',0); + jQuery('#jform_store').prop('required','required'); + jQuery('#jform_store').attr('aria-required',true); + jQuery('#jform_store').addClass('required'); + jform_vvvvwahvzt_required = false; + } + + } + else + { + jQuery('#jform_store').closest('.control-group').hide(); + if (!jform_vvvvwahvzt_required) + { + updateFieldRequired('store',1); + jQuery('#jform_store').removeAttr('required'); + jQuery('#jform_store').removeAttr('aria-required'); + jQuery('#jform_store').removeClass('required'); + jform_vvvvwahvzt_required = true; + } + } +} + +// the vvvvwah Some function +function datatype_vvvvwah_SomeFunc(datatype_vvvvwah) +{ + // set the function logic + if (datatype_vvvvwah == 'CHAR' || datatype_vvvvwah == 'VARCHAR' || datatype_vvvvwah == 'TEXT' || datatype_vvvvwah == 'MEDIUMTEXT' || datatype_vvvvwah == 'LONGTEXT') + { + return true; + } + return false; +} + +// the vvvvwai function +function vvvvwai(store_vvvvwai,datatype_vvvvwai) +{ + if (isSet(store_vvvvwai) && store_vvvvwai.constructor !== Array) + { + var temp_vvvvwai = store_vvvvwai; + var store_vvvvwai = []; + store_vvvvwai.push(temp_vvvvwai); + } + else if (!isSet(store_vvvvwai)) + { + var store_vvvvwai = []; + } + var store = store_vvvvwai.some(store_vvvvwai_SomeFunc); + + if (isSet(datatype_vvvvwai) && datatype_vvvvwai.constructor !== Array) + { + var temp_vvvvwai = datatype_vvvvwai; + var datatype_vvvvwai = []; + datatype_vvvvwai.push(temp_vvvvwai); + } + else if (!isSet(datatype_vvvvwai)) + { + var datatype_vvvvwai = []; + } + var datatype = datatype_vvvvwai.some(datatype_vvvvwai_SomeFunc); + + // set this function logic if (store && datatype) { @@ -327,148 +327,148 @@ function vvvvwag(store_vvvvwag,datatype_vvvvwag) } } -// the vvvvwag Some function -function store_vvvvwag_SomeFunc(store_vvvvwag) +// the vvvvwai Some function +function store_vvvvwai_SomeFunc(store_vvvvwai) { // set the function logic - if (store_vvvvwag == 4) + if (store_vvvvwai == 4) { return true; } return false; } -// the vvvvwag Some function -function datatype_vvvvwag_SomeFunc(datatype_vvvvwag) +// the vvvvwai Some function +function datatype_vvvvwai_SomeFunc(datatype_vvvvwai) { // set the function logic - if (datatype_vvvvwag == 'CHAR' || datatype_vvvvwag == 'VARCHAR' || datatype_vvvvwag == 'TEXT' || datatype_vvvvwag == 'MEDIUMTEXT' || datatype_vvvvwag == 'LONGTEXT') + if (datatype_vvvvwai == 'CHAR' || datatype_vvvvwai == 'VARCHAR' || datatype_vvvvwai == 'TEXT' || datatype_vvvvwai == 'MEDIUMTEXT' || datatype_vvvvwai == 'LONGTEXT') { return true; } return false; } -// the vvvvwai function -function vvvvwai(add_css_view_vvvvwai) +// the vvvvwak function +function vvvvwak(add_css_view_vvvvwak) { // set the function logic - if (add_css_view_vvvvwai == 1) + if (add_css_view_vvvvwak == 1) { jQuery('#jform_css_view').closest('.control-group').show(); - if (jform_vvvvwaivzs_required) + if (jform_vvvvwakvzu_required) { updateFieldRequired('css_view',0); jQuery('#jform_css_view').prop('required','required'); jQuery('#jform_css_view').attr('aria-required',true); jQuery('#jform_css_view').addClass('required'); - jform_vvvvwaivzs_required = false; - } - - } - else - { - jQuery('#jform_css_view').closest('.control-group').hide(); - if (!jform_vvvvwaivzs_required) - { - updateFieldRequired('css_view',1); - jQuery('#jform_css_view').removeAttr('required'); - jQuery('#jform_css_view').removeAttr('aria-required'); - jQuery('#jform_css_view').removeClass('required'); - jform_vvvvwaivzs_required = true; - } - } -} - -// the vvvvwaj function -function vvvvwaj(add_css_views_vvvvwaj) -{ - // set the function logic - if (add_css_views_vvvvwaj == 1) - { - jQuery('#jform_css_views').closest('.control-group').show(); - if (jform_vvvvwajvzt_required) - { - updateFieldRequired('css_views',0); - jQuery('#jform_css_views').prop('required','required'); - jQuery('#jform_css_views').attr('aria-required',true); - jQuery('#jform_css_views').addClass('required'); - jform_vvvvwajvzt_required = false; - } - - } - else - { - jQuery('#jform_css_views').closest('.control-group').hide(); - if (!jform_vvvvwajvzt_required) - { - updateFieldRequired('css_views',1); - jQuery('#jform_css_views').removeAttr('required'); - jQuery('#jform_css_views').removeAttr('aria-required'); - jQuery('#jform_css_views').removeClass('required'); - jform_vvvvwajvzt_required = true; - } - } -} - -// the vvvvwak function -function vvvvwak(add_javascript_view_footer_vvvvwak) -{ - // set the function logic - if (add_javascript_view_footer_vvvvwak == 1) - { - jQuery('#jform_javascript_view_footer').closest('.control-group').show(); - if (jform_vvvvwakvzu_required) - { - updateFieldRequired('javascript_view_footer',0); - jQuery('#jform_javascript_view_footer').prop('required','required'); - jQuery('#jform_javascript_view_footer').attr('aria-required',true); - jQuery('#jform_javascript_view_footer').addClass('required'); jform_vvvvwakvzu_required = false; } } else { - jQuery('#jform_javascript_view_footer').closest('.control-group').hide(); + jQuery('#jform_css_view').closest('.control-group').hide(); if (!jform_vvvvwakvzu_required) { - updateFieldRequired('javascript_view_footer',1); - jQuery('#jform_javascript_view_footer').removeAttr('required'); - jQuery('#jform_javascript_view_footer').removeAttr('aria-required'); - jQuery('#jform_javascript_view_footer').removeClass('required'); + updateFieldRequired('css_view',1); + jQuery('#jform_css_view').removeAttr('required'); + jQuery('#jform_css_view').removeAttr('aria-required'); + jQuery('#jform_css_view').removeClass('required'); jform_vvvvwakvzu_required = true; } } } // the vvvvwal function -function vvvvwal(add_javascript_views_footer_vvvvwal) +function vvvvwal(add_css_views_vvvvwal) { // set the function logic - if (add_javascript_views_footer_vvvvwal == 1) + if (add_css_views_vvvvwal == 1) { - jQuery('#jform_javascript_views_footer').closest('.control-group').show(); + jQuery('#jform_css_views').closest('.control-group').show(); if (jform_vvvvwalvzv_required) { - updateFieldRequired('javascript_views_footer',0); - jQuery('#jform_javascript_views_footer').prop('required','required'); - jQuery('#jform_javascript_views_footer').attr('aria-required',true); - jQuery('#jform_javascript_views_footer').addClass('required'); + updateFieldRequired('css_views',0); + jQuery('#jform_css_views').prop('required','required'); + jQuery('#jform_css_views').attr('aria-required',true); + jQuery('#jform_css_views').addClass('required'); jform_vvvvwalvzv_required = false; } } else { - jQuery('#jform_javascript_views_footer').closest('.control-group').hide(); + jQuery('#jform_css_views').closest('.control-group').hide(); if (!jform_vvvvwalvzv_required) + { + updateFieldRequired('css_views',1); + jQuery('#jform_css_views').removeAttr('required'); + jQuery('#jform_css_views').removeAttr('aria-required'); + jQuery('#jform_css_views').removeClass('required'); + jform_vvvvwalvzv_required = true; + } + } +} + +// the vvvvwam function +function vvvvwam(add_javascript_view_footer_vvvvwam) +{ + // set the function logic + if (add_javascript_view_footer_vvvvwam == 1) + { + jQuery('#jform_javascript_view_footer').closest('.control-group').show(); + if (jform_vvvvwamvzw_required) + { + updateFieldRequired('javascript_view_footer',0); + jQuery('#jform_javascript_view_footer').prop('required','required'); + jQuery('#jform_javascript_view_footer').attr('aria-required',true); + jQuery('#jform_javascript_view_footer').addClass('required'); + jform_vvvvwamvzw_required = false; + } + + } + else + { + jQuery('#jform_javascript_view_footer').closest('.control-group').hide(); + if (!jform_vvvvwamvzw_required) + { + updateFieldRequired('javascript_view_footer',1); + jQuery('#jform_javascript_view_footer').removeAttr('required'); + jQuery('#jform_javascript_view_footer').removeAttr('aria-required'); + jQuery('#jform_javascript_view_footer').removeClass('required'); + jform_vvvvwamvzw_required = true; + } + } +} + +// the vvvvwan function +function vvvvwan(add_javascript_views_footer_vvvvwan) +{ + // set the function logic + if (add_javascript_views_footer_vvvvwan == 1) + { + jQuery('#jform_javascript_views_footer').closest('.control-group').show(); + if (jform_vvvvwanvzx_required) + { + updateFieldRequired('javascript_views_footer',0); + jQuery('#jform_javascript_views_footer').prop('required','required'); + jQuery('#jform_javascript_views_footer').attr('aria-required',true); + jQuery('#jform_javascript_views_footer').addClass('required'); + jform_vvvvwanvzx_required = false; + } + + } + else + { + jQuery('#jform_javascript_views_footer').closest('.control-group').hide(); + if (!jform_vvvvwanvzx_required) { updateFieldRequired('javascript_views_footer',1); jQuery('#jform_javascript_views_footer').removeAttr('required'); jQuery('#jform_javascript_views_footer').removeAttr('aria-required'); jQuery('#jform_javascript_views_footer').removeClass('required'); - jform_vvvvwalvzv_required = true; + jform_vvvvwanvzx_required = true; } } } diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index b27dbb1af..65ac22f06 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -23,207 +23,97 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvwamvzy_required = false; -jform_vvvvwanvzz_required = false; jform_vvvvwaowaa_required = false; jform_vvvvwapwab_required = false; jform_vvvvwaqwac_required = false; jform_vvvvwarwad_required = false; +jform_vvvvwaswae_required = false; +jform_vvvvwatwaf_required = false; // Initial Script jQuery(document).ready(function() { - var location_vvvvwam = jQuery("#jform_location input[type='radio']:checked").val(); - vvvvwam(location_vvvvwam); + var location_vvvvwao = jQuery("#jform_location input[type='radio']:checked").val(); + vvvvwao(location_vvvvwao); - var location_vvvvwan = jQuery("#jform_location input[type='radio']:checked").val(); - vvvvwan(location_vvvvwan); - - var type_vvvvwao = jQuery("#jform_type").val(); - vvvvwao(type_vvvvwao); - - var type_vvvvwap = jQuery("#jform_type").val(); - vvvvwap(type_vvvvwap); + var location_vvvvwap = jQuery("#jform_location input[type='radio']:checked").val(); + vvvvwap(location_vvvvwap); var type_vvvvwaq = jQuery("#jform_type").val(); vvvvwaq(type_vvvvwaq); - var target_vvvvwar = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvwar(target_vvvvwar); + var type_vvvvwar = jQuery("#jform_type").val(); + vvvvwar(type_vvvvwar); + + var type_vvvvwas = jQuery("#jform_type").val(); + vvvvwas(type_vvvvwas); + + var target_vvvvwat = jQuery("#jform_target input[type='radio']:checked").val(); + vvvvwat(target_vvvvwat); }); -// the vvvvwam function -function vvvvwam(location_vvvvwam) +// the vvvvwao function +function vvvvwao(location_vvvvwao) { // set the function logic - if (location_vvvvwam == 1) + if (location_vvvvwao == 1) { jQuery('#jform_admin_view').closest('.control-group').show(); - if (jform_vvvvwamvzy_required) + if (jform_vvvvwaowaa_required) { updateFieldRequired('admin_view',0); jQuery('#jform_admin_view').prop('required','required'); jQuery('#jform_admin_view').attr('aria-required',true); jQuery('#jform_admin_view').addClass('required'); - jform_vvvvwamvzy_required = false; - } - - } - else - { - jQuery('#jform_admin_view').closest('.control-group').hide(); - if (!jform_vvvvwamvzy_required) - { - updateFieldRequired('admin_view',1); - jQuery('#jform_admin_view').removeAttr('required'); - jQuery('#jform_admin_view').removeAttr('aria-required'); - jQuery('#jform_admin_view').removeClass('required'); - jform_vvvvwamvzy_required = true; - } - } -} - -// the vvvvwan function -function vvvvwan(location_vvvvwan) -{ - // set the function logic - if (location_vvvvwan == 2) - { - jQuery('#jform_site_view').closest('.control-group').show(); - if (jform_vvvvwanvzz_required) - { - updateFieldRequired('site_view',0); - jQuery('#jform_site_view').prop('required','required'); - jQuery('#jform_site_view').attr('aria-required',true); - jQuery('#jform_site_view').addClass('required'); - jform_vvvvwanvzz_required = false; - } - - } - else - { - jQuery('#jform_site_view').closest('.control-group').hide(); - if (!jform_vvvvwanvzz_required) - { - updateFieldRequired('site_view',1); - jQuery('#jform_site_view').removeAttr('required'); - jQuery('#jform_site_view').removeAttr('aria-required'); - jQuery('#jform_site_view').removeClass('required'); - jform_vvvvwanvzz_required = true; - } - } -} - -// the vvvvwao function -function vvvvwao(type_vvvvwao) -{ - if (isSet(type_vvvvwao) && type_vvvvwao.constructor !== Array) - { - var temp_vvvvwao = type_vvvvwao; - var type_vvvvwao = []; - type_vvvvwao.push(temp_vvvvwao); - } - else if (!isSet(type_vvvvwao)) - { - var type_vvvvwao = []; - } - var type = type_vvvvwao.some(type_vvvvwao_SomeFunc); - - - // set this function logic - if (type) - { - jQuery('#jform_url').closest('.control-group').show(); - if (jform_vvvvwaowaa_required) - { - updateFieldRequired('url',0); - jQuery('#jform_url').prop('required','required'); - jQuery('#jform_url').attr('aria-required',true); - jQuery('#jform_url').addClass('required'); jform_vvvvwaowaa_required = false; } } else { - jQuery('#jform_url').closest('.control-group').hide(); + jQuery('#jform_admin_view').closest('.control-group').hide(); if (!jform_vvvvwaowaa_required) { - updateFieldRequired('url',1); - jQuery('#jform_url').removeAttr('required'); - jQuery('#jform_url').removeAttr('aria-required'); - jQuery('#jform_url').removeClass('required'); + updateFieldRequired('admin_view',1); + jQuery('#jform_admin_view').removeAttr('required'); + jQuery('#jform_admin_view').removeAttr('aria-required'); + jQuery('#jform_admin_view').removeClass('required'); jform_vvvvwaowaa_required = true; } } } -// the vvvvwao Some function -function type_vvvvwao_SomeFunc(type_vvvvwao) +// the vvvvwap function +function vvvvwap(location_vvvvwap) { // set the function logic - if (type_vvvvwao == 3) + if (location_vvvvwap == 2) { - return true; - } - return false; -} - -// the vvvvwap function -function vvvvwap(type_vvvvwap) -{ - if (isSet(type_vvvvwap) && type_vvvvwap.constructor !== Array) - { - var temp_vvvvwap = type_vvvvwap; - var type_vvvvwap = []; - type_vvvvwap.push(temp_vvvvwap); - } - else if (!isSet(type_vvvvwap)) - { - var type_vvvvwap = []; - } - var type = type_vvvvwap.some(type_vvvvwap_SomeFunc); - - - // set this function logic - if (type) - { - jQuery('#jform_article').closest('.control-group').show(); + jQuery('#jform_site_view').closest('.control-group').show(); if (jform_vvvvwapwab_required) { - updateFieldRequired('article',0); - jQuery('#jform_article').prop('required','required'); - jQuery('#jform_article').attr('aria-required',true); - jQuery('#jform_article').addClass('required'); + updateFieldRequired('site_view',0); + jQuery('#jform_site_view').prop('required','required'); + jQuery('#jform_site_view').attr('aria-required',true); + jQuery('#jform_site_view').addClass('required'); jform_vvvvwapwab_required = false; } } else { - jQuery('#jform_article').closest('.control-group').hide(); + jQuery('#jform_site_view').closest('.control-group').hide(); if (!jform_vvvvwapwab_required) { - updateFieldRequired('article',1); - jQuery('#jform_article').removeAttr('required'); - jQuery('#jform_article').removeAttr('aria-required'); - jQuery('#jform_article').removeClass('required'); + updateFieldRequired('site_view',1); + jQuery('#jform_site_view').removeAttr('required'); + jQuery('#jform_site_view').removeAttr('aria-required'); + jQuery('#jform_site_view').removeClass('required'); jform_vvvvwapwab_required = true; } } } -// the vvvvwap Some function -function type_vvvvwap_SomeFunc(type_vvvvwap) -{ - // set the function logic - if (type_vvvvwap == 1) - { - return true; - } - return false; -} - // the vvvvwaq function function vvvvwaq(type_vvvvwaq) { @@ -243,26 +133,26 @@ function vvvvwaq(type_vvvvwaq) // set this function logic if (type) { - jQuery('#jform_content-lbl').closest('.control-group').show(); + jQuery('#jform_url').closest('.control-group').show(); if (jform_vvvvwaqwac_required) { - updateFieldRequired('content',0); - jQuery('#jform_content').prop('required','required'); - jQuery('#jform_content').attr('aria-required',true); - jQuery('#jform_content').addClass('required'); + updateFieldRequired('url',0); + jQuery('#jform_url').prop('required','required'); + jQuery('#jform_url').attr('aria-required',true); + jQuery('#jform_url').addClass('required'); jform_vvvvwaqwac_required = false; } } else { - jQuery('#jform_content-lbl').closest('.control-group').hide(); + jQuery('#jform_url').closest('.control-group').hide(); if (!jform_vvvvwaqwac_required) { - updateFieldRequired('content',1); - jQuery('#jform_content').removeAttr('required'); - jQuery('#jform_content').removeAttr('aria-required'); - jQuery('#jform_content').removeClass('required'); + updateFieldRequired('url',1); + jQuery('#jform_url').removeAttr('required'); + jQuery('#jform_url').removeAttr('aria-required'); + jQuery('#jform_url').removeClass('required'); jform_vvvvwaqwac_required = true; } } @@ -272,7 +162,7 @@ function vvvvwaq(type_vvvvwaq) function type_vvvvwaq_SomeFunc(type_vvvvwaq) { // set the function logic - if (type_vvvvwaq == 2) + if (type_vvvvwaq == 3) { return true; } @@ -280,32 +170,142 @@ function type_vvvvwaq_SomeFunc(type_vvvvwaq) } // the vvvvwar function -function vvvvwar(target_vvvvwar) +function vvvvwar(type_vvvvwar) { - // set the function logic - if (target_vvvvwar == 1) + if (isSet(type_vvvvwar) && type_vvvvwar.constructor !== Array) { - jQuery('#jform_groups').closest('.control-group').show(); + var temp_vvvvwar = type_vvvvwar; + var type_vvvvwar = []; + type_vvvvwar.push(temp_vvvvwar); + } + else if (!isSet(type_vvvvwar)) + { + var type_vvvvwar = []; + } + var type = type_vvvvwar.some(type_vvvvwar_SomeFunc); + + + // set this function logic + if (type) + { + jQuery('#jform_article').closest('.control-group').show(); if (jform_vvvvwarwad_required) { - updateFieldRequired('groups',0); - jQuery('#jform_groups').prop('required','required'); - jQuery('#jform_groups').attr('aria-required',true); - jQuery('#jform_groups').addClass('required'); + updateFieldRequired('article',0); + jQuery('#jform_article').prop('required','required'); + jQuery('#jform_article').attr('aria-required',true); + jQuery('#jform_article').addClass('required'); jform_vvvvwarwad_required = false; } } else { - jQuery('#jform_groups').closest('.control-group').hide(); + jQuery('#jform_article').closest('.control-group').hide(); if (!jform_vvvvwarwad_required) + { + updateFieldRequired('article',1); + jQuery('#jform_article').removeAttr('required'); + jQuery('#jform_article').removeAttr('aria-required'); + jQuery('#jform_article').removeClass('required'); + jform_vvvvwarwad_required = true; + } + } +} + +// the vvvvwar Some function +function type_vvvvwar_SomeFunc(type_vvvvwar) +{ + // set the function logic + if (type_vvvvwar == 1) + { + return true; + } + return false; +} + +// the vvvvwas function +function vvvvwas(type_vvvvwas) +{ + if (isSet(type_vvvvwas) && type_vvvvwas.constructor !== Array) + { + var temp_vvvvwas = type_vvvvwas; + var type_vvvvwas = []; + type_vvvvwas.push(temp_vvvvwas); + } + else if (!isSet(type_vvvvwas)) + { + var type_vvvvwas = []; + } + var type = type_vvvvwas.some(type_vvvvwas_SomeFunc); + + + // set this function logic + if (type) + { + jQuery('#jform_content-lbl').closest('.control-group').show(); + if (jform_vvvvwaswae_required) + { + updateFieldRequired('content',0); + jQuery('#jform_content').prop('required','required'); + jQuery('#jform_content').attr('aria-required',true); + jQuery('#jform_content').addClass('required'); + jform_vvvvwaswae_required = false; + } + + } + else + { + jQuery('#jform_content-lbl').closest('.control-group').hide(); + if (!jform_vvvvwaswae_required) + { + updateFieldRequired('content',1); + jQuery('#jform_content').removeAttr('required'); + jQuery('#jform_content').removeAttr('aria-required'); + jQuery('#jform_content').removeClass('required'); + jform_vvvvwaswae_required = true; + } + } +} + +// the vvvvwas Some function +function type_vvvvwas_SomeFunc(type_vvvvwas) +{ + // set the function logic + if (type_vvvvwas == 2) + { + return true; + } + return false; +} + +// the vvvvwat function +function vvvvwat(target_vvvvwat) +{ + // set the function logic + if (target_vvvvwat == 1) + { + jQuery('#jform_groups').closest('.control-group').show(); + if (jform_vvvvwatwaf_required) + { + updateFieldRequired('groups',0); + jQuery('#jform_groups').prop('required','required'); + jQuery('#jform_groups').attr('aria-required',true); + jQuery('#jform_groups').addClass('required'); + jform_vvvvwatwaf_required = false; + } + + } + else + { + jQuery('#jform_groups').closest('.control-group').hide(); + if (!jform_vvvvwatwaf_required) { updateFieldRequired('groups',1); jQuery('#jform_groups').removeAttr('required'); jQuery('#jform_groups').removeAttr('aria-required'); jQuery('#jform_groups').removeClass('required'); - jform_vvvvwarwad_required = true; + jform_vvvvwatwaf_required = true; } } } diff --git a/admin/models/forms/layout.js b/admin/models/forms/layout.js index 0734423a5..295c084c4 100644 --- a/admin/models/forms/layout.js +++ b/admin/models/forms/layout.js @@ -23,42 +23,42 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvytvyp_required = false; +jform_vvvvvyvvyr_required = false; // Initial Script jQuery(document).ready(function() { - var add_php_view_vvvvvyt = jQuery("#jform_add_php_view input[type='radio']:checked").val(); - vvvvvyt(add_php_view_vvvvvyt); + var add_php_view_vvvvvyv = jQuery("#jform_add_php_view input[type='radio']:checked").val(); + vvvvvyv(add_php_view_vvvvvyv); }); -// the vvvvvyt function -function vvvvvyt(add_php_view_vvvvvyt) +// the vvvvvyv function +function vvvvvyv(add_php_view_vvvvvyv) { // set the function logic - if (add_php_view_vvvvvyt == 1) + if (add_php_view_vvvvvyv == 1) { jQuery('#jform_php_view').closest('.control-group').show(); - if (jform_vvvvvytvyp_required) + if (jform_vvvvvyvvyr_required) { updateFieldRequired('php_view',0); jQuery('#jform_php_view').prop('required','required'); jQuery('#jform_php_view').attr('aria-required',true); jQuery('#jform_php_view').addClass('required'); - jform_vvvvvytvyp_required = false; + jform_vvvvvyvvyr_required = false; } } else { jQuery('#jform_php_view').closest('.control-group').hide(); - if (!jform_vvvvvytvyp_required) + if (!jform_vvvvvyvvyr_required) { updateFieldRequired('php_view',1); jQuery('#jform_php_view').removeAttr('required'); jQuery('#jform_php_view').removeAttr('aria-required'); jQuery('#jform_php_view').removeClass('required'); - jform_vvvvvytvyp_required = true; + jform_vvvvvyvvyr_required = true; } } } diff --git a/admin/models/forms/library.js b/admin/models/forms/library.js index a5a960a54..98f4d4e46 100644 --- a/admin/models/forms/library.js +++ b/admin/models/forms/library.js @@ -23,18 +23,12 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvzvvzm_required = false; -jform_vvvvwabvzn_required = false; +jform_vvvvvzxvzo_required = false; +jform_vvvvwadvzp_required = false; // Initial Script jQuery(document).ready(function() { - var how_vvvvvzu = jQuery("#jform_how").val(); - vvvvvzu(how_vvvvvzu); - - var how_vvvvvzv = jQuery("#jform_how").val(); - vvvvvzv(how_vvvvvzv); - var how_vvvvvzw = jQuery("#jform_how").val(); vvvvvzw(how_vvvvvzw); @@ -50,103 +44,16 @@ jQuery(document).ready(function() var how_vvvvwaa = jQuery("#jform_how").val(); vvvvwaa(how_vvvvwaa); - var type_vvvvwab = jQuery("#jform_type input[type='radio']:checked").val(); - vvvvwab(type_vvvvwab); + var how_vvvvwab = jQuery("#jform_how").val(); + vvvvwab(how_vvvvwab); + + var how_vvvvwac = jQuery("#jform_how").val(); + vvvvwac(how_vvvvwac); + + var type_vvvvwad = jQuery("#jform_type input[type='radio']:checked").val(); + vvvvwad(type_vvvvwad); }); -// the vvvvvzu function -function vvvvvzu(how_vvvvvzu) -{ - if (isSet(how_vvvvvzu) && how_vvvvvzu.constructor !== Array) - { - var temp_vvvvvzu = how_vvvvvzu; - var how_vvvvvzu = []; - how_vvvvvzu.push(temp_vvvvvzu); - } - else if (!isSet(how_vvvvvzu)) - { - var how_vvvvvzu = []; - } - var how = how_vvvvvzu.some(how_vvvvvzu_SomeFunc); - - - // set this function logic - if (how) - { - jQuery('#jform_addconditions-lbl').closest('.control-group').show(); - } - else - { - jQuery('#jform_addconditions-lbl').closest('.control-group').hide(); - } -} - -// the vvvvvzu Some function -function how_vvvvvzu_SomeFunc(how_vvvvvzu) -{ - // set the function logic - if (how_vvvvvzu == 2) - { - return true; - } - return false; -} - -// the vvvvvzv function -function vvvvvzv(how_vvvvvzv) -{ - if (isSet(how_vvvvvzv) && how_vvvvvzv.constructor !== Array) - { - var temp_vvvvvzv = how_vvvvvzv; - var how_vvvvvzv = []; - how_vvvvvzv.push(temp_vvvvvzv); - } - else if (!isSet(how_vvvvvzv)) - { - var how_vvvvvzv = []; - } - var how = how_vvvvvzv.some(how_vvvvvzv_SomeFunc); - - - // set this function logic - if (how) - { - jQuery('#jform_php_setdocument').closest('.control-group').show(); - if (jform_vvvvvzvvzm_required) - { - updateFieldRequired('php_setdocument',0); - jQuery('#jform_php_setdocument').prop('required','required'); - jQuery('#jform_php_setdocument').attr('aria-required',true); - jQuery('#jform_php_setdocument').addClass('required'); - jform_vvvvvzvvzm_required = false; - } - - } - else - { - jQuery('#jform_php_setdocument').closest('.control-group').hide(); - if (!jform_vvvvvzvvzm_required) - { - updateFieldRequired('php_setdocument',1); - jQuery('#jform_php_setdocument').removeAttr('required'); - jQuery('#jform_php_setdocument').removeAttr('aria-required'); - jQuery('#jform_php_setdocument').removeClass('required'); - jform_vvvvvzvvzm_required = true; - } - } -} - -// the vvvvvzv Some function -function how_vvvvvzv_SomeFunc(how_vvvvvzv) -{ - // set the function logic - if (how_vvvvvzv == 3) - { - return true; - } - return false; -} - // the vvvvvzw function function vvvvvzw(how_vvvvvzw) { @@ -166,11 +73,11 @@ function vvvvvzw(how_vvvvvzw) // set this function logic if (how) { - jQuery('.note_display_library_config').closest('.control-group').show(); + jQuery('#jform_addconditions-lbl').closest('.control-group').show(); } else { - jQuery('.note_display_library_config').closest('.control-group').hide(); + jQuery('#jform_addconditions-lbl').closest('.control-group').hide(); } } @@ -178,7 +85,7 @@ function vvvvvzw(how_vvvvvzw) function how_vvvvvzw_SomeFunc(how_vvvvvzw) { // set the function logic - if (how_vvvvvzw == 2 || how_vvvvvzw == 3) + if (how_vvvvvzw == 2) { return true; } @@ -204,11 +111,28 @@ function vvvvvzx(how_vvvvvzx) // set this function logic if (how) { - jQuery('.note_display_library_files_folders_urls').closest('.control-group').show(); + jQuery('#jform_php_setdocument').closest('.control-group').show(); + if (jform_vvvvvzxvzo_required) + { + updateFieldRequired('php_setdocument',0); + jQuery('#jform_php_setdocument').prop('required','required'); + jQuery('#jform_php_setdocument').attr('aria-required',true); + jQuery('#jform_php_setdocument').addClass('required'); + jform_vvvvvzxvzo_required = false; + } + } else { - jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide(); + jQuery('#jform_php_setdocument').closest('.control-group').hide(); + if (!jform_vvvvvzxvzo_required) + { + updateFieldRequired('php_setdocument',1); + jQuery('#jform_php_setdocument').removeAttr('required'); + jQuery('#jform_php_setdocument').removeAttr('aria-required'); + jQuery('#jform_php_setdocument').removeClass('required'); + jform_vvvvvzxvzo_required = true; + } } } @@ -216,7 +140,7 @@ function vvvvvzx(how_vvvvvzx) function how_vvvvvzx_SomeFunc(how_vvvvvzx) { // set the function logic - if (how_vvvvvzx == 1 || how_vvvvvzx == 2 || how_vvvvvzx == 3) + if (how_vvvvvzx == 3) { return true; } @@ -242,15 +166,11 @@ function vvvvvzy(how_vvvvvzy) // set this function logic if (how) { - jQuery('.note_no_behaviour_one').closest('.control-group').show(); - jQuery('.note_no_behaviour_three').closest('.control-group').show(); - jQuery('.note_no_behaviour_two').closest('.control-group').show(); + jQuery('.note_display_library_config').closest('.control-group').show(); } else { - jQuery('.note_no_behaviour_one').closest('.control-group').hide(); - jQuery('.note_no_behaviour_three').closest('.control-group').hide(); - jQuery('.note_no_behaviour_two').closest('.control-group').hide(); + jQuery('.note_display_library_config').closest('.control-group').hide(); } } @@ -258,7 +178,7 @@ function vvvvvzy(how_vvvvvzy) function how_vvvvvzy_SomeFunc(how_vvvvvzy) { // set the function logic - if (how_vvvvvzy == 0) + if (how_vvvvvzy == 2 || how_vvvvvzy == 3) { return true; } @@ -284,13 +204,11 @@ function vvvvvzz(how_vvvvvzz) // set this function logic if (how) { - jQuery('.note_yes_behaviour_one').closest('.control-group').show(); - jQuery('.note_yes_behaviour_two').closest('.control-group').show(); + jQuery('.note_display_library_files_folders_urls').closest('.control-group').show(); } else { - jQuery('.note_yes_behaviour_one').closest('.control-group').hide(); - jQuery('.note_yes_behaviour_two').closest('.control-group').hide(); + jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide(); } } @@ -298,7 +216,7 @@ function vvvvvzz(how_vvvvvzz) function how_vvvvvzz_SomeFunc(how_vvvvvzz) { // set the function logic - if (how_vvvvvzz == 1) + if (how_vvvvvzz == 1 || how_vvvvvzz == 2 || how_vvvvvzz == 3) { return true; } @@ -321,6 +239,88 @@ function vvvvwaa(how_vvvvwaa) var how = how_vvvvwaa.some(how_vvvvwaa_SomeFunc); + // set this function logic + if (how) + { + jQuery('.note_no_behaviour_one').closest('.control-group').show(); + jQuery('.note_no_behaviour_three').closest('.control-group').show(); + jQuery('.note_no_behaviour_two').closest('.control-group').show(); + } + else + { + jQuery('.note_no_behaviour_one').closest('.control-group').hide(); + jQuery('.note_no_behaviour_three').closest('.control-group').hide(); + jQuery('.note_no_behaviour_two').closest('.control-group').hide(); + } +} + +// the vvvvwaa Some function +function how_vvvvwaa_SomeFunc(how_vvvvwaa) +{ + // set the function logic + if (how_vvvvwaa == 0) + { + return true; + } + return false; +} + +// the vvvvwab function +function vvvvwab(how_vvvvwab) +{ + if (isSet(how_vvvvwab) && how_vvvvwab.constructor !== Array) + { + var temp_vvvvwab = how_vvvvwab; + var how_vvvvwab = []; + how_vvvvwab.push(temp_vvvvwab); + } + else if (!isSet(how_vvvvwab)) + { + var how_vvvvwab = []; + } + var how = how_vvvvwab.some(how_vvvvwab_SomeFunc); + + + // set this function logic + if (how) + { + jQuery('.note_yes_behaviour_one').closest('.control-group').show(); + jQuery('.note_yes_behaviour_two').closest('.control-group').show(); + } + else + { + jQuery('.note_yes_behaviour_one').closest('.control-group').hide(); + jQuery('.note_yes_behaviour_two').closest('.control-group').hide(); + } +} + +// the vvvvwab Some function +function how_vvvvwab_SomeFunc(how_vvvvwab) +{ + // set the function logic + if (how_vvvvwab == 1) + { + return true; + } + return false; +} + +// the vvvvwac function +function vvvvwac(how_vvvvwac) +{ + if (isSet(how_vvvvwac) && how_vvvvwac.constructor !== Array) + { + var temp_vvvvwac = how_vvvvwac; + var how_vvvvwac = []; + how_vvvvwac.push(temp_vvvvwac); + } + else if (!isSet(how_vvvvwac)) + { + var how_vvvvwac = []; + } + var how = how_vvvvwac.some(how_vvvvwac_SomeFunc); + + // set this function logic if (how) { @@ -336,44 +336,44 @@ function vvvvwaa(how_vvvvwaa) } } -// the vvvvwaa Some function -function how_vvvvwaa_SomeFunc(how_vvvvwaa) +// the vvvvwac Some function +function how_vvvvwac_SomeFunc(how_vvvvwac) { // set the function logic - if (how_vvvvwaa == 4) + if (how_vvvvwac == 4) { return true; } return false; } -// the vvvvwab function -function vvvvwab(type_vvvvwab) +// the vvvvwad function +function vvvvwad(type_vvvvwad) { // set the function logic - if (type_vvvvwab == 2) + if (type_vvvvwad == 2) { jQuery('#jform_libraries').closest('.control-group').show(); - if (jform_vvvvwabvzn_required) + if (jform_vvvvwadvzp_required) { updateFieldRequired('libraries',0); jQuery('#jform_libraries').prop('required','required'); jQuery('#jform_libraries').attr('aria-required',true); jQuery('#jform_libraries').addClass('required'); - jform_vvvvwabvzn_required = false; + jform_vvvvwadvzp_required = false; } } else { jQuery('#jform_libraries').closest('.control-group').hide(); - if (!jform_vvvvwabvzn_required) + if (!jform_vvvvwadvzp_required) { updateFieldRequired('libraries',1); jQuery('#jform_libraries').removeAttr('required'); jQuery('#jform_libraries').removeAttr('aria-required'); jQuery('#jform_libraries').removeClass('required'); - jform_vvvvwabvzn_required = true; + jform_vvvvwadvzp_required = true; } } } diff --git a/admin/models/forms/site_view.js b/admin/models/forms/site_view.js index f69c61d46..cbf590fcb 100644 --- a/admin/models/forms/site_view.js +++ b/admin/models/forms/site_view.js @@ -23,7 +23,6 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvyivye_required = false; jform_vvvvvyjvyf_required = false; jform_vvvvvykvyg_required = false; jform_vvvvvylvyh_required = false; @@ -32,274 +31,310 @@ jform_vvvvvynvyj_required = false; jform_vvvvvyovyk_required = false; jform_vvvvvypvyl_required = false; jform_vvvvvyqvym_required = false; -jform_vvvvvyqvyn_required = false; +jform_vvvvvyrvyn_required = false; +jform_vvvvvysvyo_required = false; +jform_vvvvvysvyp_required = false; // Initial Script jQuery(document).ready(function() { - var add_php_view_vvvvvyi = jQuery("#jform_add_php_view input[type='radio']:checked").val(); - vvvvvyi(add_php_view_vvvvvyi); + var add_php_view_vvvvvyj = jQuery("#jform_add_php_view input[type='radio']:checked").val(); + vvvvvyj(add_php_view_vvvvvyj); - var add_php_jview_display_vvvvvyj = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val(); - vvvvvyj(add_php_jview_display_vvvvvyj); + var add_php_jview_display_vvvvvyk = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val(); + vvvvvyk(add_php_jview_display_vvvvvyk); - var add_php_jview_vvvvvyk = jQuery("#jform_add_php_jview input[type='radio']:checked").val(); - vvvvvyk(add_php_jview_vvvvvyk); + var add_php_jview_vvvvvyl = jQuery("#jform_add_php_jview input[type='radio']:checked").val(); + vvvvvyl(add_php_jview_vvvvvyl); - var add_php_document_vvvvvyl = jQuery("#jform_add_php_document input[type='radio']:checked").val(); - vvvvvyl(add_php_document_vvvvvyl); + var add_php_document_vvvvvym = jQuery("#jform_add_php_document input[type='radio']:checked").val(); + vvvvvym(add_php_document_vvvvvym); - var add_css_document_vvvvvym = jQuery("#jform_add_css_document input[type='radio']:checked").val(); - vvvvvym(add_css_document_vvvvvym); + var add_css_document_vvvvvyn = jQuery("#jform_add_css_document input[type='radio']:checked").val(); + vvvvvyn(add_css_document_vvvvvyn); - var add_js_document_vvvvvyn = jQuery("#jform_add_js_document input[type='radio']:checked").val(); - vvvvvyn(add_js_document_vvvvvyn); + var add_javascript_file_vvvvvyo = jQuery("#jform_add_javascript_file input[type='radio']:checked").val(); + vvvvvyo(add_javascript_file_vvvvvyo); - var add_css_vvvvvyo = jQuery("#jform_add_css input[type='radio']:checked").val(); - vvvvvyo(add_css_vvvvvyo); + var add_js_document_vvvvvyp = jQuery("#jform_add_js_document input[type='radio']:checked").val(); + vvvvvyp(add_js_document_vvvvvyp); - var add_php_ajax_vvvvvyp = jQuery("#jform_add_php_ajax input[type='radio']:checked").val(); - vvvvvyp(add_php_ajax_vvvvvyp); + var add_css_vvvvvyq = jQuery("#jform_add_css input[type='radio']:checked").val(); + vvvvvyq(add_css_vvvvvyq); - var add_custom_button_vvvvvyq = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); - vvvvvyq(add_custom_button_vvvvvyq); + var add_php_ajax_vvvvvyr = jQuery("#jform_add_php_ajax input[type='radio']:checked").val(); + vvvvvyr(add_php_ajax_vvvvvyr); - var button_position_vvvvvyr = jQuery("#jform_button_position").val(); - vvvvvyr(button_position_vvvvvyr); + var add_custom_button_vvvvvys = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); + vvvvvys(add_custom_button_vvvvvys); + + var button_position_vvvvvyt = jQuery("#jform_button_position").val(); + vvvvvyt(button_position_vvvvvyt); }); -// the vvvvvyi function -function vvvvvyi(add_php_view_vvvvvyi) +// the vvvvvyj function +function vvvvvyj(add_php_view_vvvvvyj) { // set the function logic - if (add_php_view_vvvvvyi == 1) + if (add_php_view_vvvvvyj == 1) { jQuery('#jform_php_view').closest('.control-group').show(); - if (jform_vvvvvyivye_required) + if (jform_vvvvvyjvyf_required) { updateFieldRequired('php_view',0); jQuery('#jform_php_view').prop('required','required'); jQuery('#jform_php_view').attr('aria-required',true); jQuery('#jform_php_view').addClass('required'); - jform_vvvvvyivye_required = false; - } - - } - else - { - jQuery('#jform_php_view').closest('.control-group').hide(); - if (!jform_vvvvvyivye_required) - { - updateFieldRequired('php_view',1); - jQuery('#jform_php_view').removeAttr('required'); - jQuery('#jform_php_view').removeAttr('aria-required'); - jQuery('#jform_php_view').removeClass('required'); - jform_vvvvvyivye_required = true; - } - } -} - -// the vvvvvyj function -function vvvvvyj(add_php_jview_display_vvvvvyj) -{ - // set the function logic - if (add_php_jview_display_vvvvvyj == 1) - { - jQuery('#jform_php_jview_display').closest('.control-group').show(); - if (jform_vvvvvyjvyf_required) - { - updateFieldRequired('php_jview_display',0); - jQuery('#jform_php_jview_display').prop('required','required'); - jQuery('#jform_php_jview_display').attr('aria-required',true); - jQuery('#jform_php_jview_display').addClass('required'); jform_vvvvvyjvyf_required = false; } } else { - jQuery('#jform_php_jview_display').closest('.control-group').hide(); + jQuery('#jform_php_view').closest('.control-group').hide(); if (!jform_vvvvvyjvyf_required) { - updateFieldRequired('php_jview_display',1); - jQuery('#jform_php_jview_display').removeAttr('required'); - jQuery('#jform_php_jview_display').removeAttr('aria-required'); - jQuery('#jform_php_jview_display').removeClass('required'); + updateFieldRequired('php_view',1); + jQuery('#jform_php_view').removeAttr('required'); + jQuery('#jform_php_view').removeAttr('aria-required'); + jQuery('#jform_php_view').removeClass('required'); jform_vvvvvyjvyf_required = true; } } } // the vvvvvyk function -function vvvvvyk(add_php_jview_vvvvvyk) +function vvvvvyk(add_php_jview_display_vvvvvyk) { // set the function logic - if (add_php_jview_vvvvvyk == 1) + if (add_php_jview_display_vvvvvyk == 1) { - jQuery('#jform_php_jview').closest('.control-group').show(); + jQuery('#jform_php_jview_display').closest('.control-group').show(); if (jform_vvvvvykvyg_required) { - updateFieldRequired('php_jview',0); - jQuery('#jform_php_jview').prop('required','required'); - jQuery('#jform_php_jview').attr('aria-required',true); - jQuery('#jform_php_jview').addClass('required'); + updateFieldRequired('php_jview_display',0); + jQuery('#jform_php_jview_display').prop('required','required'); + jQuery('#jform_php_jview_display').attr('aria-required',true); + jQuery('#jform_php_jview_display').addClass('required'); jform_vvvvvykvyg_required = false; } } else { - jQuery('#jform_php_jview').closest('.control-group').hide(); + jQuery('#jform_php_jview_display').closest('.control-group').hide(); if (!jform_vvvvvykvyg_required) { - updateFieldRequired('php_jview',1); - jQuery('#jform_php_jview').removeAttr('required'); - jQuery('#jform_php_jview').removeAttr('aria-required'); - jQuery('#jform_php_jview').removeClass('required'); + updateFieldRequired('php_jview_display',1); + jQuery('#jform_php_jview_display').removeAttr('required'); + jQuery('#jform_php_jview_display').removeAttr('aria-required'); + jQuery('#jform_php_jview_display').removeClass('required'); jform_vvvvvykvyg_required = true; } } } // the vvvvvyl function -function vvvvvyl(add_php_document_vvvvvyl) +function vvvvvyl(add_php_jview_vvvvvyl) { // set the function logic - if (add_php_document_vvvvvyl == 1) + if (add_php_jview_vvvvvyl == 1) { - jQuery('#jform_php_document').closest('.control-group').show(); + jQuery('#jform_php_jview').closest('.control-group').show(); if (jform_vvvvvylvyh_required) { - updateFieldRequired('php_document',0); - jQuery('#jform_php_document').prop('required','required'); - jQuery('#jform_php_document').attr('aria-required',true); - jQuery('#jform_php_document').addClass('required'); + updateFieldRequired('php_jview',0); + jQuery('#jform_php_jview').prop('required','required'); + jQuery('#jform_php_jview').attr('aria-required',true); + jQuery('#jform_php_jview').addClass('required'); jform_vvvvvylvyh_required = false; } } else { - jQuery('#jform_php_document').closest('.control-group').hide(); + jQuery('#jform_php_jview').closest('.control-group').hide(); if (!jform_vvvvvylvyh_required) { - updateFieldRequired('php_document',1); - jQuery('#jform_php_document').removeAttr('required'); - jQuery('#jform_php_document').removeAttr('aria-required'); - jQuery('#jform_php_document').removeClass('required'); + updateFieldRequired('php_jview',1); + jQuery('#jform_php_jview').removeAttr('required'); + jQuery('#jform_php_jview').removeAttr('aria-required'); + jQuery('#jform_php_jview').removeClass('required'); jform_vvvvvylvyh_required = true; } } } // the vvvvvym function -function vvvvvym(add_css_document_vvvvvym) +function vvvvvym(add_php_document_vvvvvym) { // set the function logic - if (add_css_document_vvvvvym == 1) + if (add_php_document_vvvvvym == 1) { - jQuery('#jform_css_document').closest('.control-group').show(); + jQuery('#jform_php_document').closest('.control-group').show(); if (jform_vvvvvymvyi_required) { - updateFieldRequired('css_document',0); - jQuery('#jform_css_document').prop('required','required'); - jQuery('#jform_css_document').attr('aria-required',true); - jQuery('#jform_css_document').addClass('required'); + updateFieldRequired('php_document',0); + jQuery('#jform_php_document').prop('required','required'); + jQuery('#jform_php_document').attr('aria-required',true); + jQuery('#jform_php_document').addClass('required'); jform_vvvvvymvyi_required = false; } } else { - jQuery('#jform_css_document').closest('.control-group').hide(); + jQuery('#jform_php_document').closest('.control-group').hide(); if (!jform_vvvvvymvyi_required) { - updateFieldRequired('css_document',1); - jQuery('#jform_css_document').removeAttr('required'); - jQuery('#jform_css_document').removeAttr('aria-required'); - jQuery('#jform_css_document').removeClass('required'); + updateFieldRequired('php_document',1); + jQuery('#jform_php_document').removeAttr('required'); + jQuery('#jform_php_document').removeAttr('aria-required'); + jQuery('#jform_php_document').removeClass('required'); jform_vvvvvymvyi_required = true; } } } // the vvvvvyn function -function vvvvvyn(add_js_document_vvvvvyn) +function vvvvvyn(add_css_document_vvvvvyn) { // set the function logic - if (add_js_document_vvvvvyn == 1) + if (add_css_document_vvvvvyn == 1) { - jQuery('#jform_js_document').closest('.control-group').show(); + jQuery('#jform_css_document').closest('.control-group').show(); if (jform_vvvvvynvyj_required) { - updateFieldRequired('js_document',0); - jQuery('#jform_js_document').prop('required','required'); - jQuery('#jform_js_document').attr('aria-required',true); - jQuery('#jform_js_document').addClass('required'); + updateFieldRequired('css_document',0); + jQuery('#jform_css_document').prop('required','required'); + jQuery('#jform_css_document').attr('aria-required',true); + jQuery('#jform_css_document').addClass('required'); jform_vvvvvynvyj_required = false; } } else { - jQuery('#jform_js_document').closest('.control-group').hide(); + jQuery('#jform_css_document').closest('.control-group').hide(); if (!jform_vvvvvynvyj_required) { - updateFieldRequired('js_document',1); - jQuery('#jform_js_document').removeAttr('required'); - jQuery('#jform_js_document').removeAttr('aria-required'); - jQuery('#jform_js_document').removeClass('required'); + updateFieldRequired('css_document',1); + jQuery('#jform_css_document').removeAttr('required'); + jQuery('#jform_css_document').removeAttr('aria-required'); + jQuery('#jform_css_document').removeClass('required'); jform_vvvvvynvyj_required = true; } } } // the vvvvvyo function -function vvvvvyo(add_css_vvvvvyo) +function vvvvvyo(add_javascript_file_vvvvvyo) { // set the function logic - if (add_css_vvvvvyo == 1) + if (add_javascript_file_vvvvvyo == 1) { - jQuery('#jform_css').closest('.control-group').show(); + jQuery('#jform_javascript_file').closest('.control-group').show(); if (jform_vvvvvyovyk_required) { - updateFieldRequired('css',0); - jQuery('#jform_css').prop('required','required'); - jQuery('#jform_css').attr('aria-required',true); - jQuery('#jform_css').addClass('required'); + updateFieldRequired('javascript_file',0); + jQuery('#jform_javascript_file').prop('required','required'); + jQuery('#jform_javascript_file').attr('aria-required',true); + jQuery('#jform_javascript_file').addClass('required'); jform_vvvvvyovyk_required = false; } } else { - jQuery('#jform_css').closest('.control-group').hide(); + jQuery('#jform_javascript_file').closest('.control-group').hide(); if (!jform_vvvvvyovyk_required) { - updateFieldRequired('css',1); - jQuery('#jform_css').removeAttr('required'); - jQuery('#jform_css').removeAttr('aria-required'); - jQuery('#jform_css').removeClass('required'); + updateFieldRequired('javascript_file',1); + jQuery('#jform_javascript_file').removeAttr('required'); + jQuery('#jform_javascript_file').removeAttr('aria-required'); + jQuery('#jform_javascript_file').removeClass('required'); jform_vvvvvyovyk_required = true; } } } // the vvvvvyp function -function vvvvvyp(add_php_ajax_vvvvvyp) +function vvvvvyp(add_js_document_vvvvvyp) { // set the function logic - if (add_php_ajax_vvvvvyp == 1) + if (add_js_document_vvvvvyp == 1) + { + jQuery('#jform_js_document').closest('.control-group').show(); + if (jform_vvvvvypvyl_required) + { + updateFieldRequired('js_document',0); + jQuery('#jform_js_document').prop('required','required'); + jQuery('#jform_js_document').attr('aria-required',true); + jQuery('#jform_js_document').addClass('required'); + jform_vvvvvypvyl_required = false; + } + + } + else + { + jQuery('#jform_js_document').closest('.control-group').hide(); + if (!jform_vvvvvypvyl_required) + { + updateFieldRequired('js_document',1); + jQuery('#jform_js_document').removeAttr('required'); + jQuery('#jform_js_document').removeAttr('aria-required'); + jQuery('#jform_js_document').removeClass('required'); + jform_vvvvvypvyl_required = true; + } + } +} + +// the vvvvvyq function +function vvvvvyq(add_css_vvvvvyq) +{ + // set the function logic + if (add_css_vvvvvyq == 1) + { + jQuery('#jform_css').closest('.control-group').show(); + if (jform_vvvvvyqvym_required) + { + updateFieldRequired('css',0); + jQuery('#jform_css').prop('required','required'); + jQuery('#jform_css').attr('aria-required',true); + jQuery('#jform_css').addClass('required'); + jform_vvvvvyqvym_required = false; + } + + } + else + { + jQuery('#jform_css').closest('.control-group').hide(); + if (!jform_vvvvvyqvym_required) + { + updateFieldRequired('css',1); + jQuery('#jform_css').removeAttr('required'); + jQuery('#jform_css').removeAttr('aria-required'); + jQuery('#jform_css').removeClass('required'); + jform_vvvvvyqvym_required = true; + } + } +} + +// the vvvvvyr function +function vvvvvyr(add_php_ajax_vvvvvyr) +{ + // set the function logic + if (add_php_ajax_vvvvvyr == 1) { jQuery('#jform_ajax_input-lbl').closest('.control-group').show(); jQuery('#jform_php_ajaxmethod').closest('.control-group').show(); - if (jform_vvvvvypvyl_required) + if (jform_vvvvvyrvyn_required) { updateFieldRequired('php_ajaxmethod',0); jQuery('#jform_php_ajaxmethod').prop('required','required'); jQuery('#jform_php_ajaxmethod').attr('aria-required',true); jQuery('#jform_php_ajaxmethod').addClass('required'); - jform_vvvvvypvyl_required = false; + jform_vvvvvyrvyn_required = false; } } @@ -307,42 +342,42 @@ function vvvvvyp(add_php_ajax_vvvvvyp) { jQuery('#jform_ajax_input-lbl').closest('.control-group').hide(); jQuery('#jform_php_ajaxmethod').closest('.control-group').hide(); - if (!jform_vvvvvypvyl_required) + if (!jform_vvvvvyrvyn_required) { updateFieldRequired('php_ajaxmethod',1); jQuery('#jform_php_ajaxmethod').removeAttr('required'); jQuery('#jform_php_ajaxmethod').removeAttr('aria-required'); jQuery('#jform_php_ajaxmethod').removeClass('required'); - jform_vvvvvypvyl_required = true; + jform_vvvvvyrvyn_required = true; } } } -// the vvvvvyq function -function vvvvvyq(add_custom_button_vvvvvyq) +// the vvvvvys function +function vvvvvys(add_custom_button_vvvvvys) { // set the function logic - if (add_custom_button_vvvvvyq == 1) + if (add_custom_button_vvvvvys == 1) { jQuery('#jform_custom_button-lbl').closest('.control-group').show(); jQuery('#jform_php_controller').closest('.control-group').show(); - if (jform_vvvvvyqvym_required) + if (jform_vvvvvysvyo_required) { updateFieldRequired('php_controller',0); jQuery('#jform_php_controller').prop('required','required'); jQuery('#jform_php_controller').attr('aria-required',true); jQuery('#jform_php_controller').addClass('required'); - jform_vvvvvyqvym_required = false; + jform_vvvvvysvyo_required = false; } jQuery('#jform_php_model').closest('.control-group').show(); - if (jform_vvvvvyqvyn_required) + if (jform_vvvvvysvyp_required) { updateFieldRequired('php_model',0); jQuery('#jform_php_model').prop('required','required'); jQuery('#jform_php_model').attr('aria-required',true); jQuery('#jform_php_model').addClass('required'); - jform_vvvvvyqvyn_required = false; + jform_vvvvvysvyp_required = false; } } @@ -350,40 +385,40 @@ function vvvvvyq(add_custom_button_vvvvvyq) { jQuery('#jform_custom_button-lbl').closest('.control-group').hide(); jQuery('#jform_php_controller').closest('.control-group').hide(); - if (!jform_vvvvvyqvym_required) + if (!jform_vvvvvysvyo_required) { updateFieldRequired('php_controller',1); jQuery('#jform_php_controller').removeAttr('required'); jQuery('#jform_php_controller').removeAttr('aria-required'); jQuery('#jform_php_controller').removeClass('required'); - jform_vvvvvyqvym_required = true; + jform_vvvvvysvyo_required = true; } jQuery('#jform_php_model').closest('.control-group').hide(); - if (!jform_vvvvvyqvyn_required) + if (!jform_vvvvvysvyp_required) { updateFieldRequired('php_model',1); jQuery('#jform_php_model').removeAttr('required'); jQuery('#jform_php_model').removeAttr('aria-required'); jQuery('#jform_php_model').removeClass('required'); - jform_vvvvvyqvyn_required = true; + jform_vvvvvysvyp_required = true; } } } -// the vvvvvyr function -function vvvvvyr(button_position_vvvvvyr) +// the vvvvvyt function +function vvvvvyt(button_position_vvvvvyt) { - if (isSet(button_position_vvvvvyr) && button_position_vvvvvyr.constructor !== Array) + if (isSet(button_position_vvvvvyt) && button_position_vvvvvyt.constructor !== Array) { - var temp_vvvvvyr = button_position_vvvvvyr; - var button_position_vvvvvyr = []; - button_position_vvvvvyr.push(temp_vvvvvyr); + var temp_vvvvvyt = button_position_vvvvvyt; + var button_position_vvvvvyt = []; + button_position_vvvvvyt.push(temp_vvvvvyt); } - else if (!isSet(button_position_vvvvvyr)) + else if (!isSet(button_position_vvvvvyt)) { - var button_position_vvvvvyr = []; + var button_position_vvvvvyt = []; } - var button_position = button_position_vvvvvyr.some(button_position_vvvvvyr_SomeFunc); + var button_position = button_position_vvvvvyt.some(button_position_vvvvvyt_SomeFunc); // set this function logic @@ -397,11 +432,11 @@ function vvvvvyr(button_position_vvvvvyr) } } -// the vvvvvyr Some function -function button_position_vvvvvyr_SomeFunc(button_position_vvvvvyr) +// the vvvvvyt Some function +function button_position_vvvvvyt_SomeFunc(button_position_vvvvvyt) { // set the function logic - if (button_position_vvvvvyr == 5) + if (button_position_vvvvvyt == 5) { return true; } diff --git a/admin/models/forms/site_view.xml b/admin/models/forms/site_view.xml index 5423c5db0..7d3c93fef 100644 --- a/admin/models/forms/site_view.xml +++ b/admin/models/forms/site_view.xml @@ -138,27 +138,6 @@ multiple="false" required="false" button="true" /> - - - - + + + + COM_COMPONENTBUILDER_SITE_VIEW_YES + + - - - - - - + + - - + + - - + + + + + + COM_COMPONENTBUILDER_SITE_VIEW_YES - + - - - + @@ -315,10 +316,10 @@ label="COM_COMPONENTBUILDER_SITE_VIEW_CUSTOM_GET_LABEL" description="COM_COMPONENTBUILDER_SITE_VIEW_CUSTOM_GET_DESCRIPTION" multiple="true" /> - + @@ -334,10 +335,10 @@ multiple="false" required="true" button="true" /> - + @@ -352,10 +353,10 @@ description="COM_COMPONENTBUILDER_SITE_VIEW_DYNAMIC_GET_DESCRIPTION" multiple="false" required="false" /> - + @@ -370,6 +371,28 @@ description="COM_COMPONENTBUILDER_SITE_VIEW_DYNAMIC_VALUES_DESCRIPTION" heading="h4" class="dynamic_values" /> + + + + + + + + + + + + - - - - - - - - COM_COMPONENTBUILDER_SITE_VIEW_BOTTOM_LEFT + + + + - - - - + + + + user = JFactory::getUser(); + // Get the current user for authorisation checks + $this->user = JFactory::getUser(); $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); - $this->groups = $this->user->get('groups'); - $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->levels = $this->user->getAuthorisedViewLevels(); - $this->app = JFactory::getApplication(); + $this->app = JFactory::getApplication(); $this->input = $this->app->input; $this->initSet = true; // Make sure all records load, since no pagination allowed. @@ -102,16 +102,16 @@ class ComponentbuilderModelGet_snippets extends JModelList */ public function getItems() { - $user = JFactory::getUser(); - // check if this user has permission to access items - if (!$user->authorise('get_snippets.access', 'com_componentbuilder')) - { + $user = JFactory::getUser(); + // check if this user has permission to access items + if (!$user->authorise('get_snippets.access', 'com_componentbuilder')) + { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) $app->redirect('index.php?option=com_componentbuilder'); return false; - } + } // load parent items $items = parent::getItems(); diff --git a/admin/models/site_view.php b/admin/models/site_view.php index ab413b249..83de5e135 100644 --- a/admin/models/site_view.php +++ b/admin/models/site_view.php @@ -127,48 +127,48 @@ class ComponentbuilderModelSite_view extends JModelAdmin $item->custom_button = $custom_button->toArray(); } - if (!empty($item->js_document)) - { - // base64 Decode js_document. - $item->js_document = base64_decode($item->js_document); - } - if (!empty($item->css)) { // base64 Decode css. $item->css = base64_decode($item->css); } + if (!empty($item->js_document)) + { + // base64 Decode js_document. + $item->js_document = base64_decode($item->js_document); + } + if (!empty($item->css_document)) { // base64 Decode css_document. $item->css_document = base64_decode($item->css_document); } - if (!empty($item->php_ajaxmethod)) - { - // base64 Decode php_ajaxmethod. - $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); - } - if (!empty($item->default)) { // base64 Decode default. $item->default = base64_decode($item->default); } + if (!empty($item->php_ajaxmethod)) + { + // base64 Decode php_ajaxmethod. + $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); + } + + if (!empty($item->javascript_file)) + { + // base64 Decode javascript_file. + $item->javascript_file = base64_decode($item->javascript_file); + } + if (!empty($item->php_model)) { // base64 Decode php_model. $item->php_model = base64_decode($item->php_model); } - if (!empty($item->php_controller)) - { - // base64 Decode php_controller. - $item->php_controller = base64_decode($item->php_controller); - } - if (!empty($item->php_document)) { // base64 Decode php_document. @@ -187,6 +187,12 @@ class ComponentbuilderModelSite_view extends JModelAdmin $item->php_jview_display = base64_decode($item->php_jview_display); } + if (!empty($item->php_controller)) + { + // base64 Decode php_controller. + $item->php_controller = base64_decode($item->php_controller); + } + if (!empty($item->php_jview)) { // base64 Decode php_jview. @@ -1010,48 +1016,48 @@ class ComponentbuilderModelSite_view extends JModelAdmin $data['custom_button'] = ''; } - // Set the js_document string to base64 string. - if (isset($data['js_document'])) - { - $data['js_document'] = base64_encode($data['js_document']); - } - // Set the css string to base64 string. if (isset($data['css'])) { $data['css'] = base64_encode($data['css']); } + // Set the js_document string to base64 string. + if (isset($data['js_document'])) + { + $data['js_document'] = base64_encode($data['js_document']); + } + // Set the css_document string to base64 string. if (isset($data['css_document'])) { $data['css_document'] = base64_encode($data['css_document']); } - // Set the php_ajaxmethod string to base64 string. - if (isset($data['php_ajaxmethod'])) - { - $data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']); - } - // Set the default string to base64 string. if (isset($data['default'])) { $data['default'] = base64_encode($data['default']); } + // Set the php_ajaxmethod string to base64 string. + if (isset($data['php_ajaxmethod'])) + { + $data['php_ajaxmethod'] = base64_encode($data['php_ajaxmethod']); + } + + // Set the javascript_file string to base64 string. + if (isset($data['javascript_file'])) + { + $data['javascript_file'] = base64_encode($data['javascript_file']); + } + // Set the php_model string to base64 string. if (isset($data['php_model'])) { $data['php_model'] = base64_encode($data['php_model']); } - // Set the php_controller string to base64 string. - if (isset($data['php_controller'])) - { - $data['php_controller'] = base64_encode($data['php_controller']); - } - // Set the php_document string to base64 string. if (isset($data['php_document'])) { @@ -1070,6 +1076,12 @@ class ComponentbuilderModelSite_view extends JModelAdmin $data['php_jview_display'] = base64_encode($data['php_jview_display']); } + // Set the php_controller string to base64 string. + if (isset($data['php_controller'])) + { + $data['php_controller'] = base64_encode($data['php_controller']); + } + // Set the php_jview string to base64 string. if (isset($data['php_jview'])) { diff --git a/admin/models/site_views.php b/admin/models/site_views.php index 06f0e3599..57ea2ec84 100644 --- a/admin/models/site_views.php +++ b/admin/models/site_views.php @@ -266,26 +266,28 @@ class ComponentbuilderModelSite_views extends JModelList continue; } - // decode js_document - $item->js_document = base64_decode($item->js_document); // decode css $item->css = base64_decode($item->css); + // decode js_document + $item->js_document = base64_decode($item->js_document); // decode css_document $item->css_document = base64_decode($item->css_document); - // decode php_ajaxmethod - $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); // decode default $item->default = base64_decode($item->default); + // decode php_ajaxmethod + $item->php_ajaxmethod = base64_decode($item->php_ajaxmethod); + // decode javascript_file + $item->javascript_file = base64_decode($item->javascript_file); // decode php_model $item->php_model = base64_decode($item->php_model); - // decode php_controller - $item->php_controller = base64_decode($item->php_controller); // decode php_document $item->php_document = base64_decode($item->php_document); // decode php_view $item->php_view = base64_decode($item->php_view); // decode php_jview_display $item->php_jview_display = base64_decode($item->php_jview_display); + // decode php_controller + $item->php_controller = base64_decode($item->php_controller); // decode php_jview $item->php_jview = base64_decode($item->php_jview); // unset the values we don't want exported. diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 07e98b49b..bfa95bc99 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -257,6 +257,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_custom_admin_view` ( `add_css` TINYINT(1) NOT NULL DEFAULT 0, `add_css_document` TINYINT(1) NOT NULL DEFAULT 0, `add_custom_button` INT(1) NOT NULL DEFAULT 0, + `add_javascript_file` TINYINT(1) NOT NULL DEFAULT 0, `add_js_document` TINYINT(1) NOT NULL DEFAULT 0, `add_php_document` TINYINT(1) NOT NULL DEFAULT 0, `add_php_jview` TINYINT(1) NOT NULL DEFAULT 0, @@ -271,6 +272,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_custom_admin_view` ( `description` VARCHAR(255) NOT NULL DEFAULT '', `dynamic_get` INT(11) NOT NULL DEFAULT 0, `icon` CHAR(64) NOT NULL DEFAULT '', + `javascript_file` TEXT NOT NULL, `js_document` TEXT NOT NULL, `libraries` TEXT NOT NULL, `main_get` INT(11) NOT NULL DEFAULT 0, @@ -304,13 +306,14 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_custom_admin_view` ( KEY `idx_state` (`published`), KEY `idx_name` (`name`), KEY `idx_codename` (`codename`), - KEY `idx_add_php_jview` (`add_php_jview`), KEY `idx_add_css_document` (`add_css_document`), + KEY `idx_add_js_document` (`add_js_document`), KEY `idx_add_php_document` (`add_php_document`), KEY `idx_add_php_jview_display` (`add_php_jview_display`), - KEY `idx_add_js_document` (`add_js_document`), KEY `idx_add_css` (`add_css`), KEY `idx_add_php_view` (`add_php_view`), + KEY `idx_add_php_jview` (`add_php_jview`), + KEY `idx_add_javascript_file` (`add_javascript_file`), KEY `idx_main_get` (`main_get`), KEY `idx_dynamic_get` (`dynamic_get`), KEY `idx_add_custom_button` (`add_custom_button`) @@ -322,6 +325,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_site_view` ( `add_css` TINYINT(1) NOT NULL DEFAULT 0, `add_css_document` TINYINT(1) NOT NULL DEFAULT 0, `add_custom_button` INT(1) NOT NULL DEFAULT 0, + `add_javascript_file` TINYINT(1) NOT NULL DEFAULT 0, `add_js_document` TINYINT(1) NOT NULL DEFAULT 0, `add_php_ajax` TINYINT(1) NOT NULL DEFAULT 0, `add_php_document` TINYINT(1) NOT NULL DEFAULT 0, @@ -338,6 +342,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_site_view` ( `default` TEXT NOT NULL, `description` VARCHAR(255) NOT NULL DEFAULT '', `dynamic_get` INT(11) NOT NULL DEFAULT 0, + `javascript_file` TEXT NOT NULL, `js_document` TEXT NOT NULL, `libraries` TEXT NOT NULL, `main_get` INT(11) NOT NULL DEFAULT 0, @@ -376,11 +381,12 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_site_view` ( KEY `idx_add_php_jview_display` (`add_php_jview_display`), KEY `idx_add_php_view` (`add_php_view`), KEY `idx_add_php_jview` (`add_php_jview`), + KEY `idx_add_javascript_file` (`add_javascript_file`), KEY `idx_add_js_document` (`add_js_document`), - KEY `idx_add_css_document` (`add_css_document`), KEY `idx_main_get` (`main_get`), - KEY `idx_add_css` (`add_css`), + KEY `idx_add_css_document` (`add_css_document`), KEY `idx_dynamic_get` (`dynamic_get`), + KEY `idx_add_css` (`add_css`), KEY `idx_add_php_ajax` (`add_php_ajax`), KEY `idx_add_custom_button` (`add_custom_button`), KEY `idx_button_position` (`button_position`) diff --git a/admin/sql/updates/mysql/2.6.6.sql b/admin/sql/updates/mysql/2.6.6.sql new file mode 100644 index 000000000..5319f929b --- /dev/null +++ b/admin/sql/updates/mysql/2.6.6.sql @@ -0,0 +1,7 @@ +ALTER TABLE `#__componentbuilder_custom_admin_view` ADD `add_javascript_file` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_custom_button`; + +ALTER TABLE `#__componentbuilder_custom_admin_view` ADD `javascript_file` TEXT NOT NULL AFTER `icon`; + +ALTER TABLE `#__componentbuilder_site_view` ADD `add_javascript_file` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_custom_button`; + +ALTER TABLE `#__componentbuilder_site_view` ADD `javascript_file` TEXT NOT NULL AFTER `dynamic_get`; diff --git a/admin/views/admin_fields/view.html.php b/admin/views/admin_fields/view.html.php index ae727d1e8..e7a4bea6d 100644 --- a/admin/views/admin_fields/view.html.php +++ b/admin/views/admin_fields/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewAdmin_fields extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewAdmin_fields extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewAdmin_fields extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/admin_fields_conditions/view.html.php b/admin/views/admin_fields_conditions/view.html.php index 258023cf4..d0ee015e8 100644 --- a/admin/views/admin_fields_conditions/view.html.php +++ b/admin/views/admin_fields_conditions/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewAdmin_fields_conditions extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewAdmin_fields_conditions extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewAdmin_fields_conditions extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/admin_view/view.html.php b/admin/views/admin_view/view.html.php index 83d6f70c8..9d8dc9499 100644 --- a/admin/views/admin_view/view.html.php +++ b/admin/views/admin_view/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/admin_views/view.html.php b/admin/views/admin_views/view.html.php index faa2387f4..3856c4974 100644 --- a/admin/views/admin_views/view.html.php +++ b/admin/views/admin_views/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_view'); $this->canEdit = $this->canDo->get('admin_view.edit'); $this->canState = $this->canDo->get('admin_view.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,96 +93,96 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMIN_VIEWS'), 'stack'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admin_views'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('admin_view.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('admin_view.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('admin_view.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('admin_views.publish'); - JToolBarHelper::unpublishList('admin_views.unpublish'); - JToolBarHelper::archiveList('admin_views.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('admin_views.publish'); + JToolBarHelper::unpublishList('admin_views.unpublish'); + JToolBarHelper::archiveList('admin_views.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('admin_views.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('admin_views.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'admin_views.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('admin_views.trash'); - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'admin_views.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('admin_views.trash'); + } if ($this->canDo->get('core.export') && $this->canDo->get('admin_view.export')) { JToolBarHelper::custom('admin_views.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } - } + } if ($this->canDo->get('core.import') && $this->canDo->get('admin_view.import')) { JToolBarHelper::custom('admin_views.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('admin_views'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -195,11 +194,11 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -217,7 +216,7 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admin_views.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -228,10 +227,10 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -251,5 +250,5 @@ class ComponentbuilderViewAdmin_views extends JViewLegacy 'a.short_description' => JText::_('COM_COMPONENTBUILDER_ADMIN_VIEW_SHORT_DESCRIPTION_LABEL'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/admins_fields/view.html.php b/admin/views/admins_fields/view.html.php index 859c1b73f..2af5b8da8 100644 --- a/admin/views/admins_fields/view.html.php +++ b/admin/views/admins_fields/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields'); $this->canEdit = $this->canDo->get('admin_fields.edit'); $this->canState = $this->canDo->get('admin_fields.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('admin_fields.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('admin_fields.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('admin_fields.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('admins_fields.publish'); - JToolBarHelper::unpublishList('admins_fields.unpublish'); - JToolBarHelper::archiveList('admins_fields.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('admins_fields.publish'); + JToolBarHelper::unpublishList('admins_fields.unpublish'); + JToolBarHelper::archiveList('admins_fields.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('admins_fields.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('admins_fields.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'admins_fields.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('admins_fields.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'admins_fields.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('admins_fields.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewAdmins_fields extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/admins_fields_conditions/view.html.php b/admin/views/admins_fields_conditions/view.html.php index 3166300ec..f3aea1e2b 100644 --- a/admin/views/admins_fields_conditions/view.html.php +++ b/admin/views/admins_fields_conditions/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); $this->canEdit = $this->canDo->get('admin_fields_conditions.edit'); $this->canState = $this->canDo->get('admin_fields_conditions.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_conditions'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('admin_fields_conditions.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('admin_fields_conditions.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('admin_fields_conditions.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('admins_fields_conditions.publish'); - JToolBarHelper::unpublishList('admins_fields_conditions.unpublish'); - JToolBarHelper::archiveList('admins_fields_conditions.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('admins_fields_conditions.publish'); + JToolBarHelper::unpublishList('admins_fields_conditions.unpublish'); + JToolBarHelper::archiveList('admins_fields_conditions.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('admins_fields_conditions.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('admins_fields_conditions.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'admins_fields_conditions.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('admins_fields_conditions.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'admins_fields_conditions.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('admins_fields_conditions.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_conditions.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewAdmins_fields_conditions extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index f16dd8152..a22c8d5a4 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -37,13 +37,13 @@ class ComponentbuilderViewCompiler extends JViewLegacy // Overwriting JView display method function display($tpl = null) { - // get component params + // get component params $this->params = JComponentHelper::getParams('com_componentbuilder'); // get the application $this->app = JFactory::getApplication(); // get the user object $this->user = JFactory::getUser(); - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('compiler'); // Initialise variables. $this->items = $this->get('Items'); @@ -139,7 +139,7 @@ class ComponentbuilderViewCompiler extends JViewLegacy return false; } - /** + /** * Prepares the document */ protected function setDocument() @@ -198,7 +198,7 @@ class ComponentbuilderViewCompiler extends JViewLegacy } // add marked library $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/custom/marked.js"); - // add the document default css file + // add the document default css file $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_componentbuilder/assets/css/compiler.css'); // Set the Custom CSS script to view $this->document->addStyleDeclaration(" @@ -267,7 +267,7 @@ class ComponentbuilderViewCompiler extends JViewLegacy }); } "); - } + } /** * Setting the toolbar @@ -275,12 +275,12 @@ class ComponentbuilderViewCompiler extends JViewLegacy protected function addToolBar() { // hide the main menu - $this->app->input->set('hidemainmenu', true); + $this->app->input->set('hidemainmenu', true); // add title to the page JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPILER'),'cogs'); - // add the back button - // JToolBarHelper::custom('compiler.back', 'undo-2', '', 'COM_COMPONENTBUILDER_BACK', false); - // add cpanel button + // add the back button + // JToolBarHelper::custom('compiler.back', 'undo-2', '', 'COM_COMPONENTBUILDER_BACK', false); + // add cpanel button JToolBarHelper::custom('compiler.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); if ($this->canDo->get('compiler.clear_tmp')) { @@ -289,20 +289,20 @@ class ComponentbuilderViewCompiler extends JViewLegacy } // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('compiler'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + $help_url = ComponentbuilderHelper::getHelpUrl('compiler'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_componentbuilder'); } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -311,7 +311,7 @@ class ComponentbuilderViewCompiler extends JViewLegacy */ public function escape($var) { - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } } diff --git a/admin/views/component_admin_views/view.html.php b/admin/views/component_admin_views/view.html.php index f45388ca2..df8294237 100644 --- a/admin/views/component_admin_views/view.html.php +++ b/admin/views/component_admin_views/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_admin_views extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_admin_views extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_admin_views extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/component_config/view.html.php b/admin/views/component_config/view.html.php index cda3ec878..fde6282cf 100644 --- a/admin/views/component_config/view.html.php +++ b/admin/views/component_config/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_config extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_config extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_config extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/component_custom_admin_menus/view.html.php b/admin/views/component_custom_admin_menus/view.html.php index 9e482d3f9..696d41677 100644 --- a/admin/views/component_custom_admin_menus/view.html.php +++ b/admin/views/component_custom_admin_menus/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_custom_admin_menus extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_custom_admin_menus extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_custom_admin_menus extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/component_custom_admin_views/view.html.php b/admin/views/component_custom_admin_views/view.html.php index e711fc0c7..57b42086c 100644 --- a/admin/views/component_custom_admin_views/view.html.php +++ b/admin/views/component_custom_admin_views/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_custom_admin_views extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_custom_admin_views extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_custom_admin_views extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/component_dashboard/view.html.php b/admin/views/component_dashboard/view.html.php index a5891d95d..60ade7b2e 100644 --- a/admin/views/component_dashboard/view.html.php +++ b/admin/views/component_dashboard/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_dashboard extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_dashboard extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_dashboard extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/component_files_folders/view.html.php b/admin/views/component_files_folders/view.html.php index c9414e0ec..33faaf38a 100644 --- a/admin/views/component_files_folders/view.html.php +++ b/admin/views/component_files_folders/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_files_folders extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_files_folders extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_files_folders extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/component_mysql_tweaks/view.html.php b/admin/views/component_mysql_tweaks/view.html.php index 62fb13e0b..e30294048 100644 --- a/admin/views/component_mysql_tweaks/view.html.php +++ b/admin/views/component_mysql_tweaks/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_mysql_tweaks extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_mysql_tweaks extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_mysql_tweaks extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/component_site_views/view.html.php b/admin/views/component_site_views/view.html.php index 375038297..05d7e065d 100644 --- a/admin/views/component_site_views/view.html.php +++ b/admin/views/component_site_views/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_site_views extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_site_views extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_site_views extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/component_updates/view.html.php b/admin/views/component_updates/view.html.php index c5ac97f52..07f974670 100644 --- a/admin/views/component_updates/view.html.php +++ b/admin/views/component_updates/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewComponent_updates extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewComponent_updates extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewComponent_updates extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/components_admin_views/view.html.php b/admin/views/components_admin_views/view.html.php index 51bb66131..a154fa83d 100644 --- a/admin/views/components_admin_views/view.html.php +++ b/admin/views/components_admin_views/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_admin_views'); $this->canEdit = $this->canDo->get('component_admin_views.edit'); $this->canState = $this->canDo->get('component_admin_views.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_admin_views'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_admin_views.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_admin_views.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_admin_views.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_admin_views.publish'); - JToolBarHelper::unpublishList('components_admin_views.unpublish'); - JToolBarHelper::archiveList('components_admin_views.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_admin_views.publish'); + JToolBarHelper::unpublishList('components_admin_views.unpublish'); + JToolBarHelper::archiveList('components_admin_views.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_admin_views.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_admin_views.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_admin_views.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_admin_views.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_admin_views.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_admin_views.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_admin_views'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_admin_views.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_admin_views extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/components_config/view.html.php b/admin/views/components_config/view.html.php index 68e6423f2..9fc786771 100644 --- a/admin/views/components_config/view.html.php +++ b/admin/views/components_config/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_config extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_config'); $this->canEdit = $this->canDo->get('component_config.edit'); $this->canState = $this->canDo->get('component_config.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_config extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_config extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CONFIG'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_config'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_config.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_config.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_config.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_config.publish'); - JToolBarHelper::unpublishList('components_config.unpublish'); - JToolBarHelper::archiveList('components_config.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_config.publish'); + JToolBarHelper::unpublishList('components_config.unpublish'); + JToolBarHelper::archiveList('components_config.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_config.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_config.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_config.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_config.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_config.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_config.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_config'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_config'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_config extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_config extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_config.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_config extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_config extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/components_custom_admin_menus/view.html.php b/admin/views/components_custom_admin_menus/view.html.php index aad36661f..0ca3d1784 100644 --- a/admin/views/components_custom_admin_menus/view.html.php +++ b/admin/views/components_custom_admin_menus/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus'); $this->canEdit = $this->canDo->get('component_custom_admin_menus.edit'); $this->canState = $this->canDo->get('component_custom_admin_menus.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_custom_admin_menus'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_custom_admin_menus.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_custom_admin_menus.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_custom_admin_menus.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_custom_admin_menus.publish'); - JToolBarHelper::unpublishList('components_custom_admin_menus.unpublish'); - JToolBarHelper::archiveList('components_custom_admin_menus.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_custom_admin_menus.publish'); + JToolBarHelper::unpublishList('components_custom_admin_menus.unpublish'); + JToolBarHelper::archiveList('components_custom_admin_menus.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_custom_admin_menus.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_custom_admin_menus.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_custom_admin_menus.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_custom_admin_menus.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_custom_admin_menus.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_custom_admin_menus.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_menus'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_menus'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_custom_admin_menus.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/components_custom_admin_views/view.html.php b/admin/views/components_custom_admin_views/view.html.php index 2e1e2f255..aad46a102 100644 --- a/admin/views/components_custom_admin_views/view.html.php +++ b/admin/views/components_custom_admin_views/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views'); $this->canEdit = $this->canDo->get('component_custom_admin_views.edit'); $this->canState = $this->canDo->get('component_custom_admin_views.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_custom_admin_views'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_custom_admin_views.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_custom_admin_views.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_custom_admin_views.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_custom_admin_views.publish'); - JToolBarHelper::unpublishList('components_custom_admin_views.unpublish'); - JToolBarHelper::archiveList('components_custom_admin_views.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_custom_admin_views.publish'); + JToolBarHelper::unpublishList('components_custom_admin_views.unpublish'); + JToolBarHelper::archiveList('components_custom_admin_views.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_custom_admin_views.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_custom_admin_views.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_custom_admin_views.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_custom_admin_views.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_custom_admin_views.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_custom_admin_views.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_views'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_custom_admin_views.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/components_dashboard/view.html.php b/admin/views/components_dashboard/view.html.php index 1037680be..ce333ece9 100644 --- a/admin/views/components_dashboard/view.html.php +++ b/admin/views/components_dashboard/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_dashboard'); $this->canEdit = $this->canDo->get('component_dashboard.edit'); $this->canState = $this->canDo->get('component_dashboard.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_dashboard'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_dashboard.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_dashboard.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_dashboard.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_dashboard.publish'); - JToolBarHelper::unpublishList('components_dashboard.unpublish'); - JToolBarHelper::archiveList('components_dashboard.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_dashboard.publish'); + JToolBarHelper::unpublishList('components_dashboard.unpublish'); + JToolBarHelper::archiveList('components_dashboard.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_dashboard.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_dashboard.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_dashboard.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_dashboard.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_dashboard.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_dashboard.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_dashboard'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_dashboard'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_dashboard.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_dashboard extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/components_files_folders/view.html.php b/admin/views/components_files_folders/view.html.php index eee0cb519..6de7f3014 100644 --- a/admin/views/components_files_folders/view.html.php +++ b/admin/views/components_files_folders/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_files_folders'); $this->canEdit = $this->canDo->get('component_files_folders.edit'); $this->canState = $this->canDo->get('component_files_folders.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_files_folders'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_files_folders.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_files_folders.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_files_folders.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_files_folders.publish'); - JToolBarHelper::unpublishList('components_files_folders.unpublish'); - JToolBarHelper::archiveList('components_files_folders.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_files_folders.publish'); + JToolBarHelper::unpublishList('components_files_folders.unpublish'); + JToolBarHelper::archiveList('components_files_folders.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_files_folders.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_files_folders.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_files_folders.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_files_folders.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_files_folders.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_files_folders.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_files_folders'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_files_folders'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_files_folders.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_files_folders extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/components_mysql_tweaks/view.html.php b/admin/views/components_mysql_tweaks/view.html.php index 2a8497c2d..91e658f9a 100644 --- a/admin/views/components_mysql_tweaks/view.html.php +++ b/admin/views/components_mysql_tweaks/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks'); $this->canEdit = $this->canDo->get('component_mysql_tweaks.edit'); $this->canState = $this->canDo->get('component_mysql_tweaks.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_mysql_tweaks'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_mysql_tweaks.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_mysql_tweaks.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_mysql_tweaks.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_mysql_tweaks.publish'); - JToolBarHelper::unpublishList('components_mysql_tweaks.unpublish'); - JToolBarHelper::archiveList('components_mysql_tweaks.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_mysql_tweaks.publish'); + JToolBarHelper::unpublishList('components_mysql_tweaks.unpublish'); + JToolBarHelper::archiveList('components_mysql_tweaks.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_mysql_tweaks.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_mysql_tweaks.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_mysql_tweaks.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_mysql_tweaks.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_mysql_tweaks.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_mysql_tweaks.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_mysql_tweaks'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_mysql_tweaks'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_mysql_tweaks.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/components_site_views/view.html.php b/admin/views/components_site_views/view.html.php index 6b3fc9ebf..52ca8a78a 100644 --- a/admin/views/components_site_views/view.html.php +++ b/admin/views/components_site_views/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_site_views'); $this->canEdit = $this->canDo->get('component_site_views.edit'); $this->canState = $this->canDo->get('component_site_views.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_site_views'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_site_views.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_site_views.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_site_views.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_site_views.publish'); - JToolBarHelper::unpublishList('components_site_views.unpublish'); - JToolBarHelper::archiveList('components_site_views.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_site_views.publish'); + JToolBarHelper::unpublishList('components_site_views.unpublish'); + JToolBarHelper::archiveList('components_site_views.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_site_views.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_site_views.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_site_views.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_site_views.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_site_views.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_site_views.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_site_views'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_site_views'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_site_views.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_site_views extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/components_updates/view.html.php b/admin/views/components_updates/view.html.php index c7f4a335b..9eb42947b 100644 --- a/admin/views/components_updates/view.html.php +++ b/admin/views/components_updates/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('component_updates'); $this->canEdit = $this->canDo->get('component_updates.edit'); $this->canState = $this->canDo->get('component_updates.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,86 +93,86 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_UPDATES'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_updates'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('component_updates.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('component_updates.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('component_updates.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('components_updates.publish'); - JToolBarHelper::unpublishList('components_updates.unpublish'); - JToolBarHelper::archiveList('components_updates.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('components_updates.publish'); + JToolBarHelper::unpublishList('components_updates.unpublish'); + JToolBarHelper::archiveList('components_updates.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('components_updates.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('components_updates.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'components_updates.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('components_updates.trash'); - } - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'components_updates.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('components_updates.trash'); + } + } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('components_updates'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('components_updates'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -185,11 +184,11 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -207,7 +206,7 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_updates.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -218,10 +217,10 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -237,5 +236,5 @@ class ComponentbuilderViewComponents_updates extends JViewLegacy 'a.published' => JText::_('JSTATUS'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/custom_admin_view/tmpl/edit.php b/admin/views/custom_admin_view/tmpl/edit.php index 3a240c3f1..95826bf5d 100644 --- a/admin/views/custom_admin_view/tmpl/edit.php +++ b/admin/views/custom_admin_view/tmpl/edit.php @@ -93,12 +93,22 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
- +
- + +
+
+ + + +
+
+
+
+
@@ -228,48 +238,63 @@ jQuery('#adminForm').on('change', '#jform_add_css_document',function (e) }); -// #jform_add_js_document listeners for add_js_document_vvvvvyf function +// #jform_add_javascript_file listeners for add_javascript_file_vvvvvyf function +jQuery('#jform_add_javascript_file').on('keyup',function() +{ + var add_javascript_file_vvvvvyf = jQuery("#jform_add_javascript_file input[type='radio']:checked").val(); + vvvvvyf(add_javascript_file_vvvvvyf); + +}); +jQuery('#adminForm').on('change', '#jform_add_javascript_file',function (e) +{ + e.preventDefault(); + var add_javascript_file_vvvvvyf = jQuery("#jform_add_javascript_file input[type='radio']:checked").val(); + vvvvvyf(add_javascript_file_vvvvvyf); + +}); + +// #jform_add_js_document listeners for add_js_document_vvvvvyg function jQuery('#jform_add_js_document').on('keyup',function() { - var add_js_document_vvvvvyf = jQuery("#jform_add_js_document input[type='radio']:checked").val(); - vvvvvyf(add_js_document_vvvvvyf); + var add_js_document_vvvvvyg = jQuery("#jform_add_js_document input[type='radio']:checked").val(); + vvvvvyg(add_js_document_vvvvvyg); }); jQuery('#adminForm').on('change', '#jform_add_js_document',function (e) { e.preventDefault(); - var add_js_document_vvvvvyf = jQuery("#jform_add_js_document input[type='radio']:checked").val(); - vvvvvyf(add_js_document_vvvvvyf); + var add_js_document_vvvvvyg = jQuery("#jform_add_js_document input[type='radio']:checked").val(); + vvvvvyg(add_js_document_vvvvvyg); }); -// #jform_add_custom_button listeners for add_custom_button_vvvvvyg function +// #jform_add_custom_button listeners for add_custom_button_vvvvvyh function jQuery('#jform_add_custom_button').on('keyup',function() { - var add_custom_button_vvvvvyg = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); - vvvvvyg(add_custom_button_vvvvvyg); + var add_custom_button_vvvvvyh = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); + vvvvvyh(add_custom_button_vvvvvyh); }); jQuery('#adminForm').on('change', '#jform_add_custom_button',function (e) { e.preventDefault(); - var add_custom_button_vvvvvyg = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); - vvvvvyg(add_custom_button_vvvvvyg); + var add_custom_button_vvvvvyh = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); + vvvvvyh(add_custom_button_vvvvvyh); }); -// #jform_add_css listeners for add_css_vvvvvyh function +// #jform_add_css listeners for add_css_vvvvvyi function jQuery('#jform_add_css').on('keyup',function() { - var add_css_vvvvvyh = jQuery("#jform_add_css input[type='radio']:checked").val(); - vvvvvyh(add_css_vvvvvyh); + var add_css_vvvvvyi = jQuery("#jform_add_css input[type='radio']:checked").val(); + vvvvvyi(add_css_vvvvvyi); }); jQuery('#adminForm').on('change', '#jform_add_css',function (e) { e.preventDefault(); - var add_css_vvvvvyh = jQuery("#jform_add_css input[type='radio']:checked").val(); - vvvvvyh(add_css_vvvvvyh); + var add_css_vvvvvyi = jQuery("#jform_add_css input[type='radio']:checked").val(); + vvvvvyi(add_css_vvvvvyi); }); diff --git a/admin/views/custom_admin_view/view.html.php b/admin/views/custom_admin_view/view.html.php index a15701e48..33c5430fb 100644 --- a/admin/views/custom_admin_view/view.html.php +++ b/admin/views/custom_admin_view/view.html.php @@ -53,15 +53,15 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy $this->refid = $jinput->get('refid', 0, 'int'); $this->referral = ''; if ($this->refid) - { - // return to the item that refered to this item - $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; - } - elseif($this->ref) - { - // return to the list view that refered to this item - $this->referral = '&ref='.(string)$this->ref; - } + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } // Set the toolbar $this->addToolBar(); @@ -163,7 +163,7 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy } } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -177,7 +177,7 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } diff --git a/admin/views/custom_admin_views/view.html.php b/admin/views/custom_admin_views/view.html.php index 1ba34a80a..dde11f8a1 100644 --- a/admin/views/custom_admin_views/view.html.php +++ b/admin/views/custom_admin_views/view.html.php @@ -53,8 +53,7 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy $this->user = JFactory::getUser(); $this->listOrder = $this->escape($this->state->get('list.ordering')); $this->listDirn = $this->escape($this->state->get('list.direction')); - $this->saveOrder = $this->listOrder == 'ordering'; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('custom_admin_view'); $this->canEdit = $this->canDo->get('core.edit'); $this->canState = $this->canDo->get('core.edit.state'); @@ -67,11 +66,11 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy { $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); - // load the batch html - if ($this->canCreate && $this->canEdit && $this->canState) - { - $this->batchDisplay = JHtmlBatch_::render(); - } + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } } // Check for errors. @@ -94,61 +93,61 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy { JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS'), 'screen'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=custom_admin_views'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) - { + { JToolBarHelper::addNew('custom_admin_view.add'); } - // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) { - if ($this->canEdit) - { - JToolBarHelper::editList('custom_admin_view.edit'); - } + if ($this->canEdit) + { + JToolBarHelper::editList('custom_admin_view.edit'); + } - if ($this->canState) - { - JToolBarHelper::publishList('custom_admin_views.publish'); - JToolBarHelper::unpublishList('custom_admin_views.unpublish'); - JToolBarHelper::archiveList('custom_admin_views.archive'); + if ($this->canState) + { + JToolBarHelper::publishList('custom_admin_views.publish'); + JToolBarHelper::unpublishList('custom_admin_views.unpublish'); + JToolBarHelper::archiveList('custom_admin_views.archive'); - if ($this->canDo->get('core.admin')) - { - JToolBarHelper::checkin('custom_admin_views.checkin'); - } - } + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('custom_admin_views.checkin'); + } + } - // Add a batch button - if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) - { - // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); - // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); - // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); - // add the button to the page - $dhtml = $layout->render(array('title' => $title)); - $bar->appendButton('Custom', $dhtml, 'batch'); - } + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } - if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) - { - JToolbarHelper::deleteList('', 'custom_admin_views.delete', 'JTOOLBAR_EMPTY_TRASH'); - } - elseif ($this->canState && $this->canDelete) - { - JToolbarHelper::trash('custom_admin_views.trash'); - } + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'custom_admin_views.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('custom_admin_views.trash'); + } if ($this->canDo->get('core.export') && $this->canDo->get('custom_admin_view.export')) { JToolBarHelper::custom('custom_admin_views.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } - } + } if ($this->user->authorise('custom_admin_view.get_snippets', 'com_componentbuilder')) { // add Get Snippets button. @@ -160,35 +159,35 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy JToolBarHelper::custom('custom_admin_views.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } - // set help url for this view if found - $help_url = ComponentbuilderHelper::getHelpUrl('custom_admin_views'); - if (ComponentbuilderHelper::checkString($help_url)) - { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); - } + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('custom_admin_views'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } - // add the options comp button - if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) - { - JToolBarHelper::preferences('com_componentbuilder'); - } + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } - if ($this->canState) - { + if ($this->canState) + { JHtmlSidebar::addFilter( JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } } JHtmlSidebar::addFilter( @@ -200,11 +199,11 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') ); - } + } } /** @@ -222,7 +221,7 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/custom_admin_views.css"); } - /** + /** * Escapes a value for output in a view script. * * @param mixed $var The output to escape. @@ -233,10 +232,10 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy { if(strlen($var) > 50) { - // use the helper htmlEscape method instead and shorten the string + // use the helper htmlEscape method instead and shorten the string return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); } - // use the helper htmlEscape method instead. + // use the helper htmlEscape method instead. return ComponentbuilderHelper::htmlEscape($var, $this->_charset); } @@ -256,5 +255,5 @@ class ComponentbuilderViewCustom_admin_views extends JViewLegacy 'a.description' => JText::_('COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DESCRIPTION_LABEL'), 'a.id' => JText::_('JGRID_HEADING_ID') ); - } + } } diff --git a/admin/views/custom_code/tmpl/edit.php b/admin/views/custom_code/tmpl/edit.php index 6932357cb..9abe9177b 100644 --- a/admin/views/custom_code/tmpl/edit.php +++ b/admin/views/custom_code/tmpl/edit.php @@ -127,101 +127,101 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
'; - $head .= PHP_EOL."\t\t\t"; - $head .= PHP_EOL."\t\t'; - $head .= PHP_EOL."\t\t\t"; - $head .= PHP_EOL."\t\t
'; + $head .= PHP_EOL . "\t\t\t"; + $head .= PHP_EOL . "\t\t'; + $head .= PHP_EOL . "\t\t\t"; + $head .= PHP_EOL . "\t\t