Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
26050c771a | |||
e44b6bc272 | |||
8ac350e62b | |||
d3cbea5c82 | |||
c9cad158e6 | |||
8ca7bc67ff | |||
95716e22cf | |||
20f5a083f0 |
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@ -2,14 +2,16 @@ Contributing to the Joomla Component Builder (JCB)
|
|||||||
===============
|
===============
|
||||||
You are welcome to submit a contribution for review and possible inclusion in the Joomla Component Builder but, before it will be accepted, we ask that you follow these simple steps:
|
You are welcome to submit a contribution for review and possible inclusion in the Joomla Component Builder but, before it will be accepted, we ask that you follow these simple steps:
|
||||||
|
|
||||||
1) Open an issue on GitHub. If you can, please provide a fix and create a pull request (PR) instead; this will automatically create an issue for you so you do not have to create an issue if you are creating a pull request.
|
1) Please watch [these tutorials](https://www.youtube.com/watch?v=lLOfx9YA7VQ&list=PLQRGFI8XZ_wsfz3NdKawCiYsALuZ-GhwJ)
|
||||||
|
|
||||||
2) Follow the [Joomla! Coding Standards](https://developer.joomla.org/coding-standards.html).
|
2) Open an issue on GitHub. If you can, please provide a fix and create a pull request (PR) instead; this will automatically create an issue for you so you do not have to create an issue if you are creating a pull request.
|
||||||
|
|
||||||
3) When filing an issue or opening a PR, please include a clear title and description. The title should be a short summary of an issue and, if possible, should include a reference to an open issue. For example, `Invalid Query in com_admin (Ref #1234)` would be sufficient. All issues and PRs should include a description with as much detail as possible.
|
3) Follow the [Joomla! Coding Standards](https://developer.joomla.org/coding-standards.html).
|
||||||
|
|
||||||
|
4) When filing an issue or opening a PR, please include a clear title and description. The title should be a short summary of an issue and, if possible, should include a reference to an open issue. For example, `Invalid Query in com_admin (Ref #1234)` would be sufficient. All issues and PRs should include a description with as much detail as possible.
|
||||||
If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission.
|
If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission.
|
||||||
|
|
||||||
4) Report security issues to the JCB! Core Team using the [Report security issues contact form](https://www.vdm.io/report-security-issues). Please do not use the public forums for security issues.
|
5) Report security issues to the JCB! Core Team using the [Report security issues contact form](https://www.vdm.io/report-security-issues). Please do not use the public forums for security issues.
|
||||||
|
|
||||||
Please be patient as not all items will be tested immediately (remember, all bug testing for the JCB is done by volunteers) and be receptive to feedback about your code.
|
Please be patient as not all items will be tested immediately (remember, all bug testing for the JCB is done by volunteers) and be receptive to feedback about your code.
|
||||||
|
|
||||||
|
6
.github/PULL_REQUEST_TEMPLATE.md
vendored
6
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,20 +1,16 @@
|
|||||||
Pull Request for Issue # .
|
Pull Request for Issue gh- .
|
||||||
|
|
||||||
### Summary of Changes
|
### Summary of Changes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Testing Instructions
|
### Testing Instructions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Expected result
|
### Expected result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Actual result
|
### Actual result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Documentation Changes Required
|
### Documentation Changes Required
|
||||||
|
|
||||||
|
10
README.md
10
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!
|
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)
|
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||||
|
|
||||||
@ -111,12 +111,12 @@ Component Builder is mapped as a component in itself on my local development env
|
|||||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||||
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
|
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
|
||||||
+ *First Build*: 30th April, 2015
|
+ *First Build*: 30th April, 2015
|
||||||
+ *Last Build*: 12th December, 2017
|
+ *Last Build*: 17th December, 2017
|
||||||
+ *Version*: 2.6.6
|
+ *Version*: 2.6.7
|
||||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
+ *Line count*: **177938**
|
+ *Line count*: **178375**
|
||||||
+ *File count*: **1142**
|
+ *File count*: **1145**
|
||||||
+ *Folder count*: **184**
|
+ *Folder count*: **184**
|
||||||
|
|
||||||
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
|
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
|
||||||
|
@ -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!
|
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)
|
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||||
|
|
||||||
@ -111,12 +111,12 @@ Component Builder is mapped as a component in itself on my local development env
|
|||||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||||
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
|
+ *Name*: [Component Builder](http://vdm.bz/component-builder)
|
||||||
+ *First Build*: 30th April, 2015
|
+ *First Build*: 30th April, 2015
|
||||||
+ *Last Build*: 12th December, 2017
|
+ *Last Build*: 17th December, 2017
|
||||||
+ *Version*: 2.6.6
|
+ *Version*: 2.6.7
|
||||||
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
|
||||||
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
+ *Line count*: **177938**
|
+ *Line count*: **178375**
|
||||||
+ *File count*: **1142**
|
+ *File count*: **1145**
|
||||||
+ *Folder count*: **184**
|
+ *Folder count*: **184**
|
||||||
|
|
||||||
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
|
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
|
||||||
|
542
admin/assets/js/get_snippets.js
Normal file
542
admin/assets/js/get_snippets.js
Normal file
@ -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 <http://vdm.bz/component-builder>
|
||||||
|
@github Joomla Component Builder <https://github.com/vdm-io/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('<h1>'+Joomla.JText._('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS')+'</h1>');
|
||||||
|
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('<h1>'+Joomla.JText._('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES')+'</h1>');
|
||||||
|
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 = '<div id="'+keyID+'-panel" class="uk-panel">';
|
||||||
|
html += '<div class="uk-panel uk-panel-box uk-width-1-1">';
|
||||||
|
html += '<h3 class="uk-panel-title">' + name + '</h3>';
|
||||||
|
html += '<hr />';
|
||||||
|
// set the data buttons
|
||||||
|
html += setLibButtons(name);
|
||||||
|
// close the box panel
|
||||||
|
html += '</div>';
|
||||||
|
html += '</div>';
|
||||||
|
// now we have the library
|
||||||
|
jQuery('#libraries-grid').append(html);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setLibButtons(name) {
|
||||||
|
return '<button class="uk-button uk-button-small uk-button-success uk-width-1-1 getreaction" data-name="'+name+'" data-type="getSnippets" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION')+'"><i class="uk-icon-thumb-tack"></i><span class="uk-hidden-small"> '+Joomla.JText._('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS')+'</span></button>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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('<h1>'+Joomla.JText._('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS')+'</h1>');
|
||||||
|
} 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 = '<div id="'+keyID+'-panel" class="uk-panel" data-uk-filter="'+status+'" data-snippet-libraries="'+snippet.library+'" data-snippet-types="'+snippet.type+'" data-snippet-name="'+snippet.name+'">';
|
||||||
|
html += '<div class="uk-panel uk-panel-box uk-width-1-1">';
|
||||||
|
html += '<div class="uk-panel-badge uk-badge" ><a id="'+keyID+'-badge" href="#'+status+'-meaning" data-uk-offcanvas class="uk-text-uppercase uk-text-contrast"><i class="uk-icon-info"></i> '+status+'</a></div><br />';
|
||||||
|
html += '<h3 class="uk-panel-title">' + snippet.library+ ' - (' + snippet.type + ') ' + snippet.name + '</h3>';
|
||||||
|
html += snippet.heading + '<hr />';
|
||||||
|
// 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 += '</div>';
|
||||||
|
html += '</div>';
|
||||||
|
// 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 = '<div class="uk-button-group uk-width-1-1 uk-margin-small-bottom">';
|
||||||
|
html += '<button class="uk-button uk-button-small uk-button-success uk-width-1-3 getreaction" data-status="'+status+'" data-path="'+key+'" data-type="usage" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION')+'"><i class="uk-icon-info"></i><span class="uk-hidden-small"> '+Joomla.JText._('COM_COMPONENTBUILDER_USAGE')+'</span></button>';
|
||||||
|
html += '<button class="uk-button uk-button-small uk-button-success uk-width-1-3 getreaction" data-status="'+status+'" data-path="'+key+'" data-type="description" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION')+'"><i class="uk-icon-sticky-note-o"></i><span class="uk-hidden-small"> '+Joomla.JText._('COM_COMPONENTBUILDER_DESCRIPTION')+'</span></button>';
|
||||||
|
html += '<button class="uk-button uk-button-small uk-button-success uk-width-1-3 getreaction" data-status="'+status+'" data-path="'+key+'" data-type="snippet" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION')+'"><i class="uk-icon-code"></i><span class="uk-hidden-small"> '+Joomla.JText._('COM_COMPONENTBUILDER_SNIPPET')+'</span></button>';
|
||||||
|
html += '</div>';
|
||||||
|
// return data buttons
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setRefButtons(snippet, key, status, keyID) {
|
||||||
|
var html = '<div><a class="uk-button uk-button-mini uk-button-success uk-margin-small-bottom uk-width-1-1" href="'+snippet.url+'" target="_blank" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL')+'"><i class="uk-icon-external-link"></i> ' + snippet.name + '</a></div>';
|
||||||
|
// set the update button
|
||||||
|
html += '<div>';
|
||||||
|
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 += '<button id="'+keyID+'-getbutton" class="uk-button uk-button-small uk-button-primary uk-width-1-1 uk-margin-small-bottom getreaction" data-status="'+status+'" data-path="'+key+'" data-type="get" title="'+tooltip+'"><i class="uk-icon-cloud-download"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_GET_SNIPPET')+'</button>';
|
||||||
|
} else {
|
||||||
|
html += '<button class="uk-button uk-button-small uk-width-1-1 uk-margin-small-bottom" type="button" disabled title="'+Joomla.JText._('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION')+'"><i class="uk-icon-check-square-o"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_LOCAL_SNIPPET')+'</button>';
|
||||||
|
}
|
||||||
|
html += '</div>';
|
||||||
|
// 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 = '<div class="uk-button-group uk-width-1-1">';
|
||||||
|
html += '<button class="uk-button uk-button-primary uk-width-1-10 uk-button-mini getreaction" data-type="contributor" data-path="'+key+'" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS')+'"><i class="uk-icon-user"></i></button>';
|
||||||
|
html += '<a class="uk-button uk-button-primary uk-width-5-10 uk-button-mini" href="'+contributor_url+'" target="_blank" title="'+Joomla.JText._('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR')+'"><i class="uk-icon-external-link"></i> ' + contributor_name + '</a>';
|
||||||
|
html += '<a class="uk-button uk-button-primary uk-width-4-10 uk-button-mini" href="https://github.com/vdm-io/Joomla-Component-Builder-Snippets/blame/master/'+key+'" target="_blank" title="'+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET')+'"><i class="uk-icon-external-link"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_VIEW_BLAME')+'</a>';
|
||||||
|
html += '</div>';
|
||||||
|
// 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('<i class="uk-icon-info"></i> ' +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('<i class="uk-icon-check-square-o"></i> ' + 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 = '<div class="uk-modal-dialog uk-modal-dialog-lightbox">';
|
||||||
|
html += '<a href="" class="uk-modal-close uk-close uk-close-alt"></a>';
|
||||||
|
html += '<h3>' + snippet.library + ' - (' + snippet.type + ') ' + snippet.name + '</h3>';
|
||||||
|
if ('contributor' === type) {
|
||||||
|
html += '<dl class="uk-description-list-line">';
|
||||||
|
html += '<dt><i class="uk-icon-institution"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_COMPANY_NAME')+'</dt>';
|
||||||
|
html += '<dd>'+snippet.contributor_company+'</dd>';
|
||||||
|
html += '<dt><i class="uk-icon-user"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_NAME')+'</dt>';
|
||||||
|
html += '<dd>'+snippet.contributor_name+'</dd>';
|
||||||
|
html += '<dt><i class="uk-icon-envelope-o"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_EMAIL')+'</dt>';
|
||||||
|
html += '<dd>'+snippet.contributor_email+'</dd>';
|
||||||
|
html += '<dt><i class="uk-icon-laptop"></i> '+Joomla.JText._('COM_COMPONENTBUILDER_AUTHOR_WEBSITE')+'</dt>';
|
||||||
|
html += '<dd>'+snippet.contributor_website+'</dd>';
|
||||||
|
html += '</dl>';
|
||||||
|
} else {
|
||||||
|
html += '<br /><textarea class="uk-width-1-1" rows="15" readonly>'+snippet[type]+'</textarea>';
|
||||||
|
}
|
||||||
|
html += '<br /><small>C: ' + snippet.created + ' | M: ' + snippet.modified + '</small>';
|
||||||
|
html += '</div>';
|
||||||
|
// 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;
|
||||||
|
}
|
@ -40,101 +40,101 @@ class ###Component###Model###Component### extends JModelList
|
|||||||
{
|
{
|
||||||
public function getIcons()
|
public function getIcons()
|
||||||
{
|
{
|
||||||
// load user for access menus
|
// load user for access menus
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
// reset icon array
|
// reset icon array
|
||||||
$icons = array();
|
$icons = array();
|
||||||
// view groups array
|
// view groups array
|
||||||
$viewGroups = array(
|
$viewGroups = array(
|
||||||
'main' => array(###DASHBOARDICONS###)
|
'main' => array(###DASHBOARDICONS###)
|
||||||
);###DASHBOARDICONACCESS###
|
);###DASHBOARDICONACCESS###
|
||||||
foreach($viewGroups as $group => $views)
|
foreach($viewGroups as $group => $views)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
if (###Component###Helper::checkArray($views))
|
if (###Component###Helper::checkArray($views))
|
||||||
{
|
{
|
||||||
foreach($views as $view)
|
foreach($views as $view)
|
||||||
{
|
{
|
||||||
$add = false;
|
$add = false;
|
||||||
if (strpos($view,'.') !== false)
|
if (strpos($view,'.') !== false)
|
||||||
{
|
{
|
||||||
$dwd = explode('.', $view);
|
$dwd = explode('.', $view);
|
||||||
if (count($dwd) == 3)
|
if (count($dwd) == 3)
|
||||||
{
|
{
|
||||||
list($type, $name, $action) = $dwd;
|
list($type, $name, $action) = $dwd;
|
||||||
}
|
}
|
||||||
elseif (count($dwd) == 2)
|
elseif (count($dwd) == 2)
|
||||||
{
|
{
|
||||||
list($type, $name) = $dwd;
|
list($type, $name) = $dwd;
|
||||||
$action = false;
|
$action = false;
|
||||||
}
|
}
|
||||||
if ($action)
|
if ($action)
|
||||||
{
|
{
|
||||||
$viewName = $name;
|
$viewName = $name;
|
||||||
switch($action)
|
switch($action)
|
||||||
{
|
{
|
||||||
case 'add':
|
case 'add':
|
||||||
$url ='index.php?option=com_###component###&view='.$name.'&layout=edit';
|
$url ='index.php?option=com_###component###&view='.$name.'&layout=edit';
|
||||||
$image = $name.'_'.$action.'.'.$type;
|
$image = $name.'_'.$action.'.'.$type;
|
||||||
$alt = $name.' '.$action;
|
$alt = $name.' '.$action;
|
||||||
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD';
|
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD';
|
||||||
$add = true;
|
$add = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$url = 'index.php?option=com_categories&view=categories&extension=com_###component###.'.$name;
|
$url = 'index.php?option=com_categories&view=categories&extension=com_###component###.'.$name;
|
||||||
$image = $name.'_'.$action.'.'.$type;
|
$image = $name.'_'.$action.'.'.$type;
|
||||||
$alt = $name.' '.$action;
|
$alt = $name.' '.$action;
|
||||||
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_'.###Component###Helper::safeString($action,'U');
|
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_'.###Component###Helper::safeString($action,'U');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$viewName = $name;
|
$viewName = $name;
|
||||||
$alt = $name;
|
$alt = $name;
|
||||||
$url = 'index.php?option=com_###component###&view='.$name;
|
$url = 'index.php?option=com_###component###&view='.$name;
|
||||||
$image = $name.'.'.$type;
|
$image = $name.'.'.$type;
|
||||||
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U');
|
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U');
|
||||||
$hover = false;
|
$hover = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$viewName = $view;
|
$viewName = $view;
|
||||||
$alt = $view;
|
$alt = $view;
|
||||||
$url = 'index.php?option=com_###component###&view='.$view;
|
$url = 'index.php?option=com_###component###&view='.$view;
|
||||||
$image = $view.'.png';
|
$image = $view.'.png';
|
||||||
$name = ucwords($view).'<br /><br />';
|
$name = ucwords($view).'<br /><br />';
|
||||||
$hover = false;
|
$hover = false;
|
||||||
}
|
}
|
||||||
// first make sure the view access is set
|
// first make sure the view access is set
|
||||||
if (###Component###Helper::checkArray($viewAccess))
|
if (###Component###Helper::checkArray($viewAccess))
|
||||||
{
|
{
|
||||||
// setup some defaults
|
// setup some defaults
|
||||||
$dashboard_add = false;
|
$dashboard_add = false;
|
||||||
$dashboard_list = false;
|
$dashboard_list = false;
|
||||||
$accessTo = '';
|
$accessTo = '';
|
||||||
$accessAdd = '';
|
$accessAdd = '';
|
||||||
// acces checking start
|
// acces checking start
|
||||||
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false;
|
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false;
|
||||||
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false;
|
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false;
|
||||||
// set main controllers
|
// set main controllers
|
||||||
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
|
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
|
||||||
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
|
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
|
||||||
// check for adding access
|
// check for adding access
|
||||||
if ($add && $accessCreate)
|
if ($add && $accessCreate)
|
||||||
{
|
{
|
||||||
$accessAdd = $viewAccess[$viewName.'.create'];
|
$accessAdd = $viewAccess[$viewName.'.create'];
|
||||||
}
|
}
|
||||||
elseif ($add)
|
elseif ($add)
|
||||||
{
|
{
|
||||||
$accessAdd = 'core.create';
|
$accessAdd = 'core.create';
|
||||||
}
|
}
|
||||||
// check if acces to view is set
|
// check if acces to view is set
|
||||||
if ($accessAccess)
|
if ($accessAccess)
|
||||||
{
|
{
|
||||||
$accessTo = $viewAccess[$viewName.'.access'];
|
$accessTo = $viewAccess[$viewName.'.access'];
|
||||||
}
|
}
|
||||||
// set main access controllers
|
// set main access controllers
|
||||||
if ($accessDashboard_add)
|
if ($accessDashboard_add)
|
||||||
{
|
{
|
||||||
@ -144,65 +144,65 @@ class ###Component###Model###Component### extends JModelList
|
|||||||
{
|
{
|
||||||
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###');
|
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###');
|
||||||
}
|
}
|
||||||
if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo))
|
if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add)
|
if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add)
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (###Component###Helper::checkString($accessTo))
|
elseif (###Component###Helper::checkString($accessTo))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessTo, 'com_###component###') && $dashboard_list)
|
if($user->authorise($accessTo, 'com_###component###') && $dashboard_list)
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (###Component###Helper::checkString($accessAdd))
|
elseif (###Component###Helper::checkString($accessAdd))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add)
|
if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add)
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = false;
|
$icons[$group][$i] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $icons;
|
return $icons;
|
||||||
|
@ -74,15 +74,15 @@ class ###Component###View###Component### extends JViewLegacy
|
|||||||
$canDo = ###Component###Helper::getActions('###component###');
|
$canDo = ###Component###Helper::getActions('###component###');
|
||||||
JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2');
|
JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2');
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$help_url = ###Component###Helper::getHelpUrl('###component###');
|
$help_url = ###Component###Helper::getHelpUrl('###component###');
|
||||||
if (###Component###Helper::checkString($help_url))
|
if (###Component###Helper::checkString($help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($canDo->get('core.admin') || $canDo->get('core.options'))
|
if ($canDo->get('core.admin') || $canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
JToolBarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,10 @@ abstract class ###Component###Helper
|
|||||||
/**
|
/**
|
||||||
* Load the Component xml manifest.
|
* Load the Component xml manifest.
|
||||||
**/
|
**/
|
||||||
public static function manifest()
|
public static function manifest()
|
||||||
{
|
{
|
||||||
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
|
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
|
||||||
return simplexml_load_file($manifestUrl);
|
return simplexml_load_file($manifestUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -55,22 +55,22 @@ abstract class ###Component###Helper
|
|||||||
// get all Contributors (max 20)
|
// get all Contributors (max 20)
|
||||||
$searchArray = range('0','20');
|
$searchArray = range('0','20');
|
||||||
foreach($searchArray as $nr)
|
foreach($searchArray as $nr)
|
||||||
{
|
{
|
||||||
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3))
|
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3))
|
||||||
{
|
{
|
||||||
// set link based of selected option
|
// set link based of selected option
|
||||||
if($params->get("useContributor".$nr) == 1)
|
if($params->get("useContributor".$nr) == 1)
|
||||||
{
|
{
|
||||||
$link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">';
|
$link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">';
|
||||||
$link_back = '</a>';
|
$link_back = '</a>';
|
||||||
}
|
}
|
||||||
elseif($params->get("useContributor".$nr) == 2)
|
elseif($params->get("useContributor".$nr) == 2)
|
||||||
{
|
{
|
||||||
$link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">';
|
$link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">';
|
||||||
$link_back = '</a>';
|
$link_back = '</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$link_front = '';
|
$link_front = '';
|
||||||
$link_back = '';
|
$link_back = '';
|
||||||
}
|
}
|
||||||
@ -86,10 +86,10 @@ abstract class ###Component###Helper
|
|||||||
**/
|
**/
|
||||||
public static function addSubmenu($submenu)
|
public static function addSubmenu($submenu)
|
||||||
{
|
{
|
||||||
// load user for access menus
|
// load user for access menus
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
// load the submenus to sidebar
|
// load the submenus to sidebar
|
||||||
###SUBMENU###
|
###SUBMENU###
|
||||||
}###HELPER_CREATEUSER### ###HELPER_UIKIT### ###HELPER_EXEL###
|
}###HELPER_CREATEUSER### ###HELPER_UIKIT### ###HELPER_EXEL###
|
||||||
|
|
||||||
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
|
public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###')
|
||||||
@ -182,9 +182,9 @@ abstract class ###Component###Helper
|
|||||||
|
|
||||||
public static function jsonToString($value, $sperator = ", ", $table = null)
|
public static function jsonToString($value, $sperator = ", ", $table = null)
|
||||||
{
|
{
|
||||||
// check if string is JSON
|
// check if string is JSON
|
||||||
$result = json_decode($value, true);
|
$result = json_decode($value, true);
|
||||||
if (json_last_error() === JSON_ERROR_NONE)
|
if (json_last_error() === JSON_ERROR_NONE)
|
||||||
{
|
{
|
||||||
// is JSON
|
// is JSON
|
||||||
if (self::checkArray($result))
|
if (self::checkArray($result))
|
||||||
@ -206,15 +206,15 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
return (string) implode($sperator,$result);
|
return (string) implode($sperator,$result);
|
||||||
}
|
}
|
||||||
return (string) json_decode($value);
|
return (string) json_decode($value);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isPublished($id,$type)
|
public static function isPublished($id,$type)
|
||||||
{
|
{
|
||||||
if ($type == 'raw')
|
if ($type == 'raw')
|
||||||
{
|
{
|
||||||
$type = 'item';
|
$type = 'item';
|
||||||
}
|
}
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
@ -227,7 +227,7 @@ abstract class ###Component###Helper
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
$found = $db->getNumRows();
|
$found = $db->getNumRows();
|
||||||
if($found)
|
if($found)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -244,33 +244,33 @@ abstract class ###Component###Helper
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
$found = $db->getNumRows();
|
$found = $db->getNumRows();
|
||||||
if($found)
|
if($found)
|
||||||
{
|
{
|
||||||
return $db->loadResult();
|
return $db->loadResult();
|
||||||
}
|
}
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the actions permissions
|
* Get the actions permissions
|
||||||
**/
|
**/
|
||||||
public static function getActions($view,&$record = null,$views = null)
|
public static function getActions($view,&$record = null,$views = null)
|
||||||
{
|
{
|
||||||
jimport('joomla.access.access');
|
jimport('joomla.access.access');
|
||||||
|
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$result = new JObject;
|
$result = new JObject;
|
||||||
$view = self::safeString($view);
|
$view = self::safeString($view);
|
||||||
if (self::checkString($views))
|
if (self::checkString($views))
|
||||||
{
|
{
|
||||||
$views = self::safeString($views);
|
$views = self::safeString($views);
|
||||||
}
|
}
|
||||||
// get all actions from component
|
// get all actions from component
|
||||||
$actions = JAccess::getActions('com_###component###', 'component');
|
$actions = JAccess::getActions('com_###component###', 'component');
|
||||||
// set acctions only set in component settiongs
|
// set acctions only set in component settiongs
|
||||||
$componentActions = array('core.admin','core.manage','core.options','core.export');
|
$componentActions = array('core.admin','core.manage','core.options','core.export');
|
||||||
// loop the actions and set the permissions
|
// loop the actions and set the permissions
|
||||||
foreach ($actions as $action)
|
foreach ($actions as $action)
|
||||||
{
|
{
|
||||||
// set to use component default
|
// set to use component default
|
||||||
$fallback= true;
|
$fallback= true;
|
||||||
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
|
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
|
||||||
@ -349,17 +349,17 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
|
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
|
||||||
{
|
{
|
||||||
// make sure we use the core. action check for the categories
|
// make sure we use the core. action check for the categories
|
||||||
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
|
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
|
||||||
$coreCheck = explode('.',$action->name);
|
$coreCheck = explode('.',$action->name);
|
||||||
$coreCheck[0] = 'core';
|
$coreCheck[0] = 'core';
|
||||||
$categoryCheck = implode('.',$coreCheck);
|
$categoryCheck = implode('.',$coreCheck);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$categoryCheck = $action->name;
|
$categoryCheck = $action->name;
|
||||||
}
|
}
|
||||||
// The record has a category. Check the category permissions.
|
// The record has a category. Check the category permissions.
|
||||||
$catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid);
|
$catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid);
|
||||||
if (!$catpermission && !is_null($catpermission))
|
if (!$catpermission && !is_null($catpermission))
|
||||||
{
|
{
|
||||||
@ -740,8 +740,8 @@ abstract class ###Component###Helper
|
|||||||
$string = self::replaceNumbers($string);
|
$string = self::replaceNumbers($string);
|
||||||
}
|
}
|
||||||
// 0nly continue if we have a string
|
// 0nly continue if we have a string
|
||||||
if (self::checkString($string))
|
if (self::checkString($string))
|
||||||
{
|
{
|
||||||
// create file name without the extention that is safe
|
// create file name without the extention that is safe
|
||||||
if ($type === 'filename')
|
if ($type === 'filename')
|
||||||
{
|
{
|
||||||
@ -764,12 +764,12 @@ abstract class ###Component###Helper
|
|||||||
$string = preg_replace("/[^A-Za-z ]/", '', $string);
|
$string = preg_replace("/[^A-Za-z ]/", '', $string);
|
||||||
// select final adaptations
|
// select final adaptations
|
||||||
if ($type === 'L' || $type === 'strtolower')
|
if ($type === 'L' || $type === 'strtolower')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// default is to return lower
|
// default is to return lower
|
||||||
return strtolower($string);
|
return strtolower($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'W')
|
elseif ($type === 'W')
|
||||||
{
|
{
|
||||||
// return a string with all first letter of each word uppercase(no undersocre)
|
// return a string with all first letter of each word uppercase(no undersocre)
|
||||||
@ -790,21 +790,21 @@ abstract class ###Component###Helper
|
|||||||
// return a string with all the uppercase(no undersocre)
|
// return a string with all the uppercase(no undersocre)
|
||||||
return strtoupper($string);
|
return strtoupper($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'U' || $type === 'strtoupper')
|
elseif ($type === 'U' || $type === 'strtoupper')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// return all upper
|
// return all upper
|
||||||
return strtoupper($string);
|
return strtoupper($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'F' || $type === 'ucfirst')
|
elseif ($type === 'F' || $type === 'ucfirst')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// return with first caracter to upper
|
// return with first caracter to upper
|
||||||
return ucfirst(strtolower($string));
|
return ucfirst(strtolower($string));
|
||||||
}
|
}
|
||||||
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
|
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
|
||||||
{
|
{
|
||||||
// convert all words to first letter uppercase
|
// convert all words to first letter uppercase
|
||||||
$string = ucwords(strtolower($string));
|
$string = ucwords(strtolower($string));
|
||||||
@ -813,14 +813,14 @@ abstract class ###Component###Helper
|
|||||||
// now return first letter lowercase
|
// now return first letter lowercase
|
||||||
return lcfirst($string);
|
return lcfirst($string);
|
||||||
}
|
}
|
||||||
// return string
|
// return string
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
// not a string
|
// not a string
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
||||||
{
|
{
|
||||||
if (self::checkString($var))
|
if (self::checkString($var))
|
||||||
{
|
{
|
||||||
@ -831,11 +831,11 @@ abstract class ###Component###Helper
|
|||||||
return self::shorten($string,$length);
|
return self::shorten($string,$length);
|
||||||
}
|
}
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}###HELPER_LICENSE_LOCK###
|
}###HELPER_LICENSE_LOCK###
|
||||||
|
|
||||||
public static function replaceNumbers($string)
|
public static function replaceNumbers($string)
|
||||||
|
@ -191,7 +191,6 @@ abstract class ###Component###Email
|
|||||||
// load the bounce email as sender if set
|
// load the bounce email as sender if set
|
||||||
if (!is_null($bounce_email))
|
if (!is_null($bounce_email))
|
||||||
{
|
{
|
||||||
|
|
||||||
$mail->Sender = $bounce_email;
|
$mail->Sender = $bounce_email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ abstract class ###Component###Helper
|
|||||||
|
|
||||||
public static function jsonToString($value, $sperator = ", ", $table = null)
|
public static function jsonToString($value, $sperator = ", ", $table = null)
|
||||||
{
|
{
|
||||||
// check if string is JSON
|
// check if string is JSON
|
||||||
$result = json_decode($value, true);
|
$result = json_decode($value, true);
|
||||||
if (json_last_error() === JSON_ERROR_NONE)
|
if (json_last_error() === JSON_ERROR_NONE)
|
||||||
{
|
{
|
||||||
// is JSON
|
// is JSON
|
||||||
if (self::checkArray($result))
|
if (self::checkArray($result))
|
||||||
@ -69,10 +69,10 @@ abstract class ###Component###Helper
|
|||||||
/**
|
/**
|
||||||
* Load the Component xml manifest.
|
* Load the Component xml manifest.
|
||||||
**/
|
**/
|
||||||
public static function manifest()
|
public static function manifest()
|
||||||
{
|
{
|
||||||
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
|
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_###component###/###component###.xml";
|
||||||
return simplexml_load_file($manifestUrl);
|
return simplexml_load_file($manifestUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,9 +87,9 @@ abstract class ###Component###Helper
|
|||||||
// get all Contributors (max 20)
|
// get all Contributors (max 20)
|
||||||
$searchArray = range('0','20');
|
$searchArray = range('0','20');
|
||||||
foreach($searchArray as $nr)
|
foreach($searchArray as $nr)
|
||||||
{
|
{
|
||||||
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3))
|
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 2 || $params->get("showContributor".$nr) == 3))
|
||||||
{
|
{
|
||||||
// set link based of selected option
|
// set link based of selected option
|
||||||
if($params->get("useContributor".$nr) == 1)
|
if($params->get("useContributor".$nr) == 1)
|
||||||
{
|
{
|
||||||
@ -368,7 +368,7 @@ abstract class ###Component###Helper
|
|||||||
public static function isPublished($id,$type)
|
public static function isPublished($id,$type)
|
||||||
{
|
{
|
||||||
if ($type == 'raw')
|
if ($type == 'raw')
|
||||||
{
|
{
|
||||||
$type = 'item';
|
$type = 'item';
|
||||||
}
|
}
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
@ -381,7 +381,7 @@ abstract class ###Component###Helper
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
$found = $db->getNumRows();
|
$found = $db->getNumRows();
|
||||||
if($found)
|
if($found)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -398,7 +398,7 @@ abstract class ###Component###Helper
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
$found = $db->getNumRows();
|
$found = $db->getNumRows();
|
||||||
if($found)
|
if($found)
|
||||||
{
|
{
|
||||||
return $db->loadResult();
|
return $db->loadResult();
|
||||||
}
|
}
|
||||||
return $id;
|
return $id;
|
||||||
@ -407,24 +407,24 @@ abstract class ###Component###Helper
|
|||||||
/**
|
/**
|
||||||
* Get the actions permissions
|
* Get the actions permissions
|
||||||
**/
|
**/
|
||||||
public static function getActions($view,&$record = null,$views = null)
|
public static function getActions($view,&$record = null,$views = null)
|
||||||
{
|
{
|
||||||
jimport('joomla.access.access');
|
jimport('joomla.access.access');
|
||||||
|
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$result = new JObject;
|
$result = new JObject;
|
||||||
$view = self::safeString($view);
|
$view = self::safeString($view);
|
||||||
if (self::checkString($views))
|
if (self::checkString($views))
|
||||||
{
|
{
|
||||||
$views = self::safeString($views);
|
$views = self::safeString($views);
|
||||||
}
|
}
|
||||||
// get all actions from component
|
// get all actions from component
|
||||||
$actions = JAccess::getActions('com_###component###', 'component');
|
$actions = JAccess::getActions('com_###component###', 'component');
|
||||||
// set acctions only set in component settiongs
|
// set acctions only set in component settiongs
|
||||||
$componentActions = array('core.admin','core.manage','core.options','core.export');
|
$componentActions = array('core.admin','core.manage','core.options','core.export');
|
||||||
// loop the actions and set the permissions
|
// loop the actions and set the permissions
|
||||||
foreach ($actions as $action)
|
foreach ($actions as $action)
|
||||||
{
|
{
|
||||||
// set to use component default
|
// set to use component default
|
||||||
$fallback = true;
|
$fallback = true;
|
||||||
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
|
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
|
||||||
@ -503,17 +503,17 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
|
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
|
||||||
{
|
{
|
||||||
// make sure we use the core. action check for the categories
|
// make sure we use the core. action check for the categories
|
||||||
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
|
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
|
||||||
$coreCheck = explode('.',$action->name);
|
$coreCheck = explode('.',$action->name);
|
||||||
$coreCheck[0] = 'core';
|
$coreCheck[0] = 'core';
|
||||||
$categoryCheck = implode('.',$coreCheck);
|
$categoryCheck = implode('.',$coreCheck);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$categoryCheck = $action->name;
|
$categoryCheck = $action->name;
|
||||||
}
|
}
|
||||||
// The record has a category. Check the category permissions.
|
// The record has a category. Check the category permissions.
|
||||||
$catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid);
|
$catpermission = $user->authorise($categoryCheck, 'com_###component###.'.$views.'.category.' . (int) $record->catid);
|
||||||
if (!$catpermission && !is_null($catpermission))
|
if (!$catpermission && !is_null($catpermission))
|
||||||
{
|
{
|
||||||
@ -655,7 +655,7 @@ abstract class ###Component###Helper
|
|||||||
{
|
{
|
||||||
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
|
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
|
||||||
$connected = @fsockopen("www.example.com", 80);
|
$connected = @fsockopen("www.example.com", 80);
|
||||||
// website, port (try 80 or 443)
|
// website, port (try 80 or 443)
|
||||||
if ($connected)
|
if ($connected)
|
||||||
{
|
{
|
||||||
//action when connected
|
//action when connected
|
||||||
@ -735,8 +735,8 @@ abstract class ###Component###Helper
|
|||||||
$string = self::replaceNumbers($string);
|
$string = self::replaceNumbers($string);
|
||||||
}
|
}
|
||||||
// 0nly continue if we have a string
|
// 0nly continue if we have a string
|
||||||
if (self::checkString($string))
|
if (self::checkString($string))
|
||||||
{
|
{
|
||||||
// create file name without the extention that is safe
|
// create file name without the extention that is safe
|
||||||
if ($type === 'filename')
|
if ($type === 'filename')
|
||||||
{
|
{
|
||||||
@ -759,12 +759,12 @@ abstract class ###Component###Helper
|
|||||||
$string = preg_replace("/[^A-Za-z ]/", '', $string);
|
$string = preg_replace("/[^A-Za-z ]/", '', $string);
|
||||||
// select final adaptations
|
// select final adaptations
|
||||||
if ($type === 'L' || $type === 'strtolower')
|
if ($type === 'L' || $type === 'strtolower')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// default is to return lower
|
// default is to return lower
|
||||||
return strtolower($string);
|
return strtolower($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'W')
|
elseif ($type === 'W')
|
||||||
{
|
{
|
||||||
// return a string with all first letter of each word uppercase(no undersocre)
|
// return a string with all first letter of each word uppercase(no undersocre)
|
||||||
@ -785,21 +785,21 @@ abstract class ###Component###Helper
|
|||||||
// return a string with all the uppercase(no undersocre)
|
// return a string with all the uppercase(no undersocre)
|
||||||
return strtoupper($string);
|
return strtoupper($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'U' || $type === 'strtoupper')
|
elseif ($type === 'U' || $type === 'strtoupper')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// return all upper
|
// return all upper
|
||||||
return strtoupper($string);
|
return strtoupper($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'F' || $type === 'ucfirst')
|
elseif ($type === 'F' || $type === 'ucfirst')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// return with first caracter to upper
|
// return with first caracter to upper
|
||||||
return ucfirst(strtolower($string));
|
return ucfirst(strtolower($string));
|
||||||
}
|
}
|
||||||
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
|
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
|
||||||
{
|
{
|
||||||
// convert all words to first letter uppercase
|
// convert all words to first letter uppercase
|
||||||
$string = ucwords(strtolower($string));
|
$string = ucwords(strtolower($string));
|
||||||
@ -808,11 +808,11 @@ abstract class ###Component###Helper
|
|||||||
// now return first letter lowercase
|
// now return first letter lowercase
|
||||||
return lcfirst($string);
|
return lcfirst($string);
|
||||||
}
|
}
|
||||||
// return string
|
// return string
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
// not a string
|
// not a string
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
||||||
|
@ -105,10 +105,10 @@ class ###Component###Controller###View### extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -220,11 +220,11 @@ class ###Component###Controller###View### extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -102,13 +102,13 @@ class ###Component###Controller###View### extends JControllerForm
|
|||||||
$append = '';
|
$append = '';
|
||||||
|
|
||||||
if ($refid)
|
if ($refid)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -220,11 +220,11 @@ class ###Component###Controller###View### extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class ###Component###Controller extends JControllerLegacy
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function display($cachable = false, $urlparams = false)
|
function display($cachable = false, $urlparams = false)
|
||||||
{
|
{
|
||||||
// set default view if not set
|
// set default view if not set
|
||||||
$view = $this->input->getCmd('view', '###Component###');
|
$view = $this->input->getCmd('view', '###Component###');
|
||||||
@ -51,58 +51,58 @@ class ###Component###Controller extends JControllerLegacy
|
|||||||
$id = $this->input->getInt('id');
|
$id = $this->input->getInt('id');
|
||||||
|
|
||||||
// Check for edit form.
|
// Check for edit form.
|
||||||
if(###Component###Helper::checkArray($data))
|
if(###Component###Helper::checkArray($data))
|
||||||
{
|
{
|
||||||
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id))
|
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.
|
// Somehow the person just went to the form - we don't allow that.
|
||||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
||||||
$this->setMessage($this->getError(), 'error');
|
$this->setMessage($this->getError(), 'error');
|
||||||
// check if item was opend from other then its own list view
|
// check if item was opend from other then its own list view
|
||||||
$ref = $this->input->getCmd('ref', 0);
|
$ref = $this->input->getCmd('ref', 0);
|
||||||
$refid = $this->input->getInt('refid', 0);
|
$refid = $this->input->getInt('refid', 0);
|
||||||
// set redirect
|
// set redirect
|
||||||
if ($refid > 0 && ###Component###Helper::checkString($ref))
|
if ($refid > 0 && ###Component###Helper::checkString($ref))
|
||||||
{
|
{
|
||||||
// redirect to item of ref
|
// redirect to item of ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
||||||
}
|
}
|
||||||
elseif (###Component###Helper::checkString($ref))
|
elseif (###Component###Helper::checkString($ref))
|
||||||
{
|
{
|
||||||
|
|
||||||
// redirect to ref
|
// redirect to ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
|
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// normal redirect back to the list view
|
// normal redirect back to the list view
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false));
|
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false));
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::display($cachable, $urlparams);
|
return parent::display($cachable, $urlparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getViewRelation($view)
|
protected function getViewRelation($view)
|
||||||
{
|
{
|
||||||
if (###Component###Helper::checkString($view))
|
if (###Component###Helper::checkString($view))
|
||||||
{
|
{
|
||||||
$views = array(###VIEWARRAY###
|
$views = array(###VIEWARRAY###
|
||||||
);
|
);
|
||||||
// check if this is a list view
|
// check if this is a list view
|
||||||
if (in_array($view,$views))
|
if (in_array($view,$views))
|
||||||
{
|
{
|
||||||
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
|
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
|
||||||
}
|
}
|
||||||
// check if it is an edit view
|
// check if it is an edit view
|
||||||
elseif (array_key_exists($view,$views))
|
elseif (array_key_exists($view,$views))
|
||||||
{
|
{
|
||||||
return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
|
return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,20 +55,20 @@ class ###Component###ControllerAjax extends JControllerLegacy
|
|||||||
$token = JSession::getFormToken();
|
$token = JSession::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($token == $call_token)
|
if($token == $call_token)
|
||||||
{
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
switch($task)
|
switch($task)
|
||||||
{###AJAX_INPUT_RETURN###
|
{###AJAX_INPUT_RETURN###
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||||
{
|
{
|
||||||
echo $callback."(".json_encode(false).");";
|
echo $callback."(".json_encode(false).");";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "(".json_encode(false).");";
|
echo "(".json_encode(false).");";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,20 +55,20 @@ class ###Component###ControllerAjax extends JControllerLegacy
|
|||||||
$token = JSession::getFormToken();
|
$token = JSession::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($token == $call_token)
|
if($token == $call_token)
|
||||||
{
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
switch($task)
|
switch($task)
|
||||||
{###AJAX_SITE_INPUT_RETURN###
|
{###AJAX_SITE_INPUT_RETURN###
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||||
{
|
{
|
||||||
echo $callback."(".json_encode(false).");";
|
echo $callback."(".json_encode(false).");";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "(".json_encode(false).");";
|
echo "(".json_encode(false).");";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,8 @@ class ###Component###ControllerHelp extends JControllerLegacy
|
|||||||
// Check Token!
|
// Check Token!
|
||||||
$token = JSession::getFormToken();
|
$token = JSession::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($user->id != 0 && $token == $call_token){
|
if($user->id != 0 && $token == $call_token)
|
||||||
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
switch($task){
|
switch($task){
|
||||||
case 'getText':
|
case 'getText':
|
||||||
@ -67,25 +68,25 @@ class ###Component###ControllerHelp extends JControllerLegacy
|
|||||||
$result = '';
|
$result = '';
|
||||||
}
|
}
|
||||||
echo $result;
|
echo $result;
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getHelpDocumentText($id)
|
protected function getHelpDocumentText($id)
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
|
@ -51,7 +51,8 @@ class ###Component###ControllerHelp extends JControllerLegacy
|
|||||||
// Check Token!
|
// Check Token!
|
||||||
$token = JSession::getFormToken();
|
$token = JSession::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($token == $call_token){
|
if($token == $call_token)
|
||||||
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
switch($task){
|
switch($task){
|
||||||
case 'getText':
|
case 'getText':
|
||||||
@ -67,25 +68,25 @@ class ###Component###ControllerHelp extends JControllerLegacy
|
|||||||
$result = '';
|
$result = '';
|
||||||
}
|
}
|
||||||
echo $result;
|
echo $result;
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getHelpDocumentText($id)
|
protected function getHelpDocumentText($id)
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
|
@ -42,18 +42,18 @@ class ###Component###Controller extends JControllerLegacy
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function display($cachable = false, $urlparams = false)
|
function display($cachable = false, $urlparams = false)
|
||||||
{
|
{
|
||||||
// set default view if not set
|
// set default view if not set
|
||||||
$view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###');
|
$view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###');
|
||||||
$isEdit = $this->checkEditView($view);
|
$isEdit = $this->checkEditView($view);
|
||||||
$layout = $this->input->get('layout', null, 'WORD');
|
$layout = $this->input->get('layout', null, 'WORD');
|
||||||
$id = $this->input->getInt('id');
|
$id = $this->input->getInt('id');
|
||||||
$cachable = true;
|
$cachable = true;
|
||||||
|
|
||||||
// Check for edit form.
|
// Check for edit form.
|
||||||
if($isEdit)
|
if($isEdit)
|
||||||
{
|
{
|
||||||
if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id))
|
if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id))
|
||||||
{
|
{
|
||||||
// Somehow the person just went to the form - we don't allow that.
|
// 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))
|
elseif (###Component###Helper::checkString($ref))
|
||||||
{
|
{
|
||||||
|
|
||||||
// redirect to ref
|
// redirect to ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
|
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
|
||||||
}
|
}
|
||||||
@ -81,23 +80,23 @@ class ###Component###Controller extends JControllerLegacy
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::display($cachable, $urlparams);
|
return parent::display($cachable, $urlparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function checkEditView($view)
|
protected function checkEditView($view)
|
||||||
{
|
{
|
||||||
if (###Component###Helper::checkString($view))
|
if (###Component###Helper::checkString($view))
|
||||||
{
|
{
|
||||||
$views = array(###SITE_EDIT_VIEW_ARRAY###
|
$views = array(###SITE_EDIT_VIEW_ARRAY###
|
||||||
);
|
);
|
||||||
// check if this is a edit view
|
// check if this is a edit view
|
||||||
if (in_array($view,$views))
|
if (in_array($view,$views))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class ###Component###Controller###SView### extends JControllerLegacy
|
|||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dashboard()
|
public function dashboard()
|
||||||
{
|
{
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###', false));
|
$this->setRedirect(JRoute::_('index.php?option=com_###component###', false));
|
||||||
return;
|
return;
|
||||||
|
@ -49,11 +49,11 @@ class ###Component###Model###SView### extends JModelItem
|
|||||||
*
|
*
|
||||||
* @var strings
|
* @var strings
|
||||||
*/
|
*/
|
||||||
protected $user;
|
protected $user;
|
||||||
protected $userId;
|
protected $userId;
|
||||||
protected $guest;
|
protected $guest;
|
||||||
protected $groups;
|
protected $groups;
|
||||||
protected $levels;
|
protected $levels;
|
||||||
protected $app;
|
protected $app;
|
||||||
protected $input;
|
protected $input;
|
||||||
protected $uikitComp;
|
protected $uikitComp;
|
||||||
@ -74,10 +74,10 @@ class ###Component###Model###SView### extends JModelItem
|
|||||||
*/
|
*/
|
||||||
protected function populateState()
|
protected function populateState()
|
||||||
{
|
{
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = JFactory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
// Get the item main id
|
// Get the item main id
|
||||||
$id = $this->input->getInt('id', null);
|
$id = $this->input->getInt('id', null);
|
||||||
$this->setState('###sview###.id', $id);
|
$this->setState('###sview###.id', $id);
|
||||||
|
|
||||||
// Load the parameters.
|
// Load the parameters.
|
||||||
@ -94,21 +94,21 @@ class ###Component###Model###SView### extends JModelItem
|
|||||||
public function getItem($pk = null)
|
public function getItem($pk = null)
|
||||||
{
|
{
|
||||||
$this->user = JFactory::getUser();
|
$this->user = JFactory::getUser();
|
||||||
// check if this user has permission to access item
|
// check if this user has permission to access item
|
||||||
if (!$this->user->authorise('###sview###.access', 'com_###component###'))
|
if (!$this->user->authorise('###sview###.access', 'com_###component###'))
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
||||||
// redirect away if not a correct to cPanel/default view
|
// redirect away if not a correct to cPanel/default view
|
||||||
$app->redirect('index.php?option=com_###component###');
|
$app->redirect('index.php?option=com_###component###');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->userId = $this->user->get('id');
|
$this->userId = $this->user->get('id');
|
||||||
$this->guest = $this->user->get('guest');
|
$this->guest = $this->user->get('guest');
|
||||||
$this->groups = $this->user->get('groups');
|
$this->groups = $this->user->get('groups');
|
||||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||||
$this->initSet = true;
|
$this->initSet = true;
|
||||||
|
|
||||||
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM###
|
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM###
|
||||||
|
|
||||||
|
@ -74,10 +74,10 @@ class ###Component###Model###SView### extends JModelItem
|
|||||||
*/
|
*/
|
||||||
protected function populateState()
|
protected function populateState()
|
||||||
{
|
{
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = JFactory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
// Get the itme main id
|
// Get the itme main id
|
||||||
$id = $this->input->getInt('id', null);
|
$id = $this->input->getInt('id', null);
|
||||||
$this->setState('###sview###.id', $id);
|
$this->setState('###sview###.id', $id);
|
||||||
|
|
||||||
// Load the parameters.
|
// Load the parameters.
|
||||||
@ -95,13 +95,13 @@ class ###Component###Model###SView### extends JModelItem
|
|||||||
*/
|
*/
|
||||||
public function getItem($pk = null)
|
public function getItem($pk = null)
|
||||||
{
|
{
|
||||||
$this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS###
|
$this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS###
|
||||||
$this->userId = $this->user->get('id');
|
$this->userId = $this->user->get('id');
|
||||||
$this->guest = $this->user->get('guest');
|
$this->guest = $this->user->get('guest');
|
||||||
$this->groups = $this->user->get('groups');
|
$this->groups = $this->user->get('groups');
|
||||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||||
$this->initSet = true;
|
$this->initSet = true;
|
||||||
|
|
||||||
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM###
|
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM###
|
||||||
|
|
||||||
|
@ -92,10 +92,10 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
public function import()
|
public function import()
|
||||||
{
|
{
|
||||||
$this->setState('action', 'import');
|
$this->setState('action', 'import');
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$session = JFactory::getSession();
|
$session = JFactory::getSession();
|
||||||
$package = null;
|
$package = null;
|
||||||
$continue = false;
|
$continue = false;
|
||||||
// get import type
|
// get import type
|
||||||
$this->getType = $app->input->getString('gettype', NULL);
|
$this->getType = $app->input->getString('gettype', NULL);
|
||||||
// get import type
|
// get import type
|
||||||
@ -150,7 +150,7 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
|
|
||||||
// first link data to table headers
|
// first link data to table headers
|
||||||
if(!$continue){
|
if(!$continue){
|
||||||
$package = json_encode($package);
|
$package = json_encode($package);
|
||||||
$session->set('package', $package);
|
$session->set('package', $package);
|
||||||
$session->set('dataType', $this->dataType);
|
$session->set('dataType', $this->dataType);
|
||||||
$session->set('hasPackage', true);
|
$session->set('hasPackage', true);
|
||||||
@ -202,8 +202,8 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
protected function _getPackageFromUpload()
|
protected function _getPackageFromUpload()
|
||||||
{
|
{
|
||||||
// Get the uploaded file information
|
// Get the uploaded file information
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||||
$userfile = $input->files->get('import_package', null, 'raw');
|
$userfile = $input->files->get('import_package', null, 'raw');
|
||||||
@ -230,9 +230,9 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build the appropriate paths
|
// Build the appropriate paths
|
||||||
$config = JFactory::getConfig();
|
$config = JFactory::getConfig();
|
||||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||||
$tmp_src = $userfile['tmp_name'];
|
$tmp_src = $userfile['tmp_name'];
|
||||||
|
|
||||||
// Move uploaded file
|
// Move uploaded file
|
||||||
jimport('joomla.filesystem.file');
|
jimport('joomla.filesystem.file');
|
||||||
@ -263,8 +263,8 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
*/
|
*/
|
||||||
protected function _getPackageFromFolder()
|
protected function _getPackageFromFolder()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Get the path to the package to import
|
// Get the path to the package to import
|
||||||
$p_dir = $input->getString('import_directory');
|
$p_dir = $input->getString('import_directory');
|
||||||
@ -294,8 +294,8 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
}
|
}
|
||||||
|
|
||||||
$package['packagename'] = null;
|
$package['packagename'] = null;
|
||||||
$package['dir'] = $p_dir;
|
$package['dir'] = $p_dir;
|
||||||
$package['type'] = $type;
|
$package['type'] = $type;
|
||||||
|
|
||||||
return $package;
|
return $package;
|
||||||
}
|
}
|
||||||
@ -308,8 +308,8 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
*/
|
*/
|
||||||
protected function _getPackageFromUrl()
|
protected function _getPackageFromUrl()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Get the URL of the package to import
|
// Get the URL of the package to import
|
||||||
$url = $input->getString('import_url');
|
$url = $input->getString('import_url');
|
||||||
@ -348,7 +348,7 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
*/
|
*/
|
||||||
protected function check($archivename)
|
protected function check($archivename)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
// Clean the name
|
// Clean the name
|
||||||
$archivename = JPath::clean($archivename);
|
$archivename = JPath::clean($archivename);
|
||||||
|
|
||||||
@ -361,15 +361,15 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = JFactory::getConfig();
|
$config = JFactory::getConfig();
|
||||||
// set Package Name
|
// set Package Name
|
||||||
$check['packagename'] = $archivename;
|
$check['packagename'] = $archivename;
|
||||||
|
|
||||||
// set directory
|
// set directory
|
||||||
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
|
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
|
||||||
|
|
||||||
// set type
|
// set type
|
||||||
$check['type'] = $this->getType;
|
$check['type'] = $this->getType;
|
||||||
|
|
||||||
return $check;
|
return $check;
|
||||||
}
|
}
|
||||||
@ -408,8 +408,8 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
{
|
{
|
||||||
jimport('joomla.filesystem.file');
|
jimport('joomla.filesystem.file');
|
||||||
|
|
||||||
$config = JFactory::getConfig();
|
$config = JFactory::getConfig();
|
||||||
$package = $config->get('tmp_path'). '/' .$package;
|
$package = $config->get('tmp_path'). '/' .$package;
|
||||||
|
|
||||||
// Is the package file a valid file?
|
// Is the package file a valid file?
|
||||||
if (is_file($package))
|
if (is_file($package))
|
||||||
@ -472,11 +472,11 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
if(###Component###Helper::checkArray($data['array']))
|
if(###Component###Helper::checkArray($data['array']))
|
||||||
{
|
{
|
||||||
// get user object
|
// get user object
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
// remove header if it has headers
|
// remove header if it has headers
|
||||||
$id_key = $data['target_headers']['id'];
|
$id_key = $data['target_headers']['id'];
|
||||||
$published_key = $data['target_headers']['published'];
|
$published_key = $data['target_headers']['published'];
|
||||||
$ordering_key = $data['target_headers']['ordering'];
|
$ordering_key = $data['target_headers']['ordering'];
|
||||||
// get the first array set
|
// get the first array set
|
||||||
$firstSet = reset($data['array']);
|
$firstSet = reset($data['array']);
|
||||||
|
|
||||||
@ -494,13 +494,13 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
// Get a db connection.
|
// Get a db connection.
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
// set some defaults
|
// set some defaults
|
||||||
$todayDate = JFactory::getDate()->toSql();
|
$todayDate = JFactory::getDate()->toSql();
|
||||||
// get global action permissions
|
// get global action permissions
|
||||||
$canDo = ###Component###Helper::getActions($table);
|
$canDo = ###Component###Helper::getActions($table);
|
||||||
$canEdit = $canDo->get('core.edit');
|
$canEdit = $canDo->get('core.edit');
|
||||||
$canState = $canDo->get('core.edit.state');
|
$canState = $canDo->get('core.edit.state');
|
||||||
$canCreate = $canDo->get('core.create');
|
$canCreate = $canDo->get('core.create');
|
||||||
$hasAlias = $this->getAliasesUsed($table);
|
$hasAlias = $this->getAliasesUsed($table);
|
||||||
// prosses the data
|
// prosses the data
|
||||||
foreach($data['array'] as $row)
|
foreach($data['array'] as $row)
|
||||||
{
|
{
|
||||||
@ -522,11 +522,11 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
if($found && $canEdit)
|
if($found && $canEdit)
|
||||||
{
|
{
|
||||||
// update item
|
// update item
|
||||||
$id = $row[$id_key];
|
$id = $row[$id_key];
|
||||||
$version = $db->loadResult();
|
$version = $db->loadResult();
|
||||||
// reset all buckets
|
// reset all buckets
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$fields = array();
|
$fields = array();
|
||||||
// Fields to update.
|
// Fields to update.
|
||||||
foreach($row as $key => $cell)
|
foreach($row as $key => $cell)
|
||||||
{
|
{
|
||||||
@ -571,8 +571,8 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// load the defaults
|
// load the defaults
|
||||||
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
|
$fields[] = $db->quoteName('modified_by') . ' = ' . $db->quote($user->id);
|
||||||
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
|
$fields[] = $db->quoteName('modified') . ' = ' . $db->quote($todayDate);
|
||||||
// Conditions for which records should be updated.
|
// Conditions for which records should be updated.
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
$db->quoteName('id') . ' = ' . $id
|
$db->quoteName('id') . ' = ' . $id
|
||||||
@ -587,9 +587,9 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
// insert item
|
// insert item
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
// reset all buckets
|
// reset all buckets
|
||||||
$columns = array();
|
$columns = array();
|
||||||
$values = array();
|
$values = array();
|
||||||
$version = false;
|
$version = false;
|
||||||
// Insert columns. Insert values.
|
// Insert columns. Insert values.
|
||||||
foreach($row as $key => $cell)
|
foreach($row as $key => $cell)
|
||||||
{
|
{
|
||||||
@ -627,30 +627,30 @@ class ###Component###ModelImport extends JModelLegacy
|
|||||||
// set to insert array
|
// set to insert array
|
||||||
if(in_array($key, $data['target_headers']) && is_numeric($cell))
|
if(in_array($key, $data['target_headers']) && is_numeric($cell))
|
||||||
{
|
{
|
||||||
$columns[] = $target[$key];
|
$columns[] = $target[$key];
|
||||||
$values[] = $cell;
|
$values[] = $cell;
|
||||||
}
|
}
|
||||||
elseif(in_array($key, $data['target_headers']) && is_string($cell))
|
elseif(in_array($key, $data['target_headers']) && is_string($cell))
|
||||||
{
|
{
|
||||||
$columns[] = $target[$key];
|
$columns[] = $target[$key];
|
||||||
$values[] = $db->quote($cell);
|
$values[] = $db->quote($cell);
|
||||||
}
|
}
|
||||||
elseif(in_array($key, $data['target_headers']) && is_null($cell))
|
elseif(in_array($key, $data['target_headers']) && is_null($cell))
|
||||||
{
|
{
|
||||||
// if import data is null then set empty
|
// if import data is null then set empty
|
||||||
$columns[] = $target[$key];
|
$columns[] = $target[$key];
|
||||||
$values[] = "''";
|
$values[] = "''";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// load the defaults
|
// load the defaults
|
||||||
$columns[] = 'created_by';
|
$columns[] = 'created_by';
|
||||||
$values[] = $db->quote($user->id);
|
$values[] = $db->quote($user->id);
|
||||||
$columns[] = 'created';
|
$columns[] = 'created';
|
||||||
$values[] = $db->quote($todayDate);
|
$values[] = $db->quote($todayDate);
|
||||||
if (!$version)
|
if (!$version)
|
||||||
{
|
{
|
||||||
$columns[] = 'version';
|
$columns[] = 'version';
|
||||||
$values[] = 1;
|
$values[] = 1;
|
||||||
}
|
}
|
||||||
// Prepare the insert query.
|
// Prepare the insert query.
|
||||||
$query
|
$query
|
||||||
|
@ -59,8 +59,8 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
/**
|
/**
|
||||||
* Import Settings
|
* Import Settings
|
||||||
*/
|
*/
|
||||||
protected $getType = NULL;
|
protected $getType = NULL;
|
||||||
protected $dataType = NULL;
|
protected $dataType = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to auto-populate the model state.
|
* Method to auto-populate the model state.
|
||||||
@ -92,8 +92,8 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
protected function _getPackageFromUpload()
|
protected function _getPackageFromUpload()
|
||||||
{
|
{
|
||||||
// Get the uploaded file information
|
// Get the uploaded file information
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||||
$userfile = $input->files->get('import_package', null, 'raw');
|
$userfile = $input->files->get('import_package', null, 'raw');
|
||||||
@ -120,9 +120,9 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build the appropriate paths
|
// Build the appropriate paths
|
||||||
$config = JFactory::getConfig();
|
$config = JFactory::getConfig();
|
||||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||||
$tmp_src = $userfile['tmp_name'];
|
$tmp_src = $userfile['tmp_name'];
|
||||||
|
|
||||||
// Move uploaded file
|
// Move uploaded file
|
||||||
jimport('joomla.filesystem.file');
|
jimport('joomla.filesystem.file');
|
||||||
@ -153,8 +153,8 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
*/
|
*/
|
||||||
protected function _getPackageFromFolder()
|
protected function _getPackageFromFolder()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Get the path to the package to import
|
// Get the path to the package to import
|
||||||
$p_dir = $input->getString('import_directory');
|
$p_dir = $input->getString('import_directory');
|
||||||
@ -184,8 +184,8 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
}
|
}
|
||||||
|
|
||||||
$package['packagename'] = null;
|
$package['packagename'] = null;
|
||||||
$package['dir'] = $p_dir;
|
$package['dir'] = $p_dir;
|
||||||
$package['type'] = $type;
|
$package['type'] = $type;
|
||||||
|
|
||||||
return $package;
|
return $package;
|
||||||
}
|
}
|
||||||
@ -198,8 +198,8 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
*/
|
*/
|
||||||
protected function _getPackageFromUrl()
|
protected function _getPackageFromUrl()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Get the URL of the package to import
|
// Get the URL of the package to import
|
||||||
$url = $input->getString('import_url');
|
$url = $input->getString('import_url');
|
||||||
@ -238,7 +238,7 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
*/
|
*/
|
||||||
protected function check($archivename)
|
protected function check($archivename)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
// Clean the name
|
// Clean the name
|
||||||
$archivename = JPath::clean($archivename);
|
$archivename = JPath::clean($archivename);
|
||||||
|
|
||||||
@ -251,15 +251,15 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = JFactory::getConfig();
|
$config = JFactory::getConfig();
|
||||||
// set Package Name
|
// set Package Name
|
||||||
$check['packagename'] = $archivename;
|
$check['packagename'] = $archivename;
|
||||||
|
|
||||||
// set directory
|
// set directory
|
||||||
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
|
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
|
||||||
|
|
||||||
// set type
|
// set type
|
||||||
$check['type'] = $this->getType;
|
$check['type'] = $this->getType;
|
||||||
|
|
||||||
return $check;
|
return $check;
|
||||||
}
|
}
|
||||||
@ -277,8 +277,8 @@ class ###Component###Model###View### extends JModelLegacy
|
|||||||
{
|
{
|
||||||
jimport('joomla.filesystem.file');
|
jimport('joomla.filesystem.file');
|
||||||
|
|
||||||
$config = JFactory::getConfig();
|
$config = JFactory::getConfig();
|
||||||
$package = $config->get('tmp_path'). '/' .$package;
|
$package = $config->get('tmp_path'). '/' .$package;
|
||||||
|
|
||||||
// Is the package file a valid file?
|
// Is the package file a valid file?
|
||||||
if (is_file($package))
|
if (is_file($package))
|
||||||
|
@ -37,16 +37,16 @@ jimport('joomla.application.component.modellist');
|
|||||||
*/
|
*/
|
||||||
class ###Component###Model###SViews### extends JModelList
|
class ###Component###Model###SViews### extends JModelList
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Model user data.
|
* Model user data.
|
||||||
*
|
*
|
||||||
* @var strings
|
* @var strings
|
||||||
*/
|
*/
|
||||||
protected $user;
|
protected $user;
|
||||||
protected $userId;
|
protected $userId;
|
||||||
protected $guest;
|
protected $guest;
|
||||||
protected $groups;
|
protected $groups;
|
||||||
protected $levels;
|
protected $levels;
|
||||||
protected $app;
|
protected $app;
|
||||||
protected $input;
|
protected $input;
|
||||||
protected $uikitComp;
|
protected $uikitComp;
|
||||||
@ -58,16 +58,16 @@ class ###Component###Model###SViews### extends JModelList
|
|||||||
*/
|
*/
|
||||||
protected function getListQuery()
|
protected function getListQuery()
|
||||||
{
|
{
|
||||||
// Get the current user for authorisation checks
|
// Get the current user for authorisation checks
|
||||||
$this->user = JFactory::getUser();
|
$this->user = JFactory::getUser();
|
||||||
$this->userId = $this->user->get('id');
|
$this->userId = $this->user->get('id');
|
||||||
$this->guest = $this->user->get('guest');
|
$this->guest = $this->user->get('guest');
|
||||||
$this->groups = $this->user->get('groups');
|
$this->groups = $this->user->get('groups');
|
||||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = JFactory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
$this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY###
|
$this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,16 +77,16 @@ class ###Component###Model###SViews### extends JModelList
|
|||||||
*/
|
*/
|
||||||
public function getItems()
|
public function getItems()
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
// check if this user has permission to access items
|
// check if this user has permission to access items
|
||||||
if (!$user->authorise('###sviews###.access', 'com_###component###'))
|
if (!$user->authorise('###sviews###.access', 'com_###component###'))
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
||||||
// redirect away if not a correct (TODO for now we go to default view)
|
// redirect away if not a correct (TODO for now we go to default view)
|
||||||
$app->redirect('index.php?option=com_###component###');
|
$app->redirect('index.php?option=com_###component###');
|
||||||
return false;
|
return false;
|
||||||
}###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS###
|
}###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS###
|
||||||
// load parent items
|
// load parent items
|
||||||
$items = parent::getItems();
|
$items = parent::getItems();
|
||||||
|
|
||||||
|
@ -59,15 +59,15 @@ class ###Component###Model###SViews### extends JModelList
|
|||||||
protected function getListQuery()
|
protected function getListQuery()
|
||||||
{
|
{
|
||||||
// Get the current user for authorisation checks
|
// Get the current user for authorisation checks
|
||||||
$this->user = JFactory::getUser();
|
$this->user = JFactory::getUser();
|
||||||
$this->userId = $this->user->get('id');
|
$this->userId = $this->user->get('id');
|
||||||
$this->guest = $this->user->get('guest');
|
$this->guest = $this->user->get('guest');
|
||||||
$this->groups = $this->user->get('groups');
|
$this->groups = $this->user->get('groups');
|
||||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = JFactory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
$this->initSet = true; ###SITE_GET_LIST_QUERY###
|
$this->initSet = true; ###SITE_GET_LIST_QUERY###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,24 +40,24 @@ class ###Component###View###SView### extends JViewLegacy
|
|||||||
// Overwriting JView display method
|
// Overwriting JView display method
|
||||||
function display($tpl = null)
|
function display($tpl = null)
|
||||||
{
|
{
|
||||||
// get component params
|
// get component params
|
||||||
$this->params = JComponentHelper::getParams('com_###component###');
|
$this->params = JComponentHelper::getParams('com_###component###');
|
||||||
// get the application
|
// get the application
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = JFactory::getApplication();
|
||||||
// get the user object
|
// get the user object
|
||||||
$this->user = JFactory::getUser();
|
$this->user = JFactory::getUser();
|
||||||
// get global action permissions
|
// get global action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
||||||
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares the document
|
* Prepares the document
|
||||||
*/
|
*/
|
||||||
protected function setDocument()
|
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###
|
{###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###
|
$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
|
* Setting the toolbar
|
||||||
@ -78,26 +78,26 @@ class ###Component###View###SView### extends JViewLegacy
|
|||||||
}
|
}
|
||||||
// add title to the page
|
// add title to the page
|
||||||
JToolbarHelper::title($title,'###ICOMOON###');
|
JToolbarHelper::title($title,'###ICOMOON###');
|
||||||
// add the back button
|
// add the back button
|
||||||
// JToolBarHelper::custom('###sview###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false);
|
// JToolBarHelper::custom('###sview###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false);
|
||||||
// add cpanel button
|
// add cpanel button
|
||||||
JToolBarHelper::custom('###sview###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
JToolBarHelper::custom('###sview###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
$help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
||||||
if (###Component###Helper::checkString($help_url))
|
if (###Component###Helper::checkString($help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the options comp button
|
// add the options comp button
|
||||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
JToolBarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
}###CUSTOM_ADMIN_GET_MODULE###
|
}###CUSTOM_ADMIN_GET_MODULE###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a value for output in a view script.
|
* Escapes a value for output in a view script.
|
||||||
*
|
*
|
||||||
* @param mixed $var The output to escape.
|
* @param mixed $var The output to escape.
|
||||||
@ -106,7 +106,7 @@ class ###Component###View###SView### extends JViewLegacy
|
|||||||
*/
|
*/
|
||||||
public function escape($var)
|
public function escape($var)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,27 +44,27 @@ class ###Component###View###View### extends JViewLegacy
|
|||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
// Assign the variables
|
// Assign the variables
|
||||||
$this->form = $this->get('Form');
|
$this->form = $this->get('Form');
|
||||||
$this->item = $this->get('Item');
|
$this->item = $this->get('Item');
|
||||||
$this->script = $this->get('Script');
|
$this->script = $this->get('Script');
|
||||||
$this->state = $this->get('State');
|
$this->state = $this->get('State');
|
||||||
// get action permissions
|
// get action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###view###',$this->item);
|
$this->canDo = ###Component###Helper::getActions('###view###',$this->item);
|
||||||
// get input
|
// get input
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = JFactory::getApplication()->input;
|
||||||
$this->ref = $jinput->get('ref', 0, 'word');
|
$this->ref = $jinput->get('ref', 0, 'word');
|
||||||
$this->refid = $jinput->get('refid', 0, 'int');
|
$this->refid = $jinput->get('refid', 0, 'int');
|
||||||
$this->referral = '';
|
$this->referral = '';
|
||||||
if ($this->refid)
|
if ($this->refid)
|
||||||
{
|
{
|
||||||
// return to the item that refered to this item
|
// return to the item that refered to this item
|
||||||
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
|
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
|
||||||
}
|
}
|
||||||
elseif($this->ref)
|
elseif($this->ref)
|
||||||
{
|
{
|
||||||
// return to the list view that refered to this item
|
// return to the list view that refered to this item
|
||||||
$this->referral = '&ref='.(string)$this->ref;
|
$this->referral = '&ref='.(string)$this->ref;
|
||||||
}###LINKEDVIEWITEMS###
|
}###LINKEDVIEWITEMS###
|
||||||
|
|
||||||
// Set the toolbar
|
// Set the toolbar
|
||||||
$this->addToolBar();
|
$this->addToolBar();
|
||||||
@ -91,7 +91,7 @@ class ###Component###View###View### extends JViewLegacy
|
|||||||
###ADDTOOLBAR###
|
###ADDTOOLBAR###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a value for output in a view script.
|
* Escapes a value for output in a view script.
|
||||||
*
|
*
|
||||||
* @param mixed $var The output to escape.
|
* @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
|
// use the helper htmlEscape method instead and shorten the string
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30);
|
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);
|
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class ###Component###View###View### extends JViewLegacy
|
|||||||
$this->item = $this->get('Item');
|
$this->item = $this->get('Item');
|
||||||
$this->script = $this->get('Script');
|
$this->script = $this->get('Script');
|
||||||
$this->state = $this->get('State');
|
$this->state = $this->get('State');
|
||||||
// get action permissions
|
// get action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###view###',$this->item);
|
$this->canDo = ###Component###Helper::getActions('###view###',$this->item);
|
||||||
// get input
|
// get input
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = JFactory::getApplication()->input;
|
||||||
@ -56,15 +56,15 @@ class ###Component###View###View### extends JViewLegacy
|
|||||||
$this->refid = $jinput->get('refid', 0, 'int');
|
$this->refid = $jinput->get('refid', 0, 'int');
|
||||||
$this->referral = '';
|
$this->referral = '';
|
||||||
if ($this->refid)
|
if ($this->refid)
|
||||||
{
|
{
|
||||||
// return to the item that refered to this item
|
// return to the item that refered to this item
|
||||||
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
|
$this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
|
||||||
}
|
}
|
||||||
elseif($this->ref)
|
elseif($this->ref)
|
||||||
{
|
{
|
||||||
// return to the list view that refered to this item
|
// return to the list view that refered to this item
|
||||||
$this->referral = '&ref='.(string)$this->ref;
|
$this->referral = '&ref='.(string)$this->ref;
|
||||||
}###LINKEDVIEWITEMS###
|
}###LINKEDVIEWITEMS###
|
||||||
|
|
||||||
// Set the toolbar
|
// Set the toolbar
|
||||||
$this->addToolBar();
|
$this->addToolBar();
|
||||||
@ -95,7 +95,7 @@ class ###Component###View###View### extends JViewLegacy
|
|||||||
$this->toolbar = JToolbar::getInstance();
|
$this->toolbar = JToolbar::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a value for output in a view script.
|
* Escapes a value for output in a view script.
|
||||||
*
|
*
|
||||||
* @param mixed $var The output to escape.
|
* @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
|
// use the helper htmlEscape method instead and shorten the string
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30);
|
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);
|
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,10 +104,10 @@ class ###Component###ViewImport extends JViewLegacy
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$help_url = ###Component###Helper::getHelpUrl('import');
|
$help_url = ###Component###Helper::getHelpUrl('import');
|
||||||
if (###Component###Helper::checkString($help_url))
|
if (###Component###Helper::checkString($help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,10 +52,10 @@ class ###Component###View###View### extends JViewLegacy
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$help_url = ###Component###Helper::getHelpUrl('###view###');
|
$help_url = ###Component###Helper::getHelpUrl('###view###');
|
||||||
if (###Component###Helper::checkString($help_url))
|
if (###Component###Helper::checkString($help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,26 +50,26 @@ class ###Component###View###Views### extends JViewLegacy
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Assign data to the view
|
// Assign data to the view
|
||||||
$this->items = $this->get('Items');
|
$this->items = $this->get('Items');
|
||||||
$this->pagination = $this->get('Pagination');
|
$this->pagination = $this->get('Pagination');
|
||||||
$this->state = $this->get('State');
|
$this->state = $this->get('State');
|
||||||
$this->user = JFactory::getUser();
|
$this->user = JFactory::getUser();
|
||||||
$this->listOrder = $this->escape($this->state->get('list.ordering'));
|
$this->listOrder = $this->escape($this->state->get('list.ordering'));
|
||||||
$this->listDirn = $this->escape($this->state->get('list.direction'));
|
$this->listDirn = $this->escape($this->state->get('list.direction'));
|
||||||
$this->saveOrder = $this->listOrder == 'ordering';
|
$this->saveOrder = $this->listOrder == 'ordering';
|
||||||
// get global action permissions
|
// get global action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO###
|
$this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO###
|
||||||
|
|
||||||
// We don't need toolbar in the modal window.
|
// We don't need toolbar in the modal window.
|
||||||
if ($this->getLayout() !== 'modal')
|
if ($this->getLayout() !== 'modal')
|
||||||
{
|
{
|
||||||
$this->addToolbar();
|
$this->addToolbar();
|
||||||
$this->sidebar = JHtmlSidebar::render();
|
$this->sidebar = JHtmlSidebar::render();
|
||||||
// load the batch html
|
// load the batch html
|
||||||
if ($this->canCreate && $this->canEdit && $this->canState)
|
if ($this->canCreate && $this->canEdit && $this->canState)
|
||||||
{
|
{
|
||||||
$this->batchDisplay = JHtmlBatch_::render();
|
$this->batchDisplay = JHtmlBatch_::render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for errors.
|
// Check for errors.
|
||||||
@ -92,86 +92,86 @@ class ###Component###View###Views### extends JViewLegacy
|
|||||||
{
|
{
|
||||||
JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###');
|
JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###');
|
||||||
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###');
|
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###');
|
||||||
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
|
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
|
||||||
|
|
||||||
if ($this->canCreate)
|
if ($this->canCreate)
|
||||||
{
|
{
|
||||||
JToolBarHelper::addNew('###view###.add');
|
JToolBarHelper::addNew('###view###.add');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only load if there are items
|
// Only load if there are items
|
||||||
if (###Component###Helper::checkArray($this->items))
|
if (###Component###Helper::checkArray($this->items))
|
||||||
{
|
{
|
||||||
if ($this->canEdit)
|
if ($this->canEdit)
|
||||||
{
|
{
|
||||||
JToolBarHelper::editList('###view###.edit');
|
JToolBarHelper::editList('###view###.edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->canState)
|
if ($this->canState)
|
||||||
{
|
{
|
||||||
JToolBarHelper::publishList('###views###.publish');
|
JToolBarHelper::publishList('###views###.publish');
|
||||||
JToolBarHelper::unpublishList('###views###.unpublish');
|
JToolBarHelper::unpublishList('###views###.unpublish');
|
||||||
JToolBarHelper::archiveList('###views###.archive');
|
JToolBarHelper::archiveList('###views###.archive');
|
||||||
|
|
||||||
if ($this->canDo->get('core.admin'))
|
if ($this->canDo->get('core.admin'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::checkin('###views###.checkin');
|
JToolBarHelper::checkin('###views###.checkin');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a batch button
|
// Add a batch button
|
||||||
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
|
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
|
||||||
{
|
{
|
||||||
// Get the toolbar object instance
|
// Get the toolbar object instance
|
||||||
$bar = JToolBar::getInstance('toolbar');
|
$bar = JToolBar::getInstance('toolbar');
|
||||||
// set the batch button name
|
// set the batch button name
|
||||||
$title = JText::_('JTOOLBAR_BATCH');
|
$title = JText::_('JTOOLBAR_BATCH');
|
||||||
// Instantiate a new JLayoutFile instance and render the batch button
|
// Instantiate a new JLayoutFile instance and render the batch button
|
||||||
$layout = new JLayoutFile('joomla.toolbar.batch');
|
$layout = new JLayoutFile('joomla.toolbar.batch');
|
||||||
// add the button to the page
|
// add the button to the page
|
||||||
$dhtml = $layout->render(array('title' => $title));
|
$dhtml = $layout->render(array('title' => $title));
|
||||||
$bar->appendButton('Custom', $dhtml, 'batch');
|
$bar->appendButton('Custom', $dhtml, 'batch');
|
||||||
}###CUSTOM_ADMIN_DYNAMIC_BUTTONS### ###ADMIN_CUSTOM_BUTTONS_LIST###
|
}###CUSTOM_ADMIN_DYNAMIC_BUTTONS### ###ADMIN_CUSTOM_BUTTONS_LIST###
|
||||||
|
|
||||||
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
||||||
{
|
{
|
||||||
JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH');
|
JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||||
}
|
}
|
||||||
elseif ($this->canState && $this->canDelete)
|
elseif ($this->canState && $this->canDelete)
|
||||||
{
|
{
|
||||||
JToolbarHelper::trash('###views###.trash');
|
JToolbarHelper::trash('###views###.trash');
|
||||||
}###EXPORTBUTTON###
|
}###EXPORTBUTTON###
|
||||||
}###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST### ###IMPORTBUTTON###
|
}###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST### ###IMPORTBUTTON###
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$help_url = ###Component###Helper::getHelpUrl('###views###');
|
$help_url = ###Component###Helper::getHelpUrl('###views###');
|
||||||
if (###Component###Helper::checkString($help_url))
|
if (###Component###Helper::checkString($help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the options comp button
|
// add the options comp button
|
||||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
JToolBarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->canState)
|
if ($this->canState)
|
||||||
{
|
{
|
||||||
JHtmlSidebar::addFilter(
|
JHtmlSidebar::addFilter(
|
||||||
JText::_('JOPTION_SELECT_PUBLISHED'),
|
JText::_('JOPTION_SELECT_PUBLISHED'),
|
||||||
'filter_published',
|
'filter_published',
|
||||||
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
|
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
|
||||||
);
|
);
|
||||||
// only load if batch allowed
|
// only load if batch allowed
|
||||||
if ($this->canBatch)
|
if ($this->canBatch)
|
||||||
{
|
{
|
||||||
JHtmlBatch_::addListSelection(
|
JHtmlBatch_::addListSelection(
|
||||||
JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_STATE'),
|
JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_STATE'),
|
||||||
'batch[published]',
|
'batch[published]',
|
||||||
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
|
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JHtmlSidebar::addFilter(
|
JHtmlSidebar::addFilter(
|
||||||
@ -183,11 +183,11 @@ class ###Component###View###Views### extends JViewLegacy
|
|||||||
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
if ($this->canBatch && $this->canCreate && $this->canEdit)
|
||||||
{
|
{
|
||||||
JHtmlBatch_::addListSelection(
|
JHtmlBatch_::addListSelection(
|
||||||
JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_ACCESS'),
|
JText::_('COM_###COMPONENT###_KEEP_ORIGINAL_ACCESS'),
|
||||||
'batch[access]',
|
'batch[access]',
|
||||||
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
|
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
|
||||||
);
|
);
|
||||||
} ###CATEGORYFILTER### ###OTHERFILTERS###
|
}###CATEGORYFILTER### ###OTHERFILTERS###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -205,7 +205,7 @@ class ###Component###View###Views### extends JViewLegacy
|
|||||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css");
|
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a value for output in a view script.
|
* Escapes a value for output in a view script.
|
||||||
*
|
*
|
||||||
* @param mixed $var The output to escape.
|
* @param mixed $var The output to escape.
|
||||||
@ -216,10 +216,10 @@ class ###Component###View###Views### extends JViewLegacy
|
|||||||
{
|
{
|
||||||
if(strlen($var) > 50)
|
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);
|
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);
|
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,5 +231,5 @@ class ###Component###View###Views### extends JViewLegacy
|
|||||||
protected function getSortFields()
|
protected function getSortFields()
|
||||||
{
|
{
|
||||||
###SORTFIELDS###
|
###SORTFIELDS###
|
||||||
} ###FILTERFUNCTIONS###
|
}###FILTERFUNCTIONS###
|
||||||
}
|
}
|
||||||
|
@ -40,24 +40,24 @@ class ###Component###View###SViews### extends JViewLegacy
|
|||||||
// Overwriting JView display method
|
// Overwriting JView display method
|
||||||
function display($tpl = null)
|
function display($tpl = null)
|
||||||
{
|
{
|
||||||
// get component params
|
// get component params
|
||||||
$this->params = JComponentHelper::getParams('com_###component###');
|
$this->params = JComponentHelper::getParams('com_###component###');
|
||||||
// get the application
|
// get the application
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = JFactory::getApplication();
|
||||||
// get the user object
|
// get the user object
|
||||||
$this->user = JFactory::getUser();
|
$this->user = JFactory::getUser();
|
||||||
// get global action permissions
|
// get global action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
||||||
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares the document
|
* Prepares the document
|
||||||
*/
|
*/
|
||||||
protected function setDocument()
|
protected function setDocument()
|
||||||
{###CUSTOM_ADMIN_LIBRARIES_LOADER### ###CUSTOM_ADMIN_UIKIT_LOADER### ###CUSTOM_ADMIN_GOOGLECHART_LOADER### ###CUSTOM_ADMIN_FOOTABLE_LOADER### ###CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
|
{###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###
|
$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
|
* Setting the toolbar
|
||||||
@ -65,29 +65,29 @@ class ###Component###View###SViews### extends JViewLegacy
|
|||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{
|
||||||
// hide the main menu
|
// hide the main menu
|
||||||
$this->app->input->set('hidemainmenu', true);
|
$this->app->input->set('hidemainmenu', true);
|
||||||
// add title to the page
|
// add title to the page
|
||||||
JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');
|
JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');
|
||||||
// add the back button
|
// add the back button
|
||||||
// JToolBarHelper::custom('###sviews###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false);
|
// JToolBarHelper::custom('###sviews###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false);
|
||||||
// add cpanel button
|
// add cpanel button
|
||||||
JToolBarHelper::custom('###sviews###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
JToolBarHelper::custom('###sviews###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
$help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
||||||
if (###Component###Helper::checkString($help_url))
|
if (###Component###Helper::checkString($help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the options comp button
|
// add the options comp button
|
||||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
JToolBarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
}###CUSTOM_ADMIN_GET_MODULE###
|
}###CUSTOM_ADMIN_GET_MODULE###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a value for output in a view script.
|
* Escapes a value for output in a view script.
|
||||||
*
|
*
|
||||||
* @param mixed $var The output to escape.
|
* @param mixed $var The output to escape.
|
||||||
@ -96,7 +96,7 @@ class ###Component###View###SViews### extends JViewLegacy
|
|||||||
*/
|
*/
|
||||||
public function escape($var)
|
public function escape($var)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,14 +48,14 @@ class ###Component###View###SViews### extends JViewLegacy
|
|||||||
$this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
|
$this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
|
||||||
}###SITE_EXTRA_DIPLAY_METHODS###
|
}###SITE_EXTRA_DIPLAY_METHODS###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares the document
|
* Prepares the document
|
||||||
*/
|
*/
|
||||||
protected function _prepareDocument()
|
protected function _prepareDocument()
|
||||||
{###SITE_LIBRARIES_LOADER### ###SITE_UIKIT_LOADER### ###SITE_GOOGLECHART_LOADER### ###SITE_FOOTABLE_LOADER### ###SITE_DOCUMENT_METADATA### ###SITE_DOCUMENT_CUSTOM_PHP###
|
{###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
|
// 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###
|
$this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css');###SITE_DOCUMENT_CUSTOM_CSS### ###SITE_DOCUMENT_CUSTOM_JS###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setting the toolbar
|
* Setting the toolbar
|
||||||
@ -75,7 +75,7 @@ class ###Component###View###SViews### extends JViewLegacy
|
|||||||
$this->toolbar = JToolbar::getInstance();
|
$this->toolbar = JToolbar::getInstance();
|
||||||
}###SITE_GET_MODULE###
|
}###SITE_GET_MODULE###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a value for output in a view script.
|
* Escapes a value for output in a view script.
|
||||||
*
|
*
|
||||||
* @param mixed $var The output to escape.
|
* @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)
|
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);
|
return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,14 +48,14 @@ class ###Component###View###SView### extends JViewLegacy
|
|||||||
$this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
|
$this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
|
||||||
}###SITE_EXTRA_DIPLAY_METHODS###
|
}###SITE_EXTRA_DIPLAY_METHODS###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares the document
|
* Prepares the document
|
||||||
*/
|
*/
|
||||||
protected function _prepareDocument()
|
protected function _prepareDocument()
|
||||||
{###SITE_LIBRARIES_LOADER### ###SITE_UIKIT_LOADER### ###SITE_GOOGLECHART_LOADER### ###SITE_FOOTABLE_LOADER### ###SITE_DOCUMENT_METADATA### ###SITE_DOCUMENT_CUSTOM_PHP###
|
{###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
|
// 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###
|
$this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css');###SITE_DOCUMENT_CUSTOM_CSS### ###SITE_DOCUMENT_CUSTOM_JS###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setting the toolbar
|
* Setting the toolbar
|
||||||
@ -75,7 +75,7 @@ class ###Component###View###SView### extends JViewLegacy
|
|||||||
$this->toolbar = JToolbar::getInstance();
|
$this->toolbar = JToolbar::getInstance();
|
||||||
}###SITE_GET_MODULE###
|
}###SITE_GET_MODULE###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes a value for output in a view script.
|
* Escapes a value for output in a view script.
|
||||||
*
|
*
|
||||||
* @param mixed $var The output to escape.
|
* @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)
|
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);
|
return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
4
admin/compiler/joomla_3/viewFile.js
Normal file
4
admin/compiler/joomla_3/viewFile.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
###BOM###
|
||||||
|
|
||||||
|
/* JS Document */
|
||||||
|
###ADMINJS###
|
4
admin/compiler/joomla_3/viewFileCustomAdmin.js
Normal file
4
admin/compiler/joomla_3/viewFileCustomAdmin.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
###BOM###
|
||||||
|
|
||||||
|
/* JS Document */
|
||||||
|
###CUSTOM_ADMIN_JAVASCRIPT_FILE###
|
4
admin/compiler/joomla_3/viewFileSite.js
Normal file
4
admin/compiler/joomla_3/viewFileSite.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
###BOM###
|
||||||
|
|
||||||
|
/* JS Document */
|
||||||
|
###SITE_JAVASCRIPT_FILE###
|
@ -39,7 +39,7 @@ class ComponentbuilderController extends JControllerLegacy
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function display($cachable = false, $urlparams = false)
|
function display($cachable = false, $urlparams = false)
|
||||||
{
|
{
|
||||||
// set default view if not set
|
// set default view if not set
|
||||||
$view = $this->input->getCmd('view', 'Componentbuilder');
|
$view = $this->input->getCmd('view', 'Componentbuilder');
|
||||||
@ -48,46 +48,46 @@ class ComponentbuilderController extends JControllerLegacy
|
|||||||
$id = $this->input->getInt('id');
|
$id = $this->input->getInt('id');
|
||||||
|
|
||||||
// Check for edit form.
|
// Check for edit form.
|
||||||
if(ComponentbuilderHelper::checkArray($data))
|
if(ComponentbuilderHelper::checkArray($data))
|
||||||
{
|
{
|
||||||
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$data['view'], $id))
|
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.
|
// Somehow the person just went to the form - we don't allow that.
|
||||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
||||||
$this->setMessage($this->getError(), 'error');
|
$this->setMessage($this->getError(), 'error');
|
||||||
// check if item was opend from other then its own list view
|
// check if item was opend from other then its own list view
|
||||||
$ref = $this->input->getCmd('ref', 0);
|
$ref = $this->input->getCmd('ref', 0);
|
||||||
$refid = $this->input->getInt('refid', 0);
|
$refid = $this->input->getInt('refid', 0);
|
||||||
// set redirect
|
// set redirect
|
||||||
if ($refid > 0 && ComponentbuilderHelper::checkString($ref))
|
if ($refid > 0 && ComponentbuilderHelper::checkString($ref))
|
||||||
{
|
{
|
||||||
// redirect to item of ref
|
// redirect to item of ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
||||||
}
|
}
|
||||||
elseif (ComponentbuilderHelper::checkString($ref))
|
elseif (ComponentbuilderHelper::checkString($ref))
|
||||||
{
|
{
|
||||||
|
|
||||||
// redirect to ref
|
// redirect to ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false));
|
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// normal redirect back to the list view
|
// normal redirect back to the list view
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.$data['views'], false));
|
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.$data['views'], false));
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::display($cachable, $urlparams);
|
return parent::display($cachable, $urlparams);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getViewRelation($view)
|
protected function getViewRelation($view)
|
||||||
{
|
{
|
||||||
if (ComponentbuilderHelper::checkString($view))
|
if (ComponentbuilderHelper::checkString($view))
|
||||||
{
|
{
|
||||||
$views = array(
|
$views = array(
|
||||||
'joomla_component' => 'joomla_components',
|
'joomla_component' => 'joomla_components',
|
||||||
'admin_view' => 'admin_views',
|
'admin_view' => 'admin_views',
|
||||||
'custom_admin_view' => 'custom_admin_views',
|
'custom_admin_view' => 'custom_admin_views',
|
||||||
@ -118,18 +118,18 @@ class ComponentbuilderController extends JControllerLegacy
|
|||||||
'snippet_type' => 'snippet_types',
|
'snippet_type' => 'snippet_types',
|
||||||
'library_config' => 'libraries_config',
|
'library_config' => 'libraries_config',
|
||||||
'library_files_folders_urls' => 'libraries_files_folders_urls'
|
'library_files_folders_urls' => 'libraries_files_folders_urls'
|
||||||
);
|
);
|
||||||
// check if this is a list view
|
// check if this is a list view
|
||||||
if (in_array($view,$views))
|
if (in_array($view,$views))
|
||||||
{
|
{
|
||||||
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
|
return array('edit' => false, 'view' => array_search($view,$views), 'views' => $view);
|
||||||
}
|
}
|
||||||
// check if it is an edit view
|
// check if it is an edit view
|
||||||
elseif (array_key_exists($view,$views))
|
elseif (array_key_exists($view,$views))
|
||||||
{
|
{
|
||||||
return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
|
return array('edit' => true, 'view' => $view, 'views' => $views[$view]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_fields extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_fields_conditions extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerAdmin_view extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -73,10 +73,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
|||||||
$token = JSession::getFormToken();
|
$token = JSession::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($token == $call_token)
|
if($token == $call_token)
|
||||||
{
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
switch($task)
|
switch($task)
|
||||||
{
|
{
|
||||||
case 'isNew':
|
case 'isNew':
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -887,14 +887,14 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||||
{
|
{
|
||||||
echo $callback."(".json_encode(false).");";
|
echo $callback."(".json_encode(false).");";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo "(".json_encode(false).");";
|
echo "(".json_encode(false).");";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
|||||||
$message .= '<ul>';
|
$message .= '<ul>';
|
||||||
$message .= '<li>Total folders created: <b>'.$model->compiler->folderCount.'</b></li>';
|
$message .= '<li>Total folders created: <b>'.$model->compiler->folderCount.'</b></li>';
|
||||||
$message .= '<li>Total files created: <b>'.$model->compiler->fileCount.'</b></li>';
|
$message .= '<li>Total files created: <b>'.$model->compiler->fileCount.'</b></li>';
|
||||||
|
$message .= '<li>Total fields created: <b>'.$model->compiler->fieldCount.'</b></li>';
|
||||||
$message .= '<li>Total lines written: <b>'.$model->compiler->lineCount.'</b></li>';
|
$message .= '<li>Total lines written: <b>'.$model->compiler->lineCount.'</b></li>';
|
||||||
$message .= '<li>A4 Book of: <b>'.$model->compiler->pageCount.' pages</b></li>';
|
$message .= '<li>A4 Book of: <b>'.$model->compiler->pageCount.' pages</b></li>';
|
||||||
$message .= '</ul>';
|
$message .= '</ul>';
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_admin_views extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_config extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_config extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends JController
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_custom_admin_views extends JController
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_dashboard extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_files_folders extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_site_views extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerComponent_updates extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerCustom_admin_view extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerCustom_code extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerCustom_code extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerDynamic_get extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -158,10 +158,10 @@ class ComponentbuilderControllerField extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -273,11 +273,11 @@ class ComponentbuilderControllerField extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -158,10 +158,10 @@ class ComponentbuilderControllerFieldtype extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -273,11 +273,11 @@ class ComponentbuilderControllerFieldtype extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerFtp extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerFtp extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -48,7 +48,8 @@ class ComponentbuilderControllerHelp extends JControllerLegacy
|
|||||||
// Check Token!
|
// Check Token!
|
||||||
$token = JSession::getFormToken();
|
$token = JSession::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($user->id != 0 && $token == $call_token){
|
if($user->id != 0 && $token == $call_token)
|
||||||
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
switch($task){
|
switch($task){
|
||||||
case 'getText':
|
case 'getText':
|
||||||
@ -64,25 +65,25 @@ class ComponentbuilderControllerHelp extends JControllerLegacy
|
|||||||
$result = '';
|
$result = '';
|
||||||
}
|
}
|
||||||
echo $result;
|
echo $result;
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// stop execution gracefully
|
// stop execution gracefully
|
||||||
jexit();
|
jexit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getHelpDocumentText($id)
|
protected function getHelpDocumentText($id)
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerHelp_document extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerHelp_document extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerLanguage extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerLanguage extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerLanguage_translation extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerLanguage_translation extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerLayout extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerLayout extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerLibrary extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerLibrary extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerLibrary_config extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerLibrary_config extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends JControllerFo
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends JControllerFo
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerSite_view extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerSite_view extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerSnippet extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerSnippet extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerSnippet_type extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerSnippet_type extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -150,12 +150,12 @@ class ComponentbuilderControllerSnippets extends JControllerAdmin
|
|||||||
if (count($pks) > 1)
|
if (count($pks) > 1)
|
||||||
{
|
{
|
||||||
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED') . '</h1>';
|
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED') . '</h1>';
|
||||||
$message .= '<p>' . JText::sprintf('To share these snippets with the rest of the JCB community,');
|
$message .= '<p>' . JText::sprintf('COM_COMPONENTBUILDER_TO_SHARE_THESE_SNIPPETS_WITH_THE_REST_OF_THE_JCB_COMMUNITY');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED') . '</h1>';
|
$message = '<h1>' . JText::_('COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED') . '</h1>';
|
||||||
$message .= '<p>' . JText::sprintf('To share this snippet with the rest of the JCB community,');
|
$message .= '<p>' . JText::sprintf('COM_COMPONENTBUILDER_TO_SHARE_THIS_SNIPPET_WITH_THE_REST_OF_THE_JCB_COMMUNITY');
|
||||||
}
|
}
|
||||||
$message .= JText::sprintf('COM_COMPONENTBUILDER_YOU_WILL_NEED_TO_KNOW_HOW_S_WORKS_BASIC_YOU_WILL_ALSO_NEED_A_S_ACCOUNT_AND_KNOW_HOW_TO_MAKE_A_PULL_REQUEST_ON_GITHUB',
|
$message .= JText::sprintf('COM_COMPONENTBUILDER_YOU_WILL_NEED_TO_KNOW_HOW_S_WORKS_BASIC_YOU_WILL_ALSO_NEED_A_S_ACCOUNT_AND_KNOW_HOW_TO_MAKE_A_PULL_REQUEST_ON_GITHUB',
|
||||||
'<a href="https://try.github.io" target="_blank">git</a>',
|
'<a href="https://try.github.io" target="_blank">git</a>',
|
||||||
|
@ -159,10 +159,10 @@ class ComponentbuilderControllerTemplate extends JControllerForm
|
|||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
$append .= '&ref='.(string)$ref.'&refid='.(int)$refid;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append .= '&ref='.(string)$ref;
|
$append .= '&ref='.(string)$ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tmpl)
|
if ($tmpl)
|
||||||
{
|
{
|
||||||
@ -274,11 +274,11 @@ class ComponentbuilderControllerTemplate extends JControllerForm
|
|||||||
$this->ref = $this->input->get('ref', 0, 'word');
|
$this->ref = $this->input->get('ref', 0, 'word');
|
||||||
$this->refid = $this->input->get('refid', 0, 'int');
|
$this->refid = $this->input->get('refid', 0, 'int');
|
||||||
|
|
||||||
if ($this->ref || $this->refid)
|
if ($this->ref || $this->refid)
|
||||||
{
|
{
|
||||||
// to make sure the item is checkedin on redirect
|
// to make sure the item is checkedin on redirect
|
||||||
$this->task = 'save';
|
$this->task = 'save';
|
||||||
}
|
}
|
||||||
|
|
||||||
$saved = parent::save($key, $urlVar);
|
$saved = parent::save($key, $urlVar);
|
||||||
|
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
|
||||||
__ __ _ _____ _ _ __ __ _ _ _
|
|
||||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
|
||||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
|
||||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
|
||||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
|
||||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
|
||||||
| |
|
|
||||||
|_|
|
|
||||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
|
||||||
|
|
||||||
@version 2.6.0
|
/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||||
@created 30th April, 2015
|
__ __ _ _____ _ _ __ __ _ _ _
|
||||||
@package Component Builder
|
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||||
@subpackage compiler.php
|
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||||
@my wife Roline van der Merwe <http://www.vdm.io/>
|
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||||
@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
|
@version 2.6.x
|
||||||
|
@created 30th April, 2015
|
||||||
|
@package Component Builder
|
||||||
|
@subpackage compiler.php
|
||||||
|
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||||
|
@my wife Roline van der Merwe <http://www.vdm.io/>
|
||||||
|
@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
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
@ -39,6 +40,7 @@ class Compiler extends Infusion
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private $tempPath;
|
private $tempPath;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -48,19 +50,18 @@ class Compiler extends Infusion
|
|||||||
*/
|
*/
|
||||||
private $time_start;
|
private $time_start;
|
||||||
private $time_end;
|
private $time_end;
|
||||||
public $secondsCompiled;
|
public $secondsCompiled;
|
||||||
|
public $filepath = '';
|
||||||
public $filepath = '';
|
|
||||||
// fixed pathes
|
// fixed pathes
|
||||||
protected $dynamicIntegration = false;
|
protected $dynamicIntegration = false;
|
||||||
protected $backupPath = false;
|
protected $backupPath = false;
|
||||||
protected $repoPath = false;
|
protected $repoPath = false;
|
||||||
protected $addCustomCodeAt = array();
|
protected $addCustomCodeAt = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
public function __construct($config = array ())
|
public function __construct($config = array())
|
||||||
{
|
{
|
||||||
// to check the compiler speed
|
// to check the compiler speed
|
||||||
$this->time_start = microtime(true);
|
$this->time_start = microtime(true);
|
||||||
@ -68,17 +69,17 @@ class Compiler extends Infusion
|
|||||||
if (parent::__construct($config))
|
if (parent::__construct($config))
|
||||||
{
|
{
|
||||||
// set temp directory
|
// set temp directory
|
||||||
$comConfig = JFactory::getConfig();
|
$comConfig = JFactory::getConfig();
|
||||||
$this->tempPath = $comConfig->get('tmp_path');
|
$this->tempPath = $comConfig->get('tmp_path');
|
||||||
// set some folder paths in relation to distribution
|
// set some folder paths in relation to distribution
|
||||||
if ($config['addBackup'])
|
if ($config['addBackup'])
|
||||||
{
|
{
|
||||||
$this->backupPath = $this->params->get('backup_folder_path', $this->tempPath).'/'.$this->componentBackupName.'.zip';
|
$this->backupPath = $this->params->get('backup_folder_path', $this->tempPath) . '/' . $this->componentBackupName . '.zip';
|
||||||
$this->dynamicIntegration = true;
|
$this->dynamicIntegration = true;
|
||||||
}
|
}
|
||||||
if ($config['addRepo'])
|
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)
|
// 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)
|
if ($this->removeSiteFolder)
|
||||||
@ -86,12 +87,12 @@ class Compiler extends Infusion
|
|||||||
// first remove the files and folders
|
// first remove the files and folders
|
||||||
$this->removeFolder($this->componentPath . '/site');
|
$this->removeFolder($this->componentPath . '/site');
|
||||||
// clear form component xml
|
// clear form component xml
|
||||||
$xmlPath = $this->componentPath . '/'. $this->fileContentStatic['###component###']. '.xml';
|
$xmlPath = $this->componentPath . '/' . $this->fileContentStatic['###component###'] . '.xml';
|
||||||
$componentXML = ComponentbuilderHelper::getFileContents($xmlPath);
|
$componentXML = ComponentbuilderHelper::getFileContents($xmlPath);
|
||||||
$textToSite = ComponentbuilderHelper::getBetween($componentXML,'<files folder="site">','</files>');
|
$textToSite = ComponentbuilderHelper::getBetween($componentXML, '<files folder="site">', '</files>');
|
||||||
$textToSiteLang = ComponentbuilderHelper::getBetween($componentXML,'<languages folder="site">','</languages>');
|
$textToSiteLang = ComponentbuilderHelper::getBetween($componentXML, '<languages folder="site">', '</languages>');
|
||||||
$componentXML = str_replace(array('<files folder="site">'.$textToSite."</files>", '<languages folder="site">'.$textToSiteLang."</languages>"), array('',''), $componentXML);
|
$componentXML = str_replace(array('<files folder="site">' . $textToSite . "</files>", '<languages folder="site">' . $textToSiteLang . "</languages>"), array('', ''), $componentXML);
|
||||||
$this->writeFile($xmlPath,$componentXML);
|
$this->writeFile($xmlPath, $componentXML);
|
||||||
}
|
}
|
||||||
// now update the files
|
// now update the files
|
||||||
if (!$this->updateFiles())
|
if (!$this->updateFiles())
|
||||||
@ -112,11 +113,9 @@ class Compiler extends Infusion
|
|||||||
{
|
{
|
||||||
foreach ($this->langNot as $tag => $percentage)
|
foreach ($this->langNot as $tag => $percentage)
|
||||||
{
|
{
|
||||||
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> language has %s% translated, you will need to translate %s% of the language strings before it will be added.',
|
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> language has %s% translated, you will need to translate %s% of the language strings before it will be added.', $tag, $percentage, $this->percentageLanguageAdd), 'Warning');
|
||||||
$tag, $percentage, $this->percentageLanguageAdd), 'Warning');
|
|
||||||
}
|
}
|
||||||
$this->app->enqueueMessage(JText::sprintf('<b>You can change this percentage of translated strings required in the global options of JCB.</b><br />Please watch this <a href=%s>tutorial for more help surrounding the JCB translations manager</a>.',
|
$this->app->enqueueMessage(JText::sprintf('<b>You can change this percentage of translated strings required in the global options of JCB.</b><br />Please watch this <a href=%s>tutorial for more help surrounding the JCB translations manager</a>.', '"https://youtu.be/zzAcVkn_cWU?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE" target="_blank" title="JCB Tutorial surrounding Translation Manager"'), 'Notice');
|
||||||
'"https://youtu.be/zzAcVkn_cWU?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE" target="_blank" title="JCB Tutorial surrounding Translation Manager"'), 'Notice');
|
|
||||||
}
|
}
|
||||||
// set why the strings were added
|
// set why the strings were added
|
||||||
$whyAddedLang = JText::sprintf('because more then %s% of the strings have been translated.', $this->percentageLanguageAdd);
|
$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)
|
foreach ($this->langSet as $tag => $percentage)
|
||||||
{
|
{
|
||||||
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> language has %s% translated. Was addeded %s',
|
$this->app->enqueueMessage(JText::sprintf('The <b>%s</b> language has %s% translated. Was addeded %s', $tag, $percentage, $whyAddedLang), 'Notice');
|
||||||
$tag, $percentage, $whyAddedLang), 'Notice');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,6 +144,37 @@ class Compiler extends Infusion
|
|||||||
// done with error
|
// done with error
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// do lang mismatch check
|
||||||
|
if (ComponentbuilderHelper::checkArray($this->langMismatch))
|
||||||
|
{
|
||||||
|
if (ComponentbuilderHelper::checkArray($this->langMatch))
|
||||||
|
{
|
||||||
|
$mismatch = array_diff(array_unique($this->langMismatch), array_unique($this->langMatch));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mismatch = array_unique($this->langMismatch);
|
||||||
|
}
|
||||||
|
// set a notice if we have a mismatch
|
||||||
|
if (isset($mismatch) && ComponentbuilderHelper::checkArray($mismatch))
|
||||||
|
{
|
||||||
|
if (count($mismatch) > 1)
|
||||||
|
{
|
||||||
|
$this->app->enqueueMessage(JText::_('<h3>Please check the following mismatching Joomla.JText language constants.</h3>'), 'Warning');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->app->enqueueMessage(JText::_('<h3>Please check the following mismatch Joomla.JText language constant.</h3>'), 'Warning');
|
||||||
|
}
|
||||||
|
// add the mismatching issues
|
||||||
|
foreach ($mismatch as $string)
|
||||||
|
{
|
||||||
|
$constant = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($string, 'U');
|
||||||
|
$this->app->enqueueMessage(JText::sprintf('The <b>Joomla.JText._(\'%s\')</b> language constant for (%s) does not have a corresponding JText::Script() decalaration.', $constant, $string), 'Warning');
|
||||||
|
}
|
||||||
|
$this->app->enqueueMessage('<hr />', 'Warning');
|
||||||
|
}
|
||||||
|
}
|
||||||
// end the timer here
|
// end the timer here
|
||||||
$this->time_end = microtime(true);
|
$this->time_end = microtime(true);
|
||||||
$this->secondsCompiled = $this->time_end - $this->time_start;
|
$this->secondsCompiled = $this->time_end - $this->time_start;
|
||||||
@ -167,7 +196,7 @@ class Compiler extends Infusion
|
|||||||
{
|
{
|
||||||
if ($this->debugLinenr)
|
if ($this->debugLinenr)
|
||||||
{
|
{
|
||||||
return ' [Compiler '.$nr.']';
|
return ' [Compiler ' . $nr . ']';
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -191,26 +220,26 @@ class Compiler extends Infusion
|
|||||||
{
|
{
|
||||||
$this->fileContentStatic['###FILENAME###'] = $static['name'];
|
$this->fileContentStatic['###FILENAME###'] = $static['name'];
|
||||||
$php = '';
|
$php = '';
|
||||||
if (ComponentbuilderHelper::checkFileType($static['name'],'php'))
|
if (ComponentbuilderHelper::checkFileType($static['name'], 'php'))
|
||||||
{
|
{
|
||||||
$php = "<?php\n";
|
$php = "<?php\n";
|
||||||
}
|
}
|
||||||
$string = ComponentbuilderHelper::getFileContents($static['path']);
|
$string = ComponentbuilderHelper::getFileContents($static['path']);
|
||||||
if (strpos($string,'###BOM###') !== false)
|
if (strpos($string, '###BOM###') !== false)
|
||||||
{
|
{
|
||||||
list($wast,$code) = explode('###BOM###',$string);
|
list($wast, $code) = explode('###BOM###', $string);
|
||||||
$string = $php.$bom.$code;
|
$string = $php . $bom . $code;
|
||||||
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
|
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
|
||||||
// add to zip array
|
// add to zip array
|
||||||
$this->writeFile($static['path'],$answer);
|
$this->writeFile($static['path'], $answer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
|
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
|
||||||
// add to zip array
|
// 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
|
// now we do the dynamic files
|
||||||
@ -228,28 +257,28 @@ class Compiler extends Infusion
|
|||||||
// do some weird stuff to improve the verion and dates being added to the license
|
// do some weird stuff to improve the verion and dates being added to the license
|
||||||
$this->fixLicenseValues($file);
|
$this->fixLicenseValues($file);
|
||||||
$php = '';
|
$php = '';
|
||||||
if (ComponentbuilderHelper::checkFileType($file['name'],'php'))
|
if (ComponentbuilderHelper::checkFileType($file['name'], 'php'))
|
||||||
{
|
{
|
||||||
$php = "<?php\n";
|
$php = "<?php\n";
|
||||||
}
|
}
|
||||||
$string = ComponentbuilderHelper::getFileContents($file['path']);
|
$string = ComponentbuilderHelper::getFileContents($file['path']);
|
||||||
if (strpos($string,'###BOM###') !== false)
|
if (strpos($string, '###BOM###') !== false)
|
||||||
{
|
{
|
||||||
list($bin,$code) = explode('###BOM###',$string);
|
list($bin, $code) = explode('###BOM###', $string);
|
||||||
$string = $php.$bom.$code;
|
$string = $php . $bom . $code;
|
||||||
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
|
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
|
||||||
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
|
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
|
||||||
// add to zip array
|
// add to zip array
|
||||||
$this->writeFile($file['path'],$answer);
|
$this->writeFile($file['path'], $answer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
|
$answer = $this->setPlaceholders($string, $this->fileContentStatic, 3);
|
||||||
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
|
$answer = $this->setPlaceholders($answer, $this->fileContentDynamic[$view], 3);
|
||||||
// add to zip array
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,7 +304,7 @@ class Compiler extends Infusion
|
|||||||
// move the update server to host
|
// move the update server to host
|
||||||
if ($this->componentData->add_update_server == 1 && $this->componentData->update_server_target == 1 && isset($this->updateServerFileName) && $this->dynamicIntegration)
|
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
|
// make sure we have the correct file
|
||||||
if (JFile::exists($xml_update_server_path) && isset($this->componentData->update_server_ftp))
|
if (JFile::exists($xml_update_server_path) && isset($this->componentData->update_server_ftp))
|
||||||
{
|
{
|
||||||
@ -289,7 +318,7 @@ class Compiler extends Infusion
|
|||||||
$this->componentData->update_server_ftp = rtrim($basic->decryptString($this->componentData->update_server_ftp), "\0");
|
$this->componentData->update_server_ftp = rtrim($basic->decryptString($this->componentData->update_server_ftp), "\0");
|
||||||
}
|
}
|
||||||
// now move the file
|
// 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -313,7 +342,7 @@ class Compiler extends Infusion
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$value = '@update number '.$value.' of this MVC';
|
$value = '@update number ' . $value . ' of this MVC';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->fileContentStatic[$key] = $value;
|
$this->fileContentStatic[$key] = $value;
|
||||||
@ -330,32 +359,32 @@ class Compiler extends Infusion
|
|||||||
protected function setCountingStuff()
|
protected function setCountingStuff()
|
||||||
{
|
{
|
||||||
// what is the size in terms of an A4 book
|
// 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
|
// setup the unrealistic numbers
|
||||||
$this->folderSeconds = $this->folderCount * 5;
|
$this->folderSeconds = $this->folderCount * 5;
|
||||||
$this->fileSeconds = $this->fileCount * 5;
|
$this->fileSeconds = $this->fileCount * 5;
|
||||||
$this->lineSeconds = $this->lineCount * 10;
|
$this->lineSeconds = $this->lineCount * 10;
|
||||||
$this->seconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds;
|
$this->seconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds;
|
||||||
$this->totalHours = round($this->seconds / 3600);
|
$this->totalHours = round($this->seconds / 3600);
|
||||||
$this->totalDays = round($this->totalHours / 8);
|
$this->totalDays = round($this->totalHours / 8);
|
||||||
// setup the more realistic numbers
|
// setup the more realistic numbers
|
||||||
$this->secondsDebugging = $this->seconds / 4;
|
$this->secondsDebugging = $this->seconds / 4;
|
||||||
$this->secondsPlanning = $this->seconds / 7;
|
$this->secondsPlanning = $this->seconds / 7;
|
||||||
$this->secondsMapping = $this->seconds / 10;
|
$this->secondsMapping = $this->seconds / 10;
|
||||||
$this->secondsOffice = $this->seconds / 6;
|
$this->secondsOffice = $this->seconds / 6;
|
||||||
$this->actualSeconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds + $this->secondsDebugging + $this->secondsPlanning + $this->secondsMapping + $this->secondsOffice;
|
$this->actualSeconds = $this->folderSeconds + $this->fileSeconds + $this->lineSeconds + $this->secondsDebugging + $this->secondsPlanning + $this->secondsMapping + $this->secondsOffice;
|
||||||
$this->actualTotalHours = round($this->actualSeconds / 3600);
|
$this->actualTotalHours = round($this->actualSeconds / 3600);
|
||||||
$this->actualTotalDays = round($this->actualTotalHours / 8);
|
$this->actualTotalDays = round($this->actualTotalHours / 8);
|
||||||
$this->debuggingHours = round($this->secondsDebugging / 3600);
|
$this->debuggingHours = round($this->secondsDebugging / 3600);
|
||||||
$this->planningHours = round($this->secondsPlanning / 3600);
|
$this->planningHours = round($this->secondsPlanning / 3600);
|
||||||
$this->mappingHours = round($this->secondsMapping / 3600);
|
$this->mappingHours = round($this->secondsMapping / 3600);
|
||||||
$this->officeHours = round($this->secondsOffice / 3600);
|
$this->officeHours = round($this->secondsOffice / 3600);
|
||||||
// the actual time spent
|
// the actual time spent
|
||||||
$this->actualHoursSpent = $this->actualTotalHours - $this->totalHours;
|
$this->actualHoursSpent = $this->actualTotalHours - $this->totalHours;
|
||||||
$this->actualDaysSpent = $this->actualTotalDays - $this->totalDays;
|
$this->actualDaysSpent = $this->actualTotalDays - $this->totalDays;
|
||||||
// calculate the projects actual time frame of completion
|
// calculate the projects actual time frame of completion
|
||||||
$this->projectWeekTime = round($this->actualTotalDays / 5,1);
|
$this->projectWeekTime = round($this->actualTotalDays / 5, 1);
|
||||||
$this->projectMonthTime = round($this->actualTotalDays / 24,1);
|
$this->projectMonthTime = round($this->actualTotalDays / 24, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildReadMe()
|
private function buildReadMe()
|
||||||
@ -389,44 +418,45 @@ class Compiler extends Infusion
|
|||||||
// update the file
|
// update the file
|
||||||
$answer = $this->setPlaceholders($string, $this->fileContentStatic);
|
$answer = $this->setPlaceholders($string, $this->fileContentStatic);
|
||||||
// add to zip array
|
// add to zip array
|
||||||
$this->writeFile($path,$answer);
|
$this->writeFile($path, $answer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildReadMeData()
|
private function buildReadMeData()
|
||||||
{
|
{
|
||||||
// set some defaults
|
// set some defaults
|
||||||
$this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount;
|
$this->fileContentStatic['###LINE_COUNT###'] = $this->lineCount;
|
||||||
$this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount;
|
$this->fileContentStatic['###FIELD_COUNT###'] = $this->fieldCount;
|
||||||
$this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount;
|
$this->fileContentStatic['###FILE_COUNT###'] = $this->fileCount;
|
||||||
$this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount;
|
$this->fileContentStatic['###FOLDER_COUNT###'] = $this->folderCount;
|
||||||
$this->fileContentStatic['###folders###'] = $this->folderSeconds;
|
$this->fileContentStatic['###PAGE_COUNT###'] = $this->pageCount;
|
||||||
$this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds;
|
$this->fileContentStatic['###folders###'] = $this->folderSeconds;
|
||||||
$this->fileContentStatic['###files###'] = $this->fileSeconds;
|
$this->fileContentStatic['###foldersSeconds###'] = $this->folderSeconds;
|
||||||
$this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds;
|
$this->fileContentStatic['###files###'] = $this->fileSeconds;
|
||||||
$this->fileContentStatic['###lines###'] = $this->lineSeconds;
|
$this->fileContentStatic['###filesSeconds###'] = $this->fileSeconds;
|
||||||
$this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds;
|
$this->fileContentStatic['###lines###'] = $this->lineSeconds;
|
||||||
$this->fileContentStatic['###seconds###'] = $this->actualSeconds;
|
$this->fileContentStatic['###linesSeconds###'] = $this->lineSeconds;
|
||||||
$this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds;
|
$this->fileContentStatic['###seconds###'] = $this->actualSeconds;
|
||||||
$this->fileContentStatic['###totalHours###'] = $this->totalHours;
|
$this->fileContentStatic['###actualSeconds###'] = $this->actualSeconds;
|
||||||
$this->fileContentStatic['###totalDays###'] = $this->totalDays;
|
$this->fileContentStatic['###totalHours###'] = $this->totalHours;
|
||||||
$this->fileContentStatic['###debugging###'] = $this->secondsDebugging;
|
$this->fileContentStatic['###totalDays###'] = $this->totalDays;
|
||||||
$this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging;
|
$this->fileContentStatic['###debugging###'] = $this->secondsDebugging;
|
||||||
$this->fileContentStatic['###planning###'] = $this->secondsPlanning;
|
$this->fileContentStatic['###secondsDebugging###'] = $this->secondsDebugging;
|
||||||
$this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning;
|
$this->fileContentStatic['###planning###'] = $this->secondsPlanning;
|
||||||
$this->fileContentStatic['###mapping###'] = $this->secondsMapping;
|
$this->fileContentStatic['###secondsPlanning###'] = $this->secondsPlanning;
|
||||||
$this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping;
|
$this->fileContentStatic['###mapping###'] = $this->secondsMapping;
|
||||||
$this->fileContentStatic['###office###'] = $this->secondsOffice;
|
$this->fileContentStatic['###secondsMapping###'] = $this->secondsMapping;
|
||||||
$this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice;
|
$this->fileContentStatic['###office###'] = $this->secondsOffice;
|
||||||
$this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours;
|
$this->fileContentStatic['###secondsOffice###'] = $this->secondsOffice;
|
||||||
$this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays;
|
$this->fileContentStatic['###actualTotalHours###'] = $this->actualTotalHours;
|
||||||
$this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours;
|
$this->fileContentStatic['###actualTotalDays###'] = $this->actualTotalDays;
|
||||||
$this->fileContentStatic['###planningHours###'] = $this->planningHours;
|
$this->fileContentStatic['###debuggingHours###'] = $this->debuggingHours;
|
||||||
$this->fileContentStatic['###mappingHours###'] = $this->mappingHours;
|
$this->fileContentStatic['###planningHours###'] = $this->planningHours;
|
||||||
$this->fileContentStatic['###officeHours###'] = $this->officeHours;
|
$this->fileContentStatic['###mappingHours###'] = $this->mappingHours;
|
||||||
$this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent;
|
$this->fileContentStatic['###officeHours###'] = $this->officeHours;
|
||||||
$this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent;
|
$this->fileContentStatic['###actualHoursSpent###'] = $this->actualHoursSpent;
|
||||||
$this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime;
|
$this->fileContentStatic['###actualDaysSpent###'] = $this->actualDaysSpent;
|
||||||
$this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime;
|
$this->fileContentStatic['###projectWeekTime###'] = $this->projectWeekTime;
|
||||||
|
$this->fileContentStatic['###projectMonthTime###'] = $this->projectMonthTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function zipComponent()
|
private function zipComponent()
|
||||||
@ -435,14 +465,14 @@ class Compiler extends Infusion
|
|||||||
if (ComponentbuilderHelper::checkString($this->repoPath))
|
if (ComponentbuilderHelper::checkString($this->repoPath))
|
||||||
{
|
{
|
||||||
// set the repo path
|
// 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
|
// remove old data
|
||||||
$this->removeFolder($repoFullPath, $this->componentData->toignore);
|
$this->removeFolder($repoFullPath, $this->componentData->toignore);
|
||||||
// set the new data
|
// set the new data
|
||||||
JFolder::copy($this->componentPath, $repoFullPath, '', true);
|
JFolder::copy($this->componentPath, $repoFullPath, '', true);
|
||||||
}
|
}
|
||||||
// the name of the zip file to create
|
// 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
|
//create the zip file
|
||||||
if (ComponentbuilderHelper::zip($this->componentPath, $this->filepath))
|
if (ComponentbuilderHelper::zip($this->componentPath, $this->filepath))
|
||||||
@ -469,7 +499,7 @@ class Compiler extends Infusion
|
|||||||
$this->componentData->sales_server_ftp = rtrim($basic->decryptString($this->componentData->sales_server_ftp), "\0");
|
$this->componentData->sales_server_ftp = rtrim($basic->decryptString($this->componentData->sales_server_ftp), "\0");
|
||||||
}
|
}
|
||||||
// now move the file
|
// 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
|
// remove the component folder since we are done
|
||||||
@ -489,7 +519,7 @@ class Compiler extends Infusion
|
|||||||
if ($ftp instanceof JClientFtp && $ftp->isConnected())
|
if ($ftp instanceof JClientFtp && $ftp->isConnected())
|
||||||
{
|
{
|
||||||
// move the file
|
// move the file
|
||||||
if ($ftp->store($localPath,$remote))
|
if ($ftp->store($localPath, $remote))
|
||||||
{
|
{
|
||||||
// if moved then remove the file from repository
|
// if moved then remove the file from repository
|
||||||
if ($removeLocal)
|
if ($removeLocal)
|
||||||
@ -554,35 +584,33 @@ class Compiler extends Infusion
|
|||||||
// reset all these
|
// reset all these
|
||||||
$this->clearFromPlaceHolders('view');
|
$this->clearFromPlaceHolders('view');
|
||||||
$this->clearFromPlaceHolders('arg');
|
$this->clearFromPlaceHolders('arg');
|
||||||
foreach($this->customCode as $nr => $target)
|
foreach ($this->customCode as $nr => $target)
|
||||||
{
|
{
|
||||||
// reset each time per custom code
|
// reset each time per custom code
|
||||||
$fingerPrint = array();
|
$fingerPrint = array();
|
||||||
if (isset($target['hashtarget'][0]) && $target['hashtarget'][0] > 3
|
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]))
|
||||||
&& isset($target['path']) && ComponentbuilderHelper::checkString($target['path'])
|
|
||||||
&& isset($target['hashtarget'][1]) && ComponentbuilderHelper::checkString($target['hashtarget'][1]))
|
|
||||||
{
|
{
|
||||||
$file = $this->componentPath . '/'. $target['path'];
|
$file = $this->componentPath . '/' . $target['path'];
|
||||||
$size = (int) $target['hashtarget'][0];
|
$size = (int) $target['hashtarget'][0];
|
||||||
$hash = $target['hashtarget'][1];
|
$hash = $target['hashtarget'][1];
|
||||||
$cut = $size - 1;
|
$cut = $size - 1;
|
||||||
$found = false;
|
$found = false;
|
||||||
$bites = 0;
|
$bites = 0;
|
||||||
$lineBites = array();
|
$lineBites = array();
|
||||||
$replace = array();
|
$replace = array();
|
||||||
if ($target['type'] == 1 && isset($target['hashendtarget'][0]) && $target['hashendtarget'][0] > 0)
|
if ($target['type'] == 1 && isset($target['hashendtarget'][0]) && $target['hashendtarget'][0] > 0)
|
||||||
{
|
{
|
||||||
$foundEnd = false;
|
$foundEnd = false;
|
||||||
$sizeEnd = (int) $target['hashendtarget'][0];
|
$sizeEnd = (int) $target['hashendtarget'][0];
|
||||||
$hashEnd = $target['hashendtarget'][1];
|
$hashEnd = $target['hashendtarget'][1];
|
||||||
$cutEnd = $sizeEnd - 1;
|
$cutEnd = $sizeEnd - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// replace to the end of the file
|
// replace to the end of the file
|
||||||
$foundEnd = true;
|
$foundEnd = true;
|
||||||
}
|
}
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
// check if file exist
|
// check if file exist
|
||||||
if (JFile::exists($file))
|
if (JFile::exists($file))
|
||||||
{
|
{
|
||||||
@ -602,12 +630,12 @@ class Compiler extends Infusion
|
|||||||
// check lines each time if it fits our target
|
// check lines each time if it fits our target
|
||||||
if (count($fingerPrint) === $sizeEnd && !$foundEnd)
|
if (count($fingerPrint) === $sizeEnd && !$foundEnd)
|
||||||
{
|
{
|
||||||
$fingerTest = md5(implode('',$fingerPrint));
|
$fingerTest = md5(implode('', $fingerPrint));
|
||||||
if ($fingerTest === $hashEnd)
|
if ($fingerTest === $hashEnd)
|
||||||
{
|
{
|
||||||
// we are done here
|
// we are done here
|
||||||
$foundEnd = true;
|
$foundEnd = true;
|
||||||
$replace = array_slice($replace, 0, count($replace)-$sizeEnd);
|
$replace = array_slice($replace, 0, count($replace) - $sizeEnd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -626,7 +654,7 @@ class Compiler extends Infusion
|
|||||||
// check lines each time if it fits our target
|
// check lines each time if it fits our target
|
||||||
if (count($fingerPrint) === $size && !$found)
|
if (count($fingerPrint) === $size && !$found)
|
||||||
{
|
{
|
||||||
$fingerTest = md5(implode('',$fingerPrint));
|
$fingerTest = md5(implode('', $fingerPrint));
|
||||||
if ($fingerTest === $hash)
|
if ($fingerTest === $hash)
|
||||||
{
|
{
|
||||||
// we are done here
|
// we are done here
|
||||||
@ -647,8 +675,8 @@ class Compiler extends Infusion
|
|||||||
}
|
}
|
||||||
if ($found)
|
if ($found)
|
||||||
{
|
{
|
||||||
$placeholder = $this->getPlaceHolder((int) $target['comment_type'].$target['type'], $target['id']);
|
$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;
|
$data = $placeholder['start'] . PHP_EOL . $this->setPlaceholders($target['code'], $this->placeholders) . $placeholder['end'] . PHP_EOL;
|
||||||
if ($target['type'] == 2)
|
if ($target['type'] == 2)
|
||||||
{
|
{
|
||||||
// found it now add code from the next line
|
// found it now add code from the next line
|
||||||
@ -699,12 +727,12 @@ class Compiler extends Infusion
|
|||||||
$code = explode(PHP_EOL, $target['code']);
|
$code = explode(PHP_EOL, $target['code']);
|
||||||
$code = PHP_EOL . $commentType . implode($_commentType . PHP_EOL . $commentType, $code) . $_commentType . PHP_EOL;
|
$code = PHP_EOL . $commentType . implode($_commentType . PHP_EOL . $commentType, $code) . $_commentType . PHP_EOL;
|
||||||
// get place holders
|
// 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
|
// build the data
|
||||||
$data = $placeholder['start'] . $code . $placeholder['end']. PHP_EOL;
|
$data = $placeholder['start'] . $code . $placeholder['end'] . PHP_EOL;
|
||||||
// get the bites before insertion
|
// get the bites before insertion
|
||||||
$bitBucket = array();
|
$bitBucket = array();
|
||||||
foreach($lineBites as $line => $value)
|
foreach ($lineBites as $line => $value)
|
||||||
{
|
{
|
||||||
if ($line < $target['from_line'])
|
if ($line < $target['from_line'])
|
||||||
{
|
{
|
||||||
@ -745,4 +773,5 @@ class Compiler extends Infusion
|
|||||||
|
|
||||||
// any help to improve this is welcome...
|
// any help to improve this is welcome...
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,27 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
/**--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
|
||||||
__ __ _ _____ _ _ __ __ _ _ _
|
|
||||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
|
||||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
|
||||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
|
||||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
|
||||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
|
||||||
| |
|
|
||||||
|_|
|
|
||||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
|
||||||
|
|
||||||
@version 2.6.0
|
/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||||
@created 30th April, 2015
|
__ __ _ _____ _ _ __ __ _ _ _
|
||||||
@package Component Builder
|
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||||
@subpackage compiler.php
|
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||||
@my wife Roline van der Merwe <http://www.vdm.io/>
|
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||||
@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
|
@version 2.6.x
|
||||||
|
@created 30th April, 2015
|
||||||
|
@package Component Builder
|
||||||
|
@subpackage compiler.php
|
||||||
|
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||||
|
@my wife Roline van der Merwe <http://www.vdm.io/>
|
||||||
|
@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
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
@ -31,6 +32,7 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
*/
|
*/
|
||||||
class Structure extends Get
|
class Structure extends Get
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The foulder counter
|
* The foulder counter
|
||||||
*
|
*
|
||||||
@ -59,6 +61,13 @@ class Structure extends Get
|
|||||||
*/
|
*/
|
||||||
public $lineCount = 0;
|
public $lineCount = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The field counter
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $fieldCount = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The seconds counter
|
* The seconds counter
|
||||||
*
|
*
|
||||||
@ -307,7 +316,7 @@ class Structure extends Get
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
public function __construct($config = array ())
|
public function __construct($config = array())
|
||||||
{
|
{
|
||||||
// first we run the perent constructor
|
// first we run the perent constructor
|
||||||
if (parent::__construct($config))
|
if (parent::__construct($config))
|
||||||
@ -315,24 +324,24 @@ class Structure extends Get
|
|||||||
// run global updater
|
// run global updater
|
||||||
ComponentbuilderHelper::runGlobalUpdater();
|
ComponentbuilderHelper::runGlobalUpdater();
|
||||||
// set the Joomla version
|
// set the Joomla version
|
||||||
$this->joomlaVersion = $config['joomlaVersion'];
|
$this->joomlaVersion = $config['joomlaVersion'];
|
||||||
// set the template path
|
// set the template path
|
||||||
$this->templatePath = $this->compilerPath.'/joomla_'.$config['joomlaVersion'];
|
$this->templatePath = $this->compilerPath . '/joomla_' . $config['joomlaVersion'];
|
||||||
// set some default names
|
// set some default names
|
||||||
$this->componentSalesName = 'com_'.$this->componentData->sales_name.'__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->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->componentFolderName = 'com_' . $this->componentData->name_code . '_v' . str_replace('.', '_', $this->componentData->component_version) . '__J' . $this->joomlaVersion;
|
||||||
|
|
||||||
// set component folder path
|
// set component folder path
|
||||||
$this->componentPath = $this->compilerPath.'/'.$this->componentFolderName;
|
$this->componentPath = $this->compilerPath . '/' . $this->componentFolderName;
|
||||||
// set the template path for custom
|
// 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
|
// make sure there is no old build
|
||||||
$this->removeFolder($this->componentPath);
|
$this->removeFolder($this->componentPath);
|
||||||
// load the libraries files/folders and url's
|
// load the libraries files/folders and url's
|
||||||
$this->setLibaries();
|
$this->setLibaries();
|
||||||
// set the Joomla Version Data
|
// set the Joomla Version Data
|
||||||
$this->joomlaVersionData = $this->setJoomlaVersionData();
|
$this->joomlaVersionData = $this->setJoomlaVersionData();
|
||||||
// set the new folders
|
// set the new folders
|
||||||
if (!$this->setFolders())
|
if (!$this->setFolders())
|
||||||
{
|
{
|
||||||
@ -365,7 +374,7 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
if ($this->debugLinenr)
|
if ($this->debugLinenr)
|
||||||
{
|
{
|
||||||
return ' [Structure '.$nr.']';
|
return ' [Structure ' . $nr . ']';
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -389,14 +398,14 @@ class Structure extends Get
|
|||||||
$this->indexHTML('');
|
$this->indexHTML('');
|
||||||
}
|
}
|
||||||
// create media path if not set
|
// create media path if not set
|
||||||
if (!JFolder::exists( $this->componentPath . '/media'))
|
if (!JFolder::exists($this->componentPath . '/media'))
|
||||||
{
|
{
|
||||||
JFolder::create($this->componentPath . '/media');
|
JFolder::create($this->componentPath . '/media');
|
||||||
// count the folder created
|
// count the folder created
|
||||||
$this->folderCount++;
|
$this->folderCount++;
|
||||||
$this->indexHTML('/media');
|
$this->indexHTML('/media');
|
||||||
}
|
}
|
||||||
foreach($this->libraries as $id => &$library)
|
foreach ($this->libraries as $id => &$library)
|
||||||
{
|
{
|
||||||
if (ComponentbuilderHelper::checkObject($library))
|
if (ComponentbuilderHelper::checkObject($library))
|
||||||
{
|
{
|
||||||
@ -422,7 +431,7 @@ class Structure extends Get
|
|||||||
if (isset($library->urls) && ComponentbuilderHelper::checkArray($library->urls))
|
if (isset($library->urls) && ComponentbuilderHelper::checkArray($library->urls))
|
||||||
{
|
{
|
||||||
// build media folder path
|
// 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;
|
$mediaPath = '/media/' . $libFolder;
|
||||||
// should we add the local folder
|
// should we add the local folder
|
||||||
$addLocalFolder = false;
|
$addLocalFolder = false;
|
||||||
@ -432,7 +441,7 @@ class Structure extends Get
|
|||||||
if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) && ComponentbuilderHelper::checkString($url['url']))
|
if (isset($url['type']) && $url['type'] > 1 && isset($url['url']) && ComponentbuilderHelper::checkString($url['url']))
|
||||||
{
|
{
|
||||||
// create media/lib path if not set
|
// create media/lib path if not set
|
||||||
if (!JFolder::exists( $this->componentPath . $mediaPath))
|
if (!JFolder::exists($this->componentPath . $mediaPath))
|
||||||
{
|
{
|
||||||
JFolder::create($this->componentPath . $mediaPath);
|
JFolder::create($this->componentPath . $mediaPath);
|
||||||
// count the folder created
|
// count the folder created
|
||||||
@ -484,7 +493,7 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = '';
|
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] = '';
|
||||||
}
|
}
|
||||||
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL."\t\t<folder>".$libFolder."</folder>";
|
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $libFolder . "</folder>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if config fields are found load into component config (avoiding dublicates)
|
// if config fields are found load into component config (avoiding dublicates)
|
||||||
@ -492,7 +501,8 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
foreach ($library->config as $cofig)
|
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'];
|
return $item['field'] == $cofig['field'];
|
||||||
});
|
});
|
||||||
// set the config data if not found
|
// set the config data if not found
|
||||||
@ -539,9 +549,9 @@ class Structure extends Get
|
|||||||
// now build all folders needed for this component
|
// now build all folders needed for this component
|
||||||
foreach ($this->joomlaVersionData->create as $main => $folders)
|
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
|
// count the folder created
|
||||||
$this->folderCount++;
|
$this->folderCount++;
|
||||||
$this->indexHTML($main);
|
$this->indexHTML($main);
|
||||||
@ -550,79 +560,79 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
foreach ($folders as $sub => $subFolders)
|
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
|
// count the folder created
|
||||||
$this->folderCount++;
|
$this->folderCount++;
|
||||||
$this->indexHTML($main.'/'.$sub);
|
$this->indexHTML($main . '/' . $sub);
|
||||||
}
|
}
|
||||||
if (ComponentbuilderHelper::checkObject($subFolders))
|
if (ComponentbuilderHelper::checkObject($subFolders))
|
||||||
{
|
{
|
||||||
foreach ($subFolders as $sub_2 => $subFolders_2)
|
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
|
// count the folder created
|
||||||
$this->folderCount++;
|
$this->folderCount++;
|
||||||
$this->indexHTML($main.'/'.$sub.'/'.$sub_2);
|
$this->indexHTML($main . '/' . $sub . '/' . $sub_2);
|
||||||
}
|
}
|
||||||
if (ComponentbuilderHelper::checkObject($subFolders_2))
|
if (ComponentbuilderHelper::checkObject($subFolders_2))
|
||||||
{
|
{
|
||||||
foreach ($subFolders_2 as $sub_3 => $subFolders_3)
|
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
|
// count the folder created
|
||||||
$this->folderCount++;
|
$this->folderCount++;
|
||||||
$this->indexHTML($main.'/'.$sub.'/'.$sub_2.'/'.$sub_3);
|
$this->indexHTML($main . '/' . $sub . '/' . $sub_2 . '/' . $sub_3);
|
||||||
}
|
}
|
||||||
if (ComponentbuilderHelper::checkObject($subFolders_3))
|
if (ComponentbuilderHelper::checkObject($subFolders_3))
|
||||||
{
|
{
|
||||||
foreach ($subFolders_3 as $sub_4 => $subFolders_4)
|
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
|
// count the folder created
|
||||||
$this->folderCount++;
|
$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))
|
if (ComponentbuilderHelper::checkObject($subFolders_4))
|
||||||
{
|
{
|
||||||
foreach ($subFolders_4 as $sub_5 => $subFolders_5)
|
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
|
// count the folder created
|
||||||
$this->folderCount++;
|
$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))
|
if (ComponentbuilderHelper::checkObject($subFolders_5))
|
||||||
{
|
{
|
||||||
foreach ($subFolders_5 as $sub_6 => $subFolders_6)
|
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
|
// count the folder created
|
||||||
$this->folderCount++;
|
$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))
|
if (ComponentbuilderHelper::checkObject($subFolders_6))
|
||||||
{
|
{
|
||||||
foreach ($subFolders_6 as $sub_7 => $subFolders_7)
|
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
|
// count the folder created
|
||||||
$this->folderCount++;
|
$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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -661,7 +671,7 @@ class Structure extends Get
|
|||||||
// do license check
|
// do license check
|
||||||
$LICENSE = false;
|
$LICENSE = false;
|
||||||
$licenseChecker = strtolower($this->componentData->license);
|
$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;
|
$LICENSE = true;
|
||||||
}
|
}
|
||||||
@ -704,27 +714,27 @@ class Structure extends Get
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// set destination path
|
// set destination path
|
||||||
$zipPath = str_replace('c0mp0n3nt/','', $details->path);
|
$zipPath = str_replace('c0mp0n3nt/', '', $details->path);
|
||||||
$path = str_replace('c0mp0n3nt/',$this->componentPath.'/', $details->path);
|
$path = str_replace('c0mp0n3nt/', $this->componentPath . '/', $details->path);
|
||||||
// set the template folder path
|
// set the template folder path
|
||||||
$templatePath = (isset($details->custom) && $details->custom) ? $this->templatePathCustom : $this->templatePath;
|
$templatePath = (isset($details->custom) && $details->custom) ? $this->templatePathCustom : $this->templatePath;
|
||||||
// now mov the file
|
// now mov the file
|
||||||
if ($details->type === 'file')
|
if ($details->type === 'file')
|
||||||
{
|
{
|
||||||
// move the file to its place
|
// move the file to its place
|
||||||
JFile::copy($templatePath.'/'.$item, $path.'/'.$new);
|
JFile::copy($templatePath . '/' . $item, $path . '/' . $new);
|
||||||
// count the file created
|
// count the file created
|
||||||
$this->fileCount++;
|
$this->fileCount++;
|
||||||
// store the new files
|
// 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')
|
elseif ($details->type === 'folder')
|
||||||
{
|
{
|
||||||
// move the folder to its place
|
// move the folder to its place
|
||||||
JFolder::copy($templatePath.'/'.$item, $path.'/'.$new);
|
JFolder::copy($templatePath . '/' . $item, $path . '/' . $new);
|
||||||
// count the folder created
|
// count the folder created
|
||||||
$this->folderCount++;
|
$this->folderCount++;
|
||||||
}
|
}
|
||||||
@ -748,7 +758,7 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
// setup dashboard
|
// setup dashboard
|
||||||
$target = array('admin' => $this->componentData->name_code);
|
$target = array('admin' => $this->componentData->name_code);
|
||||||
$this->buildDynamique($target,'dashboard');
|
$this->buildDynamique($target, 'dashboard');
|
||||||
// now the rest of the views
|
// now the rest of the views
|
||||||
foreach ($this->componentData->admin_views as $nr => $view)
|
foreach ($this->componentData->admin_views as $nr => $view)
|
||||||
{
|
{
|
||||||
@ -759,21 +769,21 @@ class Structure extends Get
|
|||||||
if ($view['settings']->name_list != 'null')
|
if ($view['settings']->name_list != 'null')
|
||||||
{
|
{
|
||||||
$target = array('admin' => $view['settings']->name_list);
|
$target = array('admin' => $view['settings']->name_list);
|
||||||
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version);
|
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
|
||||||
$this->buildDynamique($target,'list', false, $config);
|
$this->buildDynamique($target, 'list', false, $config);
|
||||||
}
|
}
|
||||||
if ($view['settings']->name_single != 'null')
|
if ($view['settings']->name_single != 'null')
|
||||||
{
|
{
|
||||||
$target = array('admin' => $view['settings']->name_single);
|
$target = array('admin' => $view['settings']->name_single);
|
||||||
$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);
|
$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
|
// setup the front site edit-view files
|
||||||
$target = array('site' => $view['settings']->name_single);
|
$target = array('site' => $view['settings']->name_single);
|
||||||
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified,'###VERSION###' => $view['settings']->version);
|
$config = array('###CREATIONDATE###' => $created, '###BUILDDATE###' => $modified, '###VERSION###' => $view['settings']->version);
|
||||||
$this->buildDynamique($target,'edit', false, $config);
|
$this->buildDynamique($target, 'edit', false, $config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// quick set of checkin once
|
// quick set of checkin once
|
||||||
@ -796,15 +806,15 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
// set list view
|
// set list view
|
||||||
$target = array('site' => $view['settings']->code);
|
$target = array('site' => $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,'list', false, $config);
|
$this->buildDynamique($target, 'list', false, $config);
|
||||||
}
|
}
|
||||||
elseif ($view['settings']->main_get->gettype == 1)
|
elseif ($view['settings']->main_get->gettype == 1)
|
||||||
{
|
{
|
||||||
// set single view
|
// set single view
|
||||||
$target = array('site' => $view['settings']->code);
|
$target = array('site' => $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);
|
$this->buildDynamique($target, 'single', false, $config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$front = true;
|
$front = true;
|
||||||
@ -819,14 +829,14 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
// set list view$view
|
// set list view$view
|
||||||
$target = array('custom_admin' => $view['settings']->code);
|
$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,'list', false, $config);
|
$this->buildDynamique($target, 'list', false, $config);
|
||||||
}
|
}
|
||||||
elseif ($view['settings']->main_get->gettype == 1)
|
elseif ($view['settings']->main_get->gettype == 1)
|
||||||
{
|
{
|
||||||
// set single view
|
// set single view
|
||||||
$target = array('custom_admin' => $view['settings']->code);
|
$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);
|
$this->buildDynamique($target, 'single', false, $config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -874,9 +884,7 @@ class Structure extends Get
|
|||||||
public function getLastModifiedDate($view)
|
public function getLastModifiedDate($view)
|
||||||
{
|
{
|
||||||
// first set the main date
|
// first set the main date
|
||||||
if (isset($view['settings']->modified)
|
if (isset($view['settings']->modified) && ComponentbuilderHelper::checkString($view['settings']->modified) && '0000-00-00 00:00:00' !== $view['settings']->modified)
|
||||||
&& ComponentbuilderHelper::checkString($view['settings']->modified)
|
|
||||||
&& '0000-00-00 00:00:00' !== $view['settings']->modified)
|
|
||||||
{
|
{
|
||||||
$date = strtotime($view['settings']->modified);
|
$date = strtotime($view['settings']->modified);
|
||||||
}
|
}
|
||||||
@ -888,7 +896,7 @@ class Structure extends Get
|
|||||||
// search for the last modified date
|
// search for the last modified date
|
||||||
if (isset($view['adminview']))
|
if (isset($view['adminview']))
|
||||||
{
|
{
|
||||||
$id = $view['adminview'].'admin';
|
$id = $view['adminview'] . 'admin';
|
||||||
// now check if value has been set
|
// now check if value has been set
|
||||||
if (!isset($this->lastModifiedDate[$id]))
|
if (!isset($this->lastModifiedDate[$id]))
|
||||||
{
|
{
|
||||||
@ -896,9 +904,7 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
foreach ($view['settings']->fields as $field)
|
foreach ($view['settings']->fields as $field)
|
||||||
{
|
{
|
||||||
if (isset($field['settings']) && ComponentbuilderHelper::checkObject($field['settings'])
|
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)
|
||||||
&& isset($field['settings']->modified) && ComponentbuilderHelper::checkString($field['settings']->modified)
|
|
||||||
&& '0000-00-00 00:00:00' !== $field['settings']->modified)
|
|
||||||
{
|
{
|
||||||
$anotherDate = strtotime($field['settings']->modified);
|
$anotherDate = strtotime($field['settings']->modified);
|
||||||
if ($anotherDate > $date)
|
if ($anotherDate > $date)
|
||||||
@ -912,13 +918,11 @@ class Structure extends Get
|
|||||||
}
|
}
|
||||||
elseif (isset($view['siteview']))
|
elseif (isset($view['siteview']))
|
||||||
{
|
{
|
||||||
$id = $view['siteview'].'site';
|
$id = $view['siteview'] . 'site';
|
||||||
// now check if value has been set
|
// now check if value has been set
|
||||||
if (!isset($this->lastModifiedDate[$id]))
|
if (!isset($this->lastModifiedDate[$id]))
|
||||||
{
|
{
|
||||||
if (isset($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)
|
||||||
&& 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);
|
$anotherDate = strtotime($view['settings']->main_get->modified);
|
||||||
if ($anotherDate > $date)
|
if ($anotherDate > $date)
|
||||||
@ -930,13 +934,11 @@ class Structure extends Get
|
|||||||
}
|
}
|
||||||
elseif (isset($view['customadminview']))
|
elseif (isset($view['customadminview']))
|
||||||
{
|
{
|
||||||
$id = $view['customadminview'].'customadmin';
|
$id = $view['customadminview'] . 'customadmin';
|
||||||
// now check if value has been set
|
// now check if value has been set
|
||||||
if (!isset($this->lastModifiedDate[$id]))
|
if (!isset($this->lastModifiedDate[$id]))
|
||||||
{
|
{
|
||||||
if (isset($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)
|
||||||
&& 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);
|
$anotherDate = strtotime($view['settings']->main_get->modified);
|
||||||
if ($anotherDate > $date)
|
if ($anotherDate > $date)
|
||||||
@ -975,7 +977,7 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
if (ComponentbuilderHelper::checkArray($target))
|
if (ComponentbuilderHelper::checkArray($target))
|
||||||
{
|
{
|
||||||
foreach ($target as $main => $name)
|
foreach ($target as $main => $name)
|
||||||
{
|
{
|
||||||
// make sure it is lower case
|
// make sure it is lower case
|
||||||
$name = ComponentbuilderHelper::safeString($name);
|
$name = ComponentbuilderHelper::safeString($name);
|
||||||
@ -985,17 +987,17 @@ class Structure extends Get
|
|||||||
if ($details->type == $type)
|
if ($details->type == $type)
|
||||||
{
|
{
|
||||||
// set destination path
|
// set destination path
|
||||||
$path = '';
|
$path = '';
|
||||||
if (strpos($details->path,'VIEW') !== false)
|
if (strpos($details->path, 'VIEW') !== false)
|
||||||
{
|
{
|
||||||
$path = str_replace('VIEW',$name,$details->path);
|
$path = str_replace('VIEW', $name, $details->path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$path = $details->path;
|
$path = $details->path;
|
||||||
}
|
}
|
||||||
$zipPath = str_replace('c0mp0n3nt/','', $path);
|
$zipPath = str_replace('c0mp0n3nt/', '', $path);
|
||||||
$path = str_replace('c0mp0n3nt/',$this->componentPath.'/', $path);
|
$path = str_replace('c0mp0n3nt/', $this->componentPath . '/', $path);
|
||||||
|
|
||||||
// setup the folder
|
// setup the folder
|
||||||
if (!JFolder::exists($path))
|
if (!JFolder::exists($path))
|
||||||
@ -1011,7 +1013,7 @@ class Structure extends Get
|
|||||||
if ($fileName)
|
if ($fileName)
|
||||||
{
|
{
|
||||||
$new = str_replace($details->rename, $fileName, $item);
|
$new = str_replace($details->rename, $fileName, $item);
|
||||||
$name = $name.'_'.$fileName;
|
$name = $name . '_' . $fileName;
|
||||||
}
|
}
|
||||||
elseif ($details->rename === 'new')
|
elseif ($details->rename === 'new')
|
||||||
{
|
{
|
||||||
@ -1026,15 +1028,15 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
$new = $item;
|
$new = $item;
|
||||||
}
|
}
|
||||||
if (!JFile::exists($path.'/'.$new))
|
if (!JFile::exists($path . '/' . $new))
|
||||||
{
|
{
|
||||||
// move the file to its place
|
// 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
|
// count the file created
|
||||||
$this->fileCount++;
|
$this->fileCount++;
|
||||||
}
|
}
|
||||||
// setup array for new file
|
// 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))
|
if (ComponentbuilderHelper::checkArray($config))
|
||||||
{
|
{
|
||||||
$newFIle['config'] = $config;
|
$newFIle['config'] = $config;
|
||||||
@ -1059,41 +1061,41 @@ class Structure extends Get
|
|||||||
private function setJoomlaVersionData()
|
private function setJoomlaVersionData()
|
||||||
{
|
{
|
||||||
// set the version data
|
// 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
|
// add custom folders
|
||||||
if ((isset($this->componentData->folders) && ComponentbuilderHelper::checkArray($this->componentData->folders)) || $this->addEximport || $this->uikit || $this->footable)
|
if ((isset($this->componentData->folders) && ComponentbuilderHelper::checkArray($this->componentData->folders)) || $this->addEximport || $this->uikit || $this->footable)
|
||||||
{
|
{
|
||||||
if ($this->addEximport)
|
if ($this->addEximport)
|
||||||
{
|
{
|
||||||
// move the import view folder in place
|
// 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;
|
$this->componentData->folders[] = $importView;
|
||||||
// move the PHPExel Folder
|
// 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;
|
$this->componentData->folders[] = $PHPExcel;
|
||||||
}
|
}
|
||||||
if (2 == $this->uikit || 1 == $this->uikit)
|
if (2 == $this->uikit || 1 == $this->uikit)
|
||||||
{
|
{
|
||||||
// move the UIKIT Folder into place
|
// 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;
|
$this->componentData->folders[] = $uikit;
|
||||||
}
|
}
|
||||||
if (2 == $this->uikit || 3 == $this->uikit)
|
if (2 == $this->uikit || 3 == $this->uikit)
|
||||||
{
|
{
|
||||||
// move the UIKIT-3 Folder into place
|
// 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;
|
$this->componentData->folders[] = $uikit;
|
||||||
}
|
}
|
||||||
if ($this->footable && (!isset($this->footableVersion) || 2 == $this->footableVersion))
|
if ($this->footable && (!isset($this->footableVersion) || 2 == $this->footableVersion))
|
||||||
{
|
{
|
||||||
// move the footable folder into place
|
// 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;
|
$this->componentData->folders[] = $footable;
|
||||||
}
|
}
|
||||||
elseif ($this->footable && 3 == $this->footableVersion)
|
elseif ($this->footable && 3 == $this->footableVersion)
|
||||||
{
|
{
|
||||||
// move the footable folder into place
|
// 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;
|
$this->componentData->folders[] = $footable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1105,16 +1107,16 @@ class Structure extends Get
|
|||||||
$custom['path'] = rtrim($custom['path'], '/');
|
$custom['path'] = rtrim($custom['path'], '/');
|
||||||
$custom['path'] = ltrim($custom['path'], '/');
|
$custom['path'] = ltrim($custom['path'], '/');
|
||||||
// make sure we use the correct name
|
// make sure we use the correct name
|
||||||
$pathArray = (array) explode('/',$custom['path']);
|
$pathArray = (array) explode('/', $custom['path']);
|
||||||
$firstFolder = array_values($pathArray)[0];
|
$firstFolder = array_values($pathArray)[0];
|
||||||
$lastFolder = end($pathArray);
|
$lastFolder = end($pathArray);
|
||||||
// only rename folder if last has folder name
|
// only rename folder if last has folder name
|
||||||
if (isset($custom['rename']) && $custom['rename'] == 1)
|
if (isset($custom['rename']) && $custom['rename'] == 1)
|
||||||
{
|
{
|
||||||
$custom['path'] = str_replace('/'.$lastFolder,'',$custom['path']);
|
$custom['path'] = str_replace('/' . $lastFolder, '', $custom['path']);
|
||||||
$rename = 'new';
|
$rename = 'new';
|
||||||
$newname = $lastFolder;
|
$newname = $lastFolder;
|
||||||
if(($tkey = array_search($lastFolder, $pathArray)) !== false)
|
if (($tkey = array_search($lastFolder, $pathArray)) !== false)
|
||||||
{
|
{
|
||||||
unset($pathArray[$tkey]);
|
unset($pathArray[$tkey]);
|
||||||
}
|
}
|
||||||
@ -1132,7 +1134,7 @@ class Structure extends Get
|
|||||||
}
|
}
|
||||||
if (count($pathArray) == 1 && $firstFolder === 'media')
|
if (count($pathArray) == 1 && $firstFolder === 'media')
|
||||||
{
|
{
|
||||||
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL."\t\t<folder>".$lastFolder."</folder>";
|
$this->fileContentStatic['###EXSTRA_MEDIA_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
|
||||||
}
|
}
|
||||||
// check if we sould add it to the site xml list
|
// check if we sould add it to the site xml list
|
||||||
if (!isset($this->fileContentStatic['###EXSTRA_SITE_FOLDERS###']))
|
if (!isset($this->fileContentStatic['###EXSTRA_SITE_FOLDERS###']))
|
||||||
@ -1141,7 +1143,7 @@ class Structure extends Get
|
|||||||
}
|
}
|
||||||
if (count($pathArray) == 1 && $firstFolder === 'site')
|
if (count($pathArray) == 1 && $firstFolder === 'site')
|
||||||
{
|
{
|
||||||
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= PHP_EOL."\t\t<folder>".$lastFolder."</folder>";
|
$this->fileContentStatic['###EXSTRA_SITE_FOLDERS###'] .= PHP_EOL . "\t\t<folder>" . $lastFolder . "</folder>";
|
||||||
}
|
}
|
||||||
// check if we sould add it to the admin xml list
|
// check if we sould add it to the admin xml list
|
||||||
if (!isset($this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###']))
|
if (!isset($this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###']))
|
||||||
@ -1150,15 +1152,15 @@ class Structure extends Get
|
|||||||
}
|
}
|
||||||
if (count($pathArray) == 1 && $firstFolder === 'admin')
|
if (count($pathArray) == 1 && $firstFolder === 'admin')
|
||||||
{
|
{
|
||||||
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL."\t\t\t<folder>".$lastFolder."</folder>";
|
$this->fileContentStatic['###EXSTRA_ADMIN_FOLDERS###'] .= PHP_EOL . "\t\t\t<folder>" . $lastFolder . "</folder>";
|
||||||
}
|
}
|
||||||
// make we have not duplicates
|
// 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++;
|
$pointer_tracker++;
|
||||||
// set new folder to object
|
// set new folder to object
|
||||||
$versionData->move->static->$key_pointer = new stdClass();
|
$versionData->move->static->$key_pointer = new stdClass();
|
||||||
$versionData->move->static->$key_pointer->naam = $custom['folder'];
|
$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->rename = $rename;
|
||||||
$versionData->move->static->$key_pointer->newName = $newname;
|
$versionData->move->static->$key_pointer->newName = $newname;
|
||||||
$versionData->move->static->$key_pointer->type = 'folder';
|
$versionData->move->static->$key_pointer->type = 'folder';
|
||||||
@ -1173,15 +1175,15 @@ class Structure extends Get
|
|||||||
if ($this->addEximport)
|
if ($this->addEximport)
|
||||||
{
|
{
|
||||||
// move the PHPExel main file
|
// 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;
|
$this->componentData->files[] = $PHPExcel;
|
||||||
}
|
}
|
||||||
if ($this->googlechart)
|
if ($this->googlechart)
|
||||||
{
|
{
|
||||||
// move the google chart files
|
// 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;
|
$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;
|
$this->componentData->files[] = $googleChart;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1190,7 +1192,7 @@ class Structure extends Get
|
|||||||
foreach ($this->componentData->files as $custom)
|
foreach ($this->componentData->files as $custom)
|
||||||
{
|
{
|
||||||
// make we have not duplicates
|
// 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++;
|
$pointer_tracker++;
|
||||||
// set new file to object
|
// set new file to object
|
||||||
$versionData->move->static->$key_pointer = new stdClass();
|
$versionData->move->static->$key_pointer = new stdClass();
|
||||||
@ -1201,7 +1203,7 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
$pathInfo['dirname'] = rtrim($pathInfo['dirname'], '/');
|
$pathInfo['dirname'] = rtrim($pathInfo['dirname'], '/');
|
||||||
$pathInfo['dirname'] = ltrim($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->rename = 'new';
|
||||||
$versionData->move->static->$key_pointer->newName = $pathInfo['basename'];
|
$versionData->move->static->$key_pointer->newName = $pathInfo['basename'];
|
||||||
// set the name
|
// set the name
|
||||||
@ -1211,7 +1213,7 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
$custom['path'] = rtrim($custom['path'], '/');
|
$custom['path'] = rtrim($custom['path'], '/');
|
||||||
$custom['path'] = ltrim($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;
|
$versionData->move->static->$key_pointer->rename = false;
|
||||||
// set the name
|
// set the name
|
||||||
$name = $custom['file'];
|
$name = $custom['file'];
|
||||||
@ -1242,13 +1244,13 @@ class Structure extends Get
|
|||||||
{
|
{
|
||||||
if (strlen($path) > 0)
|
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
|
// count the file created
|
||||||
$this->fileCount++;
|
$this->fileCount++;
|
||||||
}
|
}
|
||||||
else
|
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
|
// count the file created
|
||||||
$this->fileCount++;
|
$this->fileCount++;
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
<?php
|
<?php
|
||||||
/**--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
|
||||||
__ __ _ _____ _ _ __ __ _ _ _
|
|
||||||
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
|
||||||
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
|
||||||
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
|
||||||
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
|
||||||
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
|
||||||
| |
|
|
||||||
|_|
|
|
||||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
|
||||||
|
|
||||||
@version 2.6.0
|
/* --------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||||
@created 30th April, 2015
|
__ __ _ _____ _ _ __ __ _ _ _
|
||||||
@package Component Builder
|
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||||
@subpackage compiler.php
|
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||||
@author Llewellyn van der Merwe <http://www.vdm.io>
|
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||||
@my wife Roline van der Merwe <http://www.vdm.io/>
|
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||||
@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
|
@version 2.6.x
|
||||||
|
@created 30th April, 2015
|
||||||
|
@package Component Builder
|
||||||
|
@subpackage compiler.php
|
||||||
|
@author Llewellyn van der Merwe <http://www.vdm.io>
|
||||||
|
@my wife Roline van der Merwe <http://www.vdm.io/>
|
||||||
|
@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
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
@ -31,12 +32,12 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
*/
|
*/
|
||||||
class Fields extends Structure
|
class Fields extends Structure
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metadate Switch
|
* Metadate Switch
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public $metadataBuilder = array();
|
public $metadataBuilder = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -289,7 +290,7 @@ class Fields extends Structure
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
public $selectionTranslationFixBuilder = array();
|
public $selectionTranslationFixBuilder = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sort Builder
|
* Sort Builder
|
||||||
@ -366,7 +367,7 @@ class Fields extends Structure
|
|||||||
{
|
{
|
||||||
if ($this->debugLinenr)
|
if ($this->debugLinenr)
|
||||||
{
|
{
|
||||||
return ' [Fields '.$nr.']';
|
return ' [Fields ' . $nr . ']';
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -487,60 +488,68 @@ class Fields extends Structure
|
|||||||
if (!isset($this->fieldsNames[$viewName]['id']))
|
if (!isset($this->fieldsNames[$viewName]['id']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'id',
|
'name' => 'id',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'class' => 'readonly',
|
'class' => 'readonly',
|
||||||
'label' => 'JGLOBAL_FIELD_ID_LABEL',
|
'label' => 'JGLOBAL_FIELD_ID_LABEL',
|
||||||
'description' => 'JGLOBAL_FIELD_ID_DESC',
|
'description' => 'JGLOBAL_FIELD_ID_DESC',
|
||||||
'size' => 10,
|
'size' => 10,
|
||||||
'default' => 0
|
'default' => 0
|
||||||
);
|
);
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// if created is not set
|
// if created is not set
|
||||||
if (!isset($this->fieldsNames[$viewName]['created']))
|
if (!isset($this->fieldsNames[$viewName]['created']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'created',
|
'name' => 'created',
|
||||||
'type' => 'calendar',
|
'type' => 'calendar',
|
||||||
'label' => $langView . '_CREATED_DATE_LABEL',
|
'label' => $langView . '_CREATED_DATE_LABEL',
|
||||||
'description' => $langView . '_CREATED_DATE_DESC',
|
'description' => $langView . '_CREATED_DATE_DESC',
|
||||||
'size' => 22,
|
'size' => 22,
|
||||||
'format' => '%Y-%m-%d %H:%M:%S',
|
'format' => '%Y-%m-%d %H:%M:%S',
|
||||||
'filter' => 'user_utc'
|
'filter' => 'user_utc'
|
||||||
);
|
);
|
||||||
$attributes = array_merge($attributes, $readOnlyXML);
|
$attributes = array_merge($attributes, $readOnlyXML);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Created Field. Type: Calendar (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Created Field. Type: Calendar (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// if created_by is not set
|
// if created_by is not set
|
||||||
if (!isset($this->fieldsNames[$viewName]['created_by']))
|
if (!isset($this->fieldsNames[$viewName]['created_by']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'created_by',
|
'name' => 'created_by',
|
||||||
'type' => 'user',
|
'type' => 'user',
|
||||||
'label' => $langView . '_CREATED_BY_LABEL',
|
'label' => $langView . '_CREATED_BY_LABEL',
|
||||||
'description' => $langView . '_CREATED_BY_DESC',
|
'description' => $langView . '_CREATED_BY_DESC',
|
||||||
);
|
);
|
||||||
$attributes = array_merge($attributes, $readOnlyXML);
|
$attributes = array_merge($attributes, $readOnlyXML);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Created Field. Type: User (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Created Field. Type: User (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// if published is not set
|
// if published is not set
|
||||||
if (!isset($this->fieldsNames[$viewName]['published']))
|
if (!isset($this->fieldsNames[$viewName]['published']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'published',
|
'name' => 'published',
|
||||||
'type' => 'list',
|
'type' => 'list',
|
||||||
'label' => 'JSTATUS'
|
'label' => 'JSTATUS'
|
||||||
);
|
);
|
||||||
$attributes = array_merge($attributes, $readOnlyXML);
|
$attributes = array_merge($attributes, $readOnlyXML);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Published Field. Type: List (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Published Field. Type: List (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
foreach (array('JPUBLISHED' => 1, 'JUNPUBLISHED' => 0, 'JARCHIVED' => 2, 'JTRASHED' => -2) as $text => $value)
|
foreach (array('JPUBLISHED' => 1, 'JUNPUBLISHED' => 0, 'JARCHIVED' => 2, 'JTRASHED' => -2) as $text => $value)
|
||||||
{
|
{
|
||||||
$optionXML = $fieldXML->addChild('option');
|
$optionXML = $fieldXML->addChild('option');
|
||||||
@ -552,102 +561,114 @@ class Fields extends Structure
|
|||||||
if (!isset($this->fieldsNames[$viewName]['modified']))
|
if (!isset($this->fieldsNames[$viewName]['modified']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'modified',
|
'name' => 'modified',
|
||||||
'type' => 'calendar',
|
'type' => 'calendar',
|
||||||
'class' => 'readonly',
|
'class' => 'readonly',
|
||||||
'label' => $langView . '_MODIFIED_DATE_LABEL',
|
'label' => $langView . '_MODIFIED_DATE_LABEL',
|
||||||
'description' => $langView . '_MODIFIED_DATE_DESC',
|
'description' => $langView . '_MODIFIED_DATE_DESC',
|
||||||
'size' => 22,
|
'size' => 22,
|
||||||
'readonly' => "true",
|
'readonly' => "true",
|
||||||
'format' => '%Y-%m-%d %H:%M:%S',
|
'format' => '%Y-%m-%d %H:%M:%S',
|
||||||
'filter' => 'user_utc'
|
'filter' => 'user_utc'
|
||||||
);
|
);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Modified Field. Type: Calendar (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Date Modified Field. Type: Calendar (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// if modified_by is not set
|
// if modified_by is not set
|
||||||
if (!isset($this->fieldsNames[$viewName]['modified_by']))
|
if (!isset($this->fieldsNames[$viewName]['modified_by']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'modified_by',
|
'name' => 'modified_by',
|
||||||
'type' => 'user',
|
'type' => 'user',
|
||||||
'label' => $langView . '_MODIFIED_BY_LABEL',
|
'label' => $langView . '_MODIFIED_BY_LABEL',
|
||||||
'description' => $langView . '_MODIFIED_BY_DESC',
|
'description' => $langView . '_MODIFIED_BY_DESC',
|
||||||
'class' => 'readonly',
|
'class' => 'readonly',
|
||||||
'readonly' => 'true',
|
'readonly' => 'true',
|
||||||
'filter' => 'unset'
|
'filter' => 'unset'
|
||||||
);
|
);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Modified Field. Type: User (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " User Modified Field. Type: User (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// check if view has access
|
// check if view has access
|
||||||
if (isset($this->accessBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName]) && !isset($this->fieldsNames[$viewName]['access']))
|
if (isset($this->accessBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->accessBuilder[$viewName]) && !isset($this->fieldsNames[$viewName]['access']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'access',
|
'name' => 'access',
|
||||||
'type' => 'accesslevel',
|
'type' => 'accesslevel',
|
||||||
'label' => 'JFIELD_ACCESS_LABEL',
|
'label' => 'JFIELD_ACCESS_LABEL',
|
||||||
'description' => 'JFIELD_ACCESS_DESC',
|
'description' => 'JFIELD_ACCESS_DESC',
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
'required' => "false"
|
'required' => "false"
|
||||||
);
|
);
|
||||||
$attributes = array_merge($attributes, $readOnlyXML);
|
$attributes = array_merge($attributes, $readOnlyXML);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Access Field. Type: Accesslevel (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Access Field. Type: Accesslevel (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// if ordering is not set
|
// if ordering is not set
|
||||||
if (!isset($this->fieldsNames[$viewName]['ordering']))
|
if (!isset($this->fieldsNames[$viewName]['ordering']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'ordering',
|
'name' => 'ordering',
|
||||||
'type' => 'number',
|
'type' => 'number',
|
||||||
'class' => 'inputbox validate-ordering',
|
'class' => 'inputbox validate-ordering',
|
||||||
'label' => $langView . '_ORDERING_LABEL',
|
'label' => $langView . '_ORDERING_LABEL',
|
||||||
'description' => '',
|
'description' => '',
|
||||||
'default' => 0,
|
'default' => 0,
|
||||||
'size' => 6,
|
'size' => 6,
|
||||||
'required' => "false"
|
'required' => "false"
|
||||||
);
|
);
|
||||||
$attributes = array_merge($attributes, $readOnlyXML);
|
$attributes = array_merge($attributes, $readOnlyXML);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Ordering Field. Type: Numbers (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Ordering Field. Type: Numbers (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// if version is not set
|
// if version is not set
|
||||||
if (!isset($this->fieldsNames[$viewName]['version']))
|
if (!isset($this->fieldsNames[$viewName]['version']))
|
||||||
{
|
{
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'version',
|
'name' => 'version',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'class' => 'readonly',
|
'class' => 'readonly',
|
||||||
'label' => $langView . '_VERSION_LABEL',
|
'label' => $langView . '_VERSION_LABEL',
|
||||||
'description' => $langView . '_VERSION_DESC',
|
'description' => $langView . '_VERSION_DESC',
|
||||||
'size' => 6,
|
'size' => 6,
|
||||||
'readonly' => "true",
|
'readonly' => "true",
|
||||||
'filter' => 'unset'
|
'filter' => 'unset'
|
||||||
);
|
);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Version Field. Type: Text (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// check if metadata is added to this view
|
// check if metadata is added to this view
|
||||||
if (isset($this->metadataBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$viewName]))
|
if (isset($this->metadataBuilder[$viewName]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$viewName]))
|
||||||
{
|
{
|
||||||
// metakey
|
// metakey
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'metakey',
|
'name' => 'metakey',
|
||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
'label' => 'JFIELD_META_KEYWORDS_LABEL',
|
'label' => 'JFIELD_META_KEYWORDS_LABEL',
|
||||||
'description' => 'JFIELD_META_KEYWORDS_DESC',
|
'description' => 'JFIELD_META_KEYWORDS_DESC',
|
||||||
'rows' => 3,
|
'rows' => 3,
|
||||||
'cols' => 30
|
'cols' => 30
|
||||||
);
|
);
|
||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
// metadesc
|
// metadesc
|
||||||
$attributes['name'] = 'metadesc';
|
$attributes['name'] = 'metadesc';
|
||||||
$attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL';
|
$attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL';
|
||||||
@ -655,6 +676,8 @@ class Fields extends Structure
|
|||||||
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla)");
|
$this->xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla)");
|
||||||
$fieldXML = $fieldSetXML->addChild('field');
|
$fieldXML = $fieldSetXML->addChild('field');
|
||||||
$this->xmlAddAttributes($fieldXML, $attributes);
|
$this->xmlAddAttributes($fieldXML, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// load the dynamic fields now
|
// load the dynamic fields now
|
||||||
if (count($dynamicFieldsXML))
|
if (count($dynamicFieldsXML))
|
||||||
@ -679,18 +702,20 @@ class Fields extends Structure
|
|||||||
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)");
|
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)");
|
||||||
$robots = $fieldsFieldSetXML->addChild('field');
|
$robots = $fieldsFieldSetXML->addChild('field');
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'robots',
|
'name' => 'robots',
|
||||||
'type' => 'list',
|
'type' => 'list',
|
||||||
'label' => 'JFIELD_METADATA_ROBOTS_LABEL',
|
'label' => 'JFIELD_METADATA_ROBOTS_LABEL',
|
||||||
'description' => 'JFIELD_METADATA_ROBOTS_DESC'
|
'description' => 'JFIELD_METADATA_ROBOTS_DESC'
|
||||||
);
|
);
|
||||||
$this->xmlAddAttributes($robots, $attributes);
|
$this->xmlAddAttributes($robots, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
$options = array(
|
$options = array(
|
||||||
'JGLOBAL_USE_GLOBAL' => '',
|
'JGLOBAL_USE_GLOBAL' => '',
|
||||||
'JGLOBAL_INDEX_FOLLOW' => 'index, follow',
|
'JGLOBAL_INDEX_FOLLOW' => 'index, follow',
|
||||||
'JGLOBAL_NOINDEX_FOLLOW' => 'noindex, follow',
|
'JGLOBAL_NOINDEX_FOLLOW' => 'noindex, follow',
|
||||||
'JGLOBAL_INDEX_NOFOLLOW' => 'index, nofollow',
|
'JGLOBAL_INDEX_NOFOLLOW' => 'index, nofollow',
|
||||||
'JGLOBAL_NOINDEX_NOFOLLOW' => 'noindex, nofollow',
|
'JGLOBAL_NOINDEX_NOFOLLOW' => 'noindex, nofollow',
|
||||||
);
|
);
|
||||||
foreach ($options as $text => $value)
|
foreach ($options as $text => $value)
|
||||||
{
|
{
|
||||||
@ -702,27 +727,31 @@ class Fields extends Structure
|
|||||||
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)");
|
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)");
|
||||||
$author = $fieldsFieldSetXML->addChild('field');
|
$author = $fieldsFieldSetXML->addChild('field');
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'author',
|
'name' => 'author',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'label' => 'JAUTHOR',
|
'label' => 'JAUTHOR',
|
||||||
'description' => 'JFIELD_METADATA_AUTHOR_DESC',
|
'description' => 'JFIELD_METADATA_AUTHOR_DESC',
|
||||||
'size' => 20
|
'size' => 20
|
||||||
);
|
);
|
||||||
$this->xmlAddAttributes($author, $attributes);
|
$this->xmlAddAttributes($author, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
// rights
|
// rights
|
||||||
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)");
|
$this->xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)");
|
||||||
$rights = $fieldsFieldSetXML->addChild('field');
|
$rights = $fieldsFieldSetXML->addChild('field');
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'name' => 'rights',
|
'name' => 'rights',
|
||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
'label' => 'JFIELD_META_RIGHTS_LABEL',
|
'label' => 'JFIELD_META_RIGHTS_LABEL',
|
||||||
'description' => 'JFIELD_META_RIGHTS_DESC',
|
'description' => 'JFIELD_META_RIGHTS_DESC',
|
||||||
'required' => 'false',
|
'required' => 'false',
|
||||||
'filter' => 'string',
|
'filter' => 'string',
|
||||||
'cols' => 30,
|
'cols' => 30,
|
||||||
'rows' => 2
|
'rows' => 2
|
||||||
);
|
);
|
||||||
$this->xmlAddAttributes($rights, $attributes);
|
$this->xmlAddAttributes($rights, $attributes);
|
||||||
|
// count the static field created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
// just to be safe, lets clear the view placeholders
|
// just to be safe, lets clear the view placeholders
|
||||||
$this->clearFromPlaceHolders('view');
|
$this->clearFromPlaceHolders('view');
|
||||||
@ -779,7 +808,7 @@ class Fields extends Structure
|
|||||||
if (ComponentbuilderHelper::checkArray($fieldAttributes))
|
if (ComponentbuilderHelper::checkArray($fieldAttributes))
|
||||||
{
|
{
|
||||||
// set the array of field names
|
// set the array of field names
|
||||||
$this->setFieldsNames($viewName,$fieldAttributes['name']);
|
$this->setFieldsNames($viewName, $fieldAttributes['name']);
|
||||||
|
|
||||||
if ($this->defaultField($typeName, 'option'))
|
if ($this->defaultField($typeName, 'option'))
|
||||||
{
|
{
|
||||||
@ -1108,9 +1137,9 @@ class Fields extends Structure
|
|||||||
{
|
{
|
||||||
$form = $field->fieldXML->addChild('form');
|
$form = $field->fieldXML->addChild('form');
|
||||||
$attributes = array(
|
$attributes = array(
|
||||||
'hidden' => 'true',
|
'hidden' => 'true',
|
||||||
'name' => 'list_' . $fieldAttributes['name'] . '_modal',
|
'name' => 'list_' . $fieldAttributes['name'] . '_modal',
|
||||||
'repeat' => 'true'
|
'repeat' => 'true'
|
||||||
);
|
);
|
||||||
$this->xmlAddAttributes($form, $attributes);
|
$this->xmlAddAttributes($form, $attributes);
|
||||||
|
|
||||||
@ -1220,7 +1249,7 @@ class Fields extends Structure
|
|||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function setLayoutBuilder(&$viewName,&$tabName,&$name,&$field)
|
public function setLayoutBuilder(&$viewName, &$tabName, &$name, &$field)
|
||||||
{
|
{
|
||||||
// first fix the zero order
|
// first fix the zero order
|
||||||
// to insure it lands before all the other fields
|
// to insure it lands before all the other fields
|
||||||
@ -1310,14 +1339,14 @@ class Fields extends Structure
|
|||||||
*/
|
*/
|
||||||
public function buildSiteFieldData($view, $field, $set, $type)
|
public function buildSiteFieldData($view, $field, $set, $type)
|
||||||
{
|
{
|
||||||
$decode = array('json','base64','basic_encryption','advance_encryption');
|
$decode = array('json', 'base64', 'basic_encryption', 'advance_encryption');
|
||||||
$textareas = array('textarea','editor');
|
$textareas = array('textarea', 'editor');
|
||||||
if (isset($this->siteFields[$view][$field]) && ComponentbuilderHelper::checkArray($this->siteFields[$view][$field]))
|
if (isset($this->siteFields[$view][$field]) && ComponentbuilderHelper::checkArray($this->siteFields[$view][$field]))
|
||||||
{
|
{
|
||||||
foreach ($this->siteFields[$view][$field] as $code => $array)
|
foreach ($this->siteFields[$view][$field] as $code => $array)
|
||||||
{
|
{
|
||||||
// set the decoding methods
|
// 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);
|
$this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']] = array('decode' => $set, 'type' => $type);
|
||||||
}
|
}
|
||||||
@ -1438,9 +1467,9 @@ class Fields extends Structure
|
|||||||
if (ComponentbuilderHelper::checkString($otherName) && ComponentbuilderHelper::checkString($otherViews) && ComponentbuilderHelper::checkString($otherView))
|
if (ComponentbuilderHelper::checkString($otherName) && ComponentbuilderHelper::checkString($otherViews) && ComponentbuilderHelper::checkString($otherView))
|
||||||
{
|
{
|
||||||
$this->catOtherName[$listViewName] = array(
|
$this->catOtherName[$listViewName] = array(
|
||||||
'name' => ComponentbuilderHelper::safeString($otherName),
|
'name' => ComponentbuilderHelper::safeString($otherName),
|
||||||
'views' => ComponentbuilderHelper::safeString($otherViews),
|
'views' => ComponentbuilderHelper::safeString($otherViews),
|
||||||
'view' => ComponentbuilderHelper::safeString($otherView)
|
'view' => ComponentbuilderHelper::safeString($otherView)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1765,7 +1794,7 @@ class Fields extends Structure
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// count how many times the field is used
|
// count how many times the field is used
|
||||||
$this->uniqueNames[$view]['counter'][$name]++;
|
$this->uniqueNames[$view]['counter'][$name] ++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1797,7 +1826,6 @@ class Fields extends Structure
|
|||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set Builders
|
* set Builders
|
||||||
*
|
*
|
||||||
@ -1919,16 +1947,16 @@ class Fields extends Structure
|
|||||||
{
|
{
|
||||||
// load to list builder
|
// load to list builder
|
||||||
$this->listBuilder[$listViewName][] = array(
|
$this->listBuilder[$listViewName][] = array(
|
||||||
'type' => $typeName,
|
'type' => $typeName,
|
||||||
'code' => $name,
|
'code' => $name,
|
||||||
'lang' => $listLangName,
|
'lang' => $listLangName,
|
||||||
'title' => (isset($field['title']) && $field['title']) ? true : false,
|
'title' => (isset($field['title']) && $field['title']) ? true : false,
|
||||||
'alias' => (isset($field['alias']) && $field['alias']) ? true : false,
|
'alias' => (isset($field['alias']) && $field['alias']) ? true : false,
|
||||||
'link' => (isset($field['link']) && $field['link']) ? true : false,
|
'link' => (isset($field['link']) && $field['link']) ? true : false,
|
||||||
'sort' => (isset($field['sort']) && $field['sort']) ? true : false,
|
'sort' => (isset($field['sort']) && $field['sort']) ? true : false,
|
||||||
'custom' => $custom,
|
'custom' => $custom,
|
||||||
'multiple' => $multiple,
|
'multiple' => $multiple,
|
||||||
'options' => $options);
|
'options' => $options);
|
||||||
|
|
||||||
$this->customBuilderList[$listViewName][] = $name;
|
$this->customBuilderList[$listViewName][] = $name;
|
||||||
}
|
}
|
||||||
@ -2128,26 +2156,26 @@ class Fields extends Structure
|
|||||||
public function setCustomFieldTypeFile($data, $viewName_list, $viewName_single)
|
public function setCustomFieldTypeFile($data, $viewName_list, $viewName_single)
|
||||||
{
|
{
|
||||||
// make sure it is not already been build
|
// 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
|
// first build the custom field type file
|
||||||
$target = array('admin' => 'customfield');
|
$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
|
// set tab and break replacements
|
||||||
$tabBreak = array(
|
$tabBreak = array(
|
||||||
'\t' => "\t",
|
'\t' => "\t",
|
||||||
'\n' => PHP_EOL
|
'\n' => PHP_EOL
|
||||||
);
|
);
|
||||||
// make field dynamic
|
// make field dynamic
|
||||||
$replace = array(
|
$replace = array(
|
||||||
'###TABLE###' => $data['custom']['table'],
|
'###TABLE###' => $data['custom']['table'],
|
||||||
'###ID###' => $data['custom']['id'],
|
'###ID###' => $data['custom']['id'],
|
||||||
'###TEXT###' => $data['custom']['text'],
|
'###TEXT###' => $data['custom']['text'],
|
||||||
'###CODE_TEXT###' => $data['code'].'_'.$data['custom']['text'],
|
'###CODE_TEXT###' => $data['code'] . '_' . $data['custom']['text'],
|
||||||
'###CODE###' => $data['code'],
|
'###CODE###' => $data['code'],
|
||||||
'###component###' => $this->fileContentStatic['###component###'],
|
'###component###' => $this->fileContentStatic['###component###'],
|
||||||
'###Component###' => $this->fileContentStatic['###Component###'],
|
'###Component###' => $this->fileContentStatic['###Component###'],
|
||||||
'###view_type###' => $viewName_single.'_'.$data['type'],
|
'###view_type###' => $viewName_single . '_' . $data['type'],
|
||||||
'###type###' => $data['type'],
|
'###type###' => $data['type'],
|
||||||
'###view###' => $viewName_single,
|
'###view###' => $viewName_single,
|
||||||
'###views###' => $viewName_list
|
'###views###' => $viewName_list
|
||||||
@ -2167,7 +2195,7 @@ class Fields extends Structure
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$phpCode .= PHP_EOL."\t\t".$this->setPlaceholders($code, $tabBreak);
|
$phpCode .= PHP_EOL . "\t\t" . $this->setPlaceholders($code, $tabBreak);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2216,30 +2244,30 @@ class Fields extends Structure
|
|||||||
$phpxCode = 'return null;';
|
$phpxCode = 'return null;';
|
||||||
}
|
}
|
||||||
// temp holder for name
|
// temp holder for name
|
||||||
$tempName = $data['custom']['label'].' Group';
|
$tempName = $data['custom']['label'] . ' Group';
|
||||||
// set lang
|
// set lang
|
||||||
$groupLangName = $this->langPrefix.'_'.ComponentbuilderHelper::safeString($tempName,'U');
|
$groupLangName = $this->langPrefix . '_' . ComponentbuilderHelper::safeString($tempName, 'U');
|
||||||
// add to lang array
|
// 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
|
// build the Group Control
|
||||||
$this->setGroupControl[$data['type']] = $groupLangName;
|
$this->setGroupControl[$data['type']] = $groupLangName;
|
||||||
// ###JFORM_GETGROUPS_PHP### <<<DYNAMIC>>>
|
// ###JFORM_GETGROUPS_PHP### <<<DYNAMIC>>>
|
||||||
$this->fileContentDynamic['customfield_'.$data['type']]['###JFORM_GETGROUPS_PHP###'] = $phpCode;
|
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETGROUPS_PHP###'] = $phpCode;
|
||||||
|
|
||||||
// ###JFORM_GETEXCLUDED_PHP### <<<DYNAMIC>>>
|
// ###JFORM_GETEXCLUDED_PHP### <<<DYNAMIC>>>
|
||||||
$this->fileContentDynamic['customfield_'.$data['type']]['###JFORM_GETEXCLUDED_PHP###'] = $phpxCode;
|
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETEXCLUDED_PHP###'] = $phpxCode;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// ###JFORM_GETOPTIONS_PHP### <<<DYNAMIC>>>
|
// ###JFORM_GETOPTIONS_PHP### <<<DYNAMIC>>>
|
||||||
$this->fileContentDynamic['customfield_'.$data['type']]['###JFORM_GETOPTIONS_PHP###'] = $phpCode;
|
$this->fileContentDynamic['customfield_' . $data['type']]['###JFORM_GETOPTIONS_PHP###'] = $phpCode;
|
||||||
}
|
}
|
||||||
// ###Type### <<<DYNAMIC>>>
|
// ###Type### <<<DYNAMIC>>>
|
||||||
$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### <<<DYNAMIC>>>
|
// ###type### <<<DYNAMIC>>>
|
||||||
$this->fileContentDynamic['customfield_'.$data['type']]['###type###'] = $data['custom']['type'];
|
$this->fileContentDynamic['customfield_' . $data['type']]['###type###'] = $data['custom']['type'];
|
||||||
// ###type### <<<DYNAMIC>>>
|
// ###type### <<<DYNAMIC>>>
|
||||||
$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']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2257,35 +2285,35 @@ class Fields extends Structure
|
|||||||
// list of default fields
|
// list of default fields
|
||||||
// https://docs.joomla.org/Form_field
|
// https://docs.joomla.org/Form_field
|
||||||
$defaults = array(
|
$defaults = array(
|
||||||
'default' => array(
|
'default' => array(
|
||||||
'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox',
|
'accesslevel', 'cachehandler', 'calendar', 'captcha', 'category', 'checkbox',
|
||||||
'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor',
|
'checkboxes', 'color', 'combo', 'componentlayout', 'contentlanguage', 'editor',
|
||||||
'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file',
|
'chromestyle', 'contenttype', 'databaseconnection', 'editors', 'email', 'file',
|
||||||
'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite',
|
'filelist', 'folderlist', 'groupedlist', 'hidden', 'file', 'headertag', 'helpsite',
|
||||||
'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password',
|
'imagelist', 'integer', 'language', 'list', 'media', 'menu', 'note', 'number', 'password',
|
||||||
'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag',
|
'plugins', 'radio', 'repeatable', 'range', 'rules', 'subform', 'sessionhandler', 'spacer', 'sql', 'tag',
|
||||||
'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag',
|
'tel', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition', 'moduletag',
|
||||||
'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
|
'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
|
||||||
),
|
),
|
||||||
'plain' => array(
|
'plain' => array(
|
||||||
'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color',
|
'accesslevel', 'checkbox', 'cachehandler', 'calendar', 'category', 'chromestyle', 'color',
|
||||||
'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors',
|
'contenttype', 'combo', 'componentlayout', 'databaseconnection', 'editor', 'editors',
|
||||||
'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite',
|
'email', 'file', 'filelist', 'folderlist', 'headertag', 'helpsite',
|
||||||
'hidden', 'imagelist', 'integer', 'language', 'media', 'menu',
|
'hidden', 'imagelist', 'integer', 'language', 'media', 'menu',
|
||||||
'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules',
|
'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules',
|
||||||
'sessionhandler', 'tag', 'tel', 'text', 'textarea',
|
'sessionhandler', 'tag', 'tel', 'text', 'textarea',
|
||||||
'timezone', 'url', 'user', 'usergroup'
|
'timezone', 'url', 'user', 'usergroup'
|
||||||
),
|
),
|
||||||
'spacer' => array(
|
'spacer' => array(
|
||||||
'note', 'spacer'
|
'note', 'spacer'
|
||||||
),
|
),
|
||||||
'option' => array(
|
'option' => array(
|
||||||
'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql'
|
'plugins', 'checkboxes', 'contentlanguage', 'list', 'radio', 'sql'
|
||||||
),
|
),
|
||||||
'special' => array(
|
'special' => array(
|
||||||
'contentlanguage', 'groupedlist', 'moduleposition', 'plugin',
|
'contentlanguage', 'groupedlist', 'moduleposition', 'plugin',
|
||||||
'repeatable', 'templatestyle', 'subform'
|
'repeatable', 'templatestyle', 'subform'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (in_array($type, $defaults[$option]))
|
if (in_array($type, $defaults[$option]))
|
||||||
@ -2342,7 +2370,8 @@ class Fields extends Structure
|
|||||||
public function xmlAppend(&$xml, $node)
|
public function xmlAppend(&$xml, $node)
|
||||||
{
|
{
|
||||||
if (!$node)
|
if (!$node)
|
||||||
{ // element was not returned
|
{
|
||||||
|
// element was not returned
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (get_class($node))
|
switch (get_class($node))
|
||||||
@ -2364,6 +2393,8 @@ class Fields extends Structure
|
|||||||
$xml = simplexml_import_dom($domXML);
|
$xml = simplexml_import_dom($domXML);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// count the dynamic fields created
|
||||||
|
$this->fieldCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2384,9 +2415,9 @@ class Fields extends Structure
|
|||||||
if ($this->tidy)
|
if ($this->tidy)
|
||||||
{
|
{
|
||||||
$tidy = new 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();
|
$tidy->cleanRepair();
|
||||||
return $this->xmlIndent((string)$tidy,' ',8,true,false);
|
return $this->xmlIndent((string) $tidy, ' ', 8, true, false);
|
||||||
}
|
}
|
||||||
// set tidy waring atleast once
|
// set tidy waring atleast once
|
||||||
elseif (!$this->setTidyWarning)
|
elseif (!$this->setTidyWarning)
|
||||||
@ -2411,18 +2442,18 @@ class Fields extends Structure
|
|||||||
* @return string XML output
|
* @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();
|
$output = array();
|
||||||
$lines = explode("\n",$string);
|
$lines = explode("\n", $string);
|
||||||
$first = true;
|
$first = true;
|
||||||
$last = count($lines)-1;
|
$last = count($lines) - 1;
|
||||||
foreach($lines as $i=>$line)
|
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;
|
$first = false;
|
||||||
}
|
}
|
||||||
return implode("\n",$output);
|
return implode("\n", $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -391,8 +391,12 @@ abstract class ComponentbuilderHelper
|
|||||||
// load document script
|
// load document script
|
||||||
$files[md5($url['path'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LOCAL');
|
$files[md5($url['path'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LOCAL');
|
||||||
}
|
}
|
||||||
// load url also if not building document
|
// check if link must be added
|
||||||
$files[md5($url['url'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LINK');
|
if (isset($url['url']) && ((isset($url['type']) && $url['type'] == 1) || (isset($url['type']) && $url['type'] == 3) || !isset($url['type'])))
|
||||||
|
{
|
||||||
|
// load url also if not building document
|
||||||
|
$files[md5($url['url'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LINK');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -475,7 +479,7 @@ abstract class ComponentbuilderHelper
|
|||||||
// load per path
|
// load per path
|
||||||
foreach($paths as $path)
|
foreach($paths as $path)
|
||||||
{
|
{
|
||||||
$files[md5($root.'/'.trim($path, '/'))] = '(' . JText::_('COM_COMPONENTBUILDER_FOLDER') . ') ' . basename($path);
|
$files[md5($root.'/'.trim($path, '/'))] = '(' . JText::_('COM_COMPONENTBUILDER_FOLDER') . ') ' . basename($path) . ' - ' . basename($root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1842,10 +1846,10 @@ abstract class ComponentbuilderHelper
|
|||||||
/**
|
/**
|
||||||
* Load the Component xml manifest.
|
* Load the Component xml manifest.
|
||||||
**/
|
**/
|
||||||
public static function manifest()
|
public static function manifest()
|
||||||
{
|
{
|
||||||
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_componentbuilder/componentbuilder.xml";
|
$manifestUrl = JPATH_ADMINISTRATOR."/components/com_componentbuilder/componentbuilder.xml";
|
||||||
return simplexml_load_file($manifestUrl);
|
return simplexml_load_file($manifestUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1860,22 +1864,22 @@ abstract class ComponentbuilderHelper
|
|||||||
// get all Contributors (max 20)
|
// get all Contributors (max 20)
|
||||||
$searchArray = range('0','20');
|
$searchArray = range('0','20');
|
||||||
foreach($searchArray as $nr)
|
foreach($searchArray as $nr)
|
||||||
{
|
{
|
||||||
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3))
|
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3))
|
||||||
{
|
{
|
||||||
// set link based of selected option
|
// set link based of selected option
|
||||||
if($params->get("useContributor".$nr) == 1)
|
if($params->get("useContributor".$nr) == 1)
|
||||||
{
|
{
|
||||||
$link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">';
|
$link_front = '<a href="mailto:'.$params->get("emailContributor".$nr).'" target="_blank">';
|
||||||
$link_back = '</a>';
|
$link_back = '</a>';
|
||||||
}
|
}
|
||||||
elseif($params->get("useContributor".$nr) == 2)
|
elseif($params->get("useContributor".$nr) == 2)
|
||||||
{
|
{
|
||||||
$link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">';
|
$link_front = '<a href="'.$params->get("linkContributor".$nr).'" target="_blank">';
|
||||||
$link_back = '</a>';
|
$link_back = '</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$link_front = '';
|
$link_front = '';
|
||||||
$link_back = '';
|
$link_back = '';
|
||||||
}
|
}
|
||||||
@ -1963,10 +1967,10 @@ abstract class ComponentbuilderHelper
|
|||||||
**/
|
**/
|
||||||
public static function addSubmenu($submenu)
|
public static function addSubmenu($submenu)
|
||||||
{
|
{
|
||||||
// load user for access menus
|
// load user for access menus
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
// load the submenus to sidebar
|
// load the submenus to sidebar
|
||||||
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_DASHBOARD'), 'index.php?option=com_componentbuilder&view=componentbuilder', $submenu === 'componentbuilder');
|
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_DASHBOARD'), 'index.php?option=com_componentbuilder&view=componentbuilder', $submenu === 'componentbuilder');
|
||||||
// Access control (compiler.submenu).
|
// Access control (compiler.submenu).
|
||||||
if ($user->authorise('compiler.submenu', 'com_componentbuilder'))
|
if ($user->authorise('compiler.submenu', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
@ -2410,9 +2414,9 @@ abstract class ComponentbuilderHelper
|
|||||||
|
|
||||||
public static function jsonToString($value, $sperator = ", ", $table = null)
|
public static function jsonToString($value, $sperator = ", ", $table = null)
|
||||||
{
|
{
|
||||||
// check if string is JSON
|
// check if string is JSON
|
||||||
$result = json_decode($value, true);
|
$result = json_decode($value, true);
|
||||||
if (json_last_error() === JSON_ERROR_NONE)
|
if (json_last_error() === JSON_ERROR_NONE)
|
||||||
{
|
{
|
||||||
// is JSON
|
// is JSON
|
||||||
if (self::checkArray($result))
|
if (self::checkArray($result))
|
||||||
@ -2434,15 +2438,15 @@ abstract class ComponentbuilderHelper
|
|||||||
}
|
}
|
||||||
return (string) implode($sperator,$result);
|
return (string) implode($sperator,$result);
|
||||||
}
|
}
|
||||||
return (string) json_decode($value);
|
return (string) json_decode($value);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isPublished($id,$type)
|
public static function isPublished($id,$type)
|
||||||
{
|
{
|
||||||
if ($type == 'raw')
|
if ($type == 'raw')
|
||||||
{
|
{
|
||||||
$type = 'item';
|
$type = 'item';
|
||||||
}
|
}
|
||||||
$db = JFactory::getDbo();
|
$db = JFactory::getDbo();
|
||||||
@ -2455,7 +2459,7 @@ abstract class ComponentbuilderHelper
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
$found = $db->getNumRows();
|
$found = $db->getNumRows();
|
||||||
if($found)
|
if($found)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -2472,33 +2476,33 @@ abstract class ComponentbuilderHelper
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
$found = $db->getNumRows();
|
$found = $db->getNumRows();
|
||||||
if($found)
|
if($found)
|
||||||
{
|
{
|
||||||
return $db->loadResult();
|
return $db->loadResult();
|
||||||
}
|
}
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the actions permissions
|
* Get the actions permissions
|
||||||
**/
|
**/
|
||||||
public static function getActions($view,&$record = null,$views = null)
|
public static function getActions($view,&$record = null,$views = null)
|
||||||
{
|
{
|
||||||
jimport('joomla.access.access');
|
jimport('joomla.access.access');
|
||||||
|
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$result = new JObject;
|
$result = new JObject;
|
||||||
$view = self::safeString($view);
|
$view = self::safeString($view);
|
||||||
if (self::checkString($views))
|
if (self::checkString($views))
|
||||||
{
|
{
|
||||||
$views = self::safeString($views);
|
$views = self::safeString($views);
|
||||||
}
|
}
|
||||||
// get all actions from component
|
// get all actions from component
|
||||||
$actions = JAccess::getActions('com_componentbuilder', 'component');
|
$actions = JAccess::getActions('com_componentbuilder', 'component');
|
||||||
// set acctions only set in component settiongs
|
// set acctions only set in component settiongs
|
||||||
$componentActions = array('core.admin','core.manage','core.options','core.export');
|
$componentActions = array('core.admin','core.manage','core.options','core.export');
|
||||||
// loop the actions and set the permissions
|
// loop the actions and set the permissions
|
||||||
foreach ($actions as $action)
|
foreach ($actions as $action)
|
||||||
{
|
{
|
||||||
// set to use component default
|
// set to use component default
|
||||||
$fallback= true;
|
$fallback= true;
|
||||||
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
|
if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions))
|
||||||
@ -2577,17 +2581,17 @@ abstract class ComponentbuilderHelper
|
|||||||
}
|
}
|
||||||
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
|
elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0)
|
||||||
{
|
{
|
||||||
// make sure we use the core. action check for the categories
|
// make sure we use the core. action check for the categories
|
||||||
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
|
if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) {
|
||||||
$coreCheck = explode('.',$action->name);
|
$coreCheck = explode('.',$action->name);
|
||||||
$coreCheck[0] = 'core';
|
$coreCheck[0] = 'core';
|
||||||
$categoryCheck = implode('.',$coreCheck);
|
$categoryCheck = implode('.',$coreCheck);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$categoryCheck = $action->name;
|
$categoryCheck = $action->name;
|
||||||
}
|
}
|
||||||
// The record has a category. Check the category permissions.
|
// The record has a category. Check the category permissions.
|
||||||
$catpermission = $user->authorise($categoryCheck, 'com_componentbuilder.'.$views.'.category.' . (int) $record->catid);
|
$catpermission = $user->authorise($categoryCheck, 'com_componentbuilder.'.$views.'.category.' . (int) $record->catid);
|
||||||
if (!$catpermission && !is_null($catpermission))
|
if (!$catpermission && !is_null($catpermission))
|
||||||
{
|
{
|
||||||
@ -2968,8 +2972,8 @@ abstract class ComponentbuilderHelper
|
|||||||
$string = self::replaceNumbers($string);
|
$string = self::replaceNumbers($string);
|
||||||
}
|
}
|
||||||
// 0nly continue if we have a string
|
// 0nly continue if we have a string
|
||||||
if (self::checkString($string))
|
if (self::checkString($string))
|
||||||
{
|
{
|
||||||
// create file name without the extention that is safe
|
// create file name without the extention that is safe
|
||||||
if ($type === 'filename')
|
if ($type === 'filename')
|
||||||
{
|
{
|
||||||
@ -2992,12 +2996,12 @@ abstract class ComponentbuilderHelper
|
|||||||
$string = preg_replace("/[^A-Za-z ]/", '', $string);
|
$string = preg_replace("/[^A-Za-z ]/", '', $string);
|
||||||
// select final adaptations
|
// select final adaptations
|
||||||
if ($type === 'L' || $type === 'strtolower')
|
if ($type === 'L' || $type === 'strtolower')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// default is to return lower
|
// default is to return lower
|
||||||
return strtolower($string);
|
return strtolower($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'W')
|
elseif ($type === 'W')
|
||||||
{
|
{
|
||||||
// return a string with all first letter of each word uppercase(no undersocre)
|
// return a string with all first letter of each word uppercase(no undersocre)
|
||||||
@ -3018,21 +3022,21 @@ abstract class ComponentbuilderHelper
|
|||||||
// return a string with all the uppercase(no undersocre)
|
// return a string with all the uppercase(no undersocre)
|
||||||
return strtoupper($string);
|
return strtoupper($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'U' || $type === 'strtoupper')
|
elseif ($type === 'U' || $type === 'strtoupper')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// return all upper
|
// return all upper
|
||||||
return strtoupper($string);
|
return strtoupper($string);
|
||||||
}
|
}
|
||||||
elseif ($type === 'F' || $type === 'ucfirst')
|
elseif ($type === 'F' || $type === 'ucfirst')
|
||||||
{
|
{
|
||||||
// replace white space with underscore
|
// replace white space with underscore
|
||||||
$string = preg_replace('/\s+/', $spacer, $string);
|
$string = preg_replace('/\s+/', $spacer, $string);
|
||||||
// return with first caracter to upper
|
// return with first caracter to upper
|
||||||
return ucfirst(strtolower($string));
|
return ucfirst(strtolower($string));
|
||||||
}
|
}
|
||||||
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
|
elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
|
||||||
{
|
{
|
||||||
// convert all words to first letter uppercase
|
// convert all words to first letter uppercase
|
||||||
$string = ucwords(strtolower($string));
|
$string = ucwords(strtolower($string));
|
||||||
@ -3041,14 +3045,14 @@ abstract class ComponentbuilderHelper
|
|||||||
// now return first letter lowercase
|
// now return first letter lowercase
|
||||||
return lcfirst($string);
|
return lcfirst($string);
|
||||||
}
|
}
|
||||||
// return string
|
// return string
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
// not a string
|
// not a string
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
||||||
{
|
{
|
||||||
if (self::checkString($var))
|
if (self::checkString($var))
|
||||||
{
|
{
|
||||||
@ -3059,11 +3063,11 @@ abstract class ComponentbuilderHelper
|
|||||||
return self::shorten($string,$length);
|
return self::shorten($string,$length);
|
||||||
}
|
}
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function replaceNumbers($string)
|
public static function replaceNumbers($string)
|
||||||
|
@ -188,7 +188,6 @@ abstract class ComponentbuilderEmail
|
|||||||
// load the bounce email as sender if set
|
// load the bounce email as sender if set
|
||||||
if (!is_null($bounce_email))
|
if (!is_null($bounce_email))
|
||||||
{
|
{
|
||||||
|
|
||||||
$mail->Sender = $bounce_email;
|
$mail->Sender = $bounce_email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -898,6 +898,7 @@ COM_COMPONENTBUILDER_BASIC_TUTORIAL_ON_GIT_BSB="Basic Tutorial on git: <b>%s</b>
|
|||||||
COM_COMPONENTBUILDER_BCUSTOM_FILESB_NOT_MOVE_TO_CORRECT_LOCATION="<b>Custom files</b> not move to correct location!"
|
COM_COMPONENTBUILDER_BCUSTOM_FILESB_NOT_MOVE_TO_CORRECT_LOCATION="<b>Custom files</b> not move to correct location!"
|
||||||
COM_COMPONENTBUILDER_BEHIND="Behind"
|
COM_COMPONENTBUILDER_BEHIND="Behind"
|
||||||
COM_COMPONENTBUILDER_BEHIND_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BOLDER_MODIFIED_DATEB_THEN_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE="Behind means your <b>local snippet</b> (with the same name, library and type) has a <b>older modified date</b> then the community snippet (with the same name, library and type)."
|
COM_COMPONENTBUILDER_BEHIND_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BOLDER_MODIFIED_DATEB_THEN_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE="Behind means your <b>local snippet</b> (with the same name, library and type) has a <b>older modified date</b> then the community snippet (with the same name, library and type)."
|
||||||
|
COM_COMPONENTBUILDER_BETA_RELEASE="Beta Release"
|
||||||
COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE="Be cautious! Do not continue unless you trust the origin of this package!"
|
COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE="Be cautious! Do not continue unless you trust the origin of this package!"
|
||||||
COM_COMPONENTBUILDER_BFIELD_TYPEB_IDS_MISMATCH_IN_BSB="<b>Field type</b> id:%s mismatch in <b>%s</b>."
|
COM_COMPONENTBUILDER_BFIELD_TYPEB_IDS_MISMATCH_IN_BSB="<b>Field type</b> id:%s mismatch in <b>%s</b>."
|
||||||
COM_COMPONENTBUILDER_BFIELD_TYPEB_NOT_SET_FOR_BSB="<b>Field type</b> not set for <b>%s</b>."
|
COM_COMPONENTBUILDER_BFIELD_TYPEB_NOT_SET_FOR_BSB="<b>Field type</b> not set for <b>%s</b>."
|
||||||
@ -2460,6 +2461,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_CSS_LABEL="Add CSS"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CUSTOM_BUTTON="Add Custom Button"
|
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_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="Add Js Document"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)"
|
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"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_DOCUMENT="Add Php Document"
|
||||||
@ -2551,7 +2555,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="Custom Get"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_GET_DESCRIPTION="Select the custom get methods"
|
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_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_DASHBOARD="Dashboard"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DATABASE="Database"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DATABASE="Database"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DEFAULT="Default"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DEFAULT="Default"
|
||||||
@ -2624,6 +2627,11 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_IMAGE="Image"
|
|||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_IMAGES="Images"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_IMAGES="Images"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_INFO="Info"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_INFO="Info"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_INFO_CIRCLE="Info Circle"
|
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_JOOMLA="Joomla"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT="Js Document"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT="Js Document"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_DESCRIPTION="JS script to the document method."
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_DESCRIPTION="JS script to the document method."
|
||||||
@ -2693,6 +2701,7 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PENCIL_TWO="Pencil 2"
|
|||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PERMISSION="Permissions"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PERMISSION="Permissions"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHONE="Phone"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHONE="Phone"
|
||||||
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHONE_TWO="Phone 2"
|
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="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_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"
|
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_CONTROLLER_HINT="// PHP methods for the controller that the button will target"
|
||||||
@ -3410,6 +3419,7 @@ COM_COMPONENTBUILDER_EMOWNEREM_BSB="<em>Owner:</em> <b>%s</b>"
|
|||||||
COM_COMPONENTBUILDER_EMWEBSITEEM_BSB="<em>Website:</em> <b>%s</b>"
|
COM_COMPONENTBUILDER_EMWEBSITEEM_BSB="<em>Website:</em> <b>%s</b>"
|
||||||
COM_COMPONENTBUILDER_EQUAL="Equal"
|
COM_COMPONENTBUILDER_EQUAL="Equal"
|
||||||
COM_COMPONENTBUILDER_EQUAL_MEANS_THAT_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_AND_YOUR_LOCAL_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_THE_SAME_BCREATIONB_AND_BMODIFIED_DATEB="Equal means that the community snippet (with the same name, library and type) and your local snippet (with the same name, library and type) has the same <b>creation</b> and <b>modified date</b>."
|
COM_COMPONENTBUILDER_EQUAL_MEANS_THAT_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_AND_YOUR_LOCAL_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_THE_SAME_BCREATIONB_AND_BMODIFIED_DATEB="Equal means that the community snippet (with the same name, library and type) and your local snippet (with the same name, library and type) has the same <b>creation</b> and <b>modified date</b>."
|
||||||
|
COM_COMPONENTBUILDER_ERROR="Error"
|
||||||
COM_COMPONENTBUILDER_ERROR_THE_PATH_HAS_A_MISMATCH_AND_COULD_THEREFORE_NOT_RETRIEVE_THE_SNIPPET_FROM_GITHUB="Error! The path has a mismatch and could therefore not retrieve the snippet from gitHub!"
|
COM_COMPONENTBUILDER_ERROR_THE_PATH_HAS_A_MISMATCH_AND_COULD_THEREFORE_NOT_RETRIEVE_THE_SNIPPET_FROM_GITHUB="Error! The path has a mismatch and could therefore not retrieve the snippet from gitHub!"
|
||||||
COM_COMPONENTBUILDER_ERROR_THE_SNIPPET_IS_FAULTY_AND_COULD_NOT_BE_SAVED="Error! The snippet is faulty and could not be saved."
|
COM_COMPONENTBUILDER_ERROR_THE_SNIPPET_IS_FAULTY_AND_COULD_NOT_BE_SAVED="Error! The snippet is faulty and could not be saved."
|
||||||
COM_COMPONENTBUILDER_ERROR_YOU_DO_NOT_HAVE_ACCESS_TO_THE_SNIPPETS="Error! You do not have access to the snippets."
|
COM_COMPONENTBUILDER_ERROR_YOU_DO_NOT_HAVE_ACCESS_TO_THE_SNIPPETS="Error! You do not have access to the snippets."
|
||||||
@ -5030,6 +5040,8 @@ COM_COMPONENTBUILDER_LIBRARY_NOTE_BUILD_IN_BEHAVIOUR_TWO_DESCRIPTION="This libra
|
|||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_BUILD_IN_BEHAVIOUR_TWO_LABEL="Build-in Behaviour"
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_BUILD_IN_BEHAVIOUR_TWO_LABEL="Build-in Behaviour"
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_DISPLAY_LIBRARY_CONFIG_DESCRIPTION="<h4>Linked Config Fields <span id='header_library_config_buttons'></span></h4><div id='display_library_config' >Display of the config fields will load here!</div>"
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_DISPLAY_LIBRARY_CONFIG_DESCRIPTION="<h4>Linked Config Fields <span id='header_library_config_buttons'></span></h4><div id='display_library_config' >Display of the config fields will load here!</div>"
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_DISPLAY_LIBRARY_FILES_FOLDERS_URLS_DESCRIPTION="<h4>Linked Files, Folders & URLs <span id='header_library_files_folders_urls_buttons'></span></h4><div id='display_library_files_folders_urls' >Display of the files, folders & urls will load here!</div>"
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_DISPLAY_LIBRARY_FILES_FOLDERS_URLS_DESCRIPTION="<h4>Linked Files, Folders & URLs <span id='header_library_files_folders_urls_buttons'></span></h4><div id='display_library_files_folders_urls' >Display of the files, folders & urls will load here!</div>"
|
||||||
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_LIBRARY_INSTRUCTION_DESCRIPTION="Watch a <a href='https://www.youtube.com/watch?v=rDjvgLYOt1o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE' target='_blank'>tutorial overview</a> of the new library manager concept."
|
||||||
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_LIBRARY_INSTRUCTION_LABEL="Quick overview"
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_ONE_DESCRIPTION="There is no behaviour set for this library. This means JCB will not add any files unless you custom code it in somewhere."
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_ONE_DESCRIPTION="There is no behaviour set for this library. This means JCB will not add any files unless you custom code it in somewhere."
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_ONE_LABEL="No Behaviour"
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_ONE_LABEL="No Behaviour"
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_THREE_DESCRIPTION="There is no behaviour set for this library. This means JCB will not add any files unless you custom code it in somewhere."
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_THREE_DESCRIPTION="There is no behaviour set for this library. This means JCB will not add any files unless you custom code it in somewhere."
|
||||||
@ -5209,6 +5221,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_CSS_LABEL="Add CSS"
|
||||||
COM_COMPONENTBUILDER_SITE_VIEW_ADD_CUSTOM_BUTTON="Add Custom Button"
|
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_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="Add Js Document"
|
||||||
COM_COMPONENTBUILDER_SITE_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)"
|
COM_COMPONENTBUILDER_SITE_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)"
|
||||||
COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_AJAX="Add Php Ajax"
|
COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_AJAX="Add Php Ajax"
|
||||||
@ -5394,6 +5409,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_INPUT_FILTER_LABEL="Select a Filter"
|
||||||
COM_COMPONENTBUILDER_SITE_VIEW_INT="INT"
|
COM_COMPONENTBUILDER_SITE_VIEW_INT="INT"
|
||||||
COM_COMPONENTBUILDER_SITE_VIEW_JAVASCRIPT_CSS="JavaScript & CSS"
|
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_JOOMLA="Joomla"
|
||||||
COM_COMPONENTBUILDER_SITE_VIEW_JS_DOCUMENT="Js Document"
|
COM_COMPONENTBUILDER_SITE_VIEW_JS_DOCUMENT="Js Document"
|
||||||
COM_COMPONENTBUILDER_SITE_VIEW_JS_DOCUMENT_DESCRIPTION="JS script to the document method."
|
COM_COMPONENTBUILDER_SITE_VIEW_JS_DOCUMENT_DESCRIPTION="JS script to the document method."
|
||||||
@ -5825,6 +5844,7 @@ COM_COMPONENTBUILDER_SUBMENU_TEMPLATES="Templates"
|
|||||||
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED="Success! The snippet was saved."
|
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED="Success! The snippet was saved."
|
||||||
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED_BUT_THE_MODIFIED_DATE_COULD_NOT_BE_ADJUSTED_BR_BR_BTHIS_MEANS_THE_SNIPPETS_WILL_CONTINUE_TO_APPEAR_OUT_OF_DATEB="Success! The snippet was saved. But the modified date could not be adjusted. <br /><br /><b>This means the snippets will continue to appear out of date.</b>"
|
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED_BUT_THE_MODIFIED_DATE_COULD_NOT_BE_ADJUSTED_BR_BR_BTHIS_MEANS_THE_SNIPPETS_WILL_CONTINUE_TO_APPEAR_OUT_OF_DATEB="Success! The snippet was saved. But the modified date could not be adjusted. <br /><br /><b>This means the snippets will continue to appear out of date.</b>"
|
||||||
COM_COMPONENTBUILDER_S_BEING_IMPORTED="%s Being Imported"
|
COM_COMPONENTBUILDER_S_BEING_IMPORTED="%s Being Imported"
|
||||||
|
COM_COMPONENTBUILDER_S_NOT_LINKED="%s Not Linked"
|
||||||
COM_COMPONENTBUILDER_S_PLEASE_WAIT_THE_COMPONENT_IS_BEING_COMPILED="%s, please wait! The component is being compiled"
|
COM_COMPONENTBUILDER_S_PLEASE_WAIT_THE_COMPONENT_IS_BEING_COMPILED="%s, please wait! The component is being compiled"
|
||||||
COM_COMPONENTBUILDER_TAB="Tab"
|
COM_COMPONENTBUILDER_TAB="Tab"
|
||||||
COM_COMPONENTBUILDER_TARGET_BEHAVIOR="Target Behavior"
|
COM_COMPONENTBUILDER_TARGET_BEHAVIOR="Target Behavior"
|
||||||
@ -5953,6 +5973,7 @@ COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME="There are no new sn
|
|||||||
COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME="There are no out of date snippets at this time"
|
COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME="There are no out of date snippets at this time"
|
||||||
COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME="There are no snippets to update at this time"
|
COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME="There are no snippets to update at this time"
|
||||||
COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_IF_THIS_CONTINUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR_OF_A_TYPE_ERROR_IN_THE_FIELDS_DISPLAY_REQUEST="There has been an error, if this continues please inform your system administrator of a type error in the fields display request!"
|
COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_IF_THIS_CONTINUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR_OF_A_TYPE_ERROR_IN_THE_FIELDS_DISPLAY_REQUEST="There has been an error, if this continues please inform your system administrator of a type error in the fields display request!"
|
||||||
|
COM_COMPONENTBUILDER_THERE_WAS_A_PROBLEM_BNO_VIEW_OR_ID_FOUND_IN_SESSION_OR_VIEW_NOT_ALLOWED_TO_ACCESS_AREAB_WE_COULD_NOT_LOAD_ANY_LINKED_TO_VALUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR="There was a problem, <b>no view or id found in session or view not allowed to access area</b>, we could not load any linked to values. Please inform your system administrator!"
|
||||||
COM_COMPONENTBUILDER_THE_BSB_LIBRARY_CAN_NOT_BE_DELETED_OR_THINGS_WILL_BREAK="The <b>%s</b> library can not be deleted, or things will break."
|
COM_COMPONENTBUILDER_THE_BSB_LIBRARY_CAN_NOT_BE_DELETED_OR_THINGS_WILL_BREAK="The <b>%s</b> library can not be deleted, or things will break."
|
||||||
COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views"
|
COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views"
|
||||||
COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config"
|
COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config"
|
||||||
@ -5973,6 +5994,7 @@ COM_COMPONENTBUILDER_THE_SEARCH_FOR_THE_SNIPPETS_ARE_CASE_SENSITIVE_SO_IF_YOU_CH
|
|||||||
COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED="The Snippets Were Successfully Exported!"
|
COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED="The Snippets Were Successfully Exported!"
|
||||||
COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED="The Snippet Was Successfully Exported!"
|
COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED="The Snippet Was Successfully Exported!"
|
||||||
COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading"
|
COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading"
|
||||||
|
COM_COMPONENTBUILDER_THIS_BSB_IS_NOT_LINKED_TO_ANY_S="This <b>%s</b> is not linked to any (%s)!"
|
||||||
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
|
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
|
||||||
COM_COMPONENTBUILDER_TITLE="Title"
|
COM_COMPONENTBUILDER_TITLE="Title"
|
||||||
COM_COMPONENTBUILDER_TOTAL_DOWNLOADS="total downloads"
|
COM_COMPONENTBUILDER_TOTAL_DOWNLOADS="total downloads"
|
||||||
|
55
admin/layouts/custom_admin_view/javascript_css_fullwidth.php
Normal file
55
admin/layouts/custom_admin_view/javascript_css_fullwidth.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
||||||
|
__ __ _ _____ _ _ __ __ _ _ _
|
||||||
|
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
||||||
|
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
||||||
|
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
||||||
|
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
||||||
|
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
||||||
|
| |
|
||||||
|
|_|
|
||||||
|
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||||
|
|
||||||
|
@version 2.6.x
|
||||||
|
@created 30th April, 2015
|
||||||
|
@package Component Builder
|
||||||
|
@subpackage javascript_css_fullwidth.php
|
||||||
|
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
|
||||||
|
@github Joomla Component Builder <https://github.com/vdm-io/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'
|
||||||
|
);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div class="form-vertical">
|
||||||
|
<?php foreach($fields as $field): ?>
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="control-label">
|
||||||
|
<?php echo $form->getLabel($field); ?>
|
||||||
|
</div>
|
||||||
|
<div class="controls">
|
||||||
|
<?php echo $form->getInput($field); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
@ -13,7 +13,7 @@
|
|||||||
@version 2.6.x
|
@version 2.6.x
|
||||||
@created 30th April, 2015
|
@created 30th April, 2015
|
||||||
@package Component Builder
|
@package Component Builder
|
||||||
@subpackage custom_script_fullwidth.php
|
@subpackage php_fullwidth.php
|
||||||
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
|
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
|
||||||
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||||
@copyright Copyright (C) 2015. All Rights Reserved
|
@copyright Copyright (C) 2015. All Rights Reserved
|
||||||
@ -37,13 +37,7 @@ $fields = $displayData->get('fields') ?: array(
|
|||||||
'add_php_jview_display',
|
'add_php_jview_display',
|
||||||
'php_jview_display',
|
'php_jview_display',
|
||||||
'add_php_jview',
|
'add_php_jview',
|
||||||
'php_jview',
|
'php_jview'
|
||||||
'add_js_document',
|
|
||||||
'js_document',
|
|
||||||
'add_css_document',
|
|
||||||
'css_document',
|
|
||||||
'add_css',
|
|
||||||
'css'
|
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
@ -28,7 +28,7 @@
|
|||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
// set the defaults
|
// set the defaults
|
||||||
$items = $displayData->vzwfields;
|
$items = $displayData->vzyfields;
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$id = $displayData->item->id;
|
$id = $displayData->item->id;
|
||||||
$edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
|
$edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
// set the defaults
|
// set the defaults
|
||||||
$items = $displayData->vzxlinked_components;
|
$items = $displayData->vzzlinked_components;
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
$id = $displayData->item->id;
|
$id = $displayData->item->id;
|
||||||
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
|
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
|
||||||
|
@ -30,6 +30,7 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
$form = $displayData->getForm();
|
$form = $displayData->getForm();
|
||||||
|
|
||||||
$fields = $displayData->get('fields') ?: array(
|
$fields = $displayData->get('fields') ?: array(
|
||||||
|
'note_library_instruction',
|
||||||
'libraries'
|
'libraries'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
$form = $displayData->getForm();
|
$form = $displayData->getForm();
|
||||||
|
|
||||||
$fields = $displayData->get('fields') ?: array(
|
$fields = $displayData->get('fields') ?: array(
|
||||||
|
'add_javascript_file',
|
||||||
|
'javascript_file',
|
||||||
'add_js_document',
|
'add_js_document',
|
||||||
'js_document',
|
'js_document',
|
||||||
'add_css_document',
|
'add_css_document',
|
||||||
|
@ -1072,6 +1072,103 @@ class ComponentbuilderModelAjax extends JModelList
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Linked to
|
||||||
|
*
|
||||||
|
* @param string $type Item Name
|
||||||
|
* @param int $id Item ID
|
||||||
|
*
|
||||||
|
* @return string The table of the linked to result
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function getLinked($to)
|
||||||
|
{
|
||||||
|
// get the view name & id
|
||||||
|
$values = $this->getViewID();
|
||||||
|
// check if item is set
|
||||||
|
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']))
|
||||||
|
{
|
||||||
|
// get linked to
|
||||||
|
$linkedToArray = (array) explode('__', $to);
|
||||||
|
// check if item is linked to component
|
||||||
|
if (in_array('component', $linkedToArray))
|
||||||
|
{
|
||||||
|
if (!$components = getComponentLinked($values['a_view'], $values['a_id']))
|
||||||
|
{
|
||||||
|
$linkedToString = implode(', ', array_map( function($name) { return ComponentbuilderHelper::safeString($name, 'w'); }, $linkedToArray));
|
||||||
|
return '<div class="control-group"><div class="alert alert-info"><h4>' . JText::sprintf('COM_COMPONENTBUILDER_S_NOT_LINKED', ComponentbuilderHelper::safeString($values['a_view'], 'Ww')) . '</h4><p>' . JText::sprintf('COM_COMPONENTBUILDER_THIS_BSB_IS_NOT_LINKED_TO_ANY_S', $values['a_view'], $linkedToString) . '</p></div></div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if fields and components found get admin views
|
||||||
|
|
||||||
|
}
|
||||||
|
// no view or id found in session, or view not allowed to access area
|
||||||
|
return '<div class="control-group"><div class="alert alert-error"><h4>' . JText::_('COM_COMPONENTBUILDER_ERROR') . '</h4><p>' . JText::_('COM_COMPONENTBUILDER_THERE_WAS_A_PROBLEM_BNO_VIEW_OR_ID_FOUND_IN_SESSION_OR_VIEW_NOT_ALLOWED_TO_ACCESS_AREAB_WE_COULD_NOT_LOAD_ANY_LINKED_TO_VALUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR') . '</p></div></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Component Linked to Item
|
||||||
|
*
|
||||||
|
* @param string $type Item Name
|
||||||
|
* @param int $id Item ID
|
||||||
|
*
|
||||||
|
* @return array Components Id if found
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
protected function getComponentLinked($type, $id)
|
||||||
|
{
|
||||||
|
// reset bucket
|
||||||
|
$componentsLinked = array();
|
||||||
|
// Create a new query object.
|
||||||
|
$query = $this->db->getQuery(true);
|
||||||
|
// get all history values
|
||||||
|
$query->select('h.*');
|
||||||
|
$query->from('#__ucm_history AS h');
|
||||||
|
$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));
|
||||||
|
$this->db->setQuery($query);
|
||||||
|
$this->db->execute();
|
||||||
|
if ($this->db->getNumRows())
|
||||||
|
{
|
||||||
|
// load all item history
|
||||||
|
$items = $db->loadObjectList();
|
||||||
|
// load the components ids
|
||||||
|
foreach ($items as $item)
|
||||||
|
{
|
||||||
|
// only work with those who have notes
|
||||||
|
if (ComponentbuilderHelper::checkJson($item->version_note))
|
||||||
|
{
|
||||||
|
$note = json_decode($item->version_note, true);
|
||||||
|
if (ComponentbuilderHelper::checkArray($note))
|
||||||
|
{
|
||||||
|
foreach($note as $ids)
|
||||||
|
{
|
||||||
|
if (ComponentbuilderHelper::checkArray($ids))
|
||||||
|
{
|
||||||
|
foreach ($ids as $_id)
|
||||||
|
{
|
||||||
|
$componentsLinked[(int) $_id] = array('component' => (int) $_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (is_numeric($ids))
|
||||||
|
{
|
||||||
|
$componentsLinked[(int) $ids] = array('component' => (int) $ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// check if we found any
|
||||||
|
if (ComponentbuilderHelper::checkArray($componentLinked))
|
||||||
|
{
|
||||||
|
return $componentLinked;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Used in site_view
|
// Used in site_view
|
||||||
|
|
||||||
public function getSnippets($libraries)
|
public function getSnippets($libraries)
|
||||||
|
@ -34,16 +34,16 @@ jimport('joomla.application.component.modellist');
|
|||||||
*/
|
*/
|
||||||
class ComponentbuilderModelCompiler extends JModelList
|
class ComponentbuilderModelCompiler extends JModelList
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Model user data.
|
* Model user data.
|
||||||
*
|
*
|
||||||
* @var strings
|
* @var strings
|
||||||
*/
|
*/
|
||||||
protected $user;
|
protected $user;
|
||||||
protected $userId;
|
protected $userId;
|
||||||
protected $guest;
|
protected $guest;
|
||||||
protected $groups;
|
protected $groups;
|
||||||
protected $levels;
|
protected $levels;
|
||||||
protected $app;
|
protected $app;
|
||||||
protected $input;
|
protected $input;
|
||||||
protected $uikitComp;
|
protected $uikitComp;
|
||||||
@ -55,16 +55,16 @@ class ComponentbuilderModelCompiler extends JModelList
|
|||||||
*/
|
*/
|
||||||
protected function getListQuery()
|
protected function getListQuery()
|
||||||
{
|
{
|
||||||
// Get the current user for authorisation checks
|
// Get the current user for authorisation checks
|
||||||
$this->user = JFactory::getUser();
|
$this->user = JFactory::getUser();
|
||||||
$this->userId = $this->user->get('id');
|
$this->userId = $this->user->get('id');
|
||||||
$this->guest = $this->user->get('guest');
|
$this->guest = $this->user->get('guest');
|
||||||
$this->groups = $this->user->get('groups');
|
$this->groups = $this->user->get('groups');
|
||||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = JFactory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
$this->initSet = true;
|
$this->initSet = true;
|
||||||
// Make sure all records load, since no pagination allowed.
|
// Make sure all records load, since no pagination allowed.
|
||||||
$this->setState('list.limit', 0);
|
$this->setState('list.limit', 0);
|
||||||
// Get a db connection.
|
// Get a db connection.
|
||||||
@ -94,16 +94,16 @@ class ComponentbuilderModelCompiler extends JModelList
|
|||||||
*/
|
*/
|
||||||
public function getItems()
|
public function getItems()
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
// check if this user has permission to access items
|
// check if this user has permission to access items
|
||||||
if (!$user->authorise('compiler.access', 'com_componentbuilder'))
|
if (!$user->authorise('compiler.access', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
||||||
// redirect away if not a correct (TODO for now we go to default view)
|
// redirect away if not a correct (TODO for now we go to default view)
|
||||||
$app->redirect('index.php?option=com_componentbuilder');
|
$app->redirect('index.php?option=com_componentbuilder');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// load parent items
|
// load parent items
|
||||||
$items = parent::getItems();
|
$items = parent::getItems();
|
||||||
|
|
||||||
|
@ -37,11 +37,11 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
|||||||
{
|
{
|
||||||
public function getIcons()
|
public function getIcons()
|
||||||
{
|
{
|
||||||
// load user for access menus
|
// load user for access menus
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
// reset icon array
|
// reset icon array
|
||||||
$icons = array();
|
$icons = array();
|
||||||
// view groups array
|
// view groups array
|
||||||
$viewGroups = array(
|
$viewGroups = array(
|
||||||
'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.libraries', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.ftps', 'png.help_document.add', 'png.help_documents')
|
'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.libraries', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.ftps', 'png.help_document.add', 'png.help_documents')
|
||||||
);
|
);
|
||||||
@ -177,92 +177,92 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
|||||||
'libraries_files_folders_urls.access' => 'library_files_folders_urls.access',
|
'libraries_files_folders_urls.access' => 'library_files_folders_urls.access',
|
||||||
'library_files_folders_urls.access' => 'library_files_folders_urls.access');
|
'library_files_folders_urls.access' => 'library_files_folders_urls.access');
|
||||||
foreach($viewGroups as $group => $views)
|
foreach($viewGroups as $group => $views)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
if (ComponentbuilderHelper::checkArray($views))
|
if (ComponentbuilderHelper::checkArray($views))
|
||||||
{
|
{
|
||||||
foreach($views as $view)
|
foreach($views as $view)
|
||||||
{
|
{
|
||||||
$add = false;
|
$add = false;
|
||||||
if (strpos($view,'.') !== false)
|
if (strpos($view,'.') !== false)
|
||||||
{
|
{
|
||||||
$dwd = explode('.', $view);
|
$dwd = explode('.', $view);
|
||||||
if (count($dwd) == 3)
|
if (count($dwd) == 3)
|
||||||
{
|
{
|
||||||
list($type, $name, $action) = $dwd;
|
list($type, $name, $action) = $dwd;
|
||||||
}
|
}
|
||||||
elseif (count($dwd) == 2)
|
elseif (count($dwd) == 2)
|
||||||
{
|
{
|
||||||
list($type, $name) = $dwd;
|
list($type, $name) = $dwd;
|
||||||
$action = false;
|
$action = false;
|
||||||
}
|
}
|
||||||
if ($action)
|
if ($action)
|
||||||
{
|
{
|
||||||
$viewName = $name;
|
$viewName = $name;
|
||||||
switch($action)
|
switch($action)
|
||||||
{
|
{
|
||||||
case 'add':
|
case 'add':
|
||||||
$url ='index.php?option=com_componentbuilder&view='.$name.'&layout=edit';
|
$url ='index.php?option=com_componentbuilder&view='.$name.'&layout=edit';
|
||||||
$image = $name.'_'.$action.'.'.$type;
|
$image = $name.'_'.$action.'.'.$type;
|
||||||
$alt = $name.' '.$action;
|
$alt = $name.' '.$action;
|
||||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_ADD';
|
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_ADD';
|
||||||
$add = true;
|
$add = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$url = 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.'.$name;
|
$url = 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.'.$name;
|
||||||
$image = $name.'_'.$action.'.'.$type;
|
$image = $name.'_'.$action.'.'.$type;
|
||||||
$alt = $name.' '.$action;
|
$alt = $name.' '.$action;
|
||||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_'.ComponentbuilderHelper::safeString($action,'U');
|
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U').'_'.ComponentbuilderHelper::safeString($action,'U');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$viewName = $name;
|
$viewName = $name;
|
||||||
$alt = $name;
|
$alt = $name;
|
||||||
$url = 'index.php?option=com_componentbuilder&view='.$name;
|
$url = 'index.php?option=com_componentbuilder&view='.$name;
|
||||||
$image = $name.'.'.$type;
|
$image = $name.'.'.$type;
|
||||||
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U');
|
$name = 'COM_COMPONENTBUILDER_DASHBOARD_'.ComponentbuilderHelper::safeString($name,'U');
|
||||||
$hover = false;
|
$hover = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$viewName = $view;
|
$viewName = $view;
|
||||||
$alt = $view;
|
$alt = $view;
|
||||||
$url = 'index.php?option=com_componentbuilder&view='.$view;
|
$url = 'index.php?option=com_componentbuilder&view='.$view;
|
||||||
$image = $view.'.png';
|
$image = $view.'.png';
|
||||||
$name = ucwords($view).'<br /><br />';
|
$name = ucwords($view).'<br /><br />';
|
||||||
$hover = false;
|
$hover = false;
|
||||||
}
|
}
|
||||||
// first make sure the view access is set
|
// first make sure the view access is set
|
||||||
if (ComponentbuilderHelper::checkArray($viewAccess))
|
if (ComponentbuilderHelper::checkArray($viewAccess))
|
||||||
{
|
{
|
||||||
// setup some defaults
|
// setup some defaults
|
||||||
$dashboard_add = false;
|
$dashboard_add = false;
|
||||||
$dashboard_list = false;
|
$dashboard_list = false;
|
||||||
$accessTo = '';
|
$accessTo = '';
|
||||||
$accessAdd = '';
|
$accessAdd = '';
|
||||||
// acces checking start
|
// acces checking start
|
||||||
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.create']):false;
|
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.create']):false;
|
||||||
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.access']):false;
|
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.access']):false;
|
||||||
// set main controllers
|
// set main controllers
|
||||||
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
|
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
|
||||||
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
|
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ComponentbuilderHelper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
|
||||||
// check for adding access
|
// check for adding access
|
||||||
if ($add && $accessCreate)
|
if ($add && $accessCreate)
|
||||||
{
|
{
|
||||||
$accessAdd = $viewAccess[$viewName.'.create'];
|
$accessAdd = $viewAccess[$viewName.'.create'];
|
||||||
}
|
}
|
||||||
elseif ($add)
|
elseif ($add)
|
||||||
{
|
{
|
||||||
$accessAdd = 'core.create';
|
$accessAdd = 'core.create';
|
||||||
}
|
}
|
||||||
// check if acces to view is set
|
// check if acces to view is set
|
||||||
if ($accessAccess)
|
if ($accessAccess)
|
||||||
{
|
{
|
||||||
$accessTo = $viewAccess[$viewName.'.access'];
|
$accessTo = $viewAccess[$viewName.'.access'];
|
||||||
}
|
}
|
||||||
// set main access controllers
|
// set main access controllers
|
||||||
if ($accessDashboard_add)
|
if ($accessDashboard_add)
|
||||||
{
|
{
|
||||||
@ -272,65 +272,65 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
|||||||
{
|
{
|
||||||
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_componentbuilder');
|
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_componentbuilder');
|
||||||
}
|
}
|
||||||
if (ComponentbuilderHelper::checkString($accessAdd) && ComponentbuilderHelper::checkString($accessTo))
|
if (ComponentbuilderHelper::checkString($accessAdd) && ComponentbuilderHelper::checkString($accessTo))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessAdd, 'com_componentbuilder') && $user->authorise($accessTo, 'com_componentbuilder') && $dashboard_add)
|
if($user->authorise($accessAdd, 'com_componentbuilder') && $user->authorise($accessTo, 'com_componentbuilder') && $dashboard_add)
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (ComponentbuilderHelper::checkString($accessTo))
|
elseif (ComponentbuilderHelper::checkString($accessTo))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessTo, 'com_componentbuilder') && $dashboard_list)
|
if($user->authorise($accessTo, 'com_componentbuilder') && $dashboard_list)
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (ComponentbuilderHelper::checkString($accessAdd))
|
elseif (ComponentbuilderHelper::checkString($accessAdd))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessAdd, 'com_componentbuilder') && $dashboard_add)
|
if($user->authorise($accessAdd, 'com_componentbuilder') && $dashboard_add)
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = new StdClass;
|
$icons[$group][$i] = new StdClass;
|
||||||
$icons[$group][$i]->url = $url;
|
$icons[$group][$i]->url = $url;
|
||||||
$icons[$group][$i]->name = $name;
|
$icons[$group][$i]->name = $name;
|
||||||
$icons[$group][$i]->image = $image;
|
$icons[$group][$i]->image = $image;
|
||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$icons[$group][$i] = false;
|
$icons[$group][$i] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $icons;
|
return $icons;
|
||||||
@ -379,9 +379,21 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
|||||||
// set the update notice while we are at it
|
// set the update notice while we are at it
|
||||||
var activeVersion = tagreleases[0].tag_name.substring(1);
|
var activeVersion = tagreleases[0].tag_name.substring(1);
|
||||||
if (activeVersion === manifest.version) {
|
if (activeVersion === manifest.version) {
|
||||||
|
// local version is in sync with latest release
|
||||||
jQuery(".update-notice").html("<small><span style=\'color:green;\'><span class=\'icon-shield\'></span>'.JText::_('COM_COMPONENTBUILDER_UP_TO_DATE').'</span></small>");
|
jQuery(".update-notice").html("<small><span style=\'color:green;\'><span class=\'icon-shield\'></span>'.JText::_('COM_COMPONENTBUILDER_UP_TO_DATE').'</span></small>");
|
||||||
} else {
|
} else {
|
||||||
jQuery(".update-notice").html("<small><span style=\'color:red;\'><span class=\'icon-warning-circle\'></span>'.JText::_('COM_COMPONENTBUILDER_OUT_OF_DATE').'</span></small>");
|
// split versions in to array
|
||||||
|
var activeVersionArray = activeVersion.split(".");
|
||||||
|
var localVersionArray = manifest.version.split(".");
|
||||||
|
if (localVersionArray[0] > activeVersionArray[0] ||
|
||||||
|
(localVersionArray[0] == activeVersionArray[0] && localVersionArray[1] > activeVersionArray[1]) ||
|
||||||
|
(localVersionArray[0] == activeVersionArray[0] && localVersionArray[1] == activeVersionArray[1] && localVersionArray[2] > activeVersionArray[2])) {
|
||||||
|
// local version head latest release
|
||||||
|
jQuery(".update-notice").html("<small><span style=\'color:#F7B033;\'><span class=\'icon-wrench\'></span>'.JText::_('COM_COMPONENTBUILDER_BETA_RELEASE').'</span></small>");
|
||||||
|
} else {
|
||||||
|
// local version behind latest release
|
||||||
|
jQuery(".update-notice").html("<small><span style=\'color:red;\'><span class=\'icon-warning-circle\'></span>'.JText::_('COM_COMPONENTBUILDER_OUT_OF_DATE').'</span></small>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// set the taged releases
|
// set the taged releases
|
||||||
jQuery("#tagreleases").html("");
|
jQuery("#tagreleases").html("");
|
||||||
|
@ -103,14 +103,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
|||||||
$item->libraries = $libraries->toArray();
|
$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))
|
if (!empty($item->custom_get))
|
||||||
{
|
{
|
||||||
// Convert the custom_get field to an array.
|
// Convert the custom_get field to an array.
|
||||||
@ -119,6 +111,14 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
|||||||
$item->custom_get = $custom_get->toArray();
|
$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))
|
if (!empty($item->php_controller))
|
||||||
{
|
{
|
||||||
// base64 Decode php_controller.
|
// base64 Decode php_controller.
|
||||||
@ -137,6 +137,30 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
|||||||
$item->php_model = base64_decode($item->php_model);
|
$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))
|
if (!empty($item->php_document))
|
||||||
{
|
{
|
||||||
// base64 Decode php_document.
|
// base64 Decode php_document.
|
||||||
@ -161,24 +185,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
|||||||
$item->php_jview = base64_decode($item->php_jview);
|
$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)
|
// check what type of custom_button array we have here (should be subform... but just incase)
|
||||||
// This could happen due to huge data sets
|
// This could happen due to huge data sets
|
||||||
if (isset($item->custom_button) && isset($item->custom_button['name']))
|
if (isset($item->custom_button) && isset($item->custom_button['name']))
|
||||||
@ -939,19 +945,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
|||||||
$data['libraries'] = '';
|
$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.
|
// Set the custom_get items to data.
|
||||||
if (isset($data['custom_get']) && is_array($data['custom_get']))
|
if (isset($data['custom_get']) && is_array($data['custom_get']))
|
||||||
{
|
{
|
||||||
@ -965,6 +958,19 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
|||||||
$data['custom_get'] = '';
|
$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.
|
// Set the php_controller string to base64 string.
|
||||||
if (isset($data['php_controller']))
|
if (isset($data['php_controller']))
|
||||||
{
|
{
|
||||||
@ -983,6 +989,30 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
|||||||
$data['php_model'] = base64_encode($data['php_model']);
|
$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.
|
// Set the php_document string to base64 string.
|
||||||
if (isset($data['php_document']))
|
if (isset($data['php_document']))
|
||||||
{
|
{
|
||||||
@ -1007,24 +1037,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
|
|||||||
$data['php_jview'] = base64_encode($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
|
// Set the Params Items to data
|
||||||
if (isset($data['params']) && is_array($data['params']))
|
if (isset($data['params']) && is_array($data['params']))
|
||||||
{
|
{
|
||||||
|
@ -272,6 +272,14 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
|
|||||||
$item->default = base64_decode($item->default);
|
$item->default = base64_decode($item->default);
|
||||||
// decode php_model
|
// decode php_model
|
||||||
$item->php_model = base64_decode($item->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
|
// decode php_document
|
||||||
$item->php_document = base64_decode($item->php_document);
|
$item->php_document = base64_decode($item->php_document);
|
||||||
// decode php_view
|
// decode php_view
|
||||||
@ -280,12 +288,6 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
|
|||||||
$item->php_jview_display = base64_decode($item->php_jview_display);
|
$item->php_jview_display = base64_decode($item->php_jview_display);
|
||||||
// decode php_jview
|
// decode php_jview
|
||||||
$item->php_jview = base64_decode($item->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 the values we don't want exported.
|
||||||
unset($item->asset_id);
|
unset($item->asset_id);
|
||||||
unset($item->checked_out);
|
unset($item->checked_out);
|
||||||
|
@ -139,7 +139,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
|||||||
*
|
*
|
||||||
* @return mixed An array of data items on success, false on failure.
|
* @return mixed An array of data items on success, false on failure.
|
||||||
*/
|
*/
|
||||||
public function getVzwfields()
|
public function getVzyfields()
|
||||||
{
|
{
|
||||||
// Get the user object.
|
// Get the user object.
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
@ -223,13 +223,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
|||||||
foreach ($items as $nr => &$item)
|
foreach ($items as $nr => &$item)
|
||||||
{
|
{
|
||||||
// convert datatype
|
// convert datatype
|
||||||
$item->datatype = $this->selectionTranslationVzwfields($item->datatype, 'datatype');
|
$item->datatype = $this->selectionTranslationVzyfields($item->datatype, 'datatype');
|
||||||
// convert indexes
|
// convert indexes
|
||||||
$item->indexes = $this->selectionTranslationVzwfields($item->indexes, 'indexes');
|
$item->indexes = $this->selectionTranslationVzyfields($item->indexes, 'indexes');
|
||||||
// convert null_switch
|
// 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
|
// 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
|
* @return translatable string
|
||||||
*/
|
*/
|
||||||
public function selectionTranslationVzwfields($value,$name)
|
public function selectionTranslationVzyfields($value,$name)
|
||||||
{
|
{
|
||||||
// Array of datatype language strings
|
// Array of datatype language strings
|
||||||
if ($name === 'datatype')
|
if ($name === 'datatype')
|
||||||
|
@ -30,8 +30,9 @@ jform_vvvvvydvxy_required = false;
|
|||||||
jform_vvvvvyevxz_required = false;
|
jform_vvvvvyevxz_required = false;
|
||||||
jform_vvvvvyfvya_required = false;
|
jform_vvvvvyfvya_required = false;
|
||||||
jform_vvvvvygvyb_required = false;
|
jform_vvvvvygvyb_required = false;
|
||||||
jform_vvvvvygvyc_required = false;
|
jform_vvvvvyhvyc_required = false;
|
||||||
jform_vvvvvyhvyd_required = false;
|
jform_vvvvvyhvyd_required = false;
|
||||||
|
jform_vvvvvyivye_required = false;
|
||||||
|
|
||||||
// Initial Script
|
// Initial Script
|
||||||
jQuery(document).ready(function()
|
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();
|
var add_css_document_vvvvvye = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||||
vvvvvye(add_css_document_vvvvvye);
|
vvvvvye(add_css_document_vvvvvye);
|
||||||
|
|
||||||
var add_js_document_vvvvvyf = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
var add_javascript_file_vvvvvyf = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||||
vvvvvyf(add_js_document_vvvvvyf);
|
vvvvvyf(add_javascript_file_vvvvvyf);
|
||||||
|
|
||||||
var add_custom_button_vvvvvyg = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
var add_js_document_vvvvvyg = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||||
vvvvvyg(add_custom_button_vvvvvyg);
|
vvvvvyg(add_js_document_vvvvvyg);
|
||||||
|
|
||||||
var add_css_vvvvvyh = jQuery("#jform_add_css input[type='radio']:checked").val();
|
var add_custom_button_vvvvvyh = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||||
vvvvvyh(add_css_vvvvvyh);
|
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
|
// the vvvvvya function
|
||||||
@ -217,61 +221,92 @@ function vvvvvye(add_css_document_vvvvvye)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvvyf function
|
// the vvvvvyf function
|
||||||
function vvvvvyf(add_js_document_vvvvvyf)
|
function vvvvvyf(add_javascript_file_vvvvvyf)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// 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)
|
if (jform_vvvvvyfvya_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('js_document',0);
|
updateFieldRequired('javascript_file',0);
|
||||||
jQuery('#jform_js_document').prop('required','required');
|
jQuery('#jform_javascript_file').prop('required','required');
|
||||||
jQuery('#jform_js_document').attr('aria-required',true);
|
jQuery('#jform_javascript_file').attr('aria-required',true);
|
||||||
jQuery('#jform_js_document').addClass('required');
|
jQuery('#jform_javascript_file').addClass('required');
|
||||||
jform_vvvvvyfvya_required = false;
|
jform_vvvvvyfvya_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_js_document').closest('.control-group').hide();
|
jQuery('#jform_javascript_file').closest('.control-group').hide();
|
||||||
if (!jform_vvvvvyfvya_required)
|
if (!jform_vvvvvyfvya_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('js_document',1);
|
updateFieldRequired('javascript_file',1);
|
||||||
jQuery('#jform_js_document').removeAttr('required');
|
jQuery('#jform_javascript_file').removeAttr('required');
|
||||||
jQuery('#jform_js_document').removeAttr('aria-required');
|
jQuery('#jform_javascript_file').removeAttr('aria-required');
|
||||||
jQuery('#jform_js_document').removeClass('required');
|
jQuery('#jform_javascript_file').removeClass('required');
|
||||||
jform_vvvvvyfvya_required = true;
|
jform_vvvvvyfvya_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvvyg function
|
// the vvvvvyg function
|
||||||
function vvvvvyg(add_custom_button_vvvvvyg)
|
function vvvvvyg(add_js_document_vvvvvyg)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// 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_custom_button-lbl').closest('.control-group').show();
|
||||||
jQuery('#jform_php_controller').closest('.control-group').show();
|
jQuery('#jform_php_controller').closest('.control-group').show();
|
||||||
if (jform_vvvvvygvyb_required)
|
if (jform_vvvvvyhvyc_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('php_controller',0);
|
updateFieldRequired('php_controller',0);
|
||||||
jQuery('#jform_php_controller').prop('required','required');
|
jQuery('#jform_php_controller').prop('required','required');
|
||||||
jQuery('#jform_php_controller').attr('aria-required',true);
|
jQuery('#jform_php_controller').attr('aria-required',true);
|
||||||
jQuery('#jform_php_controller').addClass('required');
|
jQuery('#jform_php_controller').addClass('required');
|
||||||
jform_vvvvvygvyb_required = false;
|
jform_vvvvvyhvyc_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('#jform_php_model').closest('.control-group').show();
|
jQuery('#jform_php_model').closest('.control-group').show();
|
||||||
if (jform_vvvvvygvyc_required)
|
if (jform_vvvvvyhvyd_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('php_model',0);
|
updateFieldRequired('php_model',0);
|
||||||
jQuery('#jform_php_model').prop('required','required');
|
jQuery('#jform_php_model').prop('required','required');
|
||||||
jQuery('#jform_php_model').attr('aria-required',true);
|
jQuery('#jform_php_model').attr('aria-required',true);
|
||||||
jQuery('#jform_php_model').addClass('required');
|
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_custom_button-lbl').closest('.control-group').hide();
|
||||||
jQuery('#jform_php_controller').closest('.control-group').hide();
|
jQuery('#jform_php_controller').closest('.control-group').hide();
|
||||||
if (!jform_vvvvvygvyb_required)
|
if (!jform_vvvvvyhvyc_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('php_controller',1);
|
updateFieldRequired('php_controller',1);
|
||||||
jQuery('#jform_php_controller').removeAttr('required');
|
jQuery('#jform_php_controller').removeAttr('required');
|
||||||
jQuery('#jform_php_controller').removeAttr('aria-required');
|
jQuery('#jform_php_controller').removeAttr('aria-required');
|
||||||
jQuery('#jform_php_controller').removeClass('required');
|
jQuery('#jform_php_controller').removeClass('required');
|
||||||
jform_vvvvvygvyb_required = true;
|
jform_vvvvvyhvyc_required = true;
|
||||||
}
|
}
|
||||||
jQuery('#jform_php_model').closest('.control-group').hide();
|
jQuery('#jform_php_model').closest('.control-group').hide();
|
||||||
if (!jform_vvvvvygvyc_required)
|
if (!jform_vvvvvyhvyd_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('php_model',1);
|
updateFieldRequired('php_model',1);
|
||||||
jQuery('#jform_php_model').removeAttr('required');
|
jQuery('#jform_php_model').removeAttr('required');
|
||||||
jQuery('#jform_php_model').removeAttr('aria-required');
|
jQuery('#jform_php_model').removeAttr('aria-required');
|
||||||
jQuery('#jform_php_model').removeClass('required');
|
jQuery('#jform_php_model').removeClass('required');
|
||||||
jform_vvvvvygvyc_required = true;
|
jform_vvvvvyhvyd_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvvyh function
|
// the vvvvvyi function
|
||||||
function vvvvvyh(add_css_vvvvvyh)
|
function vvvvvyi(add_css_vvvvvyi)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// set the function logic
|
||||||
if (add_css_vvvvvyh == 1)
|
if (add_css_vvvvvyi == 1)
|
||||||
{
|
{
|
||||||
jQuery('#jform_css').closest('.control-group').show();
|
jQuery('#jform_css').closest('.control-group').show();
|
||||||
if (jform_vvvvvyhvyd_required)
|
if (jform_vvvvvyivye_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('css',0);
|
updateFieldRequired('css',0);
|
||||||
jQuery('#jform_css').prop('required','required');
|
jQuery('#jform_css').prop('required','required');
|
||||||
jQuery('#jform_css').attr('aria-required',true);
|
jQuery('#jform_css').attr('aria-required',true);
|
||||||
jQuery('#jform_css').addClass('required');
|
jQuery('#jform_css').addClass('required');
|
||||||
jform_vvvvvyhvyd_required = false;
|
jform_vvvvvyivye_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_css').closest('.control-group').hide();
|
jQuery('#jform_css').closest('.control-group').hide();
|
||||||
if (!jform_vvvvvyhvyd_required)
|
if (!jform_vvvvvyivye_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('css',1);
|
updateFieldRequired('css',1);
|
||||||
jQuery('#jform_css').removeAttr('required');
|
jQuery('#jform_css').removeAttr('required');
|
||||||
jQuery('#jform_css').removeAttr('aria-required');
|
jQuery('#jform_css').removeAttr('aria-required');
|
||||||
jQuery('#jform_css').removeClass('required');
|
jQuery('#jform_css').removeClass('required');
|
||||||
jform_vvvvvyhvyd_required = true;
|
jform_vvvvvyivye_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,30 +138,10 @@
|
|||||||
multiple="false"
|
multiple="false"
|
||||||
required="false"
|
required="false"
|
||||||
button="true" />
|
button="true" />
|
||||||
<!-- Note_libraries_selection Field. Type: Note. A None Database Field. (joomla)-->
|
<!-- Add_css_document Field. Type: Radio. (joomla)-->
|
||||||
<field type="note"
|
|
||||||
name="note_libraries_selection"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LIBRARIES_SELECTION_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LIBRARIES_SELECTION_DESCRIPTION"
|
|
||||||
heading="h4"
|
|
||||||
class="alert alert-info note_libraries_selection" />
|
|
||||||
<!-- Note_add_language_string Field. Type: Note. A None Database Field. (joomla)-->
|
|
||||||
<field type="note"
|
|
||||||
name="note_add_language_string"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_LANGUAGE_STRING_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_LANGUAGE_STRING_DESCRIPTION"
|
|
||||||
heading="h4"
|
|
||||||
class="note_add_language_string" />
|
|
||||||
<!-- Icon Field. Type: Media. (joomla)-->
|
|
||||||
<field type="media"
|
|
||||||
name="icon"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ICON_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ICON_DESCRIPTION"
|
|
||||||
directory="" />
|
|
||||||
<!-- Add_php_jview Field. Type: Radio. (joomla)-->
|
|
||||||
<field type="radio"
|
<field type="radio"
|
||||||
name="add_php_jview"
|
name="add_css_document"
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_LABEL"
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CSS_DOCUMENT_LABEL"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
required="true">
|
required="true">
|
||||||
@ -169,10 +149,16 @@
|
|||||||
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
||||||
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
||||||
</field>
|
</field>
|
||||||
<!-- Add_css_document Field. Type: Radio. (joomla)-->
|
<!-- Icon Field. Type: Media. (joomla)-->
|
||||||
|
<field type="media"
|
||||||
|
name="icon"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ICON_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ICON_DESCRIPTION"
|
||||||
|
directory="" />
|
||||||
|
<!-- Add_js_document Field. Type: Radio. (joomla)-->
|
||||||
<field type="radio"
|
<field type="radio"
|
||||||
name="add_css_document"
|
name="add_js_document"
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CSS_DOCUMENT_LABEL"
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JS_DOCUMENT_LABEL"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
required="true">
|
required="true">
|
||||||
@ -191,6 +177,31 @@
|
|||||||
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
||||||
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
||||||
</field>
|
</field>
|
||||||
|
<!-- Note_add_language_string Field. Type: Note. A None Database Field. (joomla)-->
|
||||||
|
<field type="note"
|
||||||
|
name="note_add_language_string"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_LANGUAGE_STRING_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_ADD_LANGUAGE_STRING_DESCRIPTION"
|
||||||
|
heading="h4"
|
||||||
|
class="note_add_language_string" />
|
||||||
|
<!-- Add_php_jview_display Field. Type: Radio. (joomla)-->
|
||||||
|
<field type="radio"
|
||||||
|
name="add_php_jview_display"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
|
required="true">
|
||||||
|
<!-- Option Set.-->
|
||||||
|
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
||||||
|
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
||||||
|
</field>
|
||||||
|
<!-- Note_libraries_selection Field. Type: Note. A None Database Field. (joomla)-->
|
||||||
|
<field type="note"
|
||||||
|
name="note_libraries_selection"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LIBRARIES_SELECTION_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_LIBRARIES_SELECTION_DESCRIPTION"
|
||||||
|
heading="h4"
|
||||||
|
class="alert alert-info note_libraries_selection" />
|
||||||
<!-- Libraries Field. Type: Libraries. (custom)-->
|
<!-- Libraries Field. Type: Libraries. (custom)-->
|
||||||
<field type="libraries"
|
<field type="libraries"
|
||||||
name="libraries"
|
name="libraries"
|
||||||
@ -201,10 +212,27 @@
|
|||||||
default="0"
|
default="0"
|
||||||
required="false"
|
required="false"
|
||||||
button="true" />
|
button="true" />
|
||||||
<!-- Add_php_jview_display Field. Type: Radio. (joomla)-->
|
<!-- Add_css Field. Type: Radio. (joomla)-->
|
||||||
<field type="radio"
|
<field type="radio"
|
||||||
name="add_php_jview_display"
|
name="add_css"
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL"
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CSS_LABEL"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
|
required="true">
|
||||||
|
<!-- Option Set.-->
|
||||||
|
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
||||||
|
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
||||||
|
</field>
|
||||||
|
<!-- Note_uikit_snippet Field. Type: Note. A None Database Field. (joomla)-->
|
||||||
|
<field type="note"
|
||||||
|
name="note_uikit_snippet"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_UIKIT_SNIPPET_LABEL"
|
||||||
|
heading="h4"
|
||||||
|
class="snippet-code note_uikit_snippet" />
|
||||||
|
<!-- Add_php_view Field. Type: Radio. (joomla)-->
|
||||||
|
<field type="radio"
|
||||||
|
name="add_php_view"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_VIEW_LABEL"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
required="true">
|
required="true">
|
||||||
@ -223,27 +251,10 @@
|
|||||||
filter="raw"
|
filter="raw"
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_CONTROLLER_HINT"
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_CONTROLLER_HINT"
|
||||||
required="false" />
|
required="false" />
|
||||||
<!-- Add_js_document Field. Type: Radio. (joomla)-->
|
<!-- Add_php_jview Field. Type: Radio. (joomla)-->
|
||||||
<field type="radio"
|
<field type="radio"
|
||||||
name="add_js_document"
|
name="add_php_jview"
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JS_DOCUMENT_LABEL"
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_LABEL"
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
|
||||||
required="true">
|
|
||||||
<!-- Option Set.-->
|
|
||||||
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
|
||||||
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
|
||||||
</field>
|
|
||||||
<!-- Note_uikit_snippet Field. Type: Note. A None Database Field. (joomla)-->
|
|
||||||
<field type="note"
|
|
||||||
name="note_uikit_snippet"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_UIKIT_SNIPPET_LABEL"
|
|
||||||
heading="h4"
|
|
||||||
class="snippet-code note_uikit_snippet" />
|
|
||||||
<!-- Add_css Field. Type: Radio. (joomla)-->
|
|
||||||
<field type="radio"
|
|
||||||
name="add_css"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CSS_LABEL"
|
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="0"
|
||||||
required="true">
|
required="true">
|
||||||
@ -257,6 +268,159 @@
|
|||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_SNIPPET_USAGE_LABEL"
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NOTE_SNIPPET_USAGE_LABEL"
|
||||||
heading="h4"
|
heading="h4"
|
||||||
class="snippet-usage note_snippet_usage" />
|
class="snippet-usage note_snippet_usage" />
|
||||||
|
<!-- Default Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="default"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DEFAULT_LABEL"
|
||||||
|
rows="20"
|
||||||
|
cols="15"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DEFAULT_HINT"
|
||||||
|
required="true" />
|
||||||
|
<!-- Php_model Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="php_model"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_MODEL_LABEL"
|
||||||
|
rows="30"
|
||||||
|
cols="15"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_MODEL_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_MODEL_HINT"
|
||||||
|
required="false" />
|
||||||
|
<!-- Add_javascript_file Field. Type: Radio. (joomla)-->
|
||||||
|
<field type="radio"
|
||||||
|
name="add_javascript_file"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JAVASCRIPT_FILE_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JAVASCRIPT_FILE_DESCRIPTION"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
|
required="true">
|
||||||
|
<!-- Option Set.-->
|
||||||
|
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
||||||
|
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
||||||
|
</field>
|
||||||
|
<!-- Js_document Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="js_document"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_LABEL"
|
||||||
|
rows="17"
|
||||||
|
cols="5"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_HINT"
|
||||||
|
required="true" />
|
||||||
|
<!-- Not_required Field. Type: Hidden. (joomla)-->
|
||||||
|
<field type="hidden"
|
||||||
|
name="not_required"
|
||||||
|
default="[]" />
|
||||||
|
<!-- Javascript_file Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="javascript_file"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JAVASCRIPT_FILE_LABEL"
|
||||||
|
rows="30"
|
||||||
|
cols="15"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JAVASCRIPT_FILE_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JAVASCRIPT_FILE_HINT"
|
||||||
|
required="true" />
|
||||||
|
<!-- Custom_get Field. Type: Customgets. (custom)-->
|
||||||
|
<field type="customgets"
|
||||||
|
name="custom_get"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_GET_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_GET_DESCRIPTION"
|
||||||
|
multiple="true" />
|
||||||
|
<!-- Css_document Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="css_document"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_DOCUMENT_LABEL"
|
||||||
|
rows="17"
|
||||||
|
cols="5"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_DOCUMENT_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_DOCUMENT_HINT"
|
||||||
|
required="true" />
|
||||||
|
<!-- Main_get Field. Type: Maingets. (custom)-->
|
||||||
|
<field type="maingets"
|
||||||
|
name="main_get"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_MAIN_GET_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_MAIN_GET_DESCRIPTION"
|
||||||
|
multiple="false"
|
||||||
|
required="true"
|
||||||
|
button="true" />
|
||||||
|
<!-- Css Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="css"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_LABEL"
|
||||||
|
rows="30"
|
||||||
|
cols="15"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_HINT"
|
||||||
|
required="true" />
|
||||||
|
<!-- Dynamic_get Field. Type: Dynamicgets. (custom)-->
|
||||||
|
<field type="dynamicgets"
|
||||||
|
name="dynamic_get"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DYNAMIC_GET_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DYNAMIC_GET_DESCRIPTION"
|
||||||
|
multiple="false"
|
||||||
|
required="false" />
|
||||||
|
<!-- Php_document Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="php_document"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_DOCUMENT_LABEL"
|
||||||
|
rows="17"
|
||||||
|
cols="5"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_DOCUMENT_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_DOCUMENT_HINT"
|
||||||
|
required="true" />
|
||||||
|
<!-- Dynamic_values Field. Type: Note. A None Database Field. (joomla)-->
|
||||||
|
<field type="note"
|
||||||
|
name="dynamic_values"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DYNAMIC_VALUES_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DYNAMIC_VALUES_DESCRIPTION"
|
||||||
|
heading="h4"
|
||||||
|
class="dynamic_values" />
|
||||||
|
<!-- Php_view Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="php_view"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_VIEW_LABEL"
|
||||||
|
rows="17"
|
||||||
|
cols="5"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_VIEW_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_VIEW_HINT"
|
||||||
|
required="true" />
|
||||||
|
<!-- Add_custom_button Field. Type: Radio. (joomla)-->
|
||||||
|
<field type="radio"
|
||||||
|
name="add_custom_button"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
|
required="true">
|
||||||
|
<!-- Option Set.-->
|
||||||
|
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
||||||
|
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
||||||
|
</field>
|
||||||
|
<!-- Php_jview_display Field. Type: Textarea. (joomla)-->
|
||||||
|
<field type="textarea"
|
||||||
|
name="php_jview_display"
|
||||||
|
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_JVIEW_DISPLAY_LABEL"
|
||||||
|
rows="17"
|
||||||
|
cols="5"
|
||||||
|
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_JVIEW_DISPLAY_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_JVIEW_DISPLAY_HINT"
|
||||||
|
required="true" />
|
||||||
<!-- Custom_button Field. Type: Subform. (joomla)-->
|
<!-- Custom_button Field. Type: Subform. (joomla)-->
|
||||||
<field type="subform"
|
<field type="subform"
|
||||||
name="custom_button"
|
name="custom_button"
|
||||||
@ -544,89 +708,6 @@
|
|||||||
</field>
|
</field>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
<!-- Default Field. Type: Textarea. (joomla)-->
|
|
||||||
<field type="textarea"
|
|
||||||
name="default"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DEFAULT_LABEL"
|
|
||||||
rows="20"
|
|
||||||
cols="15"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DEFAULT_HINT"
|
|
||||||
required="true" />
|
|
||||||
<!-- Php_model Field. Type: Textarea. (joomla)-->
|
|
||||||
<field type="textarea"
|
|
||||||
name="php_model"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_MODEL_LABEL"
|
|
||||||
rows="30"
|
|
||||||
cols="15"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_MODEL_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_MODEL_HINT"
|
|
||||||
required="false" />
|
|
||||||
<!-- Add_php_view Field. Type: Radio. (joomla)-->
|
|
||||||
<field type="radio"
|
|
||||||
name="add_php_view"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_VIEW_LABEL"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
|
||||||
required="true">
|
|
||||||
<!-- Option Set.-->
|
|
||||||
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
|
||||||
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
|
||||||
</field>
|
|
||||||
<!-- Php_document Field. Type: Textarea. (joomla)-->
|
|
||||||
<field type="textarea"
|
|
||||||
name="php_document"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_DOCUMENT_LABEL"
|
|
||||||
rows="17"
|
|
||||||
cols="5"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_DOCUMENT_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_DOCUMENT_HINT"
|
|
||||||
required="true" />
|
|
||||||
<!-- Not_required Field. Type: Hidden. (joomla)-->
|
|
||||||
<field type="hidden"
|
|
||||||
name="not_required"
|
|
||||||
default="[]" />
|
|
||||||
<!-- Php_view Field. Type: Textarea. (joomla)-->
|
|
||||||
<field type="textarea"
|
|
||||||
name="php_view"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_VIEW_LABEL"
|
|
||||||
rows="17"
|
|
||||||
cols="5"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_VIEW_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_VIEW_HINT"
|
|
||||||
required="true" />
|
|
||||||
<!-- Custom_get Field. Type: Customgets. (custom)-->
|
|
||||||
<field type="customgets"
|
|
||||||
name="custom_get"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_GET_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CUSTOM_GET_DESCRIPTION"
|
|
||||||
multiple="true" />
|
|
||||||
<!-- Php_jview_display Field. Type: Textarea. (joomla)-->
|
|
||||||
<field type="textarea"
|
|
||||||
name="php_jview_display"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_JVIEW_DISPLAY_LABEL"
|
|
||||||
rows="17"
|
|
||||||
cols="5"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_JVIEW_DISPLAY_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_JVIEW_DISPLAY_HINT"
|
|
||||||
required="true" />
|
|
||||||
<!-- Main_get Field. Type: Maingets. (custom)-->
|
|
||||||
<field type="maingets"
|
|
||||||
name="main_get"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_MAIN_GET_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_MAIN_GET_DESCRIPTION"
|
|
||||||
multiple="false"
|
|
||||||
required="true"
|
|
||||||
button="true" />
|
|
||||||
<!-- Php_jview Field. Type: Textarea. (joomla)-->
|
<!-- Php_jview Field. Type: Textarea. (joomla)-->
|
||||||
<field type="textarea"
|
<field type="textarea"
|
||||||
name="php_jview"
|
name="php_jview"
|
||||||
@ -638,64 +719,6 @@
|
|||||||
filter="raw"
|
filter="raw"
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_JVIEW_HINT"
|
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_PHP_JVIEW_HINT"
|
||||||
required="true" />
|
required="true" />
|
||||||
<!-- Dynamic_get Field. Type: Dynamicgets. (custom)-->
|
|
||||||
<field type="dynamicgets"
|
|
||||||
name="dynamic_get"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DYNAMIC_GET_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DYNAMIC_GET_DESCRIPTION"
|
|
||||||
multiple="false"
|
|
||||||
required="false" />
|
|
||||||
<!-- Js_document Field. Type: Textarea. (joomla)-->
|
|
||||||
<field type="textarea"
|
|
||||||
name="js_document"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_LABEL"
|
|
||||||
rows="17"
|
|
||||||
cols="5"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_JS_DOCUMENT_HINT"
|
|
||||||
required="true" />
|
|
||||||
<!-- Dynamic_values Field. Type: Note. A None Database Field. (joomla)-->
|
|
||||||
<field type="note"
|
|
||||||
name="dynamic_values"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DYNAMIC_VALUES_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_DYNAMIC_VALUES_DESCRIPTION"
|
|
||||||
heading="h4"
|
|
||||||
class="dynamic_values" />
|
|
||||||
<!-- Css_document Field. Type: Textarea. (joomla)-->
|
|
||||||
<field type="textarea"
|
|
||||||
name="css_document"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_DOCUMENT_LABEL"
|
|
||||||
rows="17"
|
|
||||||
cols="5"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_DOCUMENT_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_DOCUMENT_HINT"
|
|
||||||
required="true" />
|
|
||||||
<!-- Add_custom_button Field. Type: Radio. (joomla)-->
|
|
||||||
<field type="radio"
|
|
||||||
name="add_custom_button"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_CUSTOM_BUTTON_LABEL"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
|
||||||
required="true">
|
|
||||||
<!-- Option Set.-->
|
|
||||||
<option value="1">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_YES</option>
|
|
||||||
<option value="0">COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NO</option>
|
|
||||||
</field>
|
|
||||||
<!-- Css Field. Type: Textarea. (joomla)-->
|
|
||||||
<field type="textarea"
|
|
||||||
name="css"
|
|
||||||
label="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_LABEL"
|
|
||||||
rows="30"
|
|
||||||
cols="15"
|
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_CSS_HINT"
|
|
||||||
required="true" />
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<!-- Access Control Fields. -->
|
<!-- Access Control Fields. -->
|
||||||
|
@ -23,43 +23,43 @@
|
|||||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Some Global Values
|
// Some Global Values
|
||||||
jform_vvvvvzqvzi_required = false;
|
jform_vvvvvzsvzk_required = false;
|
||||||
jform_vvvvvzrvzj_required = false;
|
jform_vvvvvztvzl_required = false;
|
||||||
jform_vvvvvzrvzk_required = false;
|
jform_vvvvvztvzm_required = false;
|
||||||
jform_vvvvvzrvzl_required = false;
|
jform_vvvvvztvzn_required = false;
|
||||||
|
|
||||||
// Initial Script
|
// Initial Script
|
||||||
jQuery(document).ready(function()
|
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 target_vvvvvzs = jQuery("#jform_target input[type='radio']:checked").val();
|
||||||
var type_vvvvvzs = jQuery("#jform_type input[type='radio']:checked").val();
|
vvvvvzs(target_vvvvvzs);
|
||||||
vvvvvzs(target_vvvvvzs,type_vvvvvzs);
|
|
||||||
|
|
||||||
var type_vvvvvzt = jQuery("#jform_type input[type='radio']:checked").val();
|
|
||||||
var target_vvvvvzt = jQuery("#jform_target 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
|
// the vvvvvzs function
|
||||||
function vvvvvzq(target_vvvvvzq)
|
function vvvvvzs(target_vvvvvzs)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// set the function logic
|
||||||
if (target_vvvvvzq == 2)
|
if (target_vvvvvzs == 2)
|
||||||
{
|
{
|
||||||
jQuery('#jform_function_name').closest('.control-group').show();
|
jQuery('#jform_function_name').closest('.control-group').show();
|
||||||
if (jform_vvvvvzqvzi_required)
|
if (jform_vvvvvzsvzk_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('function_name',0);
|
updateFieldRequired('function_name',0);
|
||||||
jQuery('#jform_function_name').prop('required','required');
|
jQuery('#jform_function_name').prop('required','required');
|
||||||
jQuery('#jform_function_name').attr('aria-required',true);
|
jQuery('#jform_function_name').attr('aria-required',true);
|
||||||
jQuery('#jform_function_name').addClass('required');
|
jQuery('#jform_function_name').addClass('required');
|
||||||
jform_vvvvvzqvzi_required = false;
|
jform_vvvvvzsvzk_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('.note_jcb_placeholder').closest('.control-group').show();
|
jQuery('.note_jcb_placeholder').closest('.control-group').show();
|
||||||
@ -68,99 +68,99 @@ function vvvvvzq(target_vvvvvzq)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_function_name').closest('.control-group').hide();
|
jQuery('#jform_function_name').closest('.control-group').hide();
|
||||||
if (!jform_vvvvvzqvzi_required)
|
if (!jform_vvvvvzsvzk_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('function_name',1);
|
updateFieldRequired('function_name',1);
|
||||||
jQuery('#jform_function_name').removeAttr('required');
|
jQuery('#jform_function_name').removeAttr('required');
|
||||||
jQuery('#jform_function_name').removeAttr('aria-required');
|
jQuery('#jform_function_name').removeAttr('aria-required');
|
||||||
jQuery('#jform_function_name').removeClass('required');
|
jQuery('#jform_function_name').removeClass('required');
|
||||||
jform_vvvvvzqvzi_required = true;
|
jform_vvvvvzsvzk_required = true;
|
||||||
}
|
}
|
||||||
jQuery('.note_jcb_placeholder').closest('.control-group').hide();
|
jQuery('.note_jcb_placeholder').closest('.control-group').hide();
|
||||||
jQuery('#jform_system_name').closest('.control-group').hide();
|
jQuery('#jform_system_name').closest('.control-group').hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvvzr function
|
// the vvvvvzt function
|
||||||
function vvvvvzr(target_vvvvvzr)
|
function vvvvvzt(target_vvvvvzt)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// set the function logic
|
||||||
if (target_vvvvvzr == 1)
|
if (target_vvvvvzt == 1)
|
||||||
{
|
{
|
||||||
jQuery('#jform_component').closest('.control-group').show();
|
jQuery('#jform_component').closest('.control-group').show();
|
||||||
if (jform_vvvvvzrvzj_required)
|
if (jform_vvvvvztvzl_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('component',0);
|
updateFieldRequired('component',0);
|
||||||
jQuery('#jform_component').prop('required','required');
|
jQuery('#jform_component').prop('required','required');
|
||||||
jQuery('#jform_component').attr('aria-required',true);
|
jQuery('#jform_component').attr('aria-required',true);
|
||||||
jQuery('#jform_component').addClass('required');
|
jQuery('#jform_component').addClass('required');
|
||||||
jform_vvvvvzrvzj_required = false;
|
jform_vvvvvztvzl_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('#jform_path').closest('.control-group').show();
|
jQuery('#jform_path').closest('.control-group').show();
|
||||||
if (jform_vvvvvzrvzk_required)
|
if (jform_vvvvvztvzm_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('path',0);
|
updateFieldRequired('path',0);
|
||||||
jQuery('#jform_path').prop('required','required');
|
jQuery('#jform_path').prop('required','required');
|
||||||
jQuery('#jform_path').attr('aria-required',true);
|
jQuery('#jform_path').attr('aria-required',true);
|
||||||
jQuery('#jform_path').addClass('required');
|
jQuery('#jform_path').addClass('required');
|
||||||
jform_vvvvvzrvzk_required = false;
|
jform_vvvvvztvzm_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('#jform_from_line').closest('.control-group').show();
|
jQuery('#jform_from_line').closest('.control-group').show();
|
||||||
jQuery('#jform_hashtarget').closest('.control-group').show();
|
jQuery('#jform_hashtarget').closest('.control-group').show();
|
||||||
jQuery('#jform_to_line').closest('.control-group').show();
|
jQuery('#jform_to_line').closest('.control-group').show();
|
||||||
jQuery('#jform_type').closest('.control-group').show();
|
jQuery('#jform_type').closest('.control-group').show();
|
||||||
if (jform_vvvvvzrvzl_required)
|
if (jform_vvvvvztvzn_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('type',0);
|
updateFieldRequired('type',0);
|
||||||
jQuery('#jform_type').prop('required','required');
|
jQuery('#jform_type').prop('required','required');
|
||||||
jQuery('#jform_type').attr('aria-required',true);
|
jQuery('#jform_type').attr('aria-required',true);
|
||||||
jQuery('#jform_type').addClass('required');
|
jQuery('#jform_type').addClass('required');
|
||||||
jform_vvvvvzrvzl_required = false;
|
jform_vvvvvztvzn_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_component').closest('.control-group').hide();
|
jQuery('#jform_component').closest('.control-group').hide();
|
||||||
if (!jform_vvvvvzrvzj_required)
|
if (!jform_vvvvvztvzl_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('component',1);
|
updateFieldRequired('component',1);
|
||||||
jQuery('#jform_component').removeAttr('required');
|
jQuery('#jform_component').removeAttr('required');
|
||||||
jQuery('#jform_component').removeAttr('aria-required');
|
jQuery('#jform_component').removeAttr('aria-required');
|
||||||
jQuery('#jform_component').removeClass('required');
|
jQuery('#jform_component').removeClass('required');
|
||||||
jform_vvvvvzrvzj_required = true;
|
jform_vvvvvztvzl_required = true;
|
||||||
}
|
}
|
||||||
jQuery('#jform_path').closest('.control-group').hide();
|
jQuery('#jform_path').closest('.control-group').hide();
|
||||||
if (!jform_vvvvvzrvzk_required)
|
if (!jform_vvvvvztvzm_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('path',1);
|
updateFieldRequired('path',1);
|
||||||
jQuery('#jform_path').removeAttr('required');
|
jQuery('#jform_path').removeAttr('required');
|
||||||
jQuery('#jform_path').removeAttr('aria-required');
|
jQuery('#jform_path').removeAttr('aria-required');
|
||||||
jQuery('#jform_path').removeClass('required');
|
jQuery('#jform_path').removeClass('required');
|
||||||
jform_vvvvvzrvzk_required = true;
|
jform_vvvvvztvzm_required = true;
|
||||||
}
|
}
|
||||||
jQuery('#jform_from_line').closest('.control-group').hide();
|
jQuery('#jform_from_line').closest('.control-group').hide();
|
||||||
jQuery('#jform_hashtarget').closest('.control-group').hide();
|
jQuery('#jform_hashtarget').closest('.control-group').hide();
|
||||||
jQuery('#jform_to_line').closest('.control-group').hide();
|
jQuery('#jform_to_line').closest('.control-group').hide();
|
||||||
jQuery('#jform_type').closest('.control-group').hide();
|
jQuery('#jform_type').closest('.control-group').hide();
|
||||||
if (!jform_vvvvvzrvzl_required)
|
if (!jform_vvvvvztvzn_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('type',1);
|
updateFieldRequired('type',1);
|
||||||
jQuery('#jform_type').removeAttr('required');
|
jQuery('#jform_type').removeAttr('required');
|
||||||
jQuery('#jform_type').removeAttr('aria-required');
|
jQuery('#jform_type').removeAttr('aria-required');
|
||||||
jQuery('#jform_type').removeClass('required');
|
jQuery('#jform_type').removeClass('required');
|
||||||
jform_vvvvvzrvzl_required = true;
|
jform_vvvvvztvzn_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvvzs function
|
// the vvvvvzu function
|
||||||
function vvvvvzs(target_vvvvvzs,type_vvvvvzs)
|
function vvvvvzu(target_vvvvvzu,type_vvvvvzu)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// 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_hashendtarget').closest('.control-group').show();
|
||||||
jQuery('#jform_to_line').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
|
// the vvvvvzv function
|
||||||
function vvvvvzt(type_vvvvvzt,target_vvvvvzt)
|
function vvvvvzv(type_vvvvvzv,target_vvvvvzv)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// 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_hashendtarget').closest('.control-group').show();
|
||||||
jQuery('#jform_to_line').closest('.control-group').show();
|
jQuery('#jform_to_line').closest('.control-group').show();
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -23,210 +23,96 @@
|
|||||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Some Global Values
|
// Some Global Values
|
||||||
jform_vvvvwacvzo_required = false;
|
|
||||||
jform_vvvvwadvzp_required = false;
|
|
||||||
jform_vvvvwaevzq_required = false;
|
jform_vvvvwaevzq_required = false;
|
||||||
jform_vvvvwafvzr_required = false;
|
jform_vvvvwafvzr_required = false;
|
||||||
jform_vvvvwaivzs_required = false;
|
jform_vvvvwagvzs_required = false;
|
||||||
jform_vvvvwajvzt_required = false;
|
jform_vvvvwahvzt_required = false;
|
||||||
jform_vvvvwakvzu_required = false;
|
jform_vvvvwakvzu_required = false;
|
||||||
jform_vvvvwalvzv_required = false;
|
jform_vvvvwalvzv_required = false;
|
||||||
|
jform_vvvvwamvzw_required = false;
|
||||||
|
jform_vvvvwanvzx_required = false;
|
||||||
|
|
||||||
// Initial Script
|
// Initial Script
|
||||||
jQuery(document).ready(function()
|
jQuery(document).ready(function()
|
||||||
{
|
{
|
||||||
var datalenght_vvvvwac = jQuery("#jform_datalenght").val();
|
var datalenght_vvvvwae = jQuery("#jform_datalenght").val();
|
||||||
vvvvwac(datalenght_vvvvwac);
|
vvvvwae(datalenght_vvvvwae);
|
||||||
|
|
||||||
var datadefault_vvvvwad = jQuery("#jform_datadefault").val();
|
var datadefault_vvvvwaf = jQuery("#jform_datadefault").val();
|
||||||
vvvvwad(datadefault_vvvvwad);
|
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();
|
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();
|
var datatype_vvvvwah = jQuery("#jform_datatype").val();
|
||||||
vvvvwai(add_css_view_vvvvwai);
|
vvvvwah(datatype_vvvvwah);
|
||||||
|
|
||||||
var add_css_views_vvvvwaj = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
var store_vvvvwai = jQuery("#jform_store").val();
|
||||||
vvvvwaj(add_css_views_vvvvwaj);
|
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();
|
var add_css_view_vvvvwak = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
||||||
vvvvwak(add_javascript_view_footer_vvvvwak);
|
vvvvwak(add_css_view_vvvvwak);
|
||||||
|
|
||||||
var add_javascript_views_footer_vvvvwal = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
|
var add_css_views_vvvvwal = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
||||||
vvvvwal(add_javascript_views_footer_vvvvwal);
|
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
|
// the vvvvwae function
|
||||||
function vvvvwac(datalenght_vvvvwac)
|
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 temp_vvvvwae = datalenght_vvvvwae;
|
||||||
var datalenght_vvvvwac = [];
|
var datalenght_vvvvwae = [];
|
||||||
datalenght_vvvvwac.push(temp_vvvvwac);
|
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
|
// set this function logic
|
||||||
if (datalenght)
|
if (datalenght)
|
||||||
{
|
{
|
||||||
jQuery('#jform_datalenght_other').closest('.control-group').show();
|
jQuery('#jform_datalenght_other').closest('.control-group').show();
|
||||||
if (jform_vvvvwacvzo_required)
|
if (jform_vvvvwaevzq_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('datalenght_other',0);
|
updateFieldRequired('datalenght_other',0);
|
||||||
jQuery('#jform_datalenght_other').prop('required','required');
|
jQuery('#jform_datalenght_other').prop('required','required');
|
||||||
jQuery('#jform_datalenght_other').attr('aria-required',true);
|
jQuery('#jform_datalenght_other').attr('aria-required',true);
|
||||||
jQuery('#jform_datalenght_other').addClass('required');
|
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;
|
jform_vvvvwaevzq_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_datadefault').closest('.control-group').hide();
|
jQuery('#jform_datalenght_other').closest('.control-group').hide();
|
||||||
jQuery('#jform_datalenght').closest('.control-group').hide();
|
|
||||||
jQuery('#jform_indexes').closest('.control-group').hide();
|
|
||||||
if (!jform_vvvvwaevzq_required)
|
if (!jform_vvvvwaevzq_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('indexes',1);
|
updateFieldRequired('datalenght_other',1);
|
||||||
jQuery('#jform_indexes').removeAttr('required');
|
jQuery('#jform_datalenght_other').removeAttr('required');
|
||||||
jQuery('#jform_indexes').removeAttr('aria-required');
|
jQuery('#jform_datalenght_other').removeAttr('aria-required');
|
||||||
jQuery('#jform_indexes').removeClass('required');
|
jQuery('#jform_datalenght_other').removeClass('required');
|
||||||
jform_vvvvwaevzq_required = true;
|
jform_vvvvwaevzq_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwae Some function
|
// the vvvvwae Some function
|
||||||
function datatype_vvvvwae_SomeFunc(datatype_vvvvwae)
|
function datalenght_vvvvwae_SomeFunc(datalenght_vvvvwae)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
@ -234,54 +120,54 @@ function datatype_vvvvwae_SomeFunc(datatype_vvvvwae)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwaf function
|
// 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 temp_vvvvwaf = datadefault_vvvvwaf;
|
||||||
var datatype_vvvvwaf = [];
|
var datadefault_vvvvwaf = [];
|
||||||
datatype_vvvvwaf.push(temp_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
|
// 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)
|
if (jform_vvvvwafvzr_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('store',0);
|
updateFieldRequired('datadefault_other',0);
|
||||||
jQuery('#jform_store').prop('required','required');
|
jQuery('#jform_datadefault_other').prop('required','required');
|
||||||
jQuery('#jform_store').attr('aria-required',true);
|
jQuery('#jform_datadefault_other').attr('aria-required',true);
|
||||||
jQuery('#jform_store').addClass('required');
|
jQuery('#jform_datadefault_other').addClass('required');
|
||||||
jform_vvvvwafvzr_required = false;
|
jform_vvvvwafvzr_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_store').closest('.control-group').hide();
|
jQuery('#jform_datadefault_other').closest('.control-group').hide();
|
||||||
if (!jform_vvvvwafvzr_required)
|
if (!jform_vvvvwafvzr_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('store',1);
|
updateFieldRequired('datadefault_other',1);
|
||||||
jQuery('#jform_store').removeAttr('required');
|
jQuery('#jform_datadefault_other').removeAttr('required');
|
||||||
jQuery('#jform_store').removeAttr('aria-required');
|
jQuery('#jform_datadefault_other').removeAttr('aria-required');
|
||||||
jQuery('#jform_store').removeClass('required');
|
jQuery('#jform_datadefault_other').removeClass('required');
|
||||||
jform_vvvvwafvzr_required = true;
|
jform_vvvvwafvzr_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwaf Some function
|
// the vvvvwaf Some function
|
||||||
function datatype_vvvvwaf_SomeFunc(datatype_vvvvwaf)
|
function datadefault_vvvvwaf_SomeFunc(datadefault_vvvvwaf)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
@ -289,20 +175,8 @@ function datatype_vvvvwaf_SomeFunc(datatype_vvvvwaf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwag function
|
// 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)
|
if (isSet(datatype_vvvvwag) && datatype_vvvvwag.constructor !== Array)
|
||||||
{
|
{
|
||||||
var temp_vvvvwag = datatype_vvvvwag;
|
var temp_vvvvwag = datatype_vvvvwag;
|
||||||
@ -316,6 +190,132 @@ function vvvvwag(store_vvvvwag,datatype_vvvvwag)
|
|||||||
var datatype = datatype_vvvvwag.some(datatype_vvvvwag_SomeFunc);
|
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
|
// set this function logic
|
||||||
if (store && datatype)
|
if (store && datatype)
|
||||||
{
|
{
|
||||||
@ -327,148 +327,148 @@ function vvvvwag(store_vvvvwag,datatype_vvvvwag)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwag Some function
|
// the vvvvwai Some function
|
||||||
function store_vvvvwag_SomeFunc(store_vvvvwag)
|
function store_vvvvwai_SomeFunc(store_vvvvwai)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// set the function logic
|
||||||
if (store_vvvvwag == 4)
|
if (store_vvvvwai == 4)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwag Some function
|
// the vvvvwai Some function
|
||||||
function datatype_vvvvwag_SomeFunc(datatype_vvvvwag)
|
function datatype_vvvvwai_SomeFunc(datatype_vvvvwai)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// 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 true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwai function
|
// the vvvvwak function
|
||||||
function vvvvwai(add_css_view_vvvvwai)
|
function vvvvwak(add_css_view_vvvvwak)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// set the function logic
|
||||||
if (add_css_view_vvvvwai == 1)
|
if (add_css_view_vvvvwak == 1)
|
||||||
{
|
{
|
||||||
jQuery('#jform_css_view').closest('.control-group').show();
|
jQuery('#jform_css_view').closest('.control-group').show();
|
||||||
if (jform_vvvvwaivzs_required)
|
if (jform_vvvvwakvzu_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('css_view',0);
|
updateFieldRequired('css_view',0);
|
||||||
jQuery('#jform_css_view').prop('required','required');
|
jQuery('#jform_css_view').prop('required','required');
|
||||||
jQuery('#jform_css_view').attr('aria-required',true);
|
jQuery('#jform_css_view').attr('aria-required',true);
|
||||||
jQuery('#jform_css_view').addClass('required');
|
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;
|
jform_vvvvwakvzu_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_javascript_view_footer').closest('.control-group').hide();
|
jQuery('#jform_css_view').closest('.control-group').hide();
|
||||||
if (!jform_vvvvwakvzu_required)
|
if (!jform_vvvvwakvzu_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('javascript_view_footer',1);
|
updateFieldRequired('css_view',1);
|
||||||
jQuery('#jform_javascript_view_footer').removeAttr('required');
|
jQuery('#jform_css_view').removeAttr('required');
|
||||||
jQuery('#jform_javascript_view_footer').removeAttr('aria-required');
|
jQuery('#jform_css_view').removeAttr('aria-required');
|
||||||
jQuery('#jform_javascript_view_footer').removeClass('required');
|
jQuery('#jform_css_view').removeClass('required');
|
||||||
jform_vvvvwakvzu_required = true;
|
jform_vvvvwakvzu_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwal function
|
// the vvvvwal function
|
||||||
function vvvvwal(add_javascript_views_footer_vvvvwal)
|
function vvvvwal(add_css_views_vvvvwal)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// 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)
|
if (jform_vvvvwalvzv_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('javascript_views_footer',0);
|
updateFieldRequired('css_views',0);
|
||||||
jQuery('#jform_javascript_views_footer').prop('required','required');
|
jQuery('#jform_css_views').prop('required','required');
|
||||||
jQuery('#jform_javascript_views_footer').attr('aria-required',true);
|
jQuery('#jform_css_views').attr('aria-required',true);
|
||||||
jQuery('#jform_javascript_views_footer').addClass('required');
|
jQuery('#jform_css_views').addClass('required');
|
||||||
jform_vvvvwalvzv_required = false;
|
jform_vvvvwalvzv_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_javascript_views_footer').closest('.control-group').hide();
|
jQuery('#jform_css_views').closest('.control-group').hide();
|
||||||
if (!jform_vvvvwalvzv_required)
|
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);
|
updateFieldRequired('javascript_views_footer',1);
|
||||||
jQuery('#jform_javascript_views_footer').removeAttr('required');
|
jQuery('#jform_javascript_views_footer').removeAttr('required');
|
||||||
jQuery('#jform_javascript_views_footer').removeAttr('aria-required');
|
jQuery('#jform_javascript_views_footer').removeAttr('aria-required');
|
||||||
jQuery('#jform_javascript_views_footer').removeClass('required');
|
jQuery('#jform_javascript_views_footer').removeClass('required');
|
||||||
jform_vvvvwalvzv_required = true;
|
jform_vvvvwanvzx_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,207 +23,97 @@
|
|||||||
/-----------------------------------------------------------------------------------------------------------------------------*/
|
/-----------------------------------------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// Some Global Values
|
// Some Global Values
|
||||||
jform_vvvvwamvzy_required = false;
|
|
||||||
jform_vvvvwanvzz_required = false;
|
|
||||||
jform_vvvvwaowaa_required = false;
|
jform_vvvvwaowaa_required = false;
|
||||||
jform_vvvvwapwab_required = false;
|
jform_vvvvwapwab_required = false;
|
||||||
jform_vvvvwaqwac_required = false;
|
jform_vvvvwaqwac_required = false;
|
||||||
jform_vvvvwarwad_required = false;
|
jform_vvvvwarwad_required = false;
|
||||||
|
jform_vvvvwaswae_required = false;
|
||||||
|
jform_vvvvwatwaf_required = false;
|
||||||
|
|
||||||
// Initial Script
|
// Initial Script
|
||||||
jQuery(document).ready(function()
|
jQuery(document).ready(function()
|
||||||
{
|
{
|
||||||
var location_vvvvwam = jQuery("#jform_location input[type='radio']:checked").val();
|
var location_vvvvwao = jQuery("#jform_location input[type='radio']:checked").val();
|
||||||
vvvvwam(location_vvvvwam);
|
vvvvwao(location_vvvvwao);
|
||||||
|
|
||||||
var location_vvvvwan = jQuery("#jform_location input[type='radio']:checked").val();
|
var location_vvvvwap = jQuery("#jform_location input[type='radio']:checked").val();
|
||||||
vvvvwan(location_vvvvwan);
|
vvvvwap(location_vvvvwap);
|
||||||
|
|
||||||
var type_vvvvwao = jQuery("#jform_type").val();
|
|
||||||
vvvvwao(type_vvvvwao);
|
|
||||||
|
|
||||||
var type_vvvvwap = jQuery("#jform_type").val();
|
|
||||||
vvvvwap(type_vvvvwap);
|
|
||||||
|
|
||||||
var type_vvvvwaq = jQuery("#jform_type").val();
|
var type_vvvvwaq = jQuery("#jform_type").val();
|
||||||
vvvvwaq(type_vvvvwaq);
|
vvvvwaq(type_vvvvwaq);
|
||||||
|
|
||||||
var target_vvvvwar = jQuery("#jform_target input[type='radio']:checked").val();
|
var type_vvvvwar = jQuery("#jform_type").val();
|
||||||
vvvvwar(target_vvvvwar);
|
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
|
// the vvvvwao function
|
||||||
function vvvvwam(location_vvvvwam)
|
function vvvvwao(location_vvvvwao)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// set the function logic
|
||||||
if (location_vvvvwam == 1)
|
if (location_vvvvwao == 1)
|
||||||
{
|
{
|
||||||
jQuery('#jform_admin_view').closest('.control-group').show();
|
jQuery('#jform_admin_view').closest('.control-group').show();
|
||||||
if (jform_vvvvwamvzy_required)
|
if (jform_vvvvwaowaa_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('admin_view',0);
|
updateFieldRequired('admin_view',0);
|
||||||
jQuery('#jform_admin_view').prop('required','required');
|
jQuery('#jform_admin_view').prop('required','required');
|
||||||
jQuery('#jform_admin_view').attr('aria-required',true);
|
jQuery('#jform_admin_view').attr('aria-required',true);
|
||||||
jQuery('#jform_admin_view').addClass('required');
|
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;
|
jform_vvvvwaowaa_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_url').closest('.control-group').hide();
|
jQuery('#jform_admin_view').closest('.control-group').hide();
|
||||||
if (!jform_vvvvwaowaa_required)
|
if (!jform_vvvvwaowaa_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('url',1);
|
updateFieldRequired('admin_view',1);
|
||||||
jQuery('#jform_url').removeAttr('required');
|
jQuery('#jform_admin_view').removeAttr('required');
|
||||||
jQuery('#jform_url').removeAttr('aria-required');
|
jQuery('#jform_admin_view').removeAttr('aria-required');
|
||||||
jQuery('#jform_url').removeClass('required');
|
jQuery('#jform_admin_view').removeClass('required');
|
||||||
jform_vvvvwaowaa_required = true;
|
jform_vvvvwaowaa_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwao Some function
|
// the vvvvwap function
|
||||||
function type_vvvvwao_SomeFunc(type_vvvvwao)
|
function vvvvwap(location_vvvvwap)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// set the function logic
|
||||||
if (type_vvvvwao == 3)
|
if (location_vvvvwap == 2)
|
||||||
{
|
{
|
||||||
return true;
|
jQuery('#jform_site_view').closest('.control-group').show();
|
||||||
}
|
|
||||||
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();
|
|
||||||
if (jform_vvvvwapwab_required)
|
if (jform_vvvvwapwab_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('article',0);
|
updateFieldRequired('site_view',0);
|
||||||
jQuery('#jform_article').prop('required','required');
|
jQuery('#jform_site_view').prop('required','required');
|
||||||
jQuery('#jform_article').attr('aria-required',true);
|
jQuery('#jform_site_view').attr('aria-required',true);
|
||||||
jQuery('#jform_article').addClass('required');
|
jQuery('#jform_site_view').addClass('required');
|
||||||
jform_vvvvwapwab_required = false;
|
jform_vvvvwapwab_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_article').closest('.control-group').hide();
|
jQuery('#jform_site_view').closest('.control-group').hide();
|
||||||
if (!jform_vvvvwapwab_required)
|
if (!jform_vvvvwapwab_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('article',1);
|
updateFieldRequired('site_view',1);
|
||||||
jQuery('#jform_article').removeAttr('required');
|
jQuery('#jform_site_view').removeAttr('required');
|
||||||
jQuery('#jform_article').removeAttr('aria-required');
|
jQuery('#jform_site_view').removeAttr('aria-required');
|
||||||
jQuery('#jform_article').removeClass('required');
|
jQuery('#jform_site_view').removeClass('required');
|
||||||
jform_vvvvwapwab_required = true;
|
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
|
// the vvvvwaq function
|
||||||
function vvvvwaq(type_vvvvwaq)
|
function vvvvwaq(type_vvvvwaq)
|
||||||
{
|
{
|
||||||
@ -243,26 +133,26 @@ function vvvvwaq(type_vvvvwaq)
|
|||||||
// set this function logic
|
// set this function logic
|
||||||
if (type)
|
if (type)
|
||||||
{
|
{
|
||||||
jQuery('#jform_content-lbl').closest('.control-group').show();
|
jQuery('#jform_url').closest('.control-group').show();
|
||||||
if (jform_vvvvwaqwac_required)
|
if (jform_vvvvwaqwac_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('content',0);
|
updateFieldRequired('url',0);
|
||||||
jQuery('#jform_content').prop('required','required');
|
jQuery('#jform_url').prop('required','required');
|
||||||
jQuery('#jform_content').attr('aria-required',true);
|
jQuery('#jform_url').attr('aria-required',true);
|
||||||
jQuery('#jform_content').addClass('required');
|
jQuery('#jform_url').addClass('required');
|
||||||
jform_vvvvwaqwac_required = false;
|
jform_vvvvwaqwac_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_content-lbl').closest('.control-group').hide();
|
jQuery('#jform_url').closest('.control-group').hide();
|
||||||
if (!jform_vvvvwaqwac_required)
|
if (!jform_vvvvwaqwac_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('content',1);
|
updateFieldRequired('url',1);
|
||||||
jQuery('#jform_content').removeAttr('required');
|
jQuery('#jform_url').removeAttr('required');
|
||||||
jQuery('#jform_content').removeAttr('aria-required');
|
jQuery('#jform_url').removeAttr('aria-required');
|
||||||
jQuery('#jform_content').removeClass('required');
|
jQuery('#jform_url').removeClass('required');
|
||||||
jform_vvvvwaqwac_required = true;
|
jform_vvvvwaqwac_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -272,7 +162,7 @@ function vvvvwaq(type_vvvvwaq)
|
|||||||
function type_vvvvwaq_SomeFunc(type_vvvvwaq)
|
function type_vvvvwaq_SomeFunc(type_vvvvwaq)
|
||||||
{
|
{
|
||||||
// set the function logic
|
// set the function logic
|
||||||
if (type_vvvvwaq == 2)
|
if (type_vvvvwaq == 3)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -280,32 +170,142 @@ function type_vvvvwaq_SomeFunc(type_vvvvwaq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// the vvvvwar function
|
// the vvvvwar function
|
||||||
function vvvvwar(target_vvvvwar)
|
function vvvvwar(type_vvvvwar)
|
||||||
{
|
{
|
||||||
// set the function logic
|
if (isSet(type_vvvvwar) && type_vvvvwar.constructor !== Array)
|
||||||
if (target_vvvvwar == 1)
|
|
||||||
{
|
{
|
||||||
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)
|
if (jform_vvvvwarwad_required)
|
||||||
{
|
{
|
||||||
updateFieldRequired('groups',0);
|
updateFieldRequired('article',0);
|
||||||
jQuery('#jform_groups').prop('required','required');
|
jQuery('#jform_article').prop('required','required');
|
||||||
jQuery('#jform_groups').attr('aria-required',true);
|
jQuery('#jform_article').attr('aria-required',true);
|
||||||
jQuery('#jform_groups').addClass('required');
|
jQuery('#jform_article').addClass('required');
|
||||||
jform_vvvvwarwad_required = false;
|
jform_vvvvwarwad_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
jQuery('#jform_groups').closest('.control-group').hide();
|
jQuery('#jform_article').closest('.control-group').hide();
|
||||||
if (!jform_vvvvwarwad_required)
|
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);
|
updateFieldRequired('groups',1);
|
||||||
jQuery('#jform_groups').removeAttr('required');
|
jQuery('#jform_groups').removeAttr('required');
|
||||||
jQuery('#jform_groups').removeAttr('aria-required');
|
jQuery('#jform_groups').removeAttr('aria-required');
|
||||||
jQuery('#jform_groups').removeClass('required');
|
jQuery('#jform_groups').removeClass('required');
|
||||||
jform_vvvvwarwad_required = true;
|
jform_vvvvwatwaf_required = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user