changed component table name to joomla-component to add history/version tracking back to components

This commit is contained in:
2017-02-16 16:02:23 +02:00
parent 79ab3164a6
commit a197f503a9
231 changed files with 4445 additions and 4289 deletions

View File

@ -490,8 +490,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// Select some fields
$query->select('a.*');
// From the componentbuilder_component table
$query->from($db->quoteName('#__componentbuilder_component', 'a'));
// From the componentbuilder_joomla_component table
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
// Join over the asset groups.
$query->select('ag.title AS access_level');

View File

@ -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.php
@ -43,7 +43,7 @@ class ComponentbuilderModelAjax extends JModelList
}
// Used in component
// Used in joomla_component
/**
* Check and if a vdm notice is new (per/user)
**/

View File

@ -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
@ -73,11 +73,11 @@ class ComponentbuilderModelCompiler extends JModelList
// Create a new query object.
$query = $db->getQuery(true);
// Get from #__componentbuilder_component as a
// Get from #__componentbuilder_joomla_component as a
$query->select($db->quoteName(
array('a.id','a.system_name','a.name','a.name_code','a.component_version','a.debug_linenr','a.short_description','a.image','a.companyname','a.author','a.email','a.website','a.copyright','a.modified','a.created','a.version'),
array('id','system_name','name','name_code','component_version','debug_linenr','short_description','image','companyname','author','email','website','copyright','modified','created','version')));
$query->from($db->quoteName('#__componentbuilder_component', 'a'));
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
$query->where('a.published = 1');
$query->order('a.modified DESC');
$query->order('a.created DESC');
@ -153,7 +153,7 @@ class ComponentbuilderModelCompiler extends JModelList
$query = $db->getQuery(true);
// Order it by the ordering field.
$query->select($db->quoteName(array('id', 'system_name'),array('id', 'name')));
$query->from($db->quoteName('#__componentbuilder_component'));
$query->from($db->quoteName('#__componentbuilder_joomla_component'));
$query->where($db->quoteName('published') . ' = 1');
$query->order('modified DESC');
$query->order('created DESC');

View File

@ -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
@ -43,12 +43,17 @@ class ComponentbuilderModelComponentbuilder extends JModelList
$icons = array();
// view groups array
$viewGroups = array(
'main' => array('png.compiler', 'png.component.add', 'png.components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.help_document.add', 'png.help_documents')
'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.help_document.add', 'png.help_documents')
);
// view access array
$viewAccess = array(
'compiler.submenu' => 'compiler.submenu',
'compiler.dashboard_list' => 'compiler.dashboard_list',
'joomla_components.access' => 'joomla_component.access',
'joomla_component.access' => 'joomla_component.access',
'joomla_components.submenu' => 'joomla_component.submenu',
'joomla_components.dashboard_list' => 'joomla_component.dashboard_list',
'joomla_component.dashboard_add' => 'joomla_component.dashboard_add',
'admin_views.access' => 'admin_view.access',
'admin_view.access' => 'admin_view.access',
'admin_views.submenu' => 'admin_view.submenu',

View File

@ -190,8 +190,8 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
// Select some fields
$query->select('a.*');
// From the componentbuilder_component table
$query->from($db->quoteName('#__componentbuilder_component', 'a'));
// From the componentbuilder_joomla_component table
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
// Join over the asset groups.
$query->select('ag.title AS access_level');

View File

@ -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

View File

@ -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
@ -240,9 +240,9 @@ class ComponentbuilderModelCustom_codes extends JModelList
// From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_custom_code', 'a'));
// From the componentbuilder_component table.
// From the componentbuilder_joomla_component table.
$query->select($db->quoteName('g.system_name','component_system_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_component', 'g') . ' ON (' . $db->quoteName('a.component') . ' = ' . $db->quoteName('g.id') . ')');
$query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.component') . ' = ' . $db->quoteName('g.id') . ')');
// Filter by published state
$published = $this->getState('filter.published');

View File

@ -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 adminviewfolderlist.php

View File

@ -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 adminviews.php

View File

@ -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 articles.php

View File

