Improved the getActions helper method, also added ->params to custom views.

This commit is contained in:
2018-09-19 14:51:59 +02:00
parent 38176365de
commit 2e758308d2
81 changed files with 484 additions and 190 deletions

View File

@ -17,7 +17,7 @@ JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = JComponentHelper::getParams('com_componentbuilder');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<div id="componentbuilder_loader">
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">

View File

@ -23,13 +23,15 @@ class ComponentbuilderViewSnippet extends JViewLegacy
*/
public function display($tpl = null)
{
// set params
$this->params = JComponentHelper::getParams('com_componentbuilder');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->script = $this->get('Script');
$this->state = $this->get('State');
// get action permissions
$this->canDo = ComponentbuilderHelper::getActions('snippet',$this->item);
$this->canDo = ComponentbuilderHelper::getActions('snippet', $this->item);
// get input
$jinput = JFactory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');