Cleaned-up some more javascript one the admin_view. Changed the admin_view layout. Improved the converion of data. Added a new tabsName field to the admin_fields view.

This commit is contained in:
2017-10-13 05:45:54 +02:00
parent fc41ba85d8
commit dfd98aeacf
290 changed files with 1378 additions and 900 deletions

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
@build 12th October, 2017
@version @update number 21 of this MVC
@build 13th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields.php
@ -101,6 +101,26 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$addfields = new Registry;
$addfields->loadString($item->addfields);
$item->addfields = $addfields->toArray();
}
// check what type of field array we have here (should be subform... but just incase)
// This could happen due to huge data sets
if (isset($item->addfields) && isset($item->addfields['field']))
{
$bucket = array();
foreach($item->addfields as $option => $values)
{
foreach($values as $nr => $value)
{
$bucket['addfields'.$nr][$option] = $value;
}
}
$item->addfields = $bucket;
// update the fields in the DB
$fieldsUpdate = new stdClass();
$fieldsUpdate->id = (int) $item->id;
$fieldsUpdate->addfields = json_encode($bucket);
$this->_db->updateObject('#__componentbuilder_admin_fields', $fieldsUpdate, 'id');
}
if (!empty($item->id))
@ -150,8 +170,8 @@ class ComponentbuilderModelAdmin_fields 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.admin_fields.' . (int) $id))
|| ($id == 0 && !$user->authorise('core.edit.state', 'com_componentbuilder')))
if ($id != 0 && (!$user->authorise('admin_fields.edit.state', 'com_componentbuilder.admin_fields.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields.edit.state', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
@ -167,7 +187,8 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$form->setValue('created_by', null, $user->id);
}
// Modify the form based on Edit Creaded By access controls.
if (!$user->authorise('core.edit.created_by', 'com_componentbuilder'))
if ($id != 0 && (!$user->authorise('admin_fields.edit.created_by', 'com_componentbuilder.admin_fields.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields.edit.created_by', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
@ -177,7 +198,8 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// Modify the form based on Edit Creaded Date access controls.
if (!$user->authorise('core.edit.created', 'com_componentbuilder'))
if ($id != 0 && (!$user->authorise('admin_fields.edit.created', 'com_componentbuilder.admin_fields.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields.edit.created', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
@ -231,7 +253,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$user = JFactory::getUser();
// The record has been set. Check the record permissions.
return $user->authorise('core.delete', 'com_componentbuilder.admin_fields.' . (int) $record->id);
return $user->authorise('admin_fields.delete', 'com_componentbuilder.admin_fields.' . (int) $record->id);
}
return false;
}
@ -253,14 +275,14 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('core.edit.state', 'com_componentbuilder.admin_fields.' . (int) $recordId);
$permission = $user->authorise('admin_fields.edit.state', 'com_componentbuilder.admin_fields.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// In the absense of better information, revert to the component permissions.
return parent::canEditState($record);
return $user->authorise('admin_fields.edit.state', 'com_componentbuilder');
}
/**
@ -275,8 +297,9 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
protected function allowEdit($data = array(), $key = 'id')
{
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return JFactory::getUser()->authorise('core.edit', 'com_componentbuilder.admin_fields.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);
return $user->authorise('admin_fields.edit', 'com_componentbuilder.admin_fields.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('admin_fields.edit', 'com_componentbuilder');
}
/**
@ -528,7 +551,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
}
if (!$this->canDo->get('core.create') || !$this->canDo->get('core.batch'))
if (!$this->canDo->get('admin_fields.create') && !$this->canDo->get('admin_fields.batch'))
{
return false;
}
@ -543,7 +566,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
{
$values['published'] = 0;
}
elseif (isset($values['published']) && !$this->canDo->get('core.edit.state'))
elseif (isset($values['published']) && !$this->canDo->get('admin_fields.edit.state'))
{
$values['published'] = 0;
}
@ -560,7 +583,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
if (!$this->user->authorise('admin_fields.edit', $contexts[$pk]))
{
@ -677,14 +700,14 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
}
if (!$this->canDo->get('core.edit') && !$this->canDo->get('core.batch'))
if (!$this->canDo->get('admin_fields.edit') && !$this->canDo->get('admin_fields.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('core.edit.state'))
if (isset($values['published']) && !$this->canDo->get('admin_fields.edit.state'))
{
unset($values['published']);
}
@ -694,7 +717,7 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('core.edit', $contexts[$pk]))
if (!$this->user->authorise('admin_fields.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 12th October, 2017
@version @update number 14 of this MVC
@build 13th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields_conditions.php
@ -101,6 +101,26 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$addconditions = new Registry;
$addconditions->loadString($item->addconditions);
$item->addconditions = $addconditions->toArray();
}
// check what type of conditions array we have here (should be subform... but just incase)
// This could happen due to huge data sets
if (isset($item->addconditions) && isset($item->addconditions['target_field']))
{
$bucket = array();
foreach($item->addconditions as $option => $values)
{
foreach($values as $nr => $value)
{
$bucket['addconditions'.$nr][$option] = $value;
}
}
$item->addconditions = $bucket;
// update the fields
$conditionsUpdate = new stdClass();
$conditionsUpdate->id = (int) $item->id;
$conditionsUpdate->addconditions = json_encode($bucket);
$this->_db->updateObject('#__componentbuilder_admin_fields_conditions', $conditionsUpdate, 'id');
}
if (!empty($item->id))
@ -150,8 +170,8 @@ class ComponentbuilderModelAdmin_fields_conditions 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.admin_fields_conditions.' . (int) $id))
|| ($id == 0 && !$user->authorise('core.edit.state', 'com_componentbuilder')))
if ($id != 0 && (!$user->authorise('admin_fields_conditions.edit.state', 'com_componentbuilder.admin_fields_conditions.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_conditions.edit.state', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
@ -167,7 +187,8 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$form->setValue('created_by', null, $user->id);
}
// Modify the form based on Edit Creaded By access controls.
if (!$user->authorise('core.edit.created_by', 'com_componentbuilder'))
if ($id != 0 && (!$user->authorise('admin_fields_conditions.edit.created_by', 'com_componentbuilder.admin_fields_conditions.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_conditions.edit.created_by', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
@ -177,7 +198,8 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// Modify the form based on Edit Creaded Date access controls.
if (!$user->authorise('core.edit.created', 'com_componentbuilder'))
if ($id != 0 && (!$user->authorise('admin_fields_conditions.edit.created', 'com_componentbuilder.admin_fields_conditions.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_fields_conditions.edit.created', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
@ -231,7 +253,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$user = JFactory::getUser();
// The record has been set. Check the record permissions.
return $user->authorise('core.delete', 'com_componentbuilder.admin_fields_conditions.' . (int) $record->id);
return $user->authorise('admin_fields_conditions.delete', 'com_componentbuilder.admin_fields_conditions.' . (int) $record->id);
}
return false;
}
@ -253,14 +275,14 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('core.edit.state', 'com_componentbuilder.admin_fields_conditions.' . (int) $recordId);
$permission = $user->authorise('admin_fields_conditions.edit.state', 'com_componentbuilder.admin_fields_conditions.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// In the absense of better information, revert to the component permissions.
return parent::canEditState($record);
return $user->authorise('admin_fields_conditions.edit.state', 'com_componentbuilder');
}
/**
@ -275,8 +297,9 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
protected function allowEdit($data = array(), $key = 'id')
{
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return JFactory::getUser()->authorise('core.edit', 'com_componentbuilder.admin_fields_conditions.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);
return $user->authorise('admin_fields_conditions.edit', 'com_componentbuilder.admin_fields_conditions.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('admin_fields_conditions.edit', 'com_componentbuilder');
}
/**
@ -528,7 +551,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
}
if (!$this->canDo->get('core.create') || !$this->canDo->get('core.batch'))
if (!$this->canDo->get('admin_fields_conditions.create') && !$this->canDo->get('admin_fields_conditions.batch'))
{
return false;
}
@ -543,7 +566,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
{
$values['published'] = 0;
}
elseif (isset($values['published']) && !$this->canDo->get('core.edit.state'))
elseif (isset($values['published']) && !$this->canDo->get('admin_fields_conditions.edit.state'))
{
$values['published'] = 0;
}
@ -560,7 +583,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk]))
{
@ -677,14 +700,14 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
}
if (!$this->canDo->get('core.edit') && !$this->canDo->get('core.batch'))
if (!$this->canDo->get('admin_fields_conditions.edit') && !$this->canDo->get('admin_fields_conditions.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('core.edit.state'))
if (isset($values['published']) && !$this->canDo->get('admin_fields_conditions.edit.state'))
{
unset($values['published']);
}
@ -694,7 +717,7 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('core.edit', $contexts[$pk]))
if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 136 of this MVC
@build 12th October, 2017
@version @update number 141 of this MVC
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php
@ -148,10 +148,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->ajax_input = $ajax_input->toArray();
}
if (!empty($item->php_after_delete))
if (!empty($item->php_getitems))
{
// base64 Decode php_after_delete.
$item->php_after_delete = base64_decode($item->php_after_delete);
// base64 Decode php_getitems.
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_save))
@ -160,6 +166,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_save = base64_decode($item->php_save);
}
if (!empty($item->php_after_delete))
{
// base64 Decode php_after_delete.
$item->php_after_delete = base64_decode($item->php_after_delete);
}
if (!empty($item->php_getlistquery))
{
// base64 Decode php_getlistquery.
@ -178,12 +190,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_after_publish = base64_decode($item->php_after_publish);
}
if (!empty($item->php_getitems))
{
// base64 Decode php_getitems.
$item->php_getitems = base64_decode($item->php_getitems);
}
if (!empty($item->php_import))
{
// base64 Decode php_import.
@ -208,12 +214,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_postsavehook = base64_decode($item->php_postsavehook);
}
if (!empty($item->php_batchmove))
{
// base64 Decode php_batchmove.
$item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_batchcopy))
{
// base64 Decode php_batchcopy.
@ -383,7 +383,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVxzlinked_components()
public function getVxzcustom_import()
{
// Get the user object.
$user = JFactory::getUser();
@ -490,8 +490,8 @@ class ComponentbuilderModelAdmin_view 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.admin_view.' . (int) $id))
|| ($id == 0 && !$user->authorise('core.edit.state', 'com_componentbuilder')))
if ($id != 0 && (!$user->authorise('admin_view.edit.state', 'com_componentbuilder.admin_view.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_view.edit.state', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
@ -507,7 +507,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$form->setValue('created_by', null, $user->id);
}
// Modify the form based on Edit Creaded By access controls.
if (!$user->authorise('core.edit.created_by', 'com_componentbuilder'))
if ($id != 0 && (!$user->authorise('admin_view.edit.created_by', 'com_componentbuilder.admin_view.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_view.edit.created_by', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
@ -517,7 +518,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// Modify the form based on Edit Creaded Date access controls.
if (!$user->authorise('core.edit.created', 'com_componentbuilder'))
if ($id != 0 && (!$user->authorise('admin_view.edit.created', 'com_componentbuilder.admin_view.' . (int) $id))
|| ($id == 0 && !$user->authorise('admin_view.edit.created', 'com_componentbuilder')))
{
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
@ -571,7 +573,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$user = JFactory::getUser();
// The record has been set. Check the record permissions.
return $user->authorise('core.delete', 'com_componentbuilder.admin_view.' . (int) $record->id);
return $user->authorise('admin_view.delete', 'com_componentbuilder.admin_view.' . (int) $record->id);
}
return false;
}
@ -593,14 +595,14 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('core.edit.state', 'com_componentbuilder.admin_view.' . (int) $recordId);
$permission = $user->authorise('admin_view.edit.state', 'com_componentbuilder.admin_view.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// In the absense of better information, revert to the component permissions.
return parent::canEditState($record);
return $user->authorise('admin_view.edit.state', 'com_componentbuilder');
}
/**
@ -615,8 +617,9 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
protected function allowEdit($data = array(), $key = 'id')
{
// Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return JFactory::getUser()->authorise('core.edit', 'com_componentbuilder.admin_view.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);
return $user->authorise('admin_view.edit', 'com_componentbuilder.admin_view.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('admin_view.edit', 'com_componentbuilder');
}
/**
@ -904,7 +907,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->canDo = ComponentbuilderHelper::getActions('admin_view');
}
if (!$this->canDo->get('core.create') || !$this->canDo->get('core.batch'))
if (!$this->canDo->get('admin_view.create') && !$this->canDo->get('admin_view.batch'))
{
return false;
}
@ -919,7 +922,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{
$values['published'] = 0;
}
elseif (isset($values['published']) && !$this->canDo->get('core.edit.state'))
elseif (isset($values['published']) && !$this->canDo->get('admin_view.edit.state'))
{
$values['published'] = 0;
}
@ -936,7 +939,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
if (!$this->user->authorise('admin_view.edit', $contexts[$pk]))
{
@ -1051,14 +1054,14 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->canDo = ComponentbuilderHelper::getActions('admin_view');
}
if (!$this->canDo->get('core.edit') && !$this->canDo->get('core.batch'))
if (!$this->canDo->get('admin_view.edit') && !$this->canDo->get('admin_view.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('core.edit.state'))
if (isset($values['published']) && !$this->canDo->get('admin_view.edit.state'))
{
unset($values['published']);
}
@ -1068,7 +1071,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('core.edit', $contexts[$pk]))
if (!$this->user->authorise('admin_view.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
@ -1241,10 +1244,16 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['ajax_input'] = '';
}
// Set the php_after_delete string to base64 string.
if (isset($data['php_after_delete']))
// Set the php_getitems string to base64 string.
if (isset($data['php_getitems']))
{
$data['php_after_delete'] = base64_encode($data['php_after_delete']);
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the php_batchmove string to base64 string.
if (isset($data['php_batchmove']))
{
$data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// Set the php_save string to base64 string.
@ -1253,6 +1262,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_save'] = base64_encode($data['php_save']);
}
// Set the php_after_delete string to base64 string.
if (isset($data['php_after_delete']))
{
$data['php_after_delete'] = base64_encode($data['php_after_delete']);
}
// Set the php_getlistquery string to base64 string.
if (isset($data['php_getlistquery']))
{
@ -1271,12 +1286,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_after_publish'] = base64_encode($data['php_after_publish']);
}
// Set the php_getitems string to base64 string.
if (isset($data['php_getitems']))
{
$data['php_getitems'] = base64_encode($data['php_getitems']);
}
// Set the php_import string to base64 string.
if (isset($data['php_import']))
{
@ -1301,12 +1310,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_postsavehook'] = base64_encode($data['php_postsavehook']);
}
// Set the php_batchmove string to base64 string.
if (isset($data['php_batchmove']))
{
$data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// Set the php_batchcopy string to base64 string.
if (isset($data['php_batchcopy']))
{

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 136 of this MVC
@build 12th October, 2017
@version @update number 141 of this MVC
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php
@ -113,7 +113,24 @@ class ComponentbuilderModelAdmin_views extends JModelList
$this->checkInNow();
// load parent items
$items = parent::getItems();
$items = parent::getItems();
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
}
}
// return items
return $items;
@ -213,20 +230,31 @@ class ComponentbuilderModelAdmin_views extends JModelList
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
// decode php_after_delete
$item->php_after_delete = base64_decode($item->php_after_delete);
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
// decode php_getitems
$item->php_getitems = base64_decode($item->php_getitems);
// decode php_batchmove
$item->php_batchmove = base64_decode($item->php_batchmove);
// decode php_save
$item->php_save = base64_decode($item->php_save);
// decode php_after_delete
$item->php_after_delete = base64_decode($item->php_after_delete);
// decode php_getlistquery
$item->php_getlistquery = base64_decode($item->php_getlistquery);
// decode php_allowedit
$item->php_allowedit = base64_decode($item->php_allowedit);
// decode php_after_publish
$item->php_after_publish = base64_decode($item->php_after_publish);
// decode php_getitems
$item->php_getitems = base64_decode($item->php_getitems);
// decode php_import
$item->php_import = base64_decode($item->php_import);
// decode php_getitems_after_all
@ -235,8 +263,6 @@ class ComponentbuilderModelAdmin_views extends JModelList
$item->php_before_save = base64_decode($item->php_before_save);
// decode php_postsavehook
$item->php_postsavehook = base64_decode($item->php_postsavehook);
// decode php_batchmove
$item->php_batchmove = base64_decode($item->php_batchmove);
// decode php_batchcopy
$item->php_batchcopy = base64_decode($item->php_batchcopy);
// decode php_before_publish

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
@build 12th October, 2017
@version @update number 21 of this MVC
@build 13th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admins_fields.php
@ -99,7 +99,24 @@ class ComponentbuilderModelAdmins_fields extends JModelList
$this->checkInNow();
// load parent items
$items = parent::getItems();
$items = parent::getItems();
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && $user->authorise('admin_fields.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
}
}
// return items
return $items;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 12th October, 2017
@version @update number 14 of this MVC
@build 13th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admins_fields_conditions.php
@ -99,7 +99,24 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList
$this->checkInNow();
// load parent items
$items = parent::getItems();
$items = parent::getItems();
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
}
}
// return items
return $items;

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ajax.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php
@ -54,6 +54,9 @@ class ComponentbuilderModelComponentbuilder extends JModelList
'joomla_components.submenu' => 'joomla_component.submenu',
'joomla_components.dashboard_list' => 'joomla_component.dashboard_list',
'joomla_component.dashboard_add' => 'joomla_component.dashboard_add',
'admin_view.create' => 'admin_view.create',
'admin_views.access' => 'admin_view.access',
'admin_view.access' => 'admin_view.access',
'admin_views.submenu' => 'admin_view.submenu',
'admin_views.dashboard_list' => 'admin_view.dashboard_list',
'admin_view.dashboard_add' => 'admin_view.dashboard_add',
@ -124,7 +127,13 @@ class ComponentbuilderModelComponentbuilder extends JModelList
'help_document.access' => 'help_document.access',
'help_documents.submenu' => 'help_document.submenu',
'help_documents.dashboard_list' => 'help_document.dashboard_list',
'help_document.dashboard_add' => 'help_document.dashboard_add');
'help_document.dashboard_add' => 'help_document.dashboard_add',
'admin_fields.create' => 'admin_fields.create',
'admins_fields.access' => 'admin_fields.access',
'admin_fields.access' => 'admin_fields.access',
'admin_fields_conditions.create' => 'admin_fields_conditions.create',
'admins_fields_conditions.access' => 'admin_fields_conditions.access',
'admin_fields_conditions.access' => 'admin_fields_conditions.access');
foreach($viewGroups as $group => $views)
{
$i = 0;

View File

@ -166,6 +166,23 @@ class ComponentbuilderModelField extends JModelAdmin
{
$items = $db->loadObjectList();
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
}
}
// Filter by addfieldsvvwc in this Repetable Field
if (ComponentbuilderHelper::checkArray($items) && isset($this->addfieldsvvwc))
{

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminviews.php
@ -79,7 +79,7 @@ class JFormFieldAdminviews extends JFormFieldList
}
$user = JFactory::getUser();
// only add if user allowed to create admin_view
if ($user->authorise('core.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
if ($user->authorise('admin_view.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
$buttonNamee = trim($buttonName);
@ -92,7 +92,7 @@ class JFormFieldAdminviews extends JFormFieldList
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit admin_view
if (($buttonName === 'admin_view' || $buttonName === 'admin_views') && $user->authorise('core.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
if (($buttonName === 'admin_view' || $buttonName === 'admin_views') && $user->authorise('admin_view.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
$buttonNamee = trim($buttonName);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage articles.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage component.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage components.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customadminviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customfilelist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customgets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dbtables.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamicget.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamicgets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldsmulti.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ftps.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage lang.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage maingets.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage siteviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage siteviews.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage snippets.php

View File

@ -0,0 +1,183 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage viewtabs.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
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Viewtabs Form Field class for the Componentbuilder component
*/
class JFormFieldViewtabs extends JFormFieldList
{
/**
* The viewtabs field type.
*
* @var string
*/
public $type = 'viewtabs';
/**
* Override to add new button
*
* @return string The field input markup.
*
* @since 3.2
*/
protected function getInput()
{
// see if we should add buttons
$setButton = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// only add if user allowed to create admin_view
if ($user->authorise('admin_view.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$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=admin_view&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit admin_view
if (($buttonName === 'admin_view' || $buttonName === 'admin_views') && $user->authorise('admin_view.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_COMPONENTBUILDER_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for admin_view field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
return $html;
}
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
public function getOptions()
{
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the view name & id
$fieldsID = $jinput->getInt('id', 0);
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.addtabs'),array('id','addtabs')));
$query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_admin_fields', 'b') . ' ON (' . $db->quoteName('a.id') . ' = ' . $db->quoteName('b.admin_view') . ')');
$query->where($db->quoteName('a.published') . ' >= 1');
$query->where($db->quoteName('b.id') . ' = ' . (int) $fieldsID);
$query->order('a.addtabs ASC');
$db->setQuery((string)$query);
$item = $db->loadObject();
$options = array();
if (isset($item->addtabs) && strlen($item->addtabs) > 5)
{
$items = json_decode($item->addtabs, true);
$nr = 1;
foreach($items as $itemName)
{
$options[] = JHtml::_('select.option', $nr, $itemName['name']);
$nr++;
}
}
else
{
$options[] = JHtml::_('select.option', 1, JText::_('COM_COMPONENTBUILDER_DETAILS'));
}
return $options;
}
}

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
@build 12th October, 2017
@version @update number 21 of this MVC
@build 13th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields.js

View File

@ -112,7 +112,7 @@
name="field"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELD_DESCRIPTION"
class="fieldMedium"
class="list_class"
multiple="false"
required="false"
button="false"
@ -200,18 +200,17 @@
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_LINK_DESCRIPTION"
class="inputbox"
/>
<!-- Tab Field. Type: Integer. (joomla) -->
<!-- Tab Field. Type: Viewtabs. (custom) -->
<field
type="integer"
type="viewtabs"
name="tab"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_TAB_LABEL"
default="1"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_TAB_DESCRIPTION"
class="fieldSmall"
class="fieldMedium"
multiple="false"
default="1"
required="false"
first="1"
last="15"
step="1"
button="false"
/>
<!-- Alignment Field. Type: List. (joomla) -->
<field
@ -259,7 +258,7 @@
name="permission"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_DESCRIPTION"
class="list_class"
class="fieldMedium"
multiple="false"
required="false"
default="0">

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 12th October, 2017
@version @update number 14 of this MVC
@build 13th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields_conditions.js

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 136 of this MVC
@build 12th October, 2017
@version @update number 141 of this MVC
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.js
@ -1210,36 +1210,6 @@ function addButtonID(type,where){
})
}
function getFieldSelectOptions_server(fieldId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json";
if(token.length > 0 && fieldId > 0){
var request = 'token='+token+'&id='+fieldId;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
}
function getFieldSelectOptions(fieldKey, table_, nr_){
// first check if the field is set
if(jQuery("#jform_addconditions"+table_+"_addconditions"+fieldKey+nr_+"_match_field").length) {
var fieldId = jQuery("#jform_addconditions"+table_+"_addconditions"+fieldKey+nr_+"_match_field option:selected").val();
getFieldSelectOptions_server(fieldId).done(function(result) {
if(result){
jQuery('textarea#jform_addconditions'+table_+'_addconditions'+fieldKey+nr_+'_match_options').val(result);
}
else
{
jQuery('textarea#jform_addconditions'+table_+'_addconditions'+fieldKey+nr_+'_match_options').val('');
}
});
}
}
function getTableColumns_server(tableName){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json";
if(token.length > 0 && tableName.length > 0){

View File

@ -140,6 +140,69 @@
message="Error! Please add some short description here."
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_SHORT_DESCRIPTION_HINT"
/>
<!-- Php_getitems Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_getitems"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_HINT"
required="true"
/>
<!-- Php_batchmove Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_batchmove"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHMOVE_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHMOVE_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHMOVE_HINT"
required="true"
/>
<!-- Icon_add Field. Type: Media. (joomla) -->
<field
type="media"
name="icon_add"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD_DESCRIPTION"
directory=""
/>
<!-- Php_save Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_SAVE_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_SAVE_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_SAVE_HINT"
required="true"
/>
<!-- Icon_category Field. Type: Media. (joomla) -->
<field
type="media"
name="icon_category"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_CATEGORY_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_CATEGORY_DESCRIPTION"
directory=""
/>
<!-- Icon Field. Type: Media. (joomla) -->
<field
type="media"
name="icon"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_DESCRIPTION"
directory=""
/>
<!-- Php_after_delete Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -153,6 +216,34 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AFTER_DELETE_HINT"
required="true"
/>
<!-- Php_getlistquery Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_getlistquery"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_HINT"
required="true"
/>
<!-- Note_advanced_import Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_advanced_import" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ADVANCED_IMPORT_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ADVANCED_IMPORT_DESCRIPTION" heading="h4" class="alert alert-success note_advanced_import" />
<!-- Php_allowedit Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_allowedit"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_HINT"
required="true"
/>
<!-- Type Field. Type: List. (joomla) -->
<field
type="list"
@ -168,17 +259,17 @@
<option value="2">
COM_COMPONENTBUILDER_ADMIN_VIEW_READONLY</option>
</field>
<!-- Php_save Field. Type: Textarea. (joomla) -->
<!-- Php_after_publish Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_SAVE_LABEL"
name="php_after_publish"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AFTER_PUBLISH_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_SAVE_DESCRIPTION"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AFTER_PUBLISH_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_SAVE_HINT"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AFTER_PUBLISH_HINT"
required="true"
/>
<!-- Description Field. Type: Textarea. (joomla) -->
@ -193,6 +284,19 @@
filter="HTML"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_DESCRIPTION_HINT"
/>
<!-- Source Field. Type: Radio. (joomla) -->
<field
type="radio"
name="source"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_SOURCE_LABEL"
class="btn-group btn-group-yesno"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_TABLE</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_VIEW_DUMP</option>
</field>
<!-- Add_fadein Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -207,99 +311,6 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_REMOVE</option>
</field>
<!-- Note_advanced_import Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_advanced_import" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ADVANCED_IMPORT_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ADVANCED_IMPORT_DESCRIPTION" heading="h4" class="alert alert-success note_advanced_import" />
<!-- Icon Field. Type: Media. (joomla) -->
<field
type="media"
name="icon"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_DESCRIPTION"
directory=""
/>
<!-- Php_getlistquery Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_getlistquery"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_HINT"
required="true"
/>
<!-- Icon_add Field. Type: Media. (joomla) -->
<field
type="media"
name="icon_add"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD_DESCRIPTION"
directory=""
/>
<!-- Php_allowedit Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_allowedit"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_HINT"
required="true"
/>
<!-- Icon_category Field. Type: Media. (joomla) -->
<field
type="media"
name="icon_category"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_CATEGORY_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_CATEGORY_DESCRIPTION"
directory=""
/>
<!-- Php_after_publish Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_after_publish"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AFTER_PUBLISH_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AFTER_PUBLISH_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AFTER_PUBLISH_HINT"
required="true"
/>
<!-- Note_on_permissions Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_permissions" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_PERMISSIONS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_PERMISSIONS_DESCRIPTION" heading="h4" class="alert alert-info note_on_permissions" close="true" />
<!-- Source Field. Type: Radio. (joomla) -->
<field
type="radio"
name="source"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_SOURCE_LABEL"
class="btn-group btn-group-yesno"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_TABLE</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_VIEW_DUMP</option>
</field>
<!-- Php_getitems Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_getitems"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_HINT"
required="true"
/>
<!-- Php_import Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -313,6 +324,27 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_HINT"
required="true"
/>
<!-- Not_required Field. Type: Hidden. (joomla) -->
<field
type="hidden"
name="not_required"
default="[]"
/>
<!-- Note_on_permissions Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_permissions" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_PERMISSIONS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_PERMISSIONS_DESCRIPTION" heading="h4" class="alert alert-info note_on_permissions" close="true" />
<!-- Php_getitems_after_all Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_getitems_after_all"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_AFTER_ALL_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_AFTER_ALL_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_AFTER_ALL_HINT"
required="true"
/>
<!-- Addpermissions Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -387,19 +419,32 @@
</field>
</form>
</field>
<!-- Note_on_tabs Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_tabs" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_TABS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_TABS_DESCRIPTION" heading="h4" class="alert alert-info note_on_tabs" close="true" />
<!-- Php_getitems_after_all Field. Type: Textarea. (joomla) -->
<!-- Php_before_save Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_getitems_after_all"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_AFTER_ALL_LABEL"
name="php_before_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_SAVE_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_AFTER_ALL_DESCRIPTION"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_SAVE_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEMS_AFTER_ALL_HINT"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_SAVE_HINT"
required="true"
/>
<!-- Note_on_tabs Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_tabs" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_TABS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_TABS_DESCRIPTION" heading="h4" class="alert alert-info note_on_tabs" close="true" />
<!-- Php_postsavehook Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_postsavehook"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_HINT"
required="true"
/>
<!-- Addtabs Field. Type: Subform. (joomla) -->
@ -431,17 +476,17 @@
/>
</form>
</field>
<!-- Php_before_save Field. Type: Textarea. (joomla) -->
<!-- Php_batchcopy Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_before_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_SAVE_LABEL"
name="php_batchcopy"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHCOPY_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_SAVE_DESCRIPTION"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHCOPY_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_SAVE_HINT"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHCOPY_HINT"
required="true"
/>
<!-- Addlinked_views Field. Type: Subform. (joomla) -->
@ -523,51 +568,6 @@
/>
</form>
</field>
<!-- Php_postsavehook Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_postsavehook"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_HINT"
required="true"
/>
<!-- Php_batchmove Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_batchmove"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHMOVE_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHMOVE_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHMOVE_HINT"
required="true"
/>
<!-- Php_batchcopy Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_batchcopy"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHCOPY_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHCOPY_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BATCHCOPY_HINT"
required="true"
/>
<!-- Not_required Field. Type: Hidden. (joomla) -->
<field
type="hidden"
name="not_required"
default="[]"
/>
<!-- Php_before_publish Field. Type: Textarea. (joomla) -->
<field
type="textarea"

View File

@ -2475,7 +2475,7 @@
name="field"
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_FIELD_LABEL"
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_FIELD_DESCRIPTION"
class="fieldMedium"
class="list_class"
multiple="false"
required="false"
button="false"

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.8
@build 12th October, 2017
@build 13th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage import_joomla_components.php

View File

@ -252,6 +252,23 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
{
$items = $db->loadObjectList();
// set values to display correctly.
if (ComponentbuilderHelper::checkArray($items))
{
// get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
if (!$access)
{
unset($items[$nr]);
continue;
}
}
}
// Filter by id Repetable Field
$idvvvv = json_decode($this->idvvvv,true);
if (ComponentbuilderHelper::checkArray($items) && isset($idvvvv) && ComponentbuilderHelper::checkArray($idvvvv))