first commit

This commit is contained in:
Llewellyn van der Merwe 2023-11-09 08:16:35 +02:00
commit 3c1695a7f9
Signed by: Llewellyn
GPG Key ID: A9201372263741E7
8 changed files with 157 additions and 0 deletions

56
getbibleloader.php Normal file
View File

@ -0,0 +1,56 @@
<?php
/*----------------------------------------------------------------------------------| io.vdm.dev |----/
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@package getBible.net
@created 3rd December, 2015
@author Llewellyn van der Merwe <https://getbible.net>
@git Get Bible <https://git.vdm.dev/getBible>
@github Get Bible <https://github.com/getBible>
@support Get Bible <https://git.vdm.dev/getBible/support>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Html\HTMLHelper;
/**
* System - GetBibleLoader plugin.
*
* @package GetBibleLoader
* @since 2.0.0
*/
class PlgSystemGetBibleLoader extends CMSPlugin
{
/**
* Application object
*
* @var CMSApplication
* @since 1.0.0
*/
protected $app;
/**
* This method is called before the head is compiled and allows manipulation of the head data.
* In this case, it's used to add a JavaScript file to the front end of the Joomla site.
*
* @return void
*
* @since 3.0.0
* @throws Exception on error.
*/
public function onBeforeCompileHead()
{
// Check if we are in the site application
if ($this->app->isClient('site')) {
HTMLHelper::_('script', 'https://cdn.jsdelivr.net/gh/getbible/loader@2.0.0/dist/js/getBible.min.js', ['version' => 'auto']);
}
}
}

28
getbibleloader.xml Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="4" group="system" method="upgrade">
<name>PLG_SYSTEM_GETBIBLELOADER</name>
<creationDate>9th November, 2023</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://getbible.net</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.0.0</version>
<description>PLG_SYSTEM_GETBIBLELOADER_XML_DESCRIPTION</description>
<!-- Scripts to run on installation -->
<scriptfile>script.php</scriptfile>
<!-- Language files -->
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.plg_system_getbibleloader.ini</language>
<language tag="en-GB">en-GB/en-GB.plg_system_getbibleloader.sys.ini</language>
</languages>
<!-- Plugin files -->
<files>
<filename plugin="getbibleloader">getbibleloader.php</filename>
<filename>index.html</filename>
<folder>language</folder>
</files>
</extension>

1
index.html Normal file
View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@ -0,0 +1,3 @@
PLG_SYSTEM_GETBIBLELOADER="System - GetBibleLoader"
PLG_SYSTEM_GETBIBLELOADER_DESCRIPTION="This plugin is used to load scripture on your website. So it adds https://cdn.jsdelivr.net/gh/getbible/loader@2.0.0/dist/js/getBible.min.js to the header of your website. See: https://getbible.net/biblekit for more details."
PLG_SYSTEM_GETBIBLELOADER_XML_DESCRIPTION="<h1>System - GetBibleLoader (v.2.0.0)</h1> <div style='clear: both;'></div><p>This plugin is used to load scripture on your website. So it adds https://cdn.jsdelivr.net/gh/getbible/loader@2.0.0/dist/js/getBible.min.js to the header of your website. See: https://getbible.net/biblekit for more details.</p><p>Created by <a href='https://getbible.net' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 26th July, 2023</small></p>"

View File

@ -0,0 +1,3 @@
PLG_SYSTEM_GETBIBLELOADER="System - GetBibleLoader"
PLG_SYSTEM_GETBIBLELOADER_DESCRIPTION="This plugin is used to load scripture on your website. So it adds https://cdn.jsdelivr.net/gh/getbible/loader@2.0.0/dist/js/getBible.min.js to the header of your website. See: https://getbible.net/biblekit for more details."
PLG_SYSTEM_GETBIBLELOADER_XML_DESCRIPTION="<h1>System - GetBibleLoader (v.2.0.0)</h1> <div style='clear: both;'></div><p>This plugin is used to load scripture on your website. So it adds https://cdn.jsdelivr.net/gh/getbible/loader@2.0.0/dist/js/getBible.min.js to the header of your website. See: https://getbible.net/biblekit for more details.</p><p>Created by <a href='https://getbible.net' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 26th July, 2023</small></p>"

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

1
language/index.html Normal file
View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

64
script.php Normal file
View File

@ -0,0 +1,64 @@
<?php
/*----------------------------------------------------------------------------------| io.vdm.dev |----/
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@package getBible.net
@created 3rd December, 2015
@author Llewellyn van der Merwe <https://getbible.net>
@git Get Bible <https://git.vdm.dev/getBible>
@github Get Bible <https://github.com/getBible>
@support Get Bible <https://git.vdm.dev/getBible/support>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* System - GetBibleLoader script file.
*
* @package PlgSystemGetBibleLoader
*/
class plgSystemGetBibleLoaderInstallerScript
{
/**
* Called before any type of action
*
* @param string $route Which action is happening (install|uninstall|discover_install|update)
* @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script
*
* @return boolean True on success
*/
public function preflight($route, $adapter)
{
// get application
$app = JFactory::getApplication();
// the default for both install and update
$jversion = new JVersion();
if (!$jversion->isCompatible('3.8.0'))
{
$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');
return false;
}
if ('install' === $route)
{
//
$jversion = new JVersion();
if (!$jversion->isCompatible('3.10.0')) {
$app->enqueueMessage('Please upgrade to at least Joomla! 3.10 before continuing!', 'error');
return false;
}
}
return true;
}
}