Update on v3.0.1 (beta for next version)

Here's an update on the current version, which includes changes towards the next release still in beta.
This commit is contained in:
Robot 2024-01-26 17:18:26 +02:00
parent 92add9d75d
commit 5751ca60f5
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
126 changed files with 1165 additions and 1036 deletions

View File

@ -18,24 +18,24 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Get Bible](https://getbible.net)
+ *First Build*: 3rd December, 2015
+ *Last Build*: 22nd January, 2024
+ *Last Build*: 26th January, 2024
+ *Version*: 3.0.1
+ *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
**568 Hours** or **71 Eight Hour Days** (actual time the author saved -
**569 Hours** or **71 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **203584**
+ *File count*: **1751**
+ *Folder count*: **167**
+ *Line count*: **203716**
+ *File count*: **1744**
+ *Folder count*: **165**
**375 Hours** or **47 Eight Hour Days** (the actual time the author spent)
**374 Hours** or **47 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @142hours** = codingtime / 4;

View File

@ -18,24 +18,24 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Get Bible](https://getbible.net)
+ *First Build*: 3rd December, 2015
+ *Last Build*: 22nd January, 2024
+ *Last Build*: 26th January, 2024
+ *Version*: 3.0.1
+ *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
**568 Hours** or **71 Eight Hour Days** (actual time the author saved -
**569 Hours** or **71 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **203584**
+ *File count*: **1751**
+ *Folder count*: **167**
+ *Line count*: **203716**
+ *File count*: **1744**
+ *Folder count*: **165**
**375 Hours** or **47 Eight Hour Days** (the actual time the author spent)
**374 Hours** or **47 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @142hours** = codingtime / 4;

View File

@ -174,59 +174,6 @@
readonly="true"
class="readonly"
/>
<field type="spacer" name="spacerContributor1" hr="true" />
<field name="contributor1"
type="spacer"
class="text"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_ONE"
/>
<field name="titleContributor1"
type="text"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_TITLE_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_TITLE_DESC"
size="60"
default="Modules"
/>
<field name="nameContributor1"
type="text"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_NAME_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_NAME_DESC"
size="60"
default="CrossWire"
/>
<field name="emailContributor1"
type="email"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_EMAIL_DESC"
size="60"
default="sword-support@crosswire.org"
/>
<field name="linkContributor1"
type="url"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_LINK_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_LINK_DESC"
size="60"
default="https://wiki.crosswire.org/"
/>
<field name="useContributor1"
type="list"
default="2"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_DESC">
<option value="0">COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_NONE</option>
<option value="1">COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
<option value="2">COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_WWW</option>
</field>
<field name="showContributor1"
type="list"
default="3"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_DESC">
<option value="0">COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
<option value="1">COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
<option value="2">COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
<option value="3">COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
</field>
</fieldset>
<fieldset
name="uikit_config"

View File

@ -69,7 +69,15 @@ class GetbibleControllerAjax extends BaseController
$noticeValue = $jinput->get('notice', NULL, 'STRING');
if($noticeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->isNew($noticeValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->isNew($noticeValue);
}
else
{
$result = false;
}
}
else
{
@ -110,7 +118,15 @@ class GetbibleControllerAjax extends BaseController
$noticeValue = $jinput->get('notice', NULL, 'STRING');
if($noticeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->isRead($noticeValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->isRead($noticeValue);
}
else
{
$result = false;
}
}
else
{
@ -151,7 +167,15 @@ class GetbibleControllerAjax extends BaseController
$nameValue = $jinput->get('name', NULL, 'WORD');
if($nameValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getWiki($nameValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->getWiki($nameValue);
}
else
{
$result = false;
}
}
else
{
@ -192,7 +216,15 @@ class GetbibleControllerAjax extends BaseController
$versionValue = $jinput->get('version', NULL, 'INT');
if($versionValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getVersion($versionValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->getVersion($versionValue);
}
else
{
$result = false;
}
}
else
{

View File

@ -254,26 +254,6 @@ COM_GETBIBLE_CONFIG_CHECK_TIMER_OPTION_TWO="Every twelve hours"
COM_GETBIBLE_CONFIG_CLASS_HINT="Blank for none"
COM_GETBIBLE_CONFIG_CLASS_LABEL="Class"
COM_GETBIBLE_CONFIG_CLASS_MESSAGE="Error! Please add some Class here."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_EMAIL_DESC="The email of this contributor."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_EMAIL_LABEL="Contributor Email"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_LINK_DESC="The link to this contributor's website."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_LINK_LABEL="Contributor Website"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_NAME_DESC="The name of this contributor."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_NAME_LABEL="Contributor Name"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_ONE="Contributor One"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_ALL="Both Front & Back-end"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_BACK="Back-end"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_DESC="Select where you want this contributor's details to show in the component."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_FRONT="Front-end"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_LABEL="Show"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_NONE="Hide"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_TITLE_DESC="The job title that best describes the contributor's relationship to this component."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_TITLE_LABEL="Contributor Job Title"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_DESC="How should we link to this contributor."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_EMAIL="Email"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_LABEL="Use"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_NONE="None"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_WWW="Website"
COM_GETBIBLE_CONFIG_CUSTOM_ICONS_DESCRIPTION="Use this option to set custom icons found at https://getuikit.com/docs/icon"
COM_GETBIBLE_CONFIG_CUSTOM_ICONS_LABEL="Set Custom Icons"
COM_GETBIBLE_CONFIG_CUSTOM_TABS_LABEL="Custom Tabs"

View File

@ -103,9 +103,6 @@ COM_GETBIBLE_LINKERS_EDIT_STATE_DESC="Allows the users in this group to update t
COM_GETBIBLE_LINKERS_SUBMENU="Linkers Submenu"
COM_GETBIBLE_LINKERS_SUBMENU_DESC="Allows the users in this group to submenu of linker"
COM_GETBIBLE_MENU="Get Bible"
COM_GETBIBLE_MENU_API_DESC="Api"
COM_GETBIBLE_MENU_API_OPTION="Api"
COM_GETBIBLE_MENU_API_TITLE="Api"
COM_GETBIBLE_MENU_APP_DESC="App"
COM_GETBIBLE_MENU_APP_OPTION="App"
COM_GETBIBLE_MENU_APP_TITLE="App"

View File

@ -22,6 +22,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
// set the defaults
$items = $displayData->vvwnotes;
@ -62,7 +63,7 @@ $can = GetbibleHelper::getActions('note');
<a class="btn btn-small" onclick="Joomla.submitbutton('linker.cancel');" href="<?php echo $close_new; ?>"><span class="icon-new"></span> <?php echo Text::_('COM_GETBIBLE_CLOSE_NEW'); ?></a>
</div><br /><br />
<?php endif; ?>
<?php if (GetbibleHelper::checkArray($items)): ?>
<?php if (ArrayHelper::check($items)): ?>
<table class="footable table data notes" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<thead>
<tr>

View File

@ -22,6 +22,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
// set the defaults
$items = $displayData->vvxpasswords;
@ -62,7 +63,7 @@ $can = GetbibleHelper::getActions('password');
<a class="btn btn-small" onclick="Joomla.submitbutton('linker.cancel');" href="<?php echo $close_new; ?>"><span class="icon-new"></span> <?php echo Text::_('COM_GETBIBLE_CLOSE_NEW'); ?></a>
</div><br /><br />
<?php endif; ?>
<?php if (GetbibleHelper::checkArray($items)): ?>
<?php if (ArrayHelper::check($items)): ?>
<table class="footable table data passwords" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<thead>
<tr>

View File

@ -22,6 +22,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
// set the defaults
$items = $displayData->vvvtags;
@ -62,7 +63,7 @@ $can = GetbibleHelper::getActions('tagged_verse');
<a class="btn btn-small" onclick="Joomla.submitbutton('linker.cancel');" href="<?php echo $close_new; ?>"><span class="icon-new"></span> <?php echo Text::_('COM_GETBIBLE_CLOSE_NEW'); ?></a>
</div><br /><br />
<?php endif; ?>
<?php if (GetbibleHelper::checkArray($items)): ?>
<?php if (ArrayHelper::check($items)): ?>
<table class="footable table data tagged_verses" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<thead>
<tr>

View File

@ -22,6 +22,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\ArrayHelper;
// set the defaults
$items = $displayData->vvymessage;
@ -50,7 +51,7 @@ else
?>
<div class="form-vertical">
<?php if (GetbibleHelper::checkArray($items)): ?>
<?php if (ArrayHelper::check($items)): ?>
<table class="footable table data open_ai_messages" data-show-toggle="true" data-toggle-column="first" data-sorting="true" data-paging="true" data-paging-size="20" data-filtering="true">
<thead>
<tr>

View File

@ -201,17 +201,17 @@ class GetbibleModelAjax extends ListModel
$wiki = GiteaFactory::_('Gitea.Repository.Wiki')->get('getBible', 'support', $name);
// now render the page in HTML
$page = $wiki->content;
$page = $wiki->content ?? null;
}
catch (DomainException $e)
catch (\DomainException $e)
{
return $this->getTokenForWiki($e->getMessage());
}
catch (InvalidArgumentException $e)
catch (\InvalidArgumentException $e)
{
return $this->getTokenForWiki($e->getMessage());
}
catch (Exception $e)
catch (\Exception $e)
{
return $this->getTokenForWiki($e->getMessage());
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -29,6 +30,7 @@ use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
/**
@ -683,13 +685,13 @@ class GetbibleModelBook extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->name) && !is_numeric($this->table->name))
if (UtilitiesStringHelper::check($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUnique('name',$this->table->name);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -701,7 +703,7 @@ class GetbibleModelBook extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -812,7 +814,7 @@ class GetbibleModelBook extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -206,7 +206,7 @@ class GetbibleModelBooks extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -247,7 +247,7 @@ class GetbibleModelBooks extends ListModel
$query->where('a.name = ' . (int) $_name);
}
}
elseif (GetbibleHelper::checkString($_name))
elseif (StringHelper::check($_name))
{
$query->where('a.name = ' . $db->quote($db->escape($_name)));
}
@ -264,10 +264,33 @@ class GetbibleModelBooks extends ListModel
$query->where('a.abbreviation = ' . (int) $_abbreviation);
}
}
elseif (GetbibleHelper::checkString($_abbreviation))
elseif (StringHelper::check($_abbreviation))
{
$query->where('a.abbreviation = ' . $db->quote($db->escape($_abbreviation)));
}
elseif (UtilitiesArrayHelper::check($_abbreviation))
{
// Secure the array for the query
$_abbreviation = array_map( function ($val) use(&$db) {
if (is_numeric($val))
{
if (is_float($val))
{
return (float) $val;
}
else
{
return (int) $val;
}
}
elseif (StringHelper::check($val))
{
return $db->quote($db->escape($val));
}
}, $_abbreviation);
// Filter by the Abbreviation Array.
$query->where('a.abbreviation IN (' . implode(',', $_abbreviation) . ')');
}
// Filter by Nr.
$_nr = $this->getState('filter.nr');
if (is_numeric($_nr))
@ -281,16 +304,18 @@ class GetbibleModelBooks extends ListModel
$query->where('a.nr = ' . (int) $_nr);
}
}
elseif (GetbibleHelper::checkString($_nr))
elseif (StringHelper::check($_nr))
{
$query->where('a.nr = ' . $db->quote($db->escape($_nr)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'g.translation');
$orderDirn = $this->state->get('list.direction', 'asc');
$orderCol = $this->getState('list.ordering', 'g.translation');
$orderDirn = $this->getState('list.direction', 'asc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'asc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -328,7 +353,18 @@ class GetbibleModelBooks extends ListModel
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');
$id .= ':' . $this->getState('filter.name');
$id .= ':' . $this->getState('filter.abbreviation');
// Check if the value is an array
$_abbreviation = $this->getState('filter.abbreviation');
if (UtilitiesArrayHelper::check($_abbreviation))
{
$id .= ':' . implode(':', $_abbreviation);
}
// Check if this is only an number or string
elseif (is_numeric($_abbreviation)
|| StringHelper::check($_abbreviation))
{
$id .= ':' . $_abbreviation;
}
$id .= ':' . $this->getState('filter.nr');
return parent::getStoreId($id);
@ -337,17 +373,16 @@ class GetbibleModelBooks extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -382,7 +417,7 @@ class GetbibleModelBooks extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -29,6 +30,7 @@ use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
/**
@ -701,13 +703,13 @@ class GetbibleModelChapter extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->name) && !is_numeric($this->table->name))
if (UtilitiesStringHelper::check($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUnique('name',$this->table->name);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -719,7 +721,7 @@ class GetbibleModelChapter extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -830,7 +832,7 @@ class GetbibleModelChapter extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -214,7 +214,7 @@ class GetbibleModelChapters extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -255,11 +255,11 @@ class GetbibleModelChapters extends ListModel
$query->where('a.chapter = ' . (int) $_chapter);
}
}
elseif (GetbibleHelper::checkString($_chapter))
elseif (StringHelper::check($_chapter))
{
$query->where('a.chapter = ' . $db->quote($db->escape($_chapter)));
}
elseif (GetbibleHelper::checkArray($_chapter))
elseif (UtilitiesArrayHelper::check($_chapter))
{
// Secure the array for the query
$_chapter = array_map( function ($val) use(&$db) {
@ -274,7 +274,7 @@ class GetbibleModelChapters extends ListModel
return (int) $val;
}
}
elseif (GetbibleHelper::checkString($val))
elseif (StringHelper::check($val))
{
return $db->quote($db->escape($val));
}
@ -295,11 +295,11 @@ class GetbibleModelChapters extends ListModel
$query->where('a.book_nr = ' . (int) $_book_nr);
}
}
elseif (GetbibleHelper::checkString($_book_nr))
elseif (StringHelper::check($_book_nr))
{
$query->where('a.book_nr = ' . $db->quote($db->escape($_book_nr)));
}
elseif (GetbibleHelper::checkArray($_book_nr))
elseif (UtilitiesArrayHelper::check($_book_nr))
{
// Secure the array for the query
$_book_nr = array_map( function ($val) use(&$db) {
@ -314,7 +314,7 @@ class GetbibleModelChapters extends ListModel
return (int) $val;
}
}
elseif (GetbibleHelper::checkString($val))
elseif (StringHelper::check($val))
{
return $db->quote($db->escape($val));
}
@ -335,16 +335,18 @@ class GetbibleModelChapters extends ListModel
$query->where('a.abbreviation = ' . (int) $_abbreviation);
}
}
elseif (GetbibleHelper::checkString($_abbreviation))
elseif (StringHelper::check($_abbreviation))
{
$query->where('a.abbreviation = ' . $db->quote($db->escape($_abbreviation)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'g.translation');
$orderDirn = $this->state->get('list.direction', 'asc');
$orderCol = $this->getState('list.ordering', 'g.translation');
$orderDirn = $this->getState('list.direction', 'asc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'asc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -417,17 +419,16 @@ class GetbibleModelChapters extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -462,7 +463,7 @@ class GetbibleModelChapters extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -41,7 +41,8 @@
type="translations"
name="abbreviation"
label="COM_GETBIBLE_BOOK_ABBREVIATION_LABEL"
multiple="false"
class="multipleTranslations"
multiple="true"
onchange="this.form.submit();"
/>
<field

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -235,7 +236,7 @@ class GetbibleModelLinker extends AdminModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslationVvvtags($value,$name)
{
@ -354,7 +355,7 @@ class GetbibleModelLinker extends AdminModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslationVvwnotes($value,$name)
{
@ -421,7 +422,7 @@ class GetbibleModelLinker extends AdminModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -1045,13 +1046,13 @@ class GetbibleModelLinker extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->name) && !is_numeric($this->table->name))
if (UtilitiesStringHelper::check($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUnique('name',$this->table->name);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -1063,7 +1064,7 @@ class GetbibleModelLinker extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -1174,7 +1175,7 @@ class GetbibleModelLinker extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -179,7 +179,7 @@ class GetbibleModelLinkers extends ListModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslation($value,$name)
{
@ -251,7 +251,7 @@ class GetbibleModelLinkers extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -292,7 +292,7 @@ class GetbibleModelLinkers extends ListModel
$query->where('a.name = ' . (int) $_name);
}
}
elseif (GetbibleHelper::checkString($_name))
elseif (StringHelper::check($_name))
{
$query->where('a.name = ' . $db->quote($db->escape($_name)));
}
@ -309,7 +309,7 @@ class GetbibleModelLinkers extends ListModel
$query->where('a.public_tagged_verses = ' . (int) $_public_tagged_verses);
}
}
elseif (GetbibleHelper::checkString($_public_tagged_verses))
elseif (StringHelper::check($_public_tagged_verses))
{
$query->where('a.public_tagged_verses = ' . $db->quote($db->escape($_public_tagged_verses)));
}
@ -326,16 +326,18 @@ class GetbibleModelLinkers extends ListModel
$query->where('a.public_notes = ' . (int) $_public_notes);
}
}
elseif (GetbibleHelper::checkString($_public_notes))
elseif (StringHelper::check($_public_notes))
{
$query->where('a.public_notes = ' . $db->quote($db->escape($_public_notes)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$orderCol = $this->getState('list.ordering', 'a.id');
$orderDirn = $this->getState('list.direction', 'desc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -379,17 +381,16 @@ class GetbibleModelLinkers extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -424,7 +425,7 @@ class GetbibleModelLinkers extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -30,8 +31,8 @@ use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\GuidHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
/**
* Getbible Note Admin Model
@ -737,7 +738,7 @@ class GetbibleModelNote extends AdminModel
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -749,7 +750,7 @@ class GetbibleModelNote extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -860,7 +861,7 @@ class GetbibleModelNote extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -186,7 +186,7 @@ class GetbibleModelNotes extends ListModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslation($value,$name)
{
@ -277,7 +277,7 @@ class GetbibleModelNotes extends ListModel
$query->where('a.book_nr = ' . (int) $_book_nr);
}
}
elseif (GetbibleHelper::checkString($_book_nr))
elseif (StringHelper::check($_book_nr))
{
$query->where('a.book_nr = ' . $db->quote($db->escape($_book_nr)));
}
@ -294,7 +294,7 @@ class GetbibleModelNotes extends ListModel
$query->where('a.linker = ' . (int) $_linker);
}
}
elseif (GetbibleHelper::checkString($_linker))
elseif (StringHelper::check($_linker))
{
$query->where('a.linker = ' . $db->quote($db->escape($_linker)));
}
@ -311,7 +311,7 @@ class GetbibleModelNotes extends ListModel
$query->where('a.access = ' . (int) $_access);
}
}
elseif (GetbibleHelper::checkString($_access))
elseif (StringHelper::check($_access))
{
$query->where('a.access = ' . $db->quote($db->escape($_access)));
}
@ -328,7 +328,7 @@ class GetbibleModelNotes extends ListModel
$query->where('a.verse = ' . (int) $_verse);
}
}
elseif (GetbibleHelper::checkString($_verse))
elseif (StringHelper::check($_verse))
{
$query->where('a.verse = ' . $db->quote($db->escape($_verse)));
}
@ -345,16 +345,18 @@ class GetbibleModelNotes extends ListModel
$query->where('a.chapter = ' . (int) $_chapter);
}
}
elseif (GetbibleHelper::checkString($_chapter))
elseif (StringHelper::check($_chapter))
{
$query->where('a.chapter = ' . $db->quote($db->escape($_chapter)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$orderCol = $this->getState('list.ordering', 'a.id');
$orderDirn = $this->getState('list.direction', 'desc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -387,17 +389,16 @@ class GetbibleModelNotes extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -432,7 +433,7 @@ class GetbibleModelNotes extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -29,6 +30,7 @@ use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
/**
@ -742,13 +744,13 @@ class GetbibleModelOpen_ai_message extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->role) && !is_numeric($this->table->role))
if (UtilitiesStringHelper::check($this->table->role) && !is_numeric($this->table->role))
{
$this->table->role = $this->generateUnique('role',$this->table->role);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -760,7 +762,7 @@ class GetbibleModelOpen_ai_message extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -871,7 +873,7 @@ class GetbibleModelOpen_ai_message extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -187,7 +187,7 @@ class GetbibleModelOpen_ai_messages extends ListModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslation($value,$name)
{
@ -269,7 +269,7 @@ class GetbibleModelOpen_ai_messages extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -310,7 +310,7 @@ class GetbibleModelOpen_ai_messages extends ListModel
$query->where('a.role = ' . (int) $_role);
}
}
elseif (GetbibleHelper::checkString($_role))
elseif (StringHelper::check($_role))
{
$query->where('a.role = ' . $db->quote($db->escape($_role)));
}
@ -327,7 +327,7 @@ class GetbibleModelOpen_ai_messages extends ListModel
$query->where('a.open_ai_response = ' . (int) $_open_ai_response);
}
}
elseif (GetbibleHelper::checkString($_open_ai_response))
elseif (StringHelper::check($_open_ai_response))
{
$query->where('a.open_ai_response = ' . $db->quote($db->escape($_open_ai_response)));
}
@ -344,7 +344,7 @@ class GetbibleModelOpen_ai_messages extends ListModel
$query->where('a.prompt = ' . (int) $_prompt);
}
}
elseif (GetbibleHelper::checkString($_prompt))
elseif (StringHelper::check($_prompt))
{
$query->where('a.prompt = ' . $db->quote($db->escape($_prompt)));
}
@ -361,16 +361,18 @@ class GetbibleModelOpen_ai_messages extends ListModel
$query->where('a.source = ' . (int) $_source);
}
}
elseif (GetbibleHelper::checkString($_source))
elseif (StringHelper::check($_source))
{
$query->where('a.source = ' . $db->quote($db->escape($_source)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$orderCol = $this->getState('list.ordering', 'a.id');
$orderDirn = $this->getState('list.direction', 'desc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -415,17 +417,16 @@ class GetbibleModelOpen_ai_messages extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -460,7 +461,7 @@ class GetbibleModelOpen_ai_messages extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -207,7 +208,7 @@ class GetbibleModelOpen_ai_response extends AdminModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -273,7 +274,7 @@ class GetbibleModelOpen_ai_response extends AdminModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslationVvymessage($value,$name)
{
@ -1192,13 +1193,13 @@ class GetbibleModelOpen_ai_response extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->response_id) && !is_numeric($this->table->response_id))
if (UtilitiesStringHelper::check($this->table->response_id) && !is_numeric($this->table->response_id))
{
$this->table->response_id = $this->generateUnique('response_id',$this->table->response_id);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -1210,7 +1211,7 @@ class GetbibleModelOpen_ai_response extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -1321,7 +1322,7 @@ class GetbibleModelOpen_ai_response extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -222,7 +222,7 @@ class GetbibleModelOpen_ai_responses extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -263,7 +263,7 @@ class GetbibleModelOpen_ai_responses extends ListModel
$query->where('a.response_id = ' . (int) $_response_id);
}
}
elseif (GetbibleHelper::checkString($_response_id))
elseif (StringHelper::check($_response_id))
{
$query->where('a.response_id = ' . $db->quote($db->escape($_response_id)));
}
@ -280,7 +280,7 @@ class GetbibleModelOpen_ai_responses extends ListModel
$query->where('a.prompt = ' . (int) $_prompt);
}
}
elseif (GetbibleHelper::checkString($_prompt))
elseif (StringHelper::check($_prompt))
{
$query->where('a.prompt = ' . $db->quote($db->escape($_prompt)));
}
@ -297,16 +297,18 @@ class GetbibleModelOpen_ai_responses extends ListModel
$query->where('a.response_model = ' . (int) $_response_model);
}
}
elseif (GetbibleHelper::checkString($_response_model))
elseif (StringHelper::check($_response_model))
{
$query->where('a.response_model = ' . $db->quote($db->escape($_response_model)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$orderCol = $this->getState('list.ordering', 'a.id');
$orderDirn = $this->getState('list.direction', 'desc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -352,17 +354,16 @@ class GetbibleModelOpen_ai_responses extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -397,7 +398,7 @@ class GetbibleModelOpen_ai_responses extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -31,6 +32,7 @@ use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\GuidHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\GetHelper;
/**
@ -722,13 +724,13 @@ class GetbibleModelPassword extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->name) && !is_numeric($this->table->name))
if (UtilitiesStringHelper::check($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUnique('name',$this->table->name);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -740,7 +742,7 @@ class GetbibleModelPassword extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -851,7 +853,7 @@ class GetbibleModelPassword extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -198,7 +198,7 @@ class GetbibleModelPasswords extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -239,7 +239,7 @@ class GetbibleModelPasswords extends ListModel
$query->where('a.name = ' . (int) $_name);
}
}
elseif (GetbibleHelper::checkString($_name))
elseif (StringHelper::check($_name))
{
$query->where('a.name = ' . $db->quote($db->escape($_name)));
}
@ -256,16 +256,18 @@ class GetbibleModelPasswords extends ListModel
$query->where('a.linker = ' . (int) $_linker);
}
}
elseif (GetbibleHelper::checkString($_linker))
elseif (StringHelper::check($_linker))
{
$query->where('a.linker = ' . $db->quote($db->escape($_linker)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$orderCol = $this->getState('list.ordering', 'a.id');
$orderDirn = $this->getState('list.direction', 'desc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -308,17 +310,16 @@ class GetbibleModelPasswords extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -353,7 +354,7 @@ class GetbibleModelPasswords extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -30,8 +31,9 @@ use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\GuidHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
/**
* Getbible Prompt Admin Model
@ -1098,13 +1100,13 @@ class GetbibleModelPrompt extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->name) && !is_numeric($this->table->name))
if (UtilitiesStringHelper::check($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUnique('name',$this->table->name);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -1116,7 +1118,7 @@ class GetbibleModelPrompt extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -1227,7 +1229,7 @@ class GetbibleModelPrompt extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -1314,7 +1316,7 @@ class GetbibleModelPrompt extends AdminModel
// Set the messages items to data.
if (isset($data['messages']) && is_array($data['messages']))
{
$messages = new JRegistry;
$messages = new Registry;
$messages->loadArray($data['messages']);
$data['messages'] = (string) $messages;
}

View File

@ -197,7 +197,7 @@ class GetbibleModelPrompts extends ListModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslation($value,$name)
{
@ -295,7 +295,7 @@ class GetbibleModelPrompts extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -336,7 +336,7 @@ class GetbibleModelPrompts extends ListModel
$query->where('a.name = ' . (int) $_name);
}
}
elseif (GetbibleHelper::checkString($_name))
elseif (StringHelper::check($_name))
{
$query->where('a.name = ' . $db->quote($db->escape($_name)));
}
@ -353,7 +353,7 @@ class GetbibleModelPrompts extends ListModel
$query->where('a.cache_behaviour = ' . (int) $_cache_behaviour);
}
}
elseif (GetbibleHelper::checkString($_cache_behaviour))
elseif (StringHelper::check($_cache_behaviour))
{
$query->where('a.cache_behaviour = ' . $db->quote($db->escape($_cache_behaviour)));
}
@ -370,7 +370,7 @@ class GetbibleModelPrompts extends ListModel
$query->where('a.abbreviation = ' . (int) $_abbreviation);
}
}
elseif (GetbibleHelper::checkString($_abbreviation))
elseif (StringHelper::check($_abbreviation))
{
$query->where('a.abbreviation = ' . $db->quote($db->escape($_abbreviation)));
}
@ -387,16 +387,18 @@ class GetbibleModelPrompts extends ListModel
$query->where('a.model = ' . (int) $_model);
}
}
elseif (GetbibleHelper::checkString($_model))
elseif (StringHelper::check($_model))
{
$query->where('a.model = ' . $db->quote($db->escape($_model)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$orderCol = $this->getState('list.ordering', 'a.id');
$orderDirn = $this->getState('list.direction', 'desc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -442,17 +444,16 @@ class GetbibleModelPrompts extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -487,7 +488,7 @@ class GetbibleModelPrompts extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -30,8 +31,9 @@ use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\GuidHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
/**
* Getbible Tag Admin Model
@ -701,13 +703,13 @@ class GetbibleModelTag extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->name) && !is_numeric($this->table->name))
if (UtilitiesStringHelper::check($this->table->name) && !is_numeric($this->table->name))
{
$this->table->name = $this->generateUnique('name',$this->table->name);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -719,7 +721,7 @@ class GetbibleModelTag extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -830,7 +832,7 @@ class GetbibleModelTag extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -30,8 +31,8 @@ use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\GuidHelper;
use VDM\Joomla\Utilities\GetHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
use VDM\Joomla\Utilities\GetHelper;
/**
* Getbible Tagged_verse Admin Model
@ -755,7 +756,7 @@ class GetbibleModelTagged_verse extends AdminModel
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -767,7 +768,7 @@ class GetbibleModelTagged_verse extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -878,7 +879,7 @@ class GetbibleModelTagged_verse extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -202,7 +202,7 @@ class GetbibleModelTagged_verses extends ListModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslation($value,$name)
{
@ -301,11 +301,11 @@ class GetbibleModelTagged_verses extends ListModel
$query->where('a.book_nr = ' . (int) $_book_nr);
}
}
elseif (GetbibleHelper::checkString($_book_nr))
elseif (StringHelper::check($_book_nr))
{
$query->where('a.book_nr = ' . $db->quote($db->escape($_book_nr)));
}
elseif (GetbibleHelper::checkArray($_book_nr))
elseif (UtilitiesArrayHelper::check($_book_nr))
{
// Secure the array for the query
$_book_nr = array_map( function ($val) use(&$db) {
@ -320,7 +320,7 @@ class GetbibleModelTagged_verses extends ListModel
return (int) $val;
}
}
elseif (GetbibleHelper::checkString($val))
elseif (StringHelper::check($val))
{
return $db->quote($db->escape($val));
}
@ -341,11 +341,11 @@ class GetbibleModelTagged_verses extends ListModel
$query->where('a.abbreviation = ' . (int) $_abbreviation);
}
}
elseif (GetbibleHelper::checkString($_abbreviation))
elseif (StringHelper::check($_abbreviation))
{
$query->where('a.abbreviation = ' . $db->quote($db->escape($_abbreviation)));
}
elseif (GetbibleHelper::checkArray($_abbreviation))
elseif (UtilitiesArrayHelper::check($_abbreviation))
{
// Secure the array for the query
$_abbreviation = array_map( function ($val) use(&$db) {
@ -360,7 +360,7 @@ class GetbibleModelTagged_verses extends ListModel
return (int) $val;
}
}
elseif (GetbibleHelper::checkString($val))
elseif (StringHelper::check($val))
{
return $db->quote($db->escape($val));
}
@ -381,7 +381,7 @@ class GetbibleModelTagged_verses extends ListModel
$query->where('a.access = ' . (int) $_access);
}
}
elseif (GetbibleHelper::checkString($_access))
elseif (StringHelper::check($_access))
{
$query->where('a.access = ' . $db->quote($db->escape($_access)));
}
@ -398,7 +398,7 @@ class GetbibleModelTagged_verses extends ListModel
$query->where('a.linker = ' . (int) $_linker);
}
}
elseif (GetbibleHelper::checkString($_linker))
elseif (StringHelper::check($_linker))
{
$query->where('a.linker = ' . $db->quote($db->escape($_linker)));
}
@ -415,7 +415,7 @@ class GetbibleModelTagged_verses extends ListModel
$query->where('a.tag = ' . (int) $_tag);
}
}
elseif (GetbibleHelper::checkString($_tag))
elseif (StringHelper::check($_tag))
{
$query->where('a.tag = ' . $db->quote($db->escape($_tag)));
}
@ -432,11 +432,11 @@ class GetbibleModelTagged_verses extends ListModel
$query->where('a.verse = ' . (int) $_verse);
}
}
elseif (GetbibleHelper::checkString($_verse))
elseif (StringHelper::check($_verse))
{
$query->where('a.verse = ' . $db->quote($db->escape($_verse)));
}
elseif (GetbibleHelper::checkArray($_verse))
elseif (UtilitiesArrayHelper::check($_verse))
{
// Secure the array for the query
$_verse = array_map( function ($val) use(&$db) {
@ -451,7 +451,7 @@ class GetbibleModelTagged_verses extends ListModel
return (int) $val;
}
}
elseif (GetbibleHelper::checkString($val))
elseif (StringHelper::check($val))
{
return $db->quote($db->escape($val));
}
@ -472,11 +472,11 @@ class GetbibleModelTagged_verses extends ListModel
$query->where('a.chapter = ' . (int) $_chapter);
}
}
elseif (GetbibleHelper::checkString($_chapter))
elseif (StringHelper::check($_chapter))
{
$query->where('a.chapter = ' . $db->quote($db->escape($_chapter)));
}
elseif (GetbibleHelper::checkArray($_chapter))
elseif (UtilitiesArrayHelper::check($_chapter))
{
// Secure the array for the query
$_chapter = array_map( function ($val) use(&$db) {
@ -491,7 +491,7 @@ class GetbibleModelTagged_verses extends ListModel
return (int) $val;
}
}
elseif (GetbibleHelper::checkString($val))
elseif (StringHelper::check($val))
{
return $db->quote($db->escape($val));
}
@ -501,10 +501,12 @@ class GetbibleModelTagged_verses extends ListModel
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$orderCol = $this->getState('list.ordering', 'a.id');
$orderDirn = $this->getState('list.direction', 'desc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -583,17 +585,16 @@ class GetbibleModelTagged_verses extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -628,7 +629,7 @@ class GetbibleModelTagged_verses extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -169,7 +169,7 @@ class GetbibleModelTags extends ListModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslation($value,$name)
{
@ -260,7 +260,7 @@ class GetbibleModelTags extends ListModel
$query->where('a.linker = ' . (int) $_linker);
}
}
elseif (GetbibleHelper::checkString($_linker))
elseif (StringHelper::check($_linker))
{
$query->where('a.linker = ' . $db->quote($db->escape($_linker)));
}
@ -277,16 +277,18 @@ class GetbibleModelTags extends ListModel
$query->where('a.access = ' . (int) $_access);
}
}
elseif (GetbibleHelper::checkString($_access))
elseif (StringHelper::check($_access))
{
$query->where('a.access = ' . $db->quote($db->escape($_access)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'desc');
$orderCol = $this->getState('list.ordering', 'a.id');
$orderDirn = $this->getState('list.direction', 'desc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'desc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -317,17 +319,16 @@ class GetbibleModelTags extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -362,7 +363,7 @@ class GetbibleModelTags extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -29,6 +30,7 @@ use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
/**
@ -930,13 +932,13 @@ class GetbibleModelTranslation extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->translation) && !is_numeric($this->table->translation))
if (UtilitiesStringHelper::check($this->table->translation) && !is_numeric($this->table->translation))
{
$this->table->translation = $this->generateUnique('translation',$this->table->translation);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -948,7 +950,7 @@ class GetbibleModelTranslation extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -1059,7 +1061,7 @@ class GetbibleModelTranslation extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -1131,7 +1133,7 @@ class GetbibleModelTranslation extends AdminModel
// Set the distribution_history items to data.
if (isset($data['distribution_history']) && is_array($data['distribution_history']))
{
$distribution_history = new JRegistry;
$distribution_history = new Registry;
$distribution_history->loadArray($data['distribution_history']);
$data['distribution_history'] = (string) $distribution_history;
}

View File

@ -185,7 +185,7 @@ class GetbibleModelTranslations extends ListModel
/**
* Method to convert selection values to translatable string.
*
* @return translatable string
* @return string The translatable string.
*/
public function selectionTranslation($value,$name)
{
@ -244,7 +244,7 @@ class GetbibleModelTranslations extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -285,16 +285,18 @@ class GetbibleModelTranslations extends ListModel
$query->where('a.direction = ' . (int) $_direction);
}
}
elseif (GetbibleHelper::checkString($_direction))
elseif (StringHelper::check($_direction))
{
$query->where('a.direction = ' . $db->quote($db->escape($_direction)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.language');
$orderDirn = $this->state->get('list.direction', 'asc');
$orderCol = $this->getState('list.ordering', 'a.language');
$orderDirn = $this->getState('list.direction', 'asc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'asc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -342,17 +344,16 @@ class GetbibleModelTranslations extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -387,7 +388,7 @@ class GetbibleModelTranslations extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\MVC\Model\AdminModel;
@ -29,6 +30,7 @@ use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
/**
@ -721,13 +723,13 @@ class GetbibleModelVerse extends AdminModel
}
// Only for strings
if (GetbibleHelper::checkString($this->table->book_nr) && !is_numeric($this->table->book_nr))
if (UtilitiesStringHelper::check($this->table->book_nr) && !is_numeric($this->table->book_nr))
{
$this->table->book_nr = $this->generateUnique('book_nr',$this->table->book_nr);
}
// insert all set values
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{
@ -739,7 +741,7 @@ class GetbibleModelVerse extends AdminModel
}
// update all unique fields
if (GetbibleHelper::checkArray($uniqueFields))
if (UtilitiesArrayHelper::check($uniqueFields))
{
foreach ($uniqueFields as $uniqueField)
{
@ -850,7 +852,7 @@ class GetbibleModelVerse extends AdminModel
}
// insert all set values.
if (GetbibleHelper::checkArray($values))
if (UtilitiesArrayHelper::check($values))
{
foreach ($values as $key => $value)
{

View File

@ -214,7 +214,7 @@ class GetbibleModelVerses extends ListModel
{
$query->where('a.access = ' . (int) $_access);
}
elseif (GetbibleHelper::checkArray($_access))
elseif (UtilitiesArrayHelper::check($_access))
{
// Secure the array for the query
$_access = ArrayHelper::toInteger($_access);
@ -255,7 +255,7 @@ class GetbibleModelVerses extends ListModel
$query->where('a.book_nr = ' . (int) $_book_nr);
}
}
elseif (GetbibleHelper::checkString($_book_nr))
elseif (StringHelper::check($_book_nr))
{
$query->where('a.book_nr = ' . $db->quote($db->escape($_book_nr)));
}
@ -272,7 +272,7 @@ class GetbibleModelVerses extends ListModel
$query->where('a.chapter = ' . (int) $_chapter);
}
}
elseif (GetbibleHelper::checkString($_chapter))
elseif (StringHelper::check($_chapter))
{
$query->where('a.chapter = ' . $db->quote($db->escape($_chapter)));
}
@ -289,7 +289,7 @@ class GetbibleModelVerses extends ListModel
$query->where('a.verse = ' . (int) $_verse);
}
}
elseif (GetbibleHelper::checkString($_verse))
elseif (StringHelper::check($_verse))
{
$query->where('a.verse = ' . $db->quote($db->escape($_verse)));
}
@ -306,16 +306,18 @@ class GetbibleModelVerses extends ListModel
$query->where('a.abbreviation = ' . (int) $_abbreviation);
}
}
elseif (GetbibleHelper::checkString($_abbreviation))
elseif (StringHelper::check($_abbreviation))
{
$query->where('a.abbreviation = ' . $db->quote($db->escape($_abbreviation)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'g.translation');
$orderDirn = $this->state->get('list.direction', 'asc');
$orderCol = $this->getState('list.ordering', 'g.translation');
$orderDirn = $this->getState('list.direction', 'asc');
if ($orderCol != '')
{
// Check that the order direction is valid encase we have a field called direction as part of filers.
$orderDirn = (is_string($orderDirn) && in_array(strtolower($orderDirn), ['asc', 'desc'])) ? $orderDirn : 'asc';
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
@ -369,17 +371,16 @@ class GetbibleModelVerses extends ListModel
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
* @return bool
* @since 3.2.0
*/
protected function checkInNow()
protected function checkInNow(): bool
{
// Get set check in time
$time = ComponentHelper::getParams('com_getbible')->get('check_in');
if ($time)
{
// Get a db connection.
$db = Factory::getDbo();
// Reset query.
@ -414,7 +415,7 @@ class GetbibleModelVerses extends ListModel
$db->setQuery($query);
$db->execute();
return $db->execute();
}
}

View File

@ -320,8 +320,8 @@ CREATE TABLE IF NOT EXISTS `#__getbible_translation` (
`distribution_history` TEXT NOT NULL,
`distribution_lcsh` VARCHAR(64) NOT NULL DEFAULT '',
`distribution_license` TEXT NOT NULL,
`distribution_source` VARCHAR(255) NOT NULL DEFAULT '',
`distribution_sourcetype` VARCHAR(64) NOT NULL DEFAULT '',
`distribution_source` TEXT NOT NULL,
`distribution_sourcetype` VARCHAR(255) NOT NULL DEFAULT '',
`distribution_versification` VARCHAR(64) NOT NULL DEFAULT '',
`distribution_version` VARCHAR(64) NOT NULL DEFAULT '',
`distribution_version_date` VARCHAR(64) NOT NULL DEFAULT '',

View File

@ -129,14 +129,20 @@ class GetbibleViewBook extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_BOOK_NEW' : 'COM_GETBIBLE_BOOK_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_BOOK_NEW' : 'COM_GETBIBLE_BOOK_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/book.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/book/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -27,6 +27,7 @@ use Joomla\CMS\Router\Route;
Html::_('behavior.multiselect');
Html::_('dropdown.init');
Html::_('formbehavior.chosen', 'select');
Html::_('formbehavior.chosen', '.multipleTranslations', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_GETBIBLE_FILTER_SELECT_TRANSLATION') . ' -']);
Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_GETBIBLE_FILTER_SELECT_ACCESS') . ' -']);
if ($this->saveOrder)

View File

@ -309,4 +309,14 @@ class GetbibleViewBooks extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -129,14 +129,20 @@ class GetbibleViewChapter extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_CHAPTER_NEW' : 'COM_GETBIBLE_CHAPTER_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_CHAPTER_NEW' : 'COM_GETBIBLE_CHAPTER_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/chapter.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/chapter/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -300,4 +300,14 @@ class GetbibleViewChapters extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -206,11 +206,7 @@ class GetbibleViewLinker extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_LINKER_NEW' : 'COM_GETBIBLE_LINKER_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_LINKER_NEW' : 'COM_GETBIBLE_LINKER_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/linker.css", ['version' => 'auto']);
// Add the CSS for Footable
@ -226,4 +222,14 @@ class GetbibleViewLinker extends HtmlView
Html::_('script', "administrator/components/com_getbible/views/linker/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -299,4 +299,14 @@ class GetbibleViewLinkers extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -202,14 +202,20 @@ class GetbibleViewNote extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_NOTE_NEW' : 'COM_GETBIBLE_NOTE_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_NOTE_NEW' : 'COM_GETBIBLE_NOTE_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/note.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/note/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -329,4 +329,14 @@ class GetbibleViewNotes extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -202,14 +202,20 @@ class GetbibleViewOpen_ai_message extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_OPEN_AI_MESSAGE_NEW' : 'COM_GETBIBLE_OPEN_AI_MESSAGE_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_OPEN_AI_MESSAGE_NEW' : 'COM_GETBIBLE_OPEN_AI_MESSAGE_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/open_ai_message.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/open_ai_message/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -320,4 +320,14 @@ class GetbibleViewOpen_ai_messages extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -205,11 +205,7 @@ class GetbibleViewOpen_ai_response extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_OPEN_AI_RESPONSE_NEW' : 'COM_GETBIBLE_OPEN_AI_RESPONSE_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_OPEN_AI_RESPONSE_NEW' : 'COM_GETBIBLE_OPEN_AI_RESPONSE_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/open_ai_response.css", ['version' => 'auto']);
// Add the CSS for Footable
@ -225,4 +221,14 @@ class GetbibleViewOpen_ai_response extends HtmlView
Html::_('script', "administrator/components/com_getbible/views/open_ai_response/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -301,4 +301,14 @@ class GetbibleViewOpen_ai_responses extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -197,14 +197,20 @@ class GetbibleViewPassword extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_PASSWORD_NEW' : 'COM_GETBIBLE_PASSWORD_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_PASSWORD_NEW' : 'COM_GETBIBLE_PASSWORD_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/password.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/password/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -278,4 +278,14 @@ class GetbibleViewPasswords extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -202,14 +202,20 @@ class GetbibleViewPrompt extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_PROMPT_NEW' : 'COM_GETBIBLE_PROMPT_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_PROMPT_NEW' : 'COM_GETBIBLE_PROMPT_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/prompt.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/prompt/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -320,4 +320,14 @@ class GetbibleViewPrompts extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -202,14 +202,20 @@ class GetbibleViewTag extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_TAG_NEW' : 'COM_GETBIBLE_TAG_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_TAG_NEW' : 'COM_GETBIBLE_TAG_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/tag.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/tag/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -202,14 +202,20 @@ class GetbibleViewTagged_verse extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_TAGGED_VERSE_NEW' : 'COM_GETBIBLE_TAGGED_VERSE_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_TAGGED_VERSE_NEW' : 'COM_GETBIBLE_TAGGED_VERSE_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/tagged_verse.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/tagged_verse/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -371,4 +371,14 @@ class GetbibleViewTagged_verses extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -269,4 +269,14 @@ class GetbibleViewTags extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -129,11 +129,7 @@ class GetbibleViewTranslation extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_TRANSLATION_NEW' : 'COM_GETBIBLE_TRANSLATION_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_TRANSLATION_NEW' : 'COM_GETBIBLE_TRANSLATION_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/translation.css", ['version' => 'auto']);
// Add Ajax Token
$this->document->addScriptDeclaration("var token = '" . Session::getFormToken() . "';");
@ -141,4 +137,14 @@ class GetbibleViewTranslation extends HtmlView
Html::_('script', "administrator/components/com_getbible/views/translation/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -270,4 +270,14 @@ class GetbibleViewTranslations extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -129,14 +129,20 @@ class GetbibleViewVerse extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
if (!isset($this->document))
{
$this->document = Factory::getDocument();
}
$this->document->setTitle(Text::_($isNew ? 'COM_GETBIBLE_VERSE_NEW' : 'COM_GETBIBLE_VERSE_EDIT'));
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_GETBIBLE_VERSE_NEW' : 'COM_GETBIBLE_VERSE_EDIT'));
Html::_('stylesheet', "administrator/components/com_getbible/assets/css/verse.css", ['version' => 'auto']);
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "administrator/components/com_getbible/views/verse/submitbutton.js", ['version' => 'auto']);
Text::script('view not acceptable. Error');
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -320,4 +320,14 @@ class GetbibleViewVerses extends HtmlView
'a.id' => Text::_('JGRID_HEADING_ID')
);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.10" method="upgrade">
<name>COM_GETBIBLE</name>
<creationDate>22nd January, 2024</creationDate>
<creationDate>26th January, 2024</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://getbible.net</authorUrl>

View File

@ -85,10 +85,13 @@ final class DailyScripture
{
$response = $http->get($config->daily_scripture_url);
$body = $response->body ?? null;
$code = $response->code ?? 400;
// make sure we got the correct response
if ($response->code == 200 && isset($response->body) && is_string($response->body))
if ($code == 200 && is_string($body))
{
$this->reference = $response->body;
$this->reference = $body;
$this->parse($this->reference);
}

View File

@ -12,7 +12,7 @@
namespace VDM\Joomla\GetBible\Utilities;
use Joomla\CMS\Http\Response as JoomlaResponse;
use Joomla\Http\Response as JoomlaResponse;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
@ -36,7 +36,7 @@ final class Response
* @since 2.0.1
* @throws \DomainException
**/
public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null)
public function get($response, int $expectedCode = 200, $default = null)
{
// Validate the response code.
if ($response->code != $expectedCode)
@ -60,27 +60,28 @@ final class Response
* @return mixed
* @since 2.0.1
**/
protected function getBody(JoomlaResponse $response, $default = null)
protected function getBody($response, $default = null)
{
$body = $response->body ?? null;
// check that we have a body
if (isset($response->body) && StringHelper::check($response->body))
if (StringHelper::check($body))
{
// if it's JSON, decode it
if (JsonHelper::check($response->body))
if (JsonHelper::check($body))
{
return json_decode((string) $response->body);
return json_decode((string) $body);
}
// if it's XML, convert it to an object
libxml_use_internal_errors(true);
$xml = simplexml_load_string($response->body);
$xml = simplexml_load_string($body);
if ($xml !== false)
{
return $xml;
}
// if it's neither JSON nor XML, return as is
return $response->body;
return $body;
}
return $default;
@ -94,12 +95,13 @@ final class Response
* @return string
* @since 2.0.1
**/
protected function error(JoomlaResponse $response): string
protected function error($response): string
{
$body = $response->body ?? null;
// do we have a json string
if (isset($response->body) && JsonHelper::check($response->body))
if (JsonHelper::check($body))
{
$error = json_decode($response->body);
$error = json_decode($body);
}
else
{

View File

@ -12,7 +12,7 @@
namespace VDM\Joomla\Gitea\Utilities;
use Joomla\CMS\Http\Response as JoomlaResponse;
use Joomla\Http\Response as JoomlaResponse;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
@ -36,7 +36,7 @@ final class Response
* @since 3.2.0
* @throws \DomainException
**/
public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null)
public function get($response, int $expectedCode = 200, $default = null)
{
// Validate the response code.
if ($response->code != $expectedCode)
@ -62,7 +62,7 @@ final class Response
* @since 3.2.0
* @throws \DomainException
**/
public function get_(JoomlaResponse $response, array $validate = [200 => null])
public function get_($response, array $validate = [200 => null])
{
// Validate the response code.
if (!isset($validate[$response->code]))
@ -86,24 +86,23 @@ final class Response
* @return mixed
* @since 3.2.0
**/
protected function body(JoomlaResponse $response, $default = null)
protected function body($response, $default = null)
{
// check that we have a body and that its JSON
if (isset($response->body) && StringHelper::check($response->body))
$body = $response->body ?? null;
// check that we have a body
if (StringHelper::check($body))
{
if (JsonHelper::check($response->body))
if (JsonHelper::check($body))
{
$body = json_decode((string) $response->body);
$body = json_decode((string) $body);
if (isset($body->content_base64))
{
$body->content = base64_decode((string) $body->content_base64);
}
return $body;
}
return $response->body;
return $body;
}
return $default;
@ -117,7 +116,7 @@ final class Response
* @return string
* @since 3.2.0
**/
protected function error(JoomlaResponse $response): string
protected function error($response): string
{
// do we have a json string
if (isset($response->body) && JsonHelper::check($response->body))
@ -141,6 +140,5 @@ final class Response
return '';
}
}

View File

@ -12,7 +12,7 @@
namespace VDM\Joomla\Openai\Utilities;
use Joomla\CMS\Http\Response as JoomlaResponse;
use Joomla\Http\Response as JoomlaResponse;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
@ -36,7 +36,7 @@ final class Response
* @since 3.2.0
* @throws \DomainException
**/
public function get(JoomlaResponse $response, int $expectedCode = 200, $default = null)
public function get($response, int $expectedCode = 200, $default = null)
{
// Validate the response code.
if ($response->code != $expectedCode)
@ -62,7 +62,7 @@ final class Response
* @since 3.2.0
* @throws \DomainException
**/
public function get_(JoomlaResponse $response, array $validate = [200 => null])
public function get_($response, array $validate = [200 => null])
{
// Validate the response code.
if (!isset($validate[$response->code]))
@ -87,17 +87,18 @@ final class Response
* @return mixed
* @since 3.2.0
**/
protected function body(JoomlaResponse $response, $default = null)
protected function body($response, $default = null)
{
// check that we have a body and that its JSON
if (isset($response->body) && StringHelper::check($response->body))
$body = $response->body ?? null;
// check that we have a body
if (StringHelper::check($body))
{
if (JsonHelper::check($response->body))
if (JsonHelper::check($body))
{
return json_decode((string) $response->body);
$body = json_decode((string) $body);
}
return $response->body;
return $body;
}
return $default;
@ -111,7 +112,7 @@ final class Response
* @return string
* @since 3.2.0
**/
protected function error(JoomlaResponse $response): string
protected function error($response): string
{
// do we have a json string
if (isset($response->body) && JsonHelper::check($response->body))

View File

@ -26,10 +26,9 @@ abstract class Database
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
*/
protected \JDatabaseDriver $db;
protected $db;
/**
* Core Component Table Name
@ -42,14 +41,12 @@ abstract class Database
/**
* Constructor
*
* @param \JDatabaseDriver|null $db The database driver
*
* @throws \Exception
* @since 3.2.0
*/
public function __construct(?\JDatabaseDriver $db = null)
public function __construct()
{
$this->db = $db ?: JoomlaFactory::getDbo();
$this->db = JoomlaFactory::getDbo();
// set the component table
$this->table = '#__' . Helper::getCode();

View File

@ -12,8 +12,9 @@
namespace VDM\Joomla\Utilities\Component;
use Joomla\Input\Input;
use Joomla\CMS\Factory;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\Input\Input;
use Joomla\Registry\Registry;
use VDM\Joomla\Utilities\String\NamespaceHelper;
@ -28,10 +29,10 @@ abstract class Helper
/**
* The current option
*
* @var string
* @var string|null
* @since 3.0.11
*/
public static string $option;
public static ?string $option = null;
/**
* The component manifest list cache
@ -91,12 +92,24 @@ abstract class Helper
self::$option = (new Input)->getString('option', null);
}
if (self::$option)
if (empty(self::$option))
{
return self::$option;
$app = Factory::getApplication();
// Check if the getInput method exists in the application object
if (method_exists($app, 'getInput'))
{
// get the option from the application
self::$option = $app->getInput()->getCmd('option', $default);
}
else
{
// Use the default value if getInput method does not exist
self::$option = $default;
}
}
return $default;
return self::$option;
}
/**

View File

@ -50,18 +50,18 @@ abstract class StringHelper
/**
* Shorten a string
*
* @input string The you would like to shorten
* @input string The sting that you would like to shorten
*
* @returns string on success
*
* @since 3.0.9
* @since 3.2.0
*/
public static function shorten($string, $length = 40, $addTip = true)
{
if (self::check($string))
{
$initial = strlen((string) $string);
$words = preg_split('/([\s\n\r]+)/', (string) $string, null, PREG_SPLIT_DELIM_CAPTURE);
$words = preg_split('/([\s\n\r]+)/', (string) $string, -1, PREG_SPLIT_DELIM_CAPTURE);
$words_count = count((array)$words);
$word_length = 0;

View File

@ -1036,7 +1036,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
// Create the note content type object.
$note = new stdClass();
$note = new \stdClass();
$note->type_title = 'Getbible Note';
$note->type_alias = 'com_getbible.note';
$note->table = '{"special": {"dbtable": "#__getbible_note","key": "id","type": "Note","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1048,7 +1048,7 @@ class Com_GetbibleInstallerScript
$note_Inserted = $db->insertObject('#__content_types', $note);
// Create the tagged_verse content type object.
$tagged_verse = new stdClass();
$tagged_verse = new \stdClass();
$tagged_verse->type_title = 'Getbible Tagged_verse';
$tagged_verse->type_alias = 'com_getbible.tagged_verse';
$tagged_verse->table = '{"special": {"dbtable": "#__getbible_tagged_verse","key": "id","type": "Tagged_verse","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1060,7 +1060,7 @@ class Com_GetbibleInstallerScript
$tagged_verse_Inserted = $db->insertObject('#__content_types', $tagged_verse);
// Create the prompt content type object.
$prompt = new stdClass();
$prompt = new \stdClass();
$prompt->type_title = 'Getbible Prompt';
$prompt->type_alias = 'com_getbible.prompt';
$prompt->table = '{"special": {"dbtable": "#__getbible_prompt","key": "id","type": "Prompt","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1072,7 +1072,7 @@ class Com_GetbibleInstallerScript
$prompt_Inserted = $db->insertObject('#__content_types', $prompt);
// Create the open_ai_response content type object.
$open_ai_response = new stdClass();
$open_ai_response = new \stdClass();
$open_ai_response->type_title = 'Getbible Open_ai_response';
$open_ai_response->type_alias = 'com_getbible.open_ai_response';
$open_ai_response->table = '{"special": {"dbtable": "#__getbible_open_ai_response","key": "id","type": "Open_ai_response","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1084,7 +1084,7 @@ class Com_GetbibleInstallerScript
$open_ai_response_Inserted = $db->insertObject('#__content_types', $open_ai_response);
// Create the open_ai_message content type object.
$open_ai_message = new stdClass();
$open_ai_message = new \stdClass();
$open_ai_message->type_title = 'Getbible Open_ai_message';
$open_ai_message->type_alias = 'com_getbible.open_ai_message';
$open_ai_message->table = '{"special": {"dbtable": "#__getbible_open_ai_message","key": "id","type": "Open_ai_message","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1096,7 +1096,7 @@ class Com_GetbibleInstallerScript
$open_ai_message_Inserted = $db->insertObject('#__content_types', $open_ai_message);
// Create the tag content type object.
$tag = new stdClass();
$tag = new \stdClass();
$tag->type_title = 'Getbible Tag';
$tag->type_alias = 'com_getbible.tag';
$tag->table = '{"special": {"dbtable": "#__getbible_tag","key": "id","type": "Tag","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1129,7 +1129,7 @@ class Com_GetbibleInstallerScript
$query = $db->getQuery(true);
// Field to update.
$fields = array(
$db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","default_translation":"kjv","show_install_button":"0","show_getbible_logo":"1","show_getbible_link":"1","show_hash_validation":"1","show_api_link":"1","activate_search":"0","search_found_color":"#4747ff","table_selection_color":"#dfdfdf","search_words":"1","search_match":"1","search_case":"1","bottom_search_position":"div","show_bottom_search_position_card":"1","bottom_search_position_card_style":"default","activate_notes":"0","activate_tags":"0","allow_untagging":"0","bottom_tag_position":"div","show_bottom_tag_position_card":"1","bottom_tag_position_card_style":"default","activate_sharing":"1","verse_layout_share":"1","verse_number_share":"1","local_link_share":"1","text_reference_share":"3","type_translation_share":"2","default_format_share":"1","verse_selected_color":"#4747ff","show_header":"1","verse_per_line":"1","show_top_menu":"1","top_menu_type":"1","show_bottom_menu":"0","bottom_menu_type":"1","previous_next_navigation":"1","set_custom_tabs":"0","custom_tabs":"div","set_default_tab_names":"0","custom_icons":"0","show_scripture_tab_text":"1","show_scripture_icon":"1","show_scripture_card":"1","scripture_card_style":"default","show_books_tab_text":"1","show_books_icon":"1","show_books_card":"1","books_card_style":"default","show_chapters_tab_text":"1","show_chapters_icon":"1","show_chapters_card":"1","chapters_card_style":"default","show_translations_tab_text":"1","show_translations_icon":"1","show_translations_card":"1","translations_card_style":"default","show_settings":"0","show_settings_tab_text":"1","show_settings_icon":"1","show_settings_card":"1","settings_card_style":"default","show_details":"1","show_details_tab_text":"1","show_details_icon":"1","show_details_card":"1","details_card_style":"default","bottom_app_position":"div","show_bottom_app_position_card":"1","bottom_app_position_card_style":"default","debug":"0","enable_open_ai":"0","openai_model":"gpt-4","openai_token":"secret","enable_open_ai_org":"0","openai_org_token":"secret","openai_max_tokens":"300","openai_temperature":"1","openai_top_p":"1","openai_n":"1","openai_presence_penalty":"0","openai_frequency_penalty":"0","bottom_ai_position":"div","show_bottom_ai_position_card":"1","bottom_ai_position_card_style":"default","check_in":"-1 day","save_history":"1","history_limit":"10","titleContributor1":"Modules","nameContributor1":"CrossWire","emailContributor1":"sword-support@crosswire.org","linkContributor1":"https://wiki.crosswire.org/","useContributor1":"2","showContributor1":"3","add_jquery_framework":"1","uikit_load":"1","uikit_min":""}'),
$db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","default_translation":"kjv","show_install_button":"0","show_getbible_logo":"1","show_getbible_link":"1","show_hash_validation":"1","show_api_link":"1","activate_search":"0","search_found_color":"#4747ff","table_selection_color":"#dfdfdf","search_words":"1","search_match":"1","search_case":"1","bottom_search_position":"div","show_bottom_search_position_card":"1","bottom_search_position_card_style":"default","activate_notes":"0","activate_tags":"0","allow_untagging":"0","bottom_tag_position":"div","show_bottom_tag_position_card":"1","bottom_tag_position_card_style":"default","activate_sharing":"1","verse_layout_share":"1","verse_number_share":"1","local_link_share":"1","text_reference_share":"3","type_translation_share":"2","default_format_share":"1","verse_selected_color":"#4747ff","show_header":"1","verse_per_line":"1","show_top_menu":"1","top_menu_type":"1","show_bottom_menu":"0","bottom_menu_type":"1","previous_next_navigation":"1","set_custom_tabs":"0","custom_tabs":"div","set_default_tab_names":"0","custom_icons":"0","show_scripture_tab_text":"1","show_scripture_icon":"1","show_scripture_card":"1","scripture_card_style":"default","show_books_tab_text":"1","show_books_icon":"1","show_books_card":"1","books_card_style":"default","show_chapters_tab_text":"1","show_chapters_icon":"1","show_chapters_card":"1","chapters_card_style":"default","show_translations_tab_text":"1","show_translations_icon":"1","show_translations_card":"1","translations_card_style":"default","show_settings":"0","show_settings_tab_text":"1","show_settings_icon":"1","show_settings_card":"1","settings_card_style":"default","show_details":"1","show_details_tab_text":"1","show_details_icon":"1","show_details_card":"1","details_card_style":"default","bottom_app_position":"div","show_bottom_app_position_card":"1","bottom_app_position_card_style":"default","debug":"0","enable_open_ai":"0","openai_model":"gpt-4","openai_token":"secret","enable_open_ai_org":"0","openai_org_token":"secret","openai_max_tokens":"300","openai_temperature":"1","openai_top_p":"1","openai_n":"1","openai_presence_penalty":"0","openai_frequency_penalty":"0","bottom_ai_position":"div","show_bottom_ai_position_card":"1","bottom_ai_position_card_style":"default","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":""}'),
);
// Condition.
$conditions = array(
@ -1150,7 +1150,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the getbible action logs extensions object.
$getbible_action_logs_extensions = new stdClass();
$getbible_action_logs_extensions = new \stdClass();
$getbible_action_logs_extensions->extension = 'com_getbible';
// Set the object into the action logs extensions table.
@ -1162,7 +1162,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the linker action log config object.
$linker_action_log_config = new stdClass();
$linker_action_log_config = new \stdClass();
$linker_action_log_config->type_title = 'LINKER';
$linker_action_log_config->type_alias = 'com_getbible.linker';
$linker_action_log_config->id_holder = 'id';
@ -1179,7 +1179,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the note action log config object.
$note_action_log_config = new stdClass();
$note_action_log_config = new \stdClass();
$note_action_log_config->type_title = 'NOTE';
$note_action_log_config->type_alias = 'com_getbible.note';
$note_action_log_config->id_holder = 'id';
@ -1196,7 +1196,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the tagged_verse action log config object.
$tagged_verse_action_log_config = new stdClass();
$tagged_verse_action_log_config = new \stdClass();
$tagged_verse_action_log_config->type_title = 'TAGGED_VERSE';
$tagged_verse_action_log_config->type_alias = 'com_getbible.tagged_verse';
$tagged_verse_action_log_config->id_holder = 'id';
@ -1213,7 +1213,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the prompt action log config object.
$prompt_action_log_config = new stdClass();
$prompt_action_log_config = new \stdClass();
$prompt_action_log_config->type_title = 'PROMPT';
$prompt_action_log_config->type_alias = 'com_getbible.prompt';
$prompt_action_log_config->id_holder = 'id';
@ -1230,7 +1230,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the open_ai_response action log config object.
$open_ai_response_action_log_config = new stdClass();
$open_ai_response_action_log_config = new \stdClass();
$open_ai_response_action_log_config->type_title = 'OPEN_AI_RESPONSE';
$open_ai_response_action_log_config->type_alias = 'com_getbible.open_ai_response';
$open_ai_response_action_log_config->id_holder = 'id';
@ -1247,7 +1247,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the open_ai_message action log config object.
$open_ai_message_action_log_config = new stdClass();
$open_ai_message_action_log_config = new \stdClass();
$open_ai_message_action_log_config->type_title = 'OPEN_AI_MESSAGE';
$open_ai_message_action_log_config->type_alias = 'com_getbible.open_ai_message';
$open_ai_message_action_log_config->id_holder = 'id';
@ -1264,7 +1264,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the password action log config object.
$password_action_log_config = new stdClass();
$password_action_log_config = new \stdClass();
$password_action_log_config->type_title = 'PASSWORD';
$password_action_log_config->type_alias = 'com_getbible.password';
$password_action_log_config->id_holder = 'id';
@ -1281,7 +1281,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the tag action log config object.
$tag_action_log_config = new stdClass();
$tag_action_log_config = new \stdClass();
$tag_action_log_config->type_title = 'TAG';
$tag_action_log_config->type_alias = 'com_getbible.tag';
$tag_action_log_config->id_holder = 'id';
@ -1298,7 +1298,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the translation action log config object.
$translation_action_log_config = new stdClass();
$translation_action_log_config = new \stdClass();
$translation_action_log_config->type_title = 'TRANSLATION';
$translation_action_log_config->type_alias = 'com_getbible.translation';
$translation_action_log_config->id_holder = 'id';
@ -1315,7 +1315,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the book action log config object.
$book_action_log_config = new stdClass();
$book_action_log_config = new \stdClass();
$book_action_log_config->type_title = 'BOOK';
$book_action_log_config->type_alias = 'com_getbible.book';
$book_action_log_config->id_holder = 'id';
@ -1332,7 +1332,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the chapter action log config object.
$chapter_action_log_config = new stdClass();
$chapter_action_log_config = new \stdClass();
$chapter_action_log_config->type_title = 'CHAPTER';
$chapter_action_log_config->type_alias = 'com_getbible.chapter';
$chapter_action_log_config->id_holder = 'id';
@ -1349,7 +1349,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the verse action log config object.
$verse_action_log_config = new stdClass();
$verse_action_log_config = new \stdClass();
$verse_action_log_config->type_title = 'VERSE';
$verse_action_log_config->type_alias = 'com_getbible.verse';
$verse_action_log_config->id_holder = 'id';
@ -1368,7 +1368,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
// Create the note content type object.
$note = new stdClass();
$note = new \stdClass();
$note->type_title = 'Getbible Note';
$note->type_alias = 'com_getbible.note';
$note->table = '{"special": {"dbtable": "#__getbible_note","key": "id","type": "Note","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1397,7 +1397,7 @@ class Com_GetbibleInstallerScript
}
// Create the tagged_verse content type object.
$tagged_verse = new stdClass();
$tagged_verse = new \stdClass();
$tagged_verse->type_title = 'Getbible Tagged_verse';
$tagged_verse->type_alias = 'com_getbible.tagged_verse';
$tagged_verse->table = '{"special": {"dbtable": "#__getbible_tagged_verse","key": "id","type": "Tagged_verse","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1426,7 +1426,7 @@ class Com_GetbibleInstallerScript
}
// Create the prompt content type object.
$prompt = new stdClass();
$prompt = new \stdClass();
$prompt->type_title = 'Getbible Prompt';
$prompt->type_alias = 'com_getbible.prompt';
$prompt->table = '{"special": {"dbtable": "#__getbible_prompt","key": "id","type": "Prompt","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1455,7 +1455,7 @@ class Com_GetbibleInstallerScript
}
// Create the open_ai_response content type object.
$open_ai_response = new stdClass();
$open_ai_response = new \stdClass();
$open_ai_response->type_title = 'Getbible Open_ai_response';
$open_ai_response->type_alias = 'com_getbible.open_ai_response';
$open_ai_response->table = '{"special": {"dbtable": "#__getbible_open_ai_response","key": "id","type": "Open_ai_response","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1484,7 +1484,7 @@ class Com_GetbibleInstallerScript
}
// Create the open_ai_message content type object.
$open_ai_message = new stdClass();
$open_ai_message = new \stdClass();
$open_ai_message->type_title = 'Getbible Open_ai_message';
$open_ai_message->type_alias = 'com_getbible.open_ai_message';
$open_ai_message->table = '{"special": {"dbtable": "#__getbible_open_ai_message","key": "id","type": "Open_ai_message","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1513,7 +1513,7 @@ class Com_GetbibleInstallerScript
}
// Create the tag content type object.
$tag = new stdClass();
$tag = new \stdClass();
$tag->type_title = 'Getbible Tag';
$tag->type_alias = 'com_getbible.tag';
$tag->table = '{"special": {"dbtable": "#__getbible_tag","key": "id","type": "Tag","prefix": "getbibleTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
@ -1554,7 +1554,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the getbible action logs extensions object.
$getbible_action_logs_extensions = new stdClass();
$getbible_action_logs_extensions = new \stdClass();
$getbible_action_logs_extensions->extension = 'com_getbible';
// Check if getbible action log extension is already in action logs extensions DB.
@ -1577,7 +1577,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the linker action log config object.
$linker_action_log_config = new stdClass();
$linker_action_log_config = new \stdClass();
$linker_action_log_config->id = null;
$linker_action_log_config->type_title = 'LINKER';
$linker_action_log_config->type_alias = 'com_getbible.linker';
@ -1611,7 +1611,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the note action log config object.
$note_action_log_config = new stdClass();
$note_action_log_config = new \stdClass();
$note_action_log_config->id = null;
$note_action_log_config->type_title = 'NOTE';
$note_action_log_config->type_alias = 'com_getbible.note';
@ -1645,7 +1645,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the tagged_verse action log config object.
$tagged_verse_action_log_config = new stdClass();
$tagged_verse_action_log_config = new \stdClass();
$tagged_verse_action_log_config->id = null;
$tagged_verse_action_log_config->type_title = 'TAGGED_VERSE';
$tagged_verse_action_log_config->type_alias = 'com_getbible.tagged_verse';
@ -1679,7 +1679,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the prompt action log config object.
$prompt_action_log_config = new stdClass();
$prompt_action_log_config = new \stdClass();
$prompt_action_log_config->id = null;
$prompt_action_log_config->type_title = 'PROMPT';
$prompt_action_log_config->type_alias = 'com_getbible.prompt';
@ -1713,7 +1713,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the open_ai_response action log config object.
$open_ai_response_action_log_config = new stdClass();
$open_ai_response_action_log_config = new \stdClass();
$open_ai_response_action_log_config->id = null;
$open_ai_response_action_log_config->type_title = 'OPEN_AI_RESPONSE';
$open_ai_response_action_log_config->type_alias = 'com_getbible.open_ai_response';
@ -1747,7 +1747,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the open_ai_message action log config object.
$open_ai_message_action_log_config = new stdClass();
$open_ai_message_action_log_config = new \stdClass();
$open_ai_message_action_log_config->id = null;
$open_ai_message_action_log_config->type_title = 'OPEN_AI_MESSAGE';
$open_ai_message_action_log_config->type_alias = 'com_getbible.open_ai_message';
@ -1781,7 +1781,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the password action log config object.
$password_action_log_config = new stdClass();
$password_action_log_config = new \stdClass();
$password_action_log_config->id = null;
$password_action_log_config->type_title = 'PASSWORD';
$password_action_log_config->type_alias = 'com_getbible.password';
@ -1815,7 +1815,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the tag action log config object.
$tag_action_log_config = new stdClass();
$tag_action_log_config = new \stdClass();
$tag_action_log_config->id = null;
$tag_action_log_config->type_title = 'TAG';
$tag_action_log_config->type_alias = 'com_getbible.tag';
@ -1849,7 +1849,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the translation action log config object.
$translation_action_log_config = new stdClass();
$translation_action_log_config = new \stdClass();
$translation_action_log_config->id = null;
$translation_action_log_config->type_title = 'TRANSLATION';
$translation_action_log_config->type_alias = 'com_getbible.translation';
@ -1883,7 +1883,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the book action log config object.
$book_action_log_config = new stdClass();
$book_action_log_config = new \stdClass();
$book_action_log_config->id = null;
$book_action_log_config->type_title = 'BOOK';
$book_action_log_config->type_alias = 'com_getbible.book';
@ -1917,7 +1917,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the chapter action log config object.
$chapter_action_log_config = new stdClass();
$chapter_action_log_config = new \stdClass();
$chapter_action_log_config->id = null;
$chapter_action_log_config->type_title = 'CHAPTER';
$chapter_action_log_config->type_alias = 'com_getbible.chapter';
@ -1951,7 +1951,7 @@ class Com_GetbibleInstallerScript
$db = Factory::getDbo();
}
// Create the verse action log config object.
$verse_action_log_config = new stdClass();
$verse_action_log_config = new \stdClass();
$verse_action_log_config->id = null;
$verse_action_log_config->type_title = 'VERSE';
$verse_action_log_config->type_alias = 'com_getbible.verse';

View File

@ -1,19 +0,0 @@
/*----------------------------------------------------------------------------------| 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
/------------------------------------------------------------------------------------------------------*/
/* CSS Document */

View File

@ -87,7 +87,15 @@ class GetbibleControllerAjax extends BaseController
$chapterValue = $jinput->get('chapter', null, 'INT');
if($linkerValue && $translationValue && $bookValue && $chapterValue)
{
$result = $this->getModel('ajax')->getShareHisWordUrl($linkerValue, $translationValue, $bookValue, $chapterValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->getShareHisWordUrl($linkerValue, $translationValue, $bookValue, $chapterValue);
}
else
{
$result = false;
}
}
else
{
@ -129,7 +137,15 @@ class GetbibleControllerAjax extends BaseController
$oldValue = $jinput->get('old', null, 'STRING');
if($linkerValue && $oldValue)
{
$result = $this->getModel('ajax')->checkValidLinker($linkerValue, $oldValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->checkValidLinker($linkerValue, $oldValue);
}
else
{
$result = false;
}
}
else
{
@ -170,7 +186,15 @@ class GetbibleControllerAjax extends BaseController
$linkerValue = $jinput->get('linker', null, 'STRING');
if($linkerValue)
{
$result = $this->getModel('ajax')->isLinkerAuthenticated($linkerValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->isLinkerAuthenticated($linkerValue);
}
else
{
$result = false;
}
}
else
{
@ -214,7 +238,15 @@ class GetbibleControllerAjax extends BaseController
$forceValue = $jinput->get('force', 0, 'INT');
if($translationValue && $bookValue && $chapterValue)
{
$result = $this->getModel('ajax')->installBibleChapter($translationValue, $bookValue, $chapterValue, $forceValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->installBibleChapter($translationValue, $bookValue, $chapterValue, $forceValue);
}
else
{
$result = false;
}
}
else
{
@ -258,7 +290,15 @@ class GetbibleControllerAjax extends BaseController
$verseValue = $jinput->get('verse', null, 'STRING');
if($translationValue && $bookValue)
{
$result = $this->getModel('ajax')->getAppUrl($translationValue, $bookValue, $chapterValue, $verseValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->getAppUrl($translationValue, $bookValue, $chapterValue, $verseValue);
}
else
{
$result = false;
}
}
else
{
@ -299,7 +339,15 @@ class GetbibleControllerAjax extends BaseController
$linkerValue = $jinput->get('linker', null, 'STRING');
if($linkerValue)
{
$result = $this->getModel('ajax')->setLinker($linkerValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->setLinker($linkerValue);
}
else
{
$result = false;
}
}
else
{
@ -342,7 +390,15 @@ class GetbibleControllerAjax extends BaseController
$oldValue = $jinput->get('old', null, 'STRING');
if($linkerValue && $passValue)
{
$result = $this->getModel('ajax')->setLinkerAccess($linkerValue, $passValue, $oldValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->setLinkerAccess($linkerValue, $passValue, $oldValue);
}
else
{
$result = false;
}
}
else
{
@ -383,7 +439,15 @@ class GetbibleControllerAjax extends BaseController
$linkerValue = $jinput->get('linker', null, 'STRING');
if($linkerValue)
{
$result = $this->getModel('ajax')->revokeLinkerSession($linkerValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->revokeLinkerSession($linkerValue);
}
else
{
$result = false;
}
}
else
{
@ -424,7 +488,15 @@ class GetbibleControllerAjax extends BaseController
$linkerValue = $jinput->get('linker', null, 'STRING');
if($linkerValue)
{
$result = $this->getModel('ajax')->revokeLinkerAccess($linkerValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->revokeLinkerAccess($linkerValue);
}
else
{
$result = false;
}
}
else
{
@ -465,7 +537,15 @@ class GetbibleControllerAjax extends BaseController
$nameValue = $jinput->get('name', null, 'STRING');
if($nameValue)
{
$result = $this->getModel('ajax')->setLinkerName($nameValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->setLinkerName($nameValue);
}
else
{
$result = false;
}
}
else
{
@ -506,7 +586,15 @@ class GetbibleControllerAjax extends BaseController
$linkersValue = $jinput->get('linkers', null, 'STRING');
if($linkersValue)
{
$result = $this->getModel('ajax')->getLinkersDisplay($linkersValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->getLinkersDisplay($linkersValue);
}
else
{
$result = false;
}
}
else
{
@ -550,7 +638,15 @@ class GetbibleControllerAjax extends BaseController
$noteValue = $jinput->get('note', null, 'STRING');
if($bookValue && $chapterValue && $verseValue)
{
$result = $this->getModel('ajax')->setNote($bookValue, $chapterValue, $verseValue, $noteValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->setNote($bookValue, $chapterValue, $verseValue, $noteValue);
}
else
{
$result = false;
}
}
else
{
@ -595,7 +691,15 @@ class GetbibleControllerAjax extends BaseController
$tagValue = $jinput->get('tag', null, 'STRING');
if($translationValue && $bookValue && $chapterValue && $verseValue && $tagValue)
{
$result = $this->getModel('ajax')->tagVerse($translationValue, $bookValue, $chapterValue, $verseValue, $tagValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->tagVerse($translationValue, $bookValue, $chapterValue, $verseValue, $tagValue);
}
else
{
$result = false;
}
}
else
{
@ -636,7 +740,15 @@ class GetbibleControllerAjax extends BaseController
$tagValue = $jinput->get('tag', null, 'STRING');
if($tagValue)
{
$result = $this->getModel('ajax')->removeTagFromVerse($tagValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->removeTagFromVerse($tagValue);
}
else
{
$result = false;
}
}
else
{
@ -678,7 +790,15 @@ class GetbibleControllerAjax extends BaseController
$descriptionValue = $jinput->get('description', null, 'STRING');
if($nameValue)
{
$result = $this->getModel('ajax')->createTag($nameValue, $descriptionValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->createTag($nameValue, $descriptionValue);
}
else
{
$result = false;
}
}
else
{
@ -721,7 +841,15 @@ class GetbibleControllerAjax extends BaseController
$descriptionValue = $jinput->get('description', null, 'STRING');
if($tagValue && $nameValue)
{
$result = $this->getModel('ajax')->updateTag($tagValue, $nameValue, $descriptionValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->updateTag($tagValue, $nameValue, $descriptionValue);
}
else
{
$result = false;
}
}
else
{
@ -762,7 +890,15 @@ class GetbibleControllerAjax extends BaseController
$tagValue = $jinput->get('tag', null, 'STRING');
if($tagValue)
{
$result = $this->getModel('ajax')->deleteTag($tagValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->deleteTag($tagValue);
}
else
{
$result = false;
}
}
else
{
@ -811,7 +947,15 @@ class GetbibleControllerAjax extends BaseController
$chapterValue = $jinput->get('chapter', 0, 'INT');
if($translationValue && $wordsValue && $matchValue && $caseValue && $targetValue)
{
$result = $this->getModel('ajax')->getSearchUrl($translationValue, $wordsValue, $matchValue, $caseValue, $targetValue, $searchValue, $target_bookValue, $bookValue, $chapterValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->getSearchUrl($translationValue, $wordsValue, $matchValue, $caseValue, $targetValue, $searchValue, $target_bookValue, $bookValue, $chapterValue);
}
else
{
$result = false;
}
}
else
{
@ -857,7 +1001,15 @@ class GetbibleControllerAjax extends BaseController
$guidValue = $jinput->get('guid', NULL, 'STRING');
if($chapterValue && $bookValue && $translationValue && $guidValue)
{
$result = $this->getModel('ajax')->getOpenaiURL($wordsValue, $verseValue, $chapterValue, $bookValue, $translationValue, $guidValue);
$ajaxModule = $this->getModel('ajax');
if ($ajaxModule)
{
$result = $ajaxModule->getOpenaiURL($wordsValue, $verseValue, $chapterValue, $bookValue, $translationValue, $guidValue);
}
else
{
$result = false;
}
}
else
{

View File

@ -205,49 +205,6 @@ abstract class GetbibleHelperRoute
return $link;
}
/**
* @param int The route of the Api
*/
public static function getApiRoute($id = 0, $catid = 0)
{
if ($id > 0)
{
// Initialize the needel array.
$needles = array(
'api' => array((int) $id)
);
// Create the link
$link = 'index.php?option=com_getbible&view=api&id='. $id;
}
else
{
// Initialize the needel array.
$needles = array(
'api' => array()
);
// Create the link but don't add the id.
$link = 'index.php?option=com_getbible&view=api';
}
if ($catid > 1)
{
$categories = Categories::getInstance('getbible.api');
$category = $categories->get($catid);
if ($category)
{
$needles['category'] = array_reverse($category->getPath());
$needles['categories'] = $needles['category'];
$link .= '&catid='.$catid;
}
}
if ($item = self::_findItem($needles))
{
$link .= '&Itemid='.$item;
}
return $link;
}
/**
* Get the URL route for getbible category from a category ID and language
*

View File

@ -15,8 +15,6 @@ COM_GETBIBLE_ALL="All"
COM_GETBIBLE_ALL_BOOKS="All Books"
COM_GETBIBLE_ALL_WORDS="All Words"
COM_GETBIBLE_ANY_WORDS="Any Words"
COM_GETBIBLE_API="Api"
COM_GETBIBLE_API_DESC="Api"
COM_GETBIBLE_API_SOURCE="API Source"
COM_GETBIBLE_APP="App"
COM_GETBIBLE_APP_DESC="App"
@ -72,7 +70,6 @@ COM_GETBIBLE_FOUND="Found"
COM_GETBIBLE_FOUND_AN_ISSUE_REPORT_IT_TODAY="Found an issue? Report it today!"
COM_GETBIBLE_FREQUENCY_PENALTY="Frequency Penalty"
COM_GETBIBLE_HEADERS="Headers"
COM_GETBIBLE_HELLO_S="Hello %s"
COM_GETBIBLE_HIDE="Hide"
COM_GETBIBLE_HOWEVER_TO_MODIFY_YOUR_SPAN_CLASSGETBIBLEACTIVITYNOTESANDTAGSNOTES_AND_TAGSSPAN_YOU_NEED_BOTH_THE_PERSISTENT_SESSION_KEY_AND_YOUR_FAVOURITE_VERSE="However, to modify your <span class="getbible-activity-notes-and-tags">notes and tags</span>, you need both the persistent session key and your favourite verse."
COM_GETBIBLE_HOW_THIS_ALL_WORKS="How This All Works"

View File

@ -26,4 +26,4 @@ use Joomla\CMS\Layout\LayoutHelper;
?>
<?php echo JLayoutHelper::render('getbibleappnotelink', ['number' => $displayData['number']]); ?>&nbsp;<span id="getbible-verse-note-<?php echo $displayData['number']; ?>" class="getbible-verse-note uk-text-muted"><?php echo $displayData['note']; ?></span>
<?php echo LayoutHelper::render('getbibleappnotelink', ['number' => $displayData['number']]); ?>&nbsp;<span id="getbible-verse-note-<?php echo $displayData['number']; ?>" class="getbible-verse-note uk-text-muted"><?php echo $displayData['note']; ?></span>

View File

@ -45,7 +45,7 @@ $verses = array_map( function ($item) {
<div class="uk-child-width-expand uk-text-center" uk-grid>
<div>
<div class="uk-card">
<?php echo JLayoutHelper::render('selectbox', [
<?php echo LayoutHelper::render('selectbox', [
'id' => 'getbible_favourite_book',
'label' => Text::_('COM_GETBIBLE_BOOKS'),
'options' => $displayData['book_options'],
@ -55,7 +55,7 @@ $verses = array_map( function ($item) {
</div>
<div>
<div class="uk-card">
<?php echo JLayoutHelper::render('selectbox', [
<?php echo LayoutHelper::render('selectbox', [
'id' => 'getbible_favourite_chapter',
'label' => Text::_('COM_GETBIBLE_CHAPTERS'),
'options' => $chapters,
@ -65,7 +65,7 @@ $verses = array_map( function ($item) {
</div>
<div>
<div class="uk-card">
<?php echo JLayoutHelper::render('selectbox', [
<?php echo LayoutHelper::render('selectbox', [
'id' => 'getbible_favourite_verse',
'label' => Text::_('COM_GETBIBLE_VERSES'),
'options' => $verses,
@ -78,7 +78,7 @@ $verses = array_map( function ($item) {
<?php echo Text::_('COM_GETBIBLE_THIS_IS_CURRENTLY_THE_ACTIVE_SESSION_KEY'); ?>
</p>
<div class="uk-child-width-expand uk-text-center" uk-grid>
<?php echo JLayoutHelper::render('inputbox', [
<?php echo LayoutHelper::render('inputbox', [
'id' => 'getbible_favourite_linker',
'class_other' => 'getbible-linker-guid-input uk-text-center',
'label' => Text::_('COM_GETBIBLE_SESSION_KEY'),

View File

@ -43,8 +43,8 @@ if (!empty($displayData))
<?php foreach ($displayData as $linker): ?>
<?php if ($linker->name !== null): ?>
<li id="getbible-local-linker-display-<?php echo $linker->guid; ?>">
<?php echo JLayoutHelper::render('inputbox', ['id' => 'get-session-name-' . $linker->guid, 'label' => Text::_('COM_GETBIBLE_SESSION_NAME'), 'value' => $linker->name, 'readonly' => true]); ?>
<?php echo JLayoutHelper::render('inputbox', ['id' => 'get-session-key-' . $linker->guid, 'label' => Text::_('COM_GETBIBLE_SESSION_KEY'), 'value' => $linker->guid, 'readonly' => true]); ?>
<?php echo LayoutHelper::render('inputbox', ['id' => 'get-session-name-' . $linker->guid, 'label' => Text::_('COM_GETBIBLE_SESSION_NAME'), 'value' => $linker->name, 'readonly' => true]); ?>
<?php echo LayoutHelper::render('inputbox', ['id' => 'get-session-key-' . $linker->guid, 'label' => Text::_('COM_GETBIBLE_SESSION_KEY'), 'value' => $linker->guid, 'readonly' => true]); ?>
<div class="uk-button-group uk-width-1-1">
<button class="uk-button uk-button-default uk-width-1-3" onclick="loadGetBiblePersistentSessionLinker('<?php echo $linker->guid; ?>');"><?php echo Text::_('COM_GETBIBLE_LOAD'); ?></button>
<button class="uk-button uk-button-default uk-width-1-3" onclick="copyGetBiblePersistentSessionUrl('<?php echo $linker->guid; ?>');"><?php echo Text::_('COM_GETBIBLE_COPY'); ?></button>

View File

@ -27,4 +27,4 @@ use Joomla\CMS\Layout\LayoutHelper;
?>
<a class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-large" href="<?php echo $displayData['url']; ?>"><?php echo $displayData['name']; ?></a>
<?php echo JLayoutHelper::render('getbibleverses', $displayData['verses']); ?>
<?php echo LayoutHelper::render('getbibleverses', $displayData['verses']); ?>

View File

@ -27,7 +27,7 @@ use Joomla\CMS\Layout\LayoutHelper;
$target = $displayData['active']->target ?? '';
// build the verse number
$number = '<span id="getbible-verse-number-' . $displayData['verse']->verse . '" class="getbible-verse-number">' . $displayData['verse']->verse . JLayoutHelper::render('getbibleversetag', $displayData) . '<span>';
$number = '<span id="getbible-verse-number-' . $displayData['verse']->verse . '" class="getbible-verse-number">' . $displayData['verse']->verse . LayoutHelper::render('getbibleversetag', $displayData) . '<span>';
// build the actual verse text
$text = '<span id="getbible-verse-text-' . $displayData['verse']->verse . '" class="getbible-verse-text">' . $displayData['verse']->text . '<span>';

View File

@ -35,6 +35,6 @@ $margin = (isset($displayData['margin'])) ? $displayData['margin'] : 'uk-margin-
<div class="<?php echo $margin; ?>">
<label class="<?php echo $class_label ; echo $class_other_label; ?>" for="<?php echo $name; ?>"><?php echo $label; ?></label>
<div class="uk-form-controls">
<?php echo JLayoutHelper::render('input', $displayData); ?>
<?php echo LayoutHelper::render('input', $displayData); ?>
</div>
</div>

View File

@ -23,7 +23,9 @@ use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
$url = $displayData ? JRoute::_('index.php?option=com_getbible&view=app&t=' . $displayData->abbreviation . '&ref=' . $displayData->name . '&c=' . $displayData->chapter) : null;
use Joomla\CMS\Router\Route;
$url = $displayData ? Route::_('index.php?option=com_getbible&view=app&t=' . $displayData->abbreviation . '&ref=' . $displayData->name . '&c=' . $displayData->chapter) : null;
?>
<?php if ($url): ?>

View File

@ -23,7 +23,9 @@ use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
$url = $displayData ? JRoute::_('index.php?option=com_getbible&view=app&t=' . $displayData->abbreviation . '&ref=' . $displayData->name . '&c=' . $displayData->chapter) : null;
use Joomla\CMS\Router\Route;
$url = $displayData ? Route::_('index.php?option=com_getbible&view=app&t=' . $displayData->abbreviation . '&ref=' . $displayData->name . '&c=' . $displayData->chapter) : null;
?>
<?php if ($url): ?>

View File

@ -33,6 +33,6 @@ $margin = (isset($displayData['margin'])) ? $displayData['margin'] : 'uk-margin-
<div class="<?php echo $margin; ?>">
<label class="uk-form-label" for="<?php echo $name; ?>"><?php echo $label; ?></label>
<div class="uk-form-controls">
<?php echo JLayoutHelper::render('select', $displayData); ?>
<?php echo LayoutHelper::render('select', $displayData); ?>
</div>
</div>

View File

@ -65,7 +65,7 @@ $items = (isset($displayData['items'])) ? $displayData['items'] : 6;
<?php endif; ?>
</thead>
<tbody>
<?php echo JLayoutHelper::render('rows', ['headers' => $headers, 'items' => $items]); ?>
<?php echo LayoutHelper::render('rows', ['headers' => $headers, 'items' => $items]); ?>
</tbody>
</table>
</div>
@ -75,8 +75,8 @@ $items = (isset($displayData['items'])) ? $displayData['items'] : 6;
if (!isset($displayData['init']) || $displayData['init']) :
?>
<script type="text/javascript">
jQuery(document).ready(function() {
var <?php echo $table_id; ?> = jQuery('#<?php echo $table_id; ?>').DataTable({
document.addEventListener('DOMContentLoaded', function() {
var <?php echo $table_id; ?> = new DataTable('#<?php echo $table_id; ?>', {
paging: false,
select: true
});

View File

@ -33,6 +33,6 @@ $margin = (isset($displayData['margin'])) ? $displayData['margin'] : 'uk-margin-
<div class="<?php echo $margin; ?>">
<label class="uk-form-label" for="<?php echo $name; ?>"><?php echo $label; ?></label>
<div class="uk-form-controls">
<?php echo JLayoutHelper::render('textarea', $displayData); ?>
<?php echo LayoutHelper::render('textarea', $displayData); ?>
</div>
</div>

View File

@ -24,6 +24,9 @@ use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Layout\LayoutHelper;
use VDM\Joomla\GetBible\Factory as GetBibleFactory;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\GuidHelper;
@ -65,7 +68,7 @@ class GetbibleModelAjax extends ListModel
// we check if this is a valid linker value
if (GetBibleFactory::_('GetBible.Linker')->valid($linker))
{
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=app&translation=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter . '&Share_His_Word=' . $linker))];
return ['url' => trim(trim(Uri::base(), '/') . Route::_('index.php?option=com_getbible&view=app&translation=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter . '&Share_His_Word=' . $linker))];
}
return ['error' => Text::_('COM_GETBIBLE_THIS_SESSION_KEY_IS_NOT_YET_ELIGIBLE_FOR_SHARING_AS_NO_ACTIONS_HAVE_BEEN_PERFORMED_WITHIN_IT')];
@ -144,7 +147,7 @@ class GetbibleModelAjax extends ListModel
int $chapter = 1,
?string $verse = ''): ?array
{
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&ref=' . $book . '&c=' . $chapter . '&v=' . $verse))];
return ['url' => trim(trim(Uri::base(), '/') . Route::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&ref=' . $book . '&c=' . $chapter . '&v=' . $verse))];
}
/**
@ -410,10 +413,10 @@ class GetbibleModelAjax extends ListModel
{
if (JsonHelper::check($linkers))
{
return ['display' => JLayoutHelper::render('getbiblelinkers', json_decode($linkers))];
return ['display' => LayoutHelper::render('getbiblelinkers', json_decode($linkers))];
}
return ['display' => JLayoutHelper::render('getbiblelinkers', null)];
return ['display' => LayoutHelper::render('getbiblelinkers', null)];
}
// Used in search
@ -450,10 +453,10 @@ class GetbibleModelAjax extends ListModel
$return = '';
if ($book > 0 && $chapter > 0)
{
$return = '&bibleurl=' . urlencode(base64_encode(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
$return = '&bibleurl=' . urlencode(base64_encode(trim(Uri::base(), '/') . Route::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
}
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=search&Itemid=' . $this->app_params->get('app_menu', 0) . $return . '&t=' . $translation . '&words=' . $words . '&match=' . $match . '&case=' . $case . '&target=' . $target . '&search=' . $search ?? ''))];
return ['url' => trim(trim(Uri::base(), '/') . Route::_('index.php?option=com_getbible&view=search&Itemid=' . $this->app_params->get('app_menu', 0) . $return . '&t=' . $translation . '&words=' . $words . '&match=' . $match . '&case=' . $case . '&target=' . $target . '&search=' . $search ?? ''))];
}
return ['error' => 'The search feature has not been activated. Please contact the system administrator of this website to resolve this.'];
@ -486,11 +489,11 @@ class GetbibleModelAjax extends ListModel
{
if ($abbreviation === 'all' || $abbreviation === $translation)
{
// set the return URL
$return = urlencode(base64_encode((string) JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
// set the return UR
$return = urlencode(base64_encode((string) Route::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
// we return the AI url
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=openai&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&bibleurl=' . $return . '&guid=' . $guid . '&book=' . $book . '&chapter=' . $chapter . '&verse=' . $verse . '&words=' . $words))];
return ['url' => trim(trim(Uri::base(), '/') . Route::_('index.php?option=com_getbible&view=openai&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&bibleurl=' . $return . '&guid=' . $guid . '&book=' . $book . '&chapter=' . $chapter . '&verse=' . $verse . '&words=' . $words))];
}
return ['error' => 'There was an error please try again.'];

View File

@ -1,115 +0,0 @@
<?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\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Helper\TagsHelper;
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
/**
* Getbible List Model for Api
*/
class GetbibleModelApi extends ListModel
{
/**
* Model user data.
*
* @var strings
*/
protected $user;
protected $userId;
protected $guest;
protected $groups;
protected $levels;
protected $app;
protected $input;
protected $uikitComp;
/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
*/
protected function getListQuery()
{
// Get the current user for authorisation checks
$this->user = Factory::getUser();
$this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups');
$this->authorisedGroups = $this->user->getAuthorisedGroups();
$this->levels = $this->user->getAuthorisedViewLevels();
$this->app = Factory::getApplication();
$this->input = $this->app->input;
$this->initSet = true;
// Make sure all records load, since no pagination allowed.
$this->setState('list.limit', 0);
// Get a db connection.
$db = Factory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Get from #__getbible_translation as a
$query->select($db->quoteName(
array('a.id','a.abbr','a.language','a.name'),
array('id','abbr','language','name')));
$query->from($db->quoteName('#__getbible_translation', 'a'));
// Get where a.published is 1
$query->where('a.published = 1');
$query->order('a.language ASC');
$query->order('a.name ASC');
// return the query object
return $query;
}
/**
* Method to get an array of data items.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getItems()
{
$user = Factory::getUser();
// load parent items
$items = parent::getItems();
// Get the global params
$globalParams = ComponentHelper::getParams('com_getbible', true);
// Insure all item fields are adapted where needed.
if (UtilitiesArrayHelper::check($items))
{
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
}
}
// return items
return $items;
}
}

View File

@ -182,16 +182,13 @@ class GetbibleModelApp extends ItemModel
// we found another book
$this->book = $book;
// since we could not find the book we where looking for, we redirect to what we found
$app = Factory::getApplication();
// get the book name
$name = $this->getBookName($this->book, $this->translation) ?? $book;
// we state this obvious result to the user
$app->enqueueMessage(Text::sprintf("COM_GETBIBLE_WERE_SORRY_THE_TRANSLATION_YOU_SELECTED_DOES_NOT_INCLUDE_THE_BOOK_YOU_WERE_IN_PREVIOUSLY_HOWEVER_WE_HAVE_LOCATED_BSB_WHICH_MIGHT_BE_OF_INTEREST_TO_YOU", $name), 'warning');
$this->app->enqueueMessage(Text::sprintf("COM_GETBIBLE_WERE_SORRY_THE_TRANSLATION_YOU_SELECTED_DOES_NOT_INCLUDE_THE_BOOK_YOU_WERE_IN_PREVIOUSLY_HOWEVER_WE_HAVE_LOCATED_BSB_WHICH_MIGHT_BE_OF_INTEREST_TO_YOU", $name), 'warning');
$app->redirect(JRoute::_('index.php?option=com_getbible&view=app&t=' . $this->translation . '&ref=' . $name));
$this->app->redirect(Route::_('index.php?option=com_getbible&view=app&t=' . $this->translation . '&ref=' . $name));
return false;
}
@ -439,7 +436,7 @@ class GetbibleModelApp extends ItemModel
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on text
$_text = new stdClass();
$_text = new \stdClass();
$_text->text =& $item->text; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (text) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.text', &$_text, &$params, 0));
@ -507,7 +504,7 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
}
}
// return items
@ -578,7 +575,7 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
}
}
// return items
@ -685,7 +682,7 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
}
}
// return items
@ -1003,12 +1000,12 @@ class GetbibleModelApp extends ItemModel
// Check if item has params, or pass whole item.
$params = (isset($data->params) && JsonHelper::check($data->params)) ? json_decode($data->params) : $data;
// Make sure the content prepare plugins fire on distribution_about
$_distribution_about = new stdClass();
$_distribution_about = new \stdClass();
$_distribution_about->text =& $data->distribution_about; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (distribution_about) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.distribution_about', &$_distribution_about, &$params, 0));
// Make sure the content prepare plugins fire on distribution_license
$_distribution_license = new stdClass();
$_distribution_license = new \stdClass();
$_distribution_license->text =& $data->distribution_license; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (distribution_license) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.distribution_license', &$_distribution_license, &$params, 0));
@ -1101,11 +1098,11 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on note
$_note = new stdClass();
$_note = new \stdClass();
$_note->text =& $item->note; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (note) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.note', &$_note, &$params, 0));
@ -1213,11 +1210,11 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on note
$_note = new stdClass();
$_note = new \stdClass();
$_note->text =& $item->note; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (note) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.note', &$_note, &$params, 0));
@ -1283,11 +1280,11 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on description
$_description = new stdClass();
$_description = new \stdClass();
$_description->text =& $item->description; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (description) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.description', &$_description, &$params, 0));
@ -1389,11 +1386,11 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on description
$_description = new stdClass();
$_description = new \stdClass();
$_description->text =& $item->description; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (description) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.description', &$_description, &$params, 0));
@ -1465,7 +1462,7 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
}
}
// return items
@ -1587,11 +1584,11 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on description
$_description = new stdClass();
$_description = new \stdClass();
$_description->text =& $item->description; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (description) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.description', &$_description, &$params, 0));
@ -1669,11 +1666,11 @@ class GetbibleModelApp extends ItemModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on description
$_description = new stdClass();
$_description = new \stdClass();
$_description->text =& $item->description; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (description) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.app.description', &$_description, &$params, 0));

View File

@ -160,28 +160,25 @@ class GetbibleModelOpenai extends ItemModel
{
$data = Openai::_('GetBible.AI')->get();
}
catch (DomainException $e)
catch (\DomainException $e)
{
$app = Factory::getApplication();
// If no data is found redirect to default page and show warning.
$app->enqueueMessage($e->getMessage(), 'error');
$app->redirect(JRoute::_('index.php?option=com_getbible&view=app'));
$this->app->enqueueMessage($e->getMessage(), 'error');
$this->app->redirect(Route::_('index.php?option=com_getbible&view=app'));
return false;
}
catch (InvalidArgumentException $e)
catch (\InvalidArgumentException $e)
{
$app = Factory::getApplication();
// If no data is found redirect to default page and show warning.
$app->enqueueMessage($e->getMessage(), 'error');
$app->redirect(JRoute::_('index.php?option=com_getbible&view=app'));
$this->app->enqueueMessage($e->getMessage(), 'error');
$this->app->redirect(Route::_('index.php?option=com_getbible&view=app'));
return false;
}
catch (Exception $e)
catch (\Exception $e)
{
$app = Factory::getApplication();
// If no data is found redirect to default page and show warning.
$app->enqueueMessage($e->getMessage(), 'error');
$app->redirect(JRoute::_('index.php?option=com_getbible&view=app'));
$this->app->enqueueMessage($e->getMessage(), 'error');
$this->app->redirect(Route::_('index.php?option=com_getbible&view=app'));
return false;
}
@ -281,12 +278,12 @@ class GetbibleModelOpenai extends ItemModel
// Check if item has params, or pass whole item.
$params = (isset($data->params) && JsonHelper::check($data->params)) ? json_decode($data->params) : $data;
// Make sure the content prepare plugins fire on distribution_about
$_distribution_about = new stdClass();
$_distribution_about = new \stdClass();
$_distribution_about->text =& $data->distribution_about; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (distribution_about) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.openai.distribution_about', &$_distribution_about, &$params, 0));
// Make sure the content prepare plugins fire on distribution_license
$_distribution_license = new stdClass();
$_distribution_license = new \stdClass();
$_distribution_license->text =& $data->distribution_license; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (distribution_license) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.openai.distribution_license', &$_distribution_license, &$params, 0));

View File

@ -130,8 +130,6 @@ class GetbibleModelSearch extends ListModel
// echo nl2br(str_replace('#__', 'api_', $query)); die;
// load helper UtilitiesArrayHelper
return $query;
// return the query object
return $query;
}
@ -209,7 +207,7 @@ class GetbibleModelSearch extends ListModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
}
}
// return items
@ -280,7 +278,7 @@ class GetbibleModelSearch extends ListModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
}
}
// return items
@ -353,12 +351,12 @@ class GetbibleModelSearch extends ListModel
// Check if item has params, or pass whole item.
$params = (isset($data->params) && JsonHelper::check($data->params)) ? json_decode($data->params) : $data;
// Make sure the content prepare plugins fire on distribution_about
$_distribution_about = new stdClass();
$_distribution_about = new \stdClass();
$_distribution_about->text =& $data->distribution_about; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (distribution_about) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.search.distribution_about', &$_distribution_about, &$params, 0));
// Make sure the content prepare plugins fire on distribution_license
$_distribution_license = new stdClass();
$_distribution_license = new \stdClass();
$_distribution_license->text =& $data->distribution_license; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (distribution_license) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.search.distribution_license', &$_distribution_license, &$params, 0));
@ -375,7 +373,7 @@ class GetbibleModelSearch extends ListModel
protected function loadRequestParameters()
{
// Get the global params
$globalParams = JComponentHelper::getParams('com_getbible', true);
$globalParams = ComponentHelper::getParams('com_getbible', true);
$this->translation = $this->input->getString('t') ?? $this->input->getString('translation', $globalParams->get('default_translation', 'kjv'));
$this->words = $this->input->getInt('words', $globalParams->get('search_words', 1));

View File

@ -185,11 +185,11 @@ class GetbibleModelTag extends ListModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on text
$_text = new stdClass();
$_text = new \stdClass();
$_text->text =& $item->text; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (text) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.tag.text', &$_text, &$params, 0));
@ -266,12 +266,12 @@ class GetbibleModelTag extends ListModel
// Check if item has params, or pass whole item.
$params = (isset($data->params) && JsonHelper::check($data->params)) ? json_decode($data->params) : $data;
// Make sure the content prepare plugins fire on distribution_about
$_distribution_about = new stdClass();
$_distribution_about = new \stdClass();
$_distribution_about->text =& $data->distribution_about; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (distribution_about) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.tag.distribution_about', &$_distribution_about, &$params, 0));
// Make sure the content prepare plugins fire on distribution_license
$_distribution_license = new stdClass();
$_distribution_license = new \stdClass();
$_distribution_license->text =& $data->distribution_license; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (distribution_license) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.tag.distribution_license', &$_distribution_license, &$params, 0));
@ -336,11 +336,11 @@ class GetbibleModelTag extends ListModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on description
$_description = new stdClass();
$_description = new \stdClass();
$_description->text =& $item->description; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (description) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.tag.description', &$_description, &$params, 0));
@ -418,11 +418,11 @@ class GetbibleModelTag extends ListModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on description
$_description = new stdClass();
$_description = new \stdClass();
$_description->text =& $item->description; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (description) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.tag.description', &$_description, &$params, 0));
@ -494,7 +494,7 @@ class GetbibleModelTag extends ListModel
// Check if item has params, or pass whole item.
$params = (isset($data->params) && JsonHelper::check($data->params)) ? json_decode($data->params) : $data;
// Make sure the content prepare plugins fire on description
$_description = new stdClass();
$_description = new \stdClass();
$_description->text =& $data->description; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (description) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.tag.description', &$_description, &$params, 0));
@ -641,11 +641,11 @@ class GetbibleModelTag extends ListModel
foreach ($items as $nr => &$item)
{
// Always create a slug for sef URL's
$item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id;
$item->slug = ($item->id ?? '0') . (isset($item->alias) ? ':' . $item->alias : '');
// Check if item has params, or pass whole item.
$params = (isset($item->params) && JsonHelper::check($item->params)) ? json_decode($item->params) : $item;
// Make sure the content prepare plugins fire on text
$_text = new stdClass();
$_text = new \stdClass();
$_text->text =& $item->text; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (text) to context
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_getbible.tag.text', &$_text, &$params, 0));

View File

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

View File

@ -1,26 +0,0 @@
<?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\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
?>
<?php echo $this->toolbar->render(); ?>
<?php echo Text::sprintf('COM_GETBIBLE_HELLO_S', $this->user->name); ?>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<metadata>
<layout title="COM_GETBIBLE_MENU_API_TITLE" option="COM_GETBIBLE_MENU_API_OPTION">
<message>
<![CDATA[COM_GETBIBLE_MENU_API_DESC]]>
</message>
</layout>
</metadata>

View File

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

View File

@ -1,127 +0,0 @@
<?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\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Toolbar\ToolbarHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Getbible Html View class for the Api
*/
class GetbibleViewApi extends HtmlView
{
// Overwriting JView display method
function display($tpl = null)
{
// get combined params of both component and menu
$this->app = Factory::getApplication();
$this->params = $this->app->getParams();
$this->menu = $this->app->getMenu()->getActive();
// get the user object
$this->user = Factory::getUser();
// Initialise variables.
$this->items = $this->get('Items');
// Set the toolbar
$this->addToolBar();
// set the document
$this->_prepareDocument();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new \Exception(implode(PHP_EOL, $errors), 500);
}
parent::display($tpl);
}
/**
* Prepares the document
*/
protected function _prepareDocument()
{
// Only load jQuery if needed. (default is true)
if ($this->params->get('add_jquery_framework', 1) == 1)
{
Html::_('jquery.framework');
}
// Load the header checker class.
require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );
// Initialize the header checker.
$HeaderCheck = new getbibleHeaderCheck();
// Load uikit options.
$uikit = $this->params->get('uikit_load');
// Set script size.
$size = $this->params->get('uikit_min');
// The uikit css.
if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
{
Html::_('stylesheet', 'media/com_getbible/uikit-v3/css/uikit'.$size.'.css', ['version' => 'auto']);
}
// The uikit js.
if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
{
Html::_('script', 'media/com_getbible/uikit-v3/js/uikit'.$size.'.js', ['version' => 'auto']);
Html::_('script', 'media/com_getbible/uikit-v3/js/uikit-icons'.$size.'.js', ['version' => 'auto']);
}
// add the document default css file
Html::_('stylesheet', 'components/com_getbible/assets/css/api.css', ['version' => 'auto']);
}
/**
* Setting the toolbar
*/
protected function addToolBar()
{
// set help url for this view if found
$this->help_url = GetbibleHelper::getHelpUrl('api');
if (StringHelper::check($this->help_url))
{
ToolbarHelper::help('COM_GETBIBLE_HELP_MANAGER', false, $this->help_url);
}
// now initiate the toolbar
$this->toolbar = Toolbar::getInstance();
}
/**
* Escapes a value for output in a view script.
*
* @param mixed $var The output to escape.
*
* @return mixed The escaped value.
*/
public function escape($var, $sorten = false, $length = 40)
{
// use the helper htmlEscape method instead.
return StringHelper::html($var, $this->_charset, $sorten, $length);
}
}

View File

@ -31,8 +31,8 @@ use Joomla\CMS\Layout\LayoutHelper;
<?php else: ?>
<h4><?php echo Text::_('COM_GETBIBLE_ACTIVE_PERSISTENT_SESSION'); ?></h4>
<?php endif; ?>
<?php echo JLayoutHelper::render('inputbox', ['id' => 'getbible-settings-session-name', 'label' => Text::_('COM_GETBIBLE_NAME'), 'class_other' => 'uk-text-center', 'value' => $this->linker['name'] ?? 'Default Name']); ?>
<?php echo JLayoutHelper::render('inputbox', ['id' => 'getbible-settings-session-linker', 'label' => Text::_('COM_GETBIBLE_PERSISTENT_SESSION_KEY'), 'class_other' => 'getbible-linker-guid-input uk-text-center', 'value' => $this->linker['guid']]); ?>
<?php echo LayoutHelper::render('inputbox', ['id' => 'getbible-settings-session-name', 'label' => Text::_('COM_GETBIBLE_NAME'), 'class_other' => 'uk-text-center', 'value' => $this->linker['name'] ?? 'Default Name']); ?>
<?php echo LayoutHelper::render('inputbox', ['id' => 'getbible-settings-session-linker', 'label' => Text::_('COM_GETBIBLE_PERSISTENT_SESSION_KEY'), 'class_other' => 'getbible-linker-guid-input uk-text-center', 'value' => $this->linker['guid']]); ?>
<button id="getbible-settings-session-copy" class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom" uk-tooltip="<?php echo Text::_('COM_GETBIBLE_YOU_CAN_SHARE_YOUR_SESSION_WITH_LOVED_ONES_SO_THEY_CAN_SEE_YOUR_NOTES_AND_TAGS'); ?>"><?php echo Text::_('COM_GETBIBLE_SHARE_YOUR_SESSION'); ?></button>
<button id="getbible-settings-session-name-update" class="uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom" uk-tooltip="<?php echo Text::_('COM_GETBIBLE_YOU_CAN_CHANGE_YOUR_SESSION_NAME_TO_SOMETHING_MORE_RECOGNIZABLE'); ?>"><?php echo Text::_('COM_GETBIBLE_UPDATE_PERSISTENT_SESSION_NAME'); ?></button>
<p class="uk-text-muted"><?php echo Text::_('COM_GETBIBLE_TO_USE_A_DIFFERENT_PERSISTENT_SESSION_KEY_SIMPLY_ADD_IT_ABOVE_AND_CLICK_THE_BUTTON_BELOW'); ?></p>

View File

@ -37,7 +37,7 @@ if (ObjectHelper::check($modules))
}
else
{
$tabs[$module->position] = JLayoutHelper::render('modulepositionerror', ['position' => $module->position, 'page' => 'GetBible App']);
$tabs[$module->position] = LayoutHelper::render('modulepositionerror', ['position' => $module->position, 'page' => 'GetBible App']);
}
}
}

View File

@ -39,20 +39,20 @@ use Joomla\CMS\Layout\LayoutHelper;
<a class="uk-link-muted" href="https://git.vdm.dev/getBible/v2/src/branch/master/<?php echo $this->chapter->abbreviation; ?>/<?php echo $this->chapter->book_nr; ?>/<?php echo $this->chapter->chapter; ?>.sha" target="_blank" title="<?php echo Text::_('COM_GETBIBLE_VALIDATION_HASH_OF_THIS_CHAPTER'); ?>"><?php echo $this->chapter->sha; ?> <span uk-icon="icon: check"></span></a>
<?php endif; ?>
</div>
<?php echo JLayoutHelper::render('modal', [
<?php echo LayoutHelper::render('modal', [
'id' => 'getbible-hash-details',
'modal_class' => 'uk-modal-container',
'header' => Text::_('COM_GETBIBLE_BASIC_HASH_USAGE_EXPLAINED'),
'header_class_other' => 'uk-text-center',
'close' => true,
'content' => JLayoutHelper::render('getbiblehashdetails', [])
'content' => LayoutHelper::render('getbiblehashdetails', [])
]); ?>
<?php elseif ($this->params->get('show_api_link') == 1): ?>
<div class="uk-float-left">
<a class="uk-link-muted" href="https://api.getbible.net/v2/<?php echo $this->chapter->abbreviation; ?>/<?php echo $this->chapter->book_nr; ?>/<?php echo $this->chapter->chapter; ?>.json" target="_blank" title="<?php echo Text::_('COM_GETBIBLE_API_SOURCE'); ?>"><?php echo Text::_('API'); ?>: <?php echo $this->chapter->name; ?></a>
</div>
<?php endif; ?>
<?php echo JLayoutHelper::render('getbiblefooter', [
<?php echo LayoutHelper::render('getbiblefooter', [
'load' => $this->params->get('show_getbible_link'),
'path' => $this->chapter->abbreviation . '/' . $this->chapter->book_name . '/' . $this->chapter->chapter,
'logo' => $this->params->get('show_getbible_logo')

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