Stable release of v3.0.4

Add the getDocument method call to view. Add recall tab memory to view tabs. Add root class calls like \JRoute.
This commit is contained in:
Robot 2024-03-07 19:06:22 +02:00
parent aeb3d063f2
commit cda404b810
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
30 changed files with 132 additions and 107 deletions

View File

@ -1,3 +1,9 @@
# v3.0.4
- Add the getDocument method call to view
- Add recall tab memory to view tabs
- Add root class calls like \JRoute
# v3.0.3
- Removed the not_required field from the sermon model. #36

View File

@ -24,38 +24,38 @@ 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*: 11th February, 2024
+ *Last Build*: 7th March, 2024
+ *Version*: 3.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time :hourglass:
**243 Hours** or **30 Eight Hour Days** (actual time the author saved -
**237 Hours** or **30 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (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*: **87039**
+ *File count*: **595**
+ *Folder count*: **113**
+ *Line count*: **84910**
+ *File count*: **572**
+ *Folder count*: **101**
**160 Hours** or **20 Eight Hour Days** (the actual time the author spent)
**156 Hours** or **19 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @61hours** = codingtime / 4;
> **planning @35hours** = codingtime / 7;
> **debugging @59hours** = codingtime / 4;
> **planning @34hours** = codingtime / 7;
> **mapping @24hours** = codingtime / 10;
> **office @40hours** = codingtime / 6;)
> **office @39hours** = codingtime / 6;)
**403 Hours** or **50 Eight Hour Days**
**393 Hours** or **49 Eight Hour Days**
(a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: **10 weeks** or **2.1 months**
Project duration: **9.8 weeks** or **2 months**
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -24,38 +24,38 @@ 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*: 11th February, 2024
+ *Last Build*: 7th March, 2024
+ *Version*: 3.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time :hourglass:
**243 Hours** or **30 Eight Hour Days** (actual time the author saved -
**237 Hours** or **30 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (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*: **87039**
+ *File count*: **595**
+ *Folder count*: **113**
+ *Line count*: **84910**
+ *File count*: **572**
+ *Folder count*: **101**
**160 Hours** or **20 Eight Hour Days** (the actual time the author spent)
**156 Hours** or **19 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @61hours** = codingtime / 4;
> **planning @35hours** = codingtime / 7;
> **debugging @59hours** = codingtime / 4;
> **planning @34hours** = codingtime / 7;
> **mapping @24hours** = codingtime / 10;
> **office @40hours** = codingtime / 6;)
> **office @39hours** = codingtime / 6;)
**403 Hours** or **50 Eight Hour Days**
**393 Hours** or **49 Eight Hour Days**
(a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: **10 weeks** or **2.1 months**
Project duration: **9.8 weeks** or **2 months**
> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -209,7 +209,7 @@ abstract class SermondistributorHelper
}
$keyCounterRAW = $safe->encryptString(json_encode($keyCounter));
$keyCounter = self::base64_urlencode($keyCounterRAW);
$token = JSession::getFormToken();
$token = \JSession::getFormToken();
$downloadURL = Uri::root().'index.php?option=com_sermondistributor&task=download.file&key='.$keyCounter.'&token='.$token;
// check if local .htaccess should be set
$setHtaccess = false;
@ -219,7 +219,7 @@ abstract class SermondistributorHelper
{
case 1:
// local file get local folder and check if outside root (if not then allow direct)
$localFolder = JComponentHelper::getParams('com_sermondistributor')->get('localfolder', JPATH_ROOT.'/images').'/';
$localFolder = \JComponentHelper::getParams('com_sermondistributor')->get('localfolder', JPATH_ROOT.'/images').'/';
// should we allow direct downloads
$allowDirect = false;
if (2 == $sermon->link_type && strpos($localFolder, JPATH_ROOT) !== false)
@ -257,7 +257,7 @@ abstract class SermondistributorHelper
break;
case 2:
// Dropbox get global dropbox switch
$addToButton = JComponentHelper::getParams('com_sermondistributor')->get('add_to_button', 0);
$addToButton = \JComponentHelper::getParams('com_sermondistributor')->get('add_to_button', 0);
if (1 == $sermon->build)
{
if (self::checkArray($sermon->manual_files))
@ -777,7 +777,7 @@ abstract class SermondistributorHelper
if (!isset(self::$localkey[$type]))
{
// get the main key
self::$localkey[$type] = JComponentHelper::getParams('com_sermondistributor')->get($type, 'localKey34fdWEkl');
self::$localkey[$type] = \JComponentHelper::getParams('com_sermondistributor')->get($type, 'localKey34fdWEkl');
}
return self::$localkey[$type];
}
@ -1928,40 +1928,40 @@ abstract class SermondistributorHelper
// load user for access menus
$user = Factory::getUser();
// load the submenus to sidebar
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_DASHBOARD'), 'index.php?option=com_sermondistributor&view=sermondistributor', $submenu === 'sermondistributor');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_DASHBOARD'), 'index.php?option=com_sermondistributor&view=sermondistributor', $submenu === 'sermondistributor');
if ($user->authorise('preacher.access', 'com_sermondistributor') && $user->authorise('preacher.submenu', 'com_sermondistributor'))
{
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_PREACHERS'), 'index.php?option=com_sermondistributor&view=preachers', $submenu === 'preachers');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_PREACHERS'), 'index.php?option=com_sermondistributor&view=preachers', $submenu === 'preachers');
}
if ($user->authorise('sermon.access', 'com_sermondistributor') && $user->authorise('sermon.submenu', 'com_sermondistributor'))
{
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_SERMONS'), 'index.php?option=com_sermondistributor&view=sermons', $submenu === 'sermons');
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SERMON_SERMONS_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_sermondistributor.sermon', $submenu === 'categories.sermon');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_SERMONS'), 'index.php?option=com_sermondistributor&view=sermons', $submenu === 'sermons');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SERMON_SERMONS_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_sermondistributor.sermon', $submenu === 'categories.sermon');
}
if ($user->authorise('series.access', 'com_sermondistributor') && $user->authorise('series.submenu', 'com_sermondistributor'))
{
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_SERIES_LIST'), 'index.php?option=com_sermondistributor&view=series_list', $submenu === 'series_list');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_SERIES_LIST'), 'index.php?option=com_sermondistributor&view=series_list', $submenu === 'series_list');
}
if ($user->authorise('statistic.access', 'com_sermondistributor') && $user->authorise('statistic.submenu', 'com_sermondistributor'))
{
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_STATISTICS'), 'index.php?option=com_sermondistributor&view=statistics', $submenu === 'statistics');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_STATISTICS'), 'index.php?option=com_sermondistributor&view=statistics', $submenu === 'statistics');
}
if ($user->authorise('external_source.access', 'com_sermondistributor') && $user->authorise('external_source.submenu', 'com_sermondistributor'))
{
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_EXTERNAL_SOURCES'), 'index.php?option=com_sermondistributor&view=external_sources', $submenu === 'external_sources');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_EXTERNAL_SOURCES'), 'index.php?option=com_sermondistributor&view=external_sources', $submenu === 'external_sources');
}
// Access control (manual_updater.access && manual_updater.submenu).
if ($user->authorise('manual_updater.access', 'com_sermondistributor') && $user->authorise('manual_updater.submenu', 'com_sermondistributor'))
{
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_MANUAL_UPDATER'), 'index.php?option=com_sermondistributor&view=manual_updater', $submenu === 'manual_updater');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_MANUAL_UPDATER'), 'index.php?option=com_sermondistributor&view=manual_updater', $submenu === 'manual_updater');
}
if ($user->authorise('local_listing.access', 'com_sermondistributor') && $user->authorise('local_listing.submenu', 'com_sermondistributor'))
{
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_LOCAL_LISTINGS'), 'index.php?option=com_sermondistributor&view=local_listings', $submenu === 'local_listings');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_LOCAL_LISTINGS'), 'index.php?option=com_sermondistributor&view=local_listings', $submenu === 'local_listings');
}
if ($user->authorise('help_document.access', 'com_sermondistributor') && $user->authorise('help_document.submenu', 'com_sermondistributor'))
{
JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_HELP_DOCUMENTS'), 'index.php?option=com_sermondistributor&view=help_documents', $submenu === 'help_documents');
\JHtmlSidebar::addEntry(Text::_('COM_SERMONDISTRIBUTOR_SUBMENU_HELP_DOCUMENTS'), 'index.php?option=com_sermondistributor&view=help_documents', $submenu === 'help_documents');
}
}

