Decoupled fields and conditions from admin view as explained in gh-136. Added new admin_fields and admin_fields_conditions tables and moved the data from admin_view to these new tables.

This commit is contained in:
2017-10-13 01:14:17 +02:00
parent 39e1e5f078
commit 35482416cb
367 changed files with 8762 additions and 2210 deletions

View File

@ -0,0 +1,879 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
@build 12th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields.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');
use Joomla\Registry\Registry;
// import Joomla modelform library
jimport('joomla.application.component.modeladmin');
/**
* Componentbuilder Admin_fields Model
*/
class ComponentbuilderModelAdmin_fields extends JModelAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_COMPONENTBUILDER';
/**
* The type alias for this content type.
*
* @var string
* @since 3.2
*/
public $typeAlias = 'com_componentbuilder.admin_fields';
/**
* Returns a Table object, always creating it
*
* @param type $type The table type to instantiate
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return JTable A database object
*
* @since 1.6
*/
public function getTable($type = 'admin_fields', $prefix = 'ComponentbuilderTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
/**
* Method to get a single record.
*
* @param integer $pk The id of the primary key.
*
* @return mixed Object on success, false on failure.
*
* @since 1.6
*/
public function getItem($pk = null)
{
if ($item = parent::getItem($pk))
{
if (!empty($item->params))
{
// Convert the params field to an array.
$registry = new Registry;
$registry->loadString($item->params);
$item->params = $registry->toArray();
}
if (!empty($item->metadata))
{
// Convert the metadata field to an array.
$registry = new Registry;
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (!empty($item->addfields))
{
// Convert the addfields field to an array.
$addfields = new Registry;
$addfields->loadString($item->addfields);
$item->addfields = $addfields->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields');
}
}
return $item;
}
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return mixed A JForm object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_componentbuilder.admin_fields', 'admin_fields', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
}
$jinput = JFactory::getApplication()->input;
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
}
$user = JFactory::getUser();
// 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')))
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// Set the created_by to this user
$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'))
{
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// Modify the form based on Edit Creaded Date access controls.
if (!$user->authorise('core.edit.created', 'com_componentbuilder'))
{
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// Only load these values if no id is found
if (0 == $id)
{
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
/**
* Method to get the script that have to be included on the form
*
* @return string script files
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_fields.js';
}
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canDelete($record)
{
if (!empty($record->id))
{
if ($record->published != -2)
{
return;
}
$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 false;
}
/**
* Method to test whether a record can have its state edited.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('core.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);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
* @since 2.5
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check specific edit permission then general edit permission.
return JFactory::getUser()->authorise('core.edit', 'com_componentbuilder.admin_fields.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);
}
/**
* Prepare and sanitise the table data prior to saving.
*
* @param JTable $table A JTable object.
*
* @return void
*
* @since 1.6
*/
protected function prepareTable($table)
{
$date = JFactory::getDate();
$user = JFactory::getUser();
if (isset($table->name))
{
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
}
if (isset($table->alias) && empty($table->alias))
{
$table->generateAlias();
}
if (empty($table->id))
{
$table->created = $date->toSql();
// set the user
if ($table->created_by == 0 || empty($table->created_by))
{
$table->created_by = $user->id;
}
// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from($db->quoteName('#__componentbuilder_admin_fields'));
$db->setQuery($query);
$max = $db->loadResult();
$table->ordering = $max + 1;
}
}
else
{
$table->modified = $date->toSql();
$table->modified_by = $user->id;
}
if (!empty($table->id))
{
// Increment the items version number.
$table->version++;
}
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
{
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.admin_fields.data', array());
if (empty($data))
{
$data = $this->getItem();
}
return $data;
}
/**
* Method to get the unique fields of this table.
*
* @return mixed An array of field names, boolean false if none is set.
*
* @since 3.0
*/
protected function getUniqeFields()
{
return false;
}
/**
* Method to delete one or more records.
*
* @param array &$pks An array of record primary keys.
*
* @return boolean True if successful, false if an error occurs.
*
* @since 12.2
*/
public function delete(&$pks)
{
if (!parent::delete($pks))
{
return false;
}
return true;
}
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param integer $value The value of the published state.
*
* @return boolean True on success.
*
* @since 12.2
*/
public function publish(&$pks, $value = 1)
{
if (!parent::publish($pks, $value))
{
return false;
}
return true;
}
/**
* Method to perform batch operations on an item or a set of items.
*
* @param array $commands An array of commands to perform.
* @param array $pks An array of item ids.
* @param array $contexts An array of item contexts.
*
* @return boolean Returns true on success, false on failure.
*
* @since 12.2
*/
public function batch($commands, $pks, $contexts)
{
// Sanitize ids.
$pks = array_unique($pks);
JArrayHelper::toInteger($pks);
// Remove any values of zero.
if (array_search(0, $pks, true))
{
unset($pks[array_search(0, $pks, true)]);
}
if (empty($pks))
{
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
return false;
}
$done = false;
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
$this->batchSet = true;
if (!$this->canDo->get('core.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
if ($this->type == false)
{
$type = new JUcmType;
$this->type = $type->getTypeByAlias($this->typeAlias);
}
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
if (!empty($commands['move_copy']))
{
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
if ($cmd == 'c')
{
$result = $this->batchCopy($commands, $pks, $contexts);
if (is_array($result))
{
foreach ($result as $old => $new)
{
$contexts[$new] = $contexts[$old];
}
$pks = array_values($result);
}
else
{
return false;
}
}
elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
{
return false;
}
$done = true;
}
if (!$done)
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
// Clear the cache
$this->cleanCache();
return true;
}
/**
* Batch copy items to a new category or current.
*
* @param integer $values The new values.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
}
if (!$this->canDo->get('core.create') || !$this->canDo->get('core.batch'))
{
return false;
}
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// remove move_copy from array
unset($values['move_copy']);
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
}
elseif (isset($values['published']) && !$this->canDo->get('core.edit.state'))
{
$values['published'] = 0;
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
if (strlen($value) > 0 && isset($this->table->$key))
{
$this->table->$key = $value;
}
}
}
// update all uniqe fields
if (ComponentbuilderHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
{
$this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
}
}
// Reset the ID because we are making a copy
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
// Get the new item ID
$newId = $this->table->get('id');
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// Clean the cache
$this->cleanCache();
return $newIds;
}
/**
* Batch move items to a new category
*
* @param integer $value The new category ID.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields');
}
if (!$this->canDo->get('core.edit') && !$this->canDo->get('core.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'))
{
unset($values['published']);
}
// remove move_copy from array
unset($values['move_copy']);
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// insert all set values.
if (ComponentbuilderHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// Do special action for access.
if ('access' === $key && strlen($value) > 0)
{
$this->table->$key = $value;
}
elseif (strlen($value) > 0 && isset($this->table->$key))
{
$this->table->$key = $value;
}
}
}
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
}
// Clean the cache
$this->cleanCache();
return true;
}
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success.
*
* @since 1.6
*/
public function save($data)
{
$input = JFactory::getApplication()->input;
$filter = JFilterInput::getInstance();
// set the metadata to the Item Data
if (isset($data['metadata']) && isset($data['metadata']['author']))
{
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
$metadata = new JRegistry;
$metadata->loadArray($data['metadata']);
$data['metadata'] = (string) $metadata;
}
// Set the addfields items to data.
if (isset($data['addfields']) && is_array($data['addfields']))
{
$addfields = new JRegistry;
$addfields->loadArray($data['addfields']);
$data['addfields'] = (string) $addfields;
}
elseif (!isset($data['addfields']))
{
// Set the empty addfields to data
$data['addfields'] = '';
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params']))
{
$params = new JRegistry;
$params->loadArray($data['params']);
$data['params'] = (string) $params;
}
// Alter the uniqe field for save as copy
if ($input->get('task') === 'save2copy')
{
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (ComponentbuilderHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
{
$data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
}
}
}
if (parent::save($data))
{
return true;
}
return false;
}
/**
* Method to generate a uniqe value.
*
* @param string $field name.
* @param string $value data.
*
* @return string New value.
*
* @since 3.0
*/
protected function generateUniqe($field,$value)
{
// set field value uniqe
$table = $this->getTable();
while ($table->load(array($field => $value)))
{
$value = JString::increment($value);
}
return $value;
}
/**
* Method to change the title & alias.
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{
// Alter the title
$table = $this->getTable();
while ($table->load(array('title' => $title)))
{
$title = JString::increment($title);
}
return $title;
}
}

View File

@ -0,0 +1,879 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 12th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields_conditions.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');
use Joomla\Registry\Registry;
// import Joomla modelform library
jimport('joomla.application.component.modeladmin');
/**
* Componentbuilder Admin_fields_conditions Model
*/
class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
{
/**
* @var string The prefix to use with controller messages.
* @since 1.6
*/
protected $text_prefix = 'COM_COMPONENTBUILDER';
/**
* The type alias for this content type.
*
* @var string
* @since 3.2
*/
public $typeAlias = 'com_componentbuilder.admin_fields_conditions';
/**
* Returns a Table object, always creating it
*
* @param type $type The table type to instantiate
* @param string $prefix A prefix for the table class name. Optional.
* @param array $config Configuration array for model. Optional.
*
* @return JTable A database object
*
* @since 1.6
*/
public function getTable($type = 'admin_fields_conditions', $prefix = 'ComponentbuilderTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
/**
* Method to get a single record.
*
* @param integer $pk The id of the primary key.
*
* @return mixed Object on success, false on failure.
*
* @since 1.6
*/
public function getItem($pk = null)
{
if ($item = parent::getItem($pk))
{
if (!empty($item->params))
{
// Convert the params field to an array.
$registry = new Registry;
$registry->loadString($item->params);
$item->params = $registry->toArray();
}
if (!empty($item->metadata))
{
// Convert the metadata field to an array.
$registry = new Registry;
$registry->loadString($item->metadata);
$item->metadata = $registry->toArray();
}
if (!empty($item->addconditions))
{
// Convert the addconditions field to an array.
$addconditions = new Registry;
$addconditions->loadString($item->addconditions);
$item->addconditions = $addconditions->toArray();
}
if (!empty($item->id))
{
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_fields_conditions');
}
}
return $item;
}
/**
* Method to get the record form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return mixed A JForm object on success, false on failure
*
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_componentbuilder.admin_fields_conditions', 'admin_fields_conditions', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
{
return false;
}
$jinput = JFactory::getApplication()->input;
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
}
$user = JFactory::getUser();
// 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')))
{
// Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// If this is a new item insure the greated by is set.
if (0 == $id)
{
// Set the created_by to this user
$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'))
{
// Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// Modify the form based on Edit Creaded Date access controls.
if (!$user->authorise('core.edit.created', 'com_componentbuilder'))
{
// Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// Only load these values if no id is found
if (0 == $id)
{
// Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
return $form;
}
/**
* Method to get the script that have to be included on the form
*
* @return string script files
*/
public function getScript()
{
return 'administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.js';
}
/**
* Method to test whether a record can be deleted.
*
* @param object $record A record object.
*
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canDelete($record)
{
if (!empty($record->id))
{
if ($record->published != -2)
{
return;
}
$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 false;
}
/**
* Method to test whether a record can have its state edited.
*
* @param object $record A record object.
*
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
*
* @since 1.6
*/
protected function canEditState($record)
{
$user = JFactory::getUser();
$recordId = (!empty($record->id)) ? $record->id : 0;
if ($recordId)
{
// The record has been set. Check the record permissions.
$permission = $user->authorise('core.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);
}
/**
* Method override to check if you can edit an existing record.
*
* @param array $data An array of input data.
* @param string $key The name of the key for the primary key.
*
* @return boolean
* @since 2.5
*/
protected function allowEdit($data = array(), $key = 'id')
{
// Check specific edit permission then general edit permission.
return JFactory::getUser()->authorise('core.edit', 'com_componentbuilder.admin_fields_conditions.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);
}
/**
* Prepare and sanitise the table data prior to saving.
*
* @param JTable $table A JTable object.
*
* @return void
*
* @since 1.6
*/
protected function prepareTable($table)
{
$date = JFactory::getDate();
$user = JFactory::getUser();
if (isset($table->name))
{
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
}
if (isset($table->alias) && empty($table->alias))
{
$table->generateAlias();
}
if (empty($table->id))
{
$table->created = $date->toSql();
// set the user
if ($table->created_by == 0 || empty($table->created_by))
{
$table->created_by = $user->id;
}
// Set ordering to the last item if not set
if (empty($table->ordering))
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('MAX(ordering)')
->from($db->quoteName('#__componentbuilder_admin_fields_conditions'));
$db->setQuery($query);
$max = $db->loadResult();
$table->ordering = $max + 1;
}
}
else
{
$table->modified = $date->toSql();
$table->modified_by = $user->id;
}
if (!empty($table->id))
{
// Increment the items version number.
$table->version++;
}
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 1.6
*/
protected function loadFormData()
{
// Check the session for previously entered form data.
$data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.admin_fields_conditions.data', array());
if (empty($data))
{
$data = $this->getItem();
}
return $data;
}
/**
* Method to get the unique fields of this table.
*
* @return mixed An array of field names, boolean false if none is set.
*
* @since 3.0
*/
protected function getUniqeFields()
{
return false;
}
/**
* Method to delete one or more records.
*
* @param array &$pks An array of record primary keys.
*
* @return boolean True if successful, false if an error occurs.
*
* @since 12.2
*/
public function delete(&$pks)
{
if (!parent::delete($pks))
{
return false;
}
return true;
}
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param integer $value The value of the published state.
*
* @return boolean True on success.
*
* @since 12.2
*/
public function publish(&$pks, $value = 1)
{
if (!parent::publish($pks, $value))
{
return false;
}
return true;
}
/**
* Method to perform batch operations on an item or a set of items.
*
* @param array $commands An array of commands to perform.
* @param array $pks An array of item ids.
* @param array $contexts An array of item contexts.
*
* @return boolean Returns true on success, false on failure.
*
* @since 12.2
*/
public function batch($commands, $pks, $contexts)
{
// Sanitize ids.
$pks = array_unique($pks);
JArrayHelper::toInteger($pks);
// Remove any values of zero.
if (array_search(0, $pks, true))
{
unset($pks[array_search(0, $pks, true)]);
}
if (empty($pks))
{
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
return false;
}
$done = false;
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
$this->batchSet = true;
if (!$this->canDo->get('core.batch'))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
if ($this->type == false)
{
$type = new JUcmType;
$this->type = $type->getTypeByAlias($this->typeAlias);
}
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
if (!empty($commands['move_copy']))
{
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
if ($cmd == 'c')
{
$result = $this->batchCopy($commands, $pks, $contexts);
if (is_array($result))
{
foreach ($result as $old => $new)
{
$contexts[$new] = $contexts[$old];
}
$pks = array_values($result);
}
else
{
return false;
}
}
elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
{
return false;
}
$done = true;
}
if (!$done)
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
return false;
}
// Clear the cache
$this->cleanCache();
return true;
}
/**
* Batch copy items to a new category or current.
*
* @param integer $values The new values.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return mixed An array of new IDs on success, boolean false on failure.
*
* @since 12.2
*/
protected function batchCopy($values, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
}
if (!$this->canDo->get('core.create') || !$this->canDo->get('core.batch'))
{
return false;
}
// get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// remove move_copy from array
unset($values['move_copy']);
// make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
}
elseif (isset($values['published']) && !$this->canDo->get('core.edit.state'))
{
$values['published'] = 0;
}
$newIds = array();
// Parent exists so let's proceed
while (!empty($pks))
{
// Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
// insert all set values
if (ComponentbuilderHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
if (strlen($value) > 0 && isset($this->table->$key))
{
$this->table->$key = $value;
}
}
}
// update all uniqe fields
if (ComponentbuilderHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
{
$this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
}
}
// Reset the ID because we are making a copy
$this->table->id = 0;
// TODO: Deal with ordering?
// $this->table->ordering = 1;
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
// Get the new item ID
$newId = $this->table->get('id');
// Add the new ID to the array
$newIds[$pk] = $newId;
}
// Clean the cache
$this->cleanCache();
return $newIds;
}
/**
* Batch move items to a new category
*
* @param integer $value The new category ID.
* @param array $pks An array of row IDs.
* @param array $contexts An array of item contexts.
*
* @return boolean True if successful, false otherwise and internal error is set.
*
* @since 12.2
*/
protected function batchMove($values, $pks, $contexts)
{
if (empty($this->batchSet))
{
// Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
}
if (!$this->canDo->get('core.edit') && !$this->canDo->get('core.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'))
{
unset($values['published']);
}
// remove move_copy from array
unset($values['move_copy']);
// Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('core.edit', $contexts[$pk]))
{
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false;
}
// Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// Fatal error
$this->setError($error);
return false;
}
else
{
// Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// insert all set values.
if (ComponentbuilderHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// Do special action for access.
if ('access' === $key && strlen($value) > 0)
{
$this->table->$key = $value;
}
elseif (strlen($value) > 0 && isset($this->table->$key))
{
$this->table->$key = $value;
}
}
}
// Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
return false;
}
if (!empty($this->type))
{
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
return false;
}
}
// Clean the cache
$this->cleanCache();
return true;
}
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success.
*
* @since 1.6
*/
public function save($data)
{
$input = JFactory::getApplication()->input;
$filter = JFilterInput::getInstance();
// set the metadata to the Item Data
if (isset($data['metadata']) && isset($data['metadata']['author']))
{
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
$metadata = new JRegistry;
$metadata->loadArray($data['metadata']);
$data['metadata'] = (string) $metadata;
}
// Set the addconditions items to data.
if (isset($data['addconditions']) && is_array($data['addconditions']))
{
$addconditions = new JRegistry;
$addconditions->loadArray($data['addconditions']);
$data['addconditions'] = (string) $addconditions;
}
elseif (!isset($data['addconditions']))
{
// Set the empty addconditions to data
$data['addconditions'] = '';
}
// Set the Params Items to data
if (isset($data['params']) && is_array($data['params']))
{
$params = new JRegistry;
$params->loadArray($data['params']);
$data['params'] = (string) $params;
}
// Alter the uniqe field for save as copy
if ($input->get('task') === 'save2copy')
{
// Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (ComponentbuilderHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
{
$data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
}
}
}
if (parent::save($data))
{
return true;
}
return false;
}
/**
* Method to generate a uniqe value.
*
* @param string $field name.
* @param string $value data.
*
* @return string New value.
*
* @since 3.0
*/
protected function generateUniqe($field,$value)
{
// set field value uniqe
$table = $this->getTable();
while ($table->load(array($field => $value)))
{
$value = JString::increment($value);
}
return $value;
}
/**
* Method to change the title & alias.
*
* @param string $title The title.
*
* @return array Contains the modified title and alias.
*
*/
protected function _generateNewTitle($title)
{
// Alter the title
$table = $this->getTable();
while ($table->load(array('title' => $title)))
{
$title = JString::increment($title);
}
return $title;
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 126 of this MVC
@build 11th October, 2017
@version @update number 136 of this MVC
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php
@ -64,6 +64,11 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
public function getTable($type = 'admin_view', $prefix = 'ComponentbuilderTable', $config = array())
{
return JTable::getInstance($type, $prefix, $config);
}
public function getVDM()
{
return $this->vastDevMod;
}
/**
@ -119,22 +124,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->addlinked_views = $addlinked_views->toArray();
}
if (!empty($item->addfields))
{
// Convert the addfields field to an array.
$addfields = new Registry;
$addfields->loadString($item->addfields);
$item->addfields = $addfields->toArray();
}
if (!empty($item->addconditions))
{
// Convert the addconditions field to an array.
$addconditions = new Registry;
$addconditions->loadString($item->addconditions);
$item->addconditions = $addconditions->toArray();
}
if (!empty($item->custom_button))
{
// Convert the custom_button field to an array.
@ -261,10 +250,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_import_display = base64_decode($item->php_import_display);
}
if (!empty($item->php_getitem))
if (!empty($item->css_view))
{
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
// base64 Decode css_view.
$item->css_view = base64_decode($item->css_view);
}
if (!empty($item->php_import_save))
@ -273,12 +262,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_import_save = base64_decode($item->php_import_save);
}
if (!empty($item->css_view))
{
// base64 Decode css_view.
$item->css_view = base64_decode($item->css_view);
}
if (!empty($item->css_views))
{
// base64 Decode css_views.
@ -351,11 +334,38 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_import_setdata = base64_decode($item->php_import_setdata);
}
if (!empty($item->php_getitem))
{
// base64 Decode php_getitem.
$item->php_getitem = base64_decode($item->php_getitem);
}
if (!empty($item->php_import_ext))
{
// base64 Decode php_import_ext.
$item->php_import_ext = base64_decode($item->php_import_ext);
}
if (empty($item->id))
{
$id = 0;
}
else
{
$id = $item->id;
}
// set the id and view name to session
if ($vdm = ComponentbuilderHelper::get('admin_view__'.$id))
{
$this->vastDevMod = $vdm;
}
else
{
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
}
if (!empty($item->id))
{
@ -1192,32 +1202,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['addlinked_views'] = '';
}
// Set the addfields items to data.
if (isset($data['addfields']) && is_array($data['addfields']))
{
$addfields = new JRegistry;
$addfields->loadArray($data['addfields']);
$data['addfields'] = (string) $addfields;
}
elseif (!isset($data['addfields']))
{
// Set the empty addfields to data
$data['addfields'] = '';
}
// Set the addconditions items to data.
if (isset($data['addconditions']) && is_array($data['addconditions']))
{
$addconditions = new JRegistry;
$addconditions->loadArray($data['addconditions']);
$data['addconditions'] = (string) $addconditions;
}
elseif (!isset($data['addconditions']))
{
// Set the empty addconditions to data
$data['addconditions'] = '';
}
// Set the custom_button items to data.
if (isset($data['custom_button']) && is_array($data['custom_button']))
{
@ -1359,10 +1343,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_import_display'] = base64_encode($data['php_import_display']);
}
// Set the php_getitem string to base64 string.
if (isset($data['php_getitem']))
// Set the css_view string to base64 string.
if (isset($data['css_view']))
{
$data['php_getitem'] = base64_encode($data['php_getitem']);
$data['css_view'] = base64_encode($data['css_view']);
}
// Set the php_import_save string to base64 string.
@ -1371,12 +1355,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_import_save'] = base64_encode($data['php_import_save']);
}
// Set the css_view string to base64 string.
if (isset($data['css_view']))
{
$data['css_view'] = base64_encode($data['css_view']);
}
// Set the css_views string to base64 string.
if (isset($data['css_views']))
{
@ -1449,6 +1427,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_import_setdata'] = base64_encode($data['php_import_setdata']);
}
// Set the php_getitem string to base64 string.
if (isset($data['php_getitem']))
{
$data['php_getitem'] = base64_encode($data['php_getitem']);
}
// Set the php_import_ext string to base64 string.
if (isset($data['php_import_ext']))
{

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 126 of this MVC
@build 11th October, 2017
@version @update number 136 of this MVC
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php
@ -148,21 +148,6 @@ class ComponentbuilderModelAdmin_views extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -214,12 +199,6 @@ class ComponentbuilderModelAdmin_views extends JModelList
// From the componentbuilder_admin_view table
$query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');
@ -270,12 +249,10 @@ class ComponentbuilderModelAdmin_views extends JModelList
$item->sql = base64_decode($item->sql);
// decode php_import_display
$item->php_import_display = base64_decode($item->php_import_display);
// decode php_getitem
$item->php_getitem = base64_decode($item->php_getitem);
// decode php_import_save
$item->php_import_save = base64_decode($item->php_import_save);
// decode css_view
$item->css_view = base64_decode($item->css_view);
// decode php_import_save
$item->php_import_save = base64_decode($item->php_import_save);
// decode css_views
$item->css_views = base64_decode($item->css_views);
// decode javascript_view_file
@ -300,6 +277,8 @@ class ComponentbuilderModelAdmin_views extends JModelList
$item->html_import_view = base64_decode($item->html_import_view);
// decode php_import_setdata
$item->php_import_setdata = base64_decode($item->php_import_setdata);
// decode php_getitem
$item->php_getitem = base64_decode($item->php_getitem);
// decode php_import_ext
$item->php_import_ext = base64_decode($item->php_import_ext);
// unset the values we don't want exported.

View File

@ -0,0 +1,224 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
@build 12th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admins_fields.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 Joomla modellist library
jimport('joomla.application.component.modellist');
/**
* Admins_fields Model
*/
class ComponentbuilderModelAdmins_fields extends JModelList
{
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by'
);
}
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* @return void
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
// List state information.
parent::populateState($ordering, $direction);
}
/**
* Method to get an array of data items.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getItems()
{
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// return items
return $items;
}
/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
*/
protected function getListQuery()
{
// Get the user object.
$user = JFactory::getUser();
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// Select some fields
$query->select('a.*');
// From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_admin_fields', 'a'));
// From the componentbuilder_admin_view table.
$query->select($db->quoteName('g.system_name','admin_view_system_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'g') . ' ON (' . $db->quoteName('a.admin_view') . ' = ' . $db->quoteName('g.id') . ')');
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
$query->where('a.published = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
{
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
return $query;
}
/**
* Method to get a store id based on model configuration state.
*
* @return string A store id.
*
*/
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');
return parent::getStoreId($id);
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{
// Get a db connection.
$db = JFactory::getDbo();
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__componentbuilder_admin_fields'));
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// reset query
$query = $db->getQuery(true);
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// Check table
$query->update($db->quoteName('#__componentbuilder_admin_fields'))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
}
}
return false;
}
}

View File

@ -0,0 +1,224 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 12th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admins_fields_conditions.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 Joomla modellist library
jimport('joomla.application.component.modellist');
/**
* Admins_fields_conditions Model
*/
class ComponentbuilderModelAdmins_fields_conditions extends JModelList
{
public function __construct($config = array())
{
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'a.id','id',
'a.published','published',
'a.ordering','ordering',
'a.created_by','created_by',
'a.modified_by','modified_by'
);
}
parent::__construct($config);
}
/**
* Method to auto-populate the model state.
*
* @return void
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access);
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);
$created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
$this->setState('filter.created_by', $created_by);
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $created);
// List state information.
parent::populateState($ordering, $direction);
}
/**
* Method to get an array of data items.
*
* @return mixed An array of data items on success, false on failure.
*/
public function getItems()
{
// check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// return items
return $items;
}
/**
* Method to build an SQL query to load the list data.
*
* @return string An SQL query
*/
protected function getListQuery()
{
// Get the user object.
$user = JFactory::getUser();
// Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// Select some fields
$query->select('a.*');
// From the componentbuilder_item table
$query->from($db->quoteName('#__componentbuilder_admin_fields_conditions', 'a'));
// From the componentbuilder_admin_view table.
$query->select($db->quoteName('g.system_name','admin_view_system_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'g') . ' ON (' . $db->quoteName('a.admin_view') . ' = ' . $db->quoteName('g.id') . ')');
// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
$query->where('a.published = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
{
$query->order($db->escape($orderCol . ' ' . $orderDirn));
}
return $query;
}
/**
* Method to get a store id based on model configuration state.
*
* @return string A store id.
*
*/
protected function getStoreId($id = '')
{
// Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');
return parent::getStoreId($id);
}
/**
* Build an SQL query to checkin all items left checked out longer then a set time.
*
* @return a bool
*
*/
protected function checkInNow()
{
// Get set check in time
$time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
if ($time)
{
// Get a db connection.
$db = JFactory::getDbo();
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__componentbuilder_admin_fields_conditions'));
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// reset query
$query = $db->getQuery(true);
// Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// Check table
$query->update($db->quoteName('#__componentbuilder_admin_fields_conditions'))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
}
}
return false;
}
}

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder
@ -177,6 +177,131 @@ class ComponentbuilderModelAjax extends JModelList
}
// Used in admin_view
protected $viewid = array();
protected function getViewID($call = 'table')
{
if (!isset($this->viewid[$call]))
{
// get the vdm key
$jinput = JFactory::getApplication()->input;
$vdm = $jinput->get('vdm', null, 'WORD');
if ($vdm)
{
if ($view = ComponentbuilderHelper::get($vdm))
{
$current = (array) explode('__', $view);
if (ComponentbuilderHelper::checkString($current[0]) && isset($current[1]) && is_numeric($current[1]))
{
// get the view name & id
$this->viewid[$call] = array(
'a_id' => (int) $current[1],
'a_view' => $current[0]
);
}
}
}
}
if (isset($this->viewid[$call]))
{
return $this->viewid[$call];
}
return false;
}
protected $buttonArray = array(
'admin_fields' => 'admins_fields',
'admin_fields_conditions' => 'admins_fields_conditions',
'language' => true);
public function getButton($type)
{
if (isset($this->buttonArray[$type]))
{
$user = JFactory::getUser();
// only add if user allowed to create
if ($user->authorise($type.'.create', 'com_componentbuilder'))
{
// get the view name & id
$values = $this->getViewID();
// check if new item
$ref = '';
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['a_view'] . '&amp;refid=' . $values['a_id'];
}
// build the button
$button = '<div class="control-group">
<div class="control-label">
<label>' . ucwords($type) . '</label>
</div>
<div class="controls">
<a class="btn btn-success vdm-button-new" onclick="UIkit.modal.confirm(\''.JText::_('COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE').'\', function(){ window.location.href = \'index.php?option=com_componentbuilder&amp;view='.$type.'&amp;layout=edit'.$ref.'\' })" href="javascript:void(0)" >
<span class="icon-new icon-white"></span>
' . JText::_('COM_COMPONENTBUILDER_NEW') . '
</a>
</div>
</div>';
// return the button attached to input field
return $button;
}
return '';
}
return false;
}
public function getButtonID($type)
{
if (isset($this->buttonArray[$type]))
{
$user = JFactory::getUser();
// only add if user allowed to create
if ($user->authorise($type.'.create', 'com_componentbuilder'))
{
// get the view name & id
$values = $this->getViewID();
// check if new item
$ref = '';
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['a_view'] . '&amp;refid=' . $values['a_id'];
// get item id
if ($id = ComponentbuilderHelper::getVar($type, $values['a_id'], $values['a_view'], 'id'))
{
$buttonText = JText::sprintf('COM_COMPONENTBUILDER_EDIT_S_FOR_THIS_S', ComponentbuilderHelper::safeString($type, 'w'), ComponentbuilderHelper::safeString($values['a_view'], 'w'));
$editThis = 'index.php?option=com_componentbuilder&amp;view='.$this->buttonArray[$type].'&amp;task='.$type.'.edit&amp;id='.$id;
$icon = 'icon-apply';
}
else
{
$buttonText = JText::sprintf('COM_COMPONENTBUILDER_CREATE_S_FOR_THIS_S', ComponentbuilderHelper::safeString($type, 'w'), ComponentbuilderHelper::safeString($values['a_view'], 'w'));
$editThis = 'index.php?option=com_componentbuilder&amp;view='.$type.'&amp;layout=edit';
$icon = 'icon-new';
}
// build the button
$button = '<div class="control-group">
<div class="control-label">
<label>' . ComponentbuilderHelper::safeString($type, 'Ww') . '</label>
</div>
<div class="controls">
<a class="btn btn-success vdm-button-new" onclick="UIkit.modal.confirm(\''.JText::_('COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE').'\', function(){ window.location.href = \''.$editThis.$ref.'\' })" href="javascript:void(0)" >
<span class="'.$icon.' icon-white"></span>
' . $buttonText . '
</a>
</div>
</div>';
// return the button attached to input field
return $button;
}
return '<div class="control-group"><div class="alert alert-info">' . JText::sprintf('COM_COMPONENTBUILDER_BUTTON_TO_CREATE_S_WILL_SHOW_ONCE_S_IS_SAVED', ComponentbuilderHelper::safeString($type, 'w'), ComponentbuilderHelper::safeString($values['a_view'], 'w')) . '</div></div>';
}
}
return '';
}
public static function getImportScripts($type)
{
// get from global helper
@ -1008,81 +1133,5 @@ class ComponentbuilderModelAjax extends JModelList
return $field;
}
return false;
}
// Used in language_translation
protected $viewid = array();
protected function getViewID($call = 'table')
{
if (!isset($this->viewid[$call]))
{
// get the vdm key
$jinput = JFactory::getApplication()->input;
$vdm = $jinput->get('vdm', null, 'WORD');
if ($vdm)
{
if ($view = ComponentbuilderHelper::get($vdm))
{
$current = (array) explode('__', $view);
if (ComponentbuilderHelper::checkString($current[0]) && isset($current[1]) && is_numeric($current[1]))
{
// get the view name & id
$this->viewid[$call] = array(
'a_id' => (int) $current[1],
'a_view' => $current[0]
);
}
}
}
}
if (isset($this->viewid[$call]))
{
return $this->viewid[$call];
}
return false;
}
protected $buttonArray = array(
'language' => true);
public function getButton($type)
{
if (isset($this->buttonArray[$type]))
{
$user = JFactory::getUser();
// only add if user allowed to create
if ($user->authorise($type.'.create', 'com_componentbuilder'))
{
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the view name & id
$values = $this->getViewID();
// check if new item
$ref = '';
if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['a_view'] . '&amp;refid=' . $values['a_id'];
}
// build the button
$button = '<div class="control-group">
<div class="control-label">
<label>' . ucwords($type) . '</label>
</div>
<div class="controls">
<a class="btn btn-success vdm-button-new" onclick="UIkit.modal.confirm(\''.JText::_('COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE').'\', function(){ window.location.href = \'index.php?option=com_componentbuilder&amp;view='.$type.'&amp;layout=edit'.$ref.'\' })" href="javascript:void(0)" >
<span class="icon-new icon-white"></span>
' . JText::_('COM_COMPONENTBUILDER_NEW') . '
</a>
</div>
</div>';
// return the button attached to input field
return $button;
}
return '';
}
return false;
}
}

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder
@ -54,8 +54,6 @@ 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_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',