@ -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 component.php
@ -78,7 +78,7 @@ class JFormFieldComponent extends JFormFieldList
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// only add if user allowed to create component
// only add if user allowed to create joomla_component
if ($user->authorise('core.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
@ -88,11 +88,11 @@ class JFormFieldComponent extends JFormFieldList
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_COMPONENTBUILDER_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_componentbuilder&amp;view=component&amp;layout=edit'.$ref.'" >
href="index.php?option=com_componentbuilder&amp;view=joomla_component&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit component
if (($buttonName === 'component' || $buttonName === 'components') && $user->authorise('core.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
// only add if user allowed to edit joomla_component
if (($buttonName === 'joomla_component' || $buttonName === 'joomla_components') && $user->authorise('core.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
$buttonNamee = trim($buttonName);
@ -119,7 +119,7 @@ class JFormFieldComponent extends JFormFieldList
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=components&task=component.edit&id='+value+'".$refJ."';
var url = 'index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
@ -129,7 +129,7 @@ class JFormFieldComponent extends JFormFieldList
}
}";
}
// check if button was created for component field.
// check if button was created for joomla_component field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
@ -152,7 +152,7 @@ class JFormFieldComponent extends JFormFieldList
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.system_name'),array('id','component_system_name')));
$query->from($db->quoteName('#__componentbuilder_component', 'a'));
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.system_name ASC');
$db->setQuery((string)$query);

View File

@ -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 customadminviews.php

View File

@ -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 customfilelist.php

View File

@ -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 customfolderlist.php

View File

@ -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 customgets.php

View File

@ -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 dbtables.php

View File

@ -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 dynamicgets.php

View File

@ -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 fields.php

View File

@ -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 fieldsmulti.php

View File

@ -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 fieldtypes.php

View File

@ -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 maingets.php

View File

@ -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 siteviewfolderlist.php

View File

@ -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 siteviews.php

View File

@ -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 snippets.php

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,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.js

View File

@ -9,11 +9,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.js
@subpackage joomla_component.js
@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

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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
@ -32,9 +32,9 @@ use Joomla\Registry\Registry;
jimport('joomla.application.component.modeladmin');
/**
* Componentbuilder Component Model
* Componentbuilder Joomla_component Model
*/
class ComponentbuilderModelComponent extends JModelAdmin
class ComponentbuilderModelJoomla_component extends JModelAdmin
{
/**
* @var string The prefix to use with controller messages.
@ -48,7 +48,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
* @var string
* @since 3.2
*/
public $typeAlias = 'com_componentbuilder.component';
public $typeAlias = 'com_componentbuilder.joomla_component';
/**
* Returns a Table object, always creating it
@ -61,7 +61,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
*
* @since 1.6
*/
public function getTable($type = 'component', $prefix = 'ComponentbuilderTable', $config = array())
public function getTable($type = 'joomla_component', $prefix = 'ComponentbuilderTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
@ -211,7 +211,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.component');
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_component');
}
}
$this->idvvvv = $item->addadmin_views;
@ -518,7 +518,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_componentbuilder.component', 'component', array('control' => 'jform', 'load_data' => $loadData));
$form = $this->loadForm('com_componentbuilder.joomla_component', 'joomla_component', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
@ -542,7 +542,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
// Check for existing item.
// Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('core.edit.state', 'com_componentbuilder.component.' . (int) $id))
if ($id != 0 && (!$user->authorise('core.edit.state', 'com_componentbuilder.joomla_component.' . (int) $id))
|| ($id == 0 && !$user->authorise('core.edit.state', 'com_componentbuilder')))
{
// Disable fields for display.
@ -576,6 +576,41 @@ class ComponentbuilderModelComponent extends JModelAdmin
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// Modify the form based on Edit Add License access controls.
if ($id != 0 && (!$user->authorise('joomla_component.edit.add_license', 'com_componentbuilder.joomla_component.' . (int) $id))
|| ($id == 0 && !$user->authorise('joomla_component.edit.add_license', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('add_license', 'disabled', 'true');
// Disable fields for display.
$form->setFieldAttribute('add_license', 'readonly', 'true');
// Disable radio button for display.
$class = $form->getFieldAttribute('add_license', 'class', '');
$form->setFieldAttribute('add_license', 'class', $class.' disabled no-click');
if (!$form->getValue('add_license'))
{
// Disable fields while saving.
$form->setFieldAttribute('add_license', 'filter', 'unset');
// Disable fields while saving.
$form->setFieldAttribute('add_license', 'required', 'false');
}
}
// Modify the form based on Edit License Type access controls.
if ($id != 0 && (!$user->authorise('joomla_component.edit.license_type', 'com_componentbuilder.joomla_component.' . (int) $id))
|| ($id == 0 && !$user->authorise('joomla_component.edit.license_type', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('license_type', 'disabled', 'true');
// Disable fields for display.
$form->setFieldAttribute('license_type', 'readonly', 'true');
if (!$form->getValue('license_type'))
{
// Disable fields while saving.
$form->setFieldAttribute('license_type', 'filter', 'unset');
// Disable fields while saving.
$form->setFieldAttribute('license_type', 'required', 'false');
}
}
// Only load these values if no id is found
if (0 == $id)
{
@ -600,7 +635,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/component.js';
return 'administrator/components/com_componentbuilder/models/forms/joomla_component.js';
}
/**
@ -623,7 +658,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
$user = JFactory::getUser();
// The record has been set. Check the record permissions.
return $user->authorise('core.delete', 'com_componentbuilder.component.' . (int) $record->id);
return $user->authorise('core.delete', 'com_componentbuilder.joomla_component.' . (int) $record->id);
}
return false;
}
@ -645,7 +680,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('core.edit.state', 'com_componentbuilder.component.' . (int) $recordId);
$permission = $user->authorise('core.edit.state', 'com_componentbuilder.joomla_component.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
@ -668,7 +703,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
{
// Check specific edit permission then general edit permission.
return JFactory::getUser()->authorise('core.edit', 'com_componentbuilder.component.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);
return JFactory::getUser()->authorise('core.edit', 'com_componentbuilder.joomla_component.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);
}
/**
@ -709,7 +744,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from($db->quoteName('#__componentbuilder_component'));
->from($db->quoteName('#__componentbuilder_joomla_component'));
$db->setQuery($query);
$max = $db->loadResult();
@ -739,7 +774,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
protected function loadFormData()
{
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component.data', array());
$data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.joomla_component.data', array());
if (empty($data))
{
@ -873,7 +908,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component');
$this->canDo = ComponentbuilderHelper::getActions('joomla_component');
$this->batchSet = true;
if (!$this->canDo->get('core.batch'))
@ -953,7 +988,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component');
$this->canDo = ComponentbuilderHelper::getActions('joomla_component');
}
if (!$this->canDo->get('core.create') || !$this->canDo->get('core.batch'))
@ -1102,7 +1137,7 @@ class ComponentbuilderModelComponent extends JModelAdmin
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component');
$this->canDo = ComponentbuilderHelper::getActions('joomla_component');
}
if (!$this->canDo->get('core.edit') && !$this->canDo->get('core.batch'))

View File

@ -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,9 +30,9 @@ defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.modellist');
/**
* Components Model
* Joomla_components Model
*/
class ComponentbuilderModelComponents extends JModelList
class ComponentbuilderModelJoomla_components extends JModelList
{
public function __construct($config = array())
{
@ -144,7 +144,7 @@ class ComponentbuilderModelComponents extends JModelList
$query->select('a.*');
// From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_component', 'a'));
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
// Filter by published state
$published = $this->getState('filter.published');
@ -229,8 +229,8 @@ class ComponentbuilderModelComponents extends JModelList
// Select some fields
$query->select('a.*');
// From the componentbuilder_component table
$query->from($db->quoteName('#__componentbuilder_component', 'a'));
// From the componentbuilder_joomla_component table
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
@ -332,7 +332,7 @@ class ComponentbuilderModelComponents extends JModelList
// Get a db connection.
$db = JFactory::getDbo();
// get the columns
$columns = $db->getTableColumns("#__componentbuilder_component");
$columns = $db->getTableColumns("#__componentbuilder_joomla_component");
if (ComponentbuilderHelper::checkArray($columns))
{
// remove the headers you don't import/export.
@ -393,7 +393,7 @@ class ComponentbuilderModelComponents extends JModelList
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__componentbuilder_component'));
$query->from($db->quoteName('#__componentbuilder_joomla_component'));
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
@ -416,7 +416,7 @@ class ComponentbuilderModelComponents extends JModelList
);
// Check table
$query->update($db->quoteName('#__componentbuilder_component'))->set($fields)->where($conditions);
$query->update($db->quoteName('#__componentbuilder_joomla_component'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -196,8 +196,8 @@ class ComponentbuilderModelSite_view extends JModelAdmin
// Select some fields
$query->select('a.*');
// From the componentbuilder_component table
$query->from($db->quoteName('#__componentbuilder_component', 'a'));
// From the componentbuilder_joomla_component table
$query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
// Join over the asset groups.
$query->select('ag.title AS access_level');