changed component table name to joomla-component to add history/version tracking back to components
This commit is contained in:
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.3.4
|
||||
@build 14th February, 2017
|
||||
@version 2.3.5
|
||||
@build 16th February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage ajax.json.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 17 of this MVC
|
||||
@build 13th February, 2017
|
||||
@version @update number 18 of this MVC
|
||||
@build 16th February, 2017
|
||||
@created 1st February, 2017
|
||||
@package Component Builder
|
||||
@subpackage compiler.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.3.4
|
||||
@build 14th February, 2017
|
||||
@version 2.3.5
|
||||
@build 16th February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 55 of this MVC
|
||||
@build 13th February, 2017
|
||||
@build 16th February, 2017
|
||||
@created 11th October, 2016
|
||||
@package Component Builder
|
||||
@subpackage custom_code.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 55 of this MVC
|
||||
@build 13th February, 2017
|
||||
@build 16th February, 2017
|
||||
@created 11th October, 2016
|
||||
@package Component Builder
|
||||
@subpackage custom_codes.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.3.4
|
||||
@build 14th February, 2017
|
||||
@version 2.3.5
|
||||
@build 16th February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage help.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.3.4
|
||||
@build 14th February, 2017
|
||||
@version 2.3.5
|
||||
@build 16th February, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import.php
|
||||
|
@ -10,11 +10,11 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 81 of this MVC
|
||||
@build 13th February, 2017
|
||||
@version @update number 84 of this MVC
|
||||
@build 16th February, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage component.php
|
||||
@subpackage joomla_component.php
|
||||
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
@ -30,9 +30,9 @@ defined('_JEXEC') or die('Restricted access');
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Component Controller
|
||||
* Joomla_component Controller
|
||||
*/
|
||||
class ComponentbuilderControllerComponent extends JControllerForm
|
||||
class ComponentbuilderControllerJoomla_component extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
@ -45,7 +45,7 @@ class ComponentbuilderControllerComponent extends JControllerForm
|
||||
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Components'; // safeguard for setting the return view listing to the main view.
|
||||
$this->view_list = 'Joomla_components'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
@ -59,7 +59,14 @@ class ComponentbuilderControllerComponent extends JControllerForm
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{ // In the absense of better information, revert to the component permissions.
|
||||
{
|
||||
// Access check.
|
||||
$access = JFactory::getUser()->authorise('joomla_component.access', 'com_componentbuilder');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return parent::allowAdd($data);
|
||||
}
|
||||
|
||||
@ -84,10 +91,10 @@ class ComponentbuilderControllerComponent extends JControllerForm
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('core.edit', 'com_componentbuilder.component.' . (int) $recordId);
|
||||
$permission = $user->authorise('core.edit', 'com_componentbuilder.joomla_component.' . (int) $recordId);
|
||||
if (!$permission)
|
||||
{
|
||||
if ($user->authorise('core.edit.own', 'com_componentbuilder.component.' . $recordId))
|
||||
if ($user->authorise('core.edit.own', 'com_componentbuilder.joomla_component.' . $recordId))
|
||||
{
|
||||
// Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
@ -182,10 +189,10 @@ class ComponentbuilderControllerComponent extends JControllerForm
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Component', '', array());
|
||||
$model = $this->getModel('Joomla_component', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components' . $this->getRedirectToListAppend(), false));
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
@ -10,11 +10,11 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 81 of this MVC
|
||||
@build 13th February, 2017
|
||||
@version @update number 84 of this MVC
|
||||
@build 16th February, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage components.php
|
||||
@subpackage joomla_components.php
|
||||
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
|
||||
@copyright Copyright (C) 2015. All Rights Reserved
|
||||
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||
@ -30,16 +30,16 @@ defined('_JEXEC') or die('Restricted access');
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Components Controller
|
||||
* Joomla_components Controller
|
||||
*/
|
||||
class ComponentbuilderControllerComponents extends JControllerAdmin
|
||||
class ComponentbuilderControllerJoomla_components extends JControllerAdmin
|
||||
{
|
||||
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS';
|
||||
protected $text_prefix = 'COM_COMPONENTBUILDER_JOOMLA_COMPONENTS';
|
||||
/**
|
||||
* Proxy for getModel.
|
||||
* @since 2.5
|
||||
*/
|
||||
public function getModel($name = 'Component', $prefix = 'ComponentbuilderModel', $config = array())
|
||||
public function getModel($name = 'Joomla_component', $prefix = 'ComponentbuilderModel', $config = array())
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||
|
||||
@ -52,7 +52,7 @@ class ComponentbuilderControllerComponents extends JControllerAdmin
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// check if export is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('component.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
|
||||
if ($user->authorise('joomla_component.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder'))
|
||||
{
|
||||
// Get the input
|
||||
$input = JFactory::getApplication()->input;
|
||||
@ -60,19 +60,19 @@ class ComponentbuilderControllerComponents extends JControllerAdmin
|
||||
// Sanitize the input
|
||||
JArrayHelper::toInteger($pks);
|
||||
// Get the model
|
||||
$model = $this->getModel('Components');
|
||||
$model = $this->getModel('Joomla_components');
|
||||
// get the data to export
|
||||
$data = $model->getExportData($pks);
|
||||
if (ComponentbuilderHelper::checkArray($data))
|
||||
{
|
||||
// now set the data to the spreadsheet
|
||||
$date = JFactory::getDate();
|
||||
ComponentbuilderHelper::xls($data,'Components_'.$date->format('jS_F_Y'),'Components exported ('.$date->format('jS F, Y').')','components');
|
||||
ComponentbuilderHelper::xls($data,'Joomla_components_'.$date->format('jS_F_Y'),'Joomla components exported ('.$date->format('jS F, Y').')','joomla components');
|
||||
}
|
||||
}
|
||||
// Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components', false), $message, 'error');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -83,10 +83,10 @@ class ComponentbuilderControllerComponents extends JControllerAdmin
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// check if import is allowed for this user.
|
||||
$user = JFactory::getUser();
|
||||
if ($user->authorise('component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
|
||||
if ($user->authorise('joomla_component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder'))
|
||||
{
|
||||
// Get the import model
|
||||
$model = $this->getModel('Components');
|
||||
$model = $this->getModel('Joomla_components');
|
||||
// get the headers to import
|
||||
$headers = $model->getExImPortHeaders();
|
||||
if (ComponentbuilderHelper::checkObject($headers))
|
||||
@ -94,18 +94,18 @@ class ComponentbuilderControllerComponents extends JControllerAdmin
|
||||
// Load headers to session.
|
||||
$session = JFactory::getSession();
|
||||
$headers = json_encode($headers);
|
||||
$session->set('component_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'components');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'component');
|
||||
$session->set('joomla_component_VDM_IMPORTHEADERS', $headers);
|
||||
$session->set('backto_VDM_IMPORT', 'joomla_components');
|
||||
$session->set('dataType_VDM_IMPORTINTO', 'joomla_component');
|
||||
// Redirect to import view.
|
||||
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_COMPONENTS');
|
||||
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_COMPONENTS');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Redirect to the list screen with error.
|
||||
$message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components', false), $message, 'error');
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
|
||||
return;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user