Release of v3.2.5

Add [AllowDynamicProperties] in the base view class for J5. Move the _prepareDocument  above the display call in the base view class. Remove all backward compatibility issues, so JCB will not need the [Backward Compatibility] plugin to run. Added new import powers for custom import of spreadsheets. Move the setDocument and _prepareDocument above the display in the site view and custom admin view. Update the trashhelper layout to work in Joomla 5. Add AllowDynamicProperties (Joomla 4+5) to view class to allow Custom Dynamic Get methods to work without issues. Fix Save failed issue in dynamicGet. #1148. Move all [TEXT, EDITOR, TEXTAREA] fields from [NOT NULL] to [NULL]. Add the DateHelper class and improve the date methods. Add simple SessionHelper class. Add first classes for the new import engine. Improve the [VDM Registry] to be Joomla Registry Compatible. Move all registries to the [VDM Registry] class. Fix Checked Out to be null and not 0. (#1194). Fix created_by, modified_by, checked_out fields in the compiler of the SQL. (#1194). Update all core date fields in table class. (#1188). Update created_by, modified_by, checked_out fields in table class. Implementation of the decentralized Super-Power CORE repository network. (#1190). Fix the noticeboard to display Llewellyn's Joomla Social feed.
This commit is contained in:
2025-02-14 22:59:16 +02:00
parent 714cb5588a
commit f8b0a5df54
1474 changed files with 133744 additions and 48350 deletions

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_custom_tabs.css", ['version' => 'auto']);
@@ -214,7 +219,7 @@ class ComponentbuilderViewAdmin_custom_tabs extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_fields.css", ['version' => 'auto']);
@@ -229,7 +234,7 @@ class ComponentbuilderViewAdmin_fields extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_fields_conditions.css", ['version' => 'auto']);
@@ -216,7 +221,7 @@ class ComponentbuilderViewAdmin_fields_conditions extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_NEW' : 'COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_fields_relations.css", ['version' => 'auto']);
@@ -209,9 +214,9 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -220,7 +225,7 @@ class ComponentbuilderViewAdmin_fields_relations extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewAdmin_view extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewAdmin_view extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_ADMIN_VIEW_NEW' : 'COM_COMPONENTBUILDER_ADMIN_VIEW_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admin_view.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewAdmin_view extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewAdmin_view extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewAdmin_views extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -301,6 +301,11 @@ class ComponentbuilderViewAdmin_views extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -349,7 +354,7 @@ class ComponentbuilderViewAdmin_views extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewAdmins_custom_tabs extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewAdmins_fields extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewClass_extendings extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -211,6 +211,11 @@ class ComponentbuilderViewClass_extendings extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -258,7 +263,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewClass_extends extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewClass_extends extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_extends.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewClass_extends extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewClass_extends extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewClass_method extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewClass_method extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_method.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewClass_method extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewClass_method extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewClass_methods extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -241,6 +241,11 @@ class ComponentbuilderViewClass_methods extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -289,7 +294,7 @@ class ComponentbuilderViewClass_methods extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewClass_properties extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -241,6 +241,11 @@ class ComponentbuilderViewClass_properties extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -289,7 +294,7 @@ class ComponentbuilderViewClass_properties extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewClass_property extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewClass_property extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_property.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewClass_property extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewClass_property extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -170,7 +170,8 @@ document.addEventListener('DOMContentLoaded', function() {
<div class="span7">
<div id="advance-details"><?php echo $this->form->renderFieldset('advanced'); ?></div>
<div id="component-details"><?php echo $selectNotice; ?></div>
<?php echo LayoutHelper::render('jcbnoticeboardtabs', array('id' => 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?>
<div class="clearfix"></div>
<?php echo LayoutHelper::render('jcbnoticeboard', null); ?>
</div>
</div>
<div id="get-compiler-animations" style="display:none;">
@@ -193,8 +194,7 @@ document.addEventListener('DOMContentLoaded', function() {
<div class="clearfix"></div>
</div>
<div id="compiler-notice" class="span7" style="display:none;">
<?php echo LayoutHelper::render('jcbnoticeboard' . $noticeboardOptions[array_rand($noticeboardOptions)], null); ?>
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
<?php echo LayoutHelper::render('jcbnoticeboard', ['id' => 'mastodon-feed-2', 'button_id' => 'refresh-feed-2', 'posts' => 7]); ?>
</div>
</div>
<input type="hidden" name="task" value="" />

View File

@@ -115,6 +115,7 @@ class ComponentbuilderViewCompiler extends HtmlView
throw new \Exception(implode(PHP_EOL, $errors), 500);
}
// Display the template
parent::display($tpl);
}
@@ -588,6 +589,9 @@ class ComponentbuilderViewCompiler extends HtmlView
// Initialize the header checker.
$HeaderCheck = new componentbuilderHeaderCheck();
// Add View JavaScript File
Html::_('script', "administrator/components/com_componentbuilder/assets/js/compiler.js", ['version' => 'auto']);
// Load uikit options.
$uikit = $this->params->get('uikit_load');
// Set script size.
@@ -683,70 +687,6 @@ class ComponentbuilderViewCompiler extends HtmlView
}
}
});
}
document.addEventListener('DOMContentLoaded', function() {
fetchNoticeboard(\"https://vdm.bz/componentbuilder-noticeboard-md\", \".noticeboard-md\", true);
fetchNoticeboard(\"https://vdm.bz/componentbuilder-pro-noticeboard-md\", \".proboard-md\", false);
});
function fetchNoticeboard(url, selector, processGetIS) {
fetch(url)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(board => {
var elements = document.querySelectorAll(selector);
if (board.length > 5) {
let html_board = marked.parse(board);
elements.forEach(element => {
element.innerHTML = html_board;
});
if (processGetIS) {
getIS(1, board).then(result => {
if (result) {
document.querySelectorAll(\".vdm-new-notice\").forEach(element => {
element.style.display = 'block';
});
getIS(2, board);
}
});
}
} else {
elements.forEach(element => {
element.innerHTML = all_is_good;
});
}
})
.catch(error => {
console.error('There was an error!', error);
document.querySelectorAll(selector).forEach(element => {
element.innerHTML = all_is_good;
});
});
}
// to check is READ/NEW
function getIS(type, notice) {
let getUrl = \"\";
if (type === 1) {
getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true\");
} else if (type === 2) {
getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true\");
}
let request = new URLSearchParams();
if (token.length > 0 && notice.length) {
request.append(token, \"1\");
request.append(\"notice\", notice);
}
return fetch(getUrl, {
method: \"POST\",
headers: {
\"Content-Type\": \"application/x-www-form-urlencoded;charset=UTF-8\"
},
body: request
}).then(response => response.json());
}
");
}
@@ -810,7 +750,7 @@ class ComponentbuilderViewCompiler extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_admin_views.css", ['version' => 'auto']);
@@ -214,7 +219,7 @@ class ComponentbuilderViewComponent_admin_views extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_config extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_config extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_config.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewComponent_config extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_custom_admin_menus.css", ['version' => 'auto']);
@@ -214,7 +219,7 @@ class ComponentbuilderViewComponent_custom_admin_menus extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_custom_admin_views.css", ['version' => 'auto']);
@@ -214,7 +219,7 @@ class ComponentbuilderViewComponent_custom_admin_views extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_dashboard.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewComponent_dashboard extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_files_folders.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewComponent_files_folders extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_modules extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_modules extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_MODULES_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_MODULES_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_modules.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewComponent_modules extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_mysql_tweaks extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_mysql_tweaks extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_mysql_tweaks.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewComponent_mysql_tweaks extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_placeholders extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_placeholders extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_placeholders.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewComponent_placeholders extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_plugins extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_plugins extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_PLUGINS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_PLUGINS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_plugins.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewComponent_plugins extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_router extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_router extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_router.css", ['version' => 'auto']);
@@ -216,7 +221,7 @@ class ComponentbuilderViewComponent_router extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_site_views extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_site_views extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_site_views.css", ['version' => 'auto']);
@@ -214,7 +219,7 @@ class ComponentbuilderViewComponent_site_views extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewComponent_updates extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewComponent_updates extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_UPDATES_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_UPDATES_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/component_updates.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewComponent_updates extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -15,6 +15,12 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
?>
<?php echo $this->noticeboard; ?>
<?php
Html::_('script', "administrator/components/com_componentbuilder/assets/js/compiler.js", ['version' => 'auto']);
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/compiler.css", ['version' => 'auto']);
Html::_('script', "media/com_componentbuilder/js/marked.js", ['version' => 'auto']);
echo LayoutHelper::render('jcbnoticeboard', null);
?>

View File

@@ -34,7 +34,6 @@ class ComponentbuilderViewComponentbuilder extends HtmlView
$this->icons = $this->get('Icons');
$this->contributors = ComponentbuilderHelper::getContributors();
$this->wiki = $this->get('Wiki');
$this->noticeboard = $this->get('Noticeboard');
$this->readme = $this->get('Readme');
$this->version = $this->get('Version');

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_admin_views extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_admin_views extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_admin_views extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_config extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_config extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_config extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_custom_admin_menus extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_custom_admin_menus extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_custom_admin_menus extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_custom_admin_views extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_custom_admin_views extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_custom_admin_views extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_dashboard extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_dashboard extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_dashboard extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_files_folders extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_files_folders extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_files_folders extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_modules extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_modules extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_modules extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_mysql_tweaks extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_mysql_tweaks extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_mysql_tweaks extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_placeholders extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_placeholders extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_placeholders extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_plugins extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_plugins extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_plugins extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_routers extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -251,6 +251,11 @@ class ComponentbuilderViewComponents_routers extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -296,7 +301,7 @@ class ComponentbuilderViewComponents_routers extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_site_views extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_site_views extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_site_views extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewComponents_updates extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewComponents_updates extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewComponents_updates extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -315,40 +315,27 @@ jQuery('#adminForm').on('change', '#jform_add_php_ajax',function (e)
jQuery(function() {
jQuery('#open-libraries').html('<a href="index.php?option=com_componentbuilder&view=libraries"><?php echo JText::_('COM_COMPONENTBUILDER_LIBRARIES'); ?></a>');
});
document.addEventListener("DOMContentLoaded", function() {
document.querySelector('#open-libraries').innerHTML = '<a href="index.php?option=com_componentbuilder&view=libraries"><?php echo Text::_('COM_COMPONENTBUILDER_LIBRARIES'); ?></a>';
});
jQuery('#jform_snippet').closest('.input-append').addClass('jform_snippet_input_width');
jQuery('#jform_main_get').closest('.input-append').addClass('jform_main_get_input_width');
jQuery('#jform_dynamic_get').closest('.input-append').addClass('jform_dynamic_get_input_width');
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
});
// make sure the code bocks are active
document.querySelectorAll("code").forEach(function(codeBlock) {
codeBlock.addEventListener("click", function() {
codeBlock.selText(); // Call the custom selText function
codeBlock.classList.add("selected"); // Add the "selected" class
});
});
});
jQuery('#adminForm').on('change', '#jform_libraries',function (e) {
e.preventDefault();
getSnippets();
});
jQuery.fn.selText = function() {
var obj = this[0];
if (jQuery.browser.msie) {
var range = obj.offsetParent.createTextRange();
range.moveToElementText(obj);
range.select();
} else if (jQuery.browser.mozilla || $.browser.opera) {
var selection = obj.ownerDocument.defaultView.getSelection();
var range = obj.ownerDocument.createRange();
range.selectNodeContents(obj);
selection.removeAllRanges();
selection.addRange(range);
} else if (jQuery.browser.safari) {
var selection = obj.ownerDocument.defaultView.getSelection();
selection.setBaseAndExtent(obj, 0, obj, 1);
}
return this;
}
jQuery('#adminForm').on('change', '#jform_snippet',function (e) {
e.preventDefault();
@@ -384,6 +371,22 @@ jQuery(document).ready(function() {
// some lang strings
var select_a_snippet = '<?php echo Text::_('COM_COMPONENTBUILDER_SELECT_A_SNIPPET'); ?>';
var create_a_snippet = '<?php echo Text::_('COM_COMPONENTBUILDER_CREATE_A_SNIPPET'); ?>';
HTMLElement.prototype.selText = function() {
var obj = this;
// For modern browsers, handle the selection
var selection = window.getSelection();
var range = document.createRange();
// Select the content of the element
range.selectNodeContents(obj);
selection.removeAllRanges(); // Clear any previous selections
selection.addRange(range); // Add the new selection range
return this;
};
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll(".loading-dots").forEach(function(loading_dots) {

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewCustom_admin_view extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewCustom_admin_view extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_NEW' : 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/custom_admin_view.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewCustom_admin_view extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewCustom_admin_view extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewCustom_admin_views extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -266,6 +266,11 @@ class ComponentbuilderViewCustom_admin_views extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -315,7 +320,7 @@ class ComponentbuilderViewCustom_admin_views extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewCustom_code extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewCustom_code extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_CUSTOM_CODE_NEW' : 'COM_COMPONENTBUILDER_CUSTOM_CODE_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/custom_code.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewCustom_code extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
// need to add some language strings
Text::script('COM_COMPONENTBUILDER_FUNCTION_NAME_ALREADY_TAKEN_PLEASE_TRY_AGAIN');
Text::script('COM_COMPONENTBUILDER_YOU_MUST_ADD_AN_UNIQUE_FUNCTION_NAME');
@@ -229,7 +234,7 @@ class ComponentbuilderViewCustom_code extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewCustom_codes extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -286,6 +286,11 @@ class ComponentbuilderViewCustom_codes extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -337,7 +342,7 @@ class ComponentbuilderViewCustom_codes extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewDynamic_get extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewDynamic_get extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/dynamic_get.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewDynamic_get extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewDynamic_get extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewDynamic_gets extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -241,6 +241,11 @@ class ComponentbuilderViewDynamic_gets extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -289,7 +294,7 @@ class ComponentbuilderViewDynamic_gets extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -286,32 +286,16 @@ jQuery('#adminForm').on('change', '#jform_add_javascript_views_footer',function
jQuery(function() {
setTimeout(
function() {
// load the on click event
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
// make sure the code bocks are active
document.querySelectorAll("code").forEach(function(codeBlock) {
codeBlock.addEventListener("click", function() {
codeBlock.selText();
codeBlock.classList.add("selected");
});
});
}, 2000);
});
jQuery.fn.selText = function() {
var obj = this[0];
if (jQuery.browser.msie) {
var range = obj.offsetParent.createTextRange();
range.moveToElementText(obj);
range.select();
} else if (jQuery.browser.mozilla || $.browser.opera) {
var selection = obj.ownerDocument.defaultView.getSelection();
var range = obj.ownerDocument.createRange();
range.selectNodeContents(obj);
selection.removeAllRanges();
selection.addRange(range);
} else if (jQuery.browser.safari) {
var selection = obj.ownerDocument.defaultView.getSelection();
selection.setBaseAndExtent(obj, 0, obj, 1);
}
return this;
}
jQuery('#adminForm').on('change', '#jform_fieldtype',function (e) {
e.preventDefault();
// get type value
@@ -324,6 +308,21 @@ jQuery('#adminForm').on('change', '#jform_fieldtype',function (e) {
});
HTMLElement.prototype.selText = function() {
var obj = this;
// For modern browsers, handle the selection
var selection = window.getSelection();
var range = document.createRange();
// Select the content of the element
range.selectNodeContents(obj);
selection.removeAllRanges(); // Clear any previous selections
selection.addRange(range); // Add the new selection range
return this;
};
<?php
$app = Factory::getApplication();
?>

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewField extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewField extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/field.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewField extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
// add the libs for subform (since not adding it via xml but ajax)
Html::_('jquery.ui', array('core', 'sortable'));
Html::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true));
@@ -235,7 +240,7 @@ class ComponentbuilderViewField extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewFields extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -311,6 +311,11 @@ class ComponentbuilderViewFields extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -363,7 +368,7 @@ class ComponentbuilderViewFields extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -82,11 +82,11 @@ class ComponentbuilderViewFieldtype extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -208,6 +208,11 @@ class ComponentbuilderViewFieldtype extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_FIELDTYPE_NEW' : 'COM_COMPONENTBUILDER_FIELDTYPE_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/fieldtype.css", ['version' => 'auto']);
@@ -276,9 +281,9 @@ class ComponentbuilderViewFieldtype extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v3/js/uikit-icons'.$size.'.js', ['version' => 'auto']);
}
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -287,7 +292,7 @@ class ComponentbuilderViewFieldtype extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewFieldtypes extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -226,6 +226,11 @@ class ComponentbuilderViewFieldtypes extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -274,7 +279,7 @@ class ComponentbuilderViewFieldtypes extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -60,6 +60,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView
throw new \Exception(implode(PHP_EOL, $errors), 500);
}
// Display the template
parent::display($tpl);
}
@@ -176,20 +177,20 @@ class ComponentbuilderViewGet_snippets extends HtmlView
$expire = 30000; // only 30 seconds
}
// Set the Time To Live To JavaScript
$this->document->addScriptDeclaration("var expire = ". (int) $expire.";");
$this->getDocument()->addScriptDeclaration("var expire = ". (int) $expire.";");
// set snippet path
$this->document->addScriptDeclaration("var snippetPath = '". ComponentbuilderHelper::$snippetPath ."';");
$this->document->addScriptDeclaration("var snippetsPath = '". ComponentbuilderHelper::$snippetsPath ."';");
$this->getDocument()->addScriptDeclaration("var snippetPath = '". ComponentbuilderHelper::$snippetPath ."';");
$this->getDocument()->addScriptDeclaration("var snippetsPath = '". ComponentbuilderHelper::$snippetsPath ."';");
// token
$this->document->addScriptDeclaration("var token = '". Session::getFormToken() ."';");
$this->getDocument()->addScriptDeclaration("var token = '". Session::getFormToken() ."';");
// add some global items buckets for bulk updating
$this->document->addScriptDeclaration("var bulkItems = {};");
$this->document->addScriptDeclaration("bulkItems.new = [];");
$this->document->addScriptDeclaration("bulkItems.diverged = [];");
$this->document->addScriptDeclaration("bulkItems.ahead = [];");
$this->document->addScriptDeclaration("bulkItems.behind = [];");
$this->getDocument()->addScriptDeclaration("var bulkItems = {};");
$this->getDocument()->addScriptDeclaration("bulkItems.new = [];");
$this->getDocument()->addScriptDeclaration("bulkItems.diverged = [];");
$this->getDocument()->addScriptDeclaration("bulkItems.ahead = [];");
$this->getDocument()->addScriptDeclaration("bulkItems.behind = [];");
// set an error message if needed
$this->document->addScriptDeclaration("var returnError = '<div class=\"uk-alert uk-alert-warning\"><h1>".Text::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."!</h1><p>".Text::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".</p></div>';");
$this->getDocument()->addScriptDeclaration("var returnError = '<div class=\"uk-alert uk-alert-warning\"><h1>".Text::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."!</h1><p>".Text::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".</p></div>';");
// need to add some language strings
Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS');
Text::script('COM_COMPONENTBUILDER_SNIPPETS');
@@ -224,7 +225,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView
Text::script('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES');
Text::script('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS');
// add some lang verfy messages
$this->document->addScriptDeclaration("
$this->getDocument()->addScriptDeclaration("
// set the snippet from gitHub
function getConfirmUpdate(status) {
switch(status) {
@@ -250,7 +251,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView
if (ArrayHelper::check($this->items))
{
// Set the local snippets array
$this->document->addScriptDeclaration("var local_snippets = ". json_encode($local_snippets).";");
$this->getDocument()->addScriptDeclaration("var local_snippets = ". json_encode($local_snippets).";");
}
// add the document default css file
Html::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/get_snippets.css', ['version' => 'auto']);
@@ -330,7 +331,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewHelp_document extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewHelp_document extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/help_document.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewHelp_document extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewHelp_documents extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -271,6 +271,11 @@ class ComponentbuilderViewHelp_documents extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -321,7 +326,7 @@ class ComponentbuilderViewHelp_documents extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -96,4 +96,14 @@ class ComponentbuilderViewImport extends HtmlView
ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
}
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= Factory::getDocument();
return $this->document;
}
}

View File

@@ -163,10 +163,10 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView
}
// Set the Time To Live To JavaScript
$this->document->addScriptDeclaration("var expire = ". (int) $expire.";");
$this->document->addScriptDeclaration("var all_is_good = '".Text::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME')."';");
$this->getDocument()->addScriptDeclaration("var expire = ". (int) $expire.";");
$this->getDocument()->addScriptDeclaration("var all_is_good = '".Text::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME')."';");
// add a token on the page for javascript
$this->document->addScriptDeclaration("var token = '".Session::getFormToken()."';");
$this->getDocument()->addScriptDeclaration("var token = '".Session::getFormToken()."';");
// add the Uikit v2 style sheets
@@ -467,4 +467,14 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView
ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
}
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= Factory::getDocument();
return $this->document;
}
}

View File

@@ -98,4 +98,14 @@ class ComponentbuilderViewImport_language_translations extends HtmlView
ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
}
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= Factory::getDocument();
return $this->document;
}
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewJoomla_component extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewJoomla_component extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_component.css", ['version' => 'auto']);
@@ -226,7 +231,7 @@ class ComponentbuilderViewJoomla_component extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -166,8 +166,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
<?php elseif ($canDo->get($_button['view'].'.create')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=<?php echo $_button['views'] ?>&task=<?php echo $_button['view'] ?>.edit&ref=joomla_component&refid=<?php echo $item->id; ?>&return=<?php echo $this->return_here; ?>" title="<?php echo $_button['title']; ?>" ><span class="icon-<?php echo $_button['icon']; ?>"></span></a>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</td>
<td class="hidden-phone">

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_components extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -266,6 +266,11 @@ class ComponentbuilderViewJoomla_components extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -317,7 +322,7 @@ class ComponentbuilderViewJoomla_components extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -379,9 +379,13 @@ jQuery('#adminForm').on('change', '#jform_add_update_server',function (e)
jQuery('#jform_snippet').closest('.input-append').addClass('jform_snippet_input_width');
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
});
// make sure the code bocks are active
document.querySelectorAll("code").forEach(function(codeBlock) {
codeBlock.addEventListener("click", function() {
codeBlock.selText(); // Call the custom selText function
codeBlock.classList.add("selected"); // Add the "selected" class
});
});
});
jQuery('#adminForm').on('change', '#jform_custom_get',function (e) {
e.preventDefault();
@@ -400,25 +404,6 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) {
// load the dynamic media placeholders if needed
setModuleCode();
});
jQuery.fn.selText = function() {
var obj = this[0];
if (jQuery.browser.msie) {
var range = obj.offsetParent.createTextRange();
range.moveToElementText(obj);
range.select();
} else if (jQuery.browser.mozilla || $.browser.opera) {
var selection = obj.ownerDocument.defaultView.getSelection();
var range = obj.ownerDocument.createRange();
range.selectNodeContents(obj);
selection.removeAllRanges();
selection.addRange(range);
} else if (jQuery.browser.safari) {
var selection = obj.ownerDocument.defaultView.getSelection();
selection.setBaseAndExtent(obj, 0, obj, 1);
}
return this;
}
jQuery('#adminForm').on('change', '#jform_snippet',function (e) {
e.preventDefault();
@@ -435,6 +420,22 @@ jQuery(document).ready(function() {
// some lang strings
var select_a_snippet = '<?php echo Text::_('COM_COMPONENTBUILDER_SELECT_A_SNIPPET'); ?>';
var create_a_snippet = '<?php echo Text::_('COM_COMPONENTBUILDER_CREATE_A_SNIPPET'); ?>';
HTMLElement.prototype.selText = function() {
var obj = this;
// For modern browsers, handle the selection
var selection = window.getSelection();
var range = document.createRange();
// Select the content of the element
range.selectNodeContents(obj);
selection.removeAllRanges(); // Clear any previous selections
selection.addRange(range); // Add the new selection range
return this;
};
<?php
$app = Factory::getApplication();

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewJoomla_module extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewJoomla_module extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_MODULE_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_MODULE_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_module.css", ['version' => 'auto']);
@@ -219,9 +224,9 @@ class ComponentbuilderViewJoomla_module extends HtmlView
Html::_('script', 'media/com_componentbuilder/js/jstorage.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/js/strtotime.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
// check if we should use browser storage
$setBrowserStorage = $this->params->get('set_browser_storage', null);
if ($setBrowserStorage)
@@ -252,7 +257,7 @@ class ComponentbuilderViewJoomla_module extends HtmlView
$expire = 30000; // only 30 seconds
}
// Set the Time To Live To JavaScript
$this->document->addScriptDeclaration("var expire = ". (int) $expire.";");
$this->getDocument()->addScriptDeclaration("var expire = ". (int) $expire.";");
Text::script('view not acceptable. Error');
}
@@ -261,7 +266,7 @@ class ComponentbuilderViewJoomla_module extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewJoomla_module_files_folders_urls extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewJoomla_module_files_folders_urls extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_module_files_folders_urls.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewJoomla_module_files_folders_urls extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewJoomla_module_updates extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewJoomla_module_updates extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_module_updates.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewJoomla_module_updates extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_modules extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -226,6 +226,11 @@ class ComponentbuilderViewJoomla_modules extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -273,7 +278,7 @@ class ComponentbuilderViewJoomla_modules extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_modules_files_folders_urls extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewJoomla_modules_files_folders_urls extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewJoomla_modules_files_folders_urls extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -80,11 +80,11 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -196,6 +196,11 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_plugin.css", ['version' => 'auto']);
@@ -220,9 +225,9 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
Html::_('script', 'media/com_componentbuilder/js/jstorage.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/js/strtotime.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
// set some lang
Text::script('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER');
Text::script('COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS');
@@ -259,8 +264,8 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
$expire = 30000; // only 30 seconds
}
// Set the Time To Live To JavaScript
$this->document->addScriptDeclaration("var expire = ". (int) $expire.";");
$this->document->addScriptDeclaration("selectionArray = {'property':{},'method':{}};");
$this->getDocument()->addScriptDeclaration("var expire = ". (int) $expire.";");
$this->getDocument()->addScriptDeclaration("selectionArray = {'property':{},'method':{}};");
// add a few field options via PHP
\JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
$tmp_ = \JFormHelper::loadFieldType('joomlaplugingroups')->options;
@@ -272,7 +277,7 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
$_tmp[$item->value] = $item->text;
}
// Set the values to JavaScript
$this->document->addScriptDeclaration("selectionArray['joomla_plugin_group'] = ". json_encode($_tmp) . ";");
$this->getDocument()->addScriptDeclaration("selectionArray['joomla_plugin_group'] = ". json_encode($_tmp) . ";");
}
$tmp_ = \JFormHelper::loadFieldType('pluginsclassproperties')->options;
if (ArrayHelper::check($tmp_))
@@ -283,7 +288,7 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
$_tmp[$item->value] = $item->text;
}
// Set the values to JavaScript
$this->document->addScriptDeclaration("selectionArray['property'] = ". json_encode($_tmp) . ";");
$this->getDocument()->addScriptDeclaration("selectionArray['property'] = ". json_encode($_tmp) . ";");
}
$tmp_ = \JFormHelper::loadFieldType('pluginsclassmethods')->options;
if (ArrayHelper::check($tmp_))
@@ -294,7 +299,7 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
$_tmp[$item->value] = $item->text;
}
// Set the values to JavaScript
$this->document->addScriptDeclaration("selectionArray['method'] = ". json_encode($_tmp) . ";");
$this->getDocument()->addScriptDeclaration("selectionArray['method'] = ". json_encode($_tmp) . ";");
}
Text::script('view not acceptable. Error');
}
@@ -304,7 +309,7 @@ class ComponentbuilderViewJoomla_plugin extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewJoomla_plugin_files_folders_urls extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewJoomla_plugin_files_folders_urls extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_plugin_files_folders_urls.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewJoomla_plugin_files_folders_urls extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewJoomla_plugin_group extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewJoomla_plugin_group extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_plugin_group.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewJoomla_plugin_group extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_plugin_groups extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -211,6 +211,11 @@ class ComponentbuilderViewJoomla_plugin_groups extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -258,7 +263,7 @@ class ComponentbuilderViewJoomla_plugin_groups extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewJoomla_plugin_updates extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewJoomla_plugin_updates extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_plugin_updates.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewJoomla_plugin_updates extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_plugins extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -246,6 +246,11 @@ class ComponentbuilderViewJoomla_plugins extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -294,7 +299,7 @@ class ComponentbuilderViewJoomla_plugins extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_plugins_files_folders_urls extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewJoomla_plugins_files_folders_urls extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewJoomla_plugins_files_folders_urls extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_plugins_updates extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewJoomla_plugins_updates extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewJoomla_plugins_updates extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewJoomla_power extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -205,6 +205,11 @@ class ComponentbuilderViewJoomla_power extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_POWER_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_POWER_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_power.css", ['version' => 'auto']);
@@ -218,7 +223,7 @@ class ComponentbuilderViewJoomla_power extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewJoomla_powers extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -206,6 +206,11 @@ class ComponentbuilderViewJoomla_powers extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -252,7 +257,7 @@ class ComponentbuilderViewJoomla_powers extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewLanguage extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewLanguage extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LANGUAGE_NEW' : 'COM_COMPONENTBUILDER_LANGUAGE_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/language.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewLanguage extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewLanguage_translation extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewLanguage_translation extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_NEW' : 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/language_translation.css", ['version' => 'auto']);
@@ -210,7 +215,7 @@ class ComponentbuilderViewLanguage_translation extends HtmlView
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']);
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
Text::script('view not acceptable. Error');
}
@@ -219,7 +224,7 @@ class ComponentbuilderViewLanguage_translation extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewLanguage_translations extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -201,6 +201,11 @@ class ComponentbuilderViewLanguage_translations extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -247,7 +252,7 @@ class ComponentbuilderViewLanguage_translations extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewLanguages extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -206,6 +206,11 @@ class ComponentbuilderViewLanguages extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -253,7 +258,7 @@ class ComponentbuilderViewLanguages extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -146,16 +146,24 @@ jQuery('#adminForm').on('change', '#jform_add_php_view',function (e)
jQuery(function() {
jQuery('#open-libraries').html('<a href="index.php?option=com_componentbuilder&view=libraries"><?php echo JText::_('COM_COMPONENTBUILDER_LIBRARIES'); ?></a>');
});
document.addEventListener("DOMContentLoaded", function() {
document.querySelector('#open-libraries').innerHTML = '<a href="index.php?option=com_componentbuilder&view=libraries"><?php echo Text::_('COM_COMPONENTBUILDER_LIBRARIES'); ?></a>';
});
jQuery('#jform_snippet').closest('.input-append').addClass('jform_snippet_input_width');
jQuery('#jform_dynamic_get').closest('.input-append').addClass('jform_dynamic_get_input_width');
jQuery(function() {
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
// Ensure the DOM is fully loaded before running the code
document.addEventListener("DOMContentLoaded", function() {
// Event listener for code blocks
document.querySelectorAll("code").forEach(function(codeBlock) {
codeBlock.addEventListener("click", function() {
codeBlock.selText(); // Call the custom selText function
codeBlock.classList.add("selected"); // Add the "selected" class
});
});
});
jQuery('#adminForm').on('change', '#jform_libraries',function (e) {
e.preventDefault();
getSnippets();
@@ -191,24 +199,20 @@ jQuery(document).ready(function() {
var select_a_snippet = '<?php echo Text::_('COM_COMPONENTBUILDER_SELECT_A_SNIPPET'); ?>';
var create_a_snippet = '<?php echo Text::_('COM_COMPONENTBUILDER_CREATE_A_SNIPPET'); ?>';
jQuery.fn.selText = function() {
var obj = this[0];
if (jQuery.browser.msie) {
var range = obj.offsetParent.createTextRange();
range.moveToElementText(obj);
range.select();
} else if (jQuery.browser.mozilla || $.browser.opera) {
var selection = obj.ownerDocument.defaultView.getSelection();
var range = obj.ownerDocument.createRange();
range.selectNodeContents(obj);
selection.removeAllRanges();
selection.addRange(range);
} else if (jQuery.browser.safari) {
var selection = obj.ownerDocument.defaultView.getSelection();
selection.setBaseAndExtent(obj, 0, obj, 1);
}
HTMLElement.prototype.selText = function() {
var obj = this;
// For modern browsers, handle the selection
var selection = window.getSelection();
var range = document.createRange();
// Select the content of the element
range.selectNodeContents(obj);
selection.removeAllRanges(); // Clear any previous selections
selection.addRange(range); // Add the new selection range
return this;
}
};
<?php
$app = Factory::getApplication();

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewLayout extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewLayout extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/layout.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewLayout extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewLayout extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -75,26 +75,25 @@ if ($this->saveOrder)
<script type="text/javascript">
// layouts footer script
jQuery.fn.selText = function() {
var obj = this[0];
if (jQuery.browser.msie) {
var range = obj.offsetParent.createTextRange();
range.moveToElementText(obj);
range.select();
} else if (jQuery.browser.mozilla || $.browser.opera) {
var selection = obj.ownerDocument.defaultView.getSelection();
var range = obj.ownerDocument.createRange();
range.selectNodeContents(obj);
selection.removeAllRanges();
selection.addRange(range);
} else if (jQuery.browser.safari) {
var selection = obj.ownerDocument.defaultView.getSelection();
selection.setBaseAndExtent(obj, 0, obj, 1);
}
HTMLElement.prototype.selText = function() {
var obj = this;
// For modern browsers, handle the selection
var selection = window.getSelection();
var range = document.createRange();
// Select the content of the element
range.selectNodeContents(obj);
selection.removeAllRanges(); // Clear any previous selections
selection.addRange(range); // Add the new selection range
return this;
}
};
// make sure the code bocks are active
jQuery("code").click(function() {
jQuery(this).selText().addClass("selected");
document.querySelectorAll("code").forEach(function(codeBlock) {
codeBlock.addEventListener("click", function() {
codeBlock.selText(); // Call the custom selText function
codeBlock.classList.add("selected"); // Add the "selected" class
});
});
</script>

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewLayouts extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -246,6 +246,11 @@ class ComponentbuilderViewLayouts extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -294,7 +299,7 @@ class ComponentbuilderViewLayouts extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewLibraries extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -256,6 +256,11 @@ class ComponentbuilderViewLibraries extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -305,7 +310,7 @@ class ComponentbuilderViewLibraries extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewLibraries_config extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewLibraries_config extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewLibraries_config extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewLibraries_files_folders_urls extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -191,6 +191,11 @@ class ComponentbuilderViewLibraries_files_folders_urls extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -236,7 +241,7 @@ class ComponentbuilderViewLibraries_files_folders_urls extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewLibrary extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewLibrary extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/library.css", ['version' => 'auto']);
@@ -215,9 +220,9 @@ class ComponentbuilderViewLibrary extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -226,7 +231,7 @@ class ComponentbuilderViewLibrary extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewLibrary_config extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewLibrary_config extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_CONFIG_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_CONFIG_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/library_config.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewLibrary_config extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewLibrary_files_folders_urls extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewLibrary_files_folders_urls extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/library_files_folders_urls.css", ['version' => 'auto']);
@@ -208,7 +213,7 @@ class ComponentbuilderViewLibrary_files_folders_urls extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -79,11 +79,11 @@ class ComponentbuilderViewPlaceholder extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
@@ -195,6 +195,11 @@ class ComponentbuilderViewPlaceholder extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_PLACEHOLDER_NEW' : 'COM_COMPONENTBUILDER_PLACEHOLDER_EDIT'));
Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/placeholder.css", ['version' => 'auto']);
@@ -218,9 +223,9 @@ class ComponentbuilderViewPlaceholder extends HtmlView
Text::script('COM_COMPONENTBUILDER_PLACEHOLDER_ALREADY_TAKEN_PLEASE_TRY_AGAIN');
Text::script('COM_COMPONENTBUILDER_YOU_MUST_ADD_AN_UNIQUE_PLACEHOLDER');
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) Uri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}
@@ -229,7 +234,7 @@ class ComponentbuilderViewPlaceholder extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

View File

@@ -85,11 +85,11 @@ class ComponentbuilderViewPlaceholders extends HtmlView
throw new Exception(implode("\n", $errors), 500);
}
// Display the template
parent::display($tpl);
// Set the document
$this->setDocument();
// Display the template
parent::display($tpl);
}
/**
@@ -201,6 +201,11 @@ class ComponentbuilderViewPlaceholders extends HtmlView
*/
protected function setDocument()
{
// Load Core
Html::_('behavior.core');
// Load jQuery
Html::_('jquery.framework');
if (!isset($this->document))
{
$this->document = Factory::getDocument();
@@ -248,7 +253,7 @@ class ComponentbuilderViewPlaceholders extends HtmlView
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
$this->document ??= Factory::getDocument();
return $this->document;
}

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