Resolves #20 to add links to all titles.

This commit is contained in:
Llewellyn van der Merwe 2016-07-16 13:19:44 +01:00
parent ae990fbb03
commit 08b4167f75
298 changed files with 10388 additions and 3085 deletions

View File

@ -1,4 +1,4 @@
# Sermon Distributor (1.3.2)
# Sermon Distributor (1.3.4)
![Sermon Distributor image] (https://raw.githubusercontent.com/SermonDistributor/Joomla-3-Component/master/admin/assets/images/component-300.jpg "The Sermon Distributor")
@ -23,32 +23,32 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe] (mailto:llewellyn@vdm.io)
+ *Name*: [Sermon Distributor] (https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 11th April, 2016
+ *Version*: 1.3.2
+ *Last Build*: 16th July, 2016
+ *Version*: 1.3.4
+ *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:
**135 Hours** or **17 Eight Hour Days** (actual time the author saved -
**137 Hours** or **17 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builder))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **48233**
+ *File count*: **352**
+ *Folder count*: **79**
+ *Line count*: **49071**
+ *File count*: **356**
+ *Folder count*: **80**
**88 Hours** or **11 Eight Hour Days** (the actual time the author spent)
**90 Hours** or **11 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @34hours** = codingtime / 4;
> **planning @19hours** = codingtime / 7;
> **mapping @13hours** = codingtime / 10;
> **office @22hours** = codingtime / 6;)
> **planning @20hours** = codingtime / 7;
> **mapping @14hours** = codingtime / 10;
> **office @23hours** = codingtime / 6;)
**223 Hours** or **28 Eight Hour Days**
**227 Hours** or **28 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**,
@ -57,4 +57,10 @@ due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builde
Project duration: **5.6 weeks** or **1.2 months**
> This **component** was build with a Joomla [Automated Component Builder] (https://www.vdm.io/joomla-component-builder).
> Developed by [Llewellyn van der Merwe] (mailto:joomla@vdm.io)
> Developed by [Llewellyn van der Merwe] (mailto:joomla@vdm.io)
## Donations
If you want to support this project, please consider donating:
* PayPal: pay@vdm.io
* Bitcoin: 3H35PYwikEosvcjxHXGPLS1GufZ4b4iFu3

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage admin.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage dashboard.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_documents.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series_list.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistics.css

File diff suppressed because it is too large Load Diff

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage controller.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage ajax.json.php
@ -72,9 +72,9 @@ class SermondistributorControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -87,9 +87,9 @@ class SermondistributorControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -110,9 +110,9 @@ class SermondistributorControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -125,9 +125,9 @@ class SermondistributorControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -148,9 +148,9 @@ class SermondistributorControllerAjax extends JControllerLegacy
{
$result = false;
}
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback'] . "(".json_encode($result).");";
echo $callback . "(".json_encode($result).");";
}
elseif($returnRaw)
{
@ -163,9 +163,9 @@ class SermondistributorControllerAjax extends JControllerLegacy
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode($e).");";
echo $callback."(".json_encode($e).");";
}
else
{
@ -177,9 +177,9 @@ class SermondistributorControllerAjax extends JControllerLegacy
}
else
{
if(array_key_exists('callback',$_GET))
if($callback = $jinput->get('callback', null, 'CMD'))
{
echo $_GET['callback']."(".json_encode(false).");";
echo $callback."(".json_encode(false).");";
}
else
{

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.php
@ -60,13 +60,13 @@ class SermondistributorControllerHelp_document extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 8642] Access check.
// Access check.
$access = JFactory::getUser()->authorise('help_document.access', 'com_sermondistributor');
if (!$access)
{
return false;
}
// [Interpretation 8653] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('help_document.create', $this->option);
}
@ -82,13 +82,13 @@ class SermondistributorControllerHelp_document extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 8796] get user object.
// get user object.
$user = JFactory::getUser();
// [Interpretation 8798] get record id.
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 8805] Access check.
// Access check.
$access = ($user->authorise('help_document.access', 'com_sermondistributor.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_sermondistributor'));
if (!$access)
{
@ -97,17 +97,17 @@ class SermondistributorControllerHelp_document extends JControllerForm
if ($recordId)
{
// [Interpretation 8814] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('help_document.edit', 'com_sermondistributor.help_document.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('help_document.edit.own', 'com_sermondistributor.help_document.' . $recordId))
{
// [Interpretation 8836] Now test the owner is the user.
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 8840] Need to do a lookup from the model.
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerHelp_document extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 8848] If the owner matches 'me' then allow.
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('help_document.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerHelp_document extends JControllerForm
return false;
}
}
// [Interpretation 8870] Since there is no permission, revert to the component permissions.
// Since there is no permission, revert to the component permissions.
return $user->authorise('help_document.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_documents.php
@ -48,29 +48,29 @@ class SermondistributorControllerHelp_documents extends JControllerAdmin
public function exportData()
{
// [Interpretation 6705] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6707] check if export is allowed for this user.
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('help_document.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 6711] Get the input
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 6714] Sanitize the input
// Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 6716] Get the model
// Get the model
$model = $this->getModel('Help_documents');
// [Interpretation 6718] get the data to export
// get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 6722] now set the data to the spreadsheet
// now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Help_documents_'.$date->format('jS_F_Y'),'Help documents exported ('.$date->format('jS F, Y').')','help documents');
}
}
// [Interpretation 6727] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerHelp_documents extends JControllerAdmin
public function importData()
{
// [Interpretation 6736] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6738] check if import is allowed for this user.
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('help_document.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 6742] Get the import model
// Get the import model
$model = $this->getModel('Help_documents');
// [Interpretation 6744] get the headers to import
// get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 6748] Load headers to session.
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('help_document_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'help_documents');
$session->set('dataType_VDM_IMPORTINTO', 'help_document');
// [Interpretation 6754] Redirect to import view.
// Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 6766] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage import.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.php
@ -60,13 +60,13 @@ class SermondistributorControllerPreacher extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 8642] Access check.
// Access check.
$access = JFactory::getUser()->authorise('preacher.access', 'com_sermondistributor');
if (!$access)
{
return false;
}
// [Interpretation 8653] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('preacher.create', $this->option);
}
@ -82,13 +82,13 @@ class SermondistributorControllerPreacher extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 8796] get user object.
// get user object.
$user = JFactory::getUser();
// [Interpretation 8798] get record id.
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 8805] Access check.
// Access check.
$access = ($user->authorise('preacher.access', 'com_sermondistributor.preacher.' . (int) $recordId) && $user->authorise('preacher.access', 'com_sermondistributor'));
if (!$access)
{
@ -97,17 +97,17 @@ class SermondistributorControllerPreacher extends JControllerForm
if ($recordId)
{
// [Interpretation 8814] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('preacher.edit', 'com_sermondistributor.preacher.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('preacher.edit.own', 'com_sermondistributor.preacher.' . $recordId))
{
// [Interpretation 8836] Now test the owner is the user.
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 8840] Need to do a lookup from the model.
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerPreacher extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 8848] If the owner matches 'me' then allow.
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('preacher.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerPreacher extends JControllerForm
return false;
}
}
// [Interpretation 8870] Since there is no permission, revert to the component permissions.
// Since there is no permission, revert to the component permissions.
return $user->authorise('preacher.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.php
@ -48,29 +48,29 @@ class SermondistributorControllerPreachers extends JControllerAdmin
public function exportData()
{
// [Interpretation 6705] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6707] check if export is allowed for this user.
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('preacher.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 6711] Get the input
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 6714] Sanitize the input
// Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 6716] Get the model
// Get the model
$model = $this->getModel('Preachers');
// [Interpretation 6718] get the data to export
// get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 6722] now set the data to the spreadsheet
// now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Preachers_'.$date->format('jS_F_Y'),'Preachers exported ('.$date->format('jS F, Y').')','preachers');
}
}
// [Interpretation 6727] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerPreachers extends JControllerAdmin
public function importData()
{
// [Interpretation 6736] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6738] check if import is allowed for this user.
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('preacher.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 6742] Get the import model
// Get the import model
$model = $this->getModel('Preachers');
// [Interpretation 6744] get the headers to import
// get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 6748] Load headers to session.
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('preacher_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'preachers');
$session->set('dataType_VDM_IMPORTINTO', 'preacher');
// [Interpretation 6754] Redirect to import view.
// Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_PREACHERS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 6766] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.php
@ -60,13 +60,13 @@ class SermondistributorControllerSeries extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 8642] Access check.
// Access check.
$access = JFactory::getUser()->authorise('series.access', 'com_sermondistributor');
if (!$access)
{
return false;
}
// [Interpretation 8653] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('series.create', $this->option);
}
@ -82,13 +82,13 @@ class SermondistributorControllerSeries extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 8796] get user object.
// get user object.
$user = JFactory::getUser();
// [Interpretation 8798] get record id.
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 8805] Access check.
// Access check.
$access = ($user->authorise('series.access', 'com_sermondistributor.series.' . (int) $recordId) && $user->authorise('series.access', 'com_sermondistributor'));
if (!$access)
{
@ -97,17 +97,17 @@ class SermondistributorControllerSeries extends JControllerForm
if ($recordId)
{
// [Interpretation 8814] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('series.edit', 'com_sermondistributor.series.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('series.edit.own', 'com_sermondistributor.series.' . $recordId))
{
// [Interpretation 8836] Now test the owner is the user.
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 8840] Need to do a lookup from the model.
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerSeries extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 8848] If the owner matches 'me' then allow.
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('series.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerSeries extends JControllerForm
return false;
}
}
// [Interpretation 8870] Since there is no permission, revert to the component permissions.
// Since there is no permission, revert to the component permissions.
return $user->authorise('series.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series_list.php
@ -48,29 +48,29 @@ class SermondistributorControllerSeries_list extends JControllerAdmin
public function exportData()
{
// [Interpretation 6705] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6707] check if export is allowed for this user.
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('series.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 6711] Get the input
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 6714] Sanitize the input
// Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 6716] Get the model
// Get the model
$model = $this->getModel('Series_list');
// [Interpretation 6718] get the data to export
// get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 6722] now set the data to the spreadsheet
// now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Series_list_'.$date->format('jS_F_Y'),'Series list exported ('.$date->format('jS F, Y').')','series list');
}
}
// [Interpretation 6727] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerSeries_list extends JControllerAdmin
public function importData()
{
// [Interpretation 6736] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6738] check if import is allowed for this user.
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('series.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 6742] Get the import model
// Get the import model
$model = $this->getModel('Series_list');
// [Interpretation 6744] get the headers to import
// get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 6748] Load headers to session.
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('series_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'series_list');
$session->set('dataType_VDM_IMPORTINTO', 'series');
// [Interpretation 6754] Redirect to import view.
// Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_SERIES_LIST');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 6766] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.php
@ -60,10 +60,10 @@ class SermondistributorControllerSermon extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 8597] get the user object
// get the user object
$user = JFactory::getUser();
// [Interpretation 8602] Access check.
// Access check.
$access = $user->authorise('sermon.access', 'com_sermondistributor');
if (!$access)
{
@ -74,13 +74,13 @@ class SermondistributorControllerSermon extends JControllerForm
if ($categoryId)
{
// [Interpretation 8613] If the category has been passed in the URL check it.
// If the category has been passed in the URL check it.
$allow = $user->authorise('core.create', $this->option . '.sermons.category.' . $categoryId);
}
if ($allow === null)
{
// [Interpretation 8622] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return $user->authorise('sermon.create', $this->option);
}
else
@ -100,13 +100,13 @@ class SermondistributorControllerSermon extends JControllerForm
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{ // [Interpretation 8700] get user object.
{ // get user object.
$user = JFactory::getUser();
// [Interpretation 8702] get record id.
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 8709] Access check.
// Access check.
$access = ($user->authorise('sermon.access', 'com_sermondistributor.sermon.' . (int) $recordId) && $user->authorise('sermon.access', 'com_sermondistributor'));
if (!$access)
{
@ -115,17 +115,17 @@ class SermondistributorControllerSermon extends JControllerForm
if ($recordId)
{
// [Interpretation 8718] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('sermon.edit', 'com_sermondistributor.sermon.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('sermon.edit.own', 'com_sermondistributor.sermon.' . $recordId))
{
// [Interpretation 8740] Fallback on edit.own. Now test the owner is the user.
// Fallback on edit.own. Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 8744] Need to do a lookup from the model.
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -135,7 +135,7 @@ class SermondistributorControllerSermon extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 8752] If the owner matches 'me' then do the test.
// If the owner matches 'me' then do the test.
if ($ownerId == $user->id)
{
if ($user->authorise('sermon.edit.own', 'com_sermondistributor'))
@ -151,7 +151,7 @@ class SermondistributorControllerSermon extends JControllerForm
if ($categoryId)
{
// [Interpretation 8774] The category has been set. Check the category permissions.
// The category has been set. Check the category permissions.
$catpermission = $user->authorise('core.edit', $this->option . '.sermons.category.' . $categoryId);
if (!$catpermission && !is_null($catpermission))
{
@ -159,7 +159,7 @@ class SermondistributorControllerSermon extends JControllerForm
}
}
}
// [Interpretation 8784] Since there is no permission, revert to the component permissions.
// Since there is no permission, revert to the component permissions.
return $user->authorise('sermon.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.php
@ -48,29 +48,29 @@ class SermondistributorControllerSermons extends JControllerAdmin
public function exportData()
{
// [Interpretation 6705] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6707] check if export is allowed for this user.
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('sermon.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 6711] Get the input
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 6714] Sanitize the input
// Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 6716] Get the model
// Get the model
$model = $this->getModel('Sermons');
// [Interpretation 6718] get the data to export
// get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 6722] now set the data to the spreadsheet
// now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Sermons_'.$date->format('jS_F_Y'),'Sermons exported ('.$date->format('jS F, Y').')','sermons');
}
}
// [Interpretation 6727] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerSermons extends JControllerAdmin
public function importData()
{
// [Interpretation 6736] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6738] check if import is allowed for this user.
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('sermon.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 6742] Get the import model
// Get the import model
$model = $this->getModel('Sermons');
// [Interpretation 6744] get the headers to import
// get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 6748] Load headers to session.
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('sermon_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'sermons');
$session->set('dataType_VDM_IMPORTINTO', 'sermon');
// [Interpretation 6754] Redirect to import view.
// Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_SERMONS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 6766] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.php
@ -60,13 +60,13 @@ class SermondistributorControllerStatistic extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 8642] Access check.
// Access check.
$access = JFactory::getUser()->authorise('statistic.access', 'com_sermondistributor');
if (!$access)
{
return false;
}
// [Interpretation 8653] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('statistic.create', $this->option);
}
@ -82,13 +82,13 @@ class SermondistributorControllerStatistic extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 8796] get user object.
// get user object.
$user = JFactory::getUser();
// [Interpretation 8798] get record id.
// get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 8805] Access check.
// Access check.
$access = ($user->authorise('statistic.access', 'com_sermondistributor.statistic.' . (int) $recordId) && $user->authorise('statistic.access', 'com_sermondistributor'));
if (!$access)
{
@ -97,17 +97,17 @@ class SermondistributorControllerStatistic extends JControllerForm
if ($recordId)
{
// [Interpretation 8814] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('statistic.edit', 'com_sermondistributor.statistic.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('statistic.edit.own', 'com_sermondistributor.statistic.' . $recordId))
{
// [Interpretation 8836] Now test the owner is the user.
// Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 8840] Need to do a lookup from the model.
// Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerStatistic extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 8848] If the owner matches 'me' then allow.
// If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('statistic.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerStatistic extends JControllerForm
return false;
}
}
// [Interpretation 8870] Since there is no permission, revert to the component permissions.
// Since there is no permission, revert to the component permissions.
return $user->authorise('statistic.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistics.php
@ -48,29 +48,29 @@ class SermondistributorControllerStatistics extends JControllerAdmin
public function exportData()
{
// [Interpretation 6705] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6707] check if export is allowed for this user.
// check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('statistic.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 6711] Get the input
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 6714] Sanitize the input
// Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 6716] Get the model
// Get the model
$model = $this->getModel('Statistics');
// [Interpretation 6718] get the data to export
// get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 6722] now set the data to the spreadsheet
// now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Statistics_'.$date->format('jS_F_Y'),'Statistics exported ('.$date->format('jS F, Y').')','statistics');
}
}
// [Interpretation 6727] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerStatistics extends JControllerAdmin
public function importData()
{
// [Interpretation 6736] Check for request forgeries
// Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 6738] check if import is allowed for this user.
// check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('statistic.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 6742] Get the import model
// Get the import model
$model = $this->getModel('Statistics');
// [Interpretation 6744] get the headers to import
// get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 6748] Load headers to session.
// Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('statistic_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'statistics');
$session->set('dataType_VDM_IMPORTINTO', 'statistic');
// [Interpretation 6754] Redirect to import view.
// Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_STATISTICS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 6766] Redirect to the list screen with error.
// Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error');
return;

View File

@ -0,0 +1,49 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@author Llewellyn van der Merwe <http://www.vdm.io>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
/-----------------------------------------------------------------------------------------------------------------------------*/
/** PHPExcel root directory */
if (!defined('PHPEXCEL_ROOT')) {
/**
* @ignore
*/
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../');
require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
class PHPExcel_Reader_chunkReadFilter implements PHPExcel_Reader_IReadFilter
{
private $_startRow = 0;
private $_endRow = 0;
/** Set the list of rows that we want to read */
public function setRows($startRow, $chunkSize)
{
$this->_startRow = $startRow;
$this->_endRow = $startRow + $chunkSize;
}
public function readCell($column, $row, $worksheetName = '')
{
// Only read the heading row, and the rows that are configured in $this->_startRow and $this->_endRow
if (($row == 1) || ($row >= $this->_startRow && $row < $this->_endRow)) {
return true;
}
return false;
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage batch_.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php
@ -119,7 +119,7 @@ abstract class SermondistributorHelper
}
$keyCounter = base64_encode($safe->encryptString(json_encode($keyCounter)));
$token = JSession::getFormToken();
$downloadURL = 'index.php?option=com_sermondistributor&task=download.file&key='.$keyCounter.'&token='.$token;
$downloadURL = JURI::root().'index.php?option=com_sermondistributor&task=download.file&key='.$keyCounter.'&token='.$token;
// check if local .htaccess should be set
$setHtaccess = false;
$onclick = ' onclick="sermonCounter(\''.$keyCounter.'\',\'FILENAME\');"';
@ -151,7 +151,7 @@ abstract class SermondistributorHelper
// get the file name use the same method as the auto
$filename = self::getDownloadFileName($sermon,$key,'local');
$lockedFolderPath = base64_encode($safe->encryptString($localFolder.$key));
$sermon->download_links[$filename] = JRoute::_($downloadURL.'&link='.$lockedFolderPath.'&filename='.$filename);
$sermon->download_links[$filename] = $downloadURL.'&link='.$lockedFolderPath.'&filename='.$filename;
$sermon->onclick[$filename] = '';
}
elseif (2 == $sermon->link_type && $allowDirect)
@ -180,7 +180,7 @@ abstract class SermondistributorHelper
{
// get the file name use the same method as the auto
$filename = self::getDownloadFileName($sermon,$key,'dropbox_manual');
$sermon->download_links[$filename] = JRoute::_($downloadURL.'&link='.$dropURL.'&filename='.$filename);
$sermon->download_links[$filename] = $downloadURL.'&link='.$dropURL.'&filename='.$filename;
$sermon->onclick[$filename] = '';
}
elseif (2 == $sermon->link_type && $dropURL)
@ -210,7 +210,7 @@ abstract class SermondistributorHelper
if (1 == $sermon->link_type && $dropURL)
{
// get the file name (use the same method as the auto
$sermon->download_links[$filename] = JRoute::_($downloadURL.'&link='.$dropURL.'&filename='.$filename);
$sermon->download_links[$filename] = $downloadURL.'&link='.$dropURL.'&filename='.$filename;
$sermon->onclick[$filename] = '';
}
elseif (2 == $sermon->link_type && $dropURL)
@ -234,7 +234,7 @@ abstract class SermondistributorHelper
if (1 == $sermon->link_type)
{
$lockedURL = base64_encode($safe->encryptString($sermon->url));
$sermon->download_links[$filename] = JRoute::_($downloadURL.'&link='.$lockedURL.'&filename='.$filename);
$sermon->download_links[$filename] = $downloadURL.'&link='.$lockedURL.'&filename='.$filename;
$sermon->onclick[$filename] = '';
}
elseif (2 == $sermon->link_type)
@ -553,23 +553,23 @@ abstract class SermondistributorHelper
$targetgroups = json_decode($help->groups, true);
if (!array_intersect($targetgroups, $groups))
{
// [Interpretation 653] if user not in those target groups then remove the item
// if user not in those target groups then remove the item
unset($helps[$nr]);
continue;
}
}
// [Interpretation 658] set the return type
// set the return type
switch ($help->type)
{
// [Interpretation 661] set joomla article
// set joomla article
case 1:
return self::loadArticleLink($help->article);
break;
// [Interpretation 665] set help text
// set help text
case 2:
return self::loadHelpTextLink($help->id);
break;
// [Interpretation 669] set Link
// set Link
case 3:
return $help->url;
break;
@ -698,7 +698,7 @@ abstract class SermondistributorHelper
{
if (strpos($content,'class="uk-') !== false)
{
// [Interpretation 1909] reset
// reset
$temp = array();
foreach (self::$uk_components as $looking => $add)
{
@ -707,15 +707,15 @@ abstract class SermondistributorHelper
$temp[] = $looking;
}
}
// [Interpretation 1918] make sure uikit is loaded to config
// make sure uikit is loaded to config
if (strpos($content,'class="uk-') !== false)
{
self::$uikit = true;
}
// [Interpretation 1923] sorter
// sorter
if (self::checkArray($temp))
{
// [Interpretation 1926] merger
// merger
if (self::checkArray($classes))
{
$newTemp = array_merge($temp,$classes);
@ -736,37 +736,37 @@ abstract class SermondistributorHelper
*/
public static function xls($rows,$fileName = null,$title = null,$subjectTab = null,$creator = 'Vast Development Method',$description = null,$category = null,$keywords = null,$modified = null)
{
// [Interpretation 708] set the user
// set the user
$user = JFactory::getUser();
// [Interpretation 711] set fieldname if not set
// set fieldname if not set
if (!$fileName)
{
$fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y');
}
// [Interpretation 716] set modiefied if not set
// set modiefied if not set
if (!$modified)
{
$modified = $user->name;
}
// [Interpretation 721] set title if not set
// set title if not set
if (!$title)
{
$title = 'Book1';
}
// [Interpretation 726] set tab name if not set
// set tab name if not set
if (!$subjectTab)
{
$subjectTab = 'Sheet1';
}
// [Interpretation 732] make sure the file is loaded
// make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// [Interpretation 735] Create new PHPExcel object
// Create new PHPExcel object
$objPHPExcel = new PHPExcel();
// [Interpretation 738] Set document properties
// Set document properties
$objPHPExcel->getProperties()->setCreator($creator)
->setCompany('Vast Development Method')
->setLastModifiedBy($modified)
@ -785,7 +785,7 @@ abstract class SermondistributorHelper
$objPHPExcel->getProperties()->setCategory($category);
}
// [Interpretation 757] Some styles
// Some styles
$headerStyles = array(
'font' => array(
'bold' => true,
@ -807,7 +807,7 @@ abstract class SermondistributorHelper
'name' => 'Verdana'
));
// [Interpretation 779] Add some data
// Add some data
if (self::checkArray($rows))
{
$i = 1;
@ -834,20 +834,20 @@ abstract class SermondistributorHelper
return false;
}
// [Interpretation 806] Rename worksheet
// Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle($subjectTab);
// [Interpretation 809] Set active sheet index to the first sheet, so Excel opens this as the first sheet
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
// [Interpretation 812] Redirect output to a client's web browser (Excel5)
// Redirect output to a client's web browser (Excel5)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$fileName.'.xls"');
header('Cache-Control: max-age=0');
// [Interpretation 816] If you're serving to IE 9, then the following may be needed
// If you're serving to IE 9, then the following may be needed
header('Cache-Control: max-age=1');
// [Interpretation 819] If you're serving to IE over SSL, then the following may be needed
// If you're serving to IE over SSL, then the following may be needed
header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
@ -863,18 +863,27 @@ abstract class SermondistributorHelper
*/
public static function getFileHeaders($dataType)
{
// [Interpretation 835] make sure the file is loaded
// make sure these files are loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// [Interpretation 837] get session object
$session = JFactory::getSession();
JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader');
// get session object
$session = JFactory::getSession();
$package = $session->get('package', null);
$package = json_decode($package, true);
// [Interpretation 841] set the headers
// set the headers
if(isset($package['dir']))
{
$chunkFilter = new PHPExcel_Reader_chunkReadFilter();
// only load first three rows
$chunkFilter->setRows(2,1);
// identify the file type
$inputFileType = PHPExcel_IOFactory::identify($package['dir']);
// create the reader for this file type
$excelReader = PHPExcel_IOFactory::createReader($inputFileType);
// load the limiting filter
$excelReader->setReadFilter($chunkFilter);
$excelReader->setReadDataOnly(true);
// load the rows (only first three)
$excelObj = $excelReader->load($package['dir']);
$headers = array();
foreach ($excelObj->getActiveSheet()->getRowIterator() as $row)
@ -910,9 +919,15 @@ abstract class SermondistributorHelper
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
$query->from($db->quoteName('#__'.$main.'_'.$table));
if (empty($table))
{
$query->from($db->quoteName('#__'.$main));
}
else
{
$query->from($db->quoteName('#__'.$main.'_'.$table));
}
if (is_numeric($where))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
@ -970,31 +985,33 @@ abstract class SermondistributorHelper
return false;
}
public static function jsonToString($value, $sperator = ", ")
public static function jsonToString($value, $sperator = ", ", $table = null)
{
// check if string is JSON
$result = json_decode($value, true);
if (json_last_error() === JSON_ERROR_NONE) {
// is JSON
if (json_last_error() === JSON_ERROR_NONE)
{
// is JSON
if (self::checkArray($result))
{
$value = '';
$counter = 0;
foreach ($result as $string)
if (self::checkString($table))
{
if ($counter)
$names = array();
foreach ($result as $val)
{
$value .= $sperator.$string;
if ($name = self::getVar($table, $val, 'id', 'name'))
{
$names[] = $name;
}
}
else
if (self::checkArray($names))
{
$value .= $string;
}
$counter++;
return (string) implode($sperator,$names);
}
}
return $value;
return (string) implode($sperator,$result);
}
return json_decode($value);
return (string) json_decode($value);
}
return $value;
}
@ -1286,7 +1303,7 @@ abstract class SermondistributorHelper
if (!$asset->check() || !$asset->store())
{
JError::raiseWarning(500, $asset->getError());
JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
return false;
}
else
@ -1649,7 +1666,7 @@ abstract class SermondistributorHelper
$w .= ' ';
if($r < 100)
{
$word .= 'and ';
$w .= 'and ';
}
$w .= self::numberToString($r);
}

View File

@ -148,6 +148,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_GREEN="Green"
COM_SERMONDISTRIBUTOR_CONFIG_GRID="Grid"
COM_SERMONDISTRIBUTOR_CONFIG_JPEG=".jpeg"
COM_SERMONDISTRIBUTOR_CONFIG_JPG=".jpg"
COM_SERMONDISTRIBUTOR_CONFIG_JPLAYER="jPlayer"
COM_SERMONDISTRIBUTOR_CONFIG_LEGACY="Legacy"
COM_SERMONDISTRIBUTOR_CONFIG_LINES="Lines"
COM_SERMONDISTRIBUTOR_CONFIG_LINK_ENCRYPTION_DESCRIPTION="Add the key to use when download link option is set to encrypted."
@ -489,6 +490,9 @@ COM_SERMONDISTRIBUTOR_CONFIG_ONLY_EXTRA="Only Extra"
COM_SERMONDISTRIBUTOR_CONFIG_PANEL="Panel"
COM_SERMONDISTRIBUTOR_CONFIG_PDF=".pdf"
COM_SERMONDISTRIBUTOR_CONFIG_PLAIN="Plain"
COM_SERMONDISTRIBUTOR_CONFIG_PLAYER="Player"
COM_SERMONDISTRIBUTOR_CONFIG_PLAYER_DESCRIPTION="Select the player you would like to use on your site."
COM_SERMONDISTRIBUTOR_CONFIG_PLAYER_LABEL="Players"
COM_SERMONDISTRIBUTOR_CONFIG_PNG=".png"
COM_SERMONDISTRIBUTOR_CONFIG_PPS=".pps"
COM_SERMONDISTRIBUTOR_CONFIG_PPSX=".ppsx"
@ -565,6 +569,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_PREACHER_WEBSITE_LABEL="Show Website"
COM_SERMONDISTRIBUTOR_CONFIG_PUBLISHED="Published"
COM_SERMONDISTRIBUTOR_CONFIG_PURPLE="Purple"
COM_SERMONDISTRIBUTOR_CONFIG_RED="Red"
COM_SERMONDISTRIBUTOR_CONFIG_SELECT_AN_OPTION="select an option"
COM_SERMONDISTRIBUTOR_CONFIG_SERIES="Series"
COM_SERMONDISTRIBUTOR_CONFIG_SERIES_BOX_CONTRAST_DESCRIPTION="Set if text should be contrast in box display option."
COM_SERMONDISTRIBUTOR_CONFIG_SERIES_BOX_CONTRAST_LABEL="Show Contrast Text"
@ -641,6 +646,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_SERMON_SERIES_LABEL="Show Sermon Series"
COM_SERMONDISTRIBUTOR_CONFIG_SERMON_STATE_DESCRIPTION="Set the state in which sermons so be loaded at initial build."
COM_SERMONDISTRIBUTOR_CONFIG_SERMON_STATE_LABEL="Auto Sermons State"
COM_SERMONDISTRIBUTOR_CONFIG_SMALL="Small"
COM_SERMONDISTRIBUTOR_CONFIG_SOUNDMANAGER="Soundmanager"
COM_SERMONDISTRIBUTOR_CONFIG_SPACED="Spaced"
COM_SERMONDISTRIBUTOR_CONFIG_STRIPED="Striped"
COM_SERMONDISTRIBUTOR_CONFIG_TABLE="Table"
@ -666,6 +672,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_YES="Yes"
COM_SERMONDISTRIBUTOR_CONFIG_ZIP=".zip"
COM_SERMONDISTRIBUTOR_CONTRIBUTOR="Contributor"
COM_SERMONDISTRIBUTOR_CONTRIBUTORS="Contributors"
COM_SERMONDISTRIBUTOR_CREATE_NEW_S="Create New %s"
COM_SERMONDISTRIBUTOR_DASH="Dashboard"
COM_SERMONDISTRIBUTOR_DASHBOARD="Sermon Distributor Dashboard"
COM_SERMONDISTRIBUTOR_DASHBOARD_HELP_DOCUMENTS="Help Documents<br /><br />"
@ -684,6 +691,7 @@ COM_SERMONDISTRIBUTOR_EDIT_CREATED_BY="Edit Created By"
COM_SERMONDISTRIBUTOR_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by."
COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE="Edit Created Date"
COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE_DESC=" Allows users in this group to edit created date."
COM_SERMONDISTRIBUTOR_EDIT_S="Edit %s"
COM_SERMONDISTRIBUTOR_EDIT_VERSIONS="Edit Version"
COM_SERMONDISTRIBUTOR_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions."
COM_SERMONDISTRIBUTOR_EXPORT_DATA="Export Data"
@ -740,15 +748,16 @@ COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN_VIEW_DESCRIPTION="Select the view bein
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN_VIEW_LABEL="Admin Views"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALIAS="Alias"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALIAS_HINT="Auto-generated from name"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALIAS_LABEL="Alias"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALL="All"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ARTICLE="Article"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ARTICLE_LABEL="Article"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CONTENT="Content"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CONTENT_LABEL="Content"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_DESC="The user that created the Help Document."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_LABEL="Created by"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_DATE_DESC="The date Help Document was created."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_DATE_LABEL="Created date"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_DESC="The user that created this Help Document."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_LABEL="Created By"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_DATE_DESC="The date this Help Document was created."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_DATE_LABEL="Created Date"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_DETAILS="Details"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_EDIT="Editing the Help Document"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ERROR_UNIQUE_ALIAS="Another Help Document has the same alias."
@ -760,6 +769,10 @@ COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_JOOMLA_ARTICLE="Joomla Article"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_LOCATION="Location"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_LOCATION_DESCRIPTION="Select the help target location."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_LOCATION_LABEL="Location"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_BY_DESC="The last user that modified this Help Document."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_BY_LABEL="Modified By"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_DATE_DESC="The date this Help Document was modified."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_DATE_LABEL="Modified Date"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_NEW="A New Help Document"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_NOT_REQUIRED="Not Required"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ORDERING_LABEL="Ordering"
@ -896,10 +909,11 @@ COM_SERMONDISTRIBUTOR_PREACHER_ACCESS_SITE="Preacher (Site) Access"
COM_SERMONDISTRIBUTOR_PREACHER_ACCESS_SITE_DESC=" Allows the users in this group to access site preacher."
COM_SERMONDISTRIBUTOR_PREACHER_ALIAS="Alias"
COM_SERMONDISTRIBUTOR_PREACHER_ALIAS_HINT="Auto-generated from name"
COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_DESC="The user that created the Preacher."
COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_LABEL="Created by"
COM_SERMONDISTRIBUTOR_PREACHER_CREATED_DATE_DESC="The date Preacher was created."
COM_SERMONDISTRIBUTOR_PREACHER_CREATED_DATE_LABEL="Created date"
COM_SERMONDISTRIBUTOR_PREACHER_ALIAS_LABEL="Alias"
COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_DESC="The user that created this Preacher."
COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_LABEL="Created By"
COM_SERMONDISTRIBUTOR_PREACHER_CREATED_DATE_DESC="The date this Preacher was created."
COM_SERMONDISTRIBUTOR_PREACHER_CREATED_DATE_LABEL="Created Date"
COM_SERMONDISTRIBUTOR_PREACHER_DESCRIPTION="Description"
COM_SERMONDISTRIBUTOR_PREACHER_DESCRIPTION_LABEL="Description"
COM_SERMONDISTRIBUTOR_PREACHER_DETAILS="Details"
@ -913,6 +927,10 @@ COM_SERMONDISTRIBUTOR_PREACHER_ICON="Icon"
COM_SERMONDISTRIBUTOR_PREACHER_ICON_DESCRIPTION="Must be 358px x 358px"
COM_SERMONDISTRIBUTOR_PREACHER_ICON_LABEL="Icon"
COM_SERMONDISTRIBUTOR_PREACHER_ID="Id"
COM_SERMONDISTRIBUTOR_PREACHER_MODIFIED_BY_DESC="The last user that modified this Preacher."
COM_SERMONDISTRIBUTOR_PREACHER_MODIFIED_BY_LABEL="Modified By"
COM_SERMONDISTRIBUTOR_PREACHER_MODIFIED_DATE_DESC="The date this Preacher was modified."
COM_SERMONDISTRIBUTOR_PREACHER_MODIFIED_DATE_LABEL="Modified Date"
COM_SERMONDISTRIBUTOR_PREACHER_NAME="Name"
COM_SERMONDISTRIBUTOR_PREACHER_NAME_DESCRIPTION="Enter Name Here"
COM_SERMONDISTRIBUTOR_PREACHER_NAME_HINT="Name Here"
@ -937,10 +955,11 @@ COM_SERMONDISTRIBUTOR_SERIES_ACCESS_SITE="Series (Site) Access"
COM_SERMONDISTRIBUTOR_SERIES_ACCESS_SITE_DESC=" Allows the users in this group to access site series."
COM_SERMONDISTRIBUTOR_SERIES_ALIAS="Alias"
COM_SERMONDISTRIBUTOR_SERIES_ALIAS_HINT="Auto-generated from name"
COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_DESC="The user that created the Series."
COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_LABEL="Created by"
COM_SERMONDISTRIBUTOR_SERIES_CREATED_DATE_DESC="The date Series was created."
COM_SERMONDISTRIBUTOR_SERIES_CREATED_DATE_LABEL="Created date"
COM_SERMONDISTRIBUTOR_SERIES_ALIAS_LABEL="Alias"
COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_DESC="The user that created this Series."
COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_LABEL="Created By"
COM_SERMONDISTRIBUTOR_SERIES_CREATED_DATE_DESC="The date this Series was created."
COM_SERMONDISTRIBUTOR_SERIES_CREATED_DATE_LABEL="Created Date"
COM_SERMONDISTRIBUTOR_SERIES_DESCRIPTION="Description"
COM_SERMONDISTRIBUTOR_SERIES_DESCRIPTION_LABEL="Description"
COM_SERMONDISTRIBUTOR_SERIES_DETAILS="Details"
@ -1002,6 +1021,10 @@ COM_SERMONDISTRIBUTOR_SERIES_LIST_N_ITEMS_UNPUBLISHED="%s Series List unpublishe
COM_SERMONDISTRIBUTOR_SERIES_LIST_N_ITEMS_UNPUBLISHED_1="%s Series unpublished."
COM_SERMONDISTRIBUTOR_SERIES_LIST_SUBMENU="Series List Submenu"
COM_SERMONDISTRIBUTOR_SERIES_LIST_SUBMENU_DESC="Allows the users in this group to update the submenu of the series"
COM_SERMONDISTRIBUTOR_SERIES_MODIFIED_BY_DESC="The last user that modified this Series."
COM_SERMONDISTRIBUTOR_SERIES_MODIFIED_BY_LABEL="Modified By"
COM_SERMONDISTRIBUTOR_SERIES_MODIFIED_DATE_DESC="The date this Series was modified."
COM_SERMONDISTRIBUTOR_SERIES_MODIFIED_DATE_LABEL="Modified Date"
COM_SERMONDISTRIBUTOR_SERIES_NAME="Name"
COM_SERMONDISTRIBUTOR_SERIES_NAME_DESCRIPTION="Enter Name Here"
COM_SERMONDISTRIBUTOR_SERIES_NAME_HINT="Name Here"
@ -1074,6 +1097,7 @@ COM_SERMONDISTRIBUTOR_SERMON_ACCESS_SITE="Sermon (Site) Access"
COM_SERMONDISTRIBUTOR_SERMON_ACCESS_SITE_DESC=" Allows the users in this group to access site sermon."
COM_SERMONDISTRIBUTOR_SERMON_ALIAS="Alias"
COM_SERMONDISTRIBUTOR_SERMON_ALIAS_HINT="Auto-generated from name"
COM_SERMONDISTRIBUTOR_SERMON_ALIAS_LABEL="Alias"
COM_SERMONDISTRIBUTOR_SERMON_AUTOMATIC="Automatic"
COM_SERMONDISTRIBUTOR_SERMON_AUTO_SERMONS="Auto Sermons"
COM_SERMONDISTRIBUTOR_SERMON_BUILD="Build"
@ -1081,10 +1105,10 @@ COM_SERMONDISTRIBUTOR_SERMON_BUILD_DESCRIPTION="Set the method used to add files
COM_SERMONDISTRIBUTOR_SERMON_BUILD_LABEL="Build Option"
COM_SERMONDISTRIBUTOR_SERMON_CATID_DESCRIPTION="select one of the following categories"
COM_SERMONDISTRIBUTOR_SERMON_CATID_LABEL="Category"
COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_DESC="The user that created the Sermon."
COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_LABEL="Created by"
COM_SERMONDISTRIBUTOR_SERMON_CREATED_DATE_DESC="The date Sermon was created."
COM_SERMONDISTRIBUTOR_SERMON_CREATED_DATE_LABEL="Created date"
COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_DESC="The user that created this Sermon."
COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_LABEL="Created By"
COM_SERMONDISTRIBUTOR_SERMON_CREATED_DATE_DESC="The date this Sermon was created."
COM_SERMONDISTRIBUTOR_SERMON_CREATED_DATE_LABEL="Created Date"
COM_SERMONDISTRIBUTOR_SERMON_DESCRIPTION="Description"
COM_SERMONDISTRIBUTOR_SERMON_DESCRIPTION_LABEL="Description"
COM_SERMONDISTRIBUTOR_SERMON_DETAILS="Details"
@ -1109,6 +1133,10 @@ COM_SERMONDISTRIBUTOR_SERMON_MANUAL="Manual"
COM_SERMONDISTRIBUTOR_SERMON_MANUAL_FILES="Manual Files"
COM_SERMONDISTRIBUTOR_SERMON_MANUAL_FILES_DESCRIPTION="Select the files you would like to add to this sermon."
COM_SERMONDISTRIBUTOR_SERMON_MANUAL_FILES_LABEL="Files"
COM_SERMONDISTRIBUTOR_SERMON_MODIFIED_BY_DESC="The last user that modified this Sermon."
COM_SERMONDISTRIBUTOR_SERMON_MODIFIED_BY_LABEL="Modified By"
COM_SERMONDISTRIBUTOR_SERMON_MODIFIED_DATE_DESC="The date this Sermon was modified."
COM_SERMONDISTRIBUTOR_SERMON_MODIFIED_DATE_LABEL="Modified Date"
COM_SERMONDISTRIBUTOR_SERMON_NAME="Name"
COM_SERMONDISTRIBUTOR_SERMON_NAME_DESCRIPTION="Enter Name Here"
COM_SERMONDISTRIBUTOR_SERMON_NAME_HINT="Name Here"
@ -1286,10 +1314,10 @@ COM_SERMONDISTRIBUTOR_STATISTIC_COUNTER="Counter"
COM_SERMONDISTRIBUTOR_STATISTIC_COUNTER_DESCRIPTION="Enter number."
COM_SERMONDISTRIBUTOR_STATISTIC_COUNTER_HINT="Number Here."
COM_SERMONDISTRIBUTOR_STATISTIC_COUNTER_LABEL="Counter"
COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_DESC="The user that created the Statistic."
COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_LABEL="Created by"
COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_DATE_DESC="The date Statistic was created."
COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_DATE_LABEL="Created date"
COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_DESC="The user that created this Statistic."
COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_LABEL="Created By"
COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_DATE_DESC="The date this Statistic was created."
COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_DATE_LABEL="Created Date"
COM_SERMONDISTRIBUTOR_STATISTIC_DETAILS="Details"
COM_SERMONDISTRIBUTOR_STATISTIC_EDIT="Editing the Statistic"
COM_SERMONDISTRIBUTOR_STATISTIC_ERROR_UNIQUE_ALIAS="Another Statistic has the same alias."
@ -1298,6 +1326,10 @@ COM_SERMONDISTRIBUTOR_STATISTIC_FILENAME_DESCRIPTION="Enter the file name."
COM_SERMONDISTRIBUTOR_STATISTIC_FILENAME_HINT="the_file_name.mp3"
COM_SERMONDISTRIBUTOR_STATISTIC_FILENAME_LABEL="File Name"
COM_SERMONDISTRIBUTOR_STATISTIC_ID="Id"
COM_SERMONDISTRIBUTOR_STATISTIC_MODIFIED_BY_DESC="The last user that modified this Statistic."
COM_SERMONDISTRIBUTOR_STATISTIC_MODIFIED_BY_LABEL="Modified By"
COM_SERMONDISTRIBUTOR_STATISTIC_MODIFIED_DATE_DESC="The date this Statistic was modified."
COM_SERMONDISTRIBUTOR_STATISTIC_MODIFIED_DATE_LABEL="Modified Date"
COM_SERMONDISTRIBUTOR_STATISTIC_NEW="A New Statistic"
COM_SERMONDISTRIBUTOR_STATISTIC_ORDERING_LABEL="Ordering"
COM_SERMONDISTRIBUTOR_STATISTIC_PERMISSION="Permissions"

View File

@ -1,4 +1,4 @@
COM_SERMONDISTRIBUTOR="Sermon Distributor Configuration"
COM_SERMONDISTRIBUTOR="Sermon Distributor"
COM_SERMONDISTRIBUTOR_CONFIGURATION="Sermon Distributor Configuration"
COM_SERMONDISTRIBUTOR_MENU="&#187; Sermon Distributor"
COM_SERMONDISTRIBUTOR_MENU_CATEGORIES_DESC="All categories that are published"

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage batchselection.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_under.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_under.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage files_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage stastics_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage ajax.php
@ -43,7 +43,7 @@ class SermondistributorModelAjax extends JModelList
}
// [Interpretation 8239] Used in sermon
// Used in sermon
/**
* Check and Set Dropbox local listing
**/

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage articles.php
@ -50,37 +50,92 @@ class JFormFieldArticles extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7009] see if we should add buttons
// see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7011] get html
// get html
$html = parent::getInput();
// [Interpretation 7013] if true set button
// if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7017] only add if user allowed to create article
// only add if user allowed to create article
if ($user->authorise('core.create', 'com_sermondistributor'))
{
// [Interpretation 7035] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7037] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7042] check if new item
$ref = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7046] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
}
// [Interpretation 7049] build the button
$button = '<a class="btn btn-small btn-success"
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_sermondistributor&amp;view=article&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [Interpretation 7053] return the button attached to input field
return $html . $button;
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit article
if (($buttonName == 'article' || $buttonName == 'articles') && $user->authorise('core.edit', 'com_sermondistributor'))
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_sermondistributor&view=articles&task=article.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for article field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
return $html;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage dropboxfiles.php
@ -50,37 +50,92 @@ class JFormFieldDropboxfiles extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7009] see if we should add buttons
// see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7011] get html
// get html
$html = parent::getInput();
// [Interpretation 7013] if true set button
// if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7017] only add if user allowed to create
// only add if user allowed to create
if ($user->authorise('core.create', 'com_sermondistributor'))
{
// [Interpretation 7035] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7037] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7042] check if new item
$ref = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7046] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
}
// [Interpretation 7049] build the button
$button = '<a class="btn btn-small btn-success"
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_sermondistributor&amp;view=&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [Interpretation 7053] return the button attached to input field
return $html . $button;
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit
if (($buttonName == '' || $buttonName == '') && $user->authorise('core.edit', 'com_sermondistributor'))
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_sermondistributor&view=&task=.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
return $html;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage localfiles.php
@ -50,37 +50,92 @@ class JFormFieldLocalfiles extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7009] see if we should add buttons
// see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7011] get html
// get html
$html = parent::getInput();
// [Interpretation 7013] if true set button
// if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7017] only add if user allowed to create
// only add if user allowed to create
if ($user->authorise('core.create', 'com_sermondistributor'))
{
// [Interpretation 7035] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7037] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7042] check if new item
$ref = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7046] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
}
// [Interpretation 7049] build the button
$button = '<a class="btn btn-small btn-success"
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_sermondistributor&amp;view=&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [Interpretation 7053] return the button attached to input field
return $html . $button;
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit
if (($buttonName == '' || $buttonName == '') && $user->authorise('core.edit', 'com_sermondistributor'))
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_sermondistributor&view=&task=.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
return $html;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.php
@ -50,37 +50,92 @@ class JFormFieldPreachers extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7009] see if we should add buttons
// see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7011] get html
// get html
$html = parent::getInput();
// [Interpretation 7013] if true set button
// if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7017] only add if user allowed to create preacher
// only add if user allowed to create preacher
if ($user->authorise('preacher.create', 'com_sermondistributor'))
{
// [Interpretation 7035] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7037] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7042] check if new item
$ref = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7046] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
}
// [Interpretation 7049] build the button
$button = '<a class="btn btn-small btn-success"
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_sermondistributor&amp;view=preacher&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [Interpretation 7053] return the button attached to input field
return $html . $button;
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit preacher
if (($buttonName == 'preacher' || $buttonName == 'preachers') && $user->authorise('preacher.edit', 'com_sermondistributor'))
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_sermondistributor&view=preachers&task=preacher.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for preacher field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
return $html;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.php
@ -50,37 +50,92 @@ class JFormFieldSeries extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7009] see if we should add buttons
// see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7011] get html
// get html
$html = parent::getInput();
// [Interpretation 7013] if true set button
// if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7017] only add if user allowed to create series
// only add if user allowed to create series
if ($user->authorise('series.create', 'com_sermondistributor'))
{
// [Interpretation 7035] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7037] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7042] check if new item
$ref = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7046] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
}
// [Interpretation 7049] build the button
$button = '<a class="btn btn-small btn-success"
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_sermondistributor&amp;view=series&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [Interpretation 7053] return the button attached to input field
return $html . $button;
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit series
if (($buttonName == 'series' || $buttonName == 'all_series') && $user->authorise('series.edit', 'com_sermondistributor'))
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_sermondistributor&view=all_series&task=series.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for series field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
return $html;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.php
@ -50,37 +50,92 @@ class JFormFieldSermon extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7009] see if we should add buttons
// see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7011] get html
// get html
$html = parent::getInput();
// [Interpretation 7013] if true set button
// if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7017] only add if user allowed to create sermon
// only add if user allowed to create sermon
if ($user->authorise('sermon.create', 'com_sermondistributor'))
{
// [Interpretation 7035] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7037] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7042] check if new item
$ref = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7046] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
}
// [Interpretation 7049] build the button
$button = '<a class="btn btn-small btn-success"
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_sermondistributor&amp;view=sermon&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [Interpretation 7053] return the button attached to input field
return $html . $button;
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit sermon
if (($buttonName == 'sermon' || $buttonName == 'sermons') && $user->authorise('sermon.edit', 'com_sermondistributor'))
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_sermondistributor&view=sermons&task=sermon.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for sermon field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
return $html;

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.js
@ -53,7 +53,7 @@ jQuery(document).ready(function()
// the vvvvvwe function
function vvvvvwe(location_vvvvvwe)
{
// [Interpretation 7326] set the function logic
// set the function logic
if (location_vvvvvwe == 1)
{
jQuery('#jform_admin_view').closest('.control-group').show();
@ -67,7 +67,7 @@ function vvvvvwe(location_vvvvvwe)
// the vvvvvwf function
function vvvvvwf(location_vvvvvwf)
{
// [Interpretation 7326] set the function logic
// set the function logic
if (location_vvvvvwf == 2)
{
jQuery('#jform_site_view').closest('.control-group').show();
@ -94,7 +94,7 @@ function vvvvvwg(type_vvvvvwg)
var type = type_vvvvvwg.some(type_vvvvvwg_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (type)
{
jQuery('#jform_url').closest('.control-group').show();
@ -125,7 +125,7 @@ function vvvvvwg(type_vvvvvwg)
// the vvvvvwg Some function
function type_vvvvvwg_SomeFunc(type_vvvvvwg)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (type_vvvvvwg == 3)
{
return true;
@ -149,7 +149,7 @@ function vvvvvwh(type_vvvvvwh)
var type = type_vvvvvwh.some(type_vvvvvwh_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (type)
{
jQuery('#jform_article').closest('.control-group').show();
@ -180,7 +180,7 @@ function vvvvvwh(type_vvvvvwh)
// the vvvvvwh Some function
function type_vvvvvwh_SomeFunc(type_vvvvvwh)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (type_vvvvvwh == 1)
{
return true;
@ -204,7 +204,7 @@ function vvvvvwi(type_vvvvvwi)
var type = type_vvvvvwi.some(type_vvvvvwi_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (type)
{
jQuery('#jform_content-lbl').closest('.control-group').show();
@ -235,7 +235,7 @@ function vvvvvwi(type_vvvvvwi)
// the vvvvvwi Some function
function type_vvvvvwi_SomeFunc(type_vvvvvwi)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (type_vvvvvwi == 2)
{
return true;
@ -246,7 +246,7 @@ function type_vvvvvwi_SomeFunc(type_vvvvvwi)
// the vvvvvwj function
function vvvvvwj(target_vvvvvwj)
{
// [Interpretation 7326] set the function logic
// set the function logic
if (target_vvvvvwj == 1)
{
jQuery('#jform_groups').closest('.control-group').show();

View File

@ -4,34 +4,37 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields"
>
<fieldset name="details">
<!-- [Interpretation 383] Default Fields. -->
<!-- [Interpretation 384] Id Field. Type: Text (joomla) -->
<!-- Default Fields. -->
<!-- Id Field. Type: Text (joomla) -->
<field
name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true"
/>
<!-- [Interpretation 391] Date Created Field. Type: Calendar (joomla) -->
<!-- Date Created Field. Type: Calendar (joomla) -->
<field
name="created"
type="calendar"
label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_DATE_LABEL"
description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_DATE_DESC"
size="22"
format="%Y-%m-%d %H:%M:%S"
filter="user_utc"
/>
<!-- [Interpretation 402] User Created Field. Type: User (joomla) -->
<!-- User Created Field. Type: User (joomla) -->
<field
name="created_by"
type="user"
label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_DESC"
/>
<!-- [Interpretation 410] Published Field. Type: List (joomla) -->
<!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" >
<option value="1">
JPUBLISHED</option>
@ -42,26 +45,28 @@
<option value="-2">
JTRASHED</option>
</field>
<!-- [Interpretation 425] Date Modified Field. Type: Calendar (joomla) -->
<!-- Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_DATE_LABEL" description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_DATE_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [Interpretation 429] User Modified Field. Type: User (joomla) -->
<!-- User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
/>
<!-- [Interpretation 439] Access Field. Type: Accesslevel (joomla) -->
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- [Interpretation 449] Ordering Field. Type: Numbers (joomla) -->
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
type="number"
@ -70,9 +75,10 @@
description=""
default="0"
size="6"
required="false"
/>
<!-- [Interpretation 461] Version Field. Type: Text (joomla) -->
<!-- Version Field. Type: Text (joomla) -->
<field
name="version"
type="text"
@ -83,7 +89,7 @@
readonly="true"
filter="unset"
/>
<!-- [Interpretation 475] Metakey Field. Type: Textarea (joomla) -->
<!-- Metakey Field. Type: Textarea (joomla) -->
<field
name="metakey"
type="textarea"
@ -92,7 +98,7 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 484] Metadesc Field. Type: Textarea (joomla) -->
<!-- Metadesc Field. Type: Textarea (joomla) -->
<field
name="metadesc"
type="textarea"
@ -101,8 +107,8 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 494] Dynamic Fields. -->
<!-- [Interpretation 763] Title Field. Type: Text. (joomla) -->
<!-- Dynamic Fields. -->
<!-- Title Field. Type: Text. (joomla) -->
<field
type="text"
name="title"
@ -118,7 +124,7 @@
message="Error! Please add title here."
hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TITLE_HINT"
/>
<!-- [Interpretation 678] Type Field. Type: List. (joomla) -->
<!-- Type Field. Type: List. (joomla) -->
<field
type="list"
name="type"
@ -127,7 +133,7 @@
class="list_class"
multiple="false"
required="true">
<!-- [Interpretation 749] Option Set. -->
<!-- Option Set. -->
<option value="">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SELECT_AN_OPTION</option>
<option value="1">
@ -137,7 +143,7 @@
<option value="3">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL</option>
</field>
<!-- [Interpretation 763] Groups Field. Type: Usergroup. (joomla) -->
<!-- Groups Field. Type: Usergroup. (joomla) -->
<field
type="usergroup"
name="groups"
@ -146,7 +152,7 @@
required="true"
multiple="true"
/>
<!-- [Interpretation 678] Location Field. Type: Radio. (joomla) -->
<!-- Location Field. Type: Radio. (joomla) -->
<field
type="radio"
name="location"
@ -154,13 +160,13 @@
description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_LOCATION_DESCRIPTION"
class="btn-group"
required="true">
<!-- [Interpretation 749] Option Set. -->
<!-- Option Set. -->
<option value="1">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN</option>
<option value="2">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE</option>
</field>
<!-- [Interpretation 763] Admin_view Field. Type: Folderlist. (joomla) -->
<!-- Admin_view Field. Type: Folderlist. (joomla) -->
<field
type="folderlist"
name="admin_view"
@ -170,7 +176,7 @@
hide_none="true"
hide_default="true"
/>
<!-- [Interpretation 763] Site_view Field. Type: Folderlist. (joomla) -->
<!-- Site_view Field. Type: Folderlist. (joomla) -->
<field
type="folderlist"
name="site_view"
@ -180,7 +186,7 @@
hide_none="true"
hide_default="true"
/>
<!-- [Interpretation 678] Target Field. Type: Radio. (joomla) -->
<!-- Target Field. Type: Radio. (joomla) -->
<field
type="radio"
name="target"
@ -188,13 +194,13 @@
description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TARGET_DESCRIPTION"
class="btn-group"
required="true">
<!-- [Interpretation 749] Option Set. -->
<!-- Option Set. -->
<option value="1">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SOME</option>
<option value="2">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALL</option>
</field>
<!-- [Interpretation 763] Content Field. Type: Editor. (joomla) -->
<!-- Content Field. Type: Editor. (joomla) -->
<field
type="editor"
name="content"
@ -205,16 +211,16 @@
filter="safehtml"
required="true"
/>
<!-- [Interpretation 763] Alias Field. Type: Text. (joomla) -->
<!-- Alias Field. Type: Text. (joomla) -->
<field
type="text"
name="alias"
label="JFIELD_ALIAS_LABEL"
label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
filter="STRING"
hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALIAS_HINT"
/>
<!-- [Interpretation 884] Article Field. Type: Articles. (custom) -->
<!-- Article Field. Type: Articles. (custom) -->
<field
type="articles"
name="article"
@ -224,7 +230,7 @@
default="0"
required="true"
/>
<!-- [Interpretation 763] Url Field. Type: Url. (joomla) -->
<!-- Url Field. Type: Url. (joomla) -->
<field
type="url"
name="url"
@ -239,7 +245,7 @@
message="Error! Please add url here."
hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_HINT"
/>
<!-- [Interpretation 763] Not_required Field. Type: Hidden. (joomla) -->
<!-- Not_required Field. Type: Hidden. (joomla) -->
<field
type="hidden"
name="not_required"
@ -247,11 +253,11 @@
/>
</fieldset>
<!-- [Interpretation 513] Metadata Fields. -->
<!-- Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [Interpretation 517] Robots Field. Type: List (joomla) -->
<!-- Robots Field. Type: List (joomla) -->
<field name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
@ -262,13 +268,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field>
<!-- [Interpretation 528] Author Field. Type: Text (joomla) -->
<!-- Author Field. Type: Text (joomla) -->
<field name="author"
type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20"
/>
<!-- [Interpretation 534] Rights Field. Type: Textarea (joomla) -->
<!-- Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2"
@ -276,15 +282,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9399] Access Control Fields. -->
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9401] Asset Id Field. Type: Hidden (joomla) -->
<!-- Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9407] Rules Field. Type: Rules (joomla) -->
<!-- Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.js

View File

@ -4,34 +4,37 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields"
>
<fieldset name="details">
<!-- [Interpretation 383] Default Fields. -->
<!-- [Interpretation 384] Id Field. Type: Text (joomla) -->
<!-- Default Fields. -->
<!-- Id Field. Type: Text (joomla) -->
<field
name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true"
/>
<!-- [Interpretation 391] Date Created Field. Type: Calendar (joomla) -->
<!-- Date Created Field. Type: Calendar (joomla) -->
<field
name="created"
type="calendar"
label="COM_SERMONDISTRIBUTOR_PREACHER_CREATED_DATE_LABEL"
description="COM_SERMONDISTRIBUTOR_PREACHER_CREATED_DATE_DESC"
size="22"
format="%Y-%m-%d %H:%M:%S"
filter="user_utc"
/>
<!-- [Interpretation 402] User Created Field. Type: User (joomla) -->
<!-- User Created Field. Type: User (joomla) -->
<field
name="created_by"
type="user"
label="COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_DESC"
/>
<!-- [Interpretation 410] Published Field. Type: List (joomla) -->
<!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" >
<option value="1">
JPUBLISHED</option>
@ -42,26 +45,28 @@
<option value="-2">
JTRASHED</option>
</field>
<!-- [Interpretation 425] Date Modified Field. Type: Calendar (joomla) -->
<!-- Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
label="COM_SERMONDISTRIBUTOR_PREACHER_MODIFIED_DATE_LABEL" description="COM_SERMONDISTRIBUTOR_PREACHER_MODIFIED_DATE_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [Interpretation 429] User Modified Field. Type: User (joomla) -->
<!-- User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
label="COM_SERMONDISTRIBUTOR_PREACHER_MODIFIED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_PREACHER_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
/>
<!-- [Interpretation 439] Access Field. Type: Accesslevel (joomla) -->
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- [Interpretation 449] Ordering Field. Type: Numbers (joomla) -->
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
type="number"
@ -70,9 +75,10 @@
description=""
default="0"
size="6"
required="false"
/>
<!-- [Interpretation 461] Version Field. Type: Text (joomla) -->
<!-- Version Field. Type: Text (joomla) -->
<field
name="version"
type="text"
@ -83,7 +89,7 @@
readonly="true"
filter="unset"
/>
<!-- [Interpretation 475] Metakey Field. Type: Textarea (joomla) -->
<!-- Metakey Field. Type: Textarea (joomla) -->
<field
name="metakey"
type="textarea"
@ -92,7 +98,7 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 484] Metadesc Field. Type: Textarea (joomla) -->
<!-- Metadesc Field. Type: Textarea (joomla) -->
<field
name="metadesc"
type="textarea"
@ -101,8 +107,8 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 494] Dynamic Fields. -->
<!-- [Interpretation 763] Name Field. Type: Text. (joomla) -->
<!-- Dynamic Fields. -->
<!-- Name Field. Type: Text. (joomla) -->
<field
type="text"
name="name"
@ -118,7 +124,7 @@
message="Error! Please add name here."
hint="COM_SERMONDISTRIBUTOR_PREACHER_NAME_HINT"
/>
<!-- [Interpretation 763] Description Field. Type: Editor. (joomla) -->
<!-- Description Field. Type: Editor. (joomla) -->
<field
type="editor"
name="description"
@ -130,16 +136,16 @@
buttons="false"
filter="safehtml"
/>
<!-- [Interpretation 763] Alias Field. Type: Text. (joomla) -->
<!-- Alias Field. Type: Text. (joomla) -->
<field
type="text"
name="alias"
label="JFIELD_ALIAS_LABEL"
label="COM_SERMONDISTRIBUTOR_PREACHER_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
filter="STRING"
hint="COM_SERMONDISTRIBUTOR_PREACHER_ALIAS_HINT"
/>
<!-- [Interpretation 763] Email Field. Type: Text. (joomla) -->
<!-- Email Field. Type: Text. (joomla) -->
<field
type="text"
name="email"
@ -154,7 +160,7 @@
message="Error! Please add email address here."
hint="COM_SERMONDISTRIBUTOR_PREACHER_EMAIL_HINT"
/>
<!-- [Interpretation 763] Website Field. Type: Url. (joomla) -->
<!-- Website Field. Type: Url. (joomla) -->
<field
type="url"
name="website"
@ -168,7 +174,7 @@
message="Error! Please add website here."
hint="COM_SERMONDISTRIBUTOR_PREACHER_WEBSITE_HINT"
/>
<!-- [Interpretation 763] Icon Field. Type: Media. (joomla) -->
<!-- Icon Field. Type: Media. (joomla) -->
<field
type="media"
name="icon"
@ -178,11 +184,11 @@
/>
</fieldset>
<!-- [Interpretation 513] Metadata Fields. -->
<!-- Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [Interpretation 517] Robots Field. Type: List (joomla) -->
<!-- Robots Field. Type: List (joomla) -->
<field name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
@ -193,13 +199,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field>
<!-- [Interpretation 528] Author Field. Type: Text (joomla) -->
<!-- Author Field. Type: Text (joomla) -->
<field name="author"
type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20"
/>
<!-- [Interpretation 534] Rights Field. Type: Textarea (joomla) -->
<!-- Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2"
@ -207,15 +213,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9399] Access Control Fields. -->
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9401] Asset Id Field. Type: Hidden (joomla) -->
<!-- Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9407] Rules Field. Type: Rules (joomla) -->
<!-- Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.js

View File

@ -4,34 +4,37 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields"
>
<fieldset name="details">
<!-- [Interpretation 383] Default Fields. -->
<!-- [Interpretation 384] Id Field. Type: Text (joomla) -->
<!-- Default Fields. -->
<!-- Id Field. Type: Text (joomla) -->
<field
name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true"
/>
<!-- [Interpretation 391] Date Created Field. Type: Calendar (joomla) -->
<!-- Date Created Field. Type: Calendar (joomla) -->
<field
name="created"
type="calendar"
label="COM_SERMONDISTRIBUTOR_SERIES_CREATED_DATE_LABEL"
description="COM_SERMONDISTRIBUTOR_SERIES_CREATED_DATE_DESC"
size="22"
format="%Y-%m-%d %H:%M:%S"
filter="user_utc"
/>
<!-- [Interpretation 402] User Created Field. Type: User (joomla) -->
<!-- User Created Field. Type: User (joomla) -->
<field
name="created_by"
type="user"
label="COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_DESC"
/>
<!-- [Interpretation 410] Published Field. Type: List (joomla) -->
<!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" >
<option value="1">
JPUBLISHED</option>
@ -42,26 +45,28 @@
<option value="-2">
JTRASHED</option>
</field>
<!-- [Interpretation 425] Date Modified Field. Type: Calendar (joomla) -->
<!-- Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
label="COM_SERMONDISTRIBUTOR_SERIES_MODIFIED_DATE_LABEL" description="COM_SERMONDISTRIBUTOR_SERIES_MODIFIED_DATE_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [Interpretation 429] User Modified Field. Type: User (joomla) -->
<!-- User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
label="COM_SERMONDISTRIBUTOR_SERIES_MODIFIED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_SERIES_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
/>
<!-- [Interpretation 439] Access Field. Type: Accesslevel (joomla) -->
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- [Interpretation 449] Ordering Field. Type: Numbers (joomla) -->
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
type="number"
@ -70,9 +75,10 @@
description=""
default="0"
size="6"
required="false"
/>
<!-- [Interpretation 461] Version Field. Type: Text (joomla) -->
<!-- Version Field. Type: Text (joomla) -->
<field
name="version"
type="text"
@ -83,7 +89,7 @@
readonly="true"
filter="unset"
/>
<!-- [Interpretation 475] Metakey Field. Type: Textarea (joomla) -->
<!-- Metakey Field. Type: Textarea (joomla) -->
<field
name="metakey"
type="textarea"
@ -92,7 +98,7 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 484] Metadesc Field. Type: Textarea (joomla) -->
<!-- Metadesc Field. Type: Textarea (joomla) -->
<field
name="metadesc"
type="textarea"
@ -101,8 +107,8 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 494] Dynamic Fields. -->
<!-- [Interpretation 763] Name Field. Type: Text. (joomla) -->
<!-- Dynamic Fields. -->
<!-- Name Field. Type: Text. (joomla) -->
<field
type="text"
name="name"
@ -118,7 +124,7 @@
message="Error! Please add name here."
hint="COM_SERMONDISTRIBUTOR_SERIES_NAME_HINT"
/>
<!-- [Interpretation 763] Description Field. Type: Editor. (joomla) -->
<!-- Description Field. Type: Editor. (joomla) -->
<field
type="editor"
name="description"
@ -130,16 +136,16 @@
buttons="false"
filter="safehtml"
/>
<!-- [Interpretation 763] Alias Field. Type: Text. (joomla) -->
<!-- Alias Field. Type: Text. (joomla) -->
<field
type="text"
name="alias"
label="JFIELD_ALIAS_LABEL"
label="COM_SERMONDISTRIBUTOR_SERIES_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
filter="STRING"
hint="COM_SERMONDISTRIBUTOR_SERIES_ALIAS_HINT"
/>
<!-- [Interpretation 763] Icon Field. Type: Media. (joomla) -->
<!-- Icon Field. Type: Media. (joomla) -->
<field
type="media"
name="icon"
@ -147,7 +153,7 @@
description="COM_SERMONDISTRIBUTOR_SERIES_ICON_DESCRIPTION"
directory=""
/>
<!-- [Interpretation 763] Scripture Field. Type: Text. (joomla) -->
<!-- Scripture Field. Type: Text. (joomla) -->
<field
type="text"
name="scripture"
@ -165,11 +171,11 @@
/>
</fieldset>
<!-- [Interpretation 513] Metadata Fields. -->
<!-- Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [Interpretation 517] Robots Field. Type: List (joomla) -->
<!-- Robots Field. Type: List (joomla) -->
<field name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
@ -180,13 +186,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field>
<!-- [Interpretation 528] Author Field. Type: Text (joomla) -->
<!-- Author Field. Type: Text (joomla) -->
<field name="author"
type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20"
/>
<!-- [Interpretation 534] Rights Field. Type: Textarea (joomla) -->
<!-- Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2"
@ -194,15 +200,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9399] Access Control Fields. -->
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9401] Asset Id Field. Type: Hidden (joomla) -->
<!-- Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9407] Rules Field. Type: Rules (joomla) -->
<!-- Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.js
@ -76,7 +76,7 @@ function vvvvvvv(source_vvvvvvv)
var source = source_vvvvvvv.some(source_vvvvvvv_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (source)
{
jQuery('#jform_build').closest('.control-group').show();
@ -107,7 +107,7 @@ function vvvvvvv(source_vvvvvvv)
// the vvvvvvv Some function
function source_vvvvvvv_SomeFunc(source_vvvvvvv)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (source_vvvvvvv == 2)
{
return true;
@ -143,7 +143,7 @@ function vvvvvvw(source_vvvvvvw,build_vvvvvvw)
var build = build_vvvvvvw.some(build_vvvvvvw_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (source && build)
{
jQuery('.note_auto_dropbox').closest('.control-group').show();
@ -157,7 +157,7 @@ function vvvvvvw(source_vvvvvvw,build_vvvvvvw)
// the vvvvvvw Some function
function source_vvvvvvw_SomeFunc(source_vvvvvvw)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (source_vvvvvvw == 2)
{
return true;
@ -168,7 +168,7 @@ function source_vvvvvvw_SomeFunc(source_vvvvvvw)
// the vvvvvvw Some function
function build_vvvvvvw_SomeFunc(build_vvvvvvw)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (build_vvvvvvw == 2)
{
return true;
@ -204,7 +204,7 @@ function vvvvvvy(source_vvvvvvy,build_vvvvvvy)
var build = build_vvvvvvy.some(build_vvvvvvy_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (source && build)
{
jQuery('#jform_manual_files').closest('.control-group').show();
@ -237,7 +237,7 @@ function vvvvvvy(source_vvvvvvy,build_vvvvvvy)
// the vvvvvvy Some function
function source_vvvvvvy_SomeFunc(source_vvvvvvy)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (source_vvvvvvy == 2)
{
return true;
@ -248,7 +248,7 @@ function source_vvvvvvy_SomeFunc(source_vvvvvvy)
// the vvvvvvy Some function
function build_vvvvvvy_SomeFunc(build_vvvvvvy)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (build_vvvvvvy == 1)
{
return true;
@ -284,7 +284,7 @@ function vvvvvvz(build_vvvvvvz,source_vvvvvvz)
var source = source_vvvvvvz.some(source_vvvvvvz_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (build && source)
{
jQuery('#jform_manual_files').closest('.control-group').show();
@ -317,7 +317,7 @@ function vvvvvvz(build_vvvvvvz,source_vvvvvvz)
// the vvvvvvz Some function
function build_vvvvvvz_SomeFunc(build_vvvvvvz)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (build_vvvvvvz == 1)
{
return true;
@ -328,7 +328,7 @@ function build_vvvvvvz_SomeFunc(build_vvvvvvz)
// the vvvvvvz Some function
function source_vvvvvvz_SomeFunc(source_vvvvvvz)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (source_vvvvvvz == 2)
{
return true;
@ -352,7 +352,7 @@ function vvvvvwa(source_vvvvvwa)
var source = source_vvvvvwa.some(source_vvvvvwa_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (source)
{
jQuery('#jform_local_files').closest('.control-group').show();
@ -383,7 +383,7 @@ function vvvvvwa(source_vvvvvwa)
// the vvvvvwa Some function
function source_vvvvvwa_SomeFunc(source_vvvvvwa)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (source_vvvvvwa == 1)
{
return true;
@ -407,7 +407,7 @@ function vvvvvwb(source_vvvvvwb)
var source = source_vvvvvwb.some(source_vvvvvwb_SomeFunc);
// [Interpretation 7304] set this function logic
// set this function logic
if (source)
{
jQuery('#jform_url').closest('.control-group').show();
@ -438,7 +438,7 @@ function vvvvvwb(source_vvvvvwb)
// the vvvvvwb Some function
function source_vvvvvwb_SomeFunc(source_vvvvvwb)
{
// [Interpretation 7291] set the function logic
// set the function logic
if (source_vvvvvwb == 3)
{
return true;
@ -449,7 +449,7 @@ function source_vvvvvwb_SomeFunc(source_vvvvvwb)
// the vvvvvwc function
function vvvvvwc(link_type_vvvvvwc)
{
// [Interpretation 7326] set the function logic
// set the function logic
if (link_type_vvvvvwc == 2)
{
jQuery('.note_link_directed').closest('.control-group').show();
@ -463,7 +463,7 @@ function vvvvvwc(link_type_vvvvvwc)
// the vvvvvwd function
function vvvvvwd(link_type_vvvvvwd)
{
// [Interpretation 7326] set the function logic
// set the function logic
if (link_type_vvvvvwd == 1)
{
jQuery('.note_link_encrypted').closest('.control-group').show();

View File

@ -4,34 +4,37 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields"
>
<fieldset name="details">
<!-- [Interpretation 383] Default Fields. -->
<!-- [Interpretation 384] Id Field. Type: Text (joomla) -->
<!-- Default Fields. -->
<!-- Id Field. Type: Text (joomla) -->
<field
name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true"
/>
<!-- [Interpretation 391] Date Created Field. Type: Calendar (joomla) -->
<!-- Date Created Field. Type: Calendar (joomla) -->
<field
name="created"
type="calendar"
label="COM_SERMONDISTRIBUTOR_SERMON_CREATED_DATE_LABEL"
description="COM_SERMONDISTRIBUTOR_SERMON_CREATED_DATE_DESC"
size="22"
format="%Y-%m-%d %H:%M:%S"
filter="user_utc"
/>
<!-- [Interpretation 402] User Created Field. Type: User (joomla) -->
<!-- User Created Field. Type: User (joomla) -->
<field
name="created_by"
type="user"
label="COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_DESC"
/>
<!-- [Interpretation 410] Published Field. Type: List (joomla) -->
<!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" >
<option value="1">
JPUBLISHED</option>
@ -42,26 +45,28 @@
<option value="-2">
JTRASHED</option>
</field>
<!-- [Interpretation 425] Date Modified Field. Type: Calendar (joomla) -->
<!-- Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
label="COM_SERMONDISTRIBUTOR_SERMON_MODIFIED_DATE_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_MODIFIED_DATE_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [Interpretation 429] User Modified Field. Type: User (joomla) -->
<!-- User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
label="COM_SERMONDISTRIBUTOR_SERMON_MODIFIED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_SERMON_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
/>
<!-- [Interpretation 439] Access Field. Type: Accesslevel (joomla) -->
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- [Interpretation 449] Ordering Field. Type: Numbers (joomla) -->
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
type="number"
@ -70,9 +75,10 @@
description=""
default="0"
size="6"
required="false"
/>
<!-- [Interpretation 461] Version Field. Type: Text (joomla) -->
<!-- Version Field. Type: Text (joomla) -->
<field
name="version"
type="text"
@ -83,7 +89,7 @@
readonly="true"
filter="unset"
/>
<!-- [Interpretation 475] Metakey Field. Type: Textarea (joomla) -->
<!-- Metakey Field. Type: Textarea (joomla) -->
<field
name="metakey"
type="textarea"
@ -92,7 +98,7 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 484] Metadesc Field. Type: Textarea (joomla) -->
<!-- Metadesc Field. Type: Textarea (joomla) -->
<field
name="metadesc"
type="textarea"
@ -101,8 +107,8 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 494] Dynamic Fields. -->
<!-- [Interpretation 763] Name Field. Type: Text. (joomla) -->
<!-- Dynamic Fields. -->
<!-- Name Field. Type: Text. (joomla) -->
<field
type="text"
name="name"
@ -118,7 +124,7 @@
message="Error! Please add name here."
hint="COM_SERMONDISTRIBUTOR_SERMON_NAME_HINT"
/>
<!-- [Interpretation 884] Preacher Field. Type: Preachers. (custom) -->
<!-- Preacher Field. Type: Preachers. (custom) -->
<field
type="preachers"
name="preacher"
@ -129,7 +135,7 @@
default="0"
button="true"
/>
<!-- [Interpretation 884] Series Field. Type: Series. (custom) -->
<!-- Series Field. Type: Series. (custom) -->
<field
type="series"
name="series"
@ -140,7 +146,7 @@
default="0"
button="true"
/>
<!-- [Interpretation 763] Short_description Field. Type: Text. (joomla) -->
<!-- Short_description Field. Type: Text. (joomla) -->
<field
type="text"
name="short_description"
@ -154,7 +160,7 @@
message="Error! Please add some short description here."
hint="COM_SERMONDISTRIBUTOR_SERMON_SHORT_DESCRIPTION_HINT"
/>
<!-- [Interpretation 763] Catid Field. Type: Category. (joomla) -->
<!-- Catid Field. Type: Category. (joomla) -->
<field
type="category"
name="catid"
@ -164,7 +170,7 @@
description="COM_SERMONDISTRIBUTOR_SERMON_CATID_DESCRIPTION"
class="inputbox"
/>
<!-- [Interpretation 678] Link_type Field. Type: Radio. (joomla) -->
<!-- Link_type Field. Type: Radio. (joomla) -->
<field
type="radio"
name="link_type"
@ -173,13 +179,13 @@
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- [Interpretation 749] Option Set. -->
<!-- Option Set. -->
<option value="1">
COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED</option>
<option value="2">
COM_SERMONDISTRIBUTOR_SERMON_DIRECT</option>
</field>
<!-- [Interpretation 678] Source Field. Type: List. (joomla) -->
<!-- Source Field. Type: List. (joomla) -->
<field
type="list"
name="source"
@ -189,7 +195,7 @@
multiple="false"
filter="INT"
required="true">
<!-- [Interpretation 749] Option Set. -->
<!-- Option Set. -->
<option value="">
COM_SERMONDISTRIBUTOR_SERMON_SELECT_SOURCE</option>
<option value="1">
@ -199,7 +205,7 @@
<option value="3">
COM_SERMONDISTRIBUTOR_SERMON_URL</option>
</field>
<!-- [Interpretation 763] Icon Field. Type: Media. (joomla) -->
<!-- Icon Field. Type: Media. (joomla) -->
<field
type="media"
name="icon"
@ -207,7 +213,7 @@
description="COM_SERMONDISTRIBUTOR_SERMON_ICON_DESCRIPTION"
directory=""
/>
<!-- [Interpretation 763] Tags Field. Type: Tag. (joomla) -->
<!-- Tags Field. Type: Tag. (joomla) -->
<field
type="tag"
name="tags"
@ -218,7 +224,7 @@
published="true"
multiple="true"
/>
<!-- [Interpretation 884] Local_files Field. Type: Localfiles. (custom) -->
<!-- Local_files Field. Type: Localfiles. (custom) -->
<field
type="localfiles"
name="local_files"
@ -230,7 +236,7 @@
required="true"
button="false"
/>
<!-- [Interpretation 763] Description Field. Type: Editor. (joomla) -->
<!-- Description Field. Type: Editor. (joomla) -->
<field
type="editor"
name="description"
@ -242,30 +248,30 @@
buttons="false"
filter="safehtml"
/>
<!-- [Interpretation 777] Note_auto_dropbox Field. Type: Note. A None Database Field. (joomla) -->
<!-- Note_auto_dropbox Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_auto_dropbox" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_AUTO_DROPBOX_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_AUTO_DROPBOX_DESCRIPTION" heading="h4" class="alert alert-info note_auto_dropbox" />
<!-- [Interpretation 763] Alias Field. Type: Text. (joomla) -->
<!-- Alias Field. Type: Text. (joomla) -->
<field
type="text"
name="alias"
label="JFIELD_ALIAS_LABEL"
label="COM_SERMONDISTRIBUTOR_SERMON_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
filter="STRING"
hint="COM_SERMONDISTRIBUTOR_SERMON_ALIAS_HINT"
/>
<!-- [Interpretation 763] Not_required Field. Type: Hidden. (joomla) -->
<!-- Not_required Field. Type: Hidden. (joomla) -->
<field
type="hidden"
name="not_required"
default="[]"
/>
<!-- [Interpretation 777] Note_link_directed Field. Type: Note. A None Database Field. (joomla) -->
<!-- Note_link_directed Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_link_directed" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_DIRECTED_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_DIRECTED_DESCRIPTION" heading="h4" class="alert alert-info note_link_directed" close="true" />
<!-- [Interpretation 777] Note_manual_dropbox Field. Type: Note. A None Database Field. (joomla) -->
<!-- Note_manual_dropbox Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_manual_dropbox" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_MANUAL_DROPBOX_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_MANUAL_DROPBOX_DESCRIPTION" heading="h4" class="alert alert-info note_manual_dropbox" />
<!-- [Interpretation 777] Note_link_encrypted Field. Type: Note. A None Database Field. (joomla) -->
<!-- Note_link_encrypted Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_link_encrypted" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_ENCRYPTED_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_ENCRYPTED_DESCRIPTION" heading="h4" class="alert alert-info note_link_encrypted" close="true" />
<!-- [Interpretation 884] Manual_files Field. Type: Dropboxfiles. (custom) -->
<!-- Manual_files Field. Type: Dropboxfiles. (custom) -->
<field
type="dropboxfiles"
name="manual_files"
@ -277,7 +283,7 @@
required="true"
button="false"
/>
<!-- [Interpretation 763] Scripture Field. Type: Text. (joomla) -->
<!-- Scripture Field. Type: Text. (joomla) -->
<field
type="text"
name="scripture"
@ -293,7 +299,7 @@
message="Error! Please add some scripture reference here."
hint="COM_SERMONDISTRIBUTOR_SERMON_SCRIPTURE_HINT"
/>
<!-- [Interpretation 763] Url Field. Type: Url. (joomla) -->
<!-- Url Field. Type: Url. (joomla) -->
<field
type="url"
name="url"
@ -308,7 +314,7 @@
message="Error! Please add sermon url here."
hint="COM_SERMONDISTRIBUTOR_SERMON_URL_HINT"
/>
<!-- [Interpretation 678] Build Field. Type: Radio. (joomla) -->
<!-- Build Field. Type: Radio. (joomla) -->
<field
type="radio"
name="build"
@ -317,13 +323,13 @@
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- [Interpretation 749] Option Set. -->
<!-- Option Set. -->
<option value="1">
COM_SERMONDISTRIBUTOR_SERMON_MANUAL</option>
<option value="2">
COM_SERMONDISTRIBUTOR_SERMON_AUTOMATIC</option>
</field>
<!-- [Interpretation 763] Auto_sermons Field. Type: Hidden. (joomla) -->
<!-- Auto_sermons Field. Type: Hidden. (joomla) -->
<field
type="hidden"
name="auto_sermons"
@ -331,11 +337,11 @@
/>
</fieldset>
<!-- [Interpretation 513] Metadata Fields. -->
<!-- Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [Interpretation 517] Robots Field. Type: List (joomla) -->
<!-- Robots Field. Type: List (joomla) -->
<field name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
@ -346,13 +352,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field>
<!-- [Interpretation 528] Author Field. Type: Text (joomla) -->
<!-- Author Field. Type: Text (joomla) -->
<field name="author"
type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20"
/>
<!-- [Interpretation 534] Rights Field. Type: Textarea (joomla) -->
<!-- Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2"
@ -360,15 +366,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9399] Access Control Fields. -->
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9401] Asset Id Field. Type: Hidden (joomla) -->
<!-- Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9407] Rules Field. Type: Rules (joomla) -->
<!-- Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.js

View File

@ -4,34 +4,37 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields"
>
<fieldset name="details">
<!-- [Interpretation 383] Default Fields. -->
<!-- [Interpretation 384] Id Field. Type: Text (joomla) -->
<!-- Default Fields. -->
<!-- Id Field. Type: Text (joomla) -->
<field
name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true"
/>
<!-- [Interpretation 391] Date Created Field. Type: Calendar (joomla) -->
<!-- Date Created Field. Type: Calendar (joomla) -->
<field
name="created"
type="calendar"
label="COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_DATE_LABEL"
description="COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_DATE_DESC"
size="22"
format="%Y-%m-%d %H:%M:%S"
filter="user_utc"
/>
<!-- [Interpretation 402] User Created Field. Type: User (joomla) -->
<!-- User Created Field. Type: User (joomla) -->
<field
name="created_by"
type="user"
label="COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_DESC"
/>
<!-- [Interpretation 410] Published Field. Type: List (joomla) -->
<!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" >
<option value="1">
JPUBLISHED</option>
@ -42,26 +45,28 @@
<option value="-2">
JTRASHED</option>
</field>
<!-- [Interpretation 425] Date Modified Field. Type: Calendar (joomla) -->
<!-- Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
label="COM_SERMONDISTRIBUTOR_STATISTIC_MODIFIED_DATE_LABEL" description="COM_SERMONDISTRIBUTOR_STATISTIC_MODIFIED_DATE_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [Interpretation 429] User Modified Field. Type: User (joomla) -->
<!-- User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
label="COM_SERMONDISTRIBUTOR_STATISTIC_MODIFIED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_STATISTIC_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
/>
<!-- [Interpretation 439] Access Field. Type: Accesslevel (joomla) -->
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- [Interpretation 449] Ordering Field. Type: Numbers (joomla) -->
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
type="number"
@ -70,9 +75,10 @@
description=""
default="0"
size="6"
required="false"
/>
<!-- [Interpretation 461] Version Field. Type: Text (joomla) -->
<!-- Version Field. Type: Text (joomla) -->
<field
name="version"
type="text"
@ -83,7 +89,7 @@
readonly="true"
filter="unset"
/>
<!-- [Interpretation 475] Metakey Field. Type: Textarea (joomla) -->
<!-- Metakey Field. Type: Textarea (joomla) -->
<field
name="metakey"
type="textarea"
@ -92,7 +98,7 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 484] Metadesc Field. Type: Textarea (joomla) -->
<!-- Metadesc Field. Type: Textarea (joomla) -->
<field
name="metadesc"
type="textarea"
@ -101,8 +107,8 @@
rows="3"
cols="30"
/>
<!-- [Interpretation 494] Dynamic Fields. -->
<!-- [Interpretation 763] Filename Field. Type: Text. (joomla) -->
<!-- Dynamic Fields. -->
<!-- Filename Field. Type: Text. (joomla) -->
<field
type="text"
name="filename"
@ -116,7 +122,7 @@
message="Error! Please add file name here."
hint="COM_SERMONDISTRIBUTOR_STATISTIC_FILENAME_HINT"
/>
<!-- [Interpretation 884] Sermon Field. Type: Sermon. (custom) -->
<!-- Sermon Field. Type: Sermon. (custom) -->
<field
type="sermon"
name="sermon"
@ -127,7 +133,7 @@
required="true"
button="true"
/>
<!-- [Interpretation 884] Preacher Field. Type: Preachers. (custom) -->
<!-- Preacher Field. Type: Preachers. (custom) -->
<field
type="preachers"
name="preacher"
@ -138,7 +144,7 @@
default="0"
button="true"
/>
<!-- [Interpretation 884] Series Field. Type: Series. (custom) -->
<!-- Series Field. Type: Series. (custom) -->
<field
type="series"
name="series"
@ -149,7 +155,7 @@
default="0"
button="true"
/>
<!-- [Interpretation 763] Counter Field. Type: Text. (joomla) -->
<!-- Counter Field. Type: Text. (joomla) -->
<field
type="text"
name="counter"
@ -165,11 +171,11 @@
/>
</fieldset>
<!-- [Interpretation 513] Metadata Fields. -->
<!-- Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [Interpretation 517] Robots Field. Type: List (joomla) -->
<!-- Robots Field. Type: List (joomla) -->
<field name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
@ -180,13 +186,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field>
<!-- [Interpretation 528] Author Field. Type: Text (joomla) -->
<!-- Author Field. Type: Text (joomla) -->
<field name="author"
type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20"
/>
<!-- [Interpretation 534] Rights Field. Type: Textarea (joomla) -->
<!-- Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2"
@ -194,15 +200,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9399] Access Control Fields. -->
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9401] Asset Id Field. Type: Hidden (joomla) -->
<!-- Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9407] Rules Field. Type: Rules (joomla) -->
<!-- Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.php
@ -97,7 +97,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
if (!empty($item->groups))
{
// [Interpretation 3187] JSON Decode groups.
// JSON Decode groups.
$item->groups = json_decode($item->groups,true);
}
@ -122,7 +122,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 8889] Get the form.
{ // Get the form.
$form = $this->loadForm('com_sermondistributor.help_document', 'help_document', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -132,12 +132,12 @@ class SermondistributorModelHelp_document extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 8974] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 8979] The back end uses id so we use that the rest of the time and set it to 0 by default.
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
@ -145,52 +145,52 @@ class SermondistributorModelHelp_document extends JModelAdmin
$user = JFactory::getUser();
// [Interpretation 8985] Check for existing item.
// [Interpretation 8986] Modify the form based on Edit State access controls.
// Check for existing item.
// Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('help_document.edit.state', 'com_sermondistributor.help_document.' . (int) $id))
|| ($id == 0 && !$user->authorise('help_document.edit.state', 'com_sermondistributor')))
{
// [Interpretation 8999] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9002] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9007] If this is a new item insure the greated by is set.
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9010] Set the created_by to this user
// Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9013] Modify the form based on Edit Creaded By access controls.
// Modify the form based on Edit Creaded By access controls.
if (!$user->authorise('core.edit.created_by', 'com_sermondistributor'))
{
// [Interpretation 9025] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9027] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9029] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9032] Modify the form based on Edit Creaded Date access controls.
// Modify the form based on Edit Creaded Date access controls.
if (!$user->authorise('core.edit.created', 'com_sermondistributor'))
{
// [Interpretation 9044] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9046] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9079] Only load these values if no id is found
// Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9082] Set redirected field name
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9084] Set redirected field value
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9088] Now set the local-redirected field default value
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -227,7 +227,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
$user = JFactory::getUser();
// [Interpretation 9210] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
return $user->authorise('help_document.delete', 'com_sermondistributor.help_document.' . (int) $record->id);
}
return false;
@ -249,14 +249,14 @@ class SermondistributorModelHelp_document extends JModelAdmin
if ($recordId)
{
// [Interpretation 9297] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('help_document.edit.state', 'com_sermondistributor.help_document.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9314] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return $user->authorise('help_document.edit.state', 'com_sermondistributor');
}
@ -271,7 +271,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9122] Check specific edit permission then general edit permission.
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('help_document.edit', 'com_sermondistributor.help_document.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('help_document.edit', 'com_sermondistributor');
@ -370,20 +370,20 @@ class SermondistributorModelHelp_document extends JModelAdmin
*/
public function validate($form, $data, $group = null)
{
// [Interpretation 8088] check if the not_required field is set
// check if the not_required field is set
if (SermondistributorHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
// [Interpretation 8093] now change the required field attributes value
// now change the required field attributes value
foreach ($requiredFields as $requiredField)
{
// [Interpretation 8096] make sure there is a string value
// make sure there is a string value
if (SermondistributorHelper::checkString($requiredField))
{
// [Interpretation 8099] change to false
// change to false
$form->setFieldAttribute($requiredField, 'required', 'false');
// [Interpretation 8101] also clear the data set
// also clear the data set
$data[$requiredField] = '';
}
}
@ -533,7 +533,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4183] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -547,12 +547,12 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false;
}
// [Interpretation 4203] get list of uniqe fields
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4205] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4208] make sure published is set
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -564,21 +564,21 @@ class SermondistributorModelHelp_document extends JModelAdmin
$newIds = array();
// [Interpretation 4245] Parent exists so let's proceed
// Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4248] Pop the first ID off the stack
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4253] only allow copy if user may edit this item.
// only allow copy if user may edit this item.
if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
{
// [Interpretation 4263] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -586,19 +586,19 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
// [Interpretation 4268] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4273] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4280] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -606,7 +606,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
list($this->table->title, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->title);
// [Interpretation 4316] insert all set values
// insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -618,7 +618,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
}
// [Interpretation 4328] update all uniqe fields
// update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -627,13 +627,13 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
}
// [Interpretation 4337] Reset the ID because we are making a copy
// Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4340] TODO: Deal with ordering?
// [Interpretation 4341] $this->table->ordering = 1;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// [Interpretation 4343] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -646,7 +646,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4356] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -654,14 +654,14 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false;
}
// [Interpretation 4364] Get the new item ID
// Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4367] Add the new ID to the array
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4371] Clean the cache
// Clean the cache
$this->cleanCache();
return $newIds;
@ -682,7 +682,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 3985] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -697,15 +697,15 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false;
}
// [Interpretation 4007] make sure published only updates if user has the permission.
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('help_document.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4020] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4041] Parent exists so we proceed
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
@ -715,30 +715,30 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false;
}
// [Interpretation 4058] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4063] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4070] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4076] insert all set values.
// insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4081] Do special action for access.
// Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -751,7 +751,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
// [Interpretation 4093] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -764,7 +764,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4106] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -773,7 +773,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
}
// [Interpretation 4115] Clean the cache
// Clean the cache
$this->cleanCache();
return true;
@ -803,7 +803,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// [Interpretation 3297] Set the groups string to JSON string.
// Set the groups string to JSON string.
if (isset($data['groups']))
{
$data['groups'] = (string) json_encode($data['groups']);
@ -817,7 +817,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4397] Alter the title for save as copy
// Alter the title for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
@ -840,7 +840,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['published'] = 0;
}
// [Interpretation 4424] Automatic handling of alias for empty fields
// Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{
if ($data['alias'] == null)
@ -871,10 +871,10 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
}
// [Interpretation 4463] Alter the uniqe field for save as copy
// Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4466] Automatic handling of other uniqe fields
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -928,7 +928,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
protected function _generateNewTitle($alias, $title)
{
// [Interpretation 4497] Alter the title & alias
// Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_documents.php
@ -113,16 +113,16 @@ class SermondistributorModelHelp_documents extends JModelList
*/
public function getItems()
{
// [Interpretation 9883] check in items
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -133,7 +133,7 @@ class SermondistributorModelHelp_documents extends JModelList
continue;
}
// [Interpretation 10029] decode groups
// decode groups
$groupsArray = json_decode($item->groups, true);
if (SermondistributorHelper::checkArray($groupsArray))
{
@ -156,14 +156,14 @@ class SermondistributorModelHelp_documents extends JModelList
}
}
// [Interpretation 10224] set selection value to a translatable value
// set selection value to a translatable value
if (SermondistributorHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// [Interpretation 10231] convert type
// convert type
$item->type = $this->selectionTranslation($item->type, 'type');
// [Interpretation 10231] convert location
// convert location
$item->location = $this->selectionTranslation($item->location, 'location');
}
}
@ -180,7 +180,7 @@ class SermondistributorModelHelp_documents extends JModelList
*/
public function selectionTranslation($value,$name)
{
// [Interpretation 10257] Array of type language strings
// Array of type language strings
if ($name == 'type')
{
$typeArray = array(
@ -189,20 +189,20 @@ class SermondistributorModelHelp_documents extends JModelList
2 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TEXT',
3 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL'
);
// [Interpretation 10288] Now check if value is found in this array
// Now check if value is found in this array
if (isset($typeArray[$value]) && SermondistributorHelper::checkString($typeArray[$value]))
{
return $typeArray[$value];
}
}
// [Interpretation 10257] Array of location language strings
// Array of location language strings
if ($name == 'location')
{
$locationArray = array(
1 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN',
2 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE'
);
// [Interpretation 10288] Now check if value is found in this array
// Now check if value is found in this array
if (isset($locationArray[$value]) && SermondistributorHelper::checkString($locationArray[$value]))
{
return $locationArray[$value];
@ -218,19 +218,19 @@ class SermondistributorModelHelp_documents extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 6833] Get the user object.
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6835] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6838] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6845] From the sermondistributor_item table
// From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_help_document', 'a'));
// [Interpretation 6859] Filter by published state
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -241,21 +241,21 @@ class SermondistributorModelHelp_documents extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 6871] Join over the asset groups.
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6874] Filter by access level.
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6879] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6956] Filter by search.
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -270,28 +270,28 @@ class SermondistributorModelHelp_documents extends JModelList
}
}
// [Interpretation 7081] Filter by Type.
// Filter by Type.
if ($type = $this->getState('filter.type'))
{
$query->where('a.type = ' . $db->quote($db->escape($type, true)));
}
// [Interpretation 7081] Filter by Location.
// Filter by Location.
if ($location = $this->getState('filter.location'))
{
$query->where('a.location = ' . $db->quote($db->escape($location, true)));
}
// [Interpretation 7081] Filter by Admin_view.
// Filter by Admin_view.
if ($admin_view = $this->getState('filter.admin_view'))
{
$query->where('a.admin_view = ' . $db->quote($db->escape($admin_view, true)));
}
// [Interpretation 7081] Filter by Site_view.
// Filter by Site_view.
if ($site_view = $this->getState('filter.site_view'))
{
$query->where('a.site_view = ' . $db->quote($db->escape($site_view, true)));
}
// [Interpretation 6915] Add the list ordering clause.
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -309,42 +309,44 @@ class SermondistributorModelHelp_documents extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6623] setup the query
// setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6626] Get the user object.
// Set a value to know this is exporting method.
$_export = true;
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6628] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6631] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6633] From the sermondistributor_help_document table
// From the sermondistributor_help_document table
$query->from($db->quoteName('#__sermondistributor_help_document', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6643] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6650] Order the results by ordering
// Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6652] Load the items
// Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -355,13 +357,13 @@ class SermondistributorModelHelp_documents extends JModelList
continue;
}
// [Interpretation 10171] unset the values we don't want exported.
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10180] Add headers to items array.
// Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -380,13 +382,13 @@ class SermondistributorModelHelp_documents extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6672] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6674] get the columns
// get the columns
$columns = $db->getTableColumns("#__sermondistributor_help_document");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6678] remove the headers you don't import/export.
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -408,7 +410,7 @@ class SermondistributorModelHelp_documents extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9506] Compile the store id.
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -432,15 +434,15 @@ class SermondistributorModelHelp_documents extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 9899] Get set check in time
// Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 9904] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 9906] reset query
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_help_document'));
@ -448,24 +450,24 @@ class SermondistributorModelHelp_documents extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 9914] Get Yesterdays date
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 9916] reset query
// reset query
$query = $db->getQuery(true);
// [Interpretation 9918] Fields to update.
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 9923] Conditions for which records should be updated.
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 9928] Check table
// Check table
$query->update($db->quoteName('#__sermondistributor_help_document'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage import.php
@ -52,7 +52,7 @@ class SermondistributorModelImport extends JModelLegacy
* Import Settings
*/
protected $getType = NULL;
protected $dataType = NULL;
protected $dataType = NULL;
/**
* Method to auto-populate the model state.
@ -198,7 +198,8 @@ class SermondistributorModelImport extends JModelLegacy
protected function _getPackageFromUpload()
{
// Get the uploaded file information
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw');
@ -206,21 +207,21 @@ class SermondistributorModelImport extends JModelLegacy
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_WARNIMPORTFILE'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
return false;
}
// If there is no uploaded file, we have a problem...
if (!is_array($userfile))
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_NO_FILE_SELECTED'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
return false;
}
// Check if there was a problem uploading the file.
if ($userfile['error'] || $userfile['size'] < 1)
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_WARNIMPORTUPLOADERROR'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
return false;
}
@ -258,7 +259,8 @@ class SermondistributorModelImport extends JModelLegacy
*/
protected function _getPackageFromFolder()
{
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
@ -266,7 +268,7 @@ class SermondistributorModelImport extends JModelLegacy
// Did you give us a valid path?
if (!file_exists($p_dir))
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
return false;
}
@ -276,7 +278,7 @@ class SermondistributorModelImport extends JModelLegacy
// Did you give us a valid package?
if (!$type)
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
}
// check the extention
@ -287,7 +289,7 @@ class SermondistributorModelImport extends JModelLegacy
break;
default:
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
@ -307,15 +309,16 @@ class SermondistributorModelImport extends JModelLegacy
*/
protected function _getPackageFromUrl()
{
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Get the URL of the package to import
$url = $input->getString('import_url');
// Did you give us a URL?
if (!$url)
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_ENTER_A_URL'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_ENTER_A_URL'), 'warning');
return false;
}
@ -325,7 +328,7 @@ class SermondistributorModelImport extends JModelLegacy
// Was the package downloaded?
if (!$p_file)
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_INVALID_URL'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_INVALID_URL'), 'warning');
return false;
}
@ -346,6 +349,7 @@ class SermondistributorModelImport extends JModelLegacy
*/
protected function check($archivename)
{
$app = JFactory::getApplication();
// Clean the name
$archivename = JPath::clean($archivename);
@ -359,7 +363,7 @@ class SermondistributorModelImport extends JModelLegacy
default:
// Cleanup the import files
$this->remove($archivename);
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.php
@ -113,29 +113,29 @@ class SermondistributorModelPreacher extends JModelAdmin
*/
public function getVvvsermons()
{
// [Interpretation 6337] Get the user object.
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6339] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6342] Select some fields
// Select some fields
$query->select('a.*');
$query->select($db->quoteName('c.title','category_title'));
// [Interpretation 6349] From the sermondistributor_sermon table
// From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [Interpretation 6986] From the sermondistributor_preacher table.
// From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 6986] From the sermondistributor_series table.
// From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 6365] Filter by preachervvvv global.
// Filter by preachervvvv global.
$preachervvvv = $this->preachervvvv;
if (is_numeric($preachervvvv ))
{
@ -150,36 +150,36 @@ class SermondistributorModelPreacher extends JModelAdmin
$query->where('a.preacher = -5');
}
// [Interpretation 6382] Join over the asset groups.
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6385] Filter by access level.
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6390] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6397] Order the results by ordering
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
// [Interpretation 6399] Load the items
// Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -193,14 +193,14 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 10224] set selection value to a translatable value
// set selection value to a translatable value
if (SermondistributorHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// [Interpretation 10231] convert link_type
// convert link_type
$item->link_type = $this->selectionTranslationVvvsermons($item->link_type, 'link_type');
// [Interpretation 10231] convert source
// convert source
$item->source = $this->selectionTranslationVvvsermons($item->source, 'source');
}
}
@ -217,20 +217,20 @@ class SermondistributorModelPreacher extends JModelAdmin
*/
public function selectionTranslationVvvsermons($value,$name)
{
// [Interpretation 10257] Array of link_type language strings
// Array of link_type language strings
if ($name == 'link_type')
{
$link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
);
// [Interpretation 10288] Now check if value is found in this array
// Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{
return $link_typeArray[$value];
}
}
// [Interpretation 10257] Array of source language strings
// Array of source language strings
if ($name == 'source')
{
$sourceArray = array(
@ -239,7 +239,7 @@ class SermondistributorModelPreacher extends JModelAdmin
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
);
// [Interpretation 10288] Now check if value is found in this array
// Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{
return $sourceArray[$value];
@ -259,7 +259,7 @@ class SermondistributorModelPreacher extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 8889] Get the form.
{ // Get the form.
$form = $this->loadForm('com_sermondistributor.preacher', 'preacher', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -269,12 +269,12 @@ class SermondistributorModelPreacher extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 8974] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 8979] The back end uses id so we use that the rest of the time and set it to 0 by default.
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
@ -282,54 +282,54 @@ class SermondistributorModelPreacher extends JModelAdmin
$user = JFactory::getUser();
// [Interpretation 8985] Check for existing item.
// [Interpretation 8986] Modify the form based on Edit State access controls.
// Check for existing item.
// Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.state', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.state', 'com_sermondistributor')))
{
// [Interpretation 8999] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9002] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9007] If this is a new item insure the greated by is set.
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9010] Set the created_by to this user
// Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9013] Modify the form based on Edit Creaded By access controls.
// Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.created_by', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.created_by', 'com_sermondistributor')))
{
// [Interpretation 9025] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9027] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9029] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9032] Modify the form based on Edit Creaded Date access controls.
// Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.created', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.created', 'com_sermondistributor')))
{
// [Interpretation 9044] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9046] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9079] Only load these values if no id is found
// Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9082] Set redirected field name
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9084] Set redirected field value
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9088] Now set the local-redirected field default value
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -366,7 +366,7 @@ class SermondistributorModelPreacher extends JModelAdmin
}
$user = JFactory::getUser();
// [Interpretation 9210] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
return $user->authorise('preacher.delete', 'com_sermondistributor.preacher.' . (int) $record->id);
}
return false;
@ -388,14 +388,14 @@ class SermondistributorModelPreacher extends JModelAdmin
if ($recordId)
{
// [Interpretation 9297] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('preacher.edit.state', 'com_sermondistributor.preacher.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9314] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return $user->authorise('preacher.edit.state', 'com_sermondistributor');
}
@ -410,7 +410,7 @@ class SermondistributorModelPreacher extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9122] Check specific edit permission then general edit permission.
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('preacher.edit', 'com_sermondistributor.preacher.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('preacher.edit', 'com_sermondistributor');
@ -636,7 +636,7 @@ class SermondistributorModelPreacher extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4183] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -650,12 +650,12 @@ class SermondistributorModelPreacher extends JModelAdmin
return false;
}
// [Interpretation 4203] get list of uniqe fields
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4205] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4208] make sure published is set
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -667,21 +667,21 @@ class SermondistributorModelPreacher extends JModelAdmin
$newIds = array();
// [Interpretation 4245] Parent exists so let's proceed
// Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4248] Pop the first ID off the stack
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4253] only allow copy if user may edit this item.
// only allow copy if user may edit this item.
if (!$this->user->authorise('preacher.edit', $contexts[$pk]))
{
// [Interpretation 4263] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -689,19 +689,19 @@ class SermondistributorModelPreacher extends JModelAdmin
}
// [Interpretation 4268] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4273] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4280] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -709,7 +709,7 @@ class SermondistributorModelPreacher extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// [Interpretation 4316] insert all set values
// insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -721,7 +721,7 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 4328] update all uniqe fields
// update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -730,13 +730,13 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 4337] Reset the ID because we are making a copy
// Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4340] TODO: Deal with ordering?
// [Interpretation 4341] $this->table->ordering = 1;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// [Interpretation 4343] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -749,7 +749,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4356] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -757,14 +757,14 @@ class SermondistributorModelPreacher extends JModelAdmin
return false;
}
// [Interpretation 4364] Get the new item ID
// Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4367] Add the new ID to the array
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4371] Clean the cache
// Clean the cache
$this->cleanCache();
return $newIds;
@ -785,7 +785,7 @@ class SermondistributorModelPreacher extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 3985] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -800,15 +800,15 @@ class SermondistributorModelPreacher extends JModelAdmin
return false;
}
// [Interpretation 4007] make sure published only updates if user has the permission.
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('preacher.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4020] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4041] Parent exists so we proceed
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('preacher.edit', $contexts[$pk]))
@ -818,30 +818,30 @@ class SermondistributorModelPreacher extends JModelAdmin
return false;
}
// [Interpretation 4058] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4063] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4070] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4076] insert all set values.
// insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4081] Do special action for access.
// Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -854,7 +854,7 @@ class SermondistributorModelPreacher extends JModelAdmin
}
// [Interpretation 4093] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -867,7 +867,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4106] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -876,7 +876,7 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 4115] Clean the cache
// Clean the cache
$this->cleanCache();
return true;
@ -914,7 +914,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4397] Alter the name for save as copy
// Alter the name for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
@ -937,7 +937,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$data['published'] = 0;
}
// [Interpretation 4424] Automatic handling of alias for empty fields
// Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{
if ($data['alias'] == null)
@ -968,10 +968,10 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 4463] Alter the uniqe field for save as copy
// Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4466] Automatic handling of other uniqe fields
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -1025,7 +1025,7 @@ class SermondistributorModelPreacher extends JModelAdmin
protected function _generateNewTitle($alias, $title)
{
// [Interpretation 4497] Alter the title & alias
// Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.php
@ -101,16 +101,16 @@ class SermondistributorModelPreachers extends JModelList
*/
public function getItems()
{
// [Interpretation 9883] check in items
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -135,19 +135,19 @@ class SermondistributorModelPreachers extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 6833] Get the user object.
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6835] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6838] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6845] From the sermondistributor_item table
// From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_preacher', 'a'));
// [Interpretation 6859] Filter by published state
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -158,21 +158,21 @@ class SermondistributorModelPreachers extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 6871] Join over the asset groups.
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6874] Filter by access level.
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6879] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6956] Filter by search.
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -188,7 +188,7 @@ class SermondistributorModelPreachers extends JModelList
}
// [Interpretation 6915] Add the list ordering clause.
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -206,42 +206,44 @@ class SermondistributorModelPreachers extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6623] setup the query
// setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6626] Get the user object.
// Set a value to know this is exporting method.
$_export = true;
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6628] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6631] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6633] From the sermondistributor_preacher table
// From the sermondistributor_preacher table
$query->from($db->quoteName('#__sermondistributor_preacher', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6643] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6650] Order the results by ordering
// Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6652] Load the items
// Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -252,13 +254,13 @@ class SermondistributorModelPreachers extends JModelList
continue;
}
// [Interpretation 10171] unset the values we don't want exported.
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10180] Add headers to items array.
// Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -277,13 +279,13 @@ class SermondistributorModelPreachers extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6672] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6674] get the columns
// get the columns
$columns = $db->getTableColumns("#__sermondistributor_preacher");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6678] remove the headers you don't import/export.
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -305,7 +307,7 @@ class SermondistributorModelPreachers extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9506] Compile the store id.
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -326,15 +328,15 @@ class SermondistributorModelPreachers extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 9899] Get set check in time
// Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 9904] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 9906] reset query
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_preacher'));
@ -342,24 +344,24 @@ class SermondistributorModelPreachers extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 9914] Get Yesterdays date
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 9916] reset query
// reset query
$query = $db->getQuery(true);
// [Interpretation 9918] Fields to update.
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 9923] Conditions for which records should be updated.
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 9928] Check table
// Check table
$query->update($db->quoteName('#__sermondistributor_preacher'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.php
@ -113,29 +113,29 @@ class SermondistributorModelSeries extends JModelAdmin
*/
public function getVwcsermons()
{
// [Interpretation 6337] Get the user object.
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6339] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6342] Select some fields
// Select some fields
$query->select('a.*');
$query->select($db->quoteName('c.title','category_title'));
// [Interpretation 6349] From the sermondistributor_sermon table
// From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [Interpretation 6986] From the sermondistributor_preacher table.
// From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 6986] From the sermondistributor_series table.
// From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 6365] Filter by seriesvvvx global.
// Filter by seriesvvvx global.
$seriesvvvx = $this->seriesvvvx;
if (is_numeric($seriesvvvx ))
{
@ -150,36 +150,36 @@ class SermondistributorModelSeries extends JModelAdmin
$query->where('a.series = -5');
}
// [Interpretation 6382] Join over the asset groups.
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6385] Filter by access level.
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6390] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6397] Order the results by ordering
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
// [Interpretation 6399] Load the items
// Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -193,14 +193,14 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 10224] set selection value to a translatable value
// set selection value to a translatable value
if (SermondistributorHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// [Interpretation 10231] convert link_type
// convert link_type
$item->link_type = $this->selectionTranslationVwcsermons($item->link_type, 'link_type');
// [Interpretation 10231] convert source
// convert source
$item->source = $this->selectionTranslationVwcsermons($item->source, 'source');
}
}
@ -217,20 +217,20 @@ class SermondistributorModelSeries extends JModelAdmin
*/
public function selectionTranslationVwcsermons($value,$name)
{
// [Interpretation 10257] Array of link_type language strings
// Array of link_type language strings
if ($name == 'link_type')
{
$link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
);
// [Interpretation 10288] Now check if value is found in this array
// Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{
return $link_typeArray[$value];
}
}
// [Interpretation 10257] Array of source language strings
// Array of source language strings
if ($name == 'source')
{
$sourceArray = array(
@ -239,7 +239,7 @@ class SermondistributorModelSeries extends JModelAdmin
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
);
// [Interpretation 10288] Now check if value is found in this array
// Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{
return $sourceArray[$value];
@ -259,7 +259,7 @@ class SermondistributorModelSeries extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 8889] Get the form.
{ // Get the form.
$form = $this->loadForm('com_sermondistributor.series', 'series', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -269,12 +269,12 @@ class SermondistributorModelSeries extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 8974] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 8979] The back end uses id so we use that the rest of the time and set it to 0 by default.
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
@ -282,54 +282,54 @@ class SermondistributorModelSeries extends JModelAdmin
$user = JFactory::getUser();
// [Interpretation 8985] Check for existing item.
// [Interpretation 8986] Modify the form based on Edit State access controls.
// Check for existing item.
// Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('series.edit.state', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.state', 'com_sermondistributor')))
{
// [Interpretation 8999] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9002] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9007] If this is a new item insure the greated by is set.
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9010] Set the created_by to this user
// Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9013] Modify the form based on Edit Creaded By access controls.
// Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('series.edit.created_by', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.created_by', 'com_sermondistributor')))
{
// [Interpretation 9025] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9027] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9029] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9032] Modify the form based on Edit Creaded Date access controls.
// Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('series.edit.created', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.created', 'com_sermondistributor')))
{
// [Interpretation 9044] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9046] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9079] Only load these values if no id is found
// Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9082] Set redirected field name
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9084] Set redirected field value
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9088] Now set the local-redirected field default value
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -366,7 +366,7 @@ class SermondistributorModelSeries extends JModelAdmin
}
$user = JFactory::getUser();
// [Interpretation 9210] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
return $user->authorise('series.delete', 'com_sermondistributor.series.' . (int) $record->id);
}
return false;
@ -388,14 +388,14 @@ class SermondistributorModelSeries extends JModelAdmin
if ($recordId)
{
// [Interpretation 9297] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('series.edit.state', 'com_sermondistributor.series.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9314] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return $user->authorise('series.edit.state', 'com_sermondistributor');
}
@ -410,7 +410,7 @@ class SermondistributorModelSeries extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9122] Check specific edit permission then general edit permission.
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('series.edit', 'com_sermondistributor.series.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('series.edit', 'com_sermondistributor');
@ -636,7 +636,7 @@ class SermondistributorModelSeries extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4183] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -650,12 +650,12 @@ class SermondistributorModelSeries extends JModelAdmin
return false;
}
// [Interpretation 4203] get list of uniqe fields
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4205] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4208] make sure published is set
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -667,21 +667,21 @@ class SermondistributorModelSeries extends JModelAdmin
$newIds = array();
// [Interpretation 4245] Parent exists so let's proceed
// Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4248] Pop the first ID off the stack
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4253] only allow copy if user may edit this item.
// only allow copy if user may edit this item.
if (!$this->user->authorise('series.edit', $contexts[$pk]))
{
// [Interpretation 4263] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -689,19 +689,19 @@ class SermondistributorModelSeries extends JModelAdmin
}
// [Interpretation 4268] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4273] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4280] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -709,7 +709,7 @@ class SermondistributorModelSeries extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// [Interpretation 4316] insert all set values
// insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -721,7 +721,7 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 4328] update all uniqe fields
// update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -730,13 +730,13 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 4337] Reset the ID because we are making a copy
// Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4340] TODO: Deal with ordering?
// [Interpretation 4341] $this->table->ordering = 1;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// [Interpretation 4343] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -749,7 +749,7 @@ class SermondistributorModelSeries extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4356] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -757,14 +757,14 @@ class SermondistributorModelSeries extends JModelAdmin
return false;
}
// [Interpretation 4364] Get the new item ID
// Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4367] Add the new ID to the array
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4371] Clean the cache
// Clean the cache
$this->cleanCache();
return $newIds;
@ -785,7 +785,7 @@ class SermondistributorModelSeries extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 3985] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -800,15 +800,15 @@ class SermondistributorModelSeries extends JModelAdmin
return false;
}
// [Interpretation 4007] make sure published only updates if user has the permission.
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('series.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4020] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4041] Parent exists so we proceed
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('series.edit', $contexts[$pk]))
@ -818,30 +818,30 @@ class SermondistributorModelSeries extends JModelAdmin
return false;
}
// [Interpretation 4058] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4063] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4070] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4076] insert all set values.
// insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4081] Do special action for access.
// Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -854,7 +854,7 @@ class SermondistributorModelSeries extends JModelAdmin
}
// [Interpretation 4093] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -867,7 +867,7 @@ class SermondistributorModelSeries extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4106] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -876,7 +876,7 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 4115] Clean the cache
// Clean the cache
$this->cleanCache();
return true;
@ -914,7 +914,7 @@ class SermondistributorModelSeries extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4397] Alter the name for save as copy
// Alter the name for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
@ -937,7 +937,7 @@ class SermondistributorModelSeries extends JModelAdmin
$data['published'] = 0;
}
// [Interpretation 4424] Automatic handling of alias for empty fields
// Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{
if ($data['alias'] == null)
@ -968,10 +968,10 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 4463] Alter the uniqe field for save as copy
// Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4466] Automatic handling of other uniqe fields
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -1025,7 +1025,7 @@ class SermondistributorModelSeries extends JModelAdmin
protected function _generateNewTitle($alias, $title)
{
// [Interpretation 4497] Alter the title & alias
// Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series_list.php
@ -97,16 +97,16 @@ class SermondistributorModelSeries_list extends JModelList
*/
public function getItems()
{
// [Interpretation 9883] check in items
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -131,19 +131,19 @@ class SermondistributorModelSeries_list extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 6833] Get the user object.
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6835] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6838] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6845] From the sermondistributor_item table
// From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_series', 'a'));
// [Interpretation 6859] Filter by published state
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -154,21 +154,21 @@ class SermondistributorModelSeries_list extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 6871] Join over the asset groups.
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6874] Filter by access level.
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6879] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6956] Filter by search.
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -184,7 +184,7 @@ class SermondistributorModelSeries_list extends JModelList
}
// [Interpretation 6915] Add the list ordering clause.
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -202,42 +202,44 @@ class SermondistributorModelSeries_list extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6623] setup the query
// setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6626] Get the user object.
// Set a value to know this is exporting method.
$_export = true;
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6628] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6631] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6633] From the sermondistributor_series table
// From the sermondistributor_series table
$query->from($db->quoteName('#__sermondistributor_series', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6643] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6650] Order the results by ordering
// Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6652] Load the items
// Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -248,13 +250,13 @@ class SermondistributorModelSeries_list extends JModelList
continue;
}
// [Interpretation 10171] unset the values we don't want exported.
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10180] Add headers to items array.
// Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -273,13 +275,13 @@ class SermondistributorModelSeries_list extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6672] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6674] get the columns
// get the columns
$columns = $db->getTableColumns("#__sermondistributor_series");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6678] remove the headers you don't import/export.
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -301,7 +303,7 @@ class SermondistributorModelSeries_list extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9506] Compile the store id.
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -321,15 +323,15 @@ class SermondistributorModelSeries_list extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 9899] Get set check in time
// Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 9904] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 9906] reset query
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_series'));
@ -337,24 +339,24 @@ class SermondistributorModelSeries_list extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 9914] Get Yesterdays date
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 9916] reset query
// reset query
$query = $db->getQuery(true);
// [Interpretation 9918] Fields to update.
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 9923] Conditions for which records should be updated.
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 9928] Check table
// Check table
$query->update($db->quoteName('#__sermondistributor_series'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.php
@ -97,13 +97,13 @@ class SermondistributorModelSermon extends JModelAdmin
if (!empty($item->local_files))
{
// [Interpretation 3187] JSON Decode local_files.
// JSON Decode local_files.
$item->local_files = json_decode($item->local_files);
}
if (!empty($item->manual_files))
{
// [Interpretation 3187] JSON Decode manual_files.
// JSON Decode manual_files.
$item->manual_files = json_decode($item->manual_files);
}
@ -125,31 +125,31 @@ class SermondistributorModelSermon extends JModelAdmin
*/
public function getVwbstastics()
{
// [Interpretation 6337] Get the user object.
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6339] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6342] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6349] From the sermondistributor_statistic table
// From the sermondistributor_statistic table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// [Interpretation 6986] From the sermondistributor_sermon table.
// From the sermondistributor_sermon table.
$query->select($db->quoteName('g.name','sermon_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_sermon', 'g') . ' ON (' . $db->quoteName('a.sermon') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 6986] From the sermondistributor_preacher table.
// From the sermondistributor_preacher table.
$query->select($db->quoteName('h.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'h') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 6986] From the sermondistributor_series table.
// From the sermondistributor_series table.
$query->select($db->quoteName('i.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'i') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('i.id') . ')');
// [Interpretation 6365] Filter by sermonvvvw global.
// Filter by sermonvvvw global.
$sermonvvvw = $this->sermonvvvw;
if (is_numeric($sermonvvvw ))
{
@ -164,36 +164,36 @@ class SermondistributorModelSermon extends JModelAdmin
$query->where('a.sermon = -5');
}
// [Interpretation 6382] Join over the asset groups.
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6385] Filter by access level.
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6390] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6397] Order the results by ordering
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
// [Interpretation 6399] Load the items
// Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -222,7 +222,7 @@ class SermondistributorModelSermon extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 8889] Get the form.
{ // Get the form.
$form = $this->loadForm('com_sermondistributor.sermon', 'sermon', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -232,17 +232,17 @@ class SermondistributorModelSermon extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 8916] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 8921] The back end uses id so we use that the rest of the time and set it to 0 by default.
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
}
// [Interpretation 8926] Determine correct permissions to check.
// Determine correct permissions to check.
if ($this->getState('sermon.id'))
{
$id = $this->getState('sermon.id');
@ -250,74 +250,74 @@ class SermondistributorModelSermon extends JModelAdmin
$catid = 0;
if (isset($this->getItem($id)->catid))
{
// [Interpretation 8933] set catagory id
// set catagory id
$catid = $this->getItem($id)->catid;
// [Interpretation 8935] Existing record. Can only edit in selected categories.
// Existing record. Can only edit in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.edit');
// [Interpretation 8937] Existing record. Can only edit own items in selected categories.
// Existing record. Can only edit own items in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.edit.own');
}
}
else
{
// [Interpretation 8943] New record. Can only create in selected categories.
// New record. Can only create in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.create');
}
$user = JFactory::getUser();
// [Interpretation 8947] Check for existing item.
// [Interpretation 8948] Modify the form based on Edit State access controls.
// Check for existing item.
// Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.state', 'com_sermondistributor.sermon.' . (int) $id))
|| (isset($catid) && $catid != 0 && !$user->authorise('core.edit.state', 'com_sermondistributor.sermons.category.' . (int) $catid))
|| ($id == 0 && !$user->authorise('sermon.edit.state', 'com_sermondistributor')))
{
// [Interpretation 8963] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 8966] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9007] If this is a new item insure the greated by is set.
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9010] Set the created_by to this user
// Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9013] Modify the form based on Edit Creaded By access controls.
// Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.created_by', 'com_sermondistributor.sermon.' . (int) $id))
|| ($id == 0 && !$user->authorise('sermon.edit.created_by', 'com_sermondistributor')))
{
// [Interpretation 9025] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9027] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9029] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9032] Modify the form based on Edit Creaded Date access controls.
// Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.created', 'com_sermondistributor.sermon.' . (int) $id))
|| ($id == 0 && !$user->authorise('sermon.edit.created', 'com_sermondistributor')))
{
// [Interpretation 9044] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9046] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9079] Only load these values if no id is found
// Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9082] Set redirected field name
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9084] Set redirected field value
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9088] Now set the local-redirected field default value
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -358,7 +358,7 @@ class SermondistributorModelSermon extends JModelAdmin
if ($allow)
{
// [Interpretation 9181] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
return $user->authorise('sermon.delete', 'com_sermondistributor.sermon.' . (int) $record->id);
}
return $allow;
@ -382,14 +382,14 @@ class SermondistributorModelSermon extends JModelAdmin
if ($recordId)
{
// [Interpretation 9254] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('sermon.edit.state', 'com_sermondistributor.sermon.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9270] Check against the category.
// Check against the category.
if (!empty($record->catid))
{
$catpermission = $user->authorise('core.edit.state', 'com_sermondistributor.sermons.category.' . (int) $record->catid);
@ -398,7 +398,7 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
}
// [Interpretation 9281] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return $user->authorise('sermon.edit.state', 'com_sermondistributor');
}
@ -413,7 +413,7 @@ class SermondistributorModelSermon extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9122] Check specific edit permission then general edit permission.
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('sermon.edit', 'com_sermondistributor.sermon.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('sermon.edit', 'com_sermondistributor');
@ -512,20 +512,20 @@ class SermondistributorModelSermon extends JModelAdmin
*/
public function validate($form, $data, $group = null)
{
// [Interpretation 8088] check if the not_required field is set
// check if the not_required field is set
if (SermondistributorHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
// [Interpretation 8093] now change the required field attributes value
// now change the required field attributes value
foreach ($requiredFields as $requiredField)
{
// [Interpretation 8096] make sure there is a string value
// make sure there is a string value
if (SermondistributorHelper::checkString($requiredField))
{
// [Interpretation 8099] change to false
// change to false
$form->setFieldAttribute($requiredField, 'required', 'false');
// [Interpretation 8101] also clear the data set
// also clear the data set
$data[$requiredField] = '';
}
}
@ -675,7 +675,7 @@ class SermondistributorModelSermon extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4183] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -689,12 +689,12 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
// [Interpretation 4203] get list of uniqe fields
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4205] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4208] make sure published is set
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -710,7 +710,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
elseif (isset($values['category']) && (int) $values['category'] > 0)
{
// [Interpretation 4233] move the category value to correct field name
// move the category value to correct field name
$values['catid'] = $values['category'];
unset($values['category']);
}
@ -721,21 +721,21 @@ class SermondistributorModelSermon extends JModelAdmin
$newIds = array();
// [Interpretation 4245] Parent exists so let's proceed
// Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4248] Pop the first ID off the stack
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4253] only allow copy if user may edit this item.
// only allow copy if user may edit this item.
if (!$this->user->authorise('sermon.edit', $contexts[$pk]))
{
// [Interpretation 4263] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -743,19 +743,19 @@ class SermondistributorModelSermon extends JModelAdmin
}
// [Interpretation 4268] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4273] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4280] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -770,7 +770,7 @@ class SermondistributorModelSermon extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->generateNewTitle($this->table->catid, $this->table->alias, $this->table->name);
}
// [Interpretation 4316] insert all set values
// insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -782,7 +782,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
}
// [Interpretation 4328] update all uniqe fields
// update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -791,13 +791,13 @@ class SermondistributorModelSermon extends JModelAdmin
}
}
// [Interpretation 4337] Reset the ID because we are making a copy
// Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4340] TODO: Deal with ordering?
// [Interpretation 4341] $this->table->ordering = 1;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// [Interpretation 4343] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -810,7 +810,7 @@ class SermondistributorModelSermon extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4356] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -818,14 +818,14 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
// [Interpretation 4364] Get the new item ID
// Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4367] Add the new ID to the array
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4371] Clean the cache
// Clean the cache
$this->cleanCache();
return $newIds;
@ -846,7 +846,7 @@ class SermondistributorModelSermon extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 3985] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -861,12 +861,12 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
// [Interpretation 4007] make sure published only updates if user has the permission.
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('sermon.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4020] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
if (isset($values['category']) && (int) $values['category'] > 0 && !static::checkCategoryId($values['category']))
@ -875,7 +875,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
elseif (isset($values['category']) && (int) $values['category'] > 0)
{
// [Interpretation 4031] move the category value to correct field name
// move the category value to correct field name
$values['catid'] = $values['category'];
unset($values['category']);
}
@ -885,7 +885,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
// [Interpretation 4041] Parent exists so we proceed
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('sermon.edit', $contexts[$pk]))
@ -895,30 +895,30 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
// [Interpretation 4058] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4063] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4070] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4076] insert all set values.
// insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4081] Do special action for access.
// Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -931,7 +931,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
// [Interpretation 4093] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -944,7 +944,7 @@ class SermondistributorModelSermon extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4106] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -953,7 +953,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
}
// [Interpretation 4115] Clean the cache
// Clean the cache
$this->cleanCache();
return true;
@ -983,13 +983,13 @@ class SermondistributorModelSermon extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// [Interpretation 3297] Set the local_files string to JSON string.
// Set the local_files string to JSON string.
if (isset($data['local_files']))
{
$data['local_files'] = (string) json_encode($data['local_files']);
}
// [Interpretation 3297] Set the manual_files string to JSON string.
// Set the manual_files string to JSON string.
if (isset($data['manual_files']))
{
$data['manual_files'] = (string) json_encode($data['manual_files']);
@ -1003,7 +1003,7 @@ class SermondistributorModelSermon extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4397] Alter the name for save as copy
// Alter the name for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
@ -1026,7 +1026,7 @@ class SermondistributorModelSermon extends JModelAdmin
$data['published'] = 0;
}
// [Interpretation 4424] Automatic handling of alias for empty fields
// Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{
if ($data['alias'] == null)
@ -1057,10 +1057,10 @@ class SermondistributorModelSermon extends JModelAdmin
}
}
// [Interpretation 4463] Alter the uniqe field for save as copy
// Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4466] Automatic handling of other uniqe fields
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -1114,7 +1114,7 @@ class SermondistributorModelSermon extends JModelAdmin
protected function _generateNewTitle($alias, $title)
{
// [Interpretation 4497] Alter the title & alias
// Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php
@ -45,7 +45,7 @@ class SermondistributorModelSermondistributor extends JModelList
$viewGroups = array(
'main' => array('png.preacher.add', 'png.preachers', 'png.sermon.add', 'png.sermons', 'png.sermons.catid', 'png.series.add', 'png.series_list', 'png.statistics', 'png.help_documents')
);
// [Interpretation 10340] view access array
// view access array
$viewAccess = array(
'preacher.create' => 'preacher.create',
'preachers.access' => 'preacher.access',

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.php
@ -129,16 +129,16 @@ class SermondistributorModelSermons extends JModelList
*/
public function getItems()
{
// [Interpretation 9883] check in items
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -152,14 +152,14 @@ class SermondistributorModelSermons extends JModelList
}
}
// [Interpretation 10224] set selection value to a translatable value
// set selection value to a translatable value
if (SermondistributorHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// [Interpretation 10231] convert link_type
// convert link_type
$item->link_type = $this->selectionTranslation($item->link_type, 'link_type');
// [Interpretation 10231] convert source
// convert source
$item->source = $this->selectionTranslation($item->source, 'source');
}
}
@ -176,20 +176,20 @@ class SermondistributorModelSermons extends JModelList
*/
public function selectionTranslation($value,$name)
{
// [Interpretation 10257] Array of link_type language strings
// Array of link_type language strings
if ($name == 'link_type')
{
$link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
);
// [Interpretation 10288] Now check if value is found in this array
// Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{
return $link_typeArray[$value];
}
}
// [Interpretation 10257] Array of source language strings
// Array of source language strings
if ($name == 'source')
{
$sourceArray = array(
@ -198,7 +198,7 @@ class SermondistributorModelSermons extends JModelList
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
);
// [Interpretation 10288] Now check if value is found in this array
// Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{
return $sourceArray[$value];
@ -214,29 +214,29 @@ class SermondistributorModelSermons extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 6833] Get the user object.
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6835] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6838] Select some fields
// Select some fields
$query->select('a.*');
$query->select($db->quoteName('c.title','category_title'));
// [Interpretation 6845] From the sermondistributor_item table
// From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [Interpretation 6986] From the sermondistributor_preacher table.
// From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 6986] From the sermondistributor_series table.
// From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 6859] Filter by published state
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -247,21 +247,21 @@ class SermondistributorModelSermons extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 6871] Join over the asset groups.
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6874] Filter by access level.
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6879] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6956] Filter by search.
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -276,28 +276,28 @@ class SermondistributorModelSermons extends JModelList
}
}
// [Interpretation 7072] Filter by preacher.
// Filter by preacher.
if ($preacher = $this->getState('filter.preacher'))
{
$query->where('a.preacher = ' . $db->quote($db->escape($preacher, true)));
}
// [Interpretation 7072] Filter by series.
// Filter by series.
if ($series = $this->getState('filter.series'))
{
$query->where('a.series = ' . $db->quote($db->escape($series, true)));
}
// [Interpretation 7081] Filter by Link_type.
// Filter by Link_type.
if ($link_type = $this->getState('filter.link_type'))
{
$query->where('a.link_type = ' . $db->quote($db->escape($link_type, true)));
}
// [Interpretation 7081] Filter by Source.
// Filter by Source.
if ($source = $this->getState('filter.source'))
{
$query->where('a.source = ' . $db->quote($db->escape($source, true)));
}
// [Interpretation 6893] Filter by a single or group of categories.
// Filter by a single or group of categories.
$baselevel = 1;
$categoryId = $this->getState('filter.category_id');
@ -319,7 +319,7 @@ class SermondistributorModelSermons extends JModelList
}
// [Interpretation 6915] Add the list ordering clause.
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -337,42 +337,44 @@ class SermondistributorModelSermons extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6623] setup the query
// setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6626] Get the user object.
// Set a value to know this is exporting method.
$_export = true;
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6628] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6631] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6633] From the sermondistributor_sermon table
// From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6643] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6650] Order the results by ordering
// Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6652] Load the items
// Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -383,13 +385,13 @@ class SermondistributorModelSermons extends JModelList
continue;
}
// [Interpretation 10171] unset the values we don't want exported.
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10180] Add headers to items array.
// Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -408,13 +410,13 @@ class SermondistributorModelSermons extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6672] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6674] get the columns
// get the columns
$columns = $db->getTableColumns("#__sermondistributor_sermon");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6678] remove the headers you don't import/export.
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -436,7 +438,7 @@ class SermondistributorModelSermons extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9506] Compile the store id.
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -464,15 +466,15 @@ class SermondistributorModelSermons extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 9899] Get set check in time
// Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 9904] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 9906] reset query
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_sermon'));
@ -480,24 +482,24 @@ class SermondistributorModelSermons extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 9914] Get Yesterdays date
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 9916] reset query
// reset query
$query = $db->getQuery(true);
// [Interpretation 9918] Fields to update.
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 9923] Conditions for which records should be updated.
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 9928] Check table
// Check table
$query->update($db->quoteName('#__sermondistributor_sermon'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.php
@ -116,7 +116,7 @@ class SermondistributorModelStatistic extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 8889] Get the form.
{ // Get the form.
$form = $this->loadForm('com_sermondistributor.statistic', 'statistic', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -126,12 +126,12 @@ class SermondistributorModelStatistic extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 8974] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 8979] The back end uses id so we use that the rest of the time and set it to 0 by default.
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
@ -139,54 +139,54 @@ class SermondistributorModelStatistic extends JModelAdmin
$user = JFactory::getUser();
// [Interpretation 8985] Check for existing item.
// [Interpretation 8986] Modify the form based on Edit State access controls.
// Check for existing item.
// Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.state', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.state', 'com_sermondistributor')))
{
// [Interpretation 8999] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9002] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9007] If this is a new item insure the greated by is set.
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9010] Set the created_by to this user
// Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9013] Modify the form based on Edit Creaded By access controls.
// Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.created_by', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.created_by', 'com_sermondistributor')))
{
// [Interpretation 9025] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9027] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9029] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9032] Modify the form based on Edit Creaded Date access controls.
// Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.created', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.created', 'com_sermondistributor')))
{
// [Interpretation 9044] Disable fields for display.
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9046] Disable fields while saving.
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9079] Only load these values if no id is found
// Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9082] Set redirected field name
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9084] Set redirected field value
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9088] Now set the local-redirected field default value
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -223,7 +223,7 @@ class SermondistributorModelStatistic extends JModelAdmin
}
$user = JFactory::getUser();
// [Interpretation 9210] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
return $user->authorise('statistic.delete', 'com_sermondistributor.statistic.' . (int) $record->id);
}
return false;
@ -245,14 +245,14 @@ class SermondistributorModelStatistic extends JModelAdmin
if ($recordId)
{
// [Interpretation 9297] The record has been set. Check the record permissions.
// The record has been set. Check the record permissions.
$permission = $user->authorise('statistic.edit.state', 'com_sermondistributor.statistic.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9314] In the absense of better information, revert to the component permissions.
// In the absense of better information, revert to the component permissions.
return $user->authorise('statistic.edit.state', 'com_sermondistributor');
}
@ -267,7 +267,7 @@ class SermondistributorModelStatistic extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9122] Check specific edit permission then general edit permission.
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('statistic.edit', 'com_sermondistributor.statistic.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('statistic.edit', 'com_sermondistributor');
@ -493,7 +493,7 @@ class SermondistributorModelStatistic extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4183] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -507,12 +507,12 @@ class SermondistributorModelStatistic extends JModelAdmin
return false;
}
// [Interpretation 4203] get list of uniqe fields
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4205] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4208] make sure published is set
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -524,21 +524,21 @@ class SermondistributorModelStatistic extends JModelAdmin
$newIds = array();
// [Interpretation 4245] Parent exists so let's proceed
// Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4248] Pop the first ID off the stack
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4253] only allow copy if user may edit this item.
// only allow copy if user may edit this item.
if (!$this->user->authorise('statistic.edit', $contexts[$pk]))
{
// [Interpretation 4263] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -546,19 +546,19 @@ class SermondistributorModelStatistic extends JModelAdmin
}
// [Interpretation 4268] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4273] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4280] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -566,7 +566,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->table->filename = $this->generateUniqe('filename',$this->table->filename);
// [Interpretation 4316] insert all set values
// insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -578,7 +578,7 @@ class SermondistributorModelStatistic extends JModelAdmin
}
}
// [Interpretation 4328] update all uniqe fields
// update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -587,13 +587,13 @@ class SermondistributorModelStatistic extends JModelAdmin
}
}
// [Interpretation 4337] Reset the ID because we are making a copy
// Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4340] TODO: Deal with ordering?
// [Interpretation 4341] $this->table->ordering = 1;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// [Interpretation 4343] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -606,7 +606,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4356] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -614,14 +614,14 @@ class SermondistributorModelStatistic extends JModelAdmin
return false;
}
// [Interpretation 4364] Get the new item ID
// Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4367] Add the new ID to the array
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4371] Clean the cache
// Clean the cache
$this->cleanCache();
return $newIds;
@ -642,7 +642,7 @@ class SermondistributorModelStatistic extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 3985] Set some needed variables.
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -657,15 +657,15 @@ class SermondistributorModelStatistic extends JModelAdmin
return false;
}
// [Interpretation 4007] make sure published only updates if user has the permission.
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('statistic.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4020] remove move_copy from array
// remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4041] Parent exists so we proceed
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('statistic.edit', $contexts[$pk]))
@ -675,30 +675,30 @@ class SermondistributorModelStatistic extends JModelAdmin
return false;
}
// [Interpretation 4058] Check that the row actually exists
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4063] Fatal error
// Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4070] Not fatal error
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4076] insert all set values.
// insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4081] Do special action for access.
// Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -711,7 +711,7 @@ class SermondistributorModelStatistic extends JModelAdmin
}
// [Interpretation 4093] Check the row.
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -724,7 +724,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4106] Store the row.
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -733,7 +733,7 @@ class SermondistributorModelStatistic extends JModelAdmin
}
}
// [Interpretation 4115] Clean the cache
// Clean the cache
$this->cleanCache();
return true;
@ -771,10 +771,10 @@ class SermondistributorModelStatistic extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4463] Alter the uniqe field for save as copy
// Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4466] Automatic handling of other uniqe fields
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -827,7 +827,7 @@ class SermondistributorModelStatistic extends JModelAdmin
protected function _generateNewTitle($title)
{
// [Interpretation 4521] Alter the title
// Alter the title
$table = $this->getTable();
while ($table->load(array('title' => $title)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistics.php
@ -113,16 +113,16 @@ class SermondistributorModelStatistics extends JModelList
*/
public function getItems()
{
// [Interpretation 9883] check in items
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -147,31 +147,31 @@ class SermondistributorModelStatistics extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 6833] Get the user object.
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6835] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6838] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6845] From the sermondistributor_item table
// From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// [Interpretation 6986] From the sermondistributor_sermon table.
// From the sermondistributor_sermon table.
$query->select($db->quoteName('g.name','sermon_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_sermon', 'g') . ' ON (' . $db->quoteName('a.sermon') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 6986] From the sermondistributor_preacher table.
// From the sermondistributor_preacher table.
$query->select($db->quoteName('h.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'h') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 6986] From the sermondistributor_series table.
// From the sermondistributor_series table.
$query->select($db->quoteName('i.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'i') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('i.id') . ')');
// [Interpretation 6859] Filter by published state
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -182,21 +182,21 @@ class SermondistributorModelStatistics extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 6871] Join over the asset groups.
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6874] Filter by access level.
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6879] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6956] Filter by search.
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -211,23 +211,23 @@ class SermondistributorModelStatistics extends JModelList
}
}
// [Interpretation 7072] Filter by sermon.
// Filter by sermon.
if ($sermon = $this->getState('filter.sermon'))
{
$query->where('a.sermon = ' . $db->quote($db->escape($sermon, true)));
}
// [Interpretation 7072] Filter by preacher.
// Filter by preacher.
if ($preacher = $this->getState('filter.preacher'))
{
$query->where('a.preacher = ' . $db->quote($db->escape($preacher, true)));
}
// [Interpretation 7072] Filter by series.
// Filter by series.
if ($series = $this->getState('filter.series'))
{
$query->where('a.series = ' . $db->quote($db->escape($series, true)));
}
// [Interpretation 6915] Add the list ordering clause.
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -245,42 +245,44 @@ class SermondistributorModelStatistics extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6623] setup the query
// setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6626] Get the user object.
// Set a value to know this is exporting method.
$_export = true;
// Get the user object.
$user = JFactory::getUser();
// [Interpretation 6628] Create a new query object.
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6631] Select some fields
// Select some fields
$query->select('a.*');
// [Interpretation 6633] From the sermondistributor_statistic table
// From the sermondistributor_statistic table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6643] Implement View Level Access
// Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6650] Order the results by ordering
// Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6652] Load the items
// Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 9958] set values to display correctly.
// set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 9961] get user object.
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -291,13 +293,13 @@ class SermondistributorModelStatistics extends JModelList
continue;
}
// [Interpretation 10171] unset the values we don't want exported.
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10180] Add headers to items array.
// Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -316,13 +318,13 @@ class SermondistributorModelStatistics extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6672] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6674] get the columns
// get the columns
$columns = $db->getTableColumns("#__sermondistributor_statistic");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6678] remove the headers you don't import/export.
// remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -344,7 +346,7 @@ class SermondistributorModelStatistics extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9506] Compile the store id.
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -368,15 +370,15 @@ class SermondistributorModelStatistics extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 9899] Get set check in time
// Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 9904] Get a db connection.
// Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 9906] reset query
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_statistic'));
@ -384,24 +386,24 @@ class SermondistributorModelStatistics extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 9914] Get Yesterdays date
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 9916] reset query
// reset query
$query = $db->getQuery(true);
// [Interpretation 9918] Fields to update.
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 9923] Conditions for which records should be updated.
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 9928] Check table
// Check table
$query->update($db->quoteName('#__sermondistributor_statistic'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@version 1.3.4
@build 16th July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php
@ -29,7 +29,7 @@ defined('_JEXEC') or die('Restricted access');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_sermondistributor'))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
return JError::raiseWaring(404, JText::_('JERROR_ALERTNOAUTHOR'));
};
// Load cms libraries
@ -43,7 +43,7 @@ $document->addStyleSheet('components/com_sermondistributor/assets/css/admin.css'
$document->addScript('components/com_sermondistributor/assets/js/admin.js');
// require helper files
JLoader::register('SermondistributorHelper', dirname(__FILE__) . '/helpers/sermondistributor.php');
JLoader::register('SermondistributorHelper', dirname(__FILE__) . '/helpers/sermondistributor.php');
JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php');
// Triger the Global Admin Event

Some files were not shown because too many files have changed in this diff Show More