diff --git a/README.md b/README.md index 907bcad9..bb99e3c7 100644 --- a/README.md +++ b/README.md @@ -24,38 +24,38 @@ The best way to see all your options is to install this component on you Joomla + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Sermon Distributor](https://www.vdm.io/) + *First Build*: 22nd October, 2015 -+ *Last Build*: 16th August, 2021 ++ *Last Build*: 2nd March, 2022 + *Version*: 2.0.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ## Build Time :hourglass: -**204 Hours** or **26 Eight Hour Days** (actual time the author saved - +**206 Hours** or **26 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*: **73073** -+ *File count*: **460** -+ *Folder count*: **93** ++ *Line count*: **73932** ++ *File count*: **472** ++ *Folder count*: **99** -**134 Hours** or **16 Eight Hour Days** (the actual time the author spent) +**136 Hours** or **17 Eight Hour Days** (the actual time the author spent) > (with the following break down: -> **debugging @51hours** = codingtime / 4; +> **debugging @52hours** = codingtime / 4; > **planning @29hours** = codingtime / 7; -> **mapping @20hours** = codingtime / 10; +> **mapping @21hours** = codingtime / 10; > **office @34hours** = codingtime / 6;) -**338 Hours** or **42 Eight Hour Days** +**342 Hours** or **43 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > with the normal everyday realities at the office, that includes the component planning, mapping & debugging.) -Project duration: **8.4 weeks** or **1.8 months** +Project duration: **8.6 weeks** or **1.8 months** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 907bcad9..bb99e3c7 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -24,38 +24,38 @@ The best way to see all your options is to install this component on you Joomla + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Sermon Distributor](https://www.vdm.io/) + *First Build*: 22nd October, 2015 -+ *Last Build*: 16th August, 2021 ++ *Last Build*: 2nd March, 2022 + *Version*: 2.0.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ## Build Time :hourglass: -**204 Hours** or **26 Eight Hour Days** (actual time the author saved - +**206 Hours** or **26 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*: **73073** -+ *File count*: **460** -+ *Folder count*: **93** ++ *Line count*: **73932** ++ *File count*: **472** ++ *Folder count*: **99** -**134 Hours** or **16 Eight Hour Days** (the actual time the author spent) +**136 Hours** or **17 Eight Hour Days** (the actual time the author spent) > (with the following break down: -> **debugging @51hours** = codingtime / 4; +> **debugging @52hours** = codingtime / 4; > **planning @29hours** = codingtime / 7; -> **mapping @20hours** = codingtime / 10; +> **mapping @21hours** = codingtime / 10; > **office @34hours** = codingtime / 6;) -**338 Hours** or **42 Eight Hour Days** +**342 Hours** or **43 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > with the normal everyday realities at the office, that includes the component planning, mapping & debugging.) -Project duration: **8.4 weeks** or **1.8 months** +Project duration: **8.6 weeks** or **1.8 months** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/config.xml b/admin/config.xml index c2ad6c10..bbd532ef 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -60,8 +60,8 @@ last="50000" step="10" /> - - + + COM_SERMONDISTRIBUTOR_CONFIG_JPLAYER + COM_SERMONDISTRIBUTOR_CONFIG_HTML_5_BASIC
COM_SERMONDISTRIBUTOR_CONFIG_NO - - + + COM_SERMONDISTRIBUTOR_CONFIG_NO - - + + COM_SERMONDISTRIBUTOR_CONFIG_NO - - + + setMimeEncoding( 'application/json' ); - JResponse::setHeader('Content-Disposition','attachment;filename="getajax.json"'); - JResponse::setHeader("Access-Control-Allow-Origin", "*"); + // get the application + $app = JFactory::getApplication(); + $app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); + $app->setHeader('Access-Control-Allow-Origin', '*'); // load the tasks $this->registerTask('isNew', 'ajax'); $this->registerTask('isRead', 'ajax'); @@ -50,20 +52,26 @@ class SermondistributorControllerAjax extends JControllerLegacy public function ajax() { + // get the user for later use $user = JFactory::getUser(); + // get the input values $jinput = JFactory::getApplication()->input; + // check if we should return raw + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + // return to a callback function + $callback = $jinput->get('callback', null, 'CMD'); // Check Token! $token = JSession::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { + // get the task $task = $this->getTask(); switch($task) { case 'isNew': try { - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); $noticeValue = $jinput->get('notice', NULL, 'STRING'); if($noticeValue && $user->id != 0) { @@ -73,7 +81,7 @@ class SermondistributorControllerAjax extends JControllerLegacy { $result = false; } - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback . "(".json_encode($result).");"; } @@ -88,10 +96,14 @@ class SermondistributorControllerAjax extends JControllerLegacy } catch(Exception $e) { - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback."(".json_encode($e).");"; } + elseif($returnRaw) + { + echo json_encode($e); + } else { echo "(".json_encode($e).");"; @@ -101,7 +113,6 @@ class SermondistributorControllerAjax extends JControllerLegacy case 'isRead': try { - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); $noticeValue = $jinput->get('notice', NULL, 'STRING'); if($noticeValue && $user->id != 0) { @@ -111,7 +122,7 @@ class SermondistributorControllerAjax extends JControllerLegacy { $result = false; } - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback . "(".json_encode($result).");"; } @@ -126,10 +137,14 @@ class SermondistributorControllerAjax extends JControllerLegacy } catch(Exception $e) { - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback."(".json_encode($e).");"; } + elseif($returnRaw) + { + echo json_encode($e); + } else { echo "(".json_encode($e).");"; @@ -139,7 +154,6 @@ class SermondistributorControllerAjax extends JControllerLegacy case 'getBuildTable': try { - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); $idNameValue = $jinput->get('idName', NULL, 'WORD'); $ojectValue = $jinput->get('oject', NULL, 'STRING'); if($idNameValue && $user->id != 0 && $ojectValue) @@ -150,7 +164,7 @@ class SermondistributorControllerAjax extends JControllerLegacy { $result = false; } - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback . "(".json_encode($result).");"; } @@ -165,10 +179,14 @@ class SermondistributorControllerAjax extends JControllerLegacy } catch(Exception $e) { - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback."(".json_encode($e).");"; } + elseif($returnRaw) + { + echo json_encode($e); + } else { echo "(".json_encode($e).");"; @@ -178,7 +196,6 @@ class SermondistributorControllerAjax extends JControllerLegacy case 'getSourceStatus': try { - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { @@ -188,7 +205,7 @@ class SermondistributorControllerAjax extends JControllerLegacy { $result = false; } - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback . "(".json_encode($result).");"; } @@ -203,10 +220,14 @@ class SermondistributorControllerAjax extends JControllerLegacy } catch(Exception $e) { - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback."(".json_encode($e).");"; } + elseif($returnRaw) + { + echo json_encode($e); + } else { echo "(".json_encode($e).");"; @@ -216,7 +237,6 @@ class SermondistributorControllerAjax extends JControllerLegacy case 'getCronPath': try { - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); $getTypeValue = $jinput->get('getType', NULL, 'WORD'); if($getTypeValue && $user->id != 0) { @@ -226,7 +246,7 @@ class SermondistributorControllerAjax extends JControllerLegacy { $result = false; } - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback . "(".json_encode($result).");"; } @@ -241,10 +261,14 @@ class SermondistributorControllerAjax extends JControllerLegacy } catch(Exception $e) { - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback."(".json_encode($e).");"; } + elseif($returnRaw) + { + echo json_encode($e); + } else { echo "(".json_encode($e).");"; @@ -254,7 +278,6 @@ class SermondistributorControllerAjax extends JControllerLegacy case 'updateLocalListingExternal': try { - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); $idValue = $jinput->get('id', NULL, 'INT'); $targetValue = $jinput->get('target', NULL, 'INT'); $typeValue = $jinput->get('type', NULL, 'INT'); @@ -267,7 +290,7 @@ class SermondistributorControllerAjax extends JControllerLegacy { $result = false; } - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback . "(".json_encode($result).");"; } @@ -282,10 +305,14 @@ class SermondistributorControllerAjax extends JControllerLegacy } catch(Exception $e) { - if($callback = $jinput->get('callback', null, 'CMD')) + if($callback) { echo $callback."(".json_encode($e).");"; } + elseif($returnRaw) + { + echo json_encode($e); + } else { echo "(".json_encode($e).");"; @@ -296,10 +323,15 @@ class SermondistributorControllerAjax extends JControllerLegacy } else { - if($callback = $jinput->get('callback', null, 'CMD')) + // return to a callback function + if($callback) { echo $callback."(".json_encode(false).");"; } + elseif($returnRaw) + { + echo json_encode(false); + } else { echo "(".json_encode(false).");"; diff --git a/admin/controllers/sermondistributor.php b/admin/controllers/sermondistributor.php index 996ce96e..3a5dc3ea 100644 --- a/admin/controllers/sermondistributor.php +++ b/admin/controllers/sermondistributor.php @@ -25,6 +25,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + + /** * Sermondistributor Controller */ diff --git a/admin/language/en-GB/en-GB.com_sermondistributor.ini b/admin/language/en-GB/en-GB.com_sermondistributor.ini index 54186df2..03ce1b09 100644 --- a/admin/language/en-GB/en-GB.com_sermondistributor.ini +++ b/admin/language/en-GB/en-GB.com_sermondistributor.ini @@ -136,7 +136,7 @@ COM_SERMONDISTRIBUTOR_CONFIG_GLOBAL_LABEL="Global" COM_SERMONDISTRIBUTOR_CONFIG_GRADIANT_LOAD="Gradient" COM_SERMONDISTRIBUTOR_CONFIG_GREEN="Green" COM_SERMONDISTRIBUTOR_CONFIG_GRID="Grid" -COM_SERMONDISTRIBUTOR_CONFIG_HTML_FIVE_BASIC="HTML 5 (basic)" +COM_SERMONDISTRIBUTOR_CONFIG_HTML_5_BASIC="HTML 5 (basic)" COM_SERMONDISTRIBUTOR_CONFIG_JPLAYER="jPlayer" COM_SERMONDISTRIBUTOR_CONFIG_LEGACY="Legacy" COM_SERMONDISTRIBUTOR_CONFIG_LINES="Lines" @@ -415,6 +415,8 @@ COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_N_ITEMS_UNPUBLISHED="%s External Sources COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_N_ITEMS_UNPUBLISHED_1="%s External Source unpublished." COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_SUBMENU="External Sources Submenu" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCES_SUBMENU_DESC="Allows the users in this group to submenu of external source" +COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_3G2=".3g2" +COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_3GP=".3gp" COM_SERMONDISTRIBUTOR_EXTERNAL_SOURCE_APICRONJOB_NOTE_DESCRIPTION="You must setup a cronjob that will update your local listing with the external sources.

USE THE FOLLOWING: loading...

Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677