Get Bible (v.2.0.17)
+ Get Bible (v.2.0.18)
Welcome to the next level of scripture engagement - The Bible for Joomla! Our purpose is to bring the Word of God to every person, in their native language, entirely free. This isn't just a typical extension; it's a groundbreaking tool developed to span language divides and deliver a rich, customizable Bible study experience to users worldwide.
diff --git a/script.php b/script.php
index ae619da..4caabe9 100644
--- a/script.php
+++ b/script.php
@@ -1108,7 +1108,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","activate_notes":"0","activate_tags":"0","allow_untagging":"0","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","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","check_in":"-1 day","save_history":"1","history_limit":"10","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(
@@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript
echo '
-
Upgrade to Version 2.0.17 Was Successful! Let us know if anything is not working as expected. ';
+ Upgrade to Version 2.0.18 Was Successful! Let us know if anything is not working as expected. ';
// Set db if not set already.
if (!isset($db))
diff --git a/site/assets/js/app.js b/site/assets/js/app.js
index 2849922..b46e9b0 100644
--- a/site/assets/js/app.js
+++ b/site/assets/js/app.js
@@ -118,68 +118,68 @@ class ScrollMemory {
}
class DatabaseManager {
- #dbName;
- #storeName;
- #fields;
- #db;
- #uniqueFields;
- #isReady = false;
- #readyPromise = null;
- #data;
+ dbName;
+ storeName;
+ fields;
+ db;
+ uniqueFields;
+ isReady = false;
+ readyPromise = null;
+ data;
constructor(dbName, storeName, fields) {
- this.#dbName = dbName;
- this.#storeName = storeName;
- this.#fields = fields;
- this.#uniqueFields = fields.filter((field) => field[1]).map((field) => field[0]);
- this.#data = JSON.parse(localStorage.getItem(this.#storeName)) || [];
+ this.dbName = dbName;
+ this.storeName = storeName;
+ this.fields = fields;
+ this.uniqueFields = fields.filter((field) => field[1]).map((field) => field[0]);
+ this.data = JSON.parse(localStorage.getItem(this.storeName)) || [];
if (window.indexedDB) {
- this.#readyPromise = this.#openDB().then(() => {
- this.#isReady = true;
+ this.readyPromise = this.openDB().then(() => {
+ this.isReady = true;
});
} else {
- this.#isReady = true;
+ this.isReady = true;
}
}
- #openDB = () => {
+ openDB = () => {
return new Promise((resolve, reject) => {
- const request = window.indexedDB.open(this.#dbName);
+ const request = window.indexedDB.open(this.dbName);
request.onerror = (e) => {
console.log('Error opening db', e);
reject('Error');
};
request.onsuccess = (e) => {
- this.#db = e.target.result;
+ this.db = e.target.result;
resolve();
};
request.onupgradeneeded = (e) => {
let db = e.target.result;
- let store = db.createObjectStore(this.#storeName, { autoIncrement: true, keyPath: 'id' });
- this.#uniqueFields.forEach((field) => {
+ let store = db.createObjectStore(this.storeName, { autoIncrement: true, keyPath: 'id' });
+ this.uniqueFields.forEach((field) => {
store.createIndex(field, field, { unique: true });
});
};
});
}
- #waitUntilReady = () => {
- return this.#isReady ? Promise.resolve() : this.#readyPromise;
+ waitUntilReady = () => {
+ return this.isReady ? Promise.resolve() : this.readyPromise;
}
- #saveToLocalStorage = () => {
- localStorage.setItem(this.#storeName, JSON.stringify(this.#data));
+ saveToLocalStorage = () => {
+ localStorage.setItem(this.storeName, JSON.stringify(this.data));
}
async set(data) {
- return this.#waitUntilReady().then(() => {
- if (!this.#db) {
- let existingItem = this.#data.find((item) => this.#uniqueFields.some((field) => item[field] === data[field]));
+ return this.waitUntilReady().then(() => {
+ if (!this.db) {
+ let existingItem = this.data.find((item) => this.uniqueFields.some((field) => item[field] === data[field]));
if (existingItem) {
Object.assign(existingItem, data);
} else {
- this.#data.push(data);
+ this.data.push(data);
}
- this.#saveToLocalStorage();
+ this.saveToLocalStorage();
} else {
- const transaction = this.#db.transaction([this.#storeName], 'readwrite');
- const store = transaction.objectStore(this.#storeName);
- this.#uniqueFields.forEach((field) => {
+ const transaction = this.db.transaction([this.storeName], 'readwrite');
+ const store = transaction.objectStore(this.storeName);
+ this.uniqueFields.forEach((field) => {
const index = store.index(field);
const getRequest = index.get(data[field]);
getRequest.onsuccess = () => {
@@ -199,16 +199,16 @@ class DatabaseManager {
});
}
async get(value, key, field = 'guid') {
- return this.#waitUntilReady().then(() => {
- if (!this.#db) {
+ return this.waitUntilReady().then(() => {
+ if (!this.db) {
// If IndexedDB is not available, get value from local storage
- const item = this.#data.find(item => item[field] === value);
+ const item = this.data.find(item => item[field] === value);
return item ? item[key] : undefined;
} else {
// If IndexedDB is available, get value from the database
return new Promise((resolve, reject) => {
- let transaction = this.#db.transaction([this.#storeName], "readonly");
- let store = transaction.objectStore(this.#storeName);
+ let transaction = this.db.transaction([this.storeName], "readonly");
+ let store = transaction.objectStore(this.storeName);
let request = store.index(field).get(value);
request.onsuccess = e => {
const item = e.target.result;
@@ -222,13 +222,13 @@ class DatabaseManager {
});
}
async item(value, field = 'guid') {
- return this.#waitUntilReady().then(() => {
- if (!this.#db) {
- return this.#data.find((item) => item[field] === value);
+ return this.waitUntilReady().then(() => {
+ if (!this.db) {
+ return this.data.find((item) => item[field] === value);
} else {
return new Promise((resolve, reject) => {
- const transaction = this.#db.transaction([this.#storeName], 'readonly');
- const store = transaction.objectStore(this.#storeName);
+ const transaction = this.db.transaction([this.storeName], 'readonly');
+ const store = transaction.objectStore(this.storeName);
const index = store.index(field);
const getRequest = index.get(value);
getRequest.onsuccess = () => {
@@ -242,13 +242,13 @@ class DatabaseManager {
});
}
async all() {
- return this.#waitUntilReady().then(() => {
- if (!this.#db) {
- return this.#data;
+ return this.waitUntilReady().then(() => {
+ if (!this.db) {
+ return this.data;
} else {
return new Promise((resolve, reject) => {
- const transaction = this.#db.transaction([this.#storeName], 'readonly');
- const store = transaction.objectStore(this.#storeName);
+ const transaction = this.db.transaction([this.storeName], 'readonly');
+ const store = transaction.objectStore(this.storeName);
const getAllRequest = store.getAll();
getAllRequest.onsuccess = () => {
resolve(getAllRequest.result);
@@ -261,17 +261,17 @@ class DatabaseManager {
});
}
async remove(value, field = 'guid') {
- return this.#waitUntilReady().then(() => {
- if (!this.#db) {
+ return this.waitUntilReady().then(() => {
+ if (!this.db) {
// Handle removal from localStorage
- this.#data = this.#data.filter(item => item[field] !== value);
- this.#saveToLocalStorage();
+ this.data = this.data.filter(item => item[field] !== value);
+ this.saveToLocalStorage();
return Promise.resolve();
} else {
// Handle removal from IndexedDB
return new Promise((resolve, reject) => {
- const transaction = this.#db.transaction([this.#storeName], 'readwrite');
- const store = transaction.objectStore(this.#storeName);
+ const transaction = this.db.transaction([this.storeName], 'readwrite');
+ const store = transaction.objectStore(this.storeName);
let index = store.index(field);
let request = index.openCursor(IDBKeyRange.only(value));
request.onsuccess = e => {
diff --git a/site/language/en-GB/en-GB.com_getbible.ini b/site/language/en-GB/en-GB.com_getbible.ini
index ce87a17..23f448f 100644
--- a/site/language/en-GB/en-GB.com_getbible.ini
+++ b/site/language/en-GB/en-GB.com_getbible.ini
@@ -223,7 +223,7 @@ COM_GETBIBLE_TOP_P="Top P"
COM_GETBIBLE_TOTALTOKENS="TotalTokens"
COM_GETBIBLE_TO_PERFORM_THIS_OPEN_THE_GLOBAL_OPTIONS_SECTION_OF_THE_GETBIBLE_BACKEND_LOCATE_THE_GLOBAL_TAB_AND_SWITCH_SHOW_INSTALL_BUTTON_TO_NO_THIS_STEP_ENSURES_THAT_YOUR_SYSTEM_RESOURCES_ARE_NOT_UTILIZED_UNNECESSARILY_ONCE_YOU_HAVE_SUCCESSFULLY_INSTALLED_ALL_YOUR_DESIRED_BIBLE_TRANSLATIONS="To perform this, open the 'Global Options' section of the getBible backend, locate the 'Global' Tab, and switch 'Show Install Button' to [No]. This step ensures that your system resources are not utilized unnecessarily once you have successfully installed all your desired Bible translations."
COM_GETBIBLE_TO_UNTAG_A_VERSE_DRAG_AND_DROP_THE_DESIRED_TAG_FROM_ACTIVE_TO_THE_AVAILABLE_TAGS_AREA="To un-tag a verse, drag and drop the desired tag from active to the available tags area."
-COM_GETBIBLE_TO_USE_A_DIFFERENT_PERSISTENT_SESSION_KEY_SIMPLY_ADD_IT_ABOVE_AND_CLICK_THE_BUTTON_BELOW_THAT_SAYS_LOAD_PREVIOUS_PERSISTENT_SESSION="To use a different persistent session key, simply add it above, and click the button below that says: Load Previous Persistent Session."
+COM_GETBIBLE_TO_USE_A_DIFFERENT_PERSISTENT_SESSION_KEY_SIMPLY_ADD_IT_ABOVE_AND_CLICK_THE_BUTTON_BELOW="To use a different persistent session key, simply add it above, and click the button below."
COM_GETBIBLE_TRANSLATION="Translation"
COM_GETBIBLE_TRANSLATIONS="Translations"
COM_GETBIBLE_TYPE_YOUR_SEARCH_PHRASE_INTO_THE_SEARCH_BOX_AND_PRESS_ENTER_TO_SEARCH_THE_BSCRIPTURESB_DAILY="Type your search phrase into the search box and press [ENTER] to search the Scriptures daily!"
diff --git a/site/views/app/tmpl/default.xml b/site/views/app/tmpl/default.xml
index 2ddb82e..ee8bd89 100644
--- a/site/views/app/tmpl/default.xml
+++ b/site/views/app/tmpl/default.xml
@@ -735,6 +735,39 @@
COM_GETBIBLE_CONFIG_SECONDARY
+
+
+
+
+ JGLOBAL_USE_GLOBAL
+
+ COM_GETBIBLE_CONFIG_YES
+
+ COM_GETBIBLE_CONFIG_NO
+
+
+
+
+
+ JGLOBAL_USE_GLOBAL
+
+ COM_GETBIBLE_CONFIG_DEFAULT
+
+ COM_GETBIBLE_CONFIG_PRIMARY
+
+ COM_GETBIBLE_CONFIG_SECONDARY
+
'getbible-settings-session-linker', 'label' => JText::_('COM_GETBIBLE_PERSISTENT_SESSION_KEY'), 'class_other' => 'getbible-linker-guid-input uk-text-center', 'value' => $this->linker['guid']]); ?>
-
+
diff --git a/site/views/app/tmpl/default_getbibleappbody.php b/site/views/app/tmpl/default_getbibleappbody.php
index c92078e..5a87e63 100644
--- a/site/views/app/tmpl/default_getbibleappbody.php
+++ b/site/views/app/tmpl/default_getbibleappbody.php
@@ -82,4 +82,11 @@ if ($this->params->get('show_details') == 1)
params->get('set_custom_tabs') == 1): ?>
loadTemplate('getbibleappcustomtabs'); ?>
-
+
+getBibleModules = [
+ 'position' => 'bottom_app_position',
+ 'page' => 'GetBible'
+ ];
+ echo $this->loadTemplate('getbiblemodules');
+?>
diff --git a/site/views/app/tmpl/default_getbiblemodules.php b/site/views/app/tmpl/default_getbiblemodules.php
new file mode 100644
index 0000000..de5afd5
--- /dev/null
+++ b/site/views/app/tmpl/default_getbiblemodules.php
@@ -0,0 +1,61 @@
+
+ @git Get Bible
+ @github Get Bible
+ @support Get Bible
+ @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 VDM\Joomla\Utilities\ObjectHelper;
+
+$modules = $this->params->get($this->getBibleModules['position']);
+$position_card = '';
+$positions = [];
+if (ObjectHelper::check($modules))
+{
+ foreach ($modules as $module)
+ {
+ if (isset($module->position) && strlen($module->position) > 0)
+ {
+ if (($content = $this->getModules($module->position, $module->separator ?? '', $module->class ?? '')) !== false)
+ {
+ $positions[$module->position] = $content;
+ }
+ else
+ {
+ $positions[$module->position] = JLayoutHelper::render('modulepositionerror', ['position' => $module->position, 'page' => $this->getBibleModules['page']]);
+ }
+ }
+ }
+ $position_card = ($this->params->get('show_' . $this->getBibleModules['position'] . '_card') == 1) ? 'uk-card uk-card-' . $this->params->get($this->getBibleModules['position'] . '_card_style', 'default') . ' uk-card-body uk-margin' : 'uk-margin';
+}
+
+?>
+
+
+
diff --git a/site/views/app/view.html.php b/site/views/app/view.html.php
index f355169..564d99c 100644
--- a/site/views/app/view.html.php
+++ b/site/views/app/view.html.php
@@ -17,10 +17,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-jimport('joomla.application.module.helper');
+use Joomla\CMS\Helper\ModuleHelper as JModuleHelper;
+use VDM\Joomla\GetBible\Factory;
use Joomla\CMS\MVC\View\HtmlView;
-use VDM\Joomla\GetBible\Factory;
/**
* Getbible Html View class for the App
@@ -929,7 +929,6 @@ class GetbibleViewApp extends HtmlView
default:
return implode(' ', $this->setModules[$position]);
break;
-
}
}
return false;
diff --git a/site/views/openai/tmpl/default_getbibleaibody.php b/site/views/openai/tmpl/default_getbibleaibody.php
index bff1495..ddbe088 100644
--- a/site/views/openai/tmpl/default_getbibleaibody.php
+++ b/site/views/openai/tmpl/default_getbibleaibody.php
@@ -70,4 +70,11 @@ if ($this->params->get('show_openai_details', 1) == 1)
params->get('set_custom_ai_tabs') == 1): ?>
loadTemplate('getbibleaicustomtabs'); ?>
-
+
+getBibleModules = [
+ 'position' => 'bottom_ai_position',
+ 'page' => 'GetBible AI'
+ ];
+ echo $this->loadTemplate('getbiblemodules');
+?>
diff --git a/site/views/openai/tmpl/default_getbiblemodules.php b/site/views/openai/tmpl/default_getbiblemodules.php
new file mode 100644
index 0000000..de5afd5
--- /dev/null
+++ b/site/views/openai/tmpl/default_getbiblemodules.php
@@ -0,0 +1,61 @@
+
+ @git Get Bible
+ @github Get Bible
+ @support Get Bible
+ @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 VDM\Joomla\Utilities\ObjectHelper;
+
+$modules = $this->params->get($this->getBibleModules['position']);
+$position_card = '';
+$positions = [];
+if (ObjectHelper::check($modules))
+{
+ foreach ($modules as $module)
+ {
+ if (isset($module->position) && strlen($module->position) > 0)
+ {
+ if (($content = $this->getModules($module->position, $module->separator ?? '', $module->class ?? '')) !== false)
+ {
+ $positions[$module->position] = $content;
+ }
+ else
+ {
+ $positions[$module->position] = JLayoutHelper::render('modulepositionerror', ['position' => $module->position, 'page' => $this->getBibleModules['page']]);
+ }
+ }
+ }
+ $position_card = ($this->params->get('show_' . $this->getBibleModules['position'] . '_card') == 1) ? 'uk-card uk-card-' . $this->params->get($this->getBibleModules['position'] . '_card_style', 'default') . ' uk-card-body uk-margin' : 'uk-margin';
+}
+
+?>
+
+
+
diff --git a/site/views/openai/view.html.php b/site/views/openai/view.html.php
index bc49e22..f723f41 100644
--- a/site/views/openai/view.html.php
+++ b/site/views/openai/view.html.php
@@ -17,7 +17,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-jimport('joomla.application.module.helper');
+use Joomla\CMS\Helper\ModuleHelper as JModuleHelper;
use Joomla\CMS\MVC\View\HtmlView;
@@ -162,7 +162,6 @@ class GetbibleViewOpenai extends HtmlView
default:
return implode(' ', $this->setModules[$position]);
break;
-
}
}
return false;
diff --git a/site/views/search/tmpl/default_getbiblemodules.php b/site/views/search/tmpl/default_getbiblemodules.php
new file mode 100644
index 0000000..de5afd5
--- /dev/null
+++ b/site/views/search/tmpl/default_getbiblemodules.php
@@ -0,0 +1,61 @@
+
+ @git Get Bible
+ @github Get Bible
+ @support Get Bible
+ @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 VDM\Joomla\Utilities\ObjectHelper;
+
+$modules = $this->params->get($this->getBibleModules['position']);
+$position_card = '';
+$positions = [];
+if (ObjectHelper::check($modules))
+{
+ foreach ($modules as $module)
+ {
+ if (isset($module->position) && strlen($module->position) > 0)
+ {
+ if (($content = $this->getModules($module->position, $module->separator ?? '', $module->class ?? '')) !== false)
+ {
+ $positions[$module->position] = $content;
+ }
+ else
+ {
+ $positions[$module->position] = JLayoutHelper::render('modulepositionerror', ['position' => $module->position, 'page' => $this->getBibleModules['page']]);
+ }
+ }
+ }
+ $position_card = ($this->params->get('show_' . $this->getBibleModules['position'] . '_card') == 1) ? 'uk-card uk-card-' . $this->params->get($this->getBibleModules['position'] . '_card_style', 'default') . ' uk-card-body uk-margin' : 'uk-margin';
+}
+
+?>
+
+
+
diff --git a/site/views/search/tmpl/default_getbiblesearch.php b/site/views/search/tmpl/default_getbiblesearch.php
index bc1536c..71bef44 100644
--- a/site/views/search/tmpl/default_getbiblesearch.php
+++ b/site/views/search/tmpl/default_getbiblesearch.php
@@ -31,4 +31,11 @@ defined('_JEXEC') or die('Restricted access');
-
+
+getBibleModules = [
+ 'position' => 'bottom_search_position',
+ 'page' => 'GetBible Search'
+ ];
+ echo $this->loadTemplate('getbiblemodules');
+?>
diff --git a/site/views/search/view.html.php b/site/views/search/view.html.php
index 752cc51..46e9636 100644
--- a/site/views/search/view.html.php
+++ b/site/views/search/view.html.php
@@ -17,9 +17,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Helper\ModuleHelper as JModuleHelper;
+use VDM\Joomla\GetBible\Factory;
use Joomla\CMS\MVC\View\HtmlView;
-use VDM\Joomla\GetBible\Factory;
/**
* Getbible Html View class for the Search
@@ -209,6 +210,65 @@ class GetbibleViewSearch extends HtmlView
$this->toolbar = JToolbar::getInstance();
}
+ /**
+ * Get the modules published in a position
+ */
+ public function getModules($position, $seperator = '', $class = '')
+ {
+ // set default
+ $found = false;
+ // check if we aleady have these modules loaded
+ if (isset($this->setModules[$position]))
+ {
+ $found = true;
+ }
+ else
+ {
+ // this is where you want to load your module position
+ $modules = JModuleHelper::getModules($position);
+ if (GetbibleHelper::checkArray($modules, true))
+ {
+ // set the place holder
+ $this->setModules[$position] = array();
+ foreach($modules as $module)
+ {
+ $this->setModules[$position][] = JModuleHelper::renderModule($module);
+ }
+ $found = true;
+ }
+ }
+ // check if modules were found
+ if ($found && isset($this->setModules[$position]) && GetbibleHelper::checkArray($this->setModules[$position]))
+ {
+ // set class
+ if (GetbibleHelper::checkString($class))
+ {
+ $class = ' class="'.$class.'" ';
+ }
+ // set seperating return values
+ switch($seperator)
+ {
+ case 'none':
+ return implode('', $this->setModules[$position]);
+ break;
+ case 'div':
+ return ''.implode('
', $this->setModules[$position]).'
';
+ break;
+ case 'list':
+ return ''.implode(' ', $this->setModules[$position]).' ';
+ break;
+ case 'array':
+ case 'Array':
+ return $this->setModules[$position];
+ break;
+ default:
+ return implode(' ', $this->setModules[$position]);
+ break;
+ }
+ }
+ return false;
+ }
+
/**
* Escapes a value for output in a view script.
*
diff --git a/site/views/tag/tmpl/default_getbiblemodules.php b/site/views/tag/tmpl/default_getbiblemodules.php
new file mode 100644
index 0000000..de5afd5
--- /dev/null
+++ b/site/views/tag/tmpl/default_getbiblemodules.php
@@ -0,0 +1,61 @@
+
+ @git Get Bible
+ @github Get Bible
+ @support Get Bible
+ @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 VDM\Joomla\Utilities\ObjectHelper;
+
+$modules = $this->params->get($this->getBibleModules['position']);
+$position_card = '';
+$positions = [];
+if (ObjectHelper::check($modules))
+{
+ foreach ($modules as $module)
+ {
+ if (isset($module->position) && strlen($module->position) > 0)
+ {
+ if (($content = $this->getModules($module->position, $module->separator ?? '', $module->class ?? '')) !== false)
+ {
+ $positions[$module->position] = $content;
+ }
+ else
+ {
+ $positions[$module->position] = JLayoutHelper::render('modulepositionerror', ['position' => $module->position, 'page' => $this->getBibleModules['page']]);
+ }
+ }
+ }
+ $position_card = ($this->params->get('show_' . $this->getBibleModules['position'] . '_card') == 1) ? 'uk-card uk-card-' . $this->params->get($this->getBibleModules['position'] . '_card_style', 'default') . ' uk-card-body uk-margin' : 'uk-margin';
+}
+
+?>
+
+
+
diff --git a/site/views/tag/tmpl/default_getbibletagbody.php b/site/views/tag/tmpl/default_getbibletagbody.php
index 57e4c7c..5fafb25 100644
--- a/site/views/tag/tmpl/default_getbibletagbody.php
+++ b/site/views/tag/tmpl/default_getbibletagbody.php
@@ -49,4 +49,11 @@ $tags_card = ($this->params->get('show_tags_card') == 1) ? 'uk-card uk-card-' .
params->get('set_custom_tag_tabs') == 1): ?>
loadTemplate('getbibletagcustomtabs'); ?>
-
+
+getBibleModules = [
+ 'position' => 'bottom_tag_position',
+ 'page' => 'GetBible Tag'
+ ];
+ echo $this->loadTemplate('getbiblemodules');
+?>
diff --git a/site/views/tag/view.html.php b/site/views/tag/view.html.php
index 05a6181..1061cbd 100644
--- a/site/views/tag/view.html.php
+++ b/site/views/tag/view.html.php
@@ -17,10 +17,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-jimport('joomla.application.module.helper');
+use Joomla\CMS\Helper\ModuleHelper as JModuleHelper;
+use VDM\Joomla\GetBible\Factory;
use Joomla\CMS\MVC\View\HtmlView;
-use VDM\Joomla\GetBible\Factory;
/**
* Getbible Html View class for the Tag
@@ -320,7 +320,6 @@ class GetbibleViewTag extends HtmlView
default:
return implode(' ', $this->setModules[$position]);
break;
-
}
}
return false;
diff --git a/update_server.xml b/update_server.xml
index 5a8c635..27de6a2 100644
--- a/update_server.xml
+++ b/update_server.xml
@@ -287,4 +287,22 @@
https://getbible.net
+
+ Get Bible
+ The Bible for Joomla
+ pkg_getbible
+ package
+ site
+ 2.0.18
+ https://getbible.net
+
+ https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.18.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ https://getbible.net
+
+
\ No newline at end of file