From f2a8e42ab612f633268a81b20fb061a38bd26723 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 4 Apr 2019 13:52:38 +0200 Subject: [PATCH] Updated with JCB v2.9.14 --- README.md | 4 +- admin/README.txt | 4 +- admin/controllers/external_sources.php | 2 +- admin/controllers/help_documents.php | 2 +- admin/controllers/local_listings.php | 2 +- admin/controllers/preachers.php | 2 +- admin/controllers/series_list.php | 2 +- admin/controllers/sermons.php | 2 +- admin/controllers/statistics.php | 2 +- admin/helpers/sermondistributor.php | 518 +- .../en-GB/en-GB.com_sermondistributor.sys.ini | 2 +- .../build_option_fullwidth.php | 18 +- .../layouts/external_source/details_above.php | 13 +- .../external_source/details_fullwidth.php | 18 +- .../layouts/external_source/details_left.php | 24 +- .../layouts/external_source/details_right.php | 24 +- .../layouts/external_source/details_under.php | 13 +- admin/layouts/external_source/publishing.php | 25 +- admin/layouts/external_source/publlshing.php | 25 +- admin/layouts/help_document/details_above.php | 13 +- .../help_document/details_fullwidth.php | 18 +- admin/layouts/help_document/details_left.php | 24 +- admin/layouts/help_document/details_right.php | 24 +- admin/layouts/help_document/details_under.php | 13 +- admin/layouts/help_document/publishing.php | 25 +- admin/layouts/local_listing/details_above.php | 13 +- .../local_listing/details_fullwidth.php | 18 +- admin/layouts/local_listing/details_left.php | 24 +- admin/layouts/local_listing/details_right.php | 24 +- admin/layouts/local_listing/publishing.php | 25 +- admin/layouts/local_listing/publlshing.php | 25 +- admin/layouts/preacher/details_above.php | 13 +- admin/layouts/preacher/details_fullwidth.php | 18 +- admin/layouts/preacher/details_left.php | 24 +- admin/layouts/preacher/details_right.php | 24 +- admin/layouts/preacher/publishing.php | 25 +- admin/layouts/preacher/sermons_fullwidth.php | 16 +- admin/layouts/series/details_above.php | 13 +- admin/layouts/series/details_fullwidth.php | 18 +- admin/layouts/series/details_left.php | 24 +- admin/layouts/series/details_right.php | 24 +- admin/layouts/series/publishing.php | 25 +- admin/layouts/series/sermons_fullwidth.php | 14 +- admin/layouts/sermon/details_above.php | 13 +- admin/layouts/sermon/details_fullwidth.php | 18 +- admin/layouts/sermon/details_left.php | 24 +- admin/layouts/sermon/details_right.php | 24 +- admin/layouts/sermon/details_under.php | 13 +- admin/layouts/sermon/files_fullwidth.php | 18 +- admin/layouts/sermon/publishing.php | 25 +- admin/layouts/sermon/stastics_fullwidth.php | 12 +- admin/layouts/statistic/details_above.php | 13 +- admin/layouts/statistic/details_left.php | 24 +- admin/layouts/statistic/details_right.php | 24 +- admin/layouts/statistic/publishing.php | 25 +- admin/models/external_source.php | 8 +- admin/models/external_sources.php | 8 +- admin/models/fields/adminviewfolderlist.php | 4 +- admin/models/fields/articles.php | 4 +- admin/models/fields/externalsource.php | 4 +- admin/models/fields/externalsourcefiles.php | 4 +- admin/models/fields/localfiles.php | 4 +- admin/models/fields/preachers.php | 4 +- admin/models/fields/series.php | 4 +- admin/models/fields/sermon.php | 4 +- admin/models/fields/siteviewfolderlist.php | 4 +- admin/models/forms/external_source.js | 6 +- admin/models/forms/external_source.xml | 8 +- admin/models/forms/help_document.js | 18 +- admin/models/forms/help_document.xml | 8 +- admin/models/forms/local_listing.xml | 3 +- admin/models/forms/series.xml | 1 + admin/models/forms/sermon.js | 15 +- admin/models/forms/sermon.xml | 9 +- admin/models/help_document.php | 8 +- admin/models/help_documents.php | 8 +- admin/models/local_listing.php | 8 +- admin/models/local_listings.php | 8 +- admin/models/manual_updater.php | 6 +- admin/models/preacher.php | 8 +- admin/models/preachers.php | 6 +- admin/models/series.php | 8 +- admin/models/series_list.php | 6 +- admin/models/sermon.php | 8 +- admin/models/sermons.php | 8 +- admin/models/statistic.php | 8 +- admin/models/statistics.php | 6 +- admin/sql/install.mysql.utf8.sql | 58 +- admin/tables/external_source.php | 4 +- admin/tables/help_document.php | 4 +- admin/tables/local_listing.php | 4 +- admin/tables/preacher.php | 4 +- admin/tables/series.php | 4 +- admin/tables/sermon.php | 4 +- admin/tables/statistic.php | 4 +- admin/views/external_source/submitbutton.js | 14 +- admin/views/external_source/tmpl/edit.php | 2 +- admin/views/external_source/view.html.php | 6 +- .../external_sources/tmpl/default_foot.php | 2 +- .../external_sources/tmpl/default_head.php | 2 +- admin/views/external_sources/view.html.php | 8 +- admin/views/help_document/submitbutton.js | 14 +- admin/views/help_document/tmpl/edit.php | 2 +- admin/views/help_document/view.html.php | 6 +- .../help_documents/tmpl/default_foot.php | 2 +- .../help_documents/tmpl/default_head.php | 2 +- admin/views/help_documents/view.html.php | 12 +- admin/views/local_listing/submitbutton.js | 14 +- admin/views/local_listing/tmpl/edit.php | 2 +- admin/views/local_listing/view.html.php | 6 +- .../local_listings/tmpl/default_body.php | 2 +- .../local_listings/tmpl/default_foot.php | 2 +- .../local_listings/tmpl/default_head.php | 2 +- admin/views/local_listings/view.html.php | 10 +- admin/views/manual_updater/tmpl/default.php | 2 +- admin/views/manual_updater/view.html.php | 6 +- admin/views/preacher/submitbutton.js | 14 +- admin/views/preacher/tmpl/edit.php | 2 +- admin/views/preacher/view.html.php | 6 +- admin/views/preachers/tmpl/default_foot.php | 2 +- admin/views/preachers/tmpl/default_head.php | 2 +- admin/views/preachers/view.html.php | 8 +- admin/views/series/submitbutton.js | 14 +- admin/views/series/tmpl/edit.php | 2 +- admin/views/series/view.html.php | 6 +- admin/views/series_list/tmpl/default_foot.php | 2 +- admin/views/series_list/tmpl/default_head.php | 2 +- admin/views/series_list/view.html.php | 8 +- admin/views/sermon/submitbutton.js | 14 +- admin/views/sermon/tmpl/edit.php | 2 +- admin/views/sermon/view.html.php | 6 +- ...sed_issues_the_closed_issues_on_github.php | 2 +- ..._open_issues_the_open_issues_on_github.php | 2 +- .../tmpl/default_readme_information.php | 2 +- .../tmpl/default_releases_information.php | 2 +- ...t_vast_development_method_notice_board.php | 2 +- admin/views/sermons/tmpl/default_body.php | 4 +- admin/views/sermons/tmpl/default_foot.php | 2 +- admin/views/sermons/tmpl/default_head.php | 2 +- admin/views/sermons/view.html.php | 12 +- admin/views/statistic/submitbutton.js | 14 +- admin/views/statistic/tmpl/edit.php | 2 +- admin/views/statistic/view.html.php | 6 +- admin/views/statistics/tmpl/default_body.php | 6 +- admin/views/statistics/tmpl/default_foot.php | 2 +- admin/views/statistics/tmpl/default_head.php | 2 +- admin/views/statistics/view.html.php | 14 +- media/uikit-v3/css/uikit-rtl.css | 1961 +- media/uikit-v3/css/uikit-rtl.min.css | 2 +- media/uikit-v3/css/uikit.css | 1961 +- media/uikit-v3/css/uikit.min.css | 2 +- media/uikit-v3/js/uikit-icons.js | 399 +- media/uikit-v3/js/uikit-icons.min.js | 4 +- media/uikit-v3/js/uikit.js | 15996 +++++++++------- media/uikit-v3/js/uikit.min.js | 4 +- sermondistributor.xml | 14 +- site/helpers/route.php | 71 +- site/helpers/sermondistributor.php | 514 +- site/models/api.php | 10 +- site/models/categories.php | 8 +- site/models/category.php | 8 +- site/models/preacher.php | 8 +- site/models/preachers.php | 8 +- site/models/series.php | 8 +- site/models/serieslist.php | 8 +- site/models/sermon.php | 4 +- site/views/api/submitbutton.js | 14 +- site/views/api/tmpl/default.php | 6 +- site/views/api/view.html.php | 6 +- site/views/categories/tmpl/default.php | 12 +- .../tmpl/default_categories-grid.php | 2 +- .../tmpl/default_categories-list.php | 2 +- .../tmpl/default_categories-table.php | 2 +- site/views/categories/view.html.php | 10 +- site/views/category/tmpl/default.php | 12 +- site/views/category/tmpl/default.xml | 1 + .../category/tmpl/default_categorybox.php | 2 +- .../category/tmpl/default_categorypanel.php | 2 +- .../category/tmpl/default_categorysmall.php | 2 +- .../category/tmpl/default_sermons-grid.php | 2 +- .../category/tmpl/default_sermons-list.php | 2 +- .../category/tmpl/default_sermons-table.php | 2 +- site/views/category/view.html.php | 16 +- site/views/preacher/tmpl/default.php | 12 +- .../preacher/tmpl/default_preacherbox.php | 2 +- .../preacher/tmpl/default_preacherpanel.php | 2 +- .../preacher/tmpl/default_preachersmall.php | 2 +- .../preacher/tmpl/default_sermons-grid.php | 2 +- .../preacher/tmpl/default_sermons-list.php | 2 +- .../preacher/tmpl/default_sermons-table.php | 2 +- site/views/preacher/view.html.php | 14 +- site/views/preachers/tmpl/default.php | 12 +- .../preachers/tmpl/default_preachers-grid.php | 2 +- .../preachers/tmpl/default_preachers-list.php | 2 +- .../tmpl/default_preachers-table.php | 2 +- site/views/preachers/view.html.php | 10 +- site/views/series/tmpl/default.php | 12 +- site/views/series/tmpl/default_seriesbox.php | 2 +- .../views/series/tmpl/default_seriespanel.php | 2 +- .../views/series/tmpl/default_seriessmall.php | 2 +- .../series/tmpl/default_sermons-grid.php | 2 +- .../series/tmpl/default_sermons-list.php | 2 +- .../series/tmpl/default_sermons-table.php | 2 +- site/views/series/view.html.php | 14 +- site/views/serieslist/tmpl/default.php | 12 +- .../serieslist/tmpl/default_series-grid.php | 2 +- .../serieslist/tmpl/default_series-list.php | 2 +- .../serieslist/tmpl/default_series-table.php | 2 +- site/views/serieslist/view.html.php | 10 +- site/views/sermon/tmpl/default.php | 6 +- site/views/sermon/tmpl/default_sermonbig.php | 2 +- site/views/sermon/tmpl/default_sermonbox.php | 2 +- .../views/sermon/tmpl/default_sermonpanel.php | 2 +- site/views/sermon/view.html.php | 12 +- 214 files changed, 11740 insertions(+), 11506 deletions(-) diff --git a/README.md b/README.md index 2c1eb13d..46de58c5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ 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*: 6th September, 2018 ++ *Last Build*: 4th April, 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 @@ -36,7 +36,7 @@ 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*: **66852** ++ *Line count*: **66821** + *File count*: **445** + *Folder count*: **93** diff --git a/admin/README.txt b/admin/README.txt index 2c1eb13d..46de58c5 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -23,7 +23,7 @@ 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*: 6th September, 2018 ++ *Last Build*: 4th April, 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 @@ -36,7 +36,7 @@ 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*: **66852** ++ *Line count*: **66821** + *File count*: **445** + *Folder count*: **93** diff --git a/admin/controllers/external_sources.php b/admin/controllers/external_sources.php index b3eaea9c..0363dc96 100644 --- a/admin/controllers/external_sources.php +++ b/admin/controllers/external_sources.php @@ -115,5 +115,5 @@ class SermondistributorControllerExternal_sources extends JControllerAdmin $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=external_sources', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/help_documents.php b/admin/controllers/help_documents.php index 2679fbd8..7777c893 100644 --- a/admin/controllers/help_documents.php +++ b/admin/controllers/help_documents.php @@ -115,5 +115,5 @@ class SermondistributorControllerHelp_documents extends JControllerAdmin $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/local_listings.php b/admin/controllers/local_listings.php index f51ce02b..a0e1d5ce 100644 --- a/admin/controllers/local_listings.php +++ b/admin/controllers/local_listings.php @@ -115,5 +115,5 @@ class SermondistributorControllerLocal_listings extends JControllerAdmin $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=local_listings', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/preachers.php b/admin/controllers/preachers.php index 89d1cbd8..0359bd2d 100644 --- a/admin/controllers/preachers.php +++ b/admin/controllers/preachers.php @@ -115,5 +115,5 @@ class SermondistributorControllerPreachers extends JControllerAdmin $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/series_list.php b/admin/controllers/series_list.php index b3686e1f..ba263f02 100644 --- a/admin/controllers/series_list.php +++ b/admin/controllers/series_list.php @@ -115,5 +115,5 @@ class SermondistributorControllerSeries_list extends JControllerAdmin $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/sermons.php b/admin/controllers/sermons.php index 73fbb287..d0cae680 100644 --- a/admin/controllers/sermons.php +++ b/admin/controllers/sermons.php @@ -115,5 +115,5 @@ class SermondistributorControllerSermons extends JControllerAdmin $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/statistics.php b/admin/controllers/statistics.php index 70f0cf3c..95f6f59e 100644 --- a/admin/controllers/statistics.php +++ b/admin/controllers/statistics.php @@ -115,5 +115,5 @@ class SermondistributorControllerStatistics extends JControllerAdmin $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error'); return; - } + } } diff --git a/admin/helpers/sermondistributor.php b/admin/helpers/sermondistributor.php index 7034ac02..bb5bdf77 100644 --- a/admin/helpers/sermondistributor.php +++ b/admin/helpers/sermondistributor.php @@ -29,7 +29,7 @@ defined('_JEXEC') or die('Restricted access'); * Sermondistributor component helper. */ abstract class SermondistributorHelper -{ +{ /** * The global params @@ -1955,6 +1955,32 @@ abstract class SermondistributorHelper return date('jS \o\f F Y',$date); } + /** + * get date based in period past + */ + public static function fancyDynamicDate($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + // older then year + $lastyear = date("Y", strtotime("-1 year")); + $tragetyear = date("Y", $date); + if ($tragetyear <= $lastyear) + { + return date('m/d/y', $date); + } + // same day + $yesterday = strtotime("-1 day"); + if ($date > $yesterday) + { + return date('g:i A', $date); + } + // just month day + return date('M j', $date); + } + /** * Change to nice fancy day time and date */ @@ -1991,6 +2017,30 @@ abstract class SermondistributorHelper return date('G:i',$time); } + /** + * set the date as 2004/05 (for charts) + */ + public static function setYearMonth($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('Y/m', $date); + } + + /** + * set the date as 2004/05/03 (for charts) + */ + public static function setYearMonthDay($date) + { + if (!self::isValidTimeStamp($date)) + { + $date = strtotime($date); + } + return date('Y/m/d', $date); + } + /** * Check if string is a valid time stamp */ @@ -2632,7 +2682,7 @@ abstract class SermondistributorHelper return $open; } /** - * Load the Component xml manifest. + * Load the Component xml manifest. **/ public static function manifest() { @@ -2641,12 +2691,12 @@ abstract class SermondistributorHelper } /** - * Joomla version object + * Joomla version object **/ protected static $JVersion; /** - * set/get Joomla version + * set/get Joomla version **/ public static function jVersion() { @@ -2659,7 +2709,7 @@ abstract class SermondistributorHelper } /** - * Load the Contributors details. + * Load the Contributors details. **/ public static function getContributors() { @@ -2769,7 +2819,7 @@ abstract class SermondistributorHelper } /** - * Configure the Linkbar. + * Configure the Linkbar. **/ public static function addSubmenu($submenu) { @@ -2811,7 +2861,7 @@ abstract class SermondistributorHelper { JHtmlSidebar::addEntry(JText::_('COM_SERMONDISTRIBUTOR_SUBMENU_HELP_DOCUMENTS'), 'index.php?option=com_sermondistributor&view=help_documents', $submenu === 'help_documents'); } - } + } /** * UIKIT Component Classes @@ -2913,7 +2963,7 @@ abstract class SermondistributorHelper return $classes; } return false; - } + } /** * Prepares the xml document @@ -3296,183 +3346,149 @@ abstract class SermondistributorHelper } /** - * Get the actions permissions + * Get the action permissions + * + * @param string $view The related view name + * @param int $record The item to act upon + * @param string $views The related list view name + * @param mixed $target Only get this permission (like edit, create, delete) + * @param string $component The target component + * + * @return object The JObject of permission/authorised actions + * **/ - public static function getActions($view,&$record = null,$views = null) + public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'sermondistributor') { - jimport('joomla.access.access'); - - $user = JFactory::getUser(); - $result = new JObject; - $view = self::safeString($view); + // get the user object + $user = JFactory::getUser(); + // load the JObject + $result = new JObject; + // make view name safe (just incase) + $view = self::safeString($view); if (self::checkString($views)) { $views = self::safeString($views); } // get all actions from component - $actions = JAccess::getActions('com_sermondistributor', 'component'); - // set acctions only set in component settiongs - $componentActions = array('core.admin','core.manage','core.options','core.export'); + $actions = JAccess::getActionsFromFile( + JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', + "/access/section[@name='component']/" + ); + // if non found then return empty JObject + if (empty($actions)) + { + return $result; + } + // get created by if not found + if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + { + $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + } + // set actions only set in component settings + $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); + // check if we have a target + $checkTarget = false; + if ($target) + { + // convert to an array + if (self::checkString($target)) + { + $target = array($target); + } + // check if we are good to go + if (self::checkArray($target)) + { + $checkTarget = true; + } + } // loop the actions and set the permissions foreach ($actions as $action) { - // set to use component default - $fallback= true; - if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions)) + // check target action filter + if ($checkTarget && self::filterActions($view, $action->name, $target)) { + continue; + } + // set to use component default + $fallback = true; + // reset permission per/action + $permission = false; + $catpermission = false; + // set area + $area = 'comp'; + // check if the record has an ID and the action is item related (not a component action) + if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) + { + // we are in item + $area = 'item'; // The record has been set. Check the record permissions. - $permission = $user->authorise($action->name, 'com_sermondistributor.'.$view.'.' . (int) $record->id); - if (!$permission) // TODO removed && !is_null($permission) + $permission = $user->authorise($action->name, 'com_' . $component . '.' . $view . '.' . (int) $record->id); + // if no permission found, check edit own + if (!$permission) { - if ($action->name == 'core.edit' || $action->name == $view.'.edit') + // With edit, if the created_by matches current user then dig deeper. + if (($action->name === 'core.edit' || $action->name === $view . '.edit') && $record->created_by > 0 && ($record->created_by == $user->id)) { - if ($user->authorise('core.edit.own', 'com_sermondistributor.'.$view.'.' . (int) $record->id)) + // the correct target + $coreCheck = (array) explode('.', $action->name); + // check that we have both local and global access + if ($user->authorise($coreCheck[0] . '.edit.own', 'com_' . $component . '.' . $view . '.' . (int) $record->id) && + $user->authorise($coreCheck[0] . '.edit.own', 'com_' . $component)) { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } + // allow edit + $result->set($action->name, true); + // set not to use global default + // because we already validated it + $fallback = false; } - elseif ($user->authorise($view.'edit.own', 'com_sermondistributor.'.$view.'.' . (int) $record->id)) + else { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } - } - elseif ($user->authorise('core.edit.own', 'com_sermondistributor')) - { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } - } - elseif ($user->authorise($view.'edit.own', 'com_sermondistributor')) - { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } + // do not allow edit + $result->set($action->name, false); + $fallback = false; } } } elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) { + // we are in item + $area = 'category'; + // set the core check + $coreCheck = explode('.', $action->name); + $core = $coreCheck[0]; // make sure we use the core. action check for the categories - if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) { - $coreCheck = explode('.',$action->name); - $coreCheck[0] = 'core'; - $categoryCheck = implode('.',$coreCheck); + if (strpos($action->name, $view) !== false && strpos($action->name, 'core.') === false ) + { + $coreCheck[0] = 'core'; + $categoryCheck = implode('.', $coreCheck); } else { $categoryCheck = $action->name; } // The record has a category. Check the category permissions. - $catpermission = $user->authorise($categoryCheck, 'com_sermondistributor.'.$views.'.category.' . (int) $record->catid); + $catpermission = $user->authorise($categoryCheck, 'com_' . $component . '.' . $views . '.category.' . (int) $record->catid); if (!$catpermission && !is_null($catpermission)) { - if ($action->name == 'core.edit' || $action->name == $view.'.edit') + // With edit, if the created_by matches current user then dig deeper. + if (($action->name === 'core.edit' || $action->name === $view . '.edit') && $record->created_by > 0 && ($record->created_by == $user->id)) { - if ($user->authorise('core.edit.own', 'com_sermondistributor.'.$views.'.category.' . (int) $record->catid)) + // check that we have both local and global access + if ($user->authorise('core.edit.own', 'com_' . $component . '.' . $views . '.category.' . (int) $record->catid) && + $user->authorise($core . '.edit.own', 'com_' . $component)) { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } + // allow edit + $result->set($action->name, true); + // set not to use global default + // because we already validated it + $fallback = false; } - elseif ($user->authorise($view.'edit.own', 'com_sermondistributor.'.$views.'.category.' . (int) $record->catid)) + else { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } - } - elseif ($user->authorise('core.edit.own', 'com_sermondistributor')) - { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } - } - elseif ($user->authorise($view.'edit.own', 'com_sermondistributor')) - { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } + // do not allow edit + $result->set($action->name, false); + $fallback = false; } } } @@ -3481,14 +3497,49 @@ abstract class SermondistributorHelper // if allowed then fallback on component global settings if ($fallback) { - $result->set($action->name, $user->authorise($action->name, 'com_sermondistributor')); + // if item/category blocks access then don't fall back on global + if ((($area === 'item') && !$permission) || (($area === 'category') && !$catpermission)) + { + // do not allow + $result->set($action->name, false); + } + // Finally remember the global settings have the final say. (even if item allow) + // The local item permissions can block, but it can't open and override of global permissions. + // Since items are created by users and global permissions is set by system admin. + else + { + $result->set($action->name, $user->authorise($action->name, 'com_' . $component)); + } } } return $result; } /** - * Get any component's model + * Filter the action permissions + * + * @param string $action The action to check + * @param array $targets The array of target actions + * + * @return boolean true if action should be filtered out + * + **/ + protected static function filterActions(&$view, &$action, &$targets) + { + foreach ($targets as $target) + { + if (strpos($action, $view . '.' . $target) !== false || + strpos($action, 'core.' . $target) !== false) + { + return false; + break; + } + } + return true; + } + + /** + * Get any component's model **/ public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'Sermondistributor', $config = array()) { @@ -3532,9 +3583,9 @@ abstract class SermondistributorHelper } /** - * Add to asset Table + * Add to asset Table */ - public static function setAsset($id,$table) + public static function setAsset($id, $table, $inherit = true) { $parent = JTable::getInstance('Asset'); $parent->loadByName('com_sermondistributor'); @@ -3566,7 +3617,7 @@ abstract class SermondistributorHelper $asset->name = $name; $asset->title = $title; // get the default asset rules - $rules = self::getDefaultAssetRules('com_sermondistributor',$table); + $rules = self::getDefaultAssetRules('com_sermondistributor', $table, $inherit); if ($rules instanceof JAccessRules) { $asset->rules = (string) $rules; @@ -3594,55 +3645,62 @@ abstract class SermondistributorHelper } /** - * Gets the default asset Rules for a component/view. + * Gets the default asset Rules for a component/view. */ - protected static function getDefaultAssetRules($component,$view) + protected static function getDefaultAssetRules($component, $view, $inherit = true) { - // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->quoteName('id')) - ->from($db->quoteName('#__assets')) - ->where($db->quoteName('name') . ' = ' . $db->quote($component)); - $db->setQuery($query); - $db->execute(); - if ($db->loadRowList()) + // if new or inherited + $assetId = 0; + // Only get the actual item rules if not inheriting + if (!$inherit) { - // asset alread set so use saved rules - $assetId = (int) $db->loadResult(); - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + // check that there is a value + if ($db->getNumRows()) { - $_result = (string) $result; - $_result = json_decode($_result); - foreach ($_result as $name => &$rule) - { - $v = explode('.', $name); - if ($view !== $v[0]) - { - // remove since it is not part of this view - unset($_result->$name); - } - else - { - // clear the value since we inherit - $rule = array(); - } - } - // check if there are any view values remaining - if (count((array)$_result)) - { - $_result = json_encode($_result); - $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); - - return $rules; - } - return $result; + // asset already set so use saved rules + $assetId = (int) $db->loadResult(); } } - return JAccess::getAssetRules(0); + // get asset rules + $result = JAccess::getAssetRules($assetId); + if ($result instanceof JAccessRules) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($view !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + elseif ($inherit) + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count($_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules($_result); + // return filtered rules + return $rules; + } + } + return $result; } /** @@ -3811,11 +3869,11 @@ abstract class SermondistributorHelper } /** - * Check if have an json string + * Check if have an json string * - * @input string The json string to check + * @input string The json string to check * - * @returns bool true on success + * @returns bool true on success **/ public static function checkJson($string) { @@ -3828,11 +3886,11 @@ abstract class SermondistributorHelper } /** - * Check if have an object with a length + * Check if have an object with a length * - * @input object The object to check + * @input object The object to check * - * @returns bool true on success + * @returns bool true on success **/ public static function checkObject($object) { @@ -3844,15 +3902,15 @@ abstract class SermondistributorHelper } /** - * Check if have an array with a length + * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * - * @returns bool true on success + * @returns bool/int number of items in array on success **/ public static function checkArray($array, $removeEmptyString = false) { - if (isset($array) && is_array($array) && count((array)$array) > 0) + if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0) { // also make sure the empty strings are removed if ($removeEmptyString) @@ -3866,17 +3924,17 @@ abstract class SermondistributorHelper } return self::checkArray($array, false); } - return true; + return $nr; } return false; } /** - * Check if have a string with a length + * Check if have a string with a length * - * @input string The string to check + * @input string The string to check * - * @returns bool true on success + * @returns bool true on success **/ public static function checkString($string) { @@ -3888,10 +3946,10 @@ abstract class SermondistributorHelper } /** - * Check if we are connected - * Thanks https://stackoverflow.com/a/4860432/1429677 + * Check if we are connected + * Thanks https://stackoverflow.com/a/4860432/1429677 * - * @returns bool true on success + * @returns bool true on success **/ public static function isConnected() { @@ -3913,11 +3971,11 @@ abstract class SermondistributorHelper } /** - * Merge an array of array's + * Merge an array of array's * - * @input array The arrays you would like to merge + * @input array The arrays you would like to merge * - * @returns array on success + * @returns array on success **/ public static function mergeArrays($arrays) { @@ -3943,11 +4001,11 @@ abstract class SermondistributorHelper } /** - * Shorten a string + * Shorten a string * - * @input string The you would like to shorten + * @input string The you would like to shorten * - * @returns string on success + * @returns string on success **/ public static function shorten($string, $length = 40, $addTip = true) { @@ -3984,11 +4042,11 @@ abstract class SermondistributorHelper } /** - * Making strings safe (various ways) + * Making strings safe (various ways) * - * @input string The you would like to make safe + * @input string The you would like to make safe * - * @returns string on success + * @returns string on success **/ public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) { @@ -4128,11 +4186,11 @@ abstract class SermondistributorHelper } /** - * Convert an integer into an English word string - * Thanks to Tom Nicholson + * Convert an integer into an English word string + * Thanks to Tom Nicholson * - * @input an int - * @returns a string + * @input an int + * @returns a string **/ public static function numberToString($x) { @@ -4219,9 +4277,9 @@ abstract class SermondistributorHelper } /** - * Random Key + * Random Key * - * @returns a string + * @returns a string **/ public static function randomkey($size) { 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 a1013d1a..99171810 100644 --- a/admin/language/en-GB/en-GB.com_sermondistributor.sys.ini +++ b/admin/language/en-GB/en-GB.com_sermondistributor.sys.ini @@ -120,7 +120,7 @@ COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS="Manual Upda 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" +COM_SERMONDISTRIBUTOR_MENU="Sermon Distributor" COM_SERMONDISTRIBUTOR_MENU_CATEGORIES_DESC="All categories that are published" COM_SERMONDISTRIBUTOR_MENU_CATEGORIES_OPTION="Categories" COM_SERMONDISTRIBUTOR_MENU_CATEGORIES_TITLE="Categories" diff --git a/admin/layouts/external_source/build_option_fullwidth.php b/admin/layouts/external_source/build_option_fullwidth.php index 06319f4f..e9afa9a3 100644 --- a/admin/layouts/external_source/build_option_fullwidth.php +++ b/admin/layouts/external_source/build_option_fullwidth.php @@ -33,16 +33,14 @@ $fields = $displayData->get('fields') ?: array( 'note_auto_externalsource' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 0c11ee61..7949db34 100644 --- a/admin/layouts/external_source/details_above.php +++ b/admin/layouts/external_source/details_above.php @@ -27,14 +27,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'description', 'externalsources' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 bb2f46bc..9815f792 100644 --- a/admin/layouts/external_source/details_fullwidth.php +++ b/admin/layouts/external_source/details_fullwidth.php @@ -33,16 +33,14 @@ $fields = $displayData->get('fields') ?: array( 'apicronjob_note' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 7e3c25ca..4e598fea 100644 --- a/admin/layouts/external_source/details_left.php +++ b/admin/layouts/external_source/details_left.php @@ -37,20 +37,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 fdb3b949..977b30a1 100644 --- a/admin/layouts/external_source/details_right.php +++ b/admin/layouts/external_source/details_right.php @@ -35,20 +35,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 23eb57e0..3d362ee6 100644 --- a/admin/layouts/external_source/details_under.php +++ b/admin/layouts/external_source/details_under.php @@ -27,13 +27,18 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'not_required' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 d63cda37..cc52498c 100644 --- a/admin/layouts/external_source/publishing.php +++ b/admin/layouts/external_source/publishing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -37,20 +36,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 52617df2..4ab42312 100644 --- a/admin/layouts/external_source/publlshing.php +++ b/admin/layouts/external_source/publlshing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -38,20 +37,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 fa825f41..d103daf1 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -27,14 +27,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'title', 'alias' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 fdfc7347..15f521c0 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -31,16 +31,14 @@ $fields = $displayData->get('fields') ?: array( 'content' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 f71625be..bbed106e 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -37,20 +37,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 a1d8afd4..d8640935 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -35,20 +35,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 23eb57e0..3d362ee6 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -27,13 +27,18 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'not_required' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 59714e81..10c3d43c 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -43,20 +42,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 b3c12a26..3365b6d9 100644 --- a/admin/layouts/local_listing/details_above.php +++ b/admin/layouts/local_listing/details_above.php @@ -27,14 +27,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'size' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 a7296ac1..96a2c39b 100644 --- a/admin/layouts/local_listing/details_fullwidth.php +++ b/admin/layouts/local_listing/details_fullwidth.php @@ -32,16 +32,14 @@ $fields = $displayData->get('fields') ?: array( 'url' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 382e7b31..5d25b90b 100644 --- a/admin/layouts/local_listing/details_left.php +++ b/admin/layouts/local_listing/details_left.php @@ -33,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 ce540d25..69de947c 100644 --- a/admin/layouts/local_listing/details_right.php +++ b/admin/layouts/local_listing/details_right.php @@ -33,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 d63cda37..cc52498c 100644 --- a/admin/layouts/local_listing/publishing.php +++ b/admin/layouts/local_listing/publishing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -37,20 +36,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 52617df2..4ab42312 100644 --- a/admin/layouts/local_listing/publlshing.php +++ b/admin/layouts/local_listing/publlshing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -38,20 +37,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 52f08c4e..9a5774f6 100644 --- a/admin/layouts/preacher/details_above.php +++ b/admin/layouts/preacher/details_above.php @@ -27,14 +27,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'alias' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 dd9e8fdf..18ae5ada 100644 --- a/admin/layouts/preacher/details_fullwidth.php +++ b/admin/layouts/preacher/details_fullwidth.php @@ -31,16 +31,14 @@ $fields = $displayData->get('fields') ?: array( 'description' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 500d41d0..64f7444f 100644 --- a/admin/layouts/preacher/details_left.php +++ b/admin/layouts/preacher/details_left.php @@ -33,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 6066729c..9b2bd6f7 100644 --- a/admin/layouts/preacher/details_right.php +++ b/admin/layouts/preacher/details_right.php @@ -34,20 +34,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 59714e81..10c3d43c 100644 --- a/admin/layouts/preacher/publishing.php +++ b/admin/layouts/preacher/publishing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -43,20 +42,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/preacher/sermons_fullwidth.php b/admin/layouts/preacher/sermons_fullwidth.php index f8fe3c8e..86c1615f 100644 --- a/admin/layouts/preacher/sermons_fullwidth.php +++ b/admin/layouts/preacher/sermons_fullwidth.php @@ -39,12 +39,20 @@ if ($_return = $jinput->get('return', null, 'base64')) { $return .= "&return=" . $_return; } -// set the referral values -$ref = ($id) ? "&ref=preacher&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : ""; +// check if return value was set +if (SermondistributorHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=preacher&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=preacher&refid=" . $id : ""; +} // set the create new URL -$new = "index.php?option=com_sermondistributor&view=sermon&layout=edit".$ref; +$new = "index.php?option=com_sermondistributor&view=sermons&task=sermon.edit" . $ref; // set the create new and close URL -$close_new = "index.php?option=com_sermondistributor&view=sermon&layout=edit"; +$close_new = "index.php?option=com_sermondistributor&view=sermons&task=sermon.edit"; // load the action object $can = SermondistributorHelper::getActions('sermon'); diff --git a/admin/layouts/series/details_above.php b/admin/layouts/series/details_above.php index 52f08c4e..9a5774f6 100644 --- a/admin/layouts/series/details_above.php +++ b/admin/layouts/series/details_above.php @@ -27,14 +27,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'alias' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 dd9e8fdf..18ae5ada 100644 --- a/admin/layouts/series/details_fullwidth.php +++ b/admin/layouts/series/details_fullwidth.php @@ -31,16 +31,14 @@ $fields = $displayData->get('fields') ?: array( 'description' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 500d41d0..64f7444f 100644 --- a/admin/layouts/series/details_left.php +++ b/admin/layouts/series/details_left.php @@ -33,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 b14d7be7..edc6bce1 100644 --- a/admin/layouts/series/details_right.php +++ b/admin/layouts/series/details_right.php @@ -33,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 59714e81..10c3d43c 100644 --- a/admin/layouts/series/publishing.php +++ b/admin/layouts/series/publishing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -43,20 +42,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/series/sermons_fullwidth.php b/admin/layouts/series/sermons_fullwidth.php index 12c23dad..4fe0208b 100644 --- a/admin/layouts/series/sermons_fullwidth.php +++ b/admin/layouts/series/sermons_fullwidth.php @@ -39,10 +39,18 @@ if ($_return = $jinput->get('return', null, 'base64')) { $return .= "&return=" . $_return; } -// set the referral values -$ref = ($id) ? "&ref=series&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : ""; +// check if return value was set +if (SermondistributorHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=series&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=series&refid=" . $id : ""; +} // set the create new URL -$new = "index.php?option=com_sermondistributor&view=sermon&layout=edit".$ref; +$new = "index.php?option=com_sermondistributor&view=sermons&task=sermon.edit" . $ref; // load the action object $can = SermondistributorHelper::getActions('sermon'); diff --git a/admin/layouts/sermon/details_above.php b/admin/layouts/sermon/details_above.php index fdb74de4..f53ab1cb 100644 --- a/admin/layouts/sermon/details_above.php +++ b/admin/layouts/sermon/details_above.php @@ -27,15 +27,20 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'alias', 'preacher' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 dd9e8fdf..18ae5ada 100644 --- a/admin/layouts/sermon/details_fullwidth.php +++ b/admin/layouts/sermon/details_fullwidth.php @@ -31,16 +31,14 @@ $fields = $displayData->get('fields') ?: array( 'description' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 e2a84040..78429b9c 100644 --- a/admin/layouts/sermon/details_left.php +++ b/admin/layouts/sermon/details_left.php @@ -35,20 +35,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 ffdb575f..cdba60f8 100644 --- a/admin/layouts/sermon/details_right.php +++ b/admin/layouts/sermon/details_right.php @@ -35,20 +35,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 e0bce71f..9a430c1a 100644 --- a/admin/layouts/sermon/details_under.php +++ b/admin/layouts/sermon/details_under.php @@ -27,14 +27,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'not_required', 'auto_sermons' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 13ff6f42..05fc2873 100644 --- a/admin/layouts/sermon/files_fullwidth.php +++ b/admin/layouts/sermon/files_fullwidth.php @@ -40,16 +40,14 @@ $fields = $displayData->get('fields') ?: array( 'url' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/sermon/publishing.php b/admin/layouts/sermon/publishing.php index 59714e81..10c3d43c 100644 --- a/admin/layouts/sermon/publishing.php +++ b/admin/layouts/sermon/publishing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -43,20 +42,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/sermon/stastics_fullwidth.php b/admin/layouts/sermon/stastics_fullwidth.php index 9c758428..78a5631b 100644 --- a/admin/layouts/sermon/stastics_fullwidth.php +++ b/admin/layouts/sermon/stastics_fullwidth.php @@ -39,8 +39,16 @@ if ($_return = $jinput->get('return', null, 'base64')) { $return .= "&return=" . $_return; } -// set the referral values -$ref = ($id) ? "&ref=sermon&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : ""; +// check if return value was set +if (SermondistributorHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=sermon&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=sermon&refid=" . $id : ""; +} ?>
diff --git a/admin/layouts/statistic/details_above.php b/admin/layouts/statistic/details_above.php index 8a7a2bd9..672c2eb4 100644 --- a/admin/layouts/statistic/details_above.php +++ b/admin/layouts/statistic/details_above.php @@ -27,14 +27,19 @@ defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'filename', 'sermon' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + 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 2ef831c9..33ec1cd4 100644 --- a/admin/layouts/statistic/details_left.php +++ b/admin/layouts/statistic/details_left.php @@ -34,20 +34,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 f2a9cac4..033f065a 100644 --- a/admin/layouts/statistic/details_right.php +++ b/admin/layouts/statistic/details_right.php @@ -33,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 59714e81..10c3d43c 100644 --- a/admin/layouts/statistic/publishing.php +++ b/admin/layouts/statistic/publishing.php @@ -25,7 +25,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -43,20 +42,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + 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 246b57e0..22cf9fbe 100644 --- a/admin/models/external_source.php +++ b/admin/models/external_source.php @@ -193,7 +193,7 @@ class SermondistributorModelExternal_source extends JModelAdmin } return $item; - } + } /** * Method to get the record form. @@ -482,7 +482,7 @@ class SermondistributorModelExternal_source extends JModelAdmin } } return parent::validate($form, $data, $group); - } + } /** * Method to get the unique fields of this table. @@ -772,7 +772,7 @@ class SermondistributorModelExternal_source extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -904,7 +904,7 @@ class SermondistributorModelExternal_source extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Set the filetypes string to JSON string. if (isset($data['filetypes'])) diff --git a/admin/models/external_sources.php b/admin/models/external_sources.php index 498520bf..bdb5e7e1 100644 --- a/admin/models/external_sources.php +++ b/admin/models/external_sources.php @@ -104,7 +104,7 @@ class SermondistributorModelExternal_sources extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -144,7 +144,7 @@ class SermondistributorModelExternal_sources extends JModelList $item->filetypes = $filetypesNames; } } - } + } // set selection value to a translatable value if (SermondistributorHelper::checkArray($items)) @@ -161,7 +161,7 @@ class SermondistributorModelExternal_sources extends JModelList $item->build = $this->selectionTranslation($item->build, 'build'); } } - + // return items return $items; @@ -427,7 +427,7 @@ class SermondistributorModelExternal_sources extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. diff --git a/admin/models/fields/adminviewfolderlist.php b/admin/models/fields/adminviewfolderlist.php index cc27afaa..ddcbd695 100644 --- a/admin/models/fields/adminviewfolderlist.php +++ b/admin/models/fields/adminviewfolderlist.php @@ -44,9 +44,9 @@ class JFormFieldAdminviewfolderlist extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // get custom folder files $localfolder = JPATH_COMPONENT_ADMINISTRATOR.'/views'; diff --git a/admin/models/fields/articles.php b/admin/models/fields/articles.php index 1886d26a..eb80daa0 100644 --- a/admin/models/fields/articles.php +++ b/admin/models/fields/articles.php @@ -44,9 +44,9 @@ class JFormFieldArticles extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/externalsource.php b/admin/models/fields/externalsource.php index d0e1a375..b7548178 100644 --- a/admin/models/fields/externalsource.php +++ b/admin/models/fields/externalsource.php @@ -151,9 +151,9 @@ class JFormFieldExternalsource extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/externalsourcefiles.php b/admin/models/fields/externalsourcefiles.php index bc9cede5..14a1d512 100644 --- a/admin/models/fields/externalsourcefiles.php +++ b/admin/models/fields/externalsourcefiles.php @@ -44,9 +44,9 @@ class JFormFieldExternalsourcefiles extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // set the default $options[] = JHtml::_('select.option', '', JText::_('COM_SERMONDISTRIBUTOR_THE_LOCAL_LISTING_OF_THE_MANUAL_EXTERNAL_SOURCE_FOLDERS_IS_EMPTY')); diff --git a/admin/models/fields/localfiles.php b/admin/models/fields/localfiles.php index e245f98f..673ddf5b 100644 --- a/admin/models/fields/localfiles.php +++ b/admin/models/fields/localfiles.php @@ -44,9 +44,9 @@ class JFormFieldLocalfiles extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // get local folder $localfolder = JComponentHelper::getParams('com_sermondistributor')->get('localfolder', JPATH_ROOT.'/images'); diff --git a/admin/models/fields/preachers.php b/admin/models/fields/preachers.php index 03da1bf5..58fa7b79 100644 --- a/admin/models/fields/preachers.php +++ b/admin/models/fields/preachers.php @@ -44,9 +44,9 @@ class JFormFieldPreachers extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/series.php b/admin/models/fields/series.php index 8618cc7f..92daee88 100644 --- a/admin/models/fields/series.php +++ b/admin/models/fields/series.php @@ -44,9 +44,9 @@ class JFormFieldSeries extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/sermon.php b/admin/models/fields/sermon.php index 0c6a1aab..9a7c7736 100644 --- a/admin/models/fields/sermon.php +++ b/admin/models/fields/sermon.php @@ -151,9 +151,9 @@ class JFormFieldSermon extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/siteviewfolderlist.php b/admin/models/fields/siteviewfolderlist.php index 22492b65..93b74854 100644 --- a/admin/models/fields/siteviewfolderlist.php +++ b/admin/models/fields/siteviewfolderlist.php @@ -44,9 +44,9 @@ class JFormFieldSiteviewfolderlist extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // get custom folder files $localfolder = JPATH_COMPONENT_SITE.'/views'; diff --git a/admin/models/forms/external_source.js b/admin/models/forms/external_source.js index 51fa1570..82ac8ea4 100644 --- a/admin/models/forms/external_source.js +++ b/admin/models/forms/external_source.js @@ -257,6 +257,7 @@ function vvvvvwj(update_method_vvvvvwj) if (update_method_vvvvvwj == 2) { jQuery('#jform_update_timer').closest('.control-group').show(); + // add required attribute to update_timer field if (jform_vvvvvwjvwd_required) { updateFieldRequired('update_timer',0); @@ -265,11 +266,11 @@ function vvvvvwj(update_method_vvvvvwj) jQuery('#jform_update_timer').addClass('required'); jform_vvvvvwjvwd_required = false; } - } else { jQuery('#jform_update_timer').closest('.control-group').hide(); + // remove required attribute from update_timer field if (!jform_vvvvvwjvwd_required) { updateFieldRequired('update_timer',1); @@ -389,6 +390,7 @@ function vvvvvwm(externalsources_vvvvvwm,update_method_vvvvvwm) if (externalsources && update_method) { jQuery('#jform_oauthtoken').closest('.control-group').show(); + // add required attribute to oauthtoken field if (jform_vvvvvwmvwe_required) { updateFieldRequired('oauthtoken',0); @@ -397,11 +399,11 @@ function vvvvvwm(externalsources_vvvvvwm,update_method_vvvvvwm) jQuery('#jform_oauthtoken').addClass('required'); jform_vvvvvwmvwe_required = false; } - } else { jQuery('#jform_oauthtoken').closest('.control-group').hide(); + // remove required attribute from oauthtoken field if (!jform_vvvvvwmvwe_required) { updateFieldRequired('oauthtoken',1); diff --git a/admin/models/forms/external_source.xml b/admin/models/forms/external_source.xml index 4b516940..fcae6bf7 100644 --- a/admin/models/forms/external_source.xml +++ b/admin/models/forms/external_source.xml @@ -117,6 +117,7 @@ label="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_UPDATE_METHOD_LABEL" description="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_UPDATE_METHOD_DESCRIPTION" class="btn-group btn-group-yesno" + default="" required="true"> @@ -225,6 +227,7 @@ name="folder" label="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_FOLDER_LABEL" description="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_FOLDER_DESCRIPTION" + default="" id="folder" class="folders" select="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_FOLDER_SELECT" @@ -302,6 +305,7 @@ name="sharedurl" label="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_SHAREDURL_LABEL" description="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_SHAREDURL_DESCRIPTION" + default="" id="sharedurl" class="sharedurls" select="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_SHAREDURL_SELECT" @@ -316,6 +320,7 @@ label="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_TSHAREDURL_LABEL" size="40" maxlength="120" + default="" description="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_TSHAREDURL_DESCRIPTION" class="text_area span12" required="false" @@ -336,6 +341,7 @@ label="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_OAUTHTOKEN_LABEL" size="250" maxlength="250" + default="" description="COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_OAUTHTOKEN_DESCRIPTION" class="text_area" required="true" diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index abb38ebd..c6f34f79 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -58,6 +58,7 @@ function vvvvvwx(location_vvvvvwx) if (location_vvvvvwx == 1) { jQuery('#jform_admin_view').closest('.control-group').show(); + // add required attribute to admin_view field if (jform_vvvvvwxvwf_required) { updateFieldRequired('admin_view',0); @@ -66,11 +67,11 @@ function vvvvvwx(location_vvvvvwx) jQuery('#jform_admin_view').addClass('required'); jform_vvvvvwxvwf_required = false; } - } else { jQuery('#jform_admin_view').closest('.control-group').hide(); + // remove required attribute from admin_view field if (!jform_vvvvvwxvwf_required) { updateFieldRequired('admin_view',1); @@ -89,6 +90,7 @@ function vvvvvwy(location_vvvvvwy) if (location_vvvvvwy == 2) { jQuery('#jform_site_view').closest('.control-group').show(); + // add required attribute to site_view field if (jform_vvvvvwyvwg_required) { updateFieldRequired('site_view',0); @@ -97,11 +99,11 @@ function vvvvvwy(location_vvvvvwy) jQuery('#jform_site_view').addClass('required'); jform_vvvvvwyvwg_required = false; } - } else { jQuery('#jform_site_view').closest('.control-group').hide(); + // remove required attribute from site_view field if (!jform_vvvvvwyvwg_required) { updateFieldRequired('site_view',1); @@ -133,6 +135,7 @@ function vvvvvwz(type_vvvvvwz) if (type) { jQuery('#jform_url').closest('.control-group').show(); + // add required attribute to url field if (jform_vvvvvwzvwh_required) { updateFieldRequired('url',0); @@ -141,11 +144,11 @@ function vvvvvwz(type_vvvvvwz) jQuery('#jform_url').addClass('required'); jform_vvvvvwzvwh_required = false; } - } else { jQuery('#jform_url').closest('.control-group').hide(); + // remove required attribute from url field if (!jform_vvvvvwzvwh_required) { updateFieldRequired('url',1); @@ -188,6 +191,7 @@ function vvvvvxa(type_vvvvvxa) if (type) { jQuery('#jform_article').closest('.control-group').show(); + // add required attribute to article field if (jform_vvvvvxavwi_required) { updateFieldRequired('article',0); @@ -196,11 +200,11 @@ function vvvvvxa(type_vvvvvxa) jQuery('#jform_article').addClass('required'); jform_vvvvvxavwi_required = false; } - } else { jQuery('#jform_article').closest('.control-group').hide(); + // remove required attribute from article field if (!jform_vvvvvxavwi_required) { updateFieldRequired('article',1); @@ -243,6 +247,7 @@ 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); @@ -251,11 +256,11 @@ function vvvvvxb(type_vvvvvxb) 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); @@ -285,6 +290,7 @@ function vvvvvxc(target_vvvvvxc) if (target_vvvvvxc == 1) { jQuery('#jform_groups').closest('.control-group').show(); + // add required attribute to groups field if (jform_vvvvvxcvwk_required) { updateFieldRequired('groups',0); @@ -293,11 +299,11 @@ function vvvvvxc(target_vvvvvxc) jQuery('#jform_groups').addClass('required'); jform_vvvvvxcvwk_required = false; } - } else { jQuery('#jform_groups').closest('.control-group').hide(); + // remove required attribute from groups field if (!jform_vvvvvxcvwk_required) { updateFieldRequired('groups',1); diff --git a/admin/models/forms/help_document.xml b/admin/models/forms/help_document.xml index 157d057b..b7cf698a 100644 --- a/admin/models/forms/help_document.xml +++ b/admin/models/forms/help_document.xml @@ -127,7 +127,8 @@ description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE_DESCRIPTION" class="list_class" multiple="false" - required="true"> + required="true" + default=""> @@ -154,6 +155,7 @@ label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_LOCATION_LABEL" description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_LOCATION_DESCRIPTION" class="btn-group" + default="" required="true"> diff --git a/admin/models/forms/series.xml b/admin/models/forms/series.xml index 5636d94f..c3d54331 100644 --- a/admin/models/forms/series.xml +++ b/admin/models/forms/series.xml @@ -138,6 +138,7 @@ label="COM_SERMONDISTRIBUTOR_SERIES_SCRIPTURE_LABEL" size="90" maxlength="150" + default="" description="COM_SERMONDISTRIBUTOR_SERIES_SCRIPTURE_DESCRIPTION" class="text_area" readonly="false" diff --git a/admin/models/forms/sermon.js b/admin/models/forms/sermon.js index 657daaa4..3a8681e4 100644 --- a/admin/models/forms/sermon.js +++ b/admin/models/forms/sermon.js @@ -79,6 +79,7 @@ function vvvvvvv(source_vvvvvvv) if (source) { jQuery('#jform_build').closest('.control-group').show(); + // add required attribute to build field if (jform_vvvvvvvvvw_required) { updateFieldRequired('build',0); @@ -87,11 +88,11 @@ function vvvvvvv(source_vvvvvvv) jQuery('#jform_build').addClass('required'); jform_vvvvvvvvvw_required = false; } - } else { jQuery('#jform_build').closest('.control-group').hide(); + // remove required attribute from build field if (!jform_vvvvvvvvvw_required) { updateFieldRequired('build',1); @@ -207,6 +208,7 @@ function vvvvvvy(source_vvvvvvy,build_vvvvvvy) if (source && build) { jQuery('#jform_manual_files').closest('.control-group').show(); + // add required attribute to manual_files field if (jform_vvvvvvyvvx_required) { updateFieldRequired('manual_files',0); @@ -215,12 +217,12 @@ function vvvvvvy(source_vvvvvvy,build_vvvvvvy) jQuery('#jform_manual_files').addClass('required'); jform_vvvvvvyvvx_required = false; } - jQuery('.note_manual_externalsource').closest('.control-group').show(); } else { jQuery('#jform_manual_files').closest('.control-group').hide(); + // remove required attribute from manual_files field if (!jform_vvvvvvyvvx_required) { updateFieldRequired('manual_files',1); @@ -287,6 +289,7 @@ function vvvvvvz(build_vvvvvvz,source_vvvvvvz) if (build && source) { jQuery('#jform_manual_files').closest('.control-group').show(); + // add required attribute to manual_files field if (jform_vvvvvvzvvy_required) { updateFieldRequired('manual_files',0); @@ -295,12 +298,12 @@ function vvvvvvz(build_vvvvvvz,source_vvvvvvz) jQuery('#jform_manual_files').addClass('required'); jform_vvvvvvzvvy_required = false; } - jQuery('.note_manual_externalsource').closest('.control-group').show(); } else { jQuery('#jform_manual_files').closest('.control-group').hide(); + // remove required attribute from manual_files field if (!jform_vvvvvvzvvy_required) { updateFieldRequired('manual_files',1); @@ -355,6 +358,7 @@ function vvvvvwa(source_vvvvvwa) if (source) { jQuery('#jform_local_files').closest('.control-group').show(); + // add required attribute to local_files field if (jform_vvvvvwavvz_required) { updateFieldRequired('local_files',0); @@ -363,11 +367,11 @@ function vvvvvwa(source_vvvvvwa) jQuery('#jform_local_files').addClass('required'); jform_vvvvvwavvz_required = false; } - } else { jQuery('#jform_local_files').closest('.control-group').hide(); + // remove required attribute from local_files field if (!jform_vvvvvwavvz_required) { updateFieldRequired('local_files',1); @@ -410,6 +414,7 @@ function vvvvvwb(source_vvvvvwb) if (source) { jQuery('#jform_url').closest('.control-group').show(); + // add required attribute to url field if (jform_vvvvvwbvwa_required) { updateFieldRequired('url',0); @@ -418,11 +423,11 @@ function vvvvvwb(source_vvvvvwb) jQuery('#jform_url').addClass('required'); jform_vvvvvwbvwa_required = false; } - } else { jQuery('#jform_url').closest('.control-group').hide(); + // remove required attribute from url field if (!jform_vvvvvwbvwa_required) { updateFieldRequired('url',1); diff --git a/admin/models/forms/sermon.xml b/admin/models/forms/sermon.xml index fdab8eb9..2d4a64fd 100644 --- a/admin/models/forms/sermon.xml +++ b/admin/models/forms/sermon.xml @@ -162,6 +162,7 @@ label="COM_SERMONDISTRIBUTOR_SERMON_CATID_LABEL" extension="com_sermondistributor.sermons" required="false" + default="" description="COM_SERMONDISTRIBUTOR_SERMON_CATID_DESCRIPTION" class="inputbox" /> @@ -189,7 +190,8 @@ class="list_class" multiple="false" filter="INT" - required="true"> + required="true" + default=""> @@ -267,7 +269,8 @@ class="list_class" multiple="false" filter="INT" - required="true"> + required="true" + default=""> @@ -309,6 +312,7 @@ label="COM_SERMONDISTRIBUTOR_SERMON_URL_LABEL" size="10" maxlength="50" + default="" description="COM_SERMONDISTRIBUTOR_SERMON_URL_DESCRIPTION" class="text_area" required="true" @@ -324,6 +328,7 @@ label="COM_SERMONDISTRIBUTOR_SERMON_SCRIPTURE_LABEL" size="90" maxlength="150" + default="" description="COM_SERMONDISTRIBUTOR_SERMON_SCRIPTURE_DESCRIPTION" class="text_area" readonly="false" diff --git a/admin/models/help_document.php b/admin/models/help_document.php index 7958a8cc..dfdcd9a0 100644 --- a/admin/models/help_document.php +++ b/admin/models/help_document.php @@ -108,7 +108,7 @@ class SermondistributorModelHelp_document extends JModelAdmin } return $item; - } + } /** * Method to get the record form. @@ -395,7 +395,7 @@ class SermondistributorModelHelp_document extends JModelAdmin } } return parent::validate($form, $data, $group); - } + } /** * Method to get the unique fields of this table. @@ -680,7 +680,7 @@ class SermondistributorModelHelp_document extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -812,7 +812,7 @@ class SermondistributorModelHelp_document extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Set the groups string to JSON string. if (isset($data['groups'])) diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index c275b702..5453f2ed 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -108,7 +108,7 @@ class SermondistributorModelHelp_documents extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -148,7 +148,7 @@ class SermondistributorModelHelp_documents extends JModelList $item->groups = $groupsNames; } } - } + } // set selection value to a translatable value if (SermondistributorHelper::checkArray($items)) @@ -161,7 +161,7 @@ class SermondistributorModelHelp_documents extends JModelList $item->location = $this->selectionTranslation($item->location, 'location'); } } - + // return items return $items; @@ -392,7 +392,7 @@ class SermondistributorModelHelp_documents extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. diff --git a/admin/models/local_listing.php b/admin/models/local_listing.php index baf8cb0a..a0167b01 100644 --- a/admin/models/local_listing.php +++ b/admin/models/local_listing.php @@ -145,7 +145,7 @@ class SermondistributorModelLocal_listing extends JModelAdmin } return $item; - } + } /** * Method to get the record form. @@ -500,7 +500,7 @@ class SermondistributorModelLocal_listing extends JModelAdmin } return $data; - } + } /** * Method to get the unique fields of this table. @@ -790,7 +790,7 @@ class SermondistributorModelLocal_listing extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -922,7 +922,7 @@ class SermondistributorModelLocal_listing extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Get the basic encryption key. $basickey = SermondistributorHelper::getCryptKey('basic'); diff --git a/admin/models/local_listings.php b/admin/models/local_listings.php index 5b8957f1..a7882e9b 100644 --- a/admin/models/local_listings.php +++ b/admin/models/local_listings.php @@ -108,7 +108,7 @@ class SermondistributorModelLocal_listings extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -128,7 +128,7 @@ class SermondistributorModelLocal_listings extends JModelList } } - } + } // set selection value to a translatable value if (SermondistributorHelper::checkArray($items)) @@ -139,7 +139,7 @@ class SermondistributorModelLocal_listings extends JModelList $item->build = $this->selectionTranslation($item->build, 'build'); } } - + // return items return $items; @@ -339,7 +339,7 @@ class SermondistributorModelLocal_listings extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. diff --git a/admin/models/manual_updater.php b/admin/models/manual_updater.php index 65f10658..5f341a8c 100644 --- a/admin/models/manual_updater.php +++ b/admin/models/manual_updater.php @@ -100,7 +100,7 @@ class SermondistributorModelManual_updater extends JModelList // redirect away if not a correct (TODO for now we go to default view) $app->redirect('index.php?option=com_sermondistributor'); return false; - } + } // load parent items $items = parent::getItems(); @@ -132,7 +132,7 @@ class SermondistributorModelManual_updater extends JModelList $item->oauthtoken = rtrim($basic->decryptString($item->oauthtoken), "\0"); } } - } + } // return items return $items; @@ -151,5 +151,5 @@ class SermondistributorModelManual_updater extends JModelList return $this->uikitComp; } return false; - } + } } diff --git a/admin/models/preacher.php b/admin/models/preacher.php index 0518155f..d874e547 100644 --- a/admin/models/preacher.php +++ b/admin/models/preacher.php @@ -243,7 +243,7 @@ class SermondistributorModelPreacher extends JModelAdmin } } return $value; - } + } /** * Method to get the record form. @@ -496,7 +496,7 @@ class SermondistributorModelPreacher extends JModelAdmin } return $data; - } + } /** * Method to get the unique fields of this table. @@ -781,7 +781,7 @@ class SermondistributorModelPreacher extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -913,7 +913,7 @@ class SermondistributorModelPreacher extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) diff --git a/admin/models/preachers.php b/admin/models/preachers.php index f8a80708..bfcb42fb 100644 --- a/admin/models/preachers.php +++ b/admin/models/preachers.php @@ -96,7 +96,7 @@ class SermondistributorModelPreachers extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -116,7 +116,7 @@ class SermondistributorModelPreachers extends JModelList } } - } + } // return items return $items; @@ -289,7 +289,7 @@ class SermondistributorModelPreachers extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. diff --git a/admin/models/series.php b/admin/models/series.php index 24c73045..68bd7dae 100644 --- a/admin/models/series.php +++ b/admin/models/series.php @@ -243,7 +243,7 @@ class SermondistributorModelSeries extends JModelAdmin } } return $value; - } + } /** * Method to get the record form. @@ -496,7 +496,7 @@ class SermondistributorModelSeries extends JModelAdmin } return $data; - } + } /** * Method to get the unique fields of this table. @@ -781,7 +781,7 @@ class SermondistributorModelSeries extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -913,7 +913,7 @@ class SermondistributorModelSeries extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) diff --git a/admin/models/series_list.php b/admin/models/series_list.php index eaac9ddb..977b49a8 100644 --- a/admin/models/series_list.php +++ b/admin/models/series_list.php @@ -92,7 +92,7 @@ class SermondistributorModelSeries_list extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -112,7 +112,7 @@ class SermondistributorModelSeries_list extends JModelList } } - } + } // return items return $items; @@ -285,7 +285,7 @@ class SermondistributorModelSeries_list extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. diff --git a/admin/models/sermon.php b/admin/models/sermon.php index aefac22a..d9fed510 100644 --- a/admin/models/sermon.php +++ b/admin/models/sermon.php @@ -206,7 +206,7 @@ class SermondistributorModelSermon extends JModelAdmin return $items; } return false; - } + } /** * Method to get the record form. @@ -495,7 +495,7 @@ class SermondistributorModelSermon extends JModelAdmin } } return parent::validate($form, $data, $group); - } + } /** * Method to get the unique fields of this table. @@ -803,7 +803,7 @@ class SermondistributorModelSermon extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -951,7 +951,7 @@ class SermondistributorModelSermon extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Set the local_files string to JSON string. if (isset($data['local_files'])) diff --git a/admin/models/sermons.php b/admin/models/sermons.php index 3813ea4b..7df270b9 100644 --- a/admin/models/sermons.php +++ b/admin/models/sermons.php @@ -124,7 +124,7 @@ class SermondistributorModelSermons extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -144,7 +144,7 @@ class SermondistributorModelSermons extends JModelList } } - } + } // set selection value to a translatable value if (SermondistributorHelper::checkArray($items)) @@ -157,7 +157,7 @@ class SermondistributorModelSermons extends JModelList $item->source = $this->selectionTranslation($item->source, 'source'); } } - + // return items return $items; @@ -420,7 +420,7 @@ class SermondistributorModelSermons extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. diff --git a/admin/models/statistic.php b/admin/models/statistic.php index c5bc24f1..7bd7729a 100644 --- a/admin/models/statistic.php +++ b/admin/models/statistic.php @@ -102,7 +102,7 @@ class SermondistributorModelStatistic extends JModelAdmin } return $item; - } + } /** * Method to get the record form. @@ -355,7 +355,7 @@ class SermondistributorModelStatistic extends JModelAdmin } return $data; - } + } /** * Method to get the unique fields of this table. @@ -645,7 +645,7 @@ class SermondistributorModelStatistic extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -777,7 +777,7 @@ class SermondistributorModelStatistic extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) diff --git a/admin/models/statistics.php b/admin/models/statistics.php index 7e3b9e08..9645dded 100644 --- a/admin/models/statistics.php +++ b/admin/models/statistics.php @@ -108,7 +108,7 @@ class SermondistributorModelStatistics extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -128,7 +128,7 @@ class SermondistributorModelStatistics extends JModelList } } - } + } // return items return $items; @@ -328,7 +328,7 @@ class SermondistributorModelStatistics extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index aef0de93..007c1f7e 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_preacher` ( `icon` CHAR(64) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL DEFAULT '', `website` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -19,9 +19,9 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_preacher` ( `hits` INT(10) unsigned NOT NULL DEFAULT 0, `access` INT(10) unsigned NOT NULL DEFAULT 0, `ordering` INT(11) NOT NULL DEFAULT 0, - `metakey` TEXT NOT NULL DEFAULT '', - `metadesc` TEXT NOT NULL DEFAULT '', - `metadata` TEXT NOT NULL DEFAULT '', + `metakey` TEXT NOT NULL, + `metadesc` TEXT NOT NULL, + `metadata` TEXT NOT NULL, PRIMARY KEY (`id`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), @@ -30,7 +30,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_preacher` ( KEY `idx_state` (`published`), KEY `idx_name` (`name`), KEY `idx_alias` (`alias`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__sermondistributor_sermon` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -52,7 +52,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_sermon` ( `short_description` VARCHAR(255) NOT NULL DEFAULT '', `source` TINYINT(1) NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -64,9 +64,9 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_sermon` ( `hits` INT(10) unsigned NOT NULL DEFAULT 0, `access` INT(10) unsigned NOT NULL DEFAULT 0, `ordering` INT(11) NOT NULL DEFAULT 0, - `metakey` TEXT NOT NULL DEFAULT '', - `metadesc` TEXT NOT NULL DEFAULT '', - `metadata` TEXT NOT NULL DEFAULT '', + `metakey` TEXT NOT NULL, + `metadesc` TEXT NOT NULL, + `metadata` TEXT NOT NULL, PRIMARY KEY (`id`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), @@ -80,7 +80,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_sermon` ( KEY `idx_link_type` (`link_type`), KEY `idx_alias` (`alias`), KEY `idx_build` (`build`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__sermondistributor_series` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -90,7 +90,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_series` ( `icon` CHAR(64) NOT NULL DEFAULT '', `name` VARCHAR(255) NOT NULL DEFAULT '', `scripture` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -102,9 +102,9 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_series` ( `hits` INT(10) unsigned NOT NULL DEFAULT 0, `access` INT(10) unsigned NOT NULL DEFAULT 0, `ordering` INT(11) NOT NULL DEFAULT 0, - `metakey` TEXT NOT NULL DEFAULT '', - `metadesc` TEXT NOT NULL DEFAULT '', - `metadata` TEXT NOT NULL DEFAULT '', + `metakey` TEXT NOT NULL, + `metadesc` TEXT NOT NULL, + `metadata` TEXT NOT NULL, PRIMARY KEY (`id`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), @@ -113,7 +113,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_series` ( KEY `idx_state` (`published`), KEY `idx_name` (`name`), KEY `idx_alias` (`alias`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__sermondistributor_statistic` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -123,7 +123,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_statistic` ( `preacher` INT(11) NOT NULL DEFAULT 0, `series` INT(11) NOT NULL DEFAULT 0, `sermon` INT(11) NOT NULL DEFAULT 0, - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -135,9 +135,9 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_statistic` ( `hits` INT(10) unsigned NOT NULL DEFAULT 0, `access` INT(10) unsigned NOT NULL DEFAULT 0, `ordering` INT(11) NOT NULL DEFAULT 0, - `metakey` TEXT NOT NULL DEFAULT '', - `metadesc` TEXT NOT NULL DEFAULT '', - `metadata` TEXT NOT NULL DEFAULT '', + `metakey` TEXT NOT NULL, + `metadesc` TEXT NOT NULL, + `metadata` TEXT NOT NULL, PRIMARY KEY (`id`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), @@ -148,7 +148,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_statistic` ( KEY `idx_sermon` (`sermon`), KEY `idx_preacher` (`preacher`), KEY `idx_series` (`series`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__sermondistributor_external_source` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -165,7 +165,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_external_source` ( `sharedurl` TEXT NOT NULL, `update_method` TINYINT NOT NULL DEFAULT 0, `update_timer` INT(1) NOT NULL DEFAULT 0, - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -187,7 +187,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_external_source` ( KEY `idx_build` (`build`), KEY `idx_dropboxoptions` (`dropboxoptions`), KEY `idx_permissiontype` (`permissiontype`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__sermondistributor_local_listing` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -198,7 +198,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_local_listing` ( `name` VARCHAR(255) NOT NULL DEFAULT '', `size` INT(50) NOT NULL DEFAULT 0, `url` TEXT NOT NULL, - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -217,7 +217,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_local_listing` ( KEY `idx_name` (`name`), KEY `idx_build` (`build`), KEY `idx_key` (`key`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; CREATE TABLE IF NOT EXISTS `#__sermondistributor_help_document` ( `id` INT(11) NOT NULL AUTO_INCREMENT, @@ -234,7 +234,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_help_document` ( `title` CHAR(64) NOT NULL DEFAULT '', `type` TINYINT(1) NOT NULL DEFAULT 0, `url` VARCHAR(255) NOT NULL DEFAULT '', - `params` text NOT NULL DEFAULT '', + `params` text NOT NULL, `published` TINYINT(3) NOT NULL DEFAULT 1, `created_by` INT(10) unsigned NOT NULL DEFAULT 0, `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, @@ -246,9 +246,9 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_help_document` ( `hits` INT(10) unsigned NOT NULL DEFAULT 0, `access` INT(10) unsigned NOT NULL DEFAULT 0, `ordering` INT(11) NOT NULL DEFAULT 0, - `metakey` TEXT NOT NULL DEFAULT '', - `metadesc` TEXT NOT NULL DEFAULT '', - `metadata` TEXT NOT NULL DEFAULT '', + `metakey` TEXT NOT NULL, + `metadesc` TEXT NOT NULL, + `metadata` TEXT NOT NULL, PRIMARY KEY (`id`), KEY `idx_access` (`access`), KEY `idx_checkout` (`checked_out`), @@ -261,7 +261,7 @@ CREATE TABLE IF NOT EXISTS `#__sermondistributor_help_document` ( KEY `idx_article` (`article`), KEY `idx_target` (`target`), KEY `idx_alias` (`alias`) -) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/admin/tables/external_source.php b/admin/tables/external_source.php index f31d7574..30d3f19a 100644 --- a/admin/tables/external_source.php +++ b/admin/tables/external_source.php @@ -50,7 +50,7 @@ class SermondistributorTableExternal_source extends JTable parent::__construct('#__sermondistributor_external_source', 'id', $db); // Adding History Options - JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.external_source')); + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.external_source')); } public function bind($array, $ignore = '') @@ -233,7 +233,7 @@ class SermondistributorTableExternal_source extends JTable { // asset alread set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) diff --git a/admin/tables/help_document.php b/admin/tables/help_document.php index 3d456e83..d6e0cc7a 100644 --- a/admin/tables/help_document.php +++ b/admin/tables/help_document.php @@ -50,7 +50,7 @@ class SermondistributorTableHelp_document extends JTable parent::__construct('#__sermondistributor_help_document', 'id', $db); // Adding History Options - JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.help_document')); + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.help_document')); } public function bind($array, $ignore = '') @@ -233,7 +233,7 @@ class SermondistributorTableHelp_document extends JTable { // asset alread set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) diff --git a/admin/tables/local_listing.php b/admin/tables/local_listing.php index c8b9035f..8b92ca36 100644 --- a/admin/tables/local_listing.php +++ b/admin/tables/local_listing.php @@ -50,7 +50,7 @@ class SermondistributorTableLocal_listing extends JTable parent::__construct('#__sermondistributor_local_listing', 'id', $db); // Adding History Options - JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.local_listing')); + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.local_listing')); } public function bind($array, $ignore = '') @@ -233,7 +233,7 @@ class SermondistributorTableLocal_listing extends JTable { // asset alread set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) diff --git a/admin/tables/preacher.php b/admin/tables/preacher.php index 85dd9c47..904e6b35 100644 --- a/admin/tables/preacher.php +++ b/admin/tables/preacher.php @@ -50,7 +50,7 @@ class SermondistributorTablePreacher extends JTable parent::__construct('#__sermondistributor_preacher', 'id', $db); // Adding History Options - JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.preacher')); + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.preacher')); } public function bind($array, $ignore = '') @@ -233,7 +233,7 @@ class SermondistributorTablePreacher extends JTable { // asset alread set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) diff --git a/admin/tables/series.php b/admin/tables/series.php index d5f384ee..19c5887c 100644 --- a/admin/tables/series.php +++ b/admin/tables/series.php @@ -50,7 +50,7 @@ class SermondistributorTableSeries extends JTable parent::__construct('#__sermondistributor_series', 'id', $db); // Adding History Options - JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.series')); + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.series')); } public function bind($array, $ignore = '') @@ -233,7 +233,7 @@ class SermondistributorTableSeries extends JTable { // asset alread set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) diff --git a/admin/tables/sermon.php b/admin/tables/sermon.php index e91a3a4b..67f78a9b 100644 --- a/admin/tables/sermon.php +++ b/admin/tables/sermon.php @@ -53,7 +53,7 @@ class SermondistributorTableSermon extends JTable JTableObserverTags::createObserver($this, array('typeAlias' => 'com_sermondistributor.sermon')); // Adding History Options - JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.sermon')); + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.sermon')); } public function bind($array, $ignore = '') @@ -236,7 +236,7 @@ class SermondistributorTableSermon extends JTable { // asset alread set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) diff --git a/admin/tables/statistic.php b/admin/tables/statistic.php index 71250cc0..e87bb6f6 100644 --- a/admin/tables/statistic.php +++ b/admin/tables/statistic.php @@ -50,7 +50,7 @@ class SermondistributorTableStatistic extends JTable parent::__construct('#__sermondistributor_statistic', 'id', $db); // Adding History Options - JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.statistic')); + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.statistic')); } public function bind($array, $ignore = '') @@ -233,7 +233,7 @@ class SermondistributorTableStatistic extends JTable { // asset alread set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) diff --git a/admin/views/external_source/submitbutton.js b/admin/views/external_source/submitbutton.js index f43d9a4b..144f8230 100644 --- a/admin/views/external_source/submitbutton.js +++ b/admin/views/external_source/submitbutton.js @@ -26,19 +26,9 @@ Joomla.submitbutton = function(task) if (task == ''){ return false; } else { - var isValid=true; var action = task.split('.'); - if (action[1] != 'cancel' && action[1] != 'close'){ - var forms = $$('form.form-validate'); - for (var i=0;iparams; // will be removed just use $this->params instead ?>