Skip to content

Commit ef4f5fe

Browse files
1.11.1 Release
1 parent f7c5bdd commit ef4f5fe

File tree

24 files changed

+496
-40
lines changed

24 files changed

+496
-40
lines changed
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?php
2+
3+
/**
4+
* @package JD Builder
5+
* @author Team Joomdev <[email protected]>
6+
* @copyright 2020 www.joomdev.com
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
8+
*/
9+
// No direct access.
10+
defined('_JEXEC') or die;
11+
12+
jimport('joomla.application.component.controlleradmin');
13+
14+
/**
15+
* Pages list controller class.
16+
*
17+
* @since 1.6
18+
*/
19+
class JdbuilderControllerIntegrations extends JControllerAdmin
20+
{
21+
22+
/**
23+
* Method to clone existing Pages
24+
*
25+
* @return void
26+
*/
27+
public function articleToggle()
28+
{
29+
// Jsession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
30+
if (defined('JDB_PRO') && !JDB_PRO) {
31+
JFactory::getApplication()->enqueueMessage(\JText::_('COM_JDBUILDER_PRO_FEATURE_WARNING'), 'error');
32+
$this->setRedirect('index.php?option=com_jdbuilder&view=integrations');
33+
return;
34+
}
35+
try {
36+
$params = JComponentHelper::getParams('com_jdbuilder');
37+
$article_integration = $params->get('article_integration', 1);
38+
39+
$article_integration = $article_integration ? 0 : 1;
40+
$params->set('article_integration', $article_integration);
41+
42+
// Save the parameters
43+
$componentid = JComponentHelper::getComponent('com_jdbuilder')->id;
44+
$table = JTable::getInstance('extension');
45+
$table->load($componentid);
46+
$table->bind(array('params' => $params->toString()));
47+
48+
// check for error
49+
if (!$table->check()) {
50+
throw new \Exception($table->getError());
51+
}
52+
// Save to database
53+
if (!$table->store()) {
54+
throw new \Exception($table->getError());
55+
}
56+
57+
$msg = 'COM_JDBUILDER_ARTICLE_INTEGRATION_' . ($article_integration ? 'ENABLED' : 'DISABLED');
58+
JFactory::getApplication()->enqueueMessage(\JText::_($msg), 'success');
59+
} catch (Exception $e) {
60+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning');
61+
}
62+
63+
$this->setRedirect('index.php?option=com_jdbuilder&view=integrations');
64+
}
65+
66+
public function faToggle()
67+
{
68+
// Jsession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
69+
if (defined('JDB_PRO') && !JDB_PRO) {
70+
JFactory::getApplication()->enqueueMessage(\JText::_('COM_JDBUILDER_PRO_FEATURE_WARNING'), 'error');
71+
$this->setRedirect('index.php?option=com_jdbuilder&view=integrations');
72+
return;
73+
}
74+
try {
75+
$params = JComponentHelper::getParams('com_jdbuilder');
76+
$fontawesomepro_integration = $params->get('fontawesomepro_integration', 1);
77+
78+
$fontawesomepro_integration = $fontawesomepro_integration ? 0 : 1;
79+
$params->set('fontawesomepro_integration', $fontawesomepro_integration);
80+
81+
// Save the parameters
82+
$componentid = JComponentHelper::getComponent('com_jdbuilder')->id;
83+
$table = JTable::getInstance('extension');
84+
$table->load($componentid);
85+
$table->bind(array('params' => $params->toString()));
86+
87+
// check for error
88+
if (!$table->check()) {
89+
throw new \Exception($table->getError());
90+
}
91+
// Save to database
92+
if (!$table->store()) {
93+
throw new \Exception($table->getError());
94+
}
95+
96+
$msg = 'COM_JDBUILDER_FA_INTEGRATION_' . ($fontawesomepro_integration ? 'ENABLED' : 'DISABLED');
97+
JFactory::getApplication()->enqueueMessage(\JText::_($msg), 'success');
98+
} catch (Exception $e) {
99+
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning');
100+
}
101+
102+
$this->setRedirect('index.php?option=com_jdbuilder&view=integrations');
103+
}
104+
}

com_jdbuilder/administrator/helpers/jdbuilder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ public static function addSubmenu($vName = '')
4343
$vName == 'categories'
4444
);
4545

46+
JHtmlSidebar::addEntry(
47+
JText::_('COM_JDBUILDER_TITLE_INTEGRATIONS'),
48+
"index.php?option=com_jdbuilder&view=integrations",
49+
$vName == 'integrations'
50+
);
51+
4652
if ($vName == 'categories') {
4753
JToolBarHelper::title('JD Builder: JCATEGORIES');
4854
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><body></body></html>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
/**
4+
* @package JD Builder
5+
* @author Team Joomdev <[email protected]>
6+
* @copyright 2020 www.joomdev.com
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
8+
*/
9+
// No direct access
10+
defined('_JEXEC') or die;
11+
12+
JHtml::addIncludePath(JPATH_COMPONENT . '\/helpers/');
13+
// Import CSS
14+
$document = JFactory::getDocument();
15+
$document->addStyleSheet(JUri::root() . 'administrator/components/com_jdbuilder/assets/css/jdbuilder.css');
16+
$document->addStyleSheet(JUri::root() . 'media/com_jdbuilder/css/list.css');
17+
18+
$buiderConfig = JComponentHelper::getParams('com_jdbuilder');
19+
$article_integration = $buiderConfig->get('article_integration', 1);
20+
$article_integration = defined('JDB_PRO') && !JDB_PRO ? 0 : $article_integration;
21+
22+
$fa_integration = $buiderConfig->get('fontawesomepro_integration', 0);
23+
$fa_integration = defined('JDB_PRO') && !JDB_PRO ? 0 : $fa_integration;
24+
25+
?>
26+
<div>
27+
<?php if (!empty($this->sidebar)) : ?>
28+
<div id="j-sidebar-container" class="span2">
29+
<?php echo $this->sidebar; ?>
30+
</div>
31+
<div id="j-main-container" class="span10">
32+
<?php else : ?>
33+
<div id="j-main-container">
34+
<?php endif; ?>
35+
<div class="clearfix"></div>
36+
<table class="table">
37+
<tbody>
38+
<tr>
39+
<td style="border: none;display: flex;align-items: stretch;">
40+
<div class="jdb-integration-item">
41+
<div class="item-icon">
42+
<img src="<?php echo JURI::root(); ?>/media/jdbuilder/images/joomla.svg" />
43+
</div>
44+
<a href="<?php echo JRoute::_('index.php?option=com_jdbuilder&task=integrations.articleToggle'); ?>" class="item-title">
45+
<h4>Joomla Articles <span class="item-switch"><img src="<?php echo JURI::root(); ?>/media/jdbuilder/images/switch-<?php echo $article_integration ? 'on' : 'off'; ?>.svg" /><span></h4>
46+
</a>
47+
</div>
48+
<div class="jdb-integration-item">
49+
<div class="item-icon">
50+
<img src="<?php echo JURI::root(); ?>/media/jdbuilder/images/fontawesome.png" />
51+
</div>
52+
<a href="<?php echo JRoute::_('index.php?option=com_jdbuilder&task=integrations.faToggle'); ?>" class="item-title">
53+
<h4>Font Awesome Pro <span class="item-switch"><img src="<?php echo JURI::root(); ?>/media/jdbuilder/images/switch-<?php echo $fa_integration ? 'on' : 'off'; ?>.svg" /><span></h4>
54+
</a>
55+
<?php echo \JText::_('COM_JDBUILDER_FA_PRO_DESC'); ?>
56+
</div>
57+
</td>
58+
</tr>
59+
</tbody>
60+
</table>
61+
<div class="component-version-container">
62+
<span class="component-version"><?php echo \JText::_('COM_JDBUILDER'); ?> <span>v<?php echo JDB_VERSION; ?></span><?php echo \JText::_('JDBUILDER_VERSION_LABEL'); ?>| Developed with <span style="color: red">&hearts;</span> by <a href="https://www.joomdev.com" target="_blank">JoomDev</a></span>
63+
<div class="support-link">
64+
<a href="https://docs.joomdev.com/category/jd-builder/" target="_blank">Documentation</a> <span>|</span> <a href="https://www.joomdev.com/jd-builder/changelog" target="_blank">Changelog</a> <span>|</span> <a href="https://www.joomdev.com/forum/jd-builder" target="_blank">Forum</a> <span>|</span> <a href="https://www.youtube.com/playlist?list=PLv9TlpLcSZTAnfiT0x10HO5GGaTJhUB1K" target="_blank">Video Tutorials</a> <span>|</span> <a href="https://extensions.joomla.org/extension/jd-builder" target="_blank"><span class="icon-joomla"></span> Rate Us</a>
65+
</div>
66+
</div>
67+
</div>
68+
</div>
69+
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<html><body></body></html>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
3+
/**
4+
* @package JD Builder
5+
* @author Team Joomdev <[email protected]>
6+
* @copyright 2020 www.joomdev.com
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
8+
*/
9+
// No direct access
10+
defined('_JEXEC') or die;
11+
12+
jimport('joomla.application.component.view');
13+
14+
/**
15+
* View class for a list of Jdbuilder.
16+
*
17+
* @since 1.6
18+
*/
19+
class JdbuilderViewIntegrations extends JViewLegacy
20+
{
21+
22+
/**
23+
* Display the view
24+
*
25+
* @param string $tpl Template name
26+
*
27+
* @return void
28+
*
29+
* @throws Exception
30+
*/
31+
public function display($tpl = null)
32+
{
33+
JdbuilderHelper::addSubmenu('integrations');
34+
35+
$this->addToolbar();
36+
37+
$this->sidebar = JHtmlSidebar::render();
38+
parent::display($tpl);
39+
}
40+
41+
/**
42+
* Add the page title and toolbar.
43+
*
44+
* @return void
45+
*
46+
* @since 1.6
47+
*/
48+
protected function addToolbar()
49+
{
50+
$canDo = JdbuilderHelper::getActions();
51+
52+
JToolBarHelper::title(JText::_('COM_JDBUILDER_TITLE_INTEGRATIONS'), 'stack pages');
53+
54+
55+
$bar = JToolbar::getInstance('toolbar');
56+
$bar->appendButton('Custom', '<a target="_blank" class="btn btn-small" href="https://www.youtube.com/playlist?list=PLv9TlpLcSZTAnfiT0x10HO5GGaTJhUB1K"><span class="icon-youtube"></span> ' . JText::_('COM_JDBUILDER_VIDEO_TUTORIALS') . '</a>', 'jdb-tutorials');
57+
58+
$bar->appendButton('Custom', '<a target="_blank" class="btn btn-small" href="https://docs.joomdev.com/category/jd-builder"><span class="icon-help"></span> ' . JText::_('COM_JDBUILDER_HELP') . '</a>', 'jdb-help');
59+
60+
if ($canDo->get('core.admin')) {
61+
JToolBarHelper::preferences('com_jdbuilder');
62+
}
63+
64+
// Set sidebar action - New in 3.0
65+
JHtmlSidebar::setAction('index.php?option=com_jdbuilder&view=pages');
66+
}
67+
}

com_jdbuilder/jdbuilder.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<author>Team Joomdev</author>
99
<authorEmail>[email protected]</authorEmail>
1010
<authorUrl>https://www.joomdev.com</authorUrl>
11-
<version>1.11.0</version>
11+
<version>1.11.1</version>
1212
<description>{jdbcomdesc}</description>
1313
<install> <!-- Runs on install -->
1414
<sql>
@@ -50,6 +50,7 @@
5050
<submenu>
5151
<menu link="option=com_jdbuilder&amp;view=pages" view="pages" alt="Jdbuilder/Pages">COM_JDBUILDER_TITLE_PAGES</menu>
5252
<menu link="option=com_categories&amp;extension=com_jdbuilder" view="categories" alt="Jdbuilder/Categories">COM_JDBUILDER_PAGES_CATEGORY_ID</menu>
53+
<menu link="option=com_jdbuilder&amp;view=pages" view="integrations" alt="Jdbuilder/Integrations">COM_JDBUILDER_TITLE_INTEGRATIONS</menu>
5354
</submenu>
5455
<files folder="administrator">
5556
<filename>access.xml</filename>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php
2+
3+
/**
4+
* @package JD Builder
5+
* @author Team Joomdev <[email protected]>
6+
* @copyright 2020 www.joomdev.com
7+
* @license GNU General Public License version 2 or later; see LICENSE.txt
8+
*/
9+
10+
namespace Joomdev\Component\JDBuilder\Administrator\Controller;
11+
12+
defined('_JEXEC') or die;
13+
14+
use Joomla\CMS\MVC\Controller\AdminController;
15+
use Joomla\CMS\Component\ComponentHelper;
16+
use Joomla\CMS\Table\Table;
17+
use Joomla\CMS\Factory;
18+
use Joomla\CMS\Language\Text;
19+
20+
class IntegrationsController extends AdminController
21+
{
22+
/**
23+
* Method to clone existing Pages
24+
*
25+
* @return void
26+
*/
27+
public function articleToggle()
28+
{
29+
if (defined('JDB_PRO') && !JDB_PRO) {
30+
Factory::getApplication()->enqueueMessage(Text::_('COM_JDBUILDER_PRO_FEATURE_WARNING'), 'error');
31+
$this->setRedirect('index.php?option=com_jdbuilder&view=integrations');
32+
return;
33+
}
34+
try {
35+
$params = ComponentHelper::getParams('com_jdbuilder');
36+
$article_integration = $params->get('article_integration', 1);
37+
38+
$article_integration = $article_integration ? 0 : 1;
39+
$params->set('article_integration', $article_integration);
40+
41+
// Save the parameters
42+
$componentid = ComponentHelper::getComponent('com_jdbuilder')->id;
43+
$table = Table::getInstance('extension');
44+
$table->load($componentid);
45+
$table->bind(array('params' => $params->toString()));
46+
47+
// check for error
48+
if (!$table->check()) {
49+
throw new \Exception($table->getError());
50+
}
51+
// Save to database
52+
if (!$table->store()) {
53+
throw new \Exception($table->getError());
54+
}
55+
56+
$msg = 'COM_JDBUILDER_ARTICLE_INTEGRATION_' . ($article_integration ? 'ENABLED' : 'DISABLED');
57+
Factory::getApplication()->enqueueMessage(Text::_($msg), 'success');
58+
} catch (Exception $e) {
59+
Factory::getApplication()->enqueueMessage($e->getMessage(), 'warning');
60+
}
61+
62+
$this->setRedirect('index.php?option=com_jdbuilder&view=integrations');
63+
}
64+
65+
public function faToggle()
66+
{
67+
if (defined('JDB_PRO') && !JDB_PRO) {
68+
Factory::getApplication()->enqueueMessage(Text::_('COM_JDBUILDER_PRO_FEATURE_WARNING'), 'error');
69+
$this->setRedirect('index.php?option=com_jdbuilder&view=integrations');
70+
return;
71+
}
72+
try {
73+
$params = ComponentHelper::getParams('com_jdbuilder');
74+
$fontawesomepro_integration = $params->get('fontawesomepro_integration', 1);
75+
76+
$fontawesomepro_integration = $fontawesomepro_integration ? 0 : 1;
77+
$params->set('fontawesomepro_integration', $fontawesomepro_integration);
78+
79+
// Save the parameters
80+
$componentid = ComponentHelper::getComponent('com_jdbuilder')->id;
81+
$table = Table::getInstance('extension');
82+
$table->load($componentid);
83+
$table->bind(array('params' => $params->toString()));
84+
85+
// check for error
86+
if (!$table->check()) {
87+
throw new \Exception($table->getError());
88+
}
89+
// Save to database
90+
if (!$table->store()) {
91+
throw new \Exception($table->getError());
92+
}
93+
94+
$msg = 'COM_JDBUILDER_FA_INTEGRATION_' . ($fontawesomepro_integration ? 'ENABLED' : 'DISABLED');
95+
Factory::getApplication()->enqueueMessage(Text::_($msg), 'success');
96+
} catch (Exception $e) {
97+
Factory::getApplication()->enqueueMessage($e->getMessage(), 'warning');
98+
}
99+
100+
$this->setRedirect('index.php?option=com_jdbuilder&view=integrations');
101+
}
102+
}

com_jdbuilder_j4/admin/Helper/JdbuilderHelper.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ public static function addSubmenu($vName = '')
4242
$vName == 'categories'
4343
);
4444

45+
\JHtmlSidebar::addEntry(
46+
\JText::_('COM_JDBUILDER_TITLE_INTEGRATIONS'),
47+
"index.php?option=com_jdbuilder&view=integrations",
48+
$vName == 'integrations'
49+
);
50+
4551
if ($vName == 'categories') {
4652
\JToolBarHelper::title('JD Builder: JCATEGORIES');
4753
}

0 commit comments

Comments
 (0)