View File

@ -169,21 +169,6 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -235,12 +220,6 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
// From the componentbuilder_custom_admin_view table
$query->from($db->quoteName('#__componentbuilder_custom_admin_view', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -254,21 +254,6 @@ class ComponentbuilderModelCustom_codes extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -340,12 +325,6 @@ class ComponentbuilderModelCustom_codes extends JModelList
// From the componentbuilder_custom_code table
$query->from($db->quoteName('#__componentbuilder_custom_code', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -214,21 +214,6 @@ class ComponentbuilderModelDynamic_gets extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -290,12 +275,6 @@ class ComponentbuilderModelDynamic_gets extends JModelList
// From the componentbuilder_dynamic_get table
$query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -155,21 +155,6 @@ class ComponentbuilderModelField extends JModelAdmin
// From the componentbuilder_admin_view table
$query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');

View File

@ -286,21 +286,6 @@ class ComponentbuilderModelFields extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -399,12 +384,6 @@ class ComponentbuilderModelFields extends JModelList
// From the componentbuilder_field table
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -154,21 +154,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$query->where('a.fieldtype = -5');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');

View File

@ -171,21 +171,6 @@ class ComponentbuilderModelFieldtypes extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -259,12 +244,6 @@ class ComponentbuilderModelFieldtypes extends JModelList
// From the componentbuilder_fieldtype table
$query->from($db->quoteName('#__componentbuilder_fieldtype', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -0,0 +1,25 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
@build 12th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields.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
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/

View File

@ -0,0 +1,297 @@
<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_componentbuilder/models/rules"
addfieldpath="/administrator/components/com_componentbuilder/models/fields"
>
<fieldset name="details">
<!-- Default Fields. -->
<!-- Id Field. Type: Text (joomla) -->
<field
name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true"
/>
<!-- Date Created Field. Type: Calendar (joomla) -->
<field
name="created"
type="calendar"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CREATED_DATE_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CREATED_DATE_DESC"
size="22"
format="%Y-%m-%d %H:%M:%S"
filter="user_utc"
/>
<!-- User Created Field. Type: User (joomla) -->
<field
name="created_by"
type="user"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CREATED_BY_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CREATED_BY_DESC"
/>
<!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" >
<option value="1">
JPUBLISHED</option>
<option value="0">
JUNPUBLISHED</option>
<option value="2">
JARCHIVED</option>
<option value="-2">
JTRASHED</option>
</field>
<!-- Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_MODIFIED_DATE_LABEL" description="COM_COMPONENTBUILDER_ADMIN_FIELDS_MODIFIED_DATE_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_MODIFIED_BY_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
type="number"
class="inputbox validate-ordering"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ORDERING_LABEL"
description=""
default="0"
size="6"
required="false"
/>
<!-- Version Field. Type: Text (joomla) -->
<field
name="version"
type="text"
class="readonly"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_VERSION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_VERSION_DESC"
size="6"
readonly="true"
filter="unset"
/>
<!-- Dynamic Fields. -->
<!-- Admin_view Field. Type: Adminviews. (custom) -->
<field
type="adminviews"
name="admin_view"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADMIN_VIEW_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADMIN_VIEW_DESCRIPTION"
class="fieldMedium"
multiple="false"
required="true"
readonly="true"
button="false"
/>
<!-- Note_on_views Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_views" label="COM_COMPONENTBUILDER_ADMIN_FIELDS_NOTE_ON_VIEWS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_FIELDS_NOTE_ON_VIEWS_DESCRIPTION" heading="h4" class="alert alert-info note_on_views" close="true" />
<!-- Addfields Field. Type: Subform. (joomla) -->
<field
type="subform"
name="addfields"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADDFIELDS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADDFIELDS_DESCRIPTION"
icon="list"
maximum="800">
<form hidden="true" name="list_addfields_modal" repeat="true">
<!-- Field Field. Type: Fields. (custom) -->
<field
type="fields"
name="field"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELD_DESCRIPTION"
class="fieldMedium"
multiple="false"
required="false"
button="false"
/>
<!-- List Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="list"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_LIST_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_LIST_DESCRIPTION"
class="inputbox"
/>
<!-- Order_list Field. Type: Integer. (joomla) -->
<field
type="integer"
name="order_list"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ORDER_LIST_LABEL"
default="0"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ORDER_LIST_DESCRIPTION"
class="fieldSmall"
required="false"
first="0"
last="100"
step="1"
/>
<!-- Title Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="title"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_TITLE_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_TITLE_DESCRIPTION"
class="inputbox"
/>
<!-- Alias Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="alias"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ALIAS_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ALIAS_DESCRIPTION"
class="inputbox"
/>
<!-- Sort Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="sort"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_SORT_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_SORT_DESCRIPTION"
class="inputbox"
/>
<!-- Search Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="search"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_SEARCH_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_SEARCH_DESCRIPTION"
class="inputbox"
/>
<!-- Filter Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="filter"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_FILTER_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_FILTER_DESCRIPTION"
class="inputbox"
/>
<!-- Link Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="link"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_LINK_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_LINK_DESCRIPTION"
class="inputbox"
/>
<!-- Tab Field. Type: Integer. (joomla) -->
<field
type="integer"
name="tab"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_TAB_LABEL"
default="1"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_TAB_DESCRIPTION"
class="fieldSmall"
required="false"
first="1"
last="15"
step="1"
/>
<!-- Alignment Field. Type: List. (joomla) -->
<field
type="list"
name="alignment"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ALIGNMENT_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ALIGNMENT_DESCRIPTION"
class="fieldMedium"
multiple="false"
filter="INT"
required="false"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_LEFT_IN_TAB</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_IN_TAB</option>
<option value="3">
COM_COMPONENTBUILDER_ADMIN_FIELDS_FULL_WIDTH_IN_TAB</option>
<option value="4">
COM_COMPONENTBUILDER_ADMIN_FIELDS_ABOVE_TABS</option>
<option value="5">
COM_COMPONENTBUILDER_ADMIN_FIELDS_UNDERNEATH_TABS</option>
<option value="6">
COM_COMPONENTBUILDER_ADMIN_FIELDS_LEFT_OF_TABS</option>
<option value="7">
COM_COMPONENTBUILDER_ADMIN_FIELDS_RIGHT_OF_TABS</option>
</field>
<!-- Order_edit Field. Type: Integer. (joomla) -->
<field
type="integer"
name="order_edit"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ORDER_EDIT_LABEL"
default="0"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ORDER_EDIT_DESCRIPTION"
class="fieldSmall"
required="false"
first="0"
last="100"
step="1"
/>
<!-- Permission Field. Type: List. (joomla) -->
<field
type="list"
name="permission"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_PERMISSION_DESCRIPTION"
class="list_class"
multiple="false"
required="false"
default="0">
<!-- Option Set. -->
<option value="0">
COM_COMPONENTBUILDER_ADMIN_FIELDS_NONE</option>
<option value=" 1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_EDITING</option>
</field>
</form>
</field>
</fieldset>
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"
label="Permissions in relation to this admin_fields"
translate_label="false"
filter="rules"
validate="rules"
class="inputbox"
component="com_componentbuilder"
section="admin_fields"
/>
</fieldset>
</form>

View File

@ -0,0 +1,57 @@
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 7 of this MVC
@build 12th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields_conditions.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
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
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('');
}
});
}
}

View File

@ -0,0 +1,238 @@
<?xml version="1.0" encoding="utf-8"?>
<form
addrulepath="/administrator/components/com_componentbuilder/models/rules"
addfieldpath="/administrator/components/com_componentbuilder/models/fields"
>
<fieldset name="details">
<!-- Default Fields. -->
<!-- Id Field. Type: Text (joomla) -->
<field
name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true"
/>
<!-- Date Created Field. Type: Calendar (joomla) -->
<field
name="created"
type="calendar"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CREATED_DATE_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CREATED_DATE_DESC"
size="22"
format="%Y-%m-%d %H:%M:%S"
filter="user_utc"
/>
<!-- User Created Field. Type: User (joomla) -->
<field
name="created_by"
type="user"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CREATED_BY_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CREATED_BY_DESC"
/>
<!-- Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" >
<option value="1">
JPUBLISHED</option>
<option value="0">
JUNPUBLISHED</option>
<option value="2">
JARCHIVED</option>
<option value="-2">
JTRASHED</option>
</field>
<!-- Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_DATE_LABEL" description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_DATE_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_BY_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MODIFIED_BY_DESC"
class="readonly"
readonly="true"
filter="unset"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
type="number"
class="inputbox validate-ordering"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ORDERING_LABEL"
description=""
default="0"
size="6"
required="false"
/>
<!-- Version Field. Type: Text (joomla) -->
<field
name="version"
type="text"
class="readonly"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_VERSION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_VERSION_DESC"
size="6"
readonly="true"
filter="unset"
/>
<!-- Dynamic Fields. -->
<!-- Admin_view Field. Type: Adminviews. (custom) -->
<field
type="adminviews"
name="admin_view"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_DESCRIPTION"
class="fieldMedium"
multiple="false"
required="true"
readonly="true"
button="false"
/>
<!-- Note_on_conditions Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_conditions" label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_NOTE_ON_CONDITIONS_DESCRIPTION" heading="h4" class="alert alert-info note_on_conditions" close="true" />
<!-- Addconditions Field. Type: Subform. (joomla) -->
<field
type="subform"
name="addconditions"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS_DESCRIPTION"
icon="list"
maximum="500">
<form hidden="true" name="list_addconditions_modal" repeat="true">
<!-- Target_field Field. Type: Fieldsmulti. (custom) -->
<field
type="fieldsmulti"
name="target_field"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_TARGET_FIELD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_TARGET_FIELD_DESCRIPTION"
class="fieldMedium"
multiple="true"
required="false"
button="false"
/>
<!-- Target_behavior Field. Type: List. (joomla) -->
<field
type="list"
name="target_behavior"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_TARGET_BEHAVIOR_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_TARGET_BEHAVIOR_DESCRIPTION"
class="list_class"
multiple="false"
filter="INT"
required="false"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_SHOW</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE</option>
</field>
<!-- Target_relation Field. Type: List. (joomla) -->
<field
type="list"
name="target_relation"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_TARGET_RELATION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_TARGET_RELATION_DESCRIPTION"
class="list_class"
multiple="false"
filter="INT"
required="false"
default="0">
<!-- Option Set. -->
<option value="0">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ISOLATE</option>
<option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CHAIN</option>
</field>
<!-- Match_field Field. Type: Fields. (custom) -->
<field
type="fields"
name="match_field"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MATCH_FIELD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MATCH_FIELD_DESCRIPTION"
multiple="false"
required="false"
button="false"
/>
<!-- Match_behavior Field. Type: List. (joomla) -->
<field
type="list"
name="match_behavior"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MATCH_BEHAVIOR_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MATCH_BEHAVIOR_DESCRIPTION"
class="list_class"
multiple="false"
filter="INT"
required="false"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_IS_ONLY_FOUR_LISTRADIOCHECKBOXES</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES</option>
<option value="3">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST</option>
<option value="4">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ACTIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="5">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_UNACTIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="6">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_KEY_WORD_ALL_CASESENSITIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="7">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_KEY_WORD_ANY_CASESENSITIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="8">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_KEY_WORD_ALL_CASEINSENSITIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="9">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_KEY_WORD_ANY_CASEINSENSITIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="10">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD</option>
<option value="11">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD</option>
<option value="12">
COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EXACT_LENGTH_ONLY_FOUR_TEXT_FIELD</option>
</field>
<!-- Match_options Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="match_options"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MATCH_OPTIONS_LABEL"
rows="10"
cols="5"
class="text_area"
filter="STRING"
hint="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_MATCH_OPTIONS_HINT"
required="false"
/>
</form>
</field>
</fieldset>
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"
label="Permissions in relation to this admin_fields_conditions"
translate_label="false"
filter="rules"
validate="rules"
class="inputbox"
component="com_componentbuilder"
section="admin_fields_conditions"
/>
</fieldset>
</form>

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 126 of this MVC
@build 11th October, 2017
@version @update number 136 of this MVC
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.js
@ -1178,10 +1178,38 @@ function isSet(val)
jQuery(document).ready(function()
{
// set button
addButtonID('admin_fields','create_edit_buttons'); // <-- first
var valueSwitch = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
getImportScripts(valueSwitch);
addButtonID('admin_fields_conditions','create_edit_buttons'); // <-- second
});
function addData(result,where){
jQuery(where).closest('.control-group').parent().append(result);
}
function addButtonID_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type='+type;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
}
function addButtonID(type,where){
addButtonID_server(type).done(function(result) {
if(result){
addData(result,'#jform_'+where);
}
})
}
function getFieldSelectOptions_server(fieldId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json";
if(token.length > 0 && fieldId > 0){

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"
@ -590,8 +581,8 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_PUBLISH_HINT"
required="true"
/>
<!-- Note_on_views Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_views" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_VIEWS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_VIEWS_DESCRIPTION" heading="h4" class="alert alert-info note_on_views" close="true" />
<!-- Note_create_edit_notice Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_create_edit_notice" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_NOTICE_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_NOTICE_DESCRIPTION" heading="h4" class="alert alert-success note_create_edit_notice" />
<!-- Php_before_delete Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -605,182 +596,8 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_BEFORE_DELETE_HINT"
required="true"
/>
<!-- Addfields Field. Type: Subform. (joomla) -->
<field
type="subform"
name="addfields"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADDFIELDS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ADDFIELDS_DESCRIPTION"
icon="list"
maximum="800">
<form hidden="true" name="list_addfields_modal" repeat="true">
<!-- Field Field. Type: Fields. (custom) -->
<field
type="fields"
name="field"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_FIELD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_FIELD_DESCRIPTION"
class="fieldMedium"
multiple="false"
required="false"
button="false"
/>
<!-- List Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="list"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_LIST_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_LIST_DESCRIPTION"
class="inputbox"
/>
<!-- Order_list Field. Type: Integer. (joomla) -->
<field
type="integer"
name="order_list"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ORDER_LIST_LABEL"
default="0"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ORDER_LIST_DESCRIPTION"
class="fieldSmall"
required="false"
first="0"
last="100"
step="1"
/>
<!-- Title Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="title"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_TITLE_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_TITLE_DESCRIPTION"
class="inputbox"
/>
<!-- Alias Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="alias"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ALIAS_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ALIAS_DESCRIPTION"
class="inputbox"
/>
<!-- Sort Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="sort"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_SORT_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_SORT_DESCRIPTION"
class="inputbox"
/>
<!-- Search Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="search"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_SEARCH_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_SEARCH_DESCRIPTION"
class="inputbox"
/>
<!-- Filter Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="filter"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_FILTER_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_FILTER_DESCRIPTION"
class="inputbox"
/>
<!-- Link Field. Type: Checkbox. (joomla) -->
<field
type="checkbox"
name="link"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_LINK_LABEL"
value="1"
required="false"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_LINK_DESCRIPTION"
class="inputbox"
/>
<!-- Tab Field. Type: Integer. (joomla) -->
<field
type="integer"
name="tab"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_TAB_LABEL"
default="1"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_TAB_DESCRIPTION"
class="fieldSmall"
required="false"
first="1"
last="15"
step="1"
/>
<!-- Alignment Field. Type: List. (joomla) -->
<field
type="list"
name="alignment"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ALIGNMENT_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ALIGNMENT_DESCRIPTION"
class="fieldMedium"
multiple="false"
filter="INT"
required="false"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_LEFT_IN_TAB</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_VIEW_RIGHT_IN_TAB</option>
<option value="3">
COM_COMPONENTBUILDER_ADMIN_VIEW_FULL_WIDTH_IN_TAB</option>
<option value="4">
COM_COMPONENTBUILDER_ADMIN_VIEW_ABOVE_TABS</option>
<option value="5">
COM_COMPONENTBUILDER_ADMIN_VIEW_UNDERNEATH_TABS</option>
<option value="6">
COM_COMPONENTBUILDER_ADMIN_VIEW_LEFT_OF_TABS</option>
<option value="7">
COM_COMPONENTBUILDER_ADMIN_VIEW_RIGHT_OF_TABS</option>
</field>
<!-- Order_edit Field. Type: Integer. (joomla) -->
<field
type="integer"
name="order_edit"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ORDER_EDIT_LABEL"
default="0"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ORDER_EDIT_DESCRIPTION"
class="fieldSmall"
required="false"
first="0"
last="100"
step="1"
/>
<!-- Permission Field. Type: List. (joomla) -->
<field
type="list"
name="permission"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PERMISSION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PERMISSION_DESCRIPTION"
class="list_class"
multiple="false"
required="false"
default="0">
<!-- Option Set. -->
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NONE</option>
<option value=" 1">
COM_COMPONENTBUILDER_ADMIN_VIEW_EDITING</option>
</field>
</form>
</field>
<!-- Note_create_edit_buttons Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_create_edit_buttons" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_BUTTONS_DESCRIPTION" class="note_create_edit_buttons" />
<!-- Php_document Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -794,8 +611,8 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_DOCUMENT_HINT"
required="true"
/>
<!-- Note_on_conditions Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_on_conditions" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_CONDITIONS_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_CONDITIONS_DESCRIPTION" heading="h4" class="alert alert-info note_on_conditions" close="true" />
<!-- Note_create_edit_display Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_create_edit_display" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_DISPLAY_DESCRIPTION" class="note_create_edit_display" />
<!-- Sql Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -809,162 +626,6 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_SQL_HINT"
required="true"
/>
<!-- Addconditions Field. Type: Subform. (joomla) -->
<field
type="subform"
name="addconditions"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADDCONDITIONS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_ADDCONDITIONS_DESCRIPTION"
icon="list"
maximum="500">
<form hidden="true" name="list_addconditions_modal" repeat="true">
<!-- Target_field Field. Type: Fieldsmulti. (custom) -->
<field
type="fieldsmulti"
name="target_field"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_TARGET_FIELD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_TARGET_FIELD_DESCRIPTION"
class="fieldMedium"
multiple="true"
required="false"
button="false"
/>
<!-- Target_behavior Field. Type: List. (joomla) -->
<field
type="list"
name="target_behavior"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_TARGET_BEHAVIOR_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_TARGET_BEHAVIOR_DESCRIPTION"
class="list_class"
multiple="false"
filter="INT"
required="false"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_SHOW</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_VIEW_HIDE</option>
</field>
<!-- Target_relation Field. Type: List. (joomla) -->
<field
type="list"
name="target_relation"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_TARGET_RELATION_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_TARGET_RELATION_DESCRIPTION"
class="list_class"
multiple="false"
filter="INT"
required="false"
default="0">
<!-- Option Set. -->
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_ISOLATE</option>
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_CHAIN</option>
</field>
<!-- Match_field Field. Type: Fields. (custom) -->
<field
type="fields"
name="match_field"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_MATCH_FIELD_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_MATCH_FIELD_DESCRIPTION"
multiple="false"
required="false"
button="false"
/>
<!-- Match_behavior Field. Type: List. (joomla) -->
<field
type="list"
name="match_behavior"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_MATCH_BEHAVIOR_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_MATCH_BEHAVIOR_DESCRIPTION"
class="list_class"
multiple="false"
filter="INT"
required="false"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_IS_ONLY_FOUR_LISTRADIOCHECKBOXES</option>
<option value="2">
COM_COMPONENTBUILDER_ADMIN_VIEW_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES</option>
<option value="3">
COM_COMPONENTBUILDER_ADMIN_VIEW_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST</option>
<option value="4">
COM_COMPONENTBUILDER_ADMIN_VIEW_ACTIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="5">
COM_COMPONENTBUILDER_ADMIN_VIEW_UNACTIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="6">
COM_COMPONENTBUILDER_ADMIN_VIEW_KEY_WORD_ALL_CASESENSITIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="7">
COM_COMPONENTBUILDER_ADMIN_VIEW_KEY_WORD_ANY_CASESENSITIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="8">
COM_COMPONENTBUILDER_ADMIN_VIEW_KEY_WORD_ALL_CASEINSENSITIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="9">
COM_COMPONENTBUILDER_ADMIN_VIEW_KEY_WORD_ANY_CASEINSENSITIVE_ONLY_FOUR_TEXT_FIELD</option>
<option value="10">
COM_COMPONENTBUILDER_ADMIN_VIEW_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD</option>
<option value="11">
COM_COMPONENTBUILDER_ADMIN_VIEW_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD</option>
<option value="12">
COM_COMPONENTBUILDER_ADMIN_VIEW_EXACT_LENGTH_ONLY_FOUR_TEXT_FIELD</option>
</field>
<!-- Match_options Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="match_options"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_MATCH_OPTIONS_LABEL"
rows="10"
cols="5"
class="text_area"
filter="STRING"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_MATCH_OPTIONS_HINT"
required="false"
/>
</form>
</field>
<!-- Php_import_display Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_import_display"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_DISPLAY_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_DISPLAY_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_DISPLAY_HINT"
required="true"
/>
<!-- Php_getitem Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_getitem"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEM_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEM_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEM_HINT"
required="true"
/>
<!-- Php_import_save Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_import_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_HINT"
required="true"
/>
<!-- Add_css_view Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -979,6 +640,19 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Php_import_display Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_import_display"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_DISPLAY_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_DISPLAY_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_DISPLAY_HINT"
required="true"
/>
<!-- Css_view Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -992,20 +666,19 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEW_HINT"
required="true"
/>
<!-- Add_php_getitems Field. Type: Radio. (joomla) -->
<!-- Php_import_save Field. Type: Textarea. (joomla) -->
<field
type="radio"
name="add_php_getitems"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_GETITEMS_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_YES</option>
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
type="textarea"
name="php_import_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_HINT"
required="true"
/>
<!-- Add_css_views Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -1020,11 +693,11 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Add_php_getitems_after_all Field. Type: Radio. (joomla) -->
<!-- Add_php_getitems Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_getitems_after_all"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_GETITEMS_AFTER_ALL_LABEL"
name="add_php_getitems"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_GETITEMS_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1047,11 +720,11 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEWS_HINT"
required="true"
/>
<!-- Add_php_getlistquery Field. Type: Radio. (joomla) -->
<!-- Add_php_getitems_after_all Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_getlistquery"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_GETLISTQUERY_LABEL"
name="add_php_getitems_after_all"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_GETITEMS_AFTER_ALL_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1075,11 +748,11 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Add_php_before_save Field. Type: Radio. (joomla) -->
<!-- Add_php_getlistquery Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_before_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BEFORE_SAVE_LABEL"
name="add_php_getlistquery"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_GETLISTQUERY_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1102,11 +775,11 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_JAVASCRIPT_VIEW_FILE_HINT"
required="true"
/>
<!-- Add_php_save Field. Type: Radio. (joomla) -->
<!-- Add_php_before_save Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_SAVE_LABEL"
name="add_php_before_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BEFORE_SAVE_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1130,11 +803,11 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Add_php_postsavehook Field. Type: Radio. (joomla) -->
<!-- Add_php_save Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_postsavehook"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_POSTSAVEHOOK_LABEL"
name="add_php_save"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_SAVE_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1157,11 +830,11 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_JAVASCRIPT_VIEW_FOOTER_HINT"
required="true"
/>
<!-- Add_php_allowedit Field. Type: Radio. (joomla) -->
<!-- Add_php_postsavehook Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_allowedit"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_ALLOWEDIT_LABEL"
name="add_php_postsavehook"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_POSTSAVEHOOK_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1185,11 +858,11 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Add_php_batchcopy Field. Type: Radio. (joomla) -->
<!-- Add_php_allowedit Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_batchcopy"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BATCHCOPY_LABEL"
name="add_php_allowedit"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_ALLOWEDIT_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1212,11 +885,11 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_JAVASCRIPT_VIEWS_FILE_HINT"
required="true"
/>
<!-- Add_php_batchmove Field. Type: Radio. (joomla) -->
<!-- Add_php_batchcopy Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_batchmove"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BATCHMOVE_LABEL"
name="add_php_batchcopy"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BATCHCOPY_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1240,11 +913,11 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Add_php_before_publish Field. Type: Radio. (joomla) -->
<!-- Add_php_batchmove Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_before_publish"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BEFORE_PUBLISH_LABEL"
name="add_php_batchmove"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BATCHMOVE_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1267,11 +940,11 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_JAVASCRIPT_VIEWS_FOOTER_HINT"
required="true"
/>
<!-- Add_php_after_publish Field. Type: Radio. (joomla) -->
<!-- Add_php_before_publish Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_after_publish"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AFTER_PUBLISH_LABEL"
name="add_php_before_publish"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BEFORE_PUBLISH_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1295,11 +968,11 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Add_php_before_delete Field. Type: Radio. (joomla) -->
<!-- Add_php_after_publish Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_before_delete"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BEFORE_DELETE_LABEL"
name="add_php_after_publish"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AFTER_PUBLISH_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1818,11 +1491,11 @@
</field>
</form>
</field>
<!-- Add_php_after_delete Field. Type: Radio. (joomla) -->
<!-- Add_php_before_delete Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_after_delete"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AFTER_DELETE_LABEL"
name="add_php_before_delete"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_BEFORE_DELETE_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1845,11 +1518,11 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_CONTROLLER_HINT"
required="false"
/>
<!-- Add_php_document Field. Type: Radio. (joomla) -->
<!-- Add_php_after_delete Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_php_document"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_DOCUMENT_LABEL"
name="add_php_after_delete"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_AFTER_DELETE_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1872,11 +1545,11 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_MODEL_HINT"
required="false"
/>
<!-- Add_sql Field. Type: Radio. (joomla) -->
<!-- Add_php_document Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_sql"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_SQL_LABEL"
name="add_php_document"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_PHP_DOCUMENT_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
@ -1899,6 +1572,33 @@
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_CONTROLLER_LIST_HINT"
required="false"
/>
<!-- Add_sql Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_sql"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_SQL_LABEL"
class="btn-group btn-group-yesno"
default="0"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_ADMIN_VIEW_YES</option>
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Php_model_list Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_model_list"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_MODEL_LIST_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_MODEL_LIST_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_MODEL_LIST_HINT"
required="false"
/>
<!-- Addtables Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -1935,21 +1635,6 @@
/>
</form>
</field>
<!-- Php_model_list Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_model_list"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_MODEL_LIST_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_MODEL_LIST_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_MODEL_LIST_HINT"
required="false"
/>
<!-- Note_beginner_import Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_beginner_import" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_DESCRIPTION" heading="h4" class="alert alert-info note_beginner_import" />
<!-- Add_php_ajax Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -1964,6 +1649,21 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Note_beginner_import Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_beginner_import" label="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_LABEL" description="COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_DESCRIPTION" heading="h4" class="alert alert-info note_beginner_import" />
<!-- Php_ajaxmethod Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_ajaxmethod"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AJAXMETHOD_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AJAXMETHOD_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AJAXMETHOD_HINT"
required="true"
/>
<!-- Add_custom_import Field. Type: Radio. (joomla) -->
<field
type="radio"
@ -1979,32 +1679,6 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Php_ajaxmethod Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_ajaxmethod"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AJAXMETHOD_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AJAXMETHOD_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_AJAXMETHOD_HINT"
required="true"
/>
<!-- Html_import_view Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="html_import_view"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_HINT"
required="true"
/>
<!-- Ajax_input Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -2137,17 +1811,17 @@
/>
</form>
</field>
<!-- Php_import_setdata Field. Type: Textarea. (joomla) -->
<!-- Html_import_view Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_import_setdata"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_LABEL"
name="html_import_view"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_DESCRIPTION"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_HINT"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_HINT"
required="true"
/>
<!-- Add_php_getitem Field. Type: Radio. (joomla) -->
@ -2164,6 +1838,32 @@
<option value="0">
COM_COMPONENTBUILDER_ADMIN_VIEW_NO</option>
</field>
<!-- Php_import_setdata Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_import_setdata"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_HINT"
required="true"
/>
<!-- Php_getitem Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_getitem"
label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEM_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEM_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETITEM_HINT"
required="true"
/>
<!-- Php_import_ext Field. Type: Textarea. (joomla) -->
<field
type="textarea"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -89,6 +89,24 @@
readonly="true"
filter="unset"
/>
<!-- Metakey Field. Type: Textarea (joomla) -->
<field
name="metakey"
type="textarea"
label="JFIELD_META_KEYWORDS_LABEL"
description="JFIELD_META_KEYWORDS_DESC"
rows="3"
cols="30"
/>
<!-- Metadesc Field. Type: Textarea (joomla) -->
<field
name="metadesc"
type="textarea"
label="JFIELD_META_DESCRIPTION_LABEL"
description="JFIELD_META_DESCRIPTION_DESC"
rows="3"
cols="30"
/>
<!-- Dynamic Fields. -->
<!-- System_name Field. Type: Text. (joomla) -->
<field
@ -2956,7 +2974,36 @@
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_HINT"
required="true"
/>
</fieldset>
</fieldset>
<!-- Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- Robots Field. Type: List (joomla) -->
<field name="robots"
type="list"
label="JFIELD_METADATA_ROBOTS_LABEL"
description="JFIELD_METADATA_ROBOTS_DESC" >
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="index, follow">JGLOBAL_INDEX_FOLLOW</option>
<option value="noindex, follow">JGLOBAL_NOINDEX_FOLLOW</option>
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field>
<!-- Author Field. Type: Text (joomla) -->
<field name="author"
type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20"
/>
<!-- Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2"
/>
</fieldset>
</fields>
<!-- Access Control Fields. -->
<fieldset name="accesscontrol">

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 43 of this MVC
@build 16th September, 2017
@version @update number 44 of this MVC
@build 12th October, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_translation.js

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -57,15 +57,6 @@
readonly="true"
filter="unset"
/>
<!-- Access Field. Type: Accesslevel (joomla) -->
<field name="access"
type="accesslevel"
label="JFIELD_ACCESS_LABEL"
description="JFIELD_ACCESS_DESC"
default="1"
required="false"
/>
<!-- Ordering Field. Type: Numbers (joomla) -->
<field
name="ordering"

View File

@ -153,21 +153,6 @@ class ComponentbuilderModelFtps extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -224,12 +209,6 @@ class ComponentbuilderModelFtps extends JModelList
// From the componentbuilder_ftp table
$query->from($db->quoteName('#__componentbuilder_ftp', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -10,7 +10,7 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.5.6
@version 2.5.8
@build 12th October, 2017
@created 30th April, 2015
@package Component Builder

View File

@ -241,21 +241,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
// From the componentbuilder_admin_view table
$query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
@ -320,21 +305,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$query->select($db->quoteName('g.name','snippet_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_snippet', 'g') . ' ON (' . $db->quoteName('a.snippet') . ' = ' . $db->quoteName('g.id') . ')');
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
@ -416,21 +386,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$query->select($db->quoteName('g.name','snippet_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_snippet', 'g') . ' ON (' . $db->quoteName('a.snippet') . ' = ' . $db->quoteName('g.id') . ')');
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
@ -508,21 +463,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
// From the componentbuilder_language_translation table
$query->from($db->quoteName('#__componentbuilder_language_translation', 'a'));
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 43 of this MVC
@build 16th September, 2017
@version @update number 44 of this MVC
@build 12th October, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_translation.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 43 of this MVC
@build 16th September, 2017
@version @update number 44 of this MVC
@build 12th October, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage language_translations.php
@ -195,21 +195,6 @@ class ComponentbuilderModelLanguage_translations extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -261,12 +246,6 @@ class ComponentbuilderModelLanguage_translations extends JModelList
// From the componentbuilder_language_translation table
$query->from($db->quoteName('#__componentbuilder_language_translation', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -157,21 +157,6 @@ class ComponentbuilderModelLanguages extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -223,12 +208,6 @@ class ComponentbuilderModelLanguages extends JModelList
// From the componentbuilder_language table
$query->from($db->quoteName('#__componentbuilder_language', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -169,21 +169,6 @@ class ComponentbuilderModelLayouts extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -240,12 +225,6 @@ class ComponentbuilderModelLayouts extends JModelList
// From the componentbuilder_layout table
$query->from($db->quoteName('#__componentbuilder_layout', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -169,21 +169,6 @@ class ComponentbuilderModelSite_views extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -235,12 +220,6 @@ class ComponentbuilderModelSite_views extends JModelList
// From the componentbuilder_site_view table
$query->from($db->quoteName('#__componentbuilder_site_view', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -203,21 +203,6 @@ class ComponentbuilderModelSnippets extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -274,12 +259,6 @@ class ComponentbuilderModelSnippets extends JModelList
// From the componentbuilder_snippet table
$query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');

View File

@ -165,21 +165,6 @@ class ComponentbuilderModelTemplates extends JModelList
{
$query->where('(a.published = 0 OR a.published = 1)');
}
// Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
@ -231,12 +216,6 @@ class ComponentbuilderModelTemplates extends JModelList
// From the componentbuilder_template table
$query->from($db->quoteName('#__componentbuilder_template', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// Implement View Level Access
if (!$user->authorise('core.options', 'com_componentbuilder'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// Order the results by ordering
$query->order('a.ordering ASC');