View File

@ -245,11 +245,11 @@ class SermondistributorModelAjax extends ListModel
$result['error'] = '<span style="color: red;">' . Text::sprintf('COM_SERMONDISTRIBUTOR_NO_CRONJOB_PATH_FOUND_FOR_S', $type) . '</span>';
if ($this->hasCurl())
{
$path = '*/15 * * * * curl -s "' .JURI::root() . 'index.php?option=com_sermondistributor&task=api.externalUpdate" >/dev/null 2>&1';
$path = '*/15 * * * * curl -s "' .\JUri::root() . 'index.php?option=com_sermondistributor&task=api.externalUpdate" >/dev/null 2>&1';
}
else
{
$path = '*/15 * * * * wget "' .JURI::root() . 'index.php?option=com_sermondistributor&task=api.externalUpdate" >/dev/null 2>&1';
$path = '*/15 * * * * wget "' .\JUri::root() . 'index.php?option=com_sermondistributor&task=api.externalUpdate" >/dev/null 2>&1';
}
$result['path'] = '<code>' . $path . '</code>';
}

View File

@ -0,0 +1 @@

View File

@ -55,10 +55,10 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div id="sermondistributor_loader" style="display: none;">
<form action="<?php echo Route::_('index.php?option=com_sermondistributor&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo LayoutHelper::render('external_source.details_above', $this); ?>
<?php echo LayoutHelper::render('external_source.details_above', $this); ?>
<div class="form-horizontal">
<?php echo Html::_('bootstrap.startTabSet', 'external_sourceTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'external_sourceTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo Html::_('bootstrap.addTab', 'external_sourceTab', 'details', Text::_('COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">

View File

@ -222,7 +222,7 @@ class SermondistributorViewExternal_source extends HtmlView
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_NEW' : 'COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_EDIT'));
Html::_('stylesheet', "administrator/components/com_sermondistributor/assets/css/external_source.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_sermondistributor/views/external_source/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');

View File

@ -55,10 +55,10 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div id="sermondistributor_loader" style="display: none;">
<form action="<?php echo Route::_('index.php?option=com_sermondistributor&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo LayoutHelper::render('help_document.details_above', $this); ?>
<?php echo LayoutHelper::render('help_document.details_above', $this); ?>
<div class="form-horizontal">
<?php echo Html::_('bootstrap.startTabSet', 'help_documentTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'help_documentTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo Html::_('bootstrap.addTab', 'help_documentTab', 'details', Text::_('COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">

View File

@ -55,10 +55,10 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div id="sermondistributor_loader" style="display: none;">
<form action="<?php echo Route::_('index.php?option=com_sermondistributor&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo LayoutHelper::render('local_listing.details_above', $this); ?>
<?php echo LayoutHelper::render('local_listing.details_above', $this); ?>
<div class="form-horizontal">
<?php echo Html::_('bootstrap.startTabSet', 'local_listingTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'local_listingTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo Html::_('bootstrap.addTab', 'local_listingTab', 'details', Text::_('COM_SERMONDISTRIBUTOR_LOCAL_LISTING_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">

View File

@ -212,7 +212,7 @@ class SermondistributorViewLocal_listing extends HtmlView
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_LOCAL_LISTING_NEW' : 'COM_SERMONDISTRIBUTOR_LOCAL_LISTING_EDIT'));
Html::_('stylesheet', "administrator/components/com_sermondistributor/assets/css/local_listing.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_sermondistributor/views/local_listing/submitbutton.js", ['version' => 'auto']);
// add JavaScripts

View File

@ -127,7 +127,7 @@ jQuery(document).ready(function($) {
</div>
<script>
// token
var token = '<?php echo JSession::getFormToken(); ?>';
var token = '<?php echo \JSession::getFormToken(); ?>';
// nice little dot trick :)
jQuery(document).ready( function($) {
var x=0;

View File

@ -55,10 +55,10 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div id="sermondistributor_loader" style="display: none;">
<form action="<?php echo Route::_('index.php?option=com_sermondistributor&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo LayoutHelper::render('preacher.details_above', $this); ?>
<?php echo LayoutHelper::render('preacher.details_above', $this); ?>
<div class="form-horizontal">
<?php echo Html::_('bootstrap.startTabSet', 'preacherTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'preacherTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo Html::_('bootstrap.addTab', 'preacherTab', 'details', Text::_('COM_SERMONDISTRIBUTOR_PREACHER_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">

View File

@ -237,7 +237,7 @@ class SermondistributorViewPreacher extends HtmlView
Html::_('script', 'media/com_sermondistributor/footable-v2/js/footable.paginate.js', ['version' => 'auto']);
$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('.footable').footable(); }); jQuery('.nav-tabs').on('click', 'li', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery('.footable').trigger('footable_resize'); }";
$this->document->addScriptDeclaration($footable);
$this->getDocument()->addScriptDeclaration($footable);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_sermondistributor/views/preacher/submitbutton.js", ['version' => 'auto']);

View File

@ -55,10 +55,10 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div id="sermondistributor_loader" style="display: none;">
<form action="<?php echo Route::_('index.php?option=com_sermondistributor&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo LayoutHelper::render('series.details_above', $this); ?>
<?php echo LayoutHelper::render('series.details_above', $this); ?>
<div class="form-horizontal">
<?php echo Html::_('bootstrap.startTabSet', 'seriesTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'seriesTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo Html::_('bootstrap.addTab', 'seriesTab', 'details', Text::_('COM_SERMONDISTRIBUTOR_SERIES_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">

View File

@ -237,7 +237,7 @@ class SermondistributorViewSeries extends HtmlView
Html::_('script', 'media/com_sermondistributor/footable-v2/js/footable.paginate.js', ['version' => 'auto']);
$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('.footable').footable(); }); jQuery('.nav-tabs').on('click', 'li', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery('.footable').trigger('footable_resize'); }";
$this->document->addScriptDeclaration($footable);
$this->getDocument()->addScriptDeclaration($footable);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_sermondistributor/views/series/submitbutton.js", ['version' => 'auto']);

View File

@ -55,10 +55,10 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div id="sermondistributor_loader" style="display: none;">
<form action="<?php echo Route::_('index.php?option=com_sermondistributor&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo LayoutHelper::render('sermon.details_above', $this); ?>
<?php echo LayoutHelper::render('sermon.details_above', $this); ?>
<div class="form-horizontal">
<?php echo Html::_('bootstrap.startTabSet', 'sermonTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'sermonTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo Html::_('bootstrap.addTab', 'sermonTab', 'details', Text::_('COM_SERMONDISTRIBUTOR_SERMON_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">

View File

@ -216,7 +216,7 @@ class SermondistributorViewSermon extends HtmlView
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_SERMONDISTRIBUTOR_SERMON_NEW' : 'COM_SERMONDISTRIBUTOR_SERMON_EDIT'));
Html::_('stylesheet', "administrator/components/com_sermondistributor/assets/css/sermon.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
$this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
// Add the CSS for Footable.
Html::_('stylesheet', 'media/com_sermondistributor/footable-v2/css/footable.core.min.css', ['version' => 'auto']);
@ -239,7 +239,7 @@ class SermondistributorViewSermon extends HtmlView
Html::_('script', 'media/com_sermondistributor/footable-v2/js/footable.paginate.js', ['version' => 'auto']);
$footable = "jQuery(document).ready(function() { jQuery(function () { jQuery('.footable').footable(); }); jQuery('.nav-tabs').on('click', 'li', function() { setTimeout(tableFix, 10); }); }); function tableFix() { jQuery('.footable').trigger('footable_resize'); }";
$this->document->addScriptDeclaration($footable);
$this->getDocument()->addScriptDeclaration($footable);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_sermondistributor/views/sermon/submitbutton.js", ['version' => 'auto']);

View File

@ -40,10 +40,10 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<div id="sermondistributor_loader">
<form action="<?php echo Route::_('index.php?option=com_sermondistributor&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo LayoutHelper::render('statistic.details_above', $this); ?>
<?php echo LayoutHelper::render('statistic.details_above', $this); ?>
<div class="form-horizontal">
<?php echo Html::_('bootstrap.startTabSet', 'statisticTab', array('active' => 'details')); ?>
<?php echo Html::_('bootstrap.startTabSet', 'statisticTab', ['active' => 'details', 'recall' => true]); ?>
<?php echo Html::_('bootstrap.addTab', 'statisticTab', 'details', Text::_('COM_SERMONDISTRIBUTOR_STATISTIC_DETAILS', true)); ?>
<div class="row-fluid form-horizontal-desktop">

View File

@ -79,12 +79,12 @@ abstract class Helper
/**
* Set the component option
*
* @param string $option The option
* @param string|null $option The option
*
* @return void
* @since 3.2.0
*/
public static function setOption(string $option): void
public static function setOption(?string $option): void
{
self::$option = $option;
}
@ -97,7 +97,7 @@ abstract class Helper
* @return string|null A component option
* @since 3.0.11
*/
public static function getOption(string $default = 'empty'): ?string
public static function getOption(?string $default = 'empty'): ?string
{
if (empty(self::$option))
{
@ -160,7 +160,7 @@ abstract class Helper
*
* @since 3.0.11
*/
public static function get(string $option = null, string $default = null): ?string
public static function get(?string $option = null, ?string $default = null): ?string
{
// check that we have an option
// and get the code name from it
@ -260,7 +260,7 @@ abstract class Helper
*
* @since 3.0.11
*/
public static function methodExists(string $method, string $option = null): bool
public static function methodExists(string $method, ?string $option = null): bool
{
// get the helper class
return ($helper = self::get($option, null)) !== null &&

View File

@ -788,7 +788,7 @@ class Com_SermondistributorInstallerScript
$revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';";
$db->setQuery($revert_rule);
$db->execute();
$app->enqueueMessage(Text::_('Reverted the <b>#__assets</b> table rules column back to its default size of varchar(5120)'));
$app->enqueueMessage(Text::_('COM_COMPONENTBUILDER_REVERTED_THE_B_ASSETSB_TABLE_RULES_COLUMN_BACK_TO_ITS_DEFAULT_SIZE_OF_VARCHARFIVE_THOUSAND_ONE_HUNDRED_AND_TWENTY'));
}
else
{
@ -1091,7 +1091,7 @@ class Com_SermondistributorInstallerScript
}
}
// do an update by moving config data to the new external source area.
$this->comParams = JComponentHelper::getParams('com_sermondistributor');
$this->comParams = \JComponentHelper::getParams('com_sermondistributor');
// the number of links
$numbers = range(1, 4);
// the types of links
@ -1847,7 +1847,7 @@ class Com_SermondistributorInstallerScript
echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://www.vdm.io/" title="Sermon Distributor">
<img src="components/com_sermondistributor/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 3.0.3 Was Successful! Let us know if anything is not working as expected.</h3></div>';
<h3>Upgrade to Version 3.0.4 Was Successful! Let us know if anything is not working as expected.</h3></div>';
// Set db if not set already.
if (!isset($db))

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.10" method="upgrade">
<name>COM_SERMONDISTRIBUTOR</name>
<creationDate>11th February, 2024</creationDate>
<creationDate>7th March, 2024</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>3.0.3</version>
<version>3.0.4</version>
<description><![CDATA[
<h1>Sermon Distributor (v.3.0.3)</h1>
<h1>Sermon Distributor (v.3.0.4)</h1>
<div style="clear: both;"></div>
<p>Distributor is a highly advanced sermon distributor that runs on the [Joomla 3.x](http://www.joomla.org) framework. You can link a shared folder from Dropbox to the component and use Dropbox as your file host, not to mention the advanced auto builder that gives you the ability to simply load sermons to your website by only adding them to Dropbox.</p>
<p>Created by <a href="https://www.vdm.io/" target="_blank">Llewellyn van der Merwe</a><br /><small>Development started 22nd October, 2015</small></p>
@ -102,6 +102,6 @@
</administration>
<updateservers>
<server type="extension" enabled="1" element="com_sermondistributor" name="Sermon Distributor">https://git.vdm.dev/christian/Joomla-Sermon-Distributor/raw/branch/3.10/sermondistributor_update_server.xml</server>
<server type="extension" enabled="1" element="com_sermondistributor" name="Sermon Distributor">https://git.vdm.dev/christian/Joomla-Sermon-Distributor/raw/branch/3.x/sermondistributor_update_server.xml</server>
</updateservers>
</extension>

View File

@ -157,4 +157,22 @@
<maintainerurl>https://www.vdm.io/</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Sermon Distributor</name>
<description>A sermon distributor that links to Dropbox.</description>
<element>pkg_sermondistributor</element>
<type>package</type>
<client>site</client>
<version>3.0.4</version>
<infourl title="Sermon Distributor!">https://www.vdm.io/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/christian/pkg-sermondistributor/archive/v3.0.4.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://www.vdm.io/</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -145,7 +145,7 @@ class SermondistributorControllerApi extends FormController
protected function getApiUser()
{
// get params
$params = JComponentHelper::getParams('com_sermondistributor');
$params = \JComponentHelper::getParams('com_sermondistributor');
// return user object
return Factory::getUser($params->get('api', 0, 'INT'));
}

View File

@ -206,7 +206,7 @@ abstract class SermondistributorHelper
}
$keyCounterRAW = $safe->encryptString(json_encode($keyCounter));
$keyCounter = self::base64_urlencode($keyCounterRAW);
$token = JSession::getFormToken();
$token = \JSession::getFormToken();
$downloadURL = Uri::root().'index.php?option=com_sermondistributor&task=download.file&key='.$keyCounter.'&token='.$token;
// check if local .htaccess should be set
$setHtaccess = false;
@ -216,7 +216,7 @@ abstract class SermondistributorHelper
{
case 1:
// local file get local folder and check if outside root (if not then allow direct)
$localFolder = JComponentHelper::getParams('com_sermondistributor')->get('localfolder', JPATH_ROOT.'/images').'/';
$localFolder = \JComponentHelper::getParams('com_sermondistributor')->get('localfolder', JPATH_ROOT.'/images').'/';
// should we allow direct downloads
$allowDirect = false;
if (2 == $sermon->link_type && strpos($localFolder, JPATH_ROOT) !== false)
@ -254,7 +254,7 @@ abstract class SermondistributorHelper
break;
case 2:
// Dropbox get global dropbox switch
$addToButton = JComponentHelper::getParams('com_sermondistributor')->get('add_to_button', 0);
$addToButton = \JComponentHelper::getParams('com_sermondistributor')->get('add_to_button', 0);
if (1 == $sermon->build)
{
if (self::checkArray($sermon->manual_files))
@ -774,7 +774,7 @@ abstract class SermondistributorHelper
if (!isset(self::$localkey[$type]))
{
// get the main key
self::$localkey[$type] = JComponentHelper::getParams('com_sermondistributor')->get($type, 'localKey34fdWEkl');
self::$localkey[$type] = \JComponentHelper::getParams('com_sermondistributor')->get($type, 'localKey34fdWEkl');
}
return self::$localkey[$type];
}

View File

@ -102,8 +102,8 @@ class SermondistributorModelCategory extends ListModel
array('category')));
$query->join('LEFT', ($db->quoteName('#__categories', 'b')) . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('b.id') . ')');
$query->where('a.access IN (' . implode(',', $this->levels) . ')');
// Check if JRequest::getInt('id') is a string or numeric value.
$checkValue = JRequest::getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.catid = ' . $db->quote($checkValue));
@ -219,9 +219,9 @@ class SermondistributorModelCategory extends ListModel
// build series slug
$item->series_slug = (isset($item->series_alias)) ? $item->series.':'.$item->series_alias : $item->series;
// build needed links
$item->link = JRoute::_(SermondistributorHelperRoute::getSermonRoute($item->slug));
$item->preacher_link = JRoute::_(SermondistributorHelperRoute::getPreacherRoute($item->preacher_slug));
$item->series_link = JRoute::_(SermondistributorHelperRoute::getSeriesRoute($item->series_slug));
$item->link = \JRoute::_(SermondistributorHelperRoute::getSermonRoute($item->slug));
$item->preacher_link = \JRoute::_(SermondistributorHelperRoute::getPreacherRoute($item->preacher_slug));
$item->series_link = \JRoute::_(SermondistributorHelperRoute::getSeriesRoute($item->series_slug));
// set view key
$item->viewKey = 'category';
SermondistributorHelper::getDownloadLinks($item);
@ -296,8 +296,8 @@ class SermondistributorModelCategory extends ListModel
array('a.id','a.parent_id','a.lft','a.rgt','a.level','a.title','a.alias','a.note','a.description','a.params','a.metadesc','a.metakey','a.metadata','a.hits','a.language','a.version'),
array('id','parent_id','lft','rgt','level','name','alias','note','description','params','metadesc','metakey','metadata','hits','language','version')));
$query->from($db->quoteName('#__categories', 'a'));
// Check if $this->input->getInt('id') is a string or numeric value.
$checkValue = $this->input->getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.id = ' . $db->quote($checkValue));

View File

@ -101,8 +101,8 @@ class SermondistributorModelPreacher extends ListModel
array('b.title','b.alias'),
array('category','category_alias')));
$query->join('LEFT', ($db->quoteName('#__categories', 'b')) . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('b.id') . ')');
// Check if JRequest::getInt('id') is a string or numeric value.
$checkValue = JRequest::getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.preacher = ' . $db->quote($checkValue));
@ -219,9 +219,9 @@ class SermondistributorModelPreacher extends ListModel
// build category slug
$item->category_slug = (isset($item->category_alias)) ? $item->catid.':'.$item->category_alias : $item->catid;
// build needed links
$item->link = JRoute::_(SermondistributorHelperRoute::getSermonRoute($item->slug));
$item->series_link = JRoute::_(SermondistributorHelperRoute::getSeriesRoute($item->series_slug));
$item->category_link = JRoute::_(SermondistributorHelperRoute::getCategoryRoute($item->category_slug));
$item->link = \JRoute::_(SermondistributorHelperRoute::getSermonRoute($item->slug));
$item->series_link = \JRoute::_(SermondistributorHelperRoute::getSeriesRoute($item->series_slug));
$item->category_link = \JRoute::_(SermondistributorHelperRoute::getCategoryRoute($item->category_slug));
// set view key
$item->viewKey = 'preacher';
SermondistributorHelper::getDownloadLinks($item);
@ -297,8 +297,8 @@ class SermondistributorModelPreacher extends ListModel
array('id','asset_id','name','alias','icon','email','website','description','published','created_by','modified_by','created','modified','version','hits','ordering','metadesc','metakey','metadata')));
$query->from($db->quoteName('#__sermondistributor_preacher', 'a'));
$query->where('a.access IN (' . implode(',', $this->levels) . ')');
// Check if JRequest::getInt('id') is a string or numeric value.
$checkValue = JRequest::getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.id = ' . $db->quote($checkValue));
@ -447,8 +447,8 @@ class SermondistributorModelPreacher extends ListModel
array('a.id','a.alias','a.preacher'),
array('id','alias','preacher')));
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
// Check if JRequest::getInt('id') is a string or numeric value.
$checkValue = JRequest::getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.preacher = ' . $db->quote($checkValue));

View File

@ -102,8 +102,8 @@ class SermondistributorModelSeries extends ListModel
array('category','category_alias')));
$query->join('LEFT', ($db->quoteName('#__categories', 'b')) . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('b.id') . ')');
$query->where('a.access IN (' . implode(',', $this->levels) . ')');
// Check if JRequest::getInt('id') is a string or numeric value.
$checkValue = JRequest::getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.series = ' . $db->quote($checkValue));
@ -219,9 +219,9 @@ class SermondistributorModelSeries extends ListModel
// build category slug
$item->category_slug = (isset($item->category_alias)) ? $item->catid.':'.$item->category_alias : $item->catid;
// build needed links
$item->link = JRoute::_(SermondistributorHelperRoute::getSermonRoute($item->slug));
$item->preacher_link = JRoute::_(SermondistributorHelperRoute::getPreacherRoute($item->preacher_slug));
$item->category_link = JRoute::_(SermondistributorHelperRoute::getCategoryRoute($item->category_slug));
$item->link = \JRoute::_(SermondistributorHelperRoute::getSermonRoute($item->slug));
$item->preacher_link = \JRoute::_(SermondistributorHelperRoute::getPreacherRoute($item->preacher_slug));
$item->category_link = \JRoute::_(SermondistributorHelperRoute::getCategoryRoute($item->category_slug));
// set view key
$item->viewKey = 'series';
SermondistributorHelper::getDownloadLinks($item);
@ -297,8 +297,8 @@ class SermondistributorModelSeries extends ListModel
array('id','asset_id','name','alias','description','icon','published','created_by','modified_by','created','modified','version','hits','ordering','metadesc','metakey','metadata')));
$query->from($db->quoteName('#__sermondistributor_series', 'a'));
$query->where('a.access IN (' . implode(',', $this->levels) . ')');
// Check if JRequest::getInt('id') is a string or numeric value.
$checkValue = JRequest::getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.id = ' . $db->quote($checkValue));
@ -374,8 +374,8 @@ class SermondistributorModelSeries extends ListModel
array('a.id','a.counter'),
array('id','counter')));
$query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// Check if JRequest::getInt('id') is a string or numeric value.
$checkValue = JRequest::getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.series = ' . $db->quote($checkValue));
@ -447,8 +447,8 @@ class SermondistributorModelSeries extends ListModel
array('a.id','a.alias','a.series'),
array('id','alias','series')));
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
// Check if JRequest::getInt('id') is a string or numeric value.
$checkValue = JRequest::getInt('id');
// Check if $this->input->getInt('id', 0) is a string or numeric value.
$checkValue = $this->input->getInt('id', 0);
if (isset($checkValue) && StringHelper::check($checkValue))
{
$query->where('a.series = ' . $db->quote($checkValue));

View File

@ -250,9 +250,9 @@ class SermondistributorModelSermon extends ItemModel
$this->_item[$pk]->series_slug = (isset($this->_item[$pk]->series_alias)) ? $this->_item[$pk]->series.':'.$this->_item[$pk]->series_alias : $this->_item[$pk]->series;
$this->_item[$pk]->category_slug = (isset($this->_item[$pk]->category_alias)) ? $this->_item[$pk]->catid.':'.$this->_item[$pk]->category_alias : $this->_item[$pk]->catid;
// now build the links
$this->_item[$pk]->preacher_link = JRoute::_(SermondistributorHelperRoute::getPreacherRoute($this->_item[$pk]->preacher_slug));
$this->_item[$pk]->series_link = JRoute::_(SermondistributorHelperRoute::getSeriesRoute($this->_item[$pk]->series_slug));
$this->_item[$pk]->category_link = JRoute::_(SermondistributorHelperRoute::getCategoryRoute($this->_item[$pk]->category_slug));
$this->_item[$pk]->preacher_link = \JRoute::_(SermondistributorHelperRoute::getPreacherRoute($this->_item[$pk]->preacher_slug));
$this->_item[$pk]->series_link = \JRoute::_(SermondistributorHelperRoute::getSeriesRoute($this->_item[$pk]->series_slug));
$this->_item[$pk]->category_link = \JRoute::_(SermondistributorHelperRoute::getCategoryRoute($this->_item[$pk]->category_slug));
// build the download links
SermondistributorHelper::getDownloadLinks($this->_item[$pk]);
// fix the scripture links that they will show

View File

@ -72,7 +72,7 @@ use VDM\Joomla\Utilities\StringHelper;
}
<?php if (1 == $this->item->playerKey) : ?>
soundManager.setup({
url: '<?php echo JURI::root(true); ?>/media/com_sermondistributor/soundmanager/swf',
url: '<?php echo \JUri::root(true); ?>/media/com_sermondistributor/soundmanager/swf',
flashVersion: 9,
onready: function() {
// Ready to use; soundManager.createSound() etc. can now be called.