diff --git a/README.md b/README.md index bfc1acc9..1fdfd38a 100644 --- a/README.md +++ b/README.md @@ -23,24 +23,24 @@ The best way to see all your options is to install this component on you Joomla + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Sermon Distributor](https://www.vdm.io/) + *First Build*: 22nd October, 2015 -+ *Last Build*: 12th June, 2019 ++ *Last Build*: 14th August, 2019 + *Version*: 2.0.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ## Build Time :hourglass: -**187 Hours** or **23 Eight Hour Days** (actual time the author saved - +**189 Hours** or **24 Eight Hour Days** (actual time the author saved - due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder)) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **66946** ++ *Line count*: **67680** + *File count*: **445** + *Folder count*: **93** -**123 Hours** or **16 Eight Hour Days** (the actual time the author spent) +**124 Hours** or **15 Eight Hour Days** (the actual time the author spent) > (with the following break down: > **debugging @47hours** = codingtime / 4; @@ -48,7 +48,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > **mapping @19hours** = codingtime / 10; > **office @31hours** = codingtime / 6;) -**310 Hours** or **39 Eight Hour Days** +**313 Hours** or **39 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, diff --git a/admin/README.txt b/admin/README.txt index bfc1acc9..1fdfd38a 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -23,24 +23,24 @@ The best way to see all your options is to install this component on you Joomla + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Sermon Distributor](https://www.vdm.io/) + *First Build*: 22nd October, 2015 -+ *Last Build*: 12th June, 2019 ++ *Last Build*: 14th August, 2019 + *Version*: 2.0.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ## Build Time :hourglass: -**187 Hours** or **23 Eight Hour Days** (actual time the author saved - +**189 Hours** or **24 Eight Hour Days** (actual time the author saved - due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder)) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **66946** ++ *Line count*: **67680** + *File count*: **445** + *Folder count*: **93** -**123 Hours** or **16 Eight Hour Days** (the actual time the author spent) +**124 Hours** or **15 Eight Hour Days** (the actual time the author spent) > (with the following break down: > **debugging @47hours** = codingtime / 4; @@ -48,7 +48,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder > **mapping @19hours** = codingtime / 10; > **office @31hours** = codingtime / 6;) -**310 Hours** or **39 Eight Hour Days** +**313 Hours** or **39 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index ccf0da46..240cc0fd 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -53,7 +53,7 @@ class SermondistributorControllerAjax extends JControllerLegacy // Check Token! $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); - if($token == $call_token) + if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { $task = $this->getTask(); switch($task) diff --git a/admin/helpers/sermondistributor.php b/admin/helpers/sermondistributor.php index bb5bdf77..49566b24 100644 --- a/admin/helpers/sermondistributor.php +++ b/admin/helpers/sermondistributor.php @@ -3541,38 +3541,42 @@ abstract class SermondistributorHelper /** * Get any component's model **/ - public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'Sermondistributor', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = 'Sermondistributor', $config = array()) { // fix the name $name = self::safeString($name); - // full path - $fullPath = $path . '/models'; - // set prefix - $prefix = $component.'Model'; + // full path to models + $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPath, $prefix); + JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + // make sure the table path is loaded + if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + { + // This is the JCB default path to tables in Joomla 3.x + $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + } // get instance - $model = JModelLegacy::getInstance($name, $prefix, $config); + $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { jimport('joomla.filesystem.file'); // get file path - $filePath = $path.'/'.$name.'.php'; - $fullPath = $fullPath.'/'.$name.'.php'; + $filePath = $path . '/' . $name . '.php'; + $fullPathModel = $fullPathModels . '/' . $name . '.php'; // check if it exists if (JFile::exists($filePath)) { // get the file require_once $filePath; } - elseif (JFile::exists($fullPath)) + elseif (JFile::exists($fullPathModel)) { // get the file - require_once $fullPath; + require_once $fullPathModel; } // build class names - $modelClass = $prefix.$name; + $modelClass = $Component . 'Model' . $name; if (class_exists($modelClass)) { // initialize the model diff --git a/admin/language/en-GB/en-GB.com_sermondistributor.ini b/admin/language/en-GB/en-GB.com_sermondistributor.ini index 208ee412..807c54bc 100644 --- a/admin/language/en-GB/en-GB.com_sermondistributor.ini +++ b/admin/language/en-GB/en-GB.com_sermondistributor.ini @@ -12,9 +12,9 @@ COM_SERMONDISTRIBUTOR_BCOULD_NOT_USE_THE_GIVEN_TOKEN_OR_THE_GIVEN_BUILD_OPTION_D COM_SERMONDISTRIBUTOR_BETA_RELEASE="Beta Release" COM_SERMONDISTRIBUTOR_BY_USING_AN_ACCESS_TOKEN_YOU_WILL_BE_ABLE_TO_MAKE_API_CALLS_FOR_YOUR_OWN_ACCOUNT_WITHOUT_GOING_THROUGH_THE_AUTHORIZATION_FLOW_DURING_THIS_MANUAL_UPDATE_OF_THE_LOCAL_LISTINGBR_THE_TOKEN_WILL_NOT_BE_STORED_AND_FOR_SAFETY_THE_TOKEN_WILL_BE_REVOKED_ONCE_THE_UPDATE_IS_COMPLETED_SUCCESSFULLYBR_BTHIS_WILL_MEAN_IT_CAN_ONLY_BE_USED_THIS_ONCEB_YOU_WOULD_NEED_A_NEW_TOKEN_EACH_TIME_YOU_RUN_THIS_UPDATE_MANUALLY_BR_SMALLMAKE_SURE_TO_HAVE_SSL_INPLACE_ON_THIS_PAGE_WHEN_DOING_THIS_UPDATE_AS_AN_EXTRA_SECURITY_MEASURESMALL="By using an access token, you will be able to make API calls for your own account without going through the authorization flow during this manual update of the local listing.
The token will not be stored and for safety the token will be revoked once the update is completed successfully.
This will mean it can only be used this once, you would need a new token each time you run this update manually.
Make sure to have SSL in-place on this page when doing this update, as an extra security measure." COM_SERMONDISTRIBUTOR_CATEGORIES_ACCESS_SITE="Categories (Site) Access" -COM_SERMONDISTRIBUTOR_CATEGORIES_ACCESS_SITE_DESC=" Allows the users in this group to access site categories." +COM_SERMONDISTRIBUTOR_CATEGORIES_ACCESS_SITE_DESC="Allows the users in this group to access site categories." COM_SERMONDISTRIBUTOR_CATEGORY_ACCESS_SITE="Category (Site) Access" -COM_SERMONDISTRIBUTOR_CATEGORY_ACCESS_SITE_DESC=" Allows the users in this group to access site category." +COM_SERMONDISTRIBUTOR_CATEGORY_ACCESS_SITE_DESC="Allows the users in this group to access site category." COM_SERMONDISTRIBUTOR_CLEARING_LOCAL_LISTING_CAN_NOT_BE_DONE="Clearing local listing can not be done." COM_SERMONDISTRIBUTOR_CLEAR_LOCAL_LISTING="Clear Local Listing" COM_SERMONDISTRIBUTOR_CLOSE_NEW="Close & New" @@ -53,7 +53,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY="Category" COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY_BOX_CONTRAST_DESCRIPTION="Set if text should be contrast in box display option." COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY_BOX_CONTRAST_LABEL="Show Contrast Text" COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY_DEFAULT_ICON_DESCRIPTION="Must be 358px x 358px" -COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY_DEFAULT_ICON_LABEL="Category Default Icon " +COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY_DEFAULT_ICON_LABEL="Category Default Icon" COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY_DESC_DESCRIPTION="Set if description should be shown." COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY_DESC_LABEL="Show Description" COM_SERMONDISTRIBUTOR_CONFIG_CATEGORY_DISPLAY_DESCRIPTION="Select the option for display of a category." @@ -191,7 +191,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_PREACHERS_WEBSITE_LABEL="Show Website" COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_BOX_CONTRAST_DESCRIPTION="Set if text should be contrast in box display option." COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_BOX_CONTRAST_LABEL="Show Contrast Text" COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_DEFAULT_ICON_DESCRIPTION="Must be 358px x 358px" -COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_DEFAULT_ICON_LABEL="Preacher Default Icon " +COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_DEFAULT_ICON_LABEL="Preacher Default Icon" COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_DESC_DESCRIPTION="Set if description should be shown." COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_DESC_LABEL="Show Description" COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_DISPLAY_DESCRIPTION="Select the option for display of a preacher." @@ -241,7 +241,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_SERIES="Series" COM_SERMONDISTRIBUTOR_CONFIG_SERIES_BOX_CONTRAST_DESCRIPTION="Set if text should be contrast in box display option." COM_SERMONDISTRIBUTOR_CONFIG_SERIES_BOX_CONTRAST_LABEL="Show Contrast Text" COM_SERMONDISTRIBUTOR_CONFIG_SERIES_DEFAULT_ICON_DESCRIPTION="Must be 358px x 358px" -COM_SERMONDISTRIBUTOR_CONFIG_SERIES_DEFAULT_ICON_LABEL="Series Default Icon " +COM_SERMONDISTRIBUTOR_CONFIG_SERIES_DEFAULT_ICON_LABEL="Series Default Icon" COM_SERMONDISTRIBUTOR_CONFIG_SERIES_DESC_DESCRIPTION="Set if description should be shown." COM_SERMONDISTRIBUTOR_CONFIG_SERIES_DESC_LABEL="Show Description" COM_SERMONDISTRIBUTOR_CONFIG_SERIES_DISPLAY_DESCRIPTION="Select the option for display of a series." @@ -287,7 +287,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_SERMON_BOX_CONTRAST_LABEL="Show Contrast Text" COM_SERMONDISTRIBUTOR_CONFIG_SERMON_CATEGORY_DESCRIPTION="Set if the category link should be shown." COM_SERMONDISTRIBUTOR_CONFIG_SERMON_CATEGORY_LABEL="Show Sermon Category" COM_SERMONDISTRIBUTOR_CONFIG_SERMON_DEFAULT_ICON_DESCRIPTION="Must be 358px x 358px" -COM_SERMONDISTRIBUTOR_CONFIG_SERMON_DEFAULT_ICON_LABEL="Sermon Default Icon " +COM_SERMONDISTRIBUTOR_CONFIG_SERMON_DEFAULT_ICON_LABEL="Sermon Default Icon" COM_SERMONDISTRIBUTOR_CONFIG_SERMON_DESC_DESCRIPTION="Set if sermon description should be shown." COM_SERMONDISTRIBUTOR_CONFIG_SERMON_DESC_LABEL="Show Sermon Description" COM_SERMONDISTRIBUTOR_CONFIG_SERMON_DISPLAY_DESCRIPTION="Select the option for display of a sermon." @@ -350,14 +350,14 @@ COM_SERMONDISTRIBUTOR_DATE="Date" COM_SERMONDISTRIBUTOR_DOWNLOAD="download" COM_SERMONDISTRIBUTOR_DOWNLOAD_NAME="Download Name" COM_SERMONDISTRIBUTOR_EDIT_CREATED_BY="Edit Created By" -COM_SERMONDISTRIBUTOR_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by." +COM_SERMONDISTRIBUTOR_EDIT_CREATED_BY_DESC="Allows users in this group to edit created by." COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE="Edit Created Date" -COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE_DESC=" Allows users in this group to edit created date." +COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date." COM_SERMONDISTRIBUTOR_EDIT_S="Edit %s" COM_SERMONDISTRIBUTOR_EDIT_VERSIONS="Edit Version" -COM_SERMONDISTRIBUTOR_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions." +COM_SERMONDISTRIBUTOR_EDIT_VERSIONS_DESC="Allows users in this group to edit versions." COM_SERMONDISTRIBUTOR_EXPORT_DATA="Export Data" -COM_SERMONDISTRIBUTOR_EXPORT_DATA_DESC=" Allows users in this group to export data." +COM_SERMONDISTRIBUTOR_EXPORT_DATA_DESC="Allows users in this group to export data." COM_SERMONDISTRIBUTOR_EXPORT_FAILED="Export Failed" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE="External Source" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES="External Sources" @@ -472,7 +472,7 @@ COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_BUILD_DESCRIPTION="Set the method used to COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_BUILD_LABEL="Build Option" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_BUILD_OPTION="Build Option" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CLEAR_LOCAL_LISTING_BUTTON_ACCESS="External Source Clear Local Listing Button Access" -COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CLEAR_LOCAL_LISTING_BUTTON_ACCESS_DESC=" Allows the users in this group to access the clear local listing button." +COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CLEAR_LOCAL_LISTING_BUTTON_ACCESS_DESC="Allows the users in this group to access the clear local listing button." COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CREATED_BY_DESC="The user that created this External Source." COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CREATED_BY_LABEL="Created By" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CREATED_DATE_DESC="The date this External Source was created." @@ -625,7 +625,7 @@ COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_PPTX=".pptx" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_PUBLISHING="Publishing" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_RELATION="External Source Relation" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_RESET_UPDATE_STATUS_BUTTON_ACCESS="External Source Reset Update Status Button Access" -COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_RESET_UPDATE_STATUS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the reset update status button." +COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_RESET_UPDATE_STATUS_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset update status button." COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the External Source to customise the alias." COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_SELECT_AN_OPTION="Select an option" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_SHAREDURL="Sharedurl" @@ -758,7 +758,7 @@ COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TITLE_MESSAGE="Error! Please add title here. COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE="Type" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE_DESCRIPTION="Select the help type." COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE_LABEL="Type" -COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL="Url" +COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL="URL" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_DESCRIPTION="Enter url" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_HINT="http://www.example.com" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_LABEL="URL" @@ -769,7 +769,7 @@ COM_SERMONDISTRIBUTOR_HELP_MANAGER="Help" COM_SERMONDISTRIBUTOR_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BSERMONDISTRIBUTORB_WILL_NOT_FUNCTION_CORRECTLYP="

Curl Not Found!

Please setup curl on your system, or sermondistributor will not function correctly!

" COM_SERMONDISTRIBUTOR_IMPORT_CONTINUE="Continue" COM_SERMONDISTRIBUTOR_IMPORT_DATA="Import Data" -COM_SERMONDISTRIBUTOR_IMPORT_DATA_DESC=" Allows users in this group to import data." +COM_SERMONDISTRIBUTOR_IMPORT_DATA_DESC="Allows users in this group to import data." COM_SERMONDISTRIBUTOR_IMPORT_ERROR="Import error." COM_SERMONDISTRIBUTOR_IMPORT_FAILED="Import Failed" COM_SERMONDISTRIBUTOR_IMPORT_FILE_COLUMNS="File Columns" @@ -933,18 +933,18 @@ COM_SERMONDISTRIBUTOR_LOCAL_LISTING_WAS_CLEARED_SUCCESSFULLY="Local listing was COM_SERMONDISTRIBUTOR_LOCAL_LISTING_WAS_NOT_CLEARED="Local listing was not cleared." COM_SERMONDISTRIBUTOR_MANUAL_UPDATER="Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS="Manual Updater Access" -COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS_DESC="Allows the users in this group to access Manual Updater" +COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS_DESC="Allows the users in this group to access manual updater." COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST="Manual Updater Dashboard List" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DESC="Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS="Manual Updater External Sources Button Access" -COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS_DESC=" Allows the users in this group to access the external sources button." +COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS_DESC="Allows the users in this group to access the external sources button." COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_SUBMENU="Manual Updater Submenu" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_SUBMENU_DESC="Allows the users in this group to submenu of Manual Updater" COM_SERMONDISTRIBUTOR_NEW="New" COM_SERMONDISTRIBUTOR_NEW_ISSUE="New Issue" COM_SERMONDISTRIBUTOR_NOTICE="Notice!" -COM_SERMONDISTRIBUTOR_NOT_FOUND_OR_ACCESS_DENIED="Not found or access denied!" +COM_SERMONDISTRIBUTOR_NOT_FOUND_OR_ACCESS_DENIED="Not found, or access denied." COM_SERMONDISTRIBUTOR_NO_ACCESS_GRANTED="No Access Granted!" COM_SERMONDISTRIBUTOR_NO_CRONJOB_PATH_FOUND_FOR_S="No cronjob path found for (%s)" COM_SERMONDISTRIBUTOR_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cronjob path found since incorrect type requested." @@ -965,7 +965,7 @@ COM_SERMONDISTRIBUTOR_PREACHERS="Preachers" COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS="Preachers Access" COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS_DESC="Allows the users in this group to access access preachers" COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS_SITE="Preachers (Site) Access" -COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS_SITE_DESC=" Allows the users in this group to access site preachers." +COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS_SITE_DESC="Allows the users in this group to access site preachers." COM_SERMONDISTRIBUTOR_PREACHERS_BATCH_OPTIONS="Batch process the selected Preachers" COM_SERMONDISTRIBUTOR_PREACHERS_BATCH_TIP="All changes will be applied to all selected Preachers" COM_SERMONDISTRIBUTOR_PREACHERS_BATCH_USE="Preachers Batch Use" @@ -1015,7 +1015,7 @@ COM_SERMONDISTRIBUTOR_PREACHERS_PREACHER_DETAILS="Preacher Details" COM_SERMONDISTRIBUTOR_PREACHERS_SUBMENU="Preachers Submenu" COM_SERMONDISTRIBUTOR_PREACHERS_SUBMENU_DESC="Allows the users in this group to submenu of preacher" COM_SERMONDISTRIBUTOR_PREACHER_ACCESS_SITE="Preacher (Site) Access" -COM_SERMONDISTRIBUTOR_PREACHER_ACCESS_SITE_DESC=" Allows the users in this group to access site preacher." +COM_SERMONDISTRIBUTOR_PREACHER_ACCESS_SITE_DESC="Allows the users in this group to access site preacher." COM_SERMONDISTRIBUTOR_PREACHER_ALIAS="Alias" COM_SERMONDISTRIBUTOR_PREACHER_ALIAS_HINT="Auto-generated from name" COM_SERMONDISTRIBUTOR_PREACHER_ALIAS_LABEL="Alias" @@ -1071,7 +1071,7 @@ COM_SERMONDISTRIBUTOR_SAVE_SUCCESS="Great! Item successfully saved." COM_SERMONDISTRIBUTOR_SAVE_WARNING="The value already existed so please select another." COM_SERMONDISTRIBUTOR_SERIES="Series" COM_SERMONDISTRIBUTOR_SERIES_ACCESS_SITE="Series (Site) Access" -COM_SERMONDISTRIBUTOR_SERIES_ACCESS_SITE_DESC=" Allows the users in this group to access site series." +COM_SERMONDISTRIBUTOR_SERIES_ACCESS_SITE_DESC="Allows the users in this group to access site series." COM_SERMONDISTRIBUTOR_SERIES_ALIAS="Alias" COM_SERMONDISTRIBUTOR_SERIES_ALIAS_HINT="Auto-generated from name" COM_SERMONDISTRIBUTOR_SERIES_ALIAS_LABEL="Alias" @@ -1092,7 +1092,7 @@ COM_SERMONDISTRIBUTOR_SERIES_LIST="Series List" COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS="Series List Access" COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS_DESC="Allows the users in this group to access access series list" COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS_SITE="Series List (Site) Access" -COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS_SITE_DESC=" Allows the users in this group to access site series list." +COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS_SITE_DESC="Allows the users in this group to access site series list." COM_SERMONDISTRIBUTOR_SERIES_LIST_BATCH_OPTIONS="Batch process the selected Series List" COM_SERMONDISTRIBUTOR_SERIES_LIST_BATCH_TIP="All changes will be applied to all selected Series List" COM_SERMONDISTRIBUTOR_SERIES_LIST_BATCH_USE="Series List Batch Use" @@ -1215,7 +1215,7 @@ COM_SERMONDISTRIBUTOR_SERMONS_N_ITEMS_UNPUBLISHED_1="%s Sermon unpublished." COM_SERMONDISTRIBUTOR_SERMONS_SUBMENU="Sermons Submenu" COM_SERMONDISTRIBUTOR_SERMONS_SUBMENU_DESC="Allows the users in this group to submenu of sermon" COM_SERMONDISTRIBUTOR_SERMON_ACCESS_SITE="Sermon (Site) Access" -COM_SERMONDISTRIBUTOR_SERMON_ACCESS_SITE_DESC=" Allows the users in this group to access site sermon." +COM_SERMONDISTRIBUTOR_SERMON_ACCESS_SITE_DESC="Allows the users in this group to access site sermon." COM_SERMONDISTRIBUTOR_SERMON_ALIAS="Alias" COM_SERMONDISTRIBUTOR_SERMON_ALIAS_HINT="Auto-generated from name" COM_SERMONDISTRIBUTOR_SERMON_ALIAS_LABEL="Alias" @@ -1380,7 +1380,7 @@ COM_SERMONDISTRIBUTOR_SERMON_STATUS="Status" COM_SERMONDISTRIBUTOR_SERMON_TAGS="Tags" COM_SERMONDISTRIBUTOR_SERMON_TAGS_DESCRIPTION="Assign tags to SERMON items. Tag names must be unique." COM_SERMONDISTRIBUTOR_SERMON_TAGS_LABEL="Tags" -COM_SERMONDISTRIBUTOR_SERMON_URL="Url" +COM_SERMONDISTRIBUTOR_SERMON_URL="URL" COM_SERMONDISTRIBUTOR_SERMON_URL_DESCRIPTION="The url to download the sermon." COM_SERMONDISTRIBUTOR_SERMON_URL_HINT="http://www.domain.com/direct-link-to-download.mp3" COM_SERMONDISTRIBUTOR_SERMON_URL_LABEL="File URL" @@ -1505,7 +1505,7 @@ COM_SERMONDISTRIBUTOR_UNKNOWN_ERROR_HAS_OCCURRED="Unknown error has occurred." COM_SERMONDISTRIBUTOR_UPDATE_LOCAL_LINKS_OF_TARGET_S_EXTERNAL_SOURCE="Update Local Links of (target %s) External Source" COM_SERMONDISTRIBUTOR_UP_TO_DATE="Up to date" COM_SERMONDISTRIBUTOR_USE_BATCH="Use Batch" -COM_SERMONDISTRIBUTOR_USE_BATCH_DESC=" Allows users in this group to use batch copy/update method." +COM_SERMONDISTRIBUTOR_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." COM_SERMONDISTRIBUTOR_VERSION="Version" COM_SERMONDISTRIBUTOR_VIEW_ERROR="View Error!" COM_SERMONDISTRIBUTOR_VIEW_MORE_ISSUES_ON_GITHUB="View more issues on Github" diff --git a/admin/language/en-GB/en-GB.com_sermondistributor.sys.ini b/admin/language/en-GB/en-GB.com_sermondistributor.sys.ini index 99171810..ea7789c4 100644 --- a/admin/language/en-GB/en-GB.com_sermondistributor.sys.ini +++ b/admin/language/en-GB/en-GB.com_sermondistributor.sys.ini @@ -1,17 +1,17 @@ COM_SERMONDISTRIBUTOR="Sermon Distributor" COM_SERMONDISTRIBUTOR_CATEGORIES_ACCESS_SITE="Categories (Site) Access" -COM_SERMONDISTRIBUTOR_CATEGORIES_ACCESS_SITE_DESC=" Allows the users in this group to access site categories." +COM_SERMONDISTRIBUTOR_CATEGORIES_ACCESS_SITE_DESC="Allows the users in this group to access site categories." COM_SERMONDISTRIBUTOR_CATEGORY_ACCESS_SITE="Category (Site) Access" -COM_SERMONDISTRIBUTOR_CATEGORY_ACCESS_SITE_DESC=" Allows the users in this group to access site category." +COM_SERMONDISTRIBUTOR_CATEGORY_ACCESS_SITE_DESC="Allows the users in this group to access site category." COM_SERMONDISTRIBUTOR_CONFIGURATION="Sermon Distributor Configuration" COM_SERMONDISTRIBUTOR_EDIT_CREATED_BY="Edit Created By" -COM_SERMONDISTRIBUTOR_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by." +COM_SERMONDISTRIBUTOR_EDIT_CREATED_BY_DESC="Allows users in this group to edit created by." COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE="Edit Created Date" -COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE_DESC=" Allows users in this group to edit created date." +COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date." COM_SERMONDISTRIBUTOR_EDIT_VERSIONS="Edit Version" -COM_SERMONDISTRIBUTOR_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions." +COM_SERMONDISTRIBUTOR_EDIT_VERSIONS_DESC="Allows users in this group to edit versions." COM_SERMONDISTRIBUTOR_EXPORT_DATA="Export Data" -COM_SERMONDISTRIBUTOR_EXPORT_DATA_DESC=" Allows users in this group to export data." +COM_SERMONDISTRIBUTOR_EXPORT_DATA_DESC="Allows users in this group to export data." COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_ACCESS="External Sources Access" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_ACCESS_DESC="Allows the users in this group to access access external sources" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_BATCH_USE="External Sources Batch Use" @@ -43,9 +43,9 @@ COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_IMPORT_DESC="Allows the users in this gro COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_SUBMENU="External Sources Submenu" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_SUBMENU_DESC="Allows the users in this group to submenu of external source" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CLEAR_LOCAL_LISTING_BUTTON_ACCESS="External Source Clear Local Listing Button Access" -COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CLEAR_LOCAL_LISTING_BUTTON_ACCESS_DESC=" Allows the users in this group to access the clear local listing button." +COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_CLEAR_LOCAL_LISTING_BUTTON_ACCESS_DESC="Allows the users in this group to access the clear local listing button." COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_RESET_UPDATE_STATUS_BUTTON_ACCESS="External Source Reset Update Status Button Access" -COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_RESET_UPDATE_STATUS_BUTTON_ACCESS_DESC=" Allows the users in this group to access the reset update status button." +COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_RESET_UPDATE_STATUS_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset update status button." COM_SERMONDISTRIBUTOR_HELP_DOCUMENTS_ACCESS="Help Documents Access" COM_SERMONDISTRIBUTOR_HELP_DOCUMENTS_ACCESS_DESC="Allows the users in this group to access access help documents" COM_SERMONDISTRIBUTOR_HELP_DOCUMENTS_BATCH_USE="Help Documents Batch Use" @@ -71,7 +71,7 @@ COM_SERMONDISTRIBUTOR_HELP_DOCUMENTS_IMPORT_DESC="Allows the users in this group COM_SERMONDISTRIBUTOR_HELP_DOCUMENTS_SUBMENU="Help Documents Submenu" COM_SERMONDISTRIBUTOR_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to submenu of help document" COM_SERMONDISTRIBUTOR_IMPORT_DATA="Import Data" -COM_SERMONDISTRIBUTOR_IMPORT_DATA_DESC=" Allows users in this group to import data." +COM_SERMONDISTRIBUTOR_IMPORT_DATA_DESC="Allows users in this group to import data." COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_ACCESS="Local Listings Access" COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_ACCESS_DESC="Allows the users in this group to access access local listings" COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_BATCH_USE="Local Listings Batch Use" @@ -113,11 +113,11 @@ COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_IMPORT_DESC="Allows the users in this group COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_SUBMENU="Local Listings Submenu" COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_SUBMENU_DESC="Allows the users in this group to submenu of local listing" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS="Manual Updater Access" -COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS_DESC="Allows the users in this group to access Manual Updater" +COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS_DESC="Allows the users in this group to access manual updater." COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST="Manual Updater Dashboard List" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS="Manual Updater External Sources Button Access" -COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS_DESC=" Allows the users in this group to access the external sources button." +COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS_DESC="Allows the users in this group to access the external sources button." COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_SUBMENU="Manual Updater Submenu" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_SUBMENU_DESC="Allows the users in this group to submenu of Manual Updater" COM_SERMONDISTRIBUTOR_MENU="Sermon Distributor" @@ -145,7 +145,7 @@ COM_SERMONDISTRIBUTOR_MENU_SERMONS="Sermons" COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS="Preachers Access" COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS_DESC="Allows the users in this group to access access preachers" COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS_SITE="Preachers (Site) Access" -COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS_SITE_DESC=" Allows the users in this group to access site preachers." +COM_SERMONDISTRIBUTOR_PREACHERS_ACCESS_SITE_DESC="Allows the users in this group to access site preachers." COM_SERMONDISTRIBUTOR_PREACHERS_BATCH_USE="Preachers Batch Use" COM_SERMONDISTRIBUTOR_PREACHERS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch preachers" COM_SERMONDISTRIBUTOR_PREACHERS_CREATE="Preachers Create" @@ -175,13 +175,13 @@ COM_SERMONDISTRIBUTOR_PREACHERS_IMPORT_DESC="Allows the users in this group to i COM_SERMONDISTRIBUTOR_PREACHERS_SUBMENU="Preachers Submenu" COM_SERMONDISTRIBUTOR_PREACHERS_SUBMENU_DESC="Allows the users in this group to submenu of preacher" COM_SERMONDISTRIBUTOR_PREACHER_ACCESS_SITE="Preacher (Site) Access" -COM_SERMONDISTRIBUTOR_PREACHER_ACCESS_SITE_DESC=" Allows the users in this group to access site preacher." +COM_SERMONDISTRIBUTOR_PREACHER_ACCESS_SITE_DESC="Allows the users in this group to access site preacher." COM_SERMONDISTRIBUTOR_SERIES_ACCESS_SITE="Series (Site) Access" -COM_SERMONDISTRIBUTOR_SERIES_ACCESS_SITE_DESC=" Allows the users in this group to access site series." +COM_SERMONDISTRIBUTOR_SERIES_ACCESS_SITE_DESC="Allows the users in this group to access site series." COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS="Series List Access" COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS_DESC="Allows the users in this group to access access series list" COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS_SITE="Series List (Site) Access" -COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS_SITE_DESC=" Allows the users in this group to access site series list." +COM_SERMONDISTRIBUTOR_SERIES_LIST_ACCESS_SITE_DESC="Allows the users in this group to access site series list." COM_SERMONDISTRIBUTOR_SERIES_LIST_BATCH_USE="Series List Batch Use" COM_SERMONDISTRIBUTOR_SERIES_LIST_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch series list" COM_SERMONDISTRIBUTOR_SERIES_LIST_CREATE="Series List Create" @@ -241,7 +241,7 @@ COM_SERMONDISTRIBUTOR_SERMONS_IMPORT_DESC="Allows the users in this group to imp COM_SERMONDISTRIBUTOR_SERMONS_SUBMENU="Sermons Submenu" COM_SERMONDISTRIBUTOR_SERMONS_SUBMENU_DESC="Allows the users in this group to submenu of sermon" COM_SERMONDISTRIBUTOR_SERMON_ACCESS_SITE="Sermon (Site) Access" -COM_SERMONDISTRIBUTOR_SERMON_ACCESS_SITE_DESC=" Allows the users in this group to access site sermon." +COM_SERMONDISTRIBUTOR_SERMON_ACCESS_SITE_DESC="Allows the users in this group to access site sermon." COM_SERMONDISTRIBUTOR_STATISTICS_ACCESS="Statistics Access" COM_SERMONDISTRIBUTOR_STATISTICS_ACCESS_DESC="Allows the users in this group to access access statistics" COM_SERMONDISTRIBUTOR_STATISTICS_BATCH_USE="Statistics Batch Use" @@ -271,4 +271,4 @@ COM_SERMONDISTRIBUTOR_STATISTICS_IMPORT_DESC="Allows the users in this group to COM_SERMONDISTRIBUTOR_STATISTICS_SUBMENU="Statistics Submenu" COM_SERMONDISTRIBUTOR_STATISTICS_SUBMENU_DESC="Allows the users in this group to submenu of statistic" COM_SERMONDISTRIBUTOR_USE_BATCH="Use Batch" -COM_SERMONDISTRIBUTOR_USE_BATCH_DESC=" Allows users in this group to use batch copy/update method." \ No newline at end of file +COM_SERMONDISTRIBUTOR_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." \ No newline at end of file diff --git a/admin/layouts/external_source/build_option_fullwidth.php b/admin/layouts/external_source/build_option_fullwidth.php index e9afa9a3..9494e5a5 100644 --- a/admin/layouts/external_source/build_option_fullwidth.php +++ b/admin/layouts/external_source/build_option_fullwidth.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'build', 'note_manual_externalsource', 'note_auto_externalsource' @@ -36,6 +47,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -44,3 +56,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/external_source/details_above.php b/admin/layouts/external_source/details_above.php index 7949db34..ca11965c 100644 --- a/admin/layouts/external_source/details_above.php +++ b/admin/layouts/external_source/details_above.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'description', 'externalsources' ); @@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/external_source/details_fullwidth.php b/admin/layouts/external_source/details_fullwidth.php index 9815f792..9469955c 100644 --- a/admin/layouts/external_source/details_fullwidth.php +++ b/admin/layouts/external_source/details_fullwidth.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'sharedurl', 'folder', 'apicronjob_note' @@ -36,6 +47,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -44,3 +56,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/external_source/details_left.php b/admin/layouts/external_source/details_left.php index 4e598fea..f44ce323 100644 --- a/admin/layouts/external_source/details_left.php +++ b/admin/layouts/external_source/details_left.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'oauthtoken', 'generated_access_token_note', 'permissiontype', @@ -38,9 +49,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/external_source/details_right.php b/admin/layouts/external_source/details_right.php index 977b30a1..9ef3c323 100644 --- a/admin/layouts/external_source/details_right.php +++ b/admin/layouts/external_source/details_right.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'update_method', 'update_timer', 'filetypes' @@ -36,9 +47,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/external_source/details_under.php b/admin/layouts/external_source/details_under.php index 3d362ee6..40d64b5f 100644 --- a/admin/layouts/external_source/details_under.php +++ b/admin/layouts/external_source/details_under.php @@ -25,15 +25,27 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/external_source/publishing.php b/admin/layouts/external_source/publishing.php index cc52498c..09c57754 100644 --- a/admin/layouts/external_source/publishing.php +++ b/admin/layouts/external_source/publishing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'created', 'created_by', 'modified', @@ -37,9 +48,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/external_source/publlshing.php b/admin/layouts/external_source/publlshing.php index 4ab42312..8c261b37 100644 --- a/admin/layouts/external_source/publlshing.php +++ b/admin/layouts/external_source/publlshing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'published', 'ordering', 'version', @@ -38,9 +49,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php index d103daf1..ef610f28 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'title', 'alias' ); @@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php index 15f521c0..c1134fe3 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -25,15 +25,27 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'content' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php index bbed106e..3ce6bcc9 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'target', 'groups', 'location', @@ -38,9 +49,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php index d8640935..292ae272 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'type', 'url', 'article' @@ -36,9 +47,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php index 3d362ee6..40d64b5f 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -25,15 +25,27 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php index 10c3d43c..6ef34a55 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'created', 'created_by', 'modified', @@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/local_listing/details_above.php b/admin/layouts/local_listing/details_above.php index 3365b6d9..97e912c7 100644 --- a/admin/layouts/local_listing/details_above.php +++ b/admin/layouts/local_listing/details_above.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'name', 'size' ); @@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/local_listing/details_fullwidth.php b/admin/layouts/local_listing/details_fullwidth.php index 96a2c39b..beb73afc 100644 --- a/admin/layouts/local_listing/details_fullwidth.php +++ b/admin/layouts/local_listing/details_fullwidth.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'key', 'url' ); @@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/local_listing/details_left.php b/admin/layouts/local_listing/details_left.php index 5d25b90b..f0a6359c 100644 --- a/admin/layouts/local_listing/details_left.php +++ b/admin/layouts/local_listing/details_left.php @@ -25,18 +25,31 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'external_source' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/local_listing/details_right.php b/admin/layouts/local_listing/details_right.php index 69de947c..8af2fa41 100644 --- a/admin/layouts/local_listing/details_right.php +++ b/admin/layouts/local_listing/details_right.php @@ -25,18 +25,31 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'build' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/local_listing/publishing.php b/admin/layouts/local_listing/publishing.php index cc52498c..09c57754 100644 --- a/admin/layouts/local_listing/publishing.php +++ b/admin/layouts/local_listing/publishing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'created', 'created_by', 'modified', @@ -37,9 +48,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/local_listing/publlshing.php b/admin/layouts/local_listing/publlshing.php index 4ab42312..8c261b37 100644 --- a/admin/layouts/local_listing/publlshing.php +++ b/admin/layouts/local_listing/publlshing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'published', 'ordering', 'version', @@ -38,9 +49,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/preacher/details_above.php b/admin/layouts/preacher/details_above.php index 9a5774f6..bdf475e9 100644 --- a/admin/layouts/preacher/details_above.php +++ b/admin/layouts/preacher/details_above.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'name', 'alias' ); @@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/preacher/details_fullwidth.php b/admin/layouts/preacher/details_fullwidth.php index 18ae5ada..15032cf9 100644 --- a/admin/layouts/preacher/details_fullwidth.php +++ b/admin/layouts/preacher/details_fullwidth.php @@ -25,15 +25,27 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/preacher/details_left.php b/admin/layouts/preacher/details_left.php index 64f7444f..b58f7d5d 100644 --- a/admin/layouts/preacher/details_left.php +++ b/admin/layouts/preacher/details_left.php @@ -25,18 +25,31 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'icon' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/preacher/details_right.php b/admin/layouts/preacher/details_right.php index 9b2bd6f7..01326eb6 100644 --- a/admin/layouts/preacher/details_right.php +++ b/admin/layouts/preacher/details_right.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'email', 'website' ); @@ -35,9 +46,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/preacher/publishing.php b/admin/layouts/preacher/publishing.php index 10c3d43c..6ef34a55 100644 --- a/admin/layouts/preacher/publishing.php +++ b/admin/layouts/preacher/publishing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'created', 'created_by', 'modified', @@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/series/details_above.php b/admin/layouts/series/details_above.php index 9a5774f6..bdf475e9 100644 --- a/admin/layouts/series/details_above.php +++ b/admin/layouts/series/details_above.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'name', 'alias' ); @@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/series/details_fullwidth.php b/admin/layouts/series/details_fullwidth.php index 18ae5ada..15032cf9 100644 --- a/admin/layouts/series/details_fullwidth.php +++ b/admin/layouts/series/details_fullwidth.php @@ -25,15 +25,27 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/series/details_left.php b/admin/layouts/series/details_left.php index 64f7444f..b58f7d5d 100644 --- a/admin/layouts/series/details_left.php +++ b/admin/layouts/series/details_left.php @@ -25,18 +25,31 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'icon' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/series/details_right.php b/admin/layouts/series/details_right.php index edc6bce1..7ea3c260 100644 --- a/admin/layouts/series/details_right.php +++ b/admin/layouts/series/details_right.php @@ -25,18 +25,31 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'scripture' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/series/publishing.php b/admin/layouts/series/publishing.php index 10c3d43c..6ef34a55 100644 --- a/admin/layouts/series/publishing.php +++ b/admin/layouts/series/publishing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'created', 'created_by', 'modified', @@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/sermon/details_above.php b/admin/layouts/sermon/details_above.php index f53ab1cb..9fce031e 100644 --- a/admin/layouts/sermon/details_above.php +++ b/admin/layouts/sermon/details_above.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'name', 'alias', 'preacher' @@ -36,6 +47,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -44,3 +56,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/sermon/details_fullwidth.php b/admin/layouts/sermon/details_fullwidth.php index 18ae5ada..15032cf9 100644 --- a/admin/layouts/sermon/details_fullwidth.php +++ b/admin/layouts/sermon/details_fullwidth.php @@ -25,15 +25,27 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/sermon/details_left.php b/admin/layouts/sermon/details_left.php index 78429b9c..3d039431 100644 --- a/admin/layouts/sermon/details_left.php +++ b/admin/layouts/sermon/details_left.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'scripture', 'short_description', 'icon' @@ -36,9 +47,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/sermon/details_right.php b/admin/layouts/sermon/details_right.php index cdba60f8..e44c4ee6 100644 --- a/admin/layouts/sermon/details_right.php +++ b/admin/layouts/sermon/details_right.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'series', 'catid', 'tags' @@ -36,9 +47,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/sermon/details_under.php b/admin/layouts/sermon/details_under.php index 9a430c1a..244278e6 100644 --- a/admin/layouts/sermon/details_under.php +++ b/admin/layouts/sermon/details_under.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'not_required', 'auto_sermons' ); @@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/sermon/files_fullwidth.php b/admin/layouts/sermon/files_fullwidth.php index 05fc2873..685b0e0d 100644 --- a/admin/layouts/sermon/files_fullwidth.php +++ b/admin/layouts/sermon/files_fullwidth.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'link_type', 'note_link_directed', 'note_link_encrypted', @@ -43,6 +54,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -51,3 +63,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/sermon/publishing.php b/admin/layouts/sermon/publishing.php index 10c3d43c..6ef34a55 100644 --- a/admin/layouts/sermon/publishing.php +++ b/admin/layouts/sermon/publishing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'created', 'created_by', 'modified', @@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/statistic/details_above.php b/admin/layouts/statistic/details_above.php index 672c2eb4..253117bb 100644 --- a/admin/layouts/statistic/details_above.php +++ b/admin/layouts/statistic/details_above.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'filename', 'sermon' ); @@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> +
@@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array(); renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
+ diff --git a/admin/layouts/statistic/details_left.php b/admin/layouts/statistic/details_left.php index 33ec1cd4..1a553e71 100644 --- a/admin/layouts/statistic/details_left.php +++ b/admin/layouts/statistic/details_left.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'preacher', 'series' ); @@ -35,9 +46,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/statistic/details_right.php b/admin/layouts/statistic/details_right.php index 033f065a..d7aa362e 100644 --- a/admin/layouts/statistic/details_right.php +++ b/admin/layouts/statistic/details_right.php @@ -25,18 +25,31 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'counter' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/statistic/publishing.php b/admin/layouts/statistic/publishing.php index 10c3d43c..6ef34a55 100644 --- a/admin/layouts/statistic/publishing.php +++ b/admin/layouts/statistic/publishing.php @@ -25,9 +25,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'created', 'created_by', 'modified', @@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/models/external_source.php b/admin/models/external_source.php index 22cf9fbe..4d4432d7 100644 --- a/admin/models/external_source.php +++ b/admin/models/external_source.php @@ -31,13 +31,54 @@ use Joomla\Registry\Registry; * Sermondistributor External_source Model */ class SermondistributorModelExternal_source extends JModelAdmin -{ +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'oauthtoken', + 'generated_access_token_note', + 'permissiontype', + 'app_limitation_note', + 'dropboxoptions' + ), + 'right' => array( + 'update_method', + 'update_timer', + 'filetypes' + ), + 'fullwidth' => array( + 'sharedurl', + 'folder', + 'apicronjob_note' + ), + 'above' => array( + 'description', + 'externalsources' + ), + 'under' => array( + 'not_required' + ) + ), + 'build_option' => array( + 'fullwidth' => array( + 'build', + 'note_manual_externalsource', + 'note_auto_externalsource' + ) + ) + ); + /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_SERMONDISTRIBUTOR'; - + /** * The type alias for this content type. * diff --git a/admin/models/fields/externalsource.php b/admin/models/fields/externalsource.php index b7548178..a02e7bb6 100644 --- a/admin/models/fields/externalsource.php +++ b/admin/models/fields/externalsource.php @@ -51,15 +51,15 @@ class JFormFieldExternalsource extends JFormFieldList protected function getInput() { // see if we should add buttons - $setButton = $this->getAttribute('button'); + $set_button = $this->getAttribute('button'); // get html $html = parent::getInput(); // if true set button - if ($setButton === 'true') + if ($set_button === 'true') { $button = array(); $script = array(); - $buttonName = $this->getAttribute('name'); + $button_code_name = $this->getAttribute('name'); // get the input from url $app = JFactory::getApplication(); $jinput = $app->input; @@ -83,55 +83,52 @@ class JFormFieldExternalsource extends JFormFieldList $ref .= '&return=' . $_return; $refJ .= '&return=' . $_return; } + // get button label + $button_label = trim($button_code_name); + $button_label = preg_replace('/_+/', ' ', $button_label); + $button_label = preg_replace('/\s+/', ' ', $button_label); + $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label); + $button_label = ucfirst(strtolower($button_label)); + // get user object $user = JFactory::getUser(); // only add if user allowed to create external_source if ($user->authorise('external_source.create', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. { // build Create button - $buttonNamee = trim($buttonName); - $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee); - $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee); - $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee); - $buttonNamee = ucfirst(strtolower($buttonNamee)); - $button[] = ' '; } // only add if user allowed to edit external_source - if (($buttonName === 'external_source' || $buttonName === 'external_sources') && $user->authorise('external_source.edit', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. + if ($user->authorise('external_source.edit', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. { // build edit button - $buttonNamee = trim($buttonName); - $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee); - $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee); - $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee); - $buttonNamee = ucfirst(strtolower($buttonNamee)); - $button[] = ''; // build script $script[] = " jQuery(document).ready(function() { - jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) { + jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) { e.preventDefault(); - var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); - ".$buttonName."Button(".$buttonName."Value); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); }); - var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); - ".$buttonName."Button(".$buttonName."Value); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); }); - function ".$buttonName."Button(value) { + function ".$button_code_name."Button(value) { if (value > 0) { // hide the create button - jQuery('#".$buttonName."Create').hide(); + jQuery('#".$button_code_name."Create').hide(); // show edit button - jQuery('#".$buttonName."Edit').show(); + jQuery('#".$button_code_name."Edit').show(); var url = 'index.php?option=com_sermondistributor&view=external_sources&task=external_source.edit&id='+value+'".$refJ."'; - jQuery('#".$buttonName."Edit').attr('href', url); + jQuery('#".$button_code_name."Edit').attr('href', url); } else { // show the create button - jQuery('#".$buttonName."Create').show(); + jQuery('#".$button_code_name."Create').show(); // hide edit button - jQuery('#".$buttonName."Edit').hide(); + jQuery('#".$button_code_name."Edit').hide(); } }"; } diff --git a/admin/models/fields/sermon.php b/admin/models/fields/sermon.php index 9a7c7736..4f1b4336 100644 --- a/admin/models/fields/sermon.php +++ b/admin/models/fields/sermon.php @@ -51,15 +51,15 @@ class JFormFieldSermon extends JFormFieldList protected function getInput() { // see if we should add buttons - $setButton = $this->getAttribute('button'); + $set_button = $this->getAttribute('button'); // get html $html = parent::getInput(); // if true set button - if ($setButton === 'true') + if ($set_button === 'true') { $button = array(); $script = array(); - $buttonName = $this->getAttribute('name'); + $button_code_name = $this->getAttribute('name'); // get the input from url $app = JFactory::getApplication(); $jinput = $app->input; @@ -83,55 +83,52 @@ class JFormFieldSermon extends JFormFieldList $ref .= '&return=' . $_return; $refJ .= '&return=' . $_return; } + // get button label + $button_label = trim($button_code_name); + $button_label = preg_replace('/_+/', ' ', $button_label); + $button_label = preg_replace('/\s+/', ' ', $button_label); + $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label); + $button_label = ucfirst(strtolower($button_label)); + // get user object $user = JFactory::getUser(); // only add if user allowed to create sermon if ($user->authorise('sermon.create', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. { // build Create button - $buttonNamee = trim($buttonName); - $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee); - $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee); - $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee); - $buttonNamee = ucfirst(strtolower($buttonNamee)); - $button[] = ' '; } // only add if user allowed to edit sermon - if (($buttonName === 'sermon' || $buttonName === 'sermons') && $user->authorise('sermon.edit', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. + if ($user->authorise('sermon.edit', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. { // build edit button - $buttonNamee = trim($buttonName); - $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee); - $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee); - $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee); - $buttonNamee = ucfirst(strtolower($buttonNamee)); - $button[] = ''; // build script $script[] = " jQuery(document).ready(function() { - jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) { + jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) { e.preventDefault(); - var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); - ".$buttonName."Button(".$buttonName."Value); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); }); - var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); - ".$buttonName."Button(".$buttonName."Value); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); }); - function ".$buttonName."Button(value) { + function ".$button_code_name."Button(value) { if (value > 0) { // hide the create button - jQuery('#".$buttonName."Create').hide(); + jQuery('#".$button_code_name."Create').hide(); // show edit button - jQuery('#".$buttonName."Edit').show(); + jQuery('#".$button_code_name."Edit').show(); var url = 'index.php?option=com_sermondistributor&view=sermons&task=sermon.edit&id='+value+'".$refJ."'; - jQuery('#".$buttonName."Edit').attr('href', url); + jQuery('#".$button_code_name."Edit').attr('href', url); } else { // show the create button - jQuery('#".$buttonName."Create').show(); + jQuery('#".$button_code_name."Create').show(); // hide edit button - jQuery('#".$buttonName."Edit').hide(); + jQuery('#".$button_code_name."Edit').hide(); } }"; } diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index c6f34f79..4fa3af14 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -26,8 +26,7 @@ jform_vvvvvwxvwf_required = false; jform_vvvvvwyvwg_required = false; jform_vvvvvwzvwh_required = false; jform_vvvvvxavwi_required = false; -jform_vvvvvxbvwj_required = false; -jform_vvvvvxcvwk_required = false; +jform_vvvvvxcvwj_required = false; // Initial Script jQuery(document).ready(function() @@ -247,28 +246,10 @@ function vvvvvxb(type_vvvvvxb) if (type) { jQuery('#jform_content-lbl').closest('.control-group').show(); - // add required attribute to content field - if (jform_vvvvvxbvwj_required) - { - updateFieldRequired('content',0); - jQuery('#jform_content').prop('required','required'); - jQuery('#jform_content').attr('aria-required',true); - jQuery('#jform_content').addClass('required'); - jform_vvvvvxbvwj_required = false; - } } else { jQuery('#jform_content-lbl').closest('.control-group').hide(); - // remove required attribute from content field - if (!jform_vvvvvxbvwj_required) - { - updateFieldRequired('content',1); - jQuery('#jform_content').removeAttr('required'); - jQuery('#jform_content').removeAttr('aria-required'); - jQuery('#jform_content').removeClass('required'); - jform_vvvvvxbvwj_required = true; - } } } @@ -291,26 +272,26 @@ function vvvvvxc(target_vvvvvxc) { jQuery('#jform_groups').closest('.control-group').show(); // add required attribute to groups field - if (jform_vvvvvxcvwk_required) + if (jform_vvvvvxcvwj_required) { updateFieldRequired('groups',0); jQuery('#jform_groups').prop('required','required'); jQuery('#jform_groups').attr('aria-required',true); jQuery('#jform_groups').addClass('required'); - jform_vvvvvxcvwk_required = false; + jform_vvvvvxcvwj_required = false; } } else { jQuery('#jform_groups').closest('.control-group').hide(); // remove required attribute from groups field - if (!jform_vvvvvxcvwk_required) + if (!jform_vvvvvxcvwj_required) { updateFieldRequired('groups',1); jQuery('#jform_groups').removeAttr('required'); jQuery('#jform_groups').removeAttr('aria-required'); jQuery('#jform_groups').removeClass('required'); - jform_vvvvvxcvwk_required = true; + jform_vvvvvxcvwj_required = true; } } } diff --git a/admin/models/forms/help_document.xml b/admin/models/forms/help_document.xml index b7cf698a..0ff723bf 100644 --- a/admin/models/forms/help_document.xml +++ b/admin/models/forms/help_document.xml @@ -202,7 +202,6 @@ height="300 px" buttons="false" filter="safehtml" - required="true" /> array( + 'left' => array( + 'target', + 'groups', + 'location', + 'admin_view', + 'site_view' + ), + 'right' => array( + 'type', + 'url', + 'article' + ), + 'fullwidth' => array( + 'content' + ), + 'above' => array( + 'title', + 'alias' + ), + 'under' => array( + 'not_required' + ) + ) + ); + /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_SERMONDISTRIBUTOR'; - + /** * The type alias for this content type. * diff --git a/admin/models/local_listing.php b/admin/models/local_listing.php index a0167b01..1d7b95f8 100644 --- a/admin/models/local_listing.php +++ b/admin/models/local_listing.php @@ -31,13 +31,37 @@ use Joomla\Registry\Registry; * Sermondistributor Local_listing Model */ class SermondistributorModelLocal_listing extends JModelAdmin -{ +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'external_source' + ), + 'right' => array( + 'build' + ), + 'fullwidth' => array( + 'key', + 'url' + ), + 'above' => array( + 'name', + 'size' + ) + ) + ); + /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_SERMONDISTRIBUTOR'; - + /** * The type alias for this content type. * diff --git a/admin/models/preacher.php b/admin/models/preacher.php index d874e547..7faa3a29 100644 --- a/admin/models/preacher.php +++ b/admin/models/preacher.php @@ -31,13 +31,37 @@ use Joomla\Registry\Registry; * Sermondistributor Preacher Model */ class SermondistributorModelPreacher extends JModelAdmin -{ +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'icon' + ), + 'right' => array( + 'email', + 'website' + ), + 'fullwidth' => array( + 'description' + ), + 'above' => array( + 'name', + 'alias' + ) + ) + ); + /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_SERMONDISTRIBUTOR'; - + /** * The type alias for this content type. * diff --git a/admin/models/series.php b/admin/models/series.php index 68bd7dae..d9b39f80 100644 --- a/admin/models/series.php +++ b/admin/models/series.php @@ -31,13 +31,36 @@ use Joomla\Registry\Registry; * Sermondistributor Series Model */ class SermondistributorModelSeries extends JModelAdmin -{ +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'icon' + ), + 'right' => array( + 'scripture' + ), + 'fullwidth' => array( + 'description' + ), + 'above' => array( + 'name', + 'alias' + ) + ) + ); + /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_SERMONDISTRIBUTOR'; - + /** * The type alias for this content type. * diff --git a/admin/models/sermon.php b/admin/models/sermon.php index d9fed510..89c02fbd 100644 --- a/admin/models/sermon.php +++ b/admin/models/sermon.php @@ -31,13 +31,59 @@ use Joomla\Registry\Registry; * Sermondistributor Sermon Model */ class SermondistributorModelSermon extends JModelAdmin -{ +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'scripture', + 'short_description', + 'icon' + ), + 'right' => array( + 'series', + 'catid', + 'tags' + ), + 'fullwidth' => array( + 'description' + ), + 'above' => array( + 'name', + 'alias', + 'preacher' + ), + 'under' => array( + 'not_required', + 'auto_sermons' + ) + ), + 'files' => array( + 'fullwidth' => array( + 'link_type', + 'note_link_directed', + 'note_link_encrypted', + 'source', + 'build', + 'note_manual_externalsource', + 'note_auto_externalsource', + 'manual_files', + 'local_files', + 'url' + ) + ) + ); + /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_SERMONDISTRIBUTOR'; - + /** * The type alias for this content type. * diff --git a/admin/models/statistic.php b/admin/models/statistic.php index 7bd7729a..c77dce16 100644 --- a/admin/models/statistic.php +++ b/admin/models/statistic.php @@ -31,13 +31,34 @@ use Joomla\Registry\Registry; * Sermondistributor Statistic Model */ class SermondistributorModelStatistic extends JModelAdmin -{ +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'preacher', + 'series' + ), + 'right' => array( + 'counter' + ), + 'above' => array( + 'filename', + 'sermon' + ) + ) + ); + /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_SERMONDISTRIBUTOR'; - + /** * The type alias for this content type. * diff --git a/script.php b/script.php index 308c6e53..1f0aa2b7 100644 --- a/script.php +++ b/script.php @@ -33,21 +33,27 @@ JHTML::_('behavior.modal'); class com_sermondistributorInstallerScript { /** - * method to install the component + * Constructor * - * @return void + * @param JAdapterInstance $parent The object responsible for running this script */ - function install($parent) - { - - } + public function __construct(JAdapterInstance $parent) {} /** - * method to uninstall the component + * Called on installation * - * @return void + * @param JAdapterInstance $parent The object responsible for running this script + * + * @return boolean True on success */ - function uninstall($parent) + public function install(JAdapterInstance $parent) {} + + /** + * Called on uninstallation + * + * @param JAdapterInstance $parent The object responsible for running this script + */ + public function uninstall(JAdapterInstance $parent) { // Get Application object $app = JFactory::getApplication(); @@ -771,38 +777,40 @@ class com_sermondistributorInstallerScript } /** - * method to update the component + * Called on update * - * @return void + * @param JAdapterInstance $parent The object responsible for running this script + * + * @return boolean True on success */ - function update($parent) - { - - } + public function update(JAdapterInstance $parent){} /** - * method to run before an install/update/uninstall method + * Called before any type of action * - * @return void + * @param string $type Which action is happening (install|uninstall|discover_install|update) + * @param JAdapterInstance $parent The object responsible for running this script + * + * @return boolean True on success */ - function preflight($type, $parent) + public function preflight($type, JAdapterInstance $parent) { // get application $app = JFactory::getApplication(); - // is redundant ...hmmm - if ($type == 'uninstall') + // is redundant or so it seems ...hmmm let me know if it works again + if ($type === 'uninstall') { return true; } // the default for both install and update $jversion = new JVersion(); - if (!$jversion->isCompatible('3.6.0')) + if (!$jversion->isCompatible('3.8.0')) { - $app->enqueueMessage('Please upgrade to at least Joomla! 3.6.0 before continuing!', 'error'); + $app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error'); return false; } // do any updates needed - if ($type == 'update') + if ($type === 'update') { // load the helper class JLoader::register('SermondistributorHelper', JPATH_ADMINISTRATOR . '/components/com_sermondistributor/helpers/sermondistributor.php'); @@ -899,22 +907,26 @@ class com_sermondistributorInstallerScript } } // do any install needed - if ($type == 'install') + if ($type === 'install') { } + return true; } /** - * method to run after an install/update/uninstall method + * Called after any type of action * - * @return void + * @param string $type Which action is happening (install|uninstall|discover_install|update) + * @param JAdapterInstance $parent The object responsible for running this script + * + * @return boolean True on success */ - function postflight($type, $parent) + public function postflight($type, JAdapterInstance $parent) { // get application $app = JFactory::getApplication(); // set the default component settings - if ($type == 'install') + if ($type === 'install') { // Get The Database object @@ -1050,7 +1062,7 @@ class com_sermondistributorInstallerScript '; } // do any updates needed - if ($type == 'update') + if ($type === 'update') { // Get The Database object @@ -1381,5 +1393,6 @@ class com_sermondistributorInstallerScript

Upgrade to Version 2.0.2 Was Successful! Let us know if anything is not working as expected.

'; } + return true; } } diff --git a/sermondistributor.xml b/sermondistributor.xml index c871d7e4..64c145fc 100644 --- a/sermondistributor.xml +++ b/sermondistributor.xml @@ -1,7 +1,7 @@ COM_SERMONDISTRIBUTOR - 12th June, 2019 + 14th August, 2019 Llewellyn van der Merwe joomla@vdm.io https://www.vdm.io/ @@ -56,9 +56,7 @@ index.html router.php sermondistributor.php - sermondistributor.php - router.php - controller.php + router.php assets helpers controllers @@ -86,11 +84,6 @@ controller.php index.html sermondistributor.php - access.xml - config.xml - controller.php - sermondistributor.php - README.txt README.txt assets controllers diff --git a/site/controllers/ajax.json.php b/site/controllers/ajax.json.php index 47dee890..4fb19930 100644 --- a/site/controllers/ajax.json.php +++ b/site/controllers/ajax.json.php @@ -49,7 +49,7 @@ class SermondistributorControllerAjax extends JControllerLegacy // Check Token! $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); - if($token == $call_token) + if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { $task = $this->getTask(); switch($task) diff --git a/site/helpers/sermondistributor.php b/site/helpers/sermondistributor.php index 3acd4ee7..e3ad0615 100644 --- a/site/helpers/sermondistributor.php +++ b/site/helpers/sermondistributor.php @@ -2870,38 +2870,42 @@ abstract class SermondistributorHelper /** * Get any component's model **/ - public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = 'Sermondistributor', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = 'Sermondistributor', $config = array()) { // fix the name $name = self::safeString($name); - // full path - $fullPath = $path . '/models'; - // set prefix - $prefix = $component.'Model'; + // full path to models + $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPath, $prefix); + JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + // make sure the table path is loaded + if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + { + // This is the JCB default path to tables in Joomla 3.x + $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + } // get instance - $model = JModelLegacy::getInstance($name, $prefix, $config); + $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { jimport('joomla.filesystem.file'); // get file path - $filePath = $path.'/'.$name.'.php'; - $fullPath = $fullPath.'/'.$name.'.php'; + $filePath = $path . '/' . $name . '.php'; + $fullPathModel = $fullPathModels . '/' . $name . '.php'; // check if it exists if (JFile::exists($filePath)) { // get the file require_once $filePath; } - elseif (JFile::exists($fullPath)) + elseif (JFile::exists($fullPathModel)) { // get the file - require_once $fullPath; + require_once $fullPathModel; } // build class names - $modelClass = $prefix.$name; + $modelClass = $Component . 'Model' . $name; if (class_exists($modelClass)) { // initialize the model diff --git a/site/router.php b/site/router.php index 6b103675..4512568f 100644 --- a/site/router.php +++ b/site/router.php @@ -271,6 +271,8 @@ class SermondistributorRouter extends JComponentRouterBase { $getTable = '#__categories'; $query->from($db->quoteName($getTable)); + // we need this to target the components categories (TODO will keep an eye on this) + $query->where($db->quoteName('extension') . ' LIKE '. $db->quote((string)'com_' . $main . '%')); } else {