-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from joomdev/dev
Performance Improvements + Live preview + Bug fixes
- Loading branch information
Showing
125 changed files
with
15,090 additions
and
2,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
<?php | ||
|
||
/** | ||
* @version CVS: 1.0.0 | ||
* @package Com_Jdbuilder | ||
* @package JD Builder | ||
* @author Team Joomdev <[email protected]> | ||
* @copyright 2019 Hitesh Aggarwal | ||
* @copyright 2019 www.joomdev.com | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
// No direct access | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
<?php | ||
|
||
/** | ||
* @version CVS: 1.0.0 | ||
* @package Com_Jdbuilder | ||
* @package JD Builder | ||
* @author Team Joomdev <[email protected]> | ||
* @copyright 2019 Hitesh Aggarwal | ||
* @copyright 2019 www.joomdev.com | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
// No direct access | ||
defined('_JEXEC') or die; | ||
|
||
|
@@ -17,16 +16,16 @@ | |
* | ||
* @since 1.6 | ||
*/ | ||
class JdbuilderControllerPage extends JControllerForm | ||
{ | ||
/** | ||
* Constructor | ||
* | ||
* @throws Exception | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->view_list = 'pages'; | ||
parent::__construct(); | ||
} | ||
class JdbuilderControllerPage extends JControllerForm { | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @throws Exception | ||
*/ | ||
public function __construct() { | ||
$this->view_list = 'pages'; | ||
parent::__construct(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
<?php | ||
|
||
/** | ||
* @version CVS: 1.0.0 | ||
* @package Com_Jdbuilder | ||
* @package JD Builder | ||
* @author Team Joomdev <[email protected]> | ||
* @copyright 2019 Hitesh Aggarwal | ||
* @copyright 2019 www.joomdev.com | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
// No direct access. | ||
defined('_JEXEC') or die; | ||
|
||
|
@@ -19,89 +18,82 @@ | |
* | ||
* @since 1.6 | ||
*/ | ||
class JdbuilderControllerPages extends JControllerAdmin | ||
{ | ||
/** | ||
* Method to clone existing Pages | ||
* | ||
* @return void | ||
*/ | ||
public function duplicate() | ||
{ | ||
// Check for request forgeries | ||
Jsession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); | ||
|
||
// Get id(s) | ||
$pks = $this->input->post->get('cid', array(), 'array'); | ||
|
||
try | ||
{ | ||
if (empty($pks)) | ||
{ | ||
throw new Exception(JText::_('COM_JDBUILDER_NO_ELEMENT_SELECTED')); | ||
} | ||
|
||
ArrayHelper::toInteger($pks); | ||
$model = $this->getModel(); | ||
$model->duplicate($pks); | ||
$this->setMessage(Jtext::_('COM_JDBUILDER_ITEMS_SUCCESS_DUPLICATED')); | ||
} | ||
catch (Exception $e) | ||
{ | ||
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning'); | ||
} | ||
|
||
$this->setRedirect('index.php?option=com_jdbuilder&view=pages'); | ||
} | ||
|
||
/** | ||
* Proxy for getModel. | ||
* | ||
* @param string $name Optional. Model name | ||
* @param string $prefix Optional. Class prefix | ||
* @param array $config Optional. Configuration array for model | ||
* | ||
* @return object The Model | ||
* | ||
* @since 1.6 | ||
*/ | ||
public function getModel($name = 'page', $prefix = 'JdbuilderModel', $config = array()) | ||
{ | ||
$model = parent::getModel($name, $prefix, array('ignore_request' => true)); | ||
|
||
return $model; | ||
} | ||
|
||
/** | ||
* Method to save the submitted ordering values for records via AJAX. | ||
* | ||
* @return void | ||
* | ||
* @since 3.0 | ||
*/ | ||
public function saveOrderAjax() | ||
{ | ||
// Get the input | ||
$input = JFactory::getApplication()->input; | ||
$pks = $input->post->get('cid', array(), 'array'); | ||
$order = $input->post->get('order', array(), 'array'); | ||
|
||
// Sanitize the input | ||
ArrayHelper::toInteger($pks); | ||
ArrayHelper::toInteger($order); | ||
|
||
// Get the model | ||
$model = $this->getModel(); | ||
|
||
// Save the ordering | ||
$return = $model->saveorder($pks, $order); | ||
|
||
if ($return) | ||
{ | ||
echo "1"; | ||
} | ||
|
||
// Close the application | ||
JFactory::getApplication()->close(); | ||
} | ||
class JdbuilderControllerPages extends JControllerAdmin { | ||
|
||
/** | ||
* Method to clone existing Pages | ||
* | ||
* @return void | ||
*/ | ||
public function duplicate() { | ||
// Check for request forgeries | ||
Jsession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); | ||
|
||
// Get id(s) | ||
$pks = $this->input->post->get('cid', array(), 'array'); | ||
|
||
try { | ||
if (empty($pks)) { | ||
throw new Exception(JText::_('COM_JDBUILDER_NO_ELEMENT_SELECTED')); | ||
} | ||
|
||
ArrayHelper::toInteger($pks); | ||
$model = $this->getModel(); | ||
$model->duplicate($pks); | ||
$this->setMessage(Jtext::_('COM_JDBUILDER_ITEMS_SUCCESS_DUPLICATED')); | ||
} catch (Exception $e) { | ||
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning'); | ||
} | ||
|
||
$this->setRedirect('index.php?option=com_jdbuilder&view=pages'); | ||
} | ||
|
||
/** | ||
* Proxy for getModel. | ||
* | ||
* @param string $name Optional. Model name | ||
* @param string $prefix Optional. Class prefix | ||
* @param array $config Optional. Configuration array for model | ||
* | ||
* @return object The Model | ||
* | ||
* @since 1.6 | ||
*/ | ||
public function getModel($name = 'page', $prefix = 'JdbuilderModel', $config = array()) { | ||
$model = parent::getModel($name, $prefix, array('ignore_request' => true)); | ||
|
||
return $model; | ||
} | ||
|
||
/** | ||
* Method to save the submitted ordering values for records via AJAX. | ||
* | ||
* @return void | ||
* | ||
* @since 3.0 | ||
*/ | ||
public function saveOrderAjax() { | ||
// Get the input | ||
$input = JFactory::getApplication()->input; | ||
$pks = $input->post->get('cid', array(), 'array'); | ||
$order = $input->post->get('order', array(), 'array'); | ||
|
||
// Sanitize the input | ||
ArrayHelper::toInteger($pks); | ||
ArrayHelper::toInteger($order); | ||
|
||
// Get the model | ||
$model = $this->getModel(); | ||
|
||
// Save the ordering | ||
$return = $model->saveorder($pks, $order); | ||
|
||
if ($return) { | ||
echo "1"; | ||
} | ||
|
||
// Close the application | ||
JFactory::getApplication()->close(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
<?php | ||
|
||
/** | ||
* @version CVS: 1.0.0 | ||
* @package Com_Jdbuilder | ||
* @package JD Builder | ||
* @author Team Joomdev <[email protected]> | ||
* @copyright 2019 Hitesh Aggarwal | ||
* @copyright 2019 www.joomdev.com | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
// No direct access | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
<?php | ||
|
||
/** | ||
* @version CVS: 1.0.0 | ||
* @package Com_Jdbuilder | ||
* @package JD Builder | ||
* @author Team Joomdev <[email protected]> | ||
* @copyright 2019 Hitesh Aggarwal | ||
* @copyright 2019 www.joomdev.com | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
// No direct access | ||
|
@@ -15,20 +14,20 @@ | |
* | ||
* @since 1.6 | ||
*/ | ||
abstract class JHtmlListhelper | ||
{ | ||
static function toggle($value = 0, $view, $field, $i) | ||
{ | ||
$states = array( | ||
0 => array('icon-remove', JText::_('Toggle'), 'inactive btn-danger'), | ||
1 => array('icon-checkmark', JText::_('Toggle'), 'active btn-success') | ||
); | ||
abstract class JHtmlListhelper { | ||
|
||
$state = \Joomla\Utilities\ArrayHelper::getValue($states, (int) $value, $states[0]); | ||
$text = '<span aria-hidden="true" class="' . $state[0] . '"></span>'; | ||
$html = '<a href="#" class="btn btn-micro ' . $state[2] . '"'; | ||
$html .= 'onclick="return toggleField(\'cb'.$i.'\',\'' . $view . '.toggle\',\'' . $field . '\')" title="' . JText::_($state[1]) . '">' . $text . '</a>'; | ||
static function toggle($value = 0, $view, $field, $i) { | ||
$states = array( | ||
0 => array('icon-remove', JText::_('Toggle'), 'inactive btn-danger'), | ||
1 => array('icon-checkmark', JText::_('Toggle'), 'active btn-success') | ||
); | ||
|
||
$state = \Joomla\Utilities\ArrayHelper::getValue($states, (int) $value, $states[0]); | ||
$text = '<span aria-hidden="true" class="' . $state[0] . '"></span>'; | ||
$html = '<a href="#" class="btn btn-micro ' . $state[2] . '"'; | ||
$html .= 'onclick="return toggleField(\'cb' . $i . '\',\'' . $view . '.toggle\',\'' . $field . '\')" title="' . JText::_($state[1]) . '">' . $text . '</a>'; | ||
|
||
return $html; | ||
} | ||
|
||
return $html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
<?php | ||
|
||
/** | ||
* @version CVS: 1.0.0 | ||
* @package Com_Jdbuilder | ||
* @package JD Builder | ||
* @author Team Joomdev <[email protected]> | ||
* @copyright 2019 Hitesh Aggarwal | ||
* @copyright 2019 www.joomdev.com | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
// No direct access | ||
defined('_JEXEC') or die; | ||
|
||
// Access check. | ||
if (!JFactory::getUser()->authorise('core.manage', 'com_jdbuilder')) | ||
{ | ||
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR')); | ||
if (!JFactory::getUser()->authorise('core.manage', 'com_jdbuilder')) { | ||
throw new Exception(JText::_('JERROR_ALERTNOAUTHOR')); | ||
} | ||
|
||
// Include dependancies | ||
|
Oops, something went wrong.