Added the main GUI for the plugin area, gh-436
This commit is contained in:
@ -249,6 +249,27 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
return function_exists('curl_version');
|
||||
}
|
||||
|
||||
// Used in joomla_plugin
|
||||
public function getClassCode($id, $type)
|
||||
{
|
||||
return ComponentbuilderHelper::getClassCode($id, $type);
|
||||
}
|
||||
|
||||
|
||||
public function getClassCodeIds($id, $type)
|
||||
{
|
||||
if ('property' === $type || 'method' === $type)
|
||||
{
|
||||
return ComponentbuilderHelper::getVars('class_' . $type, $id, 'joomla_plugin_group', 'id');
|
||||
}
|
||||
elseif ('joomla_plugin_group' === $type)
|
||||
{
|
||||
return ComponentbuilderHelper::getVars($type, $id, 'class_extends', 'id');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Used in admin_view
|
||||
|
||||
protected $viewid = array();
|
||||
@ -2721,7 +2742,7 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
foreach($field['php'] as $name => $values)
|
||||
{
|
||||
$value = implode(PHP_EOL, $values['value']);
|
||||
$textarea = $this->buildFieldTexteara($name, $values['desc'], $value, substr_count( $value, PHP_EOL ));
|
||||
$textarea = $this->buildFieldTextarea($name, $values['desc'], $value, substr_count( $value, PHP_EOL ));
|
||||
// load the html
|
||||
$field['textarea'][] = '<div class="control-label prop_removal">'. $textarea->label . '</div><div class="controls prop_removal">' . $textarea->input . '</div><br />';
|
||||
}
|
||||
@ -2761,7 +2782,7 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function buildFieldTexteara($name, $desc, $default, $rows)
|
||||
protected function buildFieldTextarea($name, $desc, $default, $rows)
|
||||
{
|
||||
// get the textarea
|
||||
$textarea = JFormHelper::loadFieldType('textarea', true);
|
||||
|
297
admin/models/class_extendings.php
Normal file
297
admin/models/class_extendings.php
Normal file
@ -0,0 +1,297 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Class_extendings Model
|
||||
*/
|
||||
class ComponentbuilderModelClass_extendings 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',
|
||||
'a.name','name',
|
||||
'a.extension_type','extension_type'
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
|
||||
$this->setState('filter.name', $name);
|
||||
|
||||
$extension_type = $this->getUserStateFromRequest($this->context . '.filter.extension_type', 'filter_extension_type');
|
||||
$this->setState('filter.extension_type', $extension_type);
|
||||
|
||||
$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();
|
||||
|
||||
// set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $item->id) && JFactory::getUser()->authorise('class_extends.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// set selection value to a translatable value
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// convert extension_type
|
||||
$item->extension_type = $this->selectionTranslation($item->extension_type, 'extension_type');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to convert selection values to translatable string.
|
||||
*
|
||||
* @return translatable string
|
||||
*/
|
||||
public function selectionTranslation($value,$name)
|
||||
{
|
||||
// Array of extension_type language strings
|
||||
if ($name === 'extension_type')
|
||||
{
|
||||
$extension_typeArray = array(
|
||||
0 => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_SELECT_AN_OPTION',
|
||||
'components' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_COMPONENTS',
|
||||
'plugins' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_PLUGINS',
|
||||
'modules' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_MODULES'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($extension_typeArray[$value]) && ComponentbuilderHelper::checkString($extension_typeArray[$value]))
|
||||
{
|
||||
return $extension_typeArray[$value];
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_class_extends', 'a'));
|
||||
|
||||
// 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)');
|
||||
}
|
||||
|
||||
// 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))
|
||||
{
|
||||
if (stripos($search, 'id:') === 0)
|
||||
{
|
||||
$query->where('a.id = ' . (int) substr($search, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.extension_type LIKE '.$search.' OR a.head LIKE '.$search.' OR a.comment LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by Extension_type.
|
||||
if ($extension_type = $this->getState('filter.extension_type'))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($extension_type)));
|
||||
}
|
||||
|
||||
// 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');
|
||||
$id .= ':' . $this->getState('filter.name');
|
||||
$id .= ':' . $this->getState('filter.extension_type');
|
||||
|
||||
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_class_extends'));
|
||||
$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_class_extends'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
907
admin/models/class_extends.php
Normal file
907
admin/models/class_extends.php
Normal file
@ -0,0 +1,907 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
/**
|
||||
* Componentbuilder Class_extends Model
|
||||
*/
|
||||
class ComponentbuilderModelClass_extends extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tabLayoutFields = array(
|
||||
'details' => array(
|
||||
'left' => array(
|
||||
'name',
|
||||
'extension_type'
|
||||
),
|
||||
'right' => array(
|
||||
'comment'
|
||||
),
|
||||
'fullwidth' => array(
|
||||
'head'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* @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.class_extends';
|
||||
|
||||
/**
|
||||
* 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 = 'class_extends', $prefix = 'ComponentbuilderTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables');
|
||||
// get instance of the table
|
||||
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) && !is_array($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->head))
|
||||
{
|
||||
// base64 Decode head.
|
||||
$item->head = base64_decode($item->head);
|
||||
}
|
||||
|
||||
if (!empty($item->comment))
|
||||
{
|
||||
// base64 Decode comment.
|
||||
$item->comment = base64_decode($item->comment);
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
{
|
||||
$item->tags = new JHelperTags;
|
||||
$item->tags->getTagIds($item->id, 'com_componentbuilder.class_extends');
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.class_extends', 'class_extends', $options);
|
||||
|
||||
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('class_extends.edit.state', 'com_componentbuilder.class_extends.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_extends.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 ($id != 0 && (!$user->authorise('class_extends.edit.created_by', 'com_componentbuilder.class_extends.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_extends.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 ($id != 0 && (!$user->authorise('class_extends.edit.created', 'com_componentbuilder.class_extends.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_extends.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 view name
|
||||
$redirectedView = $jinput->get('ref', null, 'STRING');
|
||||
// Set field name (or fall back to view name)
|
||||
$redirectedField = $jinput->get('field', $redirectedView, 'STRING');
|
||||
// Set redirected view id
|
||||
$redirectedId = $jinput->get('refid', 0, 'INT');
|
||||
// Set field id (or fall back to redirected view id)
|
||||
$redirectedValue = $jinput->get('field_id', $redirectedId, 'INT');
|
||||
if (0 != $redirectedValue && $redirectedField)
|
||||
{
|
||||
// Now set the local-redirected field default value
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
// update all editors to use this components global editor
|
||||
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
|
||||
// now get all the editor fields
|
||||
$editors = $form->getXml()->xpath("//field[@type='editor']");
|
||||
// check if we found any
|
||||
if (ComponentbuilderHelper::checkArray($editors))
|
||||
{
|
||||
foreach ($editors as $editor)
|
||||
{
|
||||
// get the field names
|
||||
$name = (string) $editor['name'];
|
||||
// set the field editor value (with none as fallback)
|
||||
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
|
||||
}
|
||||
}
|
||||
|
||||
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/class_extends.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('class_extends.delete', 'com_componentbuilder.class_extends.' . (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('class_extends.edit.state', 'com_componentbuilder.class_extends.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('class_extends.edit.state', 'com_componentbuilder');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
$user = JFactory::getUser();
|
||||
|
||||
return $user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('class_extends.edit', 'com_componentbuilder');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_class_extends'));
|
||||
$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.class_extends.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('class_extends');
|
||||
$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->canDo = ComponentbuilderHelper::getActions('class_extends');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('class_extends.create') && !$this->canDo->get('class_extends.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('class_extends.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('class_extends.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;
|
||||
}
|
||||
}
|
||||
|
||||
// Only for strings
|
||||
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
|
||||
{
|
||||
$this->table->name = $this->generateUniqe('name',$this->table->name);
|
||||
}
|
||||
|
||||
// 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->canDo = ComponentbuilderHelper::getActions('class_extends');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('class_extends.edit') && !$this->canDo->get('class_extends.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('class_extends.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('class_extends.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;
|
||||
}
|
||||
|
||||
// make sure the name is safe to be used as a class name
|
||||
$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
|
||||
|
||||
// Set the head string to base64 string.
|
||||
if (isset($data['head']))
|
||||
{
|
||||
$data['head'] = base64_encode($data['head']);
|
||||
}
|
||||
|
||||
// Set the comment string to base64 string.
|
||||
if (isset($data['comment']))
|
||||
{
|
||||
$data['comment'] = base64_encode($data['comment']);
|
||||
}
|
||||
|
||||
// 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
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
958
admin/models/class_method.php
Normal file
958
admin/models/class_method.php
Normal file
@ -0,0 +1,958 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
/**
|
||||
* Componentbuilder Class_method Model
|
||||
*/
|
||||
class ComponentbuilderModelClass_method extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tabLayoutFields = array(
|
||||
'details' => array(
|
||||
'left' => array(
|
||||
'name',
|
||||
'arguments',
|
||||
'visibility',
|
||||
'extension_type',
|
||||
'joomla_plugin_group'
|
||||
),
|
||||
'right' => array(
|
||||
'comment'
|
||||
),
|
||||
'fullwidth' => array(
|
||||
'code'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* @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.class_method';
|
||||
|
||||
/**
|
||||
* 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 = 'class_method', $prefix = 'ComponentbuilderTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables');
|
||||
// get instance of the table
|
||||
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) && !is_array($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->code))
|
||||
{
|
||||
// base64 Decode code.
|
||||
$item->code = base64_decode($item->code);
|
||||
}
|
||||
|
||||
if (!empty($item->comment))
|
||||
{
|
||||
// base64 Decode comment.
|
||||
$item->comment = base64_decode($item->comment);
|
||||
}
|
||||
|
||||
if (!empty($item->arguments))
|
||||
{
|
||||
// base64 Decode arguments.
|
||||
$item->arguments = base64_decode($item->arguments);
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
{
|
||||
$item->tags = new JHelperTags;
|
||||
$item->tags->getTagIds($item->id, 'com_componentbuilder.class_method');
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.class_method', 'class_method', $options);
|
||||
|
||||
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('class_method.edit.state', 'com_componentbuilder.class_method.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_method.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 ($id != 0 && (!$user->authorise('class_method.edit.created_by', 'com_componentbuilder.class_method.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_method.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 ($id != 0 && (!$user->authorise('class_method.edit.created', 'com_componentbuilder.class_method.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_method.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 view name
|
||||
$redirectedView = $jinput->get('ref', null, 'STRING');
|
||||
// Set field name (or fall back to view name)
|
||||
$redirectedField = $jinput->get('field', $redirectedView, 'STRING');
|
||||
// Set redirected view id
|
||||
$redirectedId = $jinput->get('refid', 0, 'INT');
|
||||
// Set field id (or fall back to redirected view id)
|
||||
$redirectedValue = $jinput->get('field_id', $redirectedId, 'INT');
|
||||
if (0 != $redirectedValue && $redirectedField)
|
||||
{
|
||||
// Now set the local-redirected field default value
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
// update all editors to use this components global editor
|
||||
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
|
||||
// now get all the editor fields
|
||||
$editors = $form->getXml()->xpath("//field[@type='editor']");
|
||||
// check if we found any
|
||||
if (ComponentbuilderHelper::checkArray($editors))
|
||||
{
|
||||
foreach ($editors as $editor)
|
||||
{
|
||||
// get the field names
|
||||
$name = (string) $editor['name'];
|
||||
// set the field editor value (with none as fallback)
|
||||
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
|
||||
}
|
||||
}
|
||||
|
||||
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/class_method.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('class_method.delete', 'com_componentbuilder.class_method.' . (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('class_method.edit.state', 'com_componentbuilder.class_method.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('class_method.edit.state', 'com_componentbuilder');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
$user = JFactory::getUser();
|
||||
|
||||
return $user->authorise('class_method.edit', 'com_componentbuilder.class_method.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('class_method.edit', 'com_componentbuilder');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_class_method'));
|
||||
$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.class_method.data', array());
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to validate the form data.
|
||||
*
|
||||
* @param JForm $form The form to validate against.
|
||||
* @param array $data The data to validate.
|
||||
* @param string $group The name of the field group to validate.
|
||||
*
|
||||
* @return mixed Array of filtered data if valid, false otherwise.
|
||||
*
|
||||
* @see JFormRule
|
||||
* @see JFilterInput
|
||||
* @since 12.2
|
||||
*/
|
||||
public function validate($form, $data, $group = null)
|
||||
{
|
||||
// check if the not_required field is set
|
||||
if (ComponentbuilderHelper::checkString($data['not_required']))
|
||||
{
|
||||
$requiredFields = (array) explode(',',(string) $data['not_required']);
|
||||
$requiredFields = array_unique($requiredFields);
|
||||
// now change the required field attributes value
|
||||
foreach ($requiredFields as $requiredField)
|
||||
{
|
||||
// make sure there is a string value
|
||||
if (ComponentbuilderHelper::checkString($requiredField))
|
||||
{
|
||||
// change to false
|
||||
$form->setFieldAttribute($requiredField, 'required', 'false');
|
||||
// also clear the data set
|
||||
$data[$requiredField] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
return parent::validate($form, $data, $group);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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('class_method');
|
||||
$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->canDo = ComponentbuilderHelper::getActions('class_method');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('class_method.create') && !$this->canDo->get('class_method.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('class_method.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('class_method.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;
|
||||
}
|
||||
}
|
||||
|
||||
// Only for strings
|
||||
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
|
||||
{
|
||||
$this->table->name = $this->generateUniqe('name',$this->table->name);
|
||||
}
|
||||
|
||||
// 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->canDo = ComponentbuilderHelper::getActions('class_method');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('class_method.edit') && !$this->canDo->get('class_method.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('class_method.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('class_method.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;
|
||||
}
|
||||
|
||||
// make sure the name is safe to be used as a function name
|
||||
$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
|
||||
|
||||
// Set the code string to base64 string.
|
||||
if (isset($data['code']))
|
||||
{
|
||||
$data['code'] = base64_encode($data['code']);
|
||||
}
|
||||
|
||||
// Set the comment string to base64 string.
|
||||
if (isset($data['comment']))
|
||||
{
|
||||
$data['comment'] = base64_encode($data['comment']);
|
||||
}
|
||||
|
||||
// Set the arguments string to base64 string.
|
||||
if (isset($data['arguments']))
|
||||
{
|
||||
$data['arguments'] = base64_encode($data['arguments']);
|
||||
}
|
||||
|
||||
// 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
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
431
admin/models/class_methods.php
Normal file
431
admin/models/class_methods.php
Normal file
@ -0,0 +1,431 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Class_methods Model
|
||||
*/
|
||||
class ComponentbuilderModelClass_methods 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',
|
||||
'a.name','name',
|
||||
'a.visibility','visibility',
|
||||
'a.extension_type','extension_type'
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
|
||||
$this->setState('filter.name', $name);
|
||||
|
||||
$visibility = $this->getUserStateFromRequest($this->context . '.filter.visibility', 'filter_visibility');
|
||||
$this->setState('filter.visibility', $visibility);
|
||||
|
||||
$extension_type = $this->getUserStateFromRequest($this->context . '.filter.extension_type', 'filter_extension_type');
|
||||
$this->setState('filter.extension_type', $extension_type);
|
||||
|
||||
$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();
|
||||
|
||||
// set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $item->id) && JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// set selection value to a translatable value
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// convert visibility
|
||||
$item->visibility = $this->selectionTranslation($item->visibility, 'visibility');
|
||||
// convert extension_type
|
||||
$item->extension_type = $this->selectionTranslation($item->extension_type, 'extension_type');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to convert selection values to translatable string.
|
||||
*
|
||||
* @return translatable string
|
||||
*/
|
||||
public function selectionTranslation($value,$name)
|
||||
{
|
||||
// Array of visibility language strings
|
||||
if ($name === 'visibility')
|
||||
{
|
||||
$visibilityArray = array(
|
||||
'public' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PUBLIC',
|
||||
'protected' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PROTECTED',
|
||||
'private' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($visibilityArray[$value]) && ComponentbuilderHelper::checkString($visibilityArray[$value]))
|
||||
{
|
||||
return $visibilityArray[$value];
|
||||
}
|
||||
}
|
||||
// Array of extension_type language strings
|
||||
if ($name === 'extension_type')
|
||||
{
|
||||
$extension_typeArray = array(
|
||||
0 => 'COM_COMPONENTBUILDER_CLASS_METHOD_SELECT_AN_OPTION',
|
||||
'components' => 'COM_COMPONENTBUILDER_CLASS_METHOD_COMPONENTS',
|
||||
'plugins' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PLUGINS',
|
||||
'modules' => 'COM_COMPONENTBUILDER_CLASS_METHOD_MODULES'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($extension_typeArray[$value]) && ComponentbuilderHelper::checkString($extension_typeArray[$value]))
|
||||
{
|
||||
return $extension_typeArray[$value];
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_class_method', 'a'));
|
||||
|
||||
// From the componentbuilder_joomla_plugin_group table.
|
||||
$query->select($db->quoteName('g.name','joomla_plugin_group_name'));
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_plugin_group', 'g') . ' ON (' . $db->quoteName('a.joomla_plugin_group') . ' = ' . $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)');
|
||||
}
|
||||
|
||||
// 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))
|
||||
{
|
||||
if (stripos($search, 'id:') === 0)
|
||||
{
|
||||
$query->where('a.id = ' . (int) substr($search, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.visibility LIKE '.$search.' OR a.extension_type LIKE '.$search.' OR a.comment LIKE '.$search.' OR a.arguments LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by Visibility.
|
||||
if ($visibility = $this->getState('filter.visibility'))
|
||||
{
|
||||
$query->where('a.visibility = ' . $db->quote($db->escape($visibility)));
|
||||
}
|
||||
// Filter by Extension_type.
|
||||
if ($extension_type = $this->getState('filter.extension_type'))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($extension_type)));
|
||||
}
|
||||
|
||||
// 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 list export data.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks)
|
||||
{
|
||||
// setup the query
|
||||
if (ComponentbuilderHelper::checkArray($pks))
|
||||
{
|
||||
// Set a value to know this is exporting method.
|
||||
$_export = true;
|
||||
// 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_class_method table
|
||||
$query->from($db->quoteName('#__componentbuilder_class_method', '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');
|
||||
|
||||
// Load the items
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $item->id) && JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// decode code
|
||||
$item->code = base64_decode($item->code);
|
||||
// decode comment
|
||||
$item->comment = base64_decode($item->comment);
|
||||
// decode arguments
|
||||
$item->arguments = base64_decode($item->arguments);
|
||||
// unset the values we don't want exported.
|
||||
unset($item->asset_id);
|
||||
unset($item->checked_out);
|
||||
unset($item->checked_out_time);
|
||||
}
|
||||
}
|
||||
// Add headers to items array.
|
||||
$headers = $this->getExImPortHeaders();
|
||||
if (ComponentbuilderHelper::checkObject($headers))
|
||||
{
|
||||
array_unshift($items,$headers);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get header.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExImPortHeaders()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// get the columns
|
||||
$columns = $db->getTableColumns("#__componentbuilder_class_method");
|
||||
if (ComponentbuilderHelper::checkArray($columns))
|
||||
{
|
||||
// remove the headers you don't import/export.
|
||||
unset($columns['asset_id']);
|
||||
unset($columns['checked_out']);
|
||||
unset($columns['checked_out_time']);
|
||||
$headers = new stdClass();
|
||||
foreach ($columns as $column => $type)
|
||||
{
|
||||
$headers->{$column} = $column;
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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');
|
||||
$id .= ':' . $this->getState('filter.name');
|
||||
$id .= ':' . $this->getState('filter.visibility');
|
||||
$id .= ':' . $this->getState('filter.extension_type');
|
||||
|
||||
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_class_method'));
|
||||
$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_class_method'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
429
admin/models/class_properties.php
Normal file
429
admin/models/class_properties.php
Normal file
@ -0,0 +1,429 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Class_properties Model
|
||||
*/
|
||||
class ComponentbuilderModelClass_properties 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',
|
||||
'a.name','name',
|
||||
'a.visibility','visibility',
|
||||
'a.extension_type','extension_type'
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
|
||||
$this->setState('filter.name', $name);
|
||||
|
||||
$visibility = $this->getUserStateFromRequest($this->context . '.filter.visibility', 'filter_visibility');
|
||||
$this->setState('filter.visibility', $visibility);
|
||||
|
||||
$extension_type = $this->getUserStateFromRequest($this->context . '.filter.extension_type', 'filter_extension_type');
|
||||
$this->setState('filter.extension_type', $extension_type);
|
||||
|
||||
$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();
|
||||
|
||||
// set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $item->id) && JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// set selection value to a translatable value
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// convert visibility
|
||||
$item->visibility = $this->selectionTranslation($item->visibility, 'visibility');
|
||||
// convert extension_type
|
||||
$item->extension_type = $this->selectionTranslation($item->extension_type, 'extension_type');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// return items
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to convert selection values to translatable string.
|
||||
*
|
||||
* @return translatable string
|
||||
*/
|
||||
public function selectionTranslation($value,$name)
|
||||
{
|
||||
// Array of visibility language strings
|
||||
if ($name === 'visibility')
|
||||
{
|
||||
$visibilityArray = array(
|
||||
'public' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLIC',
|
||||
'protected' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PROTECTED',
|
||||
'private' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($visibilityArray[$value]) && ComponentbuilderHelper::checkString($visibilityArray[$value]))
|
||||
{
|
||||
return $visibilityArray[$value];
|
||||
}
|
||||
}
|
||||
// Array of extension_type language strings
|
||||
if ($name === 'extension_type')
|
||||
{
|
||||
$extension_typeArray = array(
|
||||
0 => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_SELECT_AN_OPTION',
|
||||
'components' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_COMPONENTS',
|
||||
'plugins' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PLUGINS',
|
||||
'modules' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_MODULES'
|
||||
);
|
||||
// Now check if value is found in this array
|
||||
if (isset($extension_typeArray[$value]) && ComponentbuilderHelper::checkString($extension_typeArray[$value]))
|
||||
{
|
||||
return $extension_typeArray[$value];
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_class_property', 'a'));
|
||||
|
||||
// From the componentbuilder_joomla_plugin_group table.
|
||||
$query->select($db->quoteName('g.name','joomla_plugin_group_name'));
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_plugin_group', 'g') . ' ON (' . $db->quoteName('a.joomla_plugin_group') . ' = ' . $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)');
|
||||
}
|
||||
|
||||
// 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))
|
||||
{
|
||||
if (stripos($search, 'id:') === 0)
|
||||
{
|
||||
$query->where('a.id = ' . (int) substr($search, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.visibility LIKE '.$search.' OR a.extension_type LIKE '.$search.' OR a.comment LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by Visibility.
|
||||
if ($visibility = $this->getState('filter.visibility'))
|
||||
{
|
||||
$query->where('a.visibility = ' . $db->quote($db->escape($visibility)));
|
||||
}
|
||||
// Filter by Extension_type.
|
||||
if ($extension_type = $this->getState('filter.extension_type'))
|
||||
{
|
||||
$query->where('a.extension_type = ' . $db->quote($db->escape($extension_type)));
|
||||
}
|
||||
|
||||
// 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 list export data.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks)
|
||||
{
|
||||
// setup the query
|
||||
if (ComponentbuilderHelper::checkArray($pks))
|
||||
{
|
||||
// Set a value to know this is exporting method.
|
||||
$_export = true;
|
||||
// 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_class_property table
|
||||
$query->from($db->quoteName('#__componentbuilder_class_property', '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');
|
||||
|
||||
// Load the items
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $item->id) && JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// decode comment
|
||||
$item->comment = base64_decode($item->comment);
|
||||
// decode default
|
||||
$item->default = base64_decode($item->default);
|
||||
// unset the values we don't want exported.
|
||||
unset($item->asset_id);
|
||||
unset($item->checked_out);
|
||||
unset($item->checked_out_time);
|
||||
}
|
||||
}
|
||||
// Add headers to items array.
|
||||
$headers = $this->getExImPortHeaders();
|
||||
if (ComponentbuilderHelper::checkObject($headers))
|
||||
{
|
||||
array_unshift($items,$headers);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get header.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExImPortHeaders()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// get the columns
|
||||
$columns = $db->getTableColumns("#__componentbuilder_class_property");
|
||||
if (ComponentbuilderHelper::checkArray($columns))
|
||||
{
|
||||
// remove the headers you don't import/export.
|
||||
unset($columns['asset_id']);
|
||||
unset($columns['checked_out']);
|
||||
unset($columns['checked_out_time']);
|
||||
$headers = new stdClass();
|
||||
foreach ($columns as $column => $type)
|
||||
{
|
||||
$headers->{$column} = $column;
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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');
|
||||
$id .= ':' . $this->getState('filter.name');
|
||||
$id .= ':' . $this->getState('filter.visibility');
|
||||
$id .= ':' . $this->getState('filter.extension_type');
|
||||
|
||||
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_class_property'));
|
||||
$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_class_property'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
943
admin/models/class_property.php
Normal file
943
admin/models/class_property.php
Normal file
@ -0,0 +1,943 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
/**
|
||||
* Componentbuilder Class_property Model
|
||||
*/
|
||||
class ComponentbuilderModelClass_property extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tabLayoutFields = array(
|
||||
'details' => array(
|
||||
'left' => array(
|
||||
'name',
|
||||
'visibility',
|
||||
'default',
|
||||
'extension_type',
|
||||
'joomla_plugin_group'
|
||||
),
|
||||
'right' => array(
|
||||
'comment'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* @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.class_property';
|
||||
|
||||
/**
|
||||
* 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 = 'class_property', $prefix = 'ComponentbuilderTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables');
|
||||
// get instance of the table
|
||||
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) && !is_array($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->comment))
|
||||
{
|
||||
// base64 Decode comment.
|
||||
$item->comment = base64_decode($item->comment);
|
||||
}
|
||||
|
||||
if (!empty($item->default))
|
||||
{
|
||||
// base64 Decode default.
|
||||
$item->default = base64_decode($item->default);
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
{
|
||||
$item->tags = new JHelperTags;
|
||||
$item->tags->getTagIds($item->id, 'com_componentbuilder.class_property');
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.class_property', 'class_property', $options);
|
||||
|
||||
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('class_property.edit.state', 'com_componentbuilder.class_property.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_property.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 ($id != 0 && (!$user->authorise('class_property.edit.created_by', 'com_componentbuilder.class_property.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_property.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 ($id != 0 && (!$user->authorise('class_property.edit.created', 'com_componentbuilder.class_property.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('class_property.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 view name
|
||||
$redirectedView = $jinput->get('ref', null, 'STRING');
|
||||
// Set field name (or fall back to view name)
|
||||
$redirectedField = $jinput->get('field', $redirectedView, 'STRING');
|
||||
// Set redirected view id
|
||||
$redirectedId = $jinput->get('refid', 0, 'INT');
|
||||
// Set field id (or fall back to redirected view id)
|
||||
$redirectedValue = $jinput->get('field_id', $redirectedId, 'INT');
|
||||
if (0 != $redirectedValue && $redirectedField)
|
||||
{
|
||||
// Now set the local-redirected field default value
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
// update all editors to use this components global editor
|
||||
$global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none');
|
||||
// now get all the editor fields
|
||||
$editors = $form->getXml()->xpath("//field[@type='editor']");
|
||||
// check if we found any
|
||||
if (ComponentbuilderHelper::checkArray($editors))
|
||||
{
|
||||
foreach ($editors as $editor)
|
||||
{
|
||||
// get the field names
|
||||
$name = (string) $editor['name'];
|
||||
// set the field editor value (with none as fallback)
|
||||
$form->setFieldAttribute($name, 'editor', $global_editor . '|none');
|
||||
}
|
||||
}
|
||||
|
||||
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/class_property.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('class_property.delete', 'com_componentbuilder.class_property.' . (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('class_property.edit.state', 'com_componentbuilder.class_property.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('class_property.edit.state', 'com_componentbuilder');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
$user = JFactory::getUser();
|
||||
|
||||
return $user->authorise('class_property.edit', 'com_componentbuilder.class_property.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('class_property.edit', 'com_componentbuilder');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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_class_property'));
|
||||
$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.class_property.data', array());
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to validate the form data.
|
||||
*
|
||||
* @param JForm $form The form to validate against.
|
||||
* @param array $data The data to validate.
|
||||
* @param string $group The name of the field group to validate.
|
||||
*
|
||||
* @return mixed Array of filtered data if valid, false otherwise.
|
||||
*
|
||||
* @see JFormRule
|
||||
* @see JFilterInput
|
||||
* @since 12.2
|
||||
*/
|
||||
public function validate($form, $data, $group = null)
|
||||
{
|
||||
// check if the not_required field is set
|
||||
if (ComponentbuilderHelper::checkString($data['not_required']))
|
||||
{
|
||||
$requiredFields = (array) explode(',',(string) $data['not_required']);
|
||||
$requiredFields = array_unique($requiredFields);
|
||||
// now change the required field attributes value
|
||||
foreach ($requiredFields as $requiredField)
|
||||
{
|
||||
// make sure there is a string value
|
||||
if (ComponentbuilderHelper::checkString($requiredField))
|
||||
{
|
||||
// change to false
|
||||
$form->setFieldAttribute($requiredField, 'required', 'false');
|
||||
// also clear the data set
|
||||
$data[$requiredField] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
return parent::validate($form, $data, $group);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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('class_property');
|
||||
$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->canDo = ComponentbuilderHelper::getActions('class_property');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('class_property.create') && !$this->canDo->get('class_property.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('class_property.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('class_property.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;
|
||||
}
|
||||
}
|
||||
|
||||
// Only for strings
|
||||
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
|
||||
{
|
||||
$this->table->name = $this->generateUniqe('name',$this->table->name);
|
||||
}
|
||||
|
||||
// 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->canDo = ComponentbuilderHelper::getActions('class_property');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('class_property.edit') && !$this->canDo->get('class_property.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('class_property.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('class_property.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;
|
||||
}
|
||||
|
||||
// make sure the name is safe to be used as a function name
|
||||
$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
|
||||
|
||||
// Set the comment string to base64 string.
|
||||
if (isset($data['comment']))
|
||||
{
|
||||
$data['comment'] = base64_encode($data['comment']);
|
||||
}
|
||||
|
||||
// Set the default string to base64 string.
|
||||
if (isset($data['default']))
|
||||
{
|
||||
$data['default'] = base64_encode($data['default']);
|
||||
}
|
||||
|
||||
// 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
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
@ -27,6 +27,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
|
||||
protected $tabLayoutFields = array(
|
||||
'dashboard' => array(
|
||||
'fullwidth' => array(
|
||||
'note_php_dashboard_note',
|
||||
'php_dashboard_methods',
|
||||
'dashboard_tab'
|
||||
),
|
||||
|
@ -25,7 +25,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
$icons = array();
|
||||
// view groups array
|
||||
$viewGroups = array(
|
||||
'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png||importjcbpackages||index.php?option=com_componentbuilder&view=joomla_components&task=joomla_components.smartImport', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.get_snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.servers', 'png.help_documents')
|
||||
'main' => array('png.compiler', 'png.joomla_components', 'png.joomla_plugins', 'png.admin_view.add', 'png.admin_views', 'png||importjcbpackages||index.php?option=com_componentbuilder&view=joomla_components&task=joomla_components.smartImport', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.get_snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.servers', 'png.help_documents')
|
||||
);
|
||||
// view access array
|
||||
$viewAccess = array(
|
||||
@ -38,7 +38,11 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
'joomla_component.access' => 'joomla_component.access',
|
||||
'joomla_components.submenu' => 'joomla_component.submenu',
|
||||
'joomla_components.dashboard_list' => 'joomla_component.dashboard_list',
|
||||
'joomla_component.dashboard_add' => 'joomla_component.dashboard_add',
|
||||
'joomla_plugin.create' => 'joomla_plugin.create',
|
||||
'joomla_plugins.access' => 'joomla_plugin.access',
|
||||
'joomla_plugin.access' => 'joomla_plugin.access',
|
||||
'joomla_plugins.submenu' => 'joomla_plugin.submenu',
|
||||
'joomla_plugins.dashboard_list' => 'joomla_plugin.dashboard_list',
|
||||
'admin_view.create' => 'admin_view.create',
|
||||
'admin_views.access' => 'admin_view.access',
|
||||
'admin_view.access' => 'admin_view.access',
|
||||
@ -76,6 +80,12 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
'custom_code.access' => 'custom_code.access',
|
||||
'custom_codes.submenu' => 'custom_code.submenu',
|
||||
'custom_codes.dashboard_list' => 'custom_code.dashboard_list',
|
||||
'class_property.create' => 'class_property.create',
|
||||
'class_properties.access' => 'class_property.access',
|
||||
'class_property.access' => 'class_property.access',
|
||||
'class_method.create' => 'class_method.create',
|
||||
'class_methods.access' => 'class_method.access',
|
||||
'class_method.access' => 'class_method.access',
|
||||
'placeholder.create' => 'placeholder.create',
|
||||
'placeholders.access' => 'placeholder.access',
|
||||
'placeholder.access' => 'placeholder.access',
|
||||
@ -175,7 +185,12 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
'library_config.access' => 'library_config.access',
|
||||
'library_files_folders_urls.create' => 'library_files_folders_urls.create',
|
||||
'libraries_files_folders_urls.access' => 'library_files_folders_urls.access',
|
||||
'library_files_folders_urls.access' => 'library_files_folders_urls.access');
|
||||
'library_files_folders_urls.access' => 'library_files_folders_urls.access',
|
||||
'class_extends.create' => 'class_extends.create',
|
||||
'class_extendings.access' => 'class_extends.access',
|
||||
'class_extends.access' => 'class_extends.access',
|
||||
'joomla_plugin_groups.access' => 'joomla_plugin_group.access',
|
||||
'joomla_plugin_group.access' => 'joomla_plugin_group.access');
|
||||
// loop over the $views
|
||||
foreach($viewGroups as $group => $views)
|
||||
{
|
||||
|
174
admin/models/fields/classextends.php
Normal file
174
admin/models/fields/classextends.php
Normal file
@ -0,0 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Classextends Form Field class for the Componentbuilder component
|
||||
*/
|
||||
class JFormFieldClassextends extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The classextends field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'classextends';
|
||||
|
||||
/**
|
||||
* Override to add new button
|
||||
*
|
||||
* @return string The field input markup.
|
||||
*
|
||||
* @since 3.2
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
// see if we should add buttons
|
||||
$set_button = $this->getAttribute('button');
|
||||
// get html
|
||||
$html = parent::getInput();
|
||||
// if true set button
|
||||
if ($set_button === 'true')
|
||||
{
|
||||
$button = array();
|
||||
$script = array();
|
||||
$button_code_name = $this->getAttribute('name');
|
||||
// get the input from url
|
||||
$app = JFactory::getApplication();
|
||||
$jinput = $app->input;
|
||||
// get the view name & id
|
||||
$values = $jinput->getArray(array(
|
||||
'id' => 'int',
|
||||
'view' => 'word'
|
||||
));
|
||||
// check if new item
|
||||
$ref = '';
|
||||
$refJ = '';
|
||||
if (!is_null($values['id']) && strlen($values['view']))
|
||||
{
|
||||
// only load referral if not new item.
|
||||
$ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
|
||||
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
|
||||
// get the return value.
|
||||
$_uri = (string) JUri::getInstance();
|
||||
$_return = urlencode(base64_encode($_uri));
|
||||
// load return value.
|
||||
$ref .= '&return=' . $_return;
|
||||
$refJ .= '&return=' . $_return;
|
||||
}
|
||||
// get button label
|
||||
$button_label = trim($button_code_name);
|
||||
$button_label = preg_replace('/_+/', ' ', $button_label);
|
||||
$button_label = preg_replace('/\s+/', ' ', $button_label);
|
||||
$button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
|
||||
$button_label = ucfirst(strtolower($button_label));
|
||||
// get user object
|
||||
$user = JFactory::getUser();
|
||||
// only add if user allowed to create class_extends
|
||||
if ($user->authorise('class_extends.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
|
||||
{
|
||||
// build Create button
|
||||
$button[] = '<a id="'.$button_code_name.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_COMPONENTBUILDER_CREATE_NEW_S', $button_label).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
|
||||
href="index.php?option=com_componentbuilder&view=class_extends&layout=edit'.$ref.'" >
|
||||
<span class="icon-new icon-white"></span></a>';
|
||||
}
|
||||
// only add if user allowed to edit class_extends
|
||||
if ($user->authorise('class_extends.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
|
||||
{
|
||||
// build edit button
|
||||
$button[] = '<a id="'.$button_code_name.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_COMPONENTBUILDER_EDIT_S', $button_label).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
|
||||
<span class="icon-edit"></span></a>';
|
||||
// build script
|
||||
$script[] = "
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
|
||||
e.preventDefault();
|
||||
var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
|
||||
".$button_code_name."Button(".$button_code_name."Value);
|
||||
});
|
||||
var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
|
||||
".$button_code_name."Button(".$button_code_name."Value);
|
||||
});
|
||||
function ".$button_code_name."Button(value) {
|
||||
if (value > 0) {
|
||||
// hide the create button
|
||||
jQuery('#".$button_code_name."Create').hide();
|
||||
// show edit button
|
||||
jQuery('#".$button_code_name."Edit').show();
|
||||
var url = 'index.php?option=com_componentbuilder&view=class_extendings&task=class_extends.edit&id='+value+'".$refJ."';
|
||||
jQuery('#".$button_code_name."Edit').attr('href', url);
|
||||
} else {
|
||||
// show the create button
|
||||
jQuery('#".$button_code_name."Create').show();
|
||||
// hide edit button
|
||||
jQuery('#".$button_code_name."Edit').hide();
|
||||
}
|
||||
}";
|
||||
}
|
||||
// check if button was created for class_extends field.
|
||||
if (is_array($button) && count($button) > 0)
|
||||
{
|
||||
// Load the needed script.
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration(implode(' ',$script));
|
||||
// return the button attached to input field.
|
||||
return '<div class="input-append">' .$html . implode('',$button).'</div>';
|
||||
}
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
// Get the databse object.
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.name'),array('id','class_extends_name')));
|
||||
$query->from($db->quoteName('#__componentbuilder_class_extends', 'a'));
|
||||
$query->where($db->quoteName('a.published') . ' >= 1');
|
||||
$query->order('a.name ASC');
|
||||
// Implement View Level Access (if set in table)
|
||||
if (!$user->authorise('core.options', 'com_componentbuilder'))
|
||||
{
|
||||
$columns = $db->getTableColumns('#__componentbuilder_class_extends');
|
||||
if(isset($columns['access']))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
}
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', '', 'Select a class');
|
||||
foreach($items as $item)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $item->id, $item->class_extends_name);
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
174
admin/models/fields/joomlaplugingroups.php
Normal file
174
admin/models/fields/joomlaplugingroups.php
Normal file
@ -0,0 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Joomlaplugingroups Form Field class for the Componentbuilder component
|
||||
*/
|
||||
class JFormFieldJoomlaplugingroups extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The joomlaplugingroups field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'joomlaplugingroups';
|
||||
|
||||
/**
|
||||
* Override to add new button
|
||||
*
|
||||
* @return string The field input markup.
|
||||
*
|
||||
* @since 3.2
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
// see if we should add buttons
|
||||
$set_button = $this->getAttribute('button');
|
||||
// get html
|
||||
$html = parent::getInput();
|
||||
// if true set button
|
||||
if ($set_button === 'true')
|
||||
{
|
||||
$button = array();
|
||||
$script = array();
|
||||
$button_code_name = $this->getAttribute('name');
|
||||
// get the input from url
|
||||
$app = JFactory::getApplication();
|
||||
$jinput = $app->input;
|
||||
// get the view name & id
|
||||
$values = $jinput->getArray(array(
|
||||
'id' => 'int',
|
||||
'view' => 'word'
|
||||
));
|
||||
// check if new item
|
||||
$ref = '';
|
||||
$refJ = '';
|
||||
if (!is_null($values['id']) && strlen($values['view']))
|
||||
{
|
||||
// only load referral if not new item.
|
||||
$ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
|
||||
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
|
||||
// get the return value.
|
||||
$_uri = (string) JUri::getInstance();
|
||||
$_return = urlencode(base64_encode($_uri));
|
||||
// load return value.
|
||||
$ref .= '&return=' . $_return;
|
||||
$refJ .= '&return=' . $_return;
|
||||
}
|
||||
// get button label
|
||||
$button_label = trim($button_code_name);
|
||||
$button_label = preg_replace('/_+/', ' ', $button_label);
|
||||
$button_label = preg_replace('/\s+/', ' ', $button_label);
|
||||
$button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
|
||||
$button_label = ucfirst(strtolower($button_label));
|
||||
// get user object
|
||||
$user = JFactory::getUser();
|
||||
// only add if user allowed to create joomla_plugin_group
|
||||
if ($user->authorise('core.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
|
||||
{
|
||||
// build Create button
|
||||
$button[] = '<a id="'.$button_code_name.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_COMPONENTBUILDER_CREATE_NEW_S', $button_label).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
|
||||
href="index.php?option=com_componentbuilder&view=joomla_plugin_group&layout=edit'.$ref.'" >
|
||||
<span class="icon-new icon-white"></span></a>';
|
||||
}
|
||||
// only add if user allowed to edit joomla_plugin_group
|
||||
if ($user->authorise('core.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
|
||||
{
|
||||
// build edit button
|
||||
$button[] = '<a id="'.$button_code_name.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_COMPONENTBUILDER_EDIT_S', $button_label).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
|
||||
<span class="icon-edit"></span></a>';
|
||||
// build script
|
||||
$script[] = "
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
|
||||
e.preventDefault();
|
||||
var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
|
||||
".$button_code_name."Button(".$button_code_name."Value);
|
||||
});
|
||||
var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
|
||||
".$button_code_name."Button(".$button_code_name."Value);
|
||||
});
|
||||
function ".$button_code_name."Button(value) {
|
||||
if (value > 0) {
|
||||
// hide the create button
|
||||
jQuery('#".$button_code_name."Create').hide();
|
||||
// show edit button
|
||||
jQuery('#".$button_code_name."Edit').show();
|
||||
var url = 'index.php?option=com_componentbuilder&view=joomla_plugin_groups&task=joomla_plugin_group.edit&id='+value+'".$refJ."';
|
||||
jQuery('#".$button_code_name."Edit').attr('href', url);
|
||||
} else {
|
||||
// show the create button
|
||||
jQuery('#".$button_code_name."Create').show();
|
||||
// hide edit button
|
||||
jQuery('#".$button_code_name."Edit').hide();
|
||||
}
|
||||
}";
|
||||
}
|
||||
// check if button was created for joomla_plugin_group field.
|
||||
if (is_array($button) && count($button) > 0)
|
||||
{
|
||||
// Load the needed script.
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration(implode(' ',$script));
|
||||
// return the button attached to input field.
|
||||
return '<div class="input-append">' .$html . implode('',$button).'</div>';
|
||||
}
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
// Get the databse object.
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.name'),array('id','joomla_plugin_group_name')));
|
||||
$query->from($db->quoteName('#__componentbuilder_joomla_plugin_group', 'a'));
|
||||
$query->where($db->quoteName('a.published') . ' >= 1');
|
||||
$query->order('a.name ASC');
|
||||
// Implement View Level Access (if set in table)
|
||||
if (!$user->authorise('core.options', 'com_componentbuilder'))
|
||||
{
|
||||
$columns = $db->getTableColumns('#__componentbuilder_joomla_plugin_group');
|
||||
if(isset($columns['access']))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
}
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', '', 'Select a group');
|
||||
foreach($items as $item)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $item->id, $item->joomla_plugin_group_name);
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
81
admin/models/fields/pluginsclassmethods.php
Normal file
81
admin/models/fields/pluginsclassmethods.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Pluginsclassmethods Form Field class for the Componentbuilder component
|
||||
*/
|
||||
class JFormFieldPluginsclassmethods extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The pluginsclassmethods field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'pluginsclassmethods';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
// Get the databse object.
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.name','a.visibility'),array('id','method_name','visibility')));
|
||||
$query->from($db->quoteName('#__componentbuilder_class_method', 'a'));
|
||||
$query->where($db->quoteName('a.published') . ' >= 1');
|
||||
$query->where($db->quoteName('a.extension_type') . ' = ' . $db->quote('plugins'));
|
||||
$query->order('a.name ASC');
|
||||
// Implement View Level Access (if set in table)
|
||||
if (!$user->authorise('core.options', 'com_componentbuilder'))
|
||||
{
|
||||
$columns = $db->getTableColumns('#__componentbuilder_class_method');
|
||||
if(isset($columns['access']))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
}
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', '', 'Select a method');
|
||||
foreach($items as $item)
|
||||
{
|
||||
// we are using this code in more then one field JCB custom_code
|
||||
if ('method' === 'method')
|
||||
{
|
||||
$select = $item->visibility . ' function ' . $item->method_name . '()';
|
||||
}
|
||||
else
|
||||
{
|
||||
$select = $item->visibility . ' $' . $item->method_name;
|
||||
}
|
||||
$options[] = JHtml::_('select.option', $item->id, $select);
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
81
admin/models/fields/pluginsclassproperties.php
Normal file
81
admin/models/fields/pluginsclassproperties.php
Normal file
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import the list field type
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Pluginsclassproperties Form Field class for the Componentbuilder component
|
||||
*/
|
||||
class JFormFieldPluginsclassproperties extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The pluginsclassproperties field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'pluginsclassproperties';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
*
|
||||
* @return array An array of JHtml options.
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
// Get the databse object.
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.name','a.visibility'),array('id','property_name','visibility')));
|
||||
$query->from($db->quoteName('#__componentbuilder_class_property', 'a'));
|
||||
$query->where($db->quoteName('a.published') . ' >= 1');
|
||||
$query->where($db->quoteName('a.extension_type') . ' = ' . $db->quote('plugins'));
|
||||
$query->order('a.name ASC');
|
||||
// Implement View Level Access (if set in table)
|
||||
if (!$user->authorise('core.options', 'com_componentbuilder'))
|
||||
{
|
||||
$columns = $db->getTableColumns('#__componentbuilder_class_property');
|
||||
if(isset($columns['access']))
|
||||
{
|
||||
$groups = implode(',', $user->getAuthorisedViewLevels());
|
||||
$query->where('a.access IN (' . $groups . ')');
|
||||
}
|
||||
}
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', '', 'Select a property');
|
||||
foreach($items as $item)
|
||||
{
|
||||
// we are using this code in more then one field JCB custom_code
|
||||
if ('method' === 'property')
|
||||
{
|
||||
$select = $item->visibility . ' function ' . $item->property_name . '()';
|
||||
}
|
||||
else
|
||||
{
|
||||
$select = $item->visibility . ' $' . $item->property_name;
|
||||
}
|
||||
$options[] = JHtml::_('select.option', $item->id, $select);
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
@ -203,7 +203,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getVxqfields()
|
||||
public function getVxsfields()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
@ -285,13 +285,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
// convert datatype
|
||||
$item->datatype = $this->selectionTranslationVxqfields($item->datatype, 'datatype');
|
||||
$item->datatype = $this->selectionTranslationVxsfields($item->datatype, 'datatype');
|
||||
// convert indexes
|
||||
$item->indexes = $this->selectionTranslationVxqfields($item->indexes, 'indexes');
|
||||
$item->indexes = $this->selectionTranslationVxsfields($item->indexes, 'indexes');
|
||||
// convert null_switch
|
||||
$item->null_switch = $this->selectionTranslationVxqfields($item->null_switch, 'null_switch');
|
||||
$item->null_switch = $this->selectionTranslationVxsfields($item->null_switch, 'null_switch');
|
||||
// convert store
|
||||
$item->store = $this->selectionTranslationVxqfields($item->store, 'store');
|
||||
$item->store = $this->selectionTranslationVxsfields($item->store, 'store');
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,7 +305,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
*
|
||||
* @return translatable string
|
||||
*/
|
||||
public function selectionTranslationVxqfields($value,$name)
|
||||
public function selectionTranslationVxsfields($value,$name)
|
||||
{
|
||||
// Array of datatype language strings
|
||||
if ($name === 'datatype')
|
||||
|
@ -9,123 +9,123 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvvybvwd_required = false;
|
||||
jform_vvvvvycvwe_required = false;
|
||||
jform_vvvvvygvwf_required = false;
|
||||
jform_vvvvvygvwg_required = false;
|
||||
jform_vvvvvygvwh_required = false;
|
||||
jform_vvvvvygvwi_required = false;
|
||||
jform_vvvvvygvwj_required = false;
|
||||
jform_vvvvvygvwk_required = false;
|
||||
jform_vvvvvygvwl_required = false;
|
||||
jform_vvvvvydvwd_required = false;
|
||||
jform_vvvvvyevwe_required = false;
|
||||
jform_vvvvvyivwf_required = false;
|
||||
jform_vvvvvyivwg_required = false;
|
||||
jform_vvvvvyivwh_required = false;
|
||||
jform_vvvvvyivwi_required = false;
|
||||
jform_vvvvvyivwj_required = false;
|
||||
jform_vvvvvyivwk_required = false;
|
||||
jform_vvvvvyivwl_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var add_css_view_vvvvvxb = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
||||
vvvvvxb(add_css_view_vvvvvxb);
|
||||
var add_css_view_vvvvvxd = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
||||
vvvvvxd(add_css_view_vvvvvxd);
|
||||
|
||||
var add_css_views_vvvvvxc = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
||||
vvvvvxc(add_css_views_vvvvvxc);
|
||||
var add_css_views_vvvvvxe = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
||||
vvvvvxe(add_css_views_vvvvvxe);
|
||||
|
||||
var add_javascript_view_file_vvvvvxd = jQuery("#jform_add_javascript_view_file input[type='radio']:checked").val();
|
||||
vvvvvxd(add_javascript_view_file_vvvvvxd);
|
||||
var add_javascript_view_file_vvvvvxf = jQuery("#jform_add_javascript_view_file input[type='radio']:checked").val();
|
||||
vvvvvxf(add_javascript_view_file_vvvvvxf);
|
||||
|
||||
var add_javascript_views_file_vvvvvxe = jQuery("#jform_add_javascript_views_file input[type='radio']:checked").val();
|
||||
vvvvvxe(add_javascript_views_file_vvvvvxe);
|
||||
var add_javascript_views_file_vvvvvxg = jQuery("#jform_add_javascript_views_file input[type='radio']:checked").val();
|
||||
vvvvvxg(add_javascript_views_file_vvvvvxg);
|
||||
|
||||
var add_javascript_view_footer_vvvvvxf = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
|
||||
vvvvvxf(add_javascript_view_footer_vvvvvxf);
|
||||
var add_javascript_view_footer_vvvvvxh = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
|
||||
vvvvvxh(add_javascript_view_footer_vvvvvxh);
|
||||
|
||||
var add_javascript_views_footer_vvvvvxg = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
|
||||
vvvvvxg(add_javascript_views_footer_vvvvvxg);
|
||||
var add_javascript_views_footer_vvvvvxi = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
|
||||
vvvvvxi(add_javascript_views_footer_vvvvvxi);
|
||||
|
||||
var add_php_ajax_vvvvvxh = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvxh(add_php_ajax_vvvvvxh);
|
||||
var add_php_ajax_vvvvvxj = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvxj(add_php_ajax_vvvvvxj);
|
||||
|
||||
var add_php_getitem_vvvvvxi = jQuery("#jform_add_php_getitem input[type='radio']:checked").val();
|
||||
vvvvvxi(add_php_getitem_vvvvvxi);
|
||||
var add_php_getitem_vvvvvxk = jQuery("#jform_add_php_getitem input[type='radio']:checked").val();
|
||||
vvvvvxk(add_php_getitem_vvvvvxk);
|
||||
|
||||
var add_php_getitems_vvvvvxj = jQuery("#jform_add_php_getitems input[type='radio']:checked").val();
|
||||
vvvvvxj(add_php_getitems_vvvvvxj);
|
||||
var add_php_getitems_vvvvvxl = jQuery("#jform_add_php_getitems input[type='radio']:checked").val();
|
||||
vvvvvxl(add_php_getitems_vvvvvxl);
|
||||
|
||||
var add_php_getitems_after_all_vvvvvxk = jQuery("#jform_add_php_getitems_after_all input[type='radio']:checked").val();
|
||||
vvvvvxk(add_php_getitems_after_all_vvvvvxk);
|
||||
var add_php_getitems_after_all_vvvvvxm = jQuery("#jform_add_php_getitems_after_all input[type='radio']:checked").val();
|
||||
vvvvvxm(add_php_getitems_after_all_vvvvvxm);
|
||||
|
||||
var add_php_getlistquery_vvvvvxl = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val();
|
||||
vvvvvxl(add_php_getlistquery_vvvvvxl);
|
||||
var add_php_getlistquery_vvvvvxn = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val();
|
||||
vvvvvxn(add_php_getlistquery_vvvvvxn);
|
||||
|
||||
var add_php_getform_vvvvvxm = jQuery("#jform_add_php_getform input[type='radio']:checked").val();
|
||||
vvvvvxm(add_php_getform_vvvvvxm);
|
||||
var add_php_getform_vvvvvxo = jQuery("#jform_add_php_getform input[type='radio']:checked").val();
|
||||
vvvvvxo(add_php_getform_vvvvvxo);
|
||||
|
||||
var add_php_before_save_vvvvvxn = jQuery("#jform_add_php_before_save input[type='radio']:checked").val();
|
||||
vvvvvxn(add_php_before_save_vvvvvxn);
|
||||
var add_php_before_save_vvvvvxp = jQuery("#jform_add_php_before_save input[type='radio']:checked").val();
|
||||
vvvvvxp(add_php_before_save_vvvvvxp);
|
||||
|
||||
var add_php_save_vvvvvxo = jQuery("#jform_add_php_save input[type='radio']:checked").val();
|
||||
vvvvvxo(add_php_save_vvvvvxo);
|
||||
var add_php_save_vvvvvxq = jQuery("#jform_add_php_save input[type='radio']:checked").val();
|
||||
vvvvvxq(add_php_save_vvvvvxq);
|
||||
|
||||
var add_php_postsavehook_vvvvvxp = jQuery("#jform_add_php_postsavehook input[type='radio']:checked").val();
|
||||
vvvvvxp(add_php_postsavehook_vvvvvxp);
|
||||
var add_php_postsavehook_vvvvvxr = jQuery("#jform_add_php_postsavehook input[type='radio']:checked").val();
|
||||
vvvvvxr(add_php_postsavehook_vvvvvxr);
|
||||
|
||||
var add_php_allowadd_vvvvvxq = jQuery("#jform_add_php_allowadd input[type='radio']:checked").val();
|
||||
vvvvvxq(add_php_allowadd_vvvvvxq);
|
||||
var add_php_allowadd_vvvvvxs = jQuery("#jform_add_php_allowadd input[type='radio']:checked").val();
|
||||
vvvvvxs(add_php_allowadd_vvvvvxs);
|
||||
|
||||
var add_php_allowedit_vvvvvxr = jQuery("#jform_add_php_allowedit input[type='radio']:checked").val();
|
||||
vvvvvxr(add_php_allowedit_vvvvvxr);
|
||||
var add_php_allowedit_vvvvvxt = jQuery("#jform_add_php_allowedit input[type='radio']:checked").val();
|
||||
vvvvvxt(add_php_allowedit_vvvvvxt);
|
||||
|
||||
var add_php_before_cancel_vvvvvxs = jQuery("#jform_add_php_before_cancel input[type='radio']:checked").val();
|
||||
vvvvvxs(add_php_before_cancel_vvvvvxs);
|
||||
var add_php_before_cancel_vvvvvxu = jQuery("#jform_add_php_before_cancel input[type='radio']:checked").val();
|
||||
vvvvvxu(add_php_before_cancel_vvvvvxu);
|
||||
|
||||
var add_php_after_cancel_vvvvvxt = jQuery("#jform_add_php_after_cancel input[type='radio']:checked").val();
|
||||
vvvvvxt(add_php_after_cancel_vvvvvxt);
|
||||
var add_php_after_cancel_vvvvvxv = jQuery("#jform_add_php_after_cancel input[type='radio']:checked").val();
|
||||
vvvvvxv(add_php_after_cancel_vvvvvxv);
|
||||
|
||||
var add_php_batchcopy_vvvvvxu = jQuery("#jform_add_php_batchcopy input[type='radio']:checked").val();
|
||||
vvvvvxu(add_php_batchcopy_vvvvvxu);
|
||||
var add_php_batchcopy_vvvvvxw = jQuery("#jform_add_php_batchcopy input[type='radio']:checked").val();
|
||||
vvvvvxw(add_php_batchcopy_vvvvvxw);
|
||||
|
||||
var add_php_batchmove_vvvvvxv = jQuery("#jform_add_php_batchmove input[type='radio']:checked").val();
|
||||
vvvvvxv(add_php_batchmove_vvvvvxv);
|
||||
var add_php_batchmove_vvvvvxx = jQuery("#jform_add_php_batchmove input[type='radio']:checked").val();
|
||||
vvvvvxx(add_php_batchmove_vvvvvxx);
|
||||
|
||||
var add_php_before_publish_vvvvvxw = jQuery("#jform_add_php_before_publish input[type='radio']:checked").val();
|
||||
vvvvvxw(add_php_before_publish_vvvvvxw);
|
||||
var add_php_before_publish_vvvvvxy = jQuery("#jform_add_php_before_publish input[type='radio']:checked").val();
|
||||
vvvvvxy(add_php_before_publish_vvvvvxy);
|
||||
|
||||
var add_php_after_publish_vvvvvxx = jQuery("#jform_add_php_after_publish input[type='radio']:checked").val();
|
||||
vvvvvxx(add_php_after_publish_vvvvvxx);
|
||||
var add_php_after_publish_vvvvvxz = jQuery("#jform_add_php_after_publish input[type='radio']:checked").val();
|
||||
vvvvvxz(add_php_after_publish_vvvvvxz);
|
||||
|
||||
var add_php_before_delete_vvvvvxy = jQuery("#jform_add_php_before_delete input[type='radio']:checked").val();
|
||||
vvvvvxy(add_php_before_delete_vvvvvxy);
|
||||
var add_php_before_delete_vvvvvya = jQuery("#jform_add_php_before_delete input[type='radio']:checked").val();
|
||||
vvvvvya(add_php_before_delete_vvvvvya);
|
||||
|
||||
var add_php_after_delete_vvvvvxz = jQuery("#jform_add_php_after_delete input[type='radio']:checked").val();
|
||||
vvvvvxz(add_php_after_delete_vvvvvxz);
|
||||
var add_php_after_delete_vvvvvyb = jQuery("#jform_add_php_after_delete input[type='radio']:checked").val();
|
||||
vvvvvyb(add_php_after_delete_vvvvvyb);
|
||||
|
||||
var add_php_document_vvvvvya = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvya(add_php_document_vvvvvya);
|
||||
var add_php_document_vvvvvyc = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvyc(add_php_document_vvvvvyc);
|
||||
|
||||
var add_sql_vvvvvyb = jQuery("#jform_add_sql input[type='radio']:checked").val();
|
||||
vvvvvyb(add_sql_vvvvvyb);
|
||||
|
||||
var source_vvvvvyc = jQuery("#jform_source input[type='radio']:checked").val();
|
||||
var add_sql_vvvvvyc = jQuery("#jform_add_sql input[type='radio']:checked").val();
|
||||
vvvvvyc(source_vvvvvyc,add_sql_vvvvvyc);
|
||||
var add_sql_vvvvvyd = jQuery("#jform_add_sql input[type='radio']:checked").val();
|
||||
vvvvvyd(add_sql_vvvvvyd);
|
||||
|
||||
var source_vvvvvye = jQuery("#jform_source input[type='radio']:checked").val();
|
||||
var add_sql_vvvvvye = jQuery("#jform_add_sql input[type='radio']:checked").val();
|
||||
vvvvvye(source_vvvvvye,add_sql_vvvvvye);
|
||||
|
||||
var add_custom_import_vvvvvyg = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
|
||||
vvvvvyg(add_custom_import_vvvvvyg);
|
||||
var source_vvvvvyg = jQuery("#jform_source input[type='radio']:checked").val();
|
||||
var add_sql_vvvvvyg = jQuery("#jform_add_sql input[type='radio']:checked").val();
|
||||
vvvvvyg(source_vvvvvyg,add_sql_vvvvvyg);
|
||||
|
||||
var add_custom_import_vvvvvyh = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
|
||||
vvvvvyh(add_custom_import_vvvvvyh);
|
||||
var add_custom_import_vvvvvyi = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
|
||||
vvvvvyi(add_custom_import_vvvvvyi);
|
||||
|
||||
var add_custom_button_vvvvvyi = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvyi(add_custom_button_vvvvvyi);
|
||||
var add_custom_import_vvvvvyj = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
|
||||
vvvvvyj(add_custom_import_vvvvvyj);
|
||||
|
||||
var add_custom_button_vvvvvyk = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvyk(add_custom_button_vvvvvyk);
|
||||
});
|
||||
|
||||
// the vvvvvxb function
|
||||
function vvvvvxb(add_css_view_vvvvvxb)
|
||||
// the vvvvvxd function
|
||||
function vvvvvxd(add_css_view_vvvvvxd)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_view_vvvvvxb == 1)
|
||||
if (add_css_view_vvvvvxd == 1)
|
||||
{
|
||||
jQuery('#jform_css_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -135,11 +135,11 @@ function vvvvvxb(add_css_view_vvvvvxb)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxc function
|
||||
function vvvvvxc(add_css_views_vvvvvxc)
|
||||
// the vvvvvxe function
|
||||
function vvvvvxe(add_css_views_vvvvvxe)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_views_vvvvvxc == 1)
|
||||
if (add_css_views_vvvvvxe == 1)
|
||||
{
|
||||
jQuery('#jform_css_views-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -149,11 +149,11 @@ function vvvvvxc(add_css_views_vvvvvxc)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxd function
|
||||
function vvvvvxd(add_javascript_view_file_vvvvvxd)
|
||||
// the vvvvvxf function
|
||||
function vvvvvxf(add_javascript_view_file_vvvvvxf)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_view_file_vvvvvxd == 1)
|
||||
if (add_javascript_view_file_vvvvvxf == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_view_file-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -163,11 +163,11 @@ function vvvvvxd(add_javascript_view_file_vvvvvxd)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxe function
|
||||
function vvvvvxe(add_javascript_views_file_vvvvvxe)
|
||||
// the vvvvvxg function
|
||||
function vvvvvxg(add_javascript_views_file_vvvvvxg)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_views_file_vvvvvxe == 1)
|
||||
if (add_javascript_views_file_vvvvvxg == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_views_file-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -177,11 +177,11 @@ function vvvvvxe(add_javascript_views_file_vvvvvxe)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxf function
|
||||
function vvvvvxf(add_javascript_view_footer_vvvvvxf)
|
||||
// the vvvvvxh function
|
||||
function vvvvvxh(add_javascript_view_footer_vvvvvxh)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_view_footer_vvvvvxf == 1)
|
||||
if (add_javascript_view_footer_vvvvvxh == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_view_footer-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -191,11 +191,11 @@ function vvvvvxf(add_javascript_view_footer_vvvvvxf)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxg function
|
||||
function vvvvvxg(add_javascript_views_footer_vvvvvxg)
|
||||
// the vvvvvxi function
|
||||
function vvvvvxi(add_javascript_views_footer_vvvvvxi)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_views_footer_vvvvvxg == 1)
|
||||
if (add_javascript_views_footer_vvvvvxi == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_views_footer-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -205,11 +205,11 @@ function vvvvvxg(add_javascript_views_footer_vvvvvxg)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxh function
|
||||
function vvvvvxh(add_php_ajax_vvvvvxh)
|
||||
// the vvvvvxj function
|
||||
function vvvvvxj(add_php_ajax_vvvvvxj)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_ajax_vvvvvxh == 1)
|
||||
if (add_php_ajax_vvvvvxj == 1)
|
||||
{
|
||||
jQuery('#jform_ajax_input-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_ajaxmethod-lbl').closest('.control-group').show();
|
||||
@ -221,11 +221,11 @@ function vvvvvxh(add_php_ajax_vvvvvxh)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxi function
|
||||
function vvvvvxi(add_php_getitem_vvvvvxi)
|
||||
// the vvvvvxk function
|
||||
function vvvvvxk(add_php_getitem_vvvvvxk)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_getitem_vvvvvxi == 1)
|
||||
if (add_php_getitem_vvvvvxk == 1)
|
||||
{
|
||||
jQuery('#jform_php_getitem-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -235,11 +235,11 @@ function vvvvvxi(add_php_getitem_vvvvvxi)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxj function
|
||||
function vvvvvxj(add_php_getitems_vvvvvxj)
|
||||
// the vvvvvxl function
|
||||
function vvvvvxl(add_php_getitems_vvvvvxl)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_getitems_vvvvvxj == 1)
|
||||
if (add_php_getitems_vvvvvxl == 1)
|
||||
{
|
||||
jQuery('#jform_php_getitems-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -249,11 +249,11 @@ function vvvvvxj(add_php_getitems_vvvvvxj)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxk function
|
||||
function vvvvvxk(add_php_getitems_after_all_vvvvvxk)
|
||||
// the vvvvvxm function
|
||||
function vvvvvxm(add_php_getitems_after_all_vvvvvxm)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_getitems_after_all_vvvvvxk == 1)
|
||||
if (add_php_getitems_after_all_vvvvvxm == 1)
|
||||
{
|
||||
jQuery('#jform_php_getitems_after_all-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -263,11 +263,11 @@ function vvvvvxk(add_php_getitems_after_all_vvvvvxk)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxl function
|
||||
function vvvvvxl(add_php_getlistquery_vvvvvxl)
|
||||
// the vvvvvxn function
|
||||
function vvvvvxn(add_php_getlistquery_vvvvvxn)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_getlistquery_vvvvvxl == 1)
|
||||
if (add_php_getlistquery_vvvvvxn == 1)
|
||||
{
|
||||
jQuery('#jform_php_getlistquery-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -277,11 +277,11 @@ function vvvvvxl(add_php_getlistquery_vvvvvxl)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxm function
|
||||
function vvvvvxm(add_php_getform_vvvvvxm)
|
||||
// the vvvvvxo function
|
||||
function vvvvvxo(add_php_getform_vvvvvxo)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_getform_vvvvvxm == 1)
|
||||
if (add_php_getform_vvvvvxo == 1)
|
||||
{
|
||||
jQuery('#jform_php_getform-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -291,11 +291,11 @@ function vvvvvxm(add_php_getform_vvvvvxm)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxn function
|
||||
function vvvvvxn(add_php_before_save_vvvvvxn)
|
||||
// the vvvvvxp function
|
||||
function vvvvvxp(add_php_before_save_vvvvvxp)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_before_save_vvvvvxn == 1)
|
||||
if (add_php_before_save_vvvvvxp == 1)
|
||||
{
|
||||
jQuery('#jform_php_before_save-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -305,11 +305,11 @@ function vvvvvxn(add_php_before_save_vvvvvxn)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxo function
|
||||
function vvvvvxo(add_php_save_vvvvvxo)
|
||||
// the vvvvvxq function
|
||||
function vvvvvxq(add_php_save_vvvvvxq)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_save_vvvvvxo == 1)
|
||||
if (add_php_save_vvvvvxq == 1)
|
||||
{
|
||||
jQuery('#jform_php_save-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -319,11 +319,11 @@ function vvvvvxo(add_php_save_vvvvvxo)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxp function
|
||||
function vvvvvxp(add_php_postsavehook_vvvvvxp)
|
||||
// the vvvvvxr function
|
||||
function vvvvvxr(add_php_postsavehook_vvvvvxr)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_postsavehook_vvvvvxp == 1)
|
||||
if (add_php_postsavehook_vvvvvxr == 1)
|
||||
{
|
||||
jQuery('#jform_php_postsavehook-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -333,11 +333,11 @@ function vvvvvxp(add_php_postsavehook_vvvvvxp)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxq function
|
||||
function vvvvvxq(add_php_allowadd_vvvvvxq)
|
||||
// the vvvvvxs function
|
||||
function vvvvvxs(add_php_allowadd_vvvvvxs)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_allowadd_vvvvvxq == 1)
|
||||
if (add_php_allowadd_vvvvvxs == 1)
|
||||
{
|
||||
jQuery('#jform_php_allowadd-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -347,11 +347,11 @@ function vvvvvxq(add_php_allowadd_vvvvvxq)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxr function
|
||||
function vvvvvxr(add_php_allowedit_vvvvvxr)
|
||||
// the vvvvvxt function
|
||||
function vvvvvxt(add_php_allowedit_vvvvvxt)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_allowedit_vvvvvxr == 1)
|
||||
if (add_php_allowedit_vvvvvxt == 1)
|
||||
{
|
||||
jQuery('#jform_php_allowedit-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -361,11 +361,11 @@ function vvvvvxr(add_php_allowedit_vvvvvxr)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxs function
|
||||
function vvvvvxs(add_php_before_cancel_vvvvvxs)
|
||||
// the vvvvvxu function
|
||||
function vvvvvxu(add_php_before_cancel_vvvvvxu)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_before_cancel_vvvvvxs == 1)
|
||||
if (add_php_before_cancel_vvvvvxu == 1)
|
||||
{
|
||||
jQuery('#jform_php_before_cancel-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -375,11 +375,11 @@ function vvvvvxs(add_php_before_cancel_vvvvvxs)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxt function
|
||||
function vvvvvxt(add_php_after_cancel_vvvvvxt)
|
||||
// the vvvvvxv function
|
||||
function vvvvvxv(add_php_after_cancel_vvvvvxv)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_after_cancel_vvvvvxt == 1)
|
||||
if (add_php_after_cancel_vvvvvxv == 1)
|
||||
{
|
||||
jQuery('#jform_php_after_cancel-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -389,11 +389,11 @@ function vvvvvxt(add_php_after_cancel_vvvvvxt)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxu function
|
||||
function vvvvvxu(add_php_batchcopy_vvvvvxu)
|
||||
// the vvvvvxw function
|
||||
function vvvvvxw(add_php_batchcopy_vvvvvxw)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_batchcopy_vvvvvxu == 1)
|
||||
if (add_php_batchcopy_vvvvvxw == 1)
|
||||
{
|
||||
jQuery('#jform_php_batchcopy-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -403,11 +403,11 @@ function vvvvvxu(add_php_batchcopy_vvvvvxu)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxv function
|
||||
function vvvvvxv(add_php_batchmove_vvvvvxv)
|
||||
// the vvvvvxx function
|
||||
function vvvvvxx(add_php_batchmove_vvvvvxx)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_batchmove_vvvvvxv == 1)
|
||||
if (add_php_batchmove_vvvvvxx == 1)
|
||||
{
|
||||
jQuery('#jform_php_batchmove-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -417,11 +417,11 @@ function vvvvvxv(add_php_batchmove_vvvvvxv)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxw function
|
||||
function vvvvvxw(add_php_before_publish_vvvvvxw)
|
||||
// the vvvvvxy function
|
||||
function vvvvvxy(add_php_before_publish_vvvvvxy)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_before_publish_vvvvvxw == 1)
|
||||
if (add_php_before_publish_vvvvvxy == 1)
|
||||
{
|
||||
jQuery('#jform_php_before_publish-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -431,11 +431,11 @@ function vvvvvxw(add_php_before_publish_vvvvvxw)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxx function
|
||||
function vvvvvxx(add_php_after_publish_vvvvvxx)
|
||||
// the vvvvvxz function
|
||||
function vvvvvxz(add_php_after_publish_vvvvvxz)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_after_publish_vvvvvxx == 1)
|
||||
if (add_php_after_publish_vvvvvxz == 1)
|
||||
{
|
||||
jQuery('#jform_php_after_publish-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -445,11 +445,11 @@ function vvvvvxx(add_php_after_publish_vvvvvxx)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxy function
|
||||
function vvvvvxy(add_php_before_delete_vvvvvxy)
|
||||
// the vvvvvya function
|
||||
function vvvvvya(add_php_before_delete_vvvvvya)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_before_delete_vvvvvxy == 1)
|
||||
if (add_php_before_delete_vvvvvya == 1)
|
||||
{
|
||||
jQuery('#jform_php_before_delete-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -459,11 +459,11 @@ function vvvvvxy(add_php_before_delete_vvvvvxy)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxz function
|
||||
function vvvvvxz(add_php_after_delete_vvvvvxz)
|
||||
// the vvvvvyb function
|
||||
function vvvvvyb(add_php_after_delete_vvvvvyb)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_after_delete_vvvvvxz == 1)
|
||||
if (add_php_after_delete_vvvvvyb == 1)
|
||||
{
|
||||
jQuery('#jform_php_after_delete-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -473,11 +473,11 @@ function vvvvvxz(add_php_after_delete_vvvvvxz)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvya function
|
||||
function vvvvvya(add_php_document_vvvvvya)
|
||||
// the vvvvvyc function
|
||||
function vvvvvyc(add_php_document_vvvvvyc)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_document_vvvvvya == 1)
|
||||
if (add_php_document_vvvvvyc == 1)
|
||||
{
|
||||
jQuery('#jform_php_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -487,66 +487,34 @@ function vvvvvya(add_php_document_vvvvvya)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyb function
|
||||
function vvvvvyb(add_sql_vvvvvyb)
|
||||
// the vvvvvyd function
|
||||
function vvvvvyd(add_sql_vvvvvyd)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_sql_vvvvvyb == 1)
|
||||
if (add_sql_vvvvvyd == 1)
|
||||
{
|
||||
jQuery('#jform_source').closest('.control-group').show();
|
||||
// add required attribute to source field
|
||||
if (jform_vvvvvybvwd_required)
|
||||
if (jform_vvvvvydvwd_required)
|
||||
{
|
||||
updateFieldRequired('source',0);
|
||||
jQuery('#jform_source').prop('required','required');
|
||||
jQuery('#jform_source').attr('aria-required',true);
|
||||
jQuery('#jform_source').addClass('required');
|
||||
jform_vvvvvybvwd_required = false;
|
||||
jform_vvvvvydvwd_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_source').closest('.control-group').hide();
|
||||
// remove required attribute from source field
|
||||
if (!jform_vvvvvybvwd_required)
|
||||
if (!jform_vvvvvydvwd_required)
|
||||
{
|
||||
updateFieldRequired('source',1);
|
||||
jQuery('#jform_source').removeAttr('required');
|
||||
jQuery('#jform_source').removeAttr('aria-required');
|
||||
jQuery('#jform_source').removeClass('required');
|
||||
jform_vvvvvybvwd_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyc function
|
||||
function vvvvvyc(source_vvvvvyc,add_sql_vvvvvyc)
|
||||
{
|
||||
// set the function logic
|
||||
if (source_vvvvvyc == 2 && add_sql_vvvvvyc == 1)
|
||||
{
|
||||
jQuery('#jform_sql').closest('.control-group').show();
|
||||
// add required attribute to sql field
|
||||
if (jform_vvvvvycvwe_required)
|
||||
{
|
||||
updateFieldRequired('sql',0);
|
||||
jQuery('#jform_sql').prop('required','required');
|
||||
jQuery('#jform_sql').attr('aria-required',true);
|
||||
jQuery('#jform_sql').addClass('required');
|
||||
jform_vvvvvycvwe_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_sql').closest('.control-group').hide();
|
||||
// remove required attribute from sql field
|
||||
if (!jform_vvvvvycvwe_required)
|
||||
{
|
||||
updateFieldRequired('sql',1);
|
||||
jQuery('#jform_sql').removeAttr('required');
|
||||
jQuery('#jform_sql').removeAttr('aria-required');
|
||||
jQuery('#jform_sql').removeClass('required');
|
||||
jform_vvvvvycvwe_required = true;
|
||||
jform_vvvvvydvwd_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -555,7 +523,39 @@ function vvvvvyc(source_vvvvvyc,add_sql_vvvvvyc)
|
||||
function vvvvvye(source_vvvvvye,add_sql_vvvvvye)
|
||||
{
|
||||
// set the function logic
|
||||
if (source_vvvvvye == 1 && add_sql_vvvvvye == 1)
|
||||
if (source_vvvvvye == 2 && add_sql_vvvvvye == 1)
|
||||
{
|
||||
jQuery('#jform_sql').closest('.control-group').show();
|
||||
// add required attribute to sql field
|
||||
if (jform_vvvvvyevwe_required)
|
||||
{
|
||||
updateFieldRequired('sql',0);
|
||||
jQuery('#jform_sql').prop('required','required');
|
||||
jQuery('#jform_sql').attr('aria-required',true);
|
||||
jQuery('#jform_sql').addClass('required');
|
||||
jform_vvvvvyevwe_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_sql').closest('.control-group').hide();
|
||||
// remove required attribute from sql field
|
||||
if (!jform_vvvvvyevwe_required)
|
||||
{
|
||||
updateFieldRequired('sql',1);
|
||||
jQuery('#jform_sql').removeAttr('required');
|
||||
jQuery('#jform_sql').removeAttr('aria-required');
|
||||
jQuery('#jform_sql').removeClass('required');
|
||||
jform_vvvvvyevwe_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyg function
|
||||
function vvvvvyg(source_vvvvvyg,add_sql_vvvvvyg)
|
||||
{
|
||||
// set the function logic
|
||||
if (source_vvvvvyg == 1 && add_sql_vvvvvyg == 1)
|
||||
{
|
||||
jQuery('#jform_addtables-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -565,165 +565,165 @@ function vvvvvye(source_vvvvvye,add_sql_vvvvvye)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyg function
|
||||
function vvvvvyg(add_custom_import_vvvvvyg)
|
||||
// the vvvvvyi function
|
||||
function vvvvvyi(add_custom_import_vvvvvyi)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_import_vvvvvyg == 1)
|
||||
if (add_custom_import_vvvvvyi == 1)
|
||||
{
|
||||
jQuery('#jform_html_import_view').closest('.control-group').show();
|
||||
// add required attribute to html_import_view field
|
||||
if (jform_vvvvvygvwf_required)
|
||||
if (jform_vvvvvyivwf_required)
|
||||
{
|
||||
updateFieldRequired('html_import_view',0);
|
||||
jQuery('#jform_html_import_view').prop('required','required');
|
||||
jQuery('#jform_html_import_view').attr('aria-required',true);
|
||||
jQuery('#jform_html_import_view').addClass('required');
|
||||
jform_vvvvvygvwf_required = false;
|
||||
jform_vvvvvyivwf_required = false;
|
||||
}
|
||||
jQuery('.note_advanced_import').closest('.control-group').show();
|
||||
jQuery('#jform_php_import_display').closest('.control-group').show();
|
||||
// add required attribute to php_import_display field
|
||||
if (jform_vvvvvygvwg_required)
|
||||
if (jform_vvvvvyivwg_required)
|
||||
{
|
||||
updateFieldRequired('php_import_display',0);
|
||||
jQuery('#jform_php_import_display').prop('required','required');
|
||||
jQuery('#jform_php_import_display').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_display').addClass('required');
|
||||
jform_vvvvvygvwg_required = false;
|
||||
jform_vvvvvyivwg_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import_ext').closest('.control-group').show();
|
||||
// add required attribute to php_import_ext field
|
||||
if (jform_vvvvvygvwh_required)
|
||||
if (jform_vvvvvyivwh_required)
|
||||
{
|
||||
updateFieldRequired('php_import_ext',0);
|
||||
jQuery('#jform_php_import_ext').prop('required','required');
|
||||
jQuery('#jform_php_import_ext').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_ext').addClass('required');
|
||||
jform_vvvvvygvwh_required = false;
|
||||
jform_vvvvvyivwh_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import_headers').closest('.control-group').show();
|
||||
// add required attribute to php_import_headers field
|
||||
if (jform_vvvvvygvwi_required)
|
||||
if (jform_vvvvvyivwi_required)
|
||||
{
|
||||
updateFieldRequired('php_import_headers',0);
|
||||
jQuery('#jform_php_import_headers').prop('required','required');
|
||||
jQuery('#jform_php_import_headers').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_headers').addClass('required');
|
||||
jform_vvvvvygvwi_required = false;
|
||||
jform_vvvvvyivwi_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import').closest('.control-group').show();
|
||||
// add required attribute to php_import field
|
||||
if (jform_vvvvvygvwj_required)
|
||||
if (jform_vvvvvyivwj_required)
|
||||
{
|
||||
updateFieldRequired('php_import',0);
|
||||
jQuery('#jform_php_import').prop('required','required');
|
||||
jQuery('#jform_php_import').attr('aria-required',true);
|
||||
jQuery('#jform_php_import').addClass('required');
|
||||
jform_vvvvvygvwj_required = false;
|
||||
jform_vvvvvyivwj_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import_save').closest('.control-group').show();
|
||||
// add required attribute to php_import_save field
|
||||
if (jform_vvvvvygvwk_required)
|
||||
if (jform_vvvvvyivwk_required)
|
||||
{
|
||||
updateFieldRequired('php_import_save',0);
|
||||
jQuery('#jform_php_import_save').prop('required','required');
|
||||
jQuery('#jform_php_import_save').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_save').addClass('required');
|
||||
jform_vvvvvygvwk_required = false;
|
||||
jform_vvvvvyivwk_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import_setdata').closest('.control-group').show();
|
||||
// add required attribute to php_import_setdata field
|
||||
if (jform_vvvvvygvwl_required)
|
||||
if (jform_vvvvvyivwl_required)
|
||||
{
|
||||
updateFieldRequired('php_import_setdata',0);
|
||||
jQuery('#jform_php_import_setdata').prop('required','required');
|
||||
jQuery('#jform_php_import_setdata').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_setdata').addClass('required');
|
||||
jform_vvvvvygvwl_required = false;
|
||||
jform_vvvvvyivwl_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_html_import_view').closest('.control-group').hide();
|
||||
// remove required attribute from html_import_view field
|
||||
if (!jform_vvvvvygvwf_required)
|
||||
if (!jform_vvvvvyivwf_required)
|
||||
{
|
||||
updateFieldRequired('html_import_view',1);
|
||||
jQuery('#jform_html_import_view').removeAttr('required');
|
||||
jQuery('#jform_html_import_view').removeAttr('aria-required');
|
||||
jQuery('#jform_html_import_view').removeClass('required');
|
||||
jform_vvvvvygvwf_required = true;
|
||||
jform_vvvvvyivwf_required = true;
|
||||
}
|
||||
jQuery('.note_advanced_import').closest('.control-group').hide();
|
||||
jQuery('#jform_php_import_display').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_display field
|
||||
if (!jform_vvvvvygvwg_required)
|
||||
if (!jform_vvvvvyivwg_required)
|
||||
{
|
||||
updateFieldRequired('php_import_display',1);
|
||||
jQuery('#jform_php_import_display').removeAttr('required');
|
||||
jQuery('#jform_php_import_display').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_display').removeClass('required');
|
||||
jform_vvvvvygvwg_required = true;
|
||||
jform_vvvvvyivwg_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import_ext').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_ext field
|
||||
if (!jform_vvvvvygvwh_required)
|
||||
if (!jform_vvvvvyivwh_required)
|
||||
{
|
||||
updateFieldRequired('php_import_ext',1);
|
||||
jQuery('#jform_php_import_ext').removeAttr('required');
|
||||
jQuery('#jform_php_import_ext').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_ext').removeClass('required');
|
||||
jform_vvvvvygvwh_required = true;
|
||||
jform_vvvvvyivwh_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import_headers').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_headers field
|
||||
if (!jform_vvvvvygvwi_required)
|
||||
if (!jform_vvvvvyivwi_required)
|
||||
{
|
||||
updateFieldRequired('php_import_headers',1);
|
||||
jQuery('#jform_php_import_headers').removeAttr('required');
|
||||
jQuery('#jform_php_import_headers').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_headers').removeClass('required');
|
||||
jform_vvvvvygvwi_required = true;
|
||||
jform_vvvvvyivwi_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import').closest('.control-group').hide();
|
||||
// remove required attribute from php_import field
|
||||
if (!jform_vvvvvygvwj_required)
|
||||
if (!jform_vvvvvyivwj_required)
|
||||
{
|
||||
updateFieldRequired('php_import',1);
|
||||
jQuery('#jform_php_import').removeAttr('required');
|
||||
jQuery('#jform_php_import').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import').removeClass('required');
|
||||
jform_vvvvvygvwj_required = true;
|
||||
jform_vvvvvyivwj_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import_save').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_save field
|
||||
if (!jform_vvvvvygvwk_required)
|
||||
if (!jform_vvvvvyivwk_required)
|
||||
{
|
||||
updateFieldRequired('php_import_save',1);
|
||||
jQuery('#jform_php_import_save').removeAttr('required');
|
||||
jQuery('#jform_php_import_save').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_save').removeClass('required');
|
||||
jform_vvvvvygvwk_required = true;
|
||||
jform_vvvvvyivwk_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import_setdata').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_setdata field
|
||||
if (!jform_vvvvvygvwl_required)
|
||||
if (!jform_vvvvvyivwl_required)
|
||||
{
|
||||
updateFieldRequired('php_import_setdata',1);
|
||||
jQuery('#jform_php_import_setdata').removeAttr('required');
|
||||
jQuery('#jform_php_import_setdata').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_setdata').removeClass('required');
|
||||
jform_vvvvvygvwl_required = true;
|
||||
jform_vvvvvyivwl_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyh function
|
||||
function vvvvvyh(add_custom_import_vvvvvyh)
|
||||
// the vvvvvyj function
|
||||
function vvvvvyj(add_custom_import_vvvvvyj)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_import_vvvvvyh == 0)
|
||||
if (add_custom_import_vvvvvyj == 0)
|
||||
{
|
||||
jQuery('.note_beginner_import').closest('.control-group').show();
|
||||
}
|
||||
@ -733,11 +733,11 @@ function vvvvvyh(add_custom_import_vvvvvyh)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyi function
|
||||
function vvvvvyi(add_custom_button_vvvvvyi)
|
||||
// the vvvvvyk function
|
||||
function vvvvvyk(add_custom_button_vvvvvyk)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_button_vvvvvyi == 1)
|
||||
if (add_custom_button_vvvvvyk == 1)
|
||||
{
|
||||
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_controller-lbl').closest('.control-group').show();
|
||||
|
11
admin/models/forms/class_extends.js
Normal file
11
admin/models/forms/class_extends.js
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
176
admin/models/forms/class_extends.xml
Normal file
176
admin/models/forms/class_extends.xml
Normal file
@ -0,0 +1,176 @@
|
||||
<?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_CLASS_EXTENDS_CREATED_DATE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_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_CLASS_EXTENDS_CREATED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_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_CLASS_EXTENDS_MODIFIED_DATE_LABEL" description="COM_COMPONENTBUILDER_CLASS_EXTENDS_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_CLASS_EXTENDS_MODIFIED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_MODIFIED_BY_DESC"
|
||||
class="readonly"
|
||||
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"
|
||||
type="number"
|
||||
class="inputbox validate-ordering"
|
||||
label="COM_COMPONENTBUILDER_CLASS_EXTENDS_ORDERING_LABEL"
|
||||
description=""
|
||||
default="0"
|
||||
size="6"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Version Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="version"
|
||||
type="text"
|
||||
class="readonly"
|
||||
label="COM_COMPONENTBUILDER_CLASS_EXTENDS_VERSION_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_VERSION_DESC"
|
||||
size="6"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Dynamic Fields. -->
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_MESSAGE"
|
||||
hint="COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_HINT"
|
||||
/>
|
||||
<!-- Extension_type Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
name="extension_type"
|
||||
label="COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="">
|
||||
COM_COMPONENTBUILDER_CLASS_EXTENDS_SELECT_AN_OPTION</option>
|
||||
<option value="components">
|
||||
COM_COMPONENTBUILDER_CLASS_EXTENDS_COMPONENTS</option>
|
||||
<option value="plugins">
|
||||
COM_COMPONENTBUILDER_CLASS_EXTENDS_PLUGINS</option>
|
||||
<option value="modules">
|
||||
COM_COMPONENTBUILDER_CLASS_EXTENDS_MODULES</option>
|
||||
</field>
|
||||
<!-- Head Field. Type: Editor. (joomla) -->
|
||||
<field
|
||||
type="editor"
|
||||
name="head"
|
||||
label="COM_COMPONENTBUILDER_CLASS_EXTENDS_HEAD_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_HEAD_DESCRIPTION"
|
||||
width="100%"
|
||||
height="450px"
|
||||
cols="15"
|
||||
rows="30"
|
||||
buttons="no"
|
||||
syntax="php"
|
||||
editor="codemirror|none"
|
||||
filter="raw"
|
||||
required="false"
|
||||
validate="code"
|
||||
/>
|
||||
<!-- Comment Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="comment"
|
||||
label="COM_COMPONENTBUILDER_CLASS_EXTENDS_COMMENT_LABEL"
|
||||
rows="10"
|
||||
cols="5"
|
||||
description="COM_COMPONENTBUILDER_CLASS_EXTENDS_COMMENT_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="string"
|
||||
hint="COM_COMPONENTBUILDER_CLASS_EXTENDS_COMMENT_HINT"
|
||||
required="false"
|
||||
/>
|
||||
</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 class_extends"
|
||||
translate_label="false"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
class="inputbox"
|
||||
component="com_componentbuilder"
|
||||
section="class_extends"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
111
admin/models/forms/class_method.js
Normal file
111
admin/models/forms/class_method.js
Normal file
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwaovxe_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var extension_type_vvvvwao = jQuery("#jform_extension_type").val();
|
||||
vvvvwao(extension_type_vvvvwao);
|
||||
});
|
||||
|
||||
// the vvvvwao function
|
||||
function vvvvwao(extension_type_vvvvwao)
|
||||
{
|
||||
if (isSet(extension_type_vvvvwao) && extension_type_vvvvwao.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwao = extension_type_vvvvwao;
|
||||
var extension_type_vvvvwao = [];
|
||||
extension_type_vvvvwao.push(temp_vvvvwao);
|
||||
}
|
||||
else if (!isSet(extension_type_vvvvwao))
|
||||
{
|
||||
var extension_type_vvvvwao = [];
|
||||
}
|
||||
var extension_type = extension_type_vvvvwao.some(extension_type_vvvvwao_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (extension_type)
|
||||
{
|
||||
jQuery('#jform_joomla_plugin_group').closest('.control-group').show();
|
||||
// add required attribute to joomla_plugin_group field
|
||||
if (jform_vvvvwaovxe_required)
|
||||
{
|
||||
updateFieldRequired('joomla_plugin_group',0);
|
||||
jQuery('#jform_joomla_plugin_group').prop('required','required');
|
||||
jQuery('#jform_joomla_plugin_group').attr('aria-required',true);
|
||||
jQuery('#jform_joomla_plugin_group').addClass('required');
|
||||
jform_vvvvwaovxe_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_joomla_plugin_group').closest('.control-group').hide();
|
||||
// remove required attribute from joomla_plugin_group field
|
||||
if (!jform_vvvvwaovxe_required)
|
||||
{
|
||||
updateFieldRequired('joomla_plugin_group',1);
|
||||
jQuery('#jform_joomla_plugin_group').removeAttr('required');
|
||||
jQuery('#jform_joomla_plugin_group').removeAttr('aria-required');
|
||||
jQuery('#jform_joomla_plugin_group').removeClass('required');
|
||||
jform_vvvvwaovxe_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwao Some function
|
||||
function extension_type_vvvvwao_SomeFunc(extension_type_vvvvwao)
|
||||
{
|
||||
// set the function logic
|
||||
if (extension_type_vvvvwao == 'plugins' || extension_type_vvvvwao == 'plugin')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// update required fields
|
||||
function updateFieldRequired(name,status)
|
||||
{
|
||||
var not_required = jQuery('#jform_not_required').val();
|
||||
|
||||
if(status == 1)
|
||||
{
|
||||
if (isSet(not_required) && not_required != 0)
|
||||
{
|
||||
not_required = not_required+','+name;
|
||||
}
|
||||
else
|
||||
{
|
||||
not_required = ','+name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isSet(not_required) && not_required != 0)
|
||||
{
|
||||
not_required = not_required.replace(','+name,'');
|
||||
}
|
||||
}
|
||||
|
||||
jQuery('#jform_not_required').val(not_required);
|
||||
}
|
||||
|
||||
// the isSet function
|
||||
function isSet(val)
|
||||
{
|
||||
if ((val != undefined) && (val != null) && 0 !== val.length){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
217
admin/models/forms/class_method.xml
Normal file
217
admin/models/forms/class_method.xml
Normal file
@ -0,0 +1,217 @@
|
||||
<?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_CLASS_METHOD_CREATED_DATE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_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_CLASS_METHOD_CREATED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_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_CLASS_METHOD_MODIFIED_DATE_LABEL" description="COM_COMPONENTBUILDER_CLASS_METHOD_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_CLASS_METHOD_MODIFIED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_MODIFIED_BY_DESC"
|
||||
class="readonly"
|
||||
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"
|
||||
type="number"
|
||||
class="inputbox validate-ordering"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_ORDERING_LABEL"
|
||||
description=""
|
||||
default="0"
|
||||
size="6"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Version Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="version"
|
||||
type="text"
|
||||
class="readonly"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_VERSION_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_VERSION_DESC"
|
||||
size="6"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Dynamic Fields. -->
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CLASS_METHOD_NAME_MESSAGE"
|
||||
hint="COM_COMPONENTBUILDER_CLASS_METHOD_NAME_HINT"
|
||||
/>
|
||||
<!-- Visibility Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
name="visibility"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
filter="WORD"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="public">
|
||||
COM_COMPONENTBUILDER_CLASS_METHOD_PUBLIC</option>
|
||||
<option value="protected">
|
||||
COM_COMPONENTBUILDER_CLASS_METHOD_PROTECTED</option>
|
||||
<option value="private">
|
||||
COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE</option>
|
||||
</field>
|
||||
<!-- Extension_type Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
name="extension_type"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="">
|
||||
COM_COMPONENTBUILDER_CLASS_METHOD_SELECT_AN_OPTION</option>
|
||||
<option value="components">
|
||||
COM_COMPONENTBUILDER_CLASS_METHOD_COMPONENTS</option>
|
||||
<option value="plugins">
|
||||
COM_COMPONENTBUILDER_CLASS_METHOD_PLUGINS</option>
|
||||
<option value="modules">
|
||||
COM_COMPONENTBUILDER_CLASS_METHOD_MODULES</option>
|
||||
</field>
|
||||
<!-- Code Field. Type: Editor. (joomla) -->
|
||||
<field
|
||||
type="editor"
|
||||
name="code"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_CODE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_CODE_DESCRIPTION"
|
||||
width="100%"
|
||||
height="600px"
|
||||
cols="15"
|
||||
rows="30"
|
||||
buttons="no"
|
||||
syntax="php"
|
||||
editor="codemirror|none"
|
||||
filter="raw"
|
||||
validate="code"
|
||||
/>
|
||||
<!-- Comment Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="comment"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_COMMENT_LABEL"
|
||||
rows="10"
|
||||
cols="5"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_COMMENT_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="string"
|
||||
hint="COM_COMPONENTBUILDER_CLASS_METHOD_COMMENT_HINT"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Joomla_plugin_group Field. Type: Joomlaplugingroups. (custom) -->
|
||||
<field
|
||||
type="joomlaplugingroups"
|
||||
name="joomla_plugin_group"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_JOOMLA_PLUGIN_GROUP_LABEL"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default="0"
|
||||
required="true"
|
||||
button="true"
|
||||
/>
|
||||
<!-- Arguments Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="arguments"
|
||||
label="COM_COMPONENTBUILDER_CLASS_METHOD_ARGUMENTS_LABEL"
|
||||
size="150"
|
||||
maxlength="350"
|
||||
description="COM_COMPONENTBUILDER_CLASS_METHOD_ARGUMENTS_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="STRING"
|
||||
hint="COM_COMPONENTBUILDER_CLASS_METHOD_ARGUMENTS_HINT"
|
||||
autocomplete="on"
|
||||
/>
|
||||
</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 class_method"
|
||||
translate_label="false"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
class="inputbox"
|
||||
component="com_componentbuilder"
|
||||
section="class_method"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
111
admin/models/forms/class_property.js
Normal file
111
admin/models/forms/class_property.js
Normal file
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwanvxd_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var extension_type_vvvvwan = jQuery("#jform_extension_type").val();
|
||||
vvvvwan(extension_type_vvvvwan);
|
||||
});
|
||||
|
||||
// the vvvvwan function
|
||||
function vvvvwan(extension_type_vvvvwan)
|
||||
{
|
||||
if (isSet(extension_type_vvvvwan) && extension_type_vvvvwan.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwan = extension_type_vvvvwan;
|
||||
var extension_type_vvvvwan = [];
|
||||
extension_type_vvvvwan.push(temp_vvvvwan);
|
||||
}
|
||||
else if (!isSet(extension_type_vvvvwan))
|
||||
{
|
||||
var extension_type_vvvvwan = [];
|
||||
}
|
||||
var extension_type = extension_type_vvvvwan.some(extension_type_vvvvwan_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (extension_type)
|
||||
{
|
||||
jQuery('#jform_joomla_plugin_group').closest('.control-group').show();
|
||||
// add required attribute to joomla_plugin_group field
|
||||
if (jform_vvvvwanvxd_required)
|
||||
{
|
||||
updateFieldRequired('joomla_plugin_group',0);
|
||||
jQuery('#jform_joomla_plugin_group').prop('required','required');
|
||||
jQuery('#jform_joomla_plugin_group').attr('aria-required',true);
|
||||
jQuery('#jform_joomla_plugin_group').addClass('required');
|
||||
jform_vvvvwanvxd_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_joomla_plugin_group').closest('.control-group').hide();
|
||||
// remove required attribute from joomla_plugin_group field
|
||||
if (!jform_vvvvwanvxd_required)
|
||||
{
|
||||
updateFieldRequired('joomla_plugin_group',1);
|
||||
jQuery('#jform_joomla_plugin_group').removeAttr('required');
|
||||
jQuery('#jform_joomla_plugin_group').removeAttr('aria-required');
|
||||
jQuery('#jform_joomla_plugin_group').removeClass('required');
|
||||
jform_vvvvwanvxd_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwan Some function
|
||||
function extension_type_vvvvwan_SomeFunc(extension_type_vvvvwan)
|
||||
{
|
||||
// set the function logic
|
||||
if (extension_type_vvvvwan == 'plugins' || extension_type_vvvvwan == 'plugin')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// update required fields
|
||||
function updateFieldRequired(name,status)
|
||||
{
|
||||
var not_required = jQuery('#jform_not_required').val();
|
||||
|
||||
if(status == 1)
|
||||
{
|
||||
if (isSet(not_required) && not_required != 0)
|
||||
{
|
||||
not_required = not_required+','+name;
|
||||
}
|
||||
else
|
||||
{
|
||||
not_required = ','+name;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isSet(not_required) && not_required != 0)
|
||||
{
|
||||
not_required = not_required.replace(','+name,'');
|
||||
}
|
||||
}
|
||||
|
||||
jQuery('#jform_not_required').val(not_required);
|
||||
}
|
||||
|
||||
// the isSet function
|
||||
function isSet(val)
|
||||
{
|
||||
if ((val != undefined) && (val != null) && 0 !== val.length){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
201
admin/models/forms/class_property.xml
Normal file
201
admin/models/forms/class_property.xml
Normal file
@ -0,0 +1,201 @@
|
||||
<?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_CLASS_PROPERTY_CREATED_DATE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_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_CLASS_PROPERTY_CREATED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_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_CLASS_PROPERTY_MODIFIED_DATE_LABEL" description="COM_COMPONENTBUILDER_CLASS_PROPERTY_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_CLASS_PROPERTY_MODIFIED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_MODIFIED_BY_DESC"
|
||||
class="readonly"
|
||||
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"
|
||||
type="number"
|
||||
class="inputbox validate-ordering"
|
||||
label="COM_COMPONENTBUILDER_CLASS_PROPERTY_ORDERING_LABEL"
|
||||
description=""
|
||||
default="0"
|
||||
size="6"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Version Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="version"
|
||||
type="text"
|
||||
class="readonly"
|
||||
label="COM_COMPONENTBUILDER_CLASS_PROPERTY_VERSION_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_VERSION_DESC"
|
||||
size="6"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Dynamic Fields. -->
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_MESSAGE"
|
||||
hint="COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_HINT"
|
||||
/>
|
||||
<!-- Visibility Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
name="visibility"
|
||||
label="COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
filter="WORD"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="public">
|
||||
COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLIC</option>
|
||||
<option value="protected">
|
||||
COM_COMPONENTBUILDER_CLASS_PROPERTY_PROTECTED</option>
|
||||
<option value="private">
|
||||
COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE</option>
|
||||
</field>
|
||||
<!-- Extension_type Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
name="extension_type"
|
||||
label="COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
required="true">
|
||||
<!-- Option Set. -->
|
||||
<option value="">
|
||||
COM_COMPONENTBUILDER_CLASS_PROPERTY_SELECT_AN_OPTION</option>
|
||||
<option value="components">
|
||||
COM_COMPONENTBUILDER_CLASS_PROPERTY_COMPONENTS</option>
|
||||
<option value="plugins">
|
||||
COM_COMPONENTBUILDER_CLASS_PROPERTY_PLUGINS</option>
|
||||
<option value="modules">
|
||||
COM_COMPONENTBUILDER_CLASS_PROPERTY_MODULES</option>
|
||||
</field>
|
||||
<!-- Comment Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="comment"
|
||||
label="COM_COMPONENTBUILDER_CLASS_PROPERTY_COMMENT_LABEL"
|
||||
rows="10"
|
||||
cols="5"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_COMMENT_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="string"
|
||||
hint="COM_COMPONENTBUILDER_CLASS_PROPERTY_COMMENT_HINT"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Joomla_plugin_group Field. Type: Joomlaplugingroups. (custom) -->
|
||||
<field
|
||||
type="joomlaplugingroups"
|
||||
name="joomla_plugin_group"
|
||||
label="COM_COMPONENTBUILDER_CLASS_PROPERTY_JOOMLA_PLUGIN_GROUP_LABEL"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default="0"
|
||||
required="true"
|
||||
button="true"
|
||||
/>
|
||||
<!-- Default Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="default"
|
||||
label="COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_LABEL"
|
||||
size="240"
|
||||
maxlength="350"
|
||||
description="COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_MESSAGE"
|
||||
hint="COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_HINT"
|
||||
/>
|
||||
</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 class_property"
|
||||
translate_label="false"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
class="inputbox"
|
||||
component="com_componentbuilder"
|
||||
section="class_property"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
@ -98,6 +98,19 @@
|
||||
readonly="true"
|
||||
button="false"
|
||||
/>
|
||||
<!-- Php_dashboard_methods Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="php_dashboard_methods"
|
||||
label="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PHP_DASHBOARD_METHODS_LABEL"
|
||||
rows="17"
|
||||
cols="5"
|
||||
description="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PHP_DASHBOARD_METHODS_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="raw"
|
||||
hint="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PHP_DASHBOARD_METHODS_HINT"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Dashboard_tab Field. Type: Subform. (joomla) -->
|
||||
<field
|
||||
type="subform"
|
||||
@ -156,19 +169,8 @@
|
||||
/>
|
||||
</form>
|
||||
</field>
|
||||
<!-- Php_dashboard_methods Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="php_dashboard_methods"
|
||||
label="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PHP_DASHBOARD_METHODS_LABEL"
|
||||
rows="17"
|
||||
cols="5"
|
||||
description="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PHP_DASHBOARD_METHODS_DESCRIPTION"
|
||||
class="text_area span12"
|
||||
filter="raw"
|
||||
hint="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PHP_DASHBOARD_METHODS_HINT"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Note_php_dashboard_note Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_php_dashboard_note" description="COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NOTE_PHP_DASHBOARD_NOTE_DESCRIPTION" class="note_php_dashboard_note" />
|
||||
</fieldset>
|
||||
|
||||
<!-- Access Control Fields. -->
|
||||
|
@ -11,42 +11,42 @@
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var add_php_view_vvvvvyj = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvyj(add_php_view_vvvvvyj);
|
||||
var add_php_view_vvvvvyl = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvyl(add_php_view_vvvvvyl);
|
||||
|
||||
var add_php_jview_display_vvvvvyk = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val();
|
||||
vvvvvyk(add_php_jview_display_vvvvvyk);
|
||||
var add_php_jview_display_vvvvvym = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val();
|
||||
vvvvvym(add_php_jview_display_vvvvvym);
|
||||
|
||||
var add_php_jview_vvvvvyl = jQuery("#jform_add_php_jview input[type='radio']:checked").val();
|
||||
vvvvvyl(add_php_jview_vvvvvyl);
|
||||
var add_php_jview_vvvvvyn = jQuery("#jform_add_php_jview input[type='radio']:checked").val();
|
||||
vvvvvyn(add_php_jview_vvvvvyn);
|
||||
|
||||
var add_php_document_vvvvvym = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvym(add_php_document_vvvvvym);
|
||||
var add_php_document_vvvvvyo = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvyo(add_php_document_vvvvvyo);
|
||||
|
||||
var add_css_document_vvvvvyn = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||
vvvvvyn(add_css_document_vvvvvyn);
|
||||
var add_css_document_vvvvvyp = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||
vvvvvyp(add_css_document_vvvvvyp);
|
||||
|
||||
var add_javascript_file_vvvvvyo = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||
vvvvvyo(add_javascript_file_vvvvvyo);
|
||||
var add_javascript_file_vvvvvyq = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||
vvvvvyq(add_javascript_file_vvvvvyq);
|
||||
|
||||
var add_js_document_vvvvvyp = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||
vvvvvyp(add_js_document_vvvvvyp);
|
||||
var add_js_document_vvvvvyr = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||
vvvvvyr(add_js_document_vvvvvyr);
|
||||
|
||||
var add_custom_button_vvvvvyq = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvyq(add_custom_button_vvvvvyq);
|
||||
var add_custom_button_vvvvvys = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvys(add_custom_button_vvvvvys);
|
||||
|
||||
var add_css_vvvvvyr = jQuery("#jform_add_css input[type='radio']:checked").val();
|
||||
vvvvvyr(add_css_vvvvvyr);
|
||||
var add_css_vvvvvyt = jQuery("#jform_add_css input[type='radio']:checked").val();
|
||||
vvvvvyt(add_css_vvvvvyt);
|
||||
|
||||
var add_php_ajax_vvvvvys = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvys(add_php_ajax_vvvvvys);
|
||||
var add_php_ajax_vvvvvyu = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvyu(add_php_ajax_vvvvvyu);
|
||||
});
|
||||
|
||||
// the vvvvvyj function
|
||||
function vvvvvyj(add_php_view_vvvvvyj)
|
||||
// the vvvvvyl function
|
||||
function vvvvvyl(add_php_view_vvvvvyl)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_view_vvvvvyj == 1)
|
||||
if (add_php_view_vvvvvyl == 1)
|
||||
{
|
||||
jQuery('#jform_php_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -56,11 +56,11 @@ function vvvvvyj(add_php_view_vvvvvyj)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyk function
|
||||
function vvvvvyk(add_php_jview_display_vvvvvyk)
|
||||
// the vvvvvym function
|
||||
function vvvvvym(add_php_jview_display_vvvvvym)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_jview_display_vvvvvyk == 1)
|
||||
if (add_php_jview_display_vvvvvym == 1)
|
||||
{
|
||||
jQuery('#jform_php_jview_display-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -70,11 +70,11 @@ function vvvvvyk(add_php_jview_display_vvvvvyk)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyl function
|
||||
function vvvvvyl(add_php_jview_vvvvvyl)
|
||||
// the vvvvvyn function
|
||||
function vvvvvyn(add_php_jview_vvvvvyn)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_jview_vvvvvyl == 1)
|
||||
if (add_php_jview_vvvvvyn == 1)
|
||||
{
|
||||
jQuery('#jform_php_jview-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -84,11 +84,11 @@ function vvvvvyl(add_php_jview_vvvvvyl)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvym function
|
||||
function vvvvvym(add_php_document_vvvvvym)
|
||||
// the vvvvvyo function
|
||||
function vvvvvyo(add_php_document_vvvvvyo)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_document_vvvvvym == 1)
|
||||
if (add_php_document_vvvvvyo == 1)
|
||||
{
|
||||
jQuery('#jform_php_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -98,11 +98,11 @@ function vvvvvym(add_php_document_vvvvvym)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyn function
|
||||
function vvvvvyn(add_css_document_vvvvvyn)
|
||||
// the vvvvvyp function
|
||||
function vvvvvyp(add_css_document_vvvvvyp)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_document_vvvvvyn == 1)
|
||||
if (add_css_document_vvvvvyp == 1)
|
||||
{
|
||||
jQuery('#jform_css_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -112,11 +112,11 @@ function vvvvvyn(add_css_document_vvvvvyn)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyo function
|
||||
function vvvvvyo(add_javascript_file_vvvvvyo)
|
||||
// the vvvvvyq function
|
||||
function vvvvvyq(add_javascript_file_vvvvvyq)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_file_vvvvvyo == 1)
|
||||
if (add_javascript_file_vvvvvyq == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_file-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -126,11 +126,11 @@ function vvvvvyo(add_javascript_file_vvvvvyo)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyp function
|
||||
function vvvvvyp(add_js_document_vvvvvyp)
|
||||
// the vvvvvyr function
|
||||
function vvvvvyr(add_js_document_vvvvvyr)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_js_document_vvvvvyp == 1)
|
||||
if (add_js_document_vvvvvyr == 1)
|
||||
{
|
||||
jQuery('#jform_js_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -140,11 +140,11 @@ function vvvvvyp(add_js_document_vvvvvyp)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyq function
|
||||
function vvvvvyq(add_custom_button_vvvvvyq)
|
||||
// the vvvvvys function
|
||||
function vvvvvys(add_custom_button_vvvvvys)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_button_vvvvvyq == 1)
|
||||
if (add_custom_button_vvvvvys == 1)
|
||||
{
|
||||
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_controller-lbl').closest('.control-group').show();
|
||||
@ -158,11 +158,11 @@ function vvvvvyq(add_custom_button_vvvvvyq)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyr function
|
||||
function vvvvvyr(add_css_vvvvvyr)
|
||||
// the vvvvvyt function
|
||||
function vvvvvyt(add_css_vvvvvyt)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_vvvvvyr == 1)
|
||||
if (add_css_vvvvvyt == 1)
|
||||
{
|
||||
jQuery('#jform_css-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -172,11 +172,11 @@ function vvvvvyr(add_css_vvvvvyr)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvys function
|
||||
function vvvvvys(add_php_ajax_vvvvvys)
|
||||
// the vvvvvyu function
|
||||
function vvvvvyu(add_php_ajax_vvvvvyu)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_ajax_vvvvvys == 1)
|
||||
if (add_php_ajax_vvvvvyu == 1)
|
||||
{
|
||||
jQuery('#jform_ajax_input-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_ajaxmethod-lbl').closest('.control-group').show();
|
||||
|
@ -9,44 +9,44 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwahvwz_required = false;
|
||||
jform_vvvvwaivxa_required = false;
|
||||
jform_vvvvwaivxb_required = false;
|
||||
jform_vvvvwaivxc_required = false;
|
||||
jform_vvvvwajvwz_required = false;
|
||||
jform_vvvvwakvxa_required = false;
|
||||
jform_vvvvwakvxb_required = false;
|
||||
jform_vvvvwakvxc_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var target_vvvvwah = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwah(target_vvvvwah);
|
||||
|
||||
var target_vvvvwai = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwai(target_vvvvwai);
|
||||
|
||||
var target_vvvvwaj = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
var type_vvvvwaj = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
vvvvwaj(target_vvvvwaj,type_vvvvwaj);
|
||||
vvvvwaj(target_vvvvwaj);
|
||||
|
||||
var type_vvvvwak = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
var target_vvvvwak = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwak(type_vvvvwak,target_vvvvwak);
|
||||
vvvvwak(target_vvvvwak);
|
||||
|
||||
var target_vvvvwal = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
var type_vvvvwal = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
vvvvwal(target_vvvvwal,type_vvvvwal);
|
||||
|
||||
var type_vvvvwam = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
var target_vvvvwam = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwam(type_vvvvwam,target_vvvvwam);
|
||||
});
|
||||
|
||||
// the vvvvwah function
|
||||
function vvvvwah(target_vvvvwah)
|
||||
// the vvvvwaj function
|
||||
function vvvvwaj(target_vvvvwaj)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwah == 2)
|
||||
if (target_vvvvwaj == 2)
|
||||
{
|
||||
jQuery('#jform_function_name').closest('.control-group').show();
|
||||
// add required attribute to function_name field
|
||||
if (jform_vvvvwahvwz_required)
|
||||
if (jform_vvvvwajvwz_required)
|
||||
{
|
||||
updateFieldRequired('function_name',0);
|
||||
jQuery('#jform_function_name').prop('required','required');
|
||||
jQuery('#jform_function_name').attr('aria-required',true);
|
||||
jQuery('#jform_function_name').addClass('required');
|
||||
jform_vvvvwahvwz_required = false;
|
||||
jform_vvvvwajvwz_required = false;
|
||||
}
|
||||
jQuery('.note_jcb_placeholder').closest('.control-group').show();
|
||||
jQuery('#jform_system_name').closest('.control-group').show();
|
||||
@ -55,102 +55,102 @@ function vvvvwah(target_vvvvwah)
|
||||
{
|
||||
jQuery('#jform_function_name').closest('.control-group').hide();
|
||||
// remove required attribute from function_name field
|
||||
if (!jform_vvvvwahvwz_required)
|
||||
if (!jform_vvvvwajvwz_required)
|
||||
{
|
||||
updateFieldRequired('function_name',1);
|
||||
jQuery('#jform_function_name').removeAttr('required');
|
||||
jQuery('#jform_function_name').removeAttr('aria-required');
|
||||
jQuery('#jform_function_name').removeClass('required');
|
||||
jform_vvvvwahvwz_required = true;
|
||||
jform_vvvvwajvwz_required = true;
|
||||
}
|
||||
jQuery('.note_jcb_placeholder').closest('.control-group').hide();
|
||||
jQuery('#jform_system_name').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwai function
|
||||
function vvvvwai(target_vvvvwai)
|
||||
// the vvvvwak function
|
||||
function vvvvwak(target_vvvvwak)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwai == 1)
|
||||
if (target_vvvvwak == 1)
|
||||
{
|
||||
jQuery('#jform_component').closest('.control-group').show();
|
||||
// add required attribute to component field
|
||||
if (jform_vvvvwaivxa_required)
|
||||
if (jform_vvvvwakvxa_required)
|
||||
{
|
||||
updateFieldRequired('component',0);
|
||||
jQuery('#jform_component').prop('required','required');
|
||||
jQuery('#jform_component').attr('aria-required',true);
|
||||
jQuery('#jform_component').addClass('required');
|
||||
jform_vvvvwaivxa_required = false;
|
||||
jform_vvvvwakvxa_required = false;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').show();
|
||||
// add required attribute to path field
|
||||
if (jform_vvvvwaivxb_required)
|
||||
if (jform_vvvvwakvxb_required)
|
||||
{
|
||||
updateFieldRequired('path',0);
|
||||
jQuery('#jform_path').prop('required','required');
|
||||
jQuery('#jform_path').attr('aria-required',true);
|
||||
jQuery('#jform_path').addClass('required');
|
||||
jform_vvvvwaivxb_required = false;
|
||||
jform_vvvvwakvxb_required = false;
|
||||
}
|
||||
jQuery('#jform_from_line').closest('.control-group').show();
|
||||
jQuery('#jform_hashtarget').closest('.control-group').show();
|
||||
jQuery('#jform_to_line').closest('.control-group').show();
|
||||
jQuery('#jform_type').closest('.control-group').show();
|
||||
// add required attribute to type field
|
||||
if (jform_vvvvwaivxc_required)
|
||||
if (jform_vvvvwakvxc_required)
|
||||
{
|
||||
updateFieldRequired('type',0);
|
||||
jQuery('#jform_type').prop('required','required');
|
||||
jQuery('#jform_type').attr('aria-required',true);
|
||||
jQuery('#jform_type').addClass('required');
|
||||
jform_vvvvwaivxc_required = false;
|
||||
jform_vvvvwakvxc_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_component').closest('.control-group').hide();
|
||||
// remove required attribute from component field
|
||||
if (!jform_vvvvwaivxa_required)
|
||||
if (!jform_vvvvwakvxa_required)
|
||||
{
|
||||
updateFieldRequired('component',1);
|
||||
jQuery('#jform_component').removeAttr('required');
|
||||
jQuery('#jform_component').removeAttr('aria-required');
|
||||
jQuery('#jform_component').removeClass('required');
|
||||
jform_vvvvwaivxa_required = true;
|
||||
jform_vvvvwakvxa_required = true;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').hide();
|
||||
// remove required attribute from path field
|
||||
if (!jform_vvvvwaivxb_required)
|
||||
if (!jform_vvvvwakvxb_required)
|
||||
{
|
||||
updateFieldRequired('path',1);
|
||||
jQuery('#jform_path').removeAttr('required');
|
||||
jQuery('#jform_path').removeAttr('aria-required');
|
||||
jQuery('#jform_path').removeClass('required');
|
||||
jform_vvvvwaivxb_required = true;
|
||||
jform_vvvvwakvxb_required = true;
|
||||
}
|
||||
jQuery('#jform_from_line').closest('.control-group').hide();
|
||||
jQuery('#jform_hashtarget').closest('.control-group').hide();
|
||||
jQuery('#jform_to_line').closest('.control-group').hide();
|
||||
jQuery('#jform_type').closest('.control-group').hide();
|
||||
// remove required attribute from type field
|
||||
if (!jform_vvvvwaivxc_required)
|
||||
if (!jform_vvvvwakvxc_required)
|
||||
{
|
||||
updateFieldRequired('type',1);
|
||||
jQuery('#jform_type').removeAttr('required');
|
||||
jQuery('#jform_type').removeAttr('aria-required');
|
||||
jQuery('#jform_type').removeClass('required');
|
||||
jform_vvvvwaivxc_required = true;
|
||||
jform_vvvvwakvxc_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwaj function
|
||||
function vvvvwaj(target_vvvvwaj,type_vvvvwaj)
|
||||
// the vvvvwal function
|
||||
function vvvvwal(target_vvvvwal,type_vvvvwal)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwaj == 1 && type_vvvvwaj == 1)
|
||||
if (target_vvvvwal == 1 && type_vvvvwal == 1)
|
||||
{
|
||||
jQuery('#jform_hashendtarget').closest('.control-group').show();
|
||||
jQuery('#jform_to_line').closest('.control-group').show();
|
||||
@ -162,11 +162,11 @@ function vvvvwaj(target_vvvvwaj,type_vvvvwaj)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwak function
|
||||
function vvvvwak(type_vvvvwak,target_vvvvwak)
|
||||
// the vvvvwam function
|
||||
function vvvvwam(type_vvvvwam,target_vvvvwam)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwak == 1 && target_vvvvwak == 1)
|
||||
if (type_vvvvwam == 1 && target_vvvvwam == 1)
|
||||
{
|
||||
jQuery('#jform_hashendtarget').closest('.control-group').show();
|
||||
jQuery('#jform_to_line').closest('.control-group').show();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,57 +9,57 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwatvxf_required = false;
|
||||
jform_vvvvwauvxg_required = false;
|
||||
jform_vvvvwavvxh_required = false;
|
||||
jform_vvvvwawvxi_required = false;
|
||||
jform_vvvvwaxvxh_required = false;
|
||||
jform_vvvvwayvxi_required = false;
|
||||
jform_vvvvwazvxj_required = false;
|
||||
jform_vvvvwbavxk_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var datalenght_vvvvwat = jQuery("#jform_datalenght").val();
|
||||
vvvvwat(datalenght_vvvvwat);
|
||||
var datalenght_vvvvwax = jQuery("#jform_datalenght").val();
|
||||
vvvvwax(datalenght_vvvvwax);
|
||||
|
||||
var datadefault_vvvvwau = jQuery("#jform_datadefault").val();
|
||||
vvvvwau(datadefault_vvvvwau);
|
||||
var datadefault_vvvvway = jQuery("#jform_datadefault").val();
|
||||
vvvvway(datadefault_vvvvway);
|
||||
|
||||
var datatype_vvvvwav = jQuery("#jform_datatype").val();
|
||||
vvvvwav(datatype_vvvvwav);
|
||||
var datatype_vvvvwaz = jQuery("#jform_datatype").val();
|
||||
vvvvwaz(datatype_vvvvwaz);
|
||||
|
||||
var datatype_vvvvwaw = jQuery("#jform_datatype").val();
|
||||
vvvvwaw(datatype_vvvvwaw);
|
||||
var datatype_vvvvwba = jQuery("#jform_datatype").val();
|
||||
vvvvwba(datatype_vvvvwba);
|
||||
|
||||
var store_vvvvwax = jQuery("#jform_store").val();
|
||||
var datatype_vvvvwax = jQuery("#jform_datatype").val();
|
||||
vvvvwax(store_vvvvwax,datatype_vvvvwax);
|
||||
var store_vvvvwbb = jQuery("#jform_store").val();
|
||||
var datatype_vvvvwbb = jQuery("#jform_datatype").val();
|
||||
vvvvwbb(store_vvvvwbb,datatype_vvvvwbb);
|
||||
|
||||
var add_css_view_vvvvwaz = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
||||
vvvvwaz(add_css_view_vvvvwaz);
|
||||
var add_css_view_vvvvwbd = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
||||
vvvvwbd(add_css_view_vvvvwbd);
|
||||
|
||||
var add_css_views_vvvvwba = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
||||
vvvvwba(add_css_views_vvvvwba);
|
||||
var add_css_views_vvvvwbe = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
||||
vvvvwbe(add_css_views_vvvvwbe);
|
||||
|
||||
var add_javascript_view_footer_vvvvwbb = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
|
||||
vvvvwbb(add_javascript_view_footer_vvvvwbb);
|
||||
var add_javascript_view_footer_vvvvwbf = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
|
||||
vvvvwbf(add_javascript_view_footer_vvvvwbf);
|
||||
|
||||
var add_javascript_views_footer_vvvvwbc = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
|
||||
vvvvwbc(add_javascript_views_footer_vvvvwbc);
|
||||
var add_javascript_views_footer_vvvvwbg = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
|
||||
vvvvwbg(add_javascript_views_footer_vvvvwbg);
|
||||
});
|
||||
|
||||
// the vvvvwat function
|
||||
function vvvvwat(datalenght_vvvvwat)
|
||||
// the vvvvwax function
|
||||
function vvvvwax(datalenght_vvvvwax)
|
||||
{
|
||||
if (isSet(datalenght_vvvvwat) && datalenght_vvvvwat.constructor !== Array)
|
||||
if (isSet(datalenght_vvvvwax) && datalenght_vvvvwax.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwat = datalenght_vvvvwat;
|
||||
var datalenght_vvvvwat = [];
|
||||
datalenght_vvvvwat.push(temp_vvvvwat);
|
||||
var temp_vvvvwax = datalenght_vvvvwax;
|
||||
var datalenght_vvvvwax = [];
|
||||
datalenght_vvvvwax.push(temp_vvvvwax);
|
||||
}
|
||||
else if (!isSet(datalenght_vvvvwat))
|
||||
else if (!isSet(datalenght_vvvvwax))
|
||||
{
|
||||
var datalenght_vvvvwat = [];
|
||||
var datalenght_vvvvwax = [];
|
||||
}
|
||||
var datalenght = datalenght_vvvvwat.some(datalenght_vvvvwat_SomeFunc);
|
||||
var datalenght = datalenght_vvvvwax.some(datalenght_vvvvwax_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -67,55 +67,55 @@ function vvvvwat(datalenght_vvvvwat)
|
||||
{
|
||||
jQuery('#jform_datalenght_other').closest('.control-group').show();
|
||||
// add required attribute to datalenght_other field
|
||||
if (jform_vvvvwatvxf_required)
|
||||
if (jform_vvvvwaxvxh_required)
|
||||
{
|
||||
updateFieldRequired('datalenght_other',0);
|
||||
jQuery('#jform_datalenght_other').prop('required','required');
|
||||
jQuery('#jform_datalenght_other').attr('aria-required',true);
|
||||
jQuery('#jform_datalenght_other').addClass('required');
|
||||
jform_vvvvwatvxf_required = false;
|
||||
jform_vvvvwaxvxh_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_datalenght_other').closest('.control-group').hide();
|
||||
// remove required attribute from datalenght_other field
|
||||
if (!jform_vvvvwatvxf_required)
|
||||
if (!jform_vvvvwaxvxh_required)
|
||||
{
|
||||
updateFieldRequired('datalenght_other',1);
|
||||
jQuery('#jform_datalenght_other').removeAttr('required');
|
||||
jQuery('#jform_datalenght_other').removeAttr('aria-required');
|
||||
jQuery('#jform_datalenght_other').removeClass('required');
|
||||
jform_vvvvwatvxf_required = true;
|
||||
jform_vvvvwaxvxh_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwat Some function
|
||||
function datalenght_vvvvwat_SomeFunc(datalenght_vvvvwat)
|
||||
// the vvvvwax Some function
|
||||
function datalenght_vvvvwax_SomeFunc(datalenght_vvvvwax)
|
||||
{
|
||||
// set the function logic
|
||||
if (datalenght_vvvvwat == 'Other')
|
||||
if (datalenght_vvvvwax == 'Other')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwau function
|
||||
function vvvvwau(datadefault_vvvvwau)
|
||||
// the vvvvway function
|
||||
function vvvvway(datadefault_vvvvway)
|
||||
{
|
||||
if (isSet(datadefault_vvvvwau) && datadefault_vvvvwau.constructor !== Array)
|
||||
if (isSet(datadefault_vvvvway) && datadefault_vvvvway.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwau = datadefault_vvvvwau;
|
||||
var datadefault_vvvvwau = [];
|
||||
datadefault_vvvvwau.push(temp_vvvvwau);
|
||||
var temp_vvvvway = datadefault_vvvvway;
|
||||
var datadefault_vvvvway = [];
|
||||
datadefault_vvvvway.push(temp_vvvvway);
|
||||
}
|
||||
else if (!isSet(datadefault_vvvvwau))
|
||||
else if (!isSet(datadefault_vvvvway))
|
||||
{
|
||||
var datadefault_vvvvwau = [];
|
||||
var datadefault_vvvvway = [];
|
||||
}
|
||||
var datadefault = datadefault_vvvvwau.some(datadefault_vvvvwau_SomeFunc);
|
||||
var datadefault = datadefault_vvvvway.some(datadefault_vvvvway_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -123,55 +123,55 @@ function vvvvwau(datadefault_vvvvwau)
|
||||
{
|
||||
jQuery('#jform_datadefault_other').closest('.control-group').show();
|
||||
// add required attribute to datadefault_other field
|
||||
if (jform_vvvvwauvxg_required)
|
||||
if (jform_vvvvwayvxi_required)
|
||||
{
|
||||
updateFieldRequired('datadefault_other',0);
|
||||
jQuery('#jform_datadefault_other').prop('required','required');
|
||||
jQuery('#jform_datadefault_other').attr('aria-required',true);
|
||||
jQuery('#jform_datadefault_other').addClass('required');
|
||||
jform_vvvvwauvxg_required = false;
|
||||
jform_vvvvwayvxi_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_datadefault_other').closest('.control-group').hide();
|
||||
// remove required attribute from datadefault_other field
|
||||
if (!jform_vvvvwauvxg_required)
|
||||
if (!jform_vvvvwayvxi_required)
|
||||
{
|
||||
updateFieldRequired('datadefault_other',1);
|
||||
jQuery('#jform_datadefault_other').removeAttr('required');
|
||||
jQuery('#jform_datadefault_other').removeAttr('aria-required');
|
||||
jQuery('#jform_datadefault_other').removeClass('required');
|
||||
jform_vvvvwauvxg_required = true;
|
||||
jform_vvvvwayvxi_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwau Some function
|
||||
function datadefault_vvvvwau_SomeFunc(datadefault_vvvvwau)
|
||||
// the vvvvway Some function
|
||||
function datadefault_vvvvway_SomeFunc(datadefault_vvvvway)
|
||||
{
|
||||
// set the function logic
|
||||
if (datadefault_vvvvwau == 'Other')
|
||||
if (datadefault_vvvvway == 'Other')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwav function
|
||||
function vvvvwav(datatype_vvvvwav)
|
||||
// the vvvvwaz function
|
||||
function vvvvwaz(datatype_vvvvwaz)
|
||||
{
|
||||
if (isSet(datatype_vvvvwav) && datatype_vvvvwav.constructor !== Array)
|
||||
if (isSet(datatype_vvvvwaz) && datatype_vvvvwaz.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwav = datatype_vvvvwav;
|
||||
var datatype_vvvvwav = [];
|
||||
datatype_vvvvwav.push(temp_vvvvwav);
|
||||
var temp_vvvvwaz = datatype_vvvvwaz;
|
||||
var datatype_vvvvwaz = [];
|
||||
datatype_vvvvwaz.push(temp_vvvvwaz);
|
||||
}
|
||||
else if (!isSet(datatype_vvvvwav))
|
||||
else if (!isSet(datatype_vvvvwaz))
|
||||
{
|
||||
var datatype_vvvvwav = [];
|
||||
var datatype_vvvvwaz = [];
|
||||
}
|
||||
var datatype = datatype_vvvvwav.some(datatype_vvvvwav_SomeFunc);
|
||||
var datatype = datatype_vvvvwaz.some(datatype_vvvvwaz_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -181,13 +181,13 @@ function vvvvwav(datatype_vvvvwav)
|
||||
jQuery('#jform_datalenght').closest('.control-group').show();
|
||||
jQuery('#jform_indexes').closest('.control-group').show();
|
||||
// add required attribute to indexes field
|
||||
if (jform_vvvvwavvxh_required)
|
||||
if (jform_vvvvwazvxj_required)
|
||||
{
|
||||
updateFieldRequired('indexes',0);
|
||||
jQuery('#jform_indexes').prop('required','required');
|
||||
jQuery('#jform_indexes').attr('aria-required',true);
|
||||
jQuery('#jform_indexes').addClass('required');
|
||||
jform_vvvvwavvxh_required = false;
|
||||
jform_vvvvwazvxj_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -196,42 +196,42 @@ function vvvvwav(datatype_vvvvwav)
|
||||
jQuery('#jform_datalenght').closest('.control-group').hide();
|
||||
jQuery('#jform_indexes').closest('.control-group').hide();
|
||||
// remove required attribute from indexes field
|
||||
if (!jform_vvvvwavvxh_required)
|
||||
if (!jform_vvvvwazvxj_required)
|
||||
{
|
||||
updateFieldRequired('indexes',1);
|
||||
jQuery('#jform_indexes').removeAttr('required');
|
||||
jQuery('#jform_indexes').removeAttr('aria-required');
|
||||
jQuery('#jform_indexes').removeClass('required');
|
||||
jform_vvvvwavvxh_required = true;
|
||||
jform_vvvvwazvxj_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwav Some function
|
||||
function datatype_vvvvwav_SomeFunc(datatype_vvvvwav)
|
||||
// the vvvvwaz Some function
|
||||
function datatype_vvvvwaz_SomeFunc(datatype_vvvvwaz)
|
||||
{
|
||||
// set the function logic
|
||||
if (datatype_vvvvwav == 'CHAR' || datatype_vvvvwav == 'VARCHAR' || datatype_vvvvwav == 'DATETIME' || datatype_vvvvwav == 'DATE' || datatype_vvvvwav == 'TIME' || datatype_vvvvwav == 'INT' || datatype_vvvvwav == 'TINYINT' || datatype_vvvvwav == 'BIGINT' || datatype_vvvvwav == 'FLOAT' || datatype_vvvvwav == 'DECIMAL' || datatype_vvvvwav == 'DOUBLE')
|
||||
if (datatype_vvvvwaz == 'CHAR' || datatype_vvvvwaz == 'VARCHAR' || datatype_vvvvwaz == 'DATETIME' || datatype_vvvvwaz == 'DATE' || datatype_vvvvwaz == 'TIME' || datatype_vvvvwaz == 'INT' || datatype_vvvvwaz == 'TINYINT' || datatype_vvvvwaz == 'BIGINT' || datatype_vvvvwaz == 'FLOAT' || datatype_vvvvwaz == 'DECIMAL' || datatype_vvvvwaz == 'DOUBLE')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwaw function
|
||||
function vvvvwaw(datatype_vvvvwaw)
|
||||
// the vvvvwba function
|
||||
function vvvvwba(datatype_vvvvwba)
|
||||
{
|
||||
if (isSet(datatype_vvvvwaw) && datatype_vvvvwaw.constructor !== Array)
|
||||
if (isSet(datatype_vvvvwba) && datatype_vvvvwba.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwaw = datatype_vvvvwaw;
|
||||
var datatype_vvvvwaw = [];
|
||||
datatype_vvvvwaw.push(temp_vvvvwaw);
|
||||
var temp_vvvvwba = datatype_vvvvwba;
|
||||
var datatype_vvvvwba = [];
|
||||
datatype_vvvvwba.push(temp_vvvvwba);
|
||||
}
|
||||
else if (!isSet(datatype_vvvvwaw))
|
||||
else if (!isSet(datatype_vvvvwba))
|
||||
{
|
||||
var datatype_vvvvwaw = [];
|
||||
var datatype_vvvvwba = [];
|
||||
}
|
||||
var datatype = datatype_vvvvwaw.some(datatype_vvvvwaw_SomeFunc);
|
||||
var datatype = datatype_vvvvwba.some(datatype_vvvvwba_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -239,67 +239,67 @@ function vvvvwaw(datatype_vvvvwaw)
|
||||
{
|
||||
jQuery('#jform_store').closest('.control-group').show();
|
||||
// add required attribute to store field
|
||||
if (jform_vvvvwawvxi_required)
|
||||
if (jform_vvvvwbavxk_required)
|
||||
{
|
||||
updateFieldRequired('store',0);
|
||||
jQuery('#jform_store').prop('required','required');
|
||||
jQuery('#jform_store').attr('aria-required',true);
|
||||
jQuery('#jform_store').addClass('required');
|
||||
jform_vvvvwawvxi_required = false;
|
||||
jform_vvvvwbavxk_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_store').closest('.control-group').hide();
|
||||
// remove required attribute from store field
|
||||
if (!jform_vvvvwawvxi_required)
|
||||
if (!jform_vvvvwbavxk_required)
|
||||
{
|
||||
updateFieldRequired('store',1);
|
||||
jQuery('#jform_store').removeAttr('required');
|
||||
jQuery('#jform_store').removeAttr('aria-required');
|
||||
jQuery('#jform_store').removeClass('required');
|
||||
jform_vvvvwawvxi_required = true;
|
||||
jform_vvvvwbavxk_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwaw Some function
|
||||
function datatype_vvvvwaw_SomeFunc(datatype_vvvvwaw)
|
||||
// the vvvvwba Some function
|
||||
function datatype_vvvvwba_SomeFunc(datatype_vvvvwba)
|
||||
{
|
||||
// set the function logic
|
||||
if (datatype_vvvvwaw == 'CHAR' || datatype_vvvvwaw == 'VARCHAR' || datatype_vvvvwaw == 'TEXT' || datatype_vvvvwaw == 'MEDIUMTEXT' || datatype_vvvvwaw == 'LONGTEXT' || datatype_vvvvwaw == 'BLOB' || datatype_vvvvwaw == 'TINYBLOB' || datatype_vvvvwaw == 'MEDIUMBLOB' || datatype_vvvvwaw == 'LONGBLOB')
|
||||
if (datatype_vvvvwba == 'CHAR' || datatype_vvvvwba == 'VARCHAR' || datatype_vvvvwba == 'TEXT' || datatype_vvvvwba == 'MEDIUMTEXT' || datatype_vvvvwba == 'LONGTEXT' || datatype_vvvvwba == 'BLOB' || datatype_vvvvwba == 'TINYBLOB' || datatype_vvvvwba == 'MEDIUMBLOB' || datatype_vvvvwba == 'LONGBLOB')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwax function
|
||||
function vvvvwax(store_vvvvwax,datatype_vvvvwax)
|
||||
// the vvvvwbb function
|
||||
function vvvvwbb(store_vvvvwbb,datatype_vvvvwbb)
|
||||
{
|
||||
if (isSet(store_vvvvwax) && store_vvvvwax.constructor !== Array)
|
||||
if (isSet(store_vvvvwbb) && store_vvvvwbb.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwax = store_vvvvwax;
|
||||
var store_vvvvwax = [];
|
||||
store_vvvvwax.push(temp_vvvvwax);
|
||||
var temp_vvvvwbb = store_vvvvwbb;
|
||||
var store_vvvvwbb = [];
|
||||
store_vvvvwbb.push(temp_vvvvwbb);
|
||||
}
|
||||
else if (!isSet(store_vvvvwax))
|
||||
else if (!isSet(store_vvvvwbb))
|
||||
{
|
||||
var store_vvvvwax = [];
|
||||
var store_vvvvwbb = [];
|
||||
}
|
||||
var store = store_vvvvwax.some(store_vvvvwax_SomeFunc);
|
||||
var store = store_vvvvwbb.some(store_vvvvwbb_SomeFunc);
|
||||
|
||||
if (isSet(datatype_vvvvwax) && datatype_vvvvwax.constructor !== Array)
|
||||
if (isSet(datatype_vvvvwbb) && datatype_vvvvwbb.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwax = datatype_vvvvwax;
|
||||
var datatype_vvvvwax = [];
|
||||
datatype_vvvvwax.push(temp_vvvvwax);
|
||||
var temp_vvvvwbb = datatype_vvvvwbb;
|
||||
var datatype_vvvvwbb = [];
|
||||
datatype_vvvvwbb.push(temp_vvvvwbb);
|
||||
}
|
||||
else if (!isSet(datatype_vvvvwax))
|
||||
else if (!isSet(datatype_vvvvwbb))
|
||||
{
|
||||
var datatype_vvvvwax = [];
|
||||
var datatype_vvvvwbb = [];
|
||||
}
|
||||
var datatype = datatype_vvvvwax.some(datatype_vvvvwax_SomeFunc);
|
||||
var datatype = datatype_vvvvwbb.some(datatype_vvvvwbb_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -313,33 +313,33 @@ function vvvvwax(store_vvvvwax,datatype_vvvvwax)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwax Some function
|
||||
function store_vvvvwax_SomeFunc(store_vvvvwax)
|
||||
// the vvvvwbb Some function
|
||||
function store_vvvvwbb_SomeFunc(store_vvvvwbb)
|
||||
{
|
||||
// set the function logic
|
||||
if (store_vvvvwax == 4)
|
||||
if (store_vvvvwbb == 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwax Some function
|
||||
function datatype_vvvvwax_SomeFunc(datatype_vvvvwax)
|
||||
// the vvvvwbb Some function
|
||||
function datatype_vvvvwbb_SomeFunc(datatype_vvvvwbb)
|
||||
{
|
||||
// set the function logic
|
||||
if (datatype_vvvvwax == 'CHAR' || datatype_vvvvwax == 'VARCHAR' || datatype_vvvvwax == 'TEXT' || datatype_vvvvwax == 'MEDIUMTEXT' || datatype_vvvvwax == 'LONGTEXT' || datatype_vvvvwax == 'BLOB' || datatype_vvvvwax == 'TINYBLOB' || datatype_vvvvwax == 'MEDIUMBLOB' || datatype_vvvvwax == 'LONGBLOB')
|
||||
if (datatype_vvvvwbb == 'CHAR' || datatype_vvvvwbb == 'VARCHAR' || datatype_vvvvwbb == 'TEXT' || datatype_vvvvwbb == 'MEDIUMTEXT' || datatype_vvvvwbb == 'LONGTEXT' || datatype_vvvvwbb == 'BLOB' || datatype_vvvvwbb == 'TINYBLOB' || datatype_vvvvwbb == 'MEDIUMBLOB' || datatype_vvvvwbb == 'LONGBLOB')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwaz function
|
||||
function vvvvwaz(add_css_view_vvvvwaz)
|
||||
// the vvvvwbd function
|
||||
function vvvvwbd(add_css_view_vvvvwbd)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_view_vvvvwaz == 1)
|
||||
if (add_css_view_vvvvwbd == 1)
|
||||
{
|
||||
jQuery('#jform_css_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -349,11 +349,11 @@ function vvvvwaz(add_css_view_vvvvwaz)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwba function
|
||||
function vvvvwba(add_css_views_vvvvwba)
|
||||
// the vvvvwbe function
|
||||
function vvvvwbe(add_css_views_vvvvwbe)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_views_vvvvwba == 1)
|
||||
if (add_css_views_vvvvwbe == 1)
|
||||
{
|
||||
jQuery('#jform_css_views-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -363,11 +363,11 @@ function vvvvwba(add_css_views_vvvvwba)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbb function
|
||||
function vvvvwbb(add_javascript_view_footer_vvvvwbb)
|
||||
// the vvvvwbf function
|
||||
function vvvvwbf(add_javascript_view_footer_vvvvwbf)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_view_footer_vvvvwbb == 1)
|
||||
if (add_javascript_view_footer_vvvvwbf == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_view_footer-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -377,11 +377,11 @@ function vvvvwbb(add_javascript_view_footer_vvvvwbb)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbc function
|
||||
function vvvvwbc(add_javascript_views_footer_vvvvwbc)
|
||||
// the vvvvwbg function
|
||||
function vvvvwbg(add_javascript_views_footer_vvvvwbg)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_views_footer_vvvvwbc == 1)
|
||||
if (add_javascript_views_footer_vvvvwbg == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_views_footer-lbl').closest('.control-group').show();
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,112 +9,112 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwbzvyb_required = false;
|
||||
jform_vvvvwcavyc_required = false;
|
||||
jform_vvvvwcbvyd_required = false;
|
||||
jform_vvvvwccvye_required = false;
|
||||
jform_vvvvwcevyf_required = false;
|
||||
jform_vvvvwcdvyd_required = false;
|
||||
jform_vvvvwcevye_required = false;
|
||||
jform_vvvvwcfvyf_required = false;
|
||||
jform_vvvvwcgvyg_required = false;
|
||||
jform_vvvvwcivyh_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var location_vvvvwbz = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwbz(location_vvvvwbz);
|
||||
var location_vvvvwcd = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwcd(location_vvvvwcd);
|
||||
|
||||
var location_vvvvwca = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwca(location_vvvvwca);
|
||||
var location_vvvvwce = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwce(location_vvvvwce);
|
||||
|
||||
var type_vvvvwcb = jQuery("#jform_type").val();
|
||||
vvvvwcb(type_vvvvwcb);
|
||||
var type_vvvvwcf = jQuery("#jform_type").val();
|
||||
vvvvwcf(type_vvvvwcf);
|
||||
|
||||
var type_vvvvwcc = jQuery("#jform_type").val();
|
||||
vvvvwcc(type_vvvvwcc);
|
||||
var type_vvvvwcg = jQuery("#jform_type").val();
|
||||
vvvvwcg(type_vvvvwcg);
|
||||
|
||||
var type_vvvvwcd = jQuery("#jform_type").val();
|
||||
vvvvwcd(type_vvvvwcd);
|
||||
var type_vvvvwch = jQuery("#jform_type").val();
|
||||
vvvvwch(type_vvvvwch);
|
||||
|
||||
var target_vvvvwce = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwce(target_vvvvwce);
|
||||
var target_vvvvwci = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwci(target_vvvvwci);
|
||||
});
|
||||
|
||||
// the vvvvwbz function
|
||||
function vvvvwbz(location_vvvvwbz)
|
||||
// the vvvvwcd function
|
||||
function vvvvwcd(location_vvvvwcd)
|
||||
{
|
||||
// set the function logic
|
||||
if (location_vvvvwbz == 1)
|
||||
if (location_vvvvwcd == 1)
|
||||
{
|
||||
jQuery('#jform_admin_view').closest('.control-group').show();
|
||||
// add required attribute to admin_view field
|
||||
if (jform_vvvvwbzvyb_required)
|
||||
if (jform_vvvvwcdvyd_required)
|
||||
{
|
||||
updateFieldRequired('admin_view',0);
|
||||
jQuery('#jform_admin_view').prop('required','required');
|
||||
jQuery('#jform_admin_view').attr('aria-required',true);
|
||||
jQuery('#jform_admin_view').addClass('required');
|
||||
jform_vvvvwbzvyb_required = false;
|
||||
jform_vvvvwcdvyd_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_admin_view').closest('.control-group').hide();
|
||||
// remove required attribute from admin_view field
|
||||
if (!jform_vvvvwbzvyb_required)
|
||||
if (!jform_vvvvwcdvyd_required)
|
||||
{
|
||||
updateFieldRequired('admin_view',1);
|
||||
jQuery('#jform_admin_view').removeAttr('required');
|
||||
jQuery('#jform_admin_view').removeAttr('aria-required');
|
||||
jQuery('#jform_admin_view').removeClass('required');
|
||||
jform_vvvvwbzvyb_required = true;
|
||||
jform_vvvvwcdvyd_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwca function
|
||||
function vvvvwca(location_vvvvwca)
|
||||
// the vvvvwce function
|
||||
function vvvvwce(location_vvvvwce)
|
||||
{
|
||||
// set the function logic
|
||||
if (location_vvvvwca == 2)
|
||||
if (location_vvvvwce == 2)
|
||||
{
|
||||
jQuery('#jform_site_view').closest('.control-group').show();
|
||||
// add required attribute to site_view field
|
||||
if (jform_vvvvwcavyc_required)
|
||||
if (jform_vvvvwcevye_required)
|
||||
{
|
||||
updateFieldRequired('site_view',0);
|
||||
jQuery('#jform_site_view').prop('required','required');
|
||||
jQuery('#jform_site_view').attr('aria-required',true);
|
||||
jQuery('#jform_site_view').addClass('required');
|
||||
jform_vvvvwcavyc_required = false;
|
||||
jform_vvvvwcevye_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_site_view').closest('.control-group').hide();
|
||||
// remove required attribute from site_view field
|
||||
if (!jform_vvvvwcavyc_required)
|
||||
if (!jform_vvvvwcevye_required)
|
||||
{
|
||||
updateFieldRequired('site_view',1);
|
||||
jQuery('#jform_site_view').removeAttr('required');
|
||||
jQuery('#jform_site_view').removeAttr('aria-required');
|
||||
jQuery('#jform_site_view').removeClass('required');
|
||||
jform_vvvvwcavyc_required = true;
|
||||
jform_vvvvwcevye_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcb function
|
||||
function vvvvwcb(type_vvvvwcb)
|
||||
// the vvvvwcf function
|
||||
function vvvvwcf(type_vvvvwcf)
|
||||
{
|
||||
if (isSet(type_vvvvwcb) && type_vvvvwcb.constructor !== Array)
|
||||
if (isSet(type_vvvvwcf) && type_vvvvwcf.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcb = type_vvvvwcb;
|
||||
var type_vvvvwcb = [];
|
||||
type_vvvvwcb.push(temp_vvvvwcb);
|
||||
var temp_vvvvwcf = type_vvvvwcf;
|
||||
var type_vvvvwcf = [];
|
||||
type_vvvvwcf.push(temp_vvvvwcf);
|
||||
}
|
||||
else if (!isSet(type_vvvvwcb))
|
||||
else if (!isSet(type_vvvvwcf))
|
||||
{
|
||||
var type_vvvvwcb = [];
|
||||
var type_vvvvwcf = [];
|
||||
}
|
||||
var type = type_vvvvwcb.some(type_vvvvwcb_SomeFunc);
|
||||
var type = type_vvvvwcf.some(type_vvvvwcf_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -122,55 +122,55 @@ function vvvvwcb(type_vvvvwcb)
|
||||
{
|
||||
jQuery('#jform_url').closest('.control-group').show();
|
||||
// add required attribute to url field
|
||||
if (jform_vvvvwcbvyd_required)
|
||||
if (jform_vvvvwcfvyf_required)
|
||||
{
|
||||
updateFieldRequired('url',0);
|
||||
jQuery('#jform_url').prop('required','required');
|
||||
jQuery('#jform_url').attr('aria-required',true);
|
||||
jQuery('#jform_url').addClass('required');
|
||||
jform_vvvvwcbvyd_required = false;
|
||||
jform_vvvvwcfvyf_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_url').closest('.control-group').hide();
|
||||
// remove required attribute from url field
|
||||
if (!jform_vvvvwcbvyd_required)
|
||||
if (!jform_vvvvwcfvyf_required)
|
||||
{
|
||||
updateFieldRequired('url',1);
|
||||
jQuery('#jform_url').removeAttr('required');
|
||||
jQuery('#jform_url').removeAttr('aria-required');
|
||||
jQuery('#jform_url').removeClass('required');
|
||||
jform_vvvvwcbvyd_required = true;
|
||||
jform_vvvvwcfvyf_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcb Some function
|
||||
function type_vvvvwcb_SomeFunc(type_vvvvwcb)
|
||||
// the vvvvwcf Some function
|
||||
function type_vvvvwcf_SomeFunc(type_vvvvwcf)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwcb == 3)
|
||||
if (type_vvvvwcf == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcc function
|
||||
function vvvvwcc(type_vvvvwcc)
|
||||
// the vvvvwcg function
|
||||
function vvvvwcg(type_vvvvwcg)
|
||||
{
|
||||
if (isSet(type_vvvvwcc) && type_vvvvwcc.constructor !== Array)
|
||||
if (isSet(type_vvvvwcg) && type_vvvvwcg.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcc = type_vvvvwcc;
|
||||
var type_vvvvwcc = [];
|
||||
type_vvvvwcc.push(temp_vvvvwcc);
|
||||
var temp_vvvvwcg = type_vvvvwcg;
|
||||
var type_vvvvwcg = [];
|
||||
type_vvvvwcg.push(temp_vvvvwcg);
|
||||
}
|
||||
else if (!isSet(type_vvvvwcc))
|
||||
else if (!isSet(type_vvvvwcg))
|
||||
{
|
||||
var type_vvvvwcc = [];
|
||||
var type_vvvvwcg = [];
|
||||
}
|
||||
var type = type_vvvvwcc.some(type_vvvvwcc_SomeFunc);
|
||||
var type = type_vvvvwcg.some(type_vvvvwcg_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -178,55 +178,55 @@ function vvvvwcc(type_vvvvwcc)
|
||||
{
|
||||
jQuery('#jform_article').closest('.control-group').show();
|
||||
// add required attribute to article field
|
||||
if (jform_vvvvwccvye_required)
|
||||
if (jform_vvvvwcgvyg_required)
|
||||
{
|
||||
updateFieldRequired('article',0);
|
||||
jQuery('#jform_article').prop('required','required');
|
||||
jQuery('#jform_article').attr('aria-required',true);
|
||||
jQuery('#jform_article').addClass('required');
|
||||
jform_vvvvwccvye_required = false;
|
||||
jform_vvvvwcgvyg_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_article').closest('.control-group').hide();
|
||||
// remove required attribute from article field
|
||||
if (!jform_vvvvwccvye_required)
|
||||
if (!jform_vvvvwcgvyg_required)
|
||||
{
|
||||
updateFieldRequired('article',1);
|
||||
jQuery('#jform_article').removeAttr('required');
|
||||
jQuery('#jform_article').removeAttr('aria-required');
|
||||
jQuery('#jform_article').removeClass('required');
|
||||
jform_vvvvwccvye_required = true;
|
||||
jform_vvvvwcgvyg_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcc Some function
|
||||
function type_vvvvwcc_SomeFunc(type_vvvvwcc)
|
||||
// the vvvvwcg Some function
|
||||
function type_vvvvwcg_SomeFunc(type_vvvvwcg)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwcc == 1)
|
||||
if (type_vvvvwcg == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcd function
|
||||
function vvvvwcd(type_vvvvwcd)
|
||||
// the vvvvwch function
|
||||
function vvvvwch(type_vvvvwch)
|
||||
{
|
||||
if (isSet(type_vvvvwcd) && type_vvvvwcd.constructor !== Array)
|
||||
if (isSet(type_vvvvwch) && type_vvvvwch.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcd = type_vvvvwcd;
|
||||
var type_vvvvwcd = [];
|
||||
type_vvvvwcd.push(temp_vvvvwcd);
|
||||
var temp_vvvvwch = type_vvvvwch;
|
||||
var type_vvvvwch = [];
|
||||
type_vvvvwch.push(temp_vvvvwch);
|
||||
}
|
||||
else if (!isSet(type_vvvvwcd))
|
||||
else if (!isSet(type_vvvvwch))
|
||||
{
|
||||
var type_vvvvwcd = [];
|
||||
var type_vvvvwch = [];
|
||||
}
|
||||
var type = type_vvvvwcd.some(type_vvvvwcd_SomeFunc);
|
||||
var type = type_vvvvwch.some(type_vvvvwch_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -240,45 +240,45 @@ function vvvvwcd(type_vvvvwcd)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcd Some function
|
||||
function type_vvvvwcd_SomeFunc(type_vvvvwcd)
|
||||
// the vvvvwch Some function
|
||||
function type_vvvvwch_SomeFunc(type_vvvvwch)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwcd == 2)
|
||||
if (type_vvvvwch == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwce function
|
||||
function vvvvwce(target_vvvvwce)
|
||||
// the vvvvwci function
|
||||
function vvvvwci(target_vvvvwci)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwce == 1)
|
||||
if (target_vvvvwci == 1)
|
||||
{
|
||||
jQuery('#jform_groups').closest('.control-group').show();
|
||||
// add required attribute to groups field
|
||||
if (jform_vvvvwcevyf_required)
|
||||
if (jform_vvvvwcivyh_required)
|
||||
{
|
||||
updateFieldRequired('groups',0);
|
||||
jQuery('#jform_groups').prop('required','required');
|
||||
jQuery('#jform_groups').attr('aria-required',true);
|
||||
jQuery('#jform_groups').addClass('required');
|
||||
jform_vvvvwcevyf_required = false;
|
||||
jform_vvvvwcivyh_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_groups').closest('.control-group').hide();
|
||||
// remove required attribute from groups field
|
||||
if (!jform_vvvvwcevyf_required)
|
||||
if (!jform_vvvvwcivyh_required)
|
||||
{
|
||||
updateFieldRequired('groups',1);
|
||||
jQuery('#jform_groups').removeAttr('required');
|
||||
jQuery('#jform_groups').removeAttr('aria-required');
|
||||
jQuery('#jform_groups').removeClass('required');
|
||||
jform_vvvvwcevyf_required = true;
|
||||
jform_vvvvwcivyh_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
491
admin/models/forms/joomla_plugin.js
Normal file
491
admin/models/forms/joomla_plugin.js
Normal file
@ -0,0 +1,491 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var class_extends_vvvvvxb = jQuery("#jform_class_extends").val();
|
||||
var joomla_plugin_group_vvvvvxb = jQuery("#jform_joomla_plugin_group").val();
|
||||
vvvvvxb(class_extends_vvvvvxb,joomla_plugin_group_vvvvvxb);
|
||||
|
||||
var joomla_plugin_group_vvvvvxc = jQuery("#jform_joomla_plugin_group").val();
|
||||
var class_extends_vvvvvxc = jQuery("#jform_class_extends").val();
|
||||
vvvvvxc(joomla_plugin_group_vvvvvxc,class_extends_vvvvvxc);
|
||||
});
|
||||
|
||||
// the vvvvvxb function
|
||||
function vvvvvxb(class_extends_vvvvvxb,joomla_plugin_group_vvvvvxb)
|
||||
{
|
||||
if (isSet(class_extends_vvvvvxb) && class_extends_vvvvvxb.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvvxb = class_extends_vvvvvxb;
|
||||
var class_extends_vvvvvxb = [];
|
||||
class_extends_vvvvvxb.push(temp_vvvvvxb);
|
||||
}
|
||||
else if (!isSet(class_extends_vvvvvxb))
|
||||
{
|
||||
var class_extends_vvvvvxb = [];
|
||||
}
|
||||
var class_extends = class_extends_vvvvvxb.some(class_extends_vvvvvxb_SomeFunc);
|
||||
|
||||
if (isSet(joomla_plugin_group_vvvvvxb) && joomla_plugin_group_vvvvvxb.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvvxb = joomla_plugin_group_vvvvvxb;
|
||||
var joomla_plugin_group_vvvvvxb = [];
|
||||
joomla_plugin_group_vvvvvxb.push(temp_vvvvvxb);
|
||||
}
|
||||
else if (!isSet(joomla_plugin_group_vvvvvxb))
|
||||
{
|
||||
var joomla_plugin_group_vvvvvxb = [];
|
||||
}
|
||||
var joomla_plugin_group = joomla_plugin_group_vvvvvxb.some(joomla_plugin_group_vvvvvxb_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (class_extends && joomla_plugin_group)
|
||||
{
|
||||
jQuery('#jform_main_class_code-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_method_selection-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_property_selection-lbl').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_main_class_code-lbl').closest('.control-group').hide();
|
||||
jQuery('#jform_method_selection-lbl').closest('.control-group').hide();
|
||||
jQuery('#jform_property_selection-lbl').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxb Some function
|
||||
function class_extends_vvvvvxb_SomeFunc(class_extends_vvvvvxb)
|
||||
{
|
||||
// set the function logic
|
||||
if (isSet(class_extends_vvvvvxb))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvvxb Some function
|
||||
function joomla_plugin_group_vvvvvxb_SomeFunc(joomla_plugin_group_vvvvvxb)
|
||||
{
|
||||
// set the function logic
|
||||
if (isSet(joomla_plugin_group_vvvvvxb))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvvxc function
|
||||
function vvvvvxc(joomla_plugin_group_vvvvvxc,class_extends_vvvvvxc)
|
||||
{
|
||||
if (isSet(joomla_plugin_group_vvvvvxc) && joomla_plugin_group_vvvvvxc.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvvxc = joomla_plugin_group_vvvvvxc;
|
||||
var joomla_plugin_group_vvvvvxc = [];
|
||||
joomla_plugin_group_vvvvvxc.push(temp_vvvvvxc);
|
||||
}
|
||||
else if (!isSet(joomla_plugin_group_vvvvvxc))
|
||||
{
|
||||
var joomla_plugin_group_vvvvvxc = [];
|
||||
}
|
||||
var joomla_plugin_group = joomla_plugin_group_vvvvvxc.some(joomla_plugin_group_vvvvvxc_SomeFunc);
|
||||
|
||||
if (isSet(class_extends_vvvvvxc) && class_extends_vvvvvxc.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvvxc = class_extends_vvvvvxc;
|
||||
var class_extends_vvvvvxc = [];
|
||||
class_extends_vvvvvxc.push(temp_vvvvvxc);
|
||||
}
|
||||
else if (!isSet(class_extends_vvvvvxc))
|
||||
{
|
||||
var class_extends_vvvvvxc = [];
|
||||
}
|
||||
var class_extends = class_extends_vvvvvxc.some(class_extends_vvvvvxc_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (joomla_plugin_group && class_extends)
|
||||
{
|
||||
jQuery('#jform_main_class_code-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_method_selection-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_property_selection-lbl').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_main_class_code-lbl').closest('.control-group').hide();
|
||||
jQuery('#jform_method_selection-lbl').closest('.control-group').hide();
|
||||
jQuery('#jform_property_selection-lbl').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvxc Some function
|
||||
function joomla_plugin_group_vvvvvxc_SomeFunc(joomla_plugin_group_vvvvvxc)
|
||||
{
|
||||
// set the function logic
|
||||
if (isSet(joomla_plugin_group_vvvvvxc))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvvxc Some function
|
||||
function class_extends_vvvvvxc_SomeFunc(class_extends_vvvvvxc)
|
||||
{
|
||||
// set the function logic
|
||||
if (isSet(class_extends_vvvvvxc))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the isSet function
|
||||
function isSet(val)
|
||||
{
|
||||
if ((val != undefined) && (val != null) && 0 !== val.length){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
// load the active array values
|
||||
buildSelectionArray('property');
|
||||
buildSelectionArray('method');
|
||||
// set joomla_plugin_group Array
|
||||
selectionArray['joomla_plugin_group'] = {};
|
||||
jQuery("#jform_joomla_plugin_group option").each(function() {
|
||||
var key = jQuery(this).val();
|
||||
var text = jQuery(this).text();
|
||||
selectionArray['joomla_plugin_group'][key] = text;
|
||||
});
|
||||
// load the active selection array values
|
||||
getClassCodeIds('joomla_plugin_group', 'jform_class_extends', false);
|
||||
getClassCodeIds('property', 'jform_joomla_plugin_group', false);
|
||||
getClassCodeIds('method', 'jform_joomla_plugin_group', false);
|
||||
// load the used in div
|
||||
// jQuery('#usedin').show();
|
||||
// check and load all the customcode edit buttons
|
||||
// setTimeout(getEditCustomCodeButtons, 300);
|
||||
|
||||
rowWatcher();
|
||||
});
|
||||
|
||||
function getClassStuff_server(id, type, callingName){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax."+callingName+"&format=json&raw=true");
|
||||
if(token.length > 0 && id > 0 && type.length > 0){
|
||||
var request = token+'=1&type=' + type + '&id=' + id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
|
||||
function getClassCodeIds(type, target_field, reset_all){
|
||||
// now get the value
|
||||
var value = jQuery('#'+target_field).val();
|
||||
// now get the code
|
||||
getClassStuff_server(value, type, 'getClassCodeIds').done(function(result) {
|
||||
if(result){
|
||||
// reset the selection
|
||||
selectionActiveArray[type] = {};
|
||||
// update the active array
|
||||
jQuery.each( result, function(i, prop) {
|
||||
selectionActiveArray[type][prop] = selectionArray[type][prop];
|
||||
});
|
||||
// update the active field selection
|
||||
updateActiveFieldSelection(type, reset_all);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateActiveFieldSelection(type, reset_all){
|
||||
// update the selection options
|
||||
if ('joomla_plugin_group' === type) {
|
||||
// get value if not going to reset all
|
||||
if (!reset_all){
|
||||
// get the active values
|
||||
var activeValue = jQuery("#jform_"+type+" option:selected").val();
|
||||
var activeText = jQuery("#jform_"+type+" option:selected").text();
|
||||
// clear the options out
|
||||
jQuery("#jform_"+type).find('option').remove().end();
|
||||
// add the active selection back (must be what is available)
|
||||
jQuery("#jform_"+type).append('<option value="'+activeValue+'">'+activeText+'</option>');
|
||||
// now add the lists back
|
||||
jQuery.each( selectionActiveArray[type], function(aValue, aText ) {
|
||||
if (activeValue !== aValue) {
|
||||
jQuery("#jform_"+type).append('<option value="'+aValue+'">'+aText+'</option>');
|
||||
}
|
||||
});
|
||||
jQuery("#jform_"+type).val(activeValue);
|
||||
} else {
|
||||
// clear the options out
|
||||
jQuery("#jform_"+type).find('option').remove().end();
|
||||
// now add the lists back
|
||||
jQuery.each( selectionActiveArray[type], function(aValue, aText ) {
|
||||
jQuery("#jform_"+type).append('<option value="'+aValue+'">'+aText+'</option>');
|
||||
});
|
||||
jQuery("#jform_"+type).val('');
|
||||
}
|
||||
jQuery("#jform_"+type).trigger('liszt:updated');
|
||||
// reset all when global update is made
|
||||
if (reset_all) {
|
||||
resetAll('method');
|
||||
resetAll('property');
|
||||
}
|
||||
} else {
|
||||
selectionDynamicUpdate(type);
|
||||
// reset all when global update is made
|
||||
if (reset_all) {
|
||||
resetAll(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resetAll(type) {
|
||||
var i;
|
||||
for (i = 0; i < 10; i++) {
|
||||
// build ID
|
||||
var id_check = 'jform_'+type+'_selection'+'__'+type+'_selection'+i+'__'+type;
|
||||
// first check if Id is on page as that not the same as the one currently calling
|
||||
if (jQuery("#"+id_check).length) {
|
||||
if (i == 0) {
|
||||
jQuery('#'+id_check).val('');
|
||||
jQuery('#'+id_check).trigger('liszt:updated');
|
||||
} else {
|
||||
// remove the row
|
||||
jQuery('#'+id_check).closest('tr').remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
Joomla.editors.instances['jform_main_class_code'].setValue('');
|
||||
}
|
||||
|
||||
function getClassCode(field, type){
|
||||
// get the ID
|
||||
var id = jQuery(field).attr('id');
|
||||
// now get the value
|
||||
var value = jQuery('#' + id).val();
|
||||
if (propertyIsSet(value, id, type)) {
|
||||
// reset the selection
|
||||
jQuery('#'+id).val('');
|
||||
jQuery('#'+id).trigger("liszt:updated");
|
||||
// give out a notice
|
||||
jQuery.UIkit.notify({message: Joomla.JText._('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER'), timeout: 5000, status: 'warning', pos: 'top-center'});
|
||||
} else {
|
||||
// set the active removed value
|
||||
selectedIdRemoved[type] = value;
|
||||
// do a dynamic update (to remove what was already used)
|
||||
selectionDynamicUpdate(type);
|
||||
// now get the code
|
||||
getClassStuff_server(value, type, 'getClassCode').done(function(result) {
|
||||
if(result){
|
||||
if (Joomla.editors.instances.hasOwnProperty("jform_main_class_code")) {
|
||||
var old_result = Joomla.editors.instances['jform_main_class_code'].getValue();
|
||||
if (old_result.length > 0) {
|
||||
// make sure not to load the same string twice
|
||||
if (old_result.indexOf(result) !== -1) {
|
||||
// reset the selection
|
||||
jQuery('#'+id).val('');
|
||||
jQuery('#'+id).trigger("liszt:updated");
|
||||
// give out a notice
|
||||
jQuery.UIkit.notify({message: Joomla.JText._('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER'), timeout: 5000, status: 'warning', pos: 'top-center'});
|
||||
} else {
|
||||
Joomla.editors.instances['jform_main_class_code'].setValue(old_result + "\n\n" + result);
|
||||
}
|
||||
} else {
|
||||
Joomla.editors.instances['jform_main_class_code'].setValue(result);
|
||||
}
|
||||
} else {
|
||||
var old_result = jQuery('textarea#jform_main_class_code').val();
|
||||
if (old_result.length > 0) {
|
||||
// make sure not to load the same string twice
|
||||
if (old_result.indexOf(result) !== -1) {
|
||||
// reset the selection
|
||||
jQuery('#'+id).val('');
|
||||
jQuery('#'+id).trigger("liszt:updated");
|
||||
// give out a notice
|
||||
jQuery.UIkit.notify({message: Joomla.JText._('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER'), timeout: 5000, status: 'warning', pos: 'top-center'});
|
||||
} else {
|
||||
jQuery('textarea#jform_main_class_code').val(old_result + "\n\n" + result);
|
||||
}
|
||||
} else {
|
||||
jQuery('textarea#jform_main_class_code').val(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// set selection the options
|
||||
selectionArray = {'property':{},'method':{}};
|
||||
selectionActiveArray = {'property':{},'method':{}};
|
||||
selectedIdRemoved = {'property':'not','method':'not'};
|
||||
justonce = {'property':1,'method':1};
|
||||
|
||||
function buildSelectionArray(type) {
|
||||
var i;
|
||||
for (i = 0; i < 10; i++) {
|
||||
// build ID
|
||||
var id_check = 'jform_'+type+'_selection'+'__'+type+'_selection'+i+'__'+type;
|
||||
// first check if Id is on page as that not the same as the one currently calling
|
||||
if (justonce[type] == 1 && jQuery("#"+id_check).length) {
|
||||
// set buckets
|
||||
jQuery("#"+id_check+" option").each(function() {
|
||||
var key = jQuery(this).val();
|
||||
var text = jQuery(this).text();
|
||||
selectionArray[type][key] = text;
|
||||
});
|
||||
justonce[type]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function selectionDynamicUpdate(type) {
|
||||
selectionAvailable = {};
|
||||
selectionSelectedArray = {};
|
||||
selectionTrackerArray = {};
|
||||
var i;
|
||||
for (i = 0; i < 70; i++) { // for now this is the number of field we should check
|
||||
// build ID
|
||||
var id_check = 'jform_'+type+'_selection'+'__'+type+'_selection'+i+'__'+type;
|
||||
// first check if Id is on page as that not the same as the one currently calling
|
||||
if (jQuery("#"+id_check).length && selectedIdRemoved[type] !== id_check) {
|
||||
// build the selected array
|
||||
var key = jQuery("#"+id_check+" option:selected").val();
|
||||
var text = jQuery("#"+id_check+" option:selected").text();
|
||||
selectionSelectedArray[key] = text;
|
||||
// keep track of the value set
|
||||
selectionTrackerArray[id_check] = key;
|
||||
// clear the options out
|
||||
jQuery("#"+id_check).find('option').remove().end();
|
||||
}
|
||||
}
|
||||
// trigger chosen on the list fields
|
||||
// jQuery('.'+type+'_selection_list').chosen({"disable_search_threshold":10,"search_contains":true,"allow_single_deselect":true,"placeholder_text_multiple":Joomla.JText._("COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS"),"placeholder_text_single":Joomla.JText._("COM_COMPONENTBUILDER_SELECT_A_PROPERTY"),"no_results_text":Joomla.JText._("COM_COMPONENTBUILDER_NO_RESULTS_MATCH")});
|
||||
// now build the list to keep
|
||||
jQuery.each( selectionActiveArray[type], function( prop, name ) {
|
||||
if (!selectionSelectedArray.hasOwnProperty(prop)) {
|
||||
selectionAvailable[prop] = name;
|
||||
}
|
||||
});
|
||||
// now add the lists back
|
||||
jQuery.each( selectionTrackerArray, function( tId, tKey ) {
|
||||
if (jQuery('#'+tId).length) {
|
||||
jQuery('#'+tId).append('<option value="'+tKey+'">'+selectionSelectedArray[tKey]+'</option>');
|
||||
jQuery.each( selectionAvailable, function( aKey, aValue ) {
|
||||
jQuery('#'+tId).append('<option value="'+aKey+'">'+aValue+'</option>');
|
||||
});
|
||||
jQuery('#'+tId).val(tKey);
|
||||
jQuery('#'+tId).trigger('liszt:updated');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function rowWatcher() {
|
||||
jQuery(document).on('subform-row-remove', function(event, row){
|
||||
// we first chck if this is a method call
|
||||
var valid_call = jQuery(row.innerHTML).find('.method_selection_list').attr('id');
|
||||
var type_call = 'method';
|
||||
if (!isSet(valid_call)){
|
||||
// now lets see if this is a property call
|
||||
var valid_call = jQuery(row.innerHTML).find('.property_selection_list').attr('id');
|
||||
var type_call = 'property';
|
||||
}
|
||||
// so lets update selection if call valid
|
||||
if (isSet(valid_call)){
|
||||
selectedIdRemoved[type_call] = valid_call;
|
||||
selectionDynamicUpdate(type_call);
|
||||
}
|
||||
});
|
||||
jQuery(document).on('subform-row-add', function(event, row){
|
||||
// we first chck if this is a method call
|
||||
var valid_call = jQuery(row.innerHTML).find('.method_selection_list').attr('id');
|
||||
var type_call = 'method';
|
||||
if (!isSet(valid_call)){
|
||||
// now lets see if this is a property call
|
||||
var valid_call = jQuery(row.innerHTML).find('.property_selection_list').attr('id');
|
||||
var type_call = 'property';
|
||||
}
|
||||
// so lets update selection if call valid
|
||||
if (isSet(valid_call)){
|
||||
selectedIdRemoved[type_call] = 'not';
|
||||
selectionDynamicUpdate(type_call);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function propertyIsSet(prop, id, type) {
|
||||
var i;
|
||||
for (i = 0; i < 70; i++) { // for now this is the number of field we should check
|
||||
// build ID
|
||||
var id_check = 'jform_'+type+'_selection'+'__'+type+'_selection'+i+'__'+type;
|
||||
// first check if Id is on page as that not the same as the one currently calling
|
||||
if (jQuery("#"+id_check).length && id_check != id) {
|
||||
// get the property value
|
||||
var tmp = jQuery("#"+id_check+" option:selected").val();
|
||||
// now validate
|
||||
if (tmp === prop) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
260
admin/models/forms/joomla_plugin.xml
Normal file
260
admin/models/forms/joomla_plugin.xml
Normal file
@ -0,0 +1,260 @@
|
||||
<?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_JOOMLA_PLUGIN_CREATED_DATE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_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_JOOMLA_PLUGIN_CREATED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_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_JOOMLA_PLUGIN_MODIFIED_DATE_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_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_JOOMLA_PLUGIN_MODIFIED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MODIFIED_BY_DESC"
|
||||
class="readonly"
|
||||
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"
|
||||
type="number"
|
||||
class="inputbox validate-ordering"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ORDERING_LABEL"
|
||||
description=""
|
||||
default="0"
|
||||
size="6"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Version Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="version"
|
||||
type="text"
|
||||
class="readonly"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_VERSION_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_VERSION_DESC"
|
||||
size="6"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Dynamic Fields. -->
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_MESSAGE"
|
||||
hint="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_HINT"
|
||||
/>
|
||||
<!-- Class_extends Field. Type: Classextends. (custom) -->
|
||||
<field
|
||||
type="classextends"
|
||||
name="class_extends"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default="0"
|
||||
required="true"
|
||||
button="true"
|
||||
/>
|
||||
<!-- Joomla_plugin_group Field. Type: Joomlaplugingroups. (custom) -->
|
||||
<field
|
||||
type="joomlaplugingroups"
|
||||
name="joomla_plugin_group"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default="0"
|
||||
required="true"
|
||||
button="true"
|
||||
/>
|
||||
<!-- Fields Field. Type: Subform. (joomla) -->
|
||||
<field
|
||||
type="subform"
|
||||
name="fields"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELDS_LABEL"
|
||||
layout="joomla.form.field.subform.repeatable-table"
|
||||
multiple="true"
|
||||
buttons="add,remove,move"
|
||||
icon="list"
|
||||
max="50">
|
||||
<form hidden="true" name="list_fields_modal" repeat="true">
|
||||
<!-- Field Field. Type: Fields. (custom) -->
|
||||
<field
|
||||
type="fields"
|
||||
name="field"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD_DESCRIPTION"
|
||||
class="list_class fieldFull"
|
||||
multiple="false"
|
||||
default=""
|
||||
required="true"
|
||||
button="false"
|
||||
/>
|
||||
<!-- Custom_value Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="custom_value"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CUSTOM_VALUE_LABEL"
|
||||
rows="2"
|
||||
cols="4"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CUSTOM_VALUE_DESCRIPTION"
|
||||
class="text_area"
|
||||
hint="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CUSTOM_VALUE_HINT"
|
||||
required="false"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
/>
|
||||
</form>
|
||||
</field>
|
||||
<!-- Main_class_code Field. Type: Editor. (joomla) -->
|
||||
<field
|
||||
type="editor"
|
||||
name="main_class_code"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE_DESCRIPTION"
|
||||
width="100%"
|
||||
height="800px"
|
||||
cols="40"
|
||||
rows="300"
|
||||
buttons="no"
|
||||
syntax="php"
|
||||
editor="codemirror|none"
|
||||
filter="raw"
|
||||
validate="code"
|
||||
/>
|
||||
<!-- Method_selection Field. Type: Subform. (joomla) -->
|
||||
<field
|
||||
type="subform"
|
||||
name="method_selection"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION_LABEL"
|
||||
layout="joomla.form.field.subform.repeatable-table"
|
||||
multiple="true"
|
||||
buttons="add,remove,move"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION_DESCRIPTION"
|
||||
icon="list"
|
||||
max="150"
|
||||
min="1">
|
||||
<form hidden="true" name="list_method_selection_modal" repeat="true">
|
||||
<!-- Method Field. Type: Pluginsclassmethods. (custom) -->
|
||||
<field
|
||||
type="pluginsclassmethods"
|
||||
name="method"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_LABEL"
|
||||
class="list_class span12 method_selection_list"
|
||||
multiple="false"
|
||||
default="0"
|
||||
onchange="getClassCode(this, 'method');"
|
||||
button="false"
|
||||
/>
|
||||
</form>
|
||||
</field>
|
||||
<!-- Property_selection Field. Type: Subform. (joomla) -->
|
||||
<field
|
||||
type="subform"
|
||||
name="property_selection"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION_LABEL"
|
||||
layout="joomla.form.field.subform.repeatable-table"
|
||||
multiple="true"
|
||||
buttons="add,remove,move"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION_DESCRIPTION"
|
||||
icon="list"
|
||||
max="150"
|
||||
min="1">
|
||||
<form hidden="true" name="list_property_selection_modal" repeat="true">
|
||||
<!-- Property Field. Type: Pluginsclassproperties. (custom) -->
|
||||
<field
|
||||
type="pluginsclassproperties"
|
||||
name="property"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_LABEL"
|
||||
class="list_class span12 property_selection_list"
|
||||
multiple="false"
|
||||
default="0"
|
||||
onchange="getClassCode(this, 'property');"
|
||||
button="false"
|
||||
/>
|
||||
</form>
|
||||
</field>
|
||||
<!-- Note_plugin Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_plugin" label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_PLUGIN_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_PLUGIN_DESCRIPTION" heading="h4" class="alert alert-info note_plugin" />
|
||||
<!-- Note_beta_stage Field. Type: Note. A None Database Field. (joomla) -->
|
||||
<field type="note" name="note_beta_stage" label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_BETA_STAGE_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_BETA_STAGE_DESCRIPTION" heading="h4" class="alert alert-warning note_beta_stage" />
|
||||
</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 joomla_plugin"
|
||||
translate_label="false"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
class="inputbox"
|
||||
component="com_componentbuilder"
|
||||
section="joomla_plugin"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
11
admin/models/forms/joomla_plugin_group.js
Normal file
11
admin/models/forms/joomla_plugin_group.js
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
138
admin/models/forms/joomla_plugin_group.xml
Normal file
138
admin/models/forms/joomla_plugin_group.xml
Normal file
@ -0,0 +1,138 @@
|
||||
<?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_JOOMLA_PLUGIN_GROUP_CREATED_DATE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_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_JOOMLA_PLUGIN_GROUP_CREATED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_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_JOOMLA_PLUGIN_GROUP_MODIFIED_DATE_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_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_JOOMLA_PLUGIN_GROUP_MODIFIED_BY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_BY_DESC"
|
||||
class="readonly"
|
||||
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"
|
||||
type="number"
|
||||
class="inputbox validate-ordering"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ORDERING_LABEL"
|
||||
description=""
|
||||
default="0"
|
||||
size="6"
|
||||
required="false"
|
||||
/>
|
||||
<!-- Version Field. Type: Text (joomla) -->
|
||||
<field
|
||||
name="version"
|
||||
type="text"
|
||||
class="readonly"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_VERSION_LABEL"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_VERSION_DESC"
|
||||
size="6"
|
||||
readonly="true"
|
||||
filter="unset"
|
||||
/>
|
||||
<!-- Dynamic Fields. -->
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="true"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_MESSAGE"
|
||||
hint="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_HINT"
|
||||
/>
|
||||
<!-- Class_extends Field. Type: Classextends. (custom) -->
|
||||
<field
|
||||
type="classextends"
|
||||
name="class_extends"
|
||||
label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_LABEL"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default="0"
|
||||
required="true"
|
||||
button="true"
|
||||
/>
|
||||
</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 joomla_plugin_group"
|
||||
translate_label="false"
|
||||
filter="rules"
|
||||
validate="rules"
|
||||
class="inputbox"
|
||||
component="com_componentbuilder"
|
||||
section="joomla_plugin_group"
|
||||
/>
|
||||
</fieldset>
|
||||
</form>
|
@ -11,15 +11,15 @@
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var add_php_view_vvvvvzf = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvzf(add_php_view_vvvvvzf);
|
||||
var add_php_view_vvvvvzh = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvzh(add_php_view_vvvvvzh);
|
||||
});
|
||||
|
||||
// the vvvvvzf function
|
||||
function vvvvvzf(add_php_view_vvvvvzf)
|
||||
// the vvvvvzh function
|
||||
function vvvvvzh(add_php_view_vvvvvzh)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_view_vvvvvzf == 1)
|
||||
if (add_php_view_vvvvvzh == 1)
|
||||
{
|
||||
jQuery('#jform_php_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
|
@ -9,24 +9,12 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwamvxd_required = false;
|
||||
jform_vvvvwasvxe_required = false;
|
||||
jform_vvvvwaqvxf_required = false;
|
||||
jform_vvvvwawvxg_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var how_vvvvwal = jQuery("#jform_how").val();
|
||||
vvvvwal(how_vvvvwal);
|
||||
|
||||
var how_vvvvwam = jQuery("#jform_how").val();
|
||||
vvvvwam(how_vvvvwam);
|
||||
|
||||
var how_vvvvwan = jQuery("#jform_how").val();
|
||||
vvvvwan(how_vvvvwan);
|
||||
|
||||
var how_vvvvwao = jQuery("#jform_how").val();
|
||||
vvvvwao(how_vvvvwao);
|
||||
|
||||
var how_vvvvwap = jQuery("#jform_how").val();
|
||||
vvvvwap(how_vvvvwap);
|
||||
|
||||
@ -36,180 +24,22 @@ jQuery(document).ready(function()
|
||||
var how_vvvvwar = jQuery("#jform_how").val();
|
||||
vvvvwar(how_vvvvwar);
|
||||
|
||||
var type_vvvvwas = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
vvvvwas(type_vvvvwas);
|
||||
var how_vvvvwas = jQuery("#jform_how").val();
|
||||
vvvvwas(how_vvvvwas);
|
||||
|
||||
var how_vvvvwat = jQuery("#jform_how").val();
|
||||
vvvvwat(how_vvvvwat);
|
||||
|
||||
var how_vvvvwau = jQuery("#jform_how").val();
|
||||
vvvvwau(how_vvvvwau);
|
||||
|
||||
var how_vvvvwav = jQuery("#jform_how").val();
|
||||
vvvvwav(how_vvvvwav);
|
||||
|
||||
var type_vvvvwaw = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
vvvvwaw(type_vvvvwaw);
|
||||
});
|
||||
|
||||
// the vvvvwal function
|
||||
function vvvvwal(how_vvvvwal)
|
||||
{
|
||||
if (isSet(how_vvvvwal) && how_vvvvwal.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwal = how_vvvvwal;
|
||||
var how_vvvvwal = [];
|
||||
how_vvvvwal.push(temp_vvvvwal);
|
||||
}
|
||||
else if (!isSet(how_vvvvwal))
|
||||
{
|
||||
var how_vvvvwal = [];
|
||||
}
|
||||
var how = how_vvvvwal.some(how_vvvvwal_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('#jform_addconditions-lbl').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_addconditions-lbl').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwal Some function
|
||||
function how_vvvvwal_SomeFunc(how_vvvvwal)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwal == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwam function
|
||||
function vvvvwam(how_vvvvwam)
|
||||
{
|
||||
if (isSet(how_vvvvwam) && how_vvvvwam.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwam = how_vvvvwam;
|
||||
var how_vvvvwam = [];
|
||||
how_vvvvwam.push(temp_vvvvwam);
|
||||
}
|
||||
else if (!isSet(how_vvvvwam))
|
||||
{
|
||||
var how_vvvvwam = [];
|
||||
}
|
||||
var how = how_vvvvwam.some(how_vvvvwam_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('#jform_php_setdocument').closest('.control-group').show();
|
||||
// add required attribute to php_setdocument field
|
||||
if (jform_vvvvwamvxd_required)
|
||||
{
|
||||
updateFieldRequired('php_setdocument',0);
|
||||
jQuery('#jform_php_setdocument').prop('required','required');
|
||||
jQuery('#jform_php_setdocument').attr('aria-required',true);
|
||||
jQuery('#jform_php_setdocument').addClass('required');
|
||||
jform_vvvvwamvxd_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_php_setdocument').closest('.control-group').hide();
|
||||
// remove required attribute from php_setdocument field
|
||||
if (!jform_vvvvwamvxd_required)
|
||||
{
|
||||
updateFieldRequired('php_setdocument',1);
|
||||
jQuery('#jform_php_setdocument').removeAttr('required');
|
||||
jQuery('#jform_php_setdocument').removeAttr('aria-required');
|
||||
jQuery('#jform_php_setdocument').removeClass('required');
|
||||
jform_vvvvwamvxd_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwam Some function
|
||||
function how_vvvvwam_SomeFunc(how_vvvvwam)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwam == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwan function
|
||||
function vvvvwan(how_vvvvwan)
|
||||
{
|
||||
if (isSet(how_vvvvwan) && how_vvvvwan.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwan = how_vvvvwan;
|
||||
var how_vvvvwan = [];
|
||||
how_vvvvwan.push(temp_vvvvwan);
|
||||
}
|
||||
else if (!isSet(how_vvvvwan))
|
||||
{
|
||||
var how_vvvvwan = [];
|
||||
}
|
||||
var how = how_vvvvwan.some(how_vvvvwan_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('.note_display_library_config').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_display_library_config').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwan Some function
|
||||
function how_vvvvwan_SomeFunc(how_vvvvwan)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwan == 2 || how_vvvvwan == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwao function
|
||||
function vvvvwao(how_vvvvwao)
|
||||
{
|
||||
if (isSet(how_vvvvwao) && how_vvvvwao.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwao = how_vvvvwao;
|
||||
var how_vvvvwao = [];
|
||||
how_vvvvwao.push(temp_vvvvwao);
|
||||
}
|
||||
else if (!isSet(how_vvvvwao))
|
||||
{
|
||||
var how_vvvvwao = [];
|
||||
}
|
||||
var how = how_vvvvwao.some(how_vvvvwao_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('.note_display_library_files_folders_urls').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwao Some function
|
||||
function how_vvvvwao_SomeFunc(how_vvvvwao)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwao == 1 || how_vvvvwao == 2 || how_vvvvwao == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwap function
|
||||
function vvvvwap(how_vvvvwap)
|
||||
{
|
||||
@ -229,15 +59,11 @@ function vvvvwap(how_vvvvwap)
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').show();
|
||||
jQuery('#jform_addconditions-lbl').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').hide();
|
||||
jQuery('#jform_addconditions-lbl').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,7 +71,7 @@ function vvvvwap(how_vvvvwap)
|
||||
function how_vvvvwap_SomeFunc(how_vvvvwap)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwap == 0)
|
||||
if (how_vvvvwap == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -271,13 +97,29 @@ function vvvvwaq(how_vvvvwaq)
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').show();
|
||||
jQuery('#jform_php_setdocument').closest('.control-group').show();
|
||||
// add required attribute to php_setdocument field
|
||||
if (jform_vvvvwaqvxf_required)
|
||||
{
|
||||
updateFieldRequired('php_setdocument',0);
|
||||
jQuery('#jform_php_setdocument').prop('required','required');
|
||||
jQuery('#jform_php_setdocument').attr('aria-required',true);
|
||||
jQuery('#jform_php_setdocument').addClass('required');
|
||||
jform_vvvvwaqvxf_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').hide();
|
||||
jQuery('#jform_php_setdocument').closest('.control-group').hide();
|
||||
// remove required attribute from php_setdocument field
|
||||
if (!jform_vvvvwaqvxf_required)
|
||||
{
|
||||
updateFieldRequired('php_setdocument',1);
|
||||
jQuery('#jform_php_setdocument').removeAttr('required');
|
||||
jQuery('#jform_php_setdocument').removeAttr('aria-required');
|
||||
jQuery('#jform_php_setdocument').removeClass('required');
|
||||
jform_vvvvwaqvxf_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,7 +127,7 @@ function vvvvwaq(how_vvvvwaq)
|
||||
function how_vvvvwaq_SomeFunc(how_vvvvwaq)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwaq == 1)
|
||||
if (how_vvvvwaq == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -308,6 +150,164 @@ function vvvvwar(how_vvvvwar)
|
||||
var how = how_vvvvwar.some(how_vvvvwar_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('.note_display_library_config').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_display_library_config').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwar Some function
|
||||
function how_vvvvwar_SomeFunc(how_vvvvwar)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwar == 2 || how_vvvvwar == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwas function
|
||||
function vvvvwas(how_vvvvwas)
|
||||
{
|
||||
if (isSet(how_vvvvwas) && how_vvvvwas.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwas = how_vvvvwas;
|
||||
var how_vvvvwas = [];
|
||||
how_vvvvwas.push(temp_vvvvwas);
|
||||
}
|
||||
else if (!isSet(how_vvvvwas))
|
||||
{
|
||||
var how_vvvvwas = [];
|
||||
}
|
||||
var how = how_vvvvwas.some(how_vvvvwas_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('.note_display_library_files_folders_urls').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwas Some function
|
||||
function how_vvvvwas_SomeFunc(how_vvvvwas)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwas == 1 || how_vvvvwas == 2 || how_vvvvwas == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwat function
|
||||
function vvvvwat(how_vvvvwat)
|
||||
{
|
||||
if (isSet(how_vvvvwat) && how_vvvvwat.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwat = how_vvvvwat;
|
||||
var how_vvvvwat = [];
|
||||
how_vvvvwat.push(temp_vvvvwat);
|
||||
}
|
||||
else if (!isSet(how_vvvvwat))
|
||||
{
|
||||
var how_vvvvwat = [];
|
||||
}
|
||||
var how = how_vvvvwat.some(how_vvvvwat_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwat Some function
|
||||
function how_vvvvwat_SomeFunc(how_vvvvwat)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwat == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwau function
|
||||
function vvvvwau(how_vvvvwau)
|
||||
{
|
||||
if (isSet(how_vvvvwau) && how_vvvvwau.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwau = how_vvvvwau;
|
||||
var how_vvvvwau = [];
|
||||
how_vvvvwau.push(temp_vvvvwau);
|
||||
}
|
||||
else if (!isSet(how_vvvvwau))
|
||||
{
|
||||
var how_vvvvwau = [];
|
||||
}
|
||||
var how = how_vvvvwau.some(how_vvvvwau_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwau Some function
|
||||
function how_vvvvwau_SomeFunc(how_vvvvwau)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwau == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwav function
|
||||
function vvvvwav(how_vvvvwav)
|
||||
{
|
||||
if (isSet(how_vvvvwav) && how_vvvvwav.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwav = how_vvvvwav;
|
||||
var how_vvvvwav = [];
|
||||
how_vvvvwav.push(temp_vvvvwav);
|
||||
}
|
||||
else if (!isSet(how_vvvvwav))
|
||||
{
|
||||
var how_vvvvwav = [];
|
||||
}
|
||||
var how = how_vvvvwav.some(how_vvvvwav_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how)
|
||||
{
|
||||
@ -323,45 +323,45 @@ function vvvvwar(how_vvvvwar)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwar Some function
|
||||
function how_vvvvwar_SomeFunc(how_vvvvwar)
|
||||
// the vvvvwav Some function
|
||||
function how_vvvvwav_SomeFunc(how_vvvvwav)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwar == 4)
|
||||
if (how_vvvvwav == 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwas function
|
||||
function vvvvwas(type_vvvvwas)
|
||||
// the vvvvwaw function
|
||||
function vvvvwaw(type_vvvvwaw)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwas == 2)
|
||||
if (type_vvvvwaw == 2)
|
||||
{
|
||||
jQuery('#jform_libraries').closest('.control-group').show();
|
||||
// add required attribute to libraries field
|
||||
if (jform_vvvvwasvxe_required)
|
||||
if (jform_vvvvwawvxg_required)
|
||||
{
|
||||
updateFieldRequired('libraries',0);
|
||||
jQuery('#jform_libraries').prop('required','required');
|
||||
jQuery('#jform_libraries').attr('aria-required',true);
|
||||
jQuery('#jform_libraries').addClass('required');
|
||||
jform_vvvvwasvxe_required = false;
|
||||
jform_vvvvwawvxg_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_libraries').closest('.control-group').hide();
|
||||
// remove required attribute from libraries field
|
||||
if (!jform_vvvvwasvxe_required)
|
||||
if (!jform_vvvvwawvxg_required)
|
||||
{
|
||||
updateFieldRequired('libraries',1);
|
||||
jQuery('#jform_libraries').removeAttr('required');
|
||||
jQuery('#jform_libraries').removeAttr('aria-required');
|
||||
jQuery('#jform_libraries').removeClass('required');
|
||||
jform_vvvvwasvxe_required = true;
|
||||
jform_vvvvwawvxg_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,32 +9,24 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwbpvxr_required = false;
|
||||
jform_vvvvwbpvxs_required = false;
|
||||
jform_vvvvwbpvxt_required = false;
|
||||
jform_vvvvwbpvxu_required = false;
|
||||
jform_vvvvwbpvxv_required = false;
|
||||
jform_vvvvwbqvxw_required = false;
|
||||
jform_vvvvwbrvxx_required = false;
|
||||
jform_vvvvwbtvxy_required = false;
|
||||
jform_vvvvwbtvxt_required = false;
|
||||
jform_vvvvwbtvxu_required = false;
|
||||
jform_vvvvwbtvxv_required = false;
|
||||
jform_vvvvwbtvxw_required = false;
|
||||
jform_vvvvwbtvxx_required = false;
|
||||
jform_vvvvwbuvxy_required = false;
|
||||
jform_vvvvwbvvxz_required = false;
|
||||
jform_vvvvwbxvya_required = false;
|
||||
jform_vvvvwbzvyb_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var protocol_vvvvwbp = jQuery("#jform_protocol").val();
|
||||
vvvvwbp(protocol_vvvvwbp);
|
||||
|
||||
var protocol_vvvvwbq = jQuery("#jform_protocol").val();
|
||||
vvvvwbq(protocol_vvvvwbq);
|
||||
|
||||
var protocol_vvvvwbr = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwbr = jQuery("#jform_authentication").val();
|
||||
vvvvwbr(protocol_vvvvwbr,authentication_vvvvwbr);
|
||||
|
||||
var protocol_vvvvwbt = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwbt = jQuery("#jform_authentication").val();
|
||||
vvvvwbt(protocol_vvvvwbt,authentication_vvvvwbt);
|
||||
vvvvwbt(protocol_vvvvwbt);
|
||||
|
||||
var protocol_vvvvwbu = jQuery("#jform_protocol").val();
|
||||
vvvvwbu(protocol_vvvvwbu);
|
||||
|
||||
var protocol_vvvvwbv = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwbv = jQuery("#jform_authentication").val();
|
||||
@ -43,285 +35,18 @@ jQuery(document).ready(function()
|
||||
var protocol_vvvvwbx = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwbx = jQuery("#jform_authentication").val();
|
||||
vvvvwbx(protocol_vvvvwbx,authentication_vvvvwbx);
|
||||
|
||||
var protocol_vvvvwbz = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwbz = jQuery("#jform_authentication").val();
|
||||
vvvvwbz(protocol_vvvvwbz,authentication_vvvvwbz);
|
||||
|
||||
var protocol_vvvvwcb = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwcb = jQuery("#jform_authentication").val();
|
||||
vvvvwcb(protocol_vvvvwcb,authentication_vvvvwcb);
|
||||
});
|
||||
|
||||
// the vvvvwbp function
|
||||
function vvvvwbp(protocol_vvvvwbp)
|
||||
{
|
||||
if (isSet(protocol_vvvvwbp) && protocol_vvvvwbp.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbp = protocol_vvvvwbp;
|
||||
var protocol_vvvvwbp = [];
|
||||
protocol_vvvvwbp.push(temp_vvvvwbp);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwbp))
|
||||
{
|
||||
var protocol_vvvvwbp = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwbp.some(protocol_vvvvwbp_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol)
|
||||
{
|
||||
jQuery('#jform_authentication').closest('.control-group').show();
|
||||
// add required attribute to authentication field
|
||||
if (jform_vvvvwbpvxr_required)
|
||||
{
|
||||
updateFieldRequired('authentication',0);
|
||||
jQuery('#jform_authentication').prop('required','required');
|
||||
jQuery('#jform_authentication').attr('aria-required',true);
|
||||
jQuery('#jform_authentication').addClass('required');
|
||||
jform_vvvvwbpvxr_required = false;
|
||||
}
|
||||
jQuery('#jform_host').closest('.control-group').show();
|
||||
// add required attribute to host field
|
||||
if (jform_vvvvwbpvxs_required)
|
||||
{
|
||||
updateFieldRequired('host',0);
|
||||
jQuery('#jform_host').prop('required','required');
|
||||
jQuery('#jform_host').attr('aria-required',true);
|
||||
jQuery('#jform_host').addClass('required');
|
||||
jform_vvvvwbpvxs_required = false;
|
||||
}
|
||||
jQuery('#jform_port').closest('.control-group').show();
|
||||
// add required attribute to port field
|
||||
if (jform_vvvvwbpvxt_required)
|
||||
{
|
||||
updateFieldRequired('port',0);
|
||||
jQuery('#jform_port').prop('required','required');
|
||||
jQuery('#jform_port').attr('aria-required',true);
|
||||
jQuery('#jform_port').addClass('required');
|
||||
jform_vvvvwbpvxt_required = false;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').show();
|
||||
// add required attribute to path field
|
||||
if (jform_vvvvwbpvxu_required)
|
||||
{
|
||||
updateFieldRequired('path',0);
|
||||
jQuery('#jform_path').prop('required','required');
|
||||
jQuery('#jform_path').attr('aria-required',true);
|
||||
jQuery('#jform_path').addClass('required');
|
||||
jform_vvvvwbpvxu_required = false;
|
||||
}
|
||||
jQuery('.note_ssh_security').closest('.control-group').show();
|
||||
jQuery('#jform_username').closest('.control-group').show();
|
||||
// add required attribute to username field
|
||||
if (jform_vvvvwbpvxv_required)
|
||||
{
|
||||
updateFieldRequired('username',0);
|
||||
jQuery('#jform_username').prop('required','required');
|
||||
jQuery('#jform_username').attr('aria-required',true);
|
||||
jQuery('#jform_username').addClass('required');
|
||||
jform_vvvvwbpvxv_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_authentication').closest('.control-group').hide();
|
||||
// remove required attribute from authentication field
|
||||
if (!jform_vvvvwbpvxr_required)
|
||||
{
|
||||
updateFieldRequired('authentication',1);
|
||||
jQuery('#jform_authentication').removeAttr('required');
|
||||
jQuery('#jform_authentication').removeAttr('aria-required');
|
||||
jQuery('#jform_authentication').removeClass('required');
|
||||
jform_vvvvwbpvxr_required = true;
|
||||
}
|
||||
jQuery('#jform_host').closest('.control-group').hide();
|
||||
// remove required attribute from host field
|
||||
if (!jform_vvvvwbpvxs_required)
|
||||
{
|
||||
updateFieldRequired('host',1);
|
||||
jQuery('#jform_host').removeAttr('required');
|
||||
jQuery('#jform_host').removeAttr('aria-required');
|
||||
jQuery('#jform_host').removeClass('required');
|
||||
jform_vvvvwbpvxs_required = true;
|
||||
}
|
||||
jQuery('#jform_port').closest('.control-group').hide();
|
||||
// remove required attribute from port field
|
||||
if (!jform_vvvvwbpvxt_required)
|
||||
{
|
||||
updateFieldRequired('port',1);
|
||||
jQuery('#jform_port').removeAttr('required');
|
||||
jQuery('#jform_port').removeAttr('aria-required');
|
||||
jQuery('#jform_port').removeClass('required');
|
||||
jform_vvvvwbpvxt_required = true;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').hide();
|
||||
// remove required attribute from path field
|
||||
if (!jform_vvvvwbpvxu_required)
|
||||
{
|
||||
updateFieldRequired('path',1);
|
||||
jQuery('#jform_path').removeAttr('required');
|
||||
jQuery('#jform_path').removeAttr('aria-required');
|
||||
jQuery('#jform_path').removeClass('required');
|
||||
jform_vvvvwbpvxu_required = true;
|
||||
}
|
||||
jQuery('.note_ssh_security').closest('.control-group').hide();
|
||||
jQuery('#jform_username').closest('.control-group').hide();
|
||||
// remove required attribute from username field
|
||||
if (!jform_vvvvwbpvxv_required)
|
||||
{
|
||||
updateFieldRequired('username',1);
|
||||
jQuery('#jform_username').removeAttr('required');
|
||||
jQuery('#jform_username').removeAttr('aria-required');
|
||||
jQuery('#jform_username').removeClass('required');
|
||||
jform_vvvvwbpvxv_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbp Some function
|
||||
function protocol_vvvvwbp_SomeFunc(protocol_vvvvwbp)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwbp == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbq function
|
||||
function vvvvwbq(protocol_vvvvwbq)
|
||||
{
|
||||
if (isSet(protocol_vvvvwbq) && protocol_vvvvwbq.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbq = protocol_vvvvwbq;
|
||||
var protocol_vvvvwbq = [];
|
||||
protocol_vvvvwbq.push(temp_vvvvwbq);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwbq))
|
||||
{
|
||||
var protocol_vvvvwbq = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwbq.some(protocol_vvvvwbq_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol)
|
||||
{
|
||||
jQuery('.note_ftp_signature').closest('.control-group').show();
|
||||
jQuery('#jform_signature').closest('.control-group').show();
|
||||
// add required attribute to signature field
|
||||
if (jform_vvvvwbqvxw_required)
|
||||
{
|
||||
updateFieldRequired('signature',0);
|
||||
jQuery('#jform_signature').prop('required','required');
|
||||
jQuery('#jform_signature').attr('aria-required',true);
|
||||
jQuery('#jform_signature').addClass('required');
|
||||
jform_vvvvwbqvxw_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_ftp_signature').closest('.control-group').hide();
|
||||
jQuery('#jform_signature').closest('.control-group').hide();
|
||||
// remove required attribute from signature field
|
||||
if (!jform_vvvvwbqvxw_required)
|
||||
{
|
||||
updateFieldRequired('signature',1);
|
||||
jQuery('#jform_signature').removeAttr('required');
|
||||
jQuery('#jform_signature').removeAttr('aria-required');
|
||||
jQuery('#jform_signature').removeClass('required');
|
||||
jform_vvvvwbqvxw_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbq Some function
|
||||
function protocol_vvvvwbq_SomeFunc(protocol_vvvvwbq)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwbq == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbr function
|
||||
function vvvvwbr(protocol_vvvvwbr,authentication_vvvvwbr)
|
||||
{
|
||||
if (isSet(protocol_vvvvwbr) && protocol_vvvvwbr.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbr = protocol_vvvvwbr;
|
||||
var protocol_vvvvwbr = [];
|
||||
protocol_vvvvwbr.push(temp_vvvvwbr);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwbr))
|
||||
{
|
||||
var protocol_vvvvwbr = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwbr.some(protocol_vvvvwbr_SomeFunc);
|
||||
|
||||
if (isSet(authentication_vvvvwbr) && authentication_vvvvwbr.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbr = authentication_vvvvwbr;
|
||||
var authentication_vvvvwbr = [];
|
||||
authentication_vvvvwbr.push(temp_vvvvwbr);
|
||||
}
|
||||
else if (!isSet(authentication_vvvvwbr))
|
||||
{
|
||||
var authentication_vvvvwbr = [];
|
||||
}
|
||||
var authentication = authentication_vvvvwbr.some(authentication_vvvvwbr_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_password').closest('.control-group').show();
|
||||
// add required attribute to password field
|
||||
if (jform_vvvvwbrvxx_required)
|
||||
{
|
||||
updateFieldRequired('password',0);
|
||||
jQuery('#jform_password').prop('required','required');
|
||||
jQuery('#jform_password').attr('aria-required',true);
|
||||
jQuery('#jform_password').addClass('required');
|
||||
jform_vvvvwbrvxx_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_password').closest('.control-group').hide();
|
||||
// remove required attribute from password field
|
||||
if (!jform_vvvvwbrvxx_required)
|
||||
{
|
||||
updateFieldRequired('password',1);
|
||||
jQuery('#jform_password').removeAttr('required');
|
||||
jQuery('#jform_password').removeAttr('aria-required');
|
||||
jQuery('#jform_password').removeClass('required');
|
||||
jform_vvvvwbrvxx_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbr Some function
|
||||
function protocol_vvvvwbr_SomeFunc(protocol_vvvvwbr)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwbr == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbr Some function
|
||||
function authentication_vvvvwbr_SomeFunc(authentication_vvvvwbr)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwbr == 1 || authentication_vvvvwbr == 3 || authentication_vvvvwbr == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbt function
|
||||
function vvvvwbt(protocol_vvvvwbt,authentication_vvvvwbt)
|
||||
function vvvvwbt(protocol_vvvvwbt)
|
||||
{
|
||||
if (isSet(protocol_vvvvwbt) && protocol_vvvvwbt.constructor !== Array)
|
||||
{
|
||||
@ -335,44 +60,114 @@ function vvvvwbt(protocol_vvvvwbt,authentication_vvvvwbt)
|
||||
}
|
||||
var protocol = protocol_vvvvwbt.some(protocol_vvvvwbt_SomeFunc);
|
||||
|
||||
if (isSet(authentication_vvvvwbt) && authentication_vvvvwbt.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbt = authentication_vvvvwbt;
|
||||
var authentication_vvvvwbt = [];
|
||||
authentication_vvvvwbt.push(temp_vvvvwbt);
|
||||
}
|
||||
else if (!isSet(authentication_vvvvwbt))
|
||||
{
|
||||
var authentication_vvvvwbt = [];
|
||||
}
|
||||
var authentication = authentication_vvvvwbt.some(authentication_vvvvwbt_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
if (protocol)
|
||||
{
|
||||
jQuery('#jform_private').closest('.control-group').show();
|
||||
// add required attribute to private field
|
||||
if (jform_vvvvwbtvxy_required)
|
||||
jQuery('#jform_authentication').closest('.control-group').show();
|
||||
// add required attribute to authentication field
|
||||
if (jform_vvvvwbtvxt_required)
|
||||
{
|
||||
updateFieldRequired('private',0);
|
||||
jQuery('#jform_private').prop('required','required');
|
||||
jQuery('#jform_private').attr('aria-required',true);
|
||||
jQuery('#jform_private').addClass('required');
|
||||
jform_vvvvwbtvxy_required = false;
|
||||
updateFieldRequired('authentication',0);
|
||||
jQuery('#jform_authentication').prop('required','required');
|
||||
jQuery('#jform_authentication').attr('aria-required',true);
|
||||
jQuery('#jform_authentication').addClass('required');
|
||||
jform_vvvvwbtvxt_required = false;
|
||||
}
|
||||
jQuery('#jform_host').closest('.control-group').show();
|
||||
// add required attribute to host field
|
||||
if (jform_vvvvwbtvxu_required)
|
||||
{
|
||||
updateFieldRequired('host',0);
|
||||
jQuery('#jform_host').prop('required','required');
|
||||
jQuery('#jform_host').attr('aria-required',true);
|
||||
jQuery('#jform_host').addClass('required');
|
||||
jform_vvvvwbtvxu_required = false;
|
||||
}
|
||||
jQuery('#jform_port').closest('.control-group').show();
|
||||
// add required attribute to port field
|
||||
if (jform_vvvvwbtvxv_required)
|
||||
{
|
||||
updateFieldRequired('port',0);
|
||||
jQuery('#jform_port').prop('required','required');
|
||||
jQuery('#jform_port').attr('aria-required',true);
|
||||
jQuery('#jform_port').addClass('required');
|
||||
jform_vvvvwbtvxv_required = false;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').show();
|
||||
// add required attribute to path field
|
||||
if (jform_vvvvwbtvxw_required)
|
||||
{
|
||||
updateFieldRequired('path',0);
|
||||
jQuery('#jform_path').prop('required','required');
|
||||
jQuery('#jform_path').attr('aria-required',true);
|
||||
jQuery('#jform_path').addClass('required');
|
||||
jform_vvvvwbtvxw_required = false;
|
||||
}
|
||||
jQuery('.note_ssh_security').closest('.control-group').show();
|
||||
jQuery('#jform_username').closest('.control-group').show();
|
||||
// add required attribute to username field
|
||||
if (jform_vvvvwbtvxx_required)
|
||||
{
|
||||
updateFieldRequired('username',0);
|
||||
jQuery('#jform_username').prop('required','required');
|
||||
jQuery('#jform_username').attr('aria-required',true);
|
||||
jQuery('#jform_username').addClass('required');
|
||||
jform_vvvvwbtvxx_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_private').closest('.control-group').hide();
|
||||
// remove required attribute from private field
|
||||
if (!jform_vvvvwbtvxy_required)
|
||||
jQuery('#jform_authentication').closest('.control-group').hide();
|
||||
// remove required attribute from authentication field
|
||||
if (!jform_vvvvwbtvxt_required)
|
||||
{
|
||||
updateFieldRequired('private',1);
|
||||
jQuery('#jform_private').removeAttr('required');
|
||||
jQuery('#jform_private').removeAttr('aria-required');
|
||||
jQuery('#jform_private').removeClass('required');
|
||||
jform_vvvvwbtvxy_required = true;
|
||||
updateFieldRequired('authentication',1);
|
||||
jQuery('#jform_authentication').removeAttr('required');
|
||||
jQuery('#jform_authentication').removeAttr('aria-required');
|
||||
jQuery('#jform_authentication').removeClass('required');
|
||||
jform_vvvvwbtvxt_required = true;
|
||||
}
|
||||
jQuery('#jform_host').closest('.control-group').hide();
|
||||
// remove required attribute from host field
|
||||
if (!jform_vvvvwbtvxu_required)
|
||||
{
|
||||
updateFieldRequired('host',1);
|
||||
jQuery('#jform_host').removeAttr('required');
|
||||
jQuery('#jform_host').removeAttr('aria-required');
|
||||
jQuery('#jform_host').removeClass('required');
|
||||
jform_vvvvwbtvxu_required = true;
|
||||
}
|
||||
jQuery('#jform_port').closest('.control-group').hide();
|
||||
// remove required attribute from port field
|
||||
if (!jform_vvvvwbtvxv_required)
|
||||
{
|
||||
updateFieldRequired('port',1);
|
||||
jQuery('#jform_port').removeAttr('required');
|
||||
jQuery('#jform_port').removeAttr('aria-required');
|
||||
jQuery('#jform_port').removeClass('required');
|
||||
jform_vvvvwbtvxv_required = true;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').hide();
|
||||
// remove required attribute from path field
|
||||
if (!jform_vvvvwbtvxw_required)
|
||||
{
|
||||
updateFieldRequired('path',1);
|
||||
jQuery('#jform_path').removeAttr('required');
|
||||
jQuery('#jform_path').removeAttr('aria-required');
|
||||
jQuery('#jform_path').removeClass('required');
|
||||
jform_vvvvwbtvxw_required = true;
|
||||
}
|
||||
jQuery('.note_ssh_security').closest('.control-group').hide();
|
||||
jQuery('#jform_username').closest('.control-group').hide();
|
||||
// remove required attribute from username field
|
||||
if (!jform_vvvvwbtvxx_required)
|
||||
{
|
||||
updateFieldRequired('username',1);
|
||||
jQuery('#jform_username').removeAttr('required');
|
||||
jQuery('#jform_username').removeAttr('aria-required');
|
||||
jQuery('#jform_username').removeClass('required');
|
||||
jform_vvvvwbtvxx_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -388,11 +183,58 @@ function protocol_vvvvwbt_SomeFunc(protocol_vvvvwbt)
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbt Some function
|
||||
function authentication_vvvvwbt_SomeFunc(authentication_vvvvwbt)
|
||||
// the vvvvwbu function
|
||||
function vvvvwbu(protocol_vvvvwbu)
|
||||
{
|
||||
if (isSet(protocol_vvvvwbu) && protocol_vvvvwbu.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbu = protocol_vvvvwbu;
|
||||
var protocol_vvvvwbu = [];
|
||||
protocol_vvvvwbu.push(temp_vvvvwbu);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwbu))
|
||||
{
|
||||
var protocol_vvvvwbu = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwbu.some(protocol_vvvvwbu_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol)
|
||||
{
|
||||
jQuery('.note_ftp_signature').closest('.control-group').show();
|
||||
jQuery('#jform_signature').closest('.control-group').show();
|
||||
// add required attribute to signature field
|
||||
if (jform_vvvvwbuvxy_required)
|
||||
{
|
||||
updateFieldRequired('signature',0);
|
||||
jQuery('#jform_signature').prop('required','required');
|
||||
jQuery('#jform_signature').attr('aria-required',true);
|
||||
jQuery('#jform_signature').addClass('required');
|
||||
jform_vvvvwbuvxy_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_ftp_signature').closest('.control-group').hide();
|
||||
jQuery('#jform_signature').closest('.control-group').hide();
|
||||
// remove required attribute from signature field
|
||||
if (!jform_vvvvwbuvxy_required)
|
||||
{
|
||||
updateFieldRequired('signature',1);
|
||||
jQuery('#jform_signature').removeAttr('required');
|
||||
jQuery('#jform_signature').removeAttr('aria-required');
|
||||
jQuery('#jform_signature').removeClass('required');
|
||||
jform_vvvvwbuvxy_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbu Some function
|
||||
function protocol_vvvvwbu_SomeFunc(protocol_vvvvwbu)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwbt == 2 || authentication_vvvvwbt == 3)
|
||||
if (protocol_vvvvwbu == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -430,27 +272,27 @@ function vvvvwbv(protocol_vvvvwbv,authentication_vvvvwbv)
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_private_key').closest('.control-group').show();
|
||||
// add required attribute to private_key field
|
||||
jQuery('#jform_password').closest('.control-group').show();
|
||||
// add required attribute to password field
|
||||
if (jform_vvvvwbvvxz_required)
|
||||
{
|
||||
updateFieldRequired('private_key',0);
|
||||
jQuery('#jform_private_key').prop('required','required');
|
||||
jQuery('#jform_private_key').attr('aria-required',true);
|
||||
jQuery('#jform_private_key').addClass('required');
|
||||
updateFieldRequired('password',0);
|
||||
jQuery('#jform_password').prop('required','required');
|
||||
jQuery('#jform_password').attr('aria-required',true);
|
||||
jQuery('#jform_password').addClass('required');
|
||||
jform_vvvvwbvvxz_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_private_key').closest('.control-group').hide();
|
||||
// remove required attribute from private_key field
|
||||
jQuery('#jform_password').closest('.control-group').hide();
|
||||
// remove required attribute from password field
|
||||
if (!jform_vvvvwbvvxz_required)
|
||||
{
|
||||
updateFieldRequired('private_key',1);
|
||||
jQuery('#jform_private_key').removeAttr('required');
|
||||
jQuery('#jform_private_key').removeAttr('aria-required');
|
||||
jQuery('#jform_private_key').removeClass('required');
|
||||
updateFieldRequired('password',1);
|
||||
jQuery('#jform_password').removeAttr('required');
|
||||
jQuery('#jform_password').removeAttr('aria-required');
|
||||
jQuery('#jform_password').removeClass('required');
|
||||
jform_vvvvwbvvxz_required = true;
|
||||
}
|
||||
}
|
||||
@ -471,7 +313,7 @@ function protocol_vvvvwbv_SomeFunc(protocol_vvvvwbv)
|
||||
function authentication_vvvvwbv_SomeFunc(authentication_vvvvwbv)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwbv == 4 || authentication_vvvvwbv == 5)
|
||||
if (authentication_vvvvwbv == 1 || authentication_vvvvwbv == 3 || authentication_vvvvwbv == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -509,11 +351,29 @@ function vvvvwbx(protocol_vvvvwbx,authentication_vvvvwbx)
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_secret').closest('.control-group').show();
|
||||
jQuery('#jform_private').closest('.control-group').show();
|
||||
// add required attribute to private field
|
||||
if (jform_vvvvwbxvya_required)
|
||||
{
|
||||
updateFieldRequired('private',0);
|
||||
jQuery('#jform_private').prop('required','required');
|
||||
jQuery('#jform_private').attr('aria-required',true);
|
||||
jQuery('#jform_private').addClass('required');
|
||||
jform_vvvvwbxvya_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_secret').closest('.control-group').hide();
|
||||
jQuery('#jform_private').closest('.control-group').hide();
|
||||
// remove required attribute from private field
|
||||
if (!jform_vvvvwbxvya_required)
|
||||
{
|
||||
updateFieldRequired('private',1);
|
||||
jQuery('#jform_private').removeAttr('required');
|
||||
jQuery('#jform_private').removeAttr('aria-required');
|
||||
jQuery('#jform_private').removeClass('required');
|
||||
jform_vvvvwbxvya_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,7 +392,147 @@ function protocol_vvvvwbx_SomeFunc(protocol_vvvvwbx)
|
||||
function authentication_vvvvwbx_SomeFunc(authentication_vvvvwbx)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwbx == 2 || authentication_vvvvwbx == 3 || authentication_vvvvwbx == 4 || authentication_vvvvwbx == 5)
|
||||
if (authentication_vvvvwbx == 2 || authentication_vvvvwbx == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbz function
|
||||
function vvvvwbz(protocol_vvvvwbz,authentication_vvvvwbz)
|
||||
{
|
||||
if (isSet(protocol_vvvvwbz) && protocol_vvvvwbz.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbz = protocol_vvvvwbz;
|
||||
var protocol_vvvvwbz = [];
|
||||
protocol_vvvvwbz.push(temp_vvvvwbz);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwbz))
|
||||
{
|
||||
var protocol_vvvvwbz = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwbz.some(protocol_vvvvwbz_SomeFunc);
|
||||
|
||||
if (isSet(authentication_vvvvwbz) && authentication_vvvvwbz.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbz = authentication_vvvvwbz;
|
||||
var authentication_vvvvwbz = [];
|
||||
authentication_vvvvwbz.push(temp_vvvvwbz);
|
||||
}
|
||||
else if (!isSet(authentication_vvvvwbz))
|
||||
{
|
||||
var authentication_vvvvwbz = [];
|
||||
}
|
||||
var authentication = authentication_vvvvwbz.some(authentication_vvvvwbz_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_private_key').closest('.control-group').show();
|
||||
// add required attribute to private_key field
|
||||
if (jform_vvvvwbzvyb_required)
|
||||
{
|
||||
updateFieldRequired('private_key',0);
|
||||
jQuery('#jform_private_key').prop('required','required');
|
||||
jQuery('#jform_private_key').attr('aria-required',true);
|
||||
jQuery('#jform_private_key').addClass('required');
|
||||
jform_vvvvwbzvyb_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_private_key').closest('.control-group').hide();
|
||||
// remove required attribute from private_key field
|
||||
if (!jform_vvvvwbzvyb_required)
|
||||
{
|
||||
updateFieldRequired('private_key',1);
|
||||
jQuery('#jform_private_key').removeAttr('required');
|
||||
jQuery('#jform_private_key').removeAttr('aria-required');
|
||||
jQuery('#jform_private_key').removeClass('required');
|
||||
jform_vvvvwbzvyb_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbz Some function
|
||||
function protocol_vvvvwbz_SomeFunc(protocol_vvvvwbz)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwbz == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbz Some function
|
||||
function authentication_vvvvwbz_SomeFunc(authentication_vvvvwbz)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwbz == 4 || authentication_vvvvwbz == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcb function
|
||||
function vvvvwcb(protocol_vvvvwcb,authentication_vvvvwcb)
|
||||
{
|
||||
if (isSet(protocol_vvvvwcb) && protocol_vvvvwcb.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcb = protocol_vvvvwcb;
|
||||
var protocol_vvvvwcb = [];
|
||||
protocol_vvvvwcb.push(temp_vvvvwcb);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwcb))
|
||||
{
|
||||
var protocol_vvvvwcb = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwcb.some(protocol_vvvvwcb_SomeFunc);
|
||||
|
||||
if (isSet(authentication_vvvvwcb) && authentication_vvvvwcb.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcb = authentication_vvvvwcb;
|
||||
var authentication_vvvvwcb = [];
|
||||
authentication_vvvvwcb.push(temp_vvvvwcb);
|
||||
}
|
||||
else if (!isSet(authentication_vvvvwcb))
|
||||
{
|
||||
var authentication_vvvvwcb = [];
|
||||
}
|
||||
var authentication = authentication_vvvvwcb.some(authentication_vvvvwcb_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_secret').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_secret').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcb Some function
|
||||
function protocol_vvvvwcb_SomeFunc(protocol_vvvvwcb)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwcb == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcb Some function
|
||||
function authentication_vvvvwcb_SomeFunc(authentication_vvvvwcb)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwcb == 2 || authentication_vvvvwcb == 3 || authentication_vvvvwcb == 4 || authentication_vvvvwcb == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -11,45 +11,45 @@
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var add_php_view_vvvvvyt = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvyt(add_php_view_vvvvvyt);
|
||||
var add_php_view_vvvvvyv = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvyv(add_php_view_vvvvvyv);
|
||||
|
||||
var add_php_jview_display_vvvvvyu = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val();
|
||||
vvvvvyu(add_php_jview_display_vvvvvyu);
|
||||
var add_php_jview_display_vvvvvyw = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val();
|
||||
vvvvvyw(add_php_jview_display_vvvvvyw);
|
||||
|
||||
var add_php_jview_vvvvvyv = jQuery("#jform_add_php_jview input[type='radio']:checked").val();
|
||||
vvvvvyv(add_php_jview_vvvvvyv);
|
||||
var add_php_jview_vvvvvyx = jQuery("#jform_add_php_jview input[type='radio']:checked").val();
|
||||
vvvvvyx(add_php_jview_vvvvvyx);
|
||||
|
||||
var add_php_document_vvvvvyw = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvyw(add_php_document_vvvvvyw);
|
||||
var add_php_document_vvvvvyy = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvyy(add_php_document_vvvvvyy);
|
||||
|
||||
var add_css_document_vvvvvyx = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||
vvvvvyx(add_css_document_vvvvvyx);
|
||||
var add_css_document_vvvvvyz = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||
vvvvvyz(add_css_document_vvvvvyz);
|
||||
|
||||
var add_javascript_file_vvvvvyy = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||
vvvvvyy(add_javascript_file_vvvvvyy);
|
||||
var add_javascript_file_vvvvvza = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||
vvvvvza(add_javascript_file_vvvvvza);
|
||||
|
||||
var add_js_document_vvvvvyz = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||
vvvvvyz(add_js_document_vvvvvyz);
|
||||
var add_js_document_vvvvvzb = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||
vvvvvzb(add_js_document_vvvvvzb);
|
||||
|
||||
var add_css_vvvvvza = jQuery("#jform_add_css input[type='radio']:checked").val();
|
||||
vvvvvza(add_css_vvvvvza);
|
||||
var add_css_vvvvvzc = jQuery("#jform_add_css input[type='radio']:checked").val();
|
||||
vvvvvzc(add_css_vvvvvzc);
|
||||
|
||||
var add_php_ajax_vvvvvzb = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvzb(add_php_ajax_vvvvvzb);
|
||||
var add_php_ajax_vvvvvzd = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvzd(add_php_ajax_vvvvvzd);
|
||||
|
||||
var add_custom_button_vvvvvzc = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvzc(add_custom_button_vvvvvzc);
|
||||
var add_custom_button_vvvvvze = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvze(add_custom_button_vvvvvze);
|
||||
|
||||
var button_position_vvvvvzd = jQuery("#jform_button_position").val();
|
||||
vvvvvzd(button_position_vvvvvzd);
|
||||
var button_position_vvvvvzf = jQuery("#jform_button_position").val();
|
||||
vvvvvzf(button_position_vvvvvzf);
|
||||
});
|
||||
|
||||
// the vvvvvyt function
|
||||
function vvvvvyt(add_php_view_vvvvvyt)
|
||||
// the vvvvvyv function
|
||||
function vvvvvyv(add_php_view_vvvvvyv)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_view_vvvvvyt == 1)
|
||||
if (add_php_view_vvvvvyv == 1)
|
||||
{
|
||||
jQuery('#jform_php_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -59,11 +59,11 @@ function vvvvvyt(add_php_view_vvvvvyt)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyu function
|
||||
function vvvvvyu(add_php_jview_display_vvvvvyu)
|
||||
// the vvvvvyw function
|
||||
function vvvvvyw(add_php_jview_display_vvvvvyw)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_jview_display_vvvvvyu == 1)
|
||||
if (add_php_jview_display_vvvvvyw == 1)
|
||||
{
|
||||
jQuery('#jform_php_jview_display-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -73,11 +73,11 @@ function vvvvvyu(add_php_jview_display_vvvvvyu)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyv function
|
||||
function vvvvvyv(add_php_jview_vvvvvyv)
|
||||
// the vvvvvyx function
|
||||
function vvvvvyx(add_php_jview_vvvvvyx)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_jview_vvvvvyv == 1)
|
||||
if (add_php_jview_vvvvvyx == 1)
|
||||
{
|
||||
jQuery('#jform_php_jview-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -87,11 +87,11 @@ function vvvvvyv(add_php_jview_vvvvvyv)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyw function
|
||||
function vvvvvyw(add_php_document_vvvvvyw)
|
||||
// the vvvvvyy function
|
||||
function vvvvvyy(add_php_document_vvvvvyy)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_document_vvvvvyw == 1)
|
||||
if (add_php_document_vvvvvyy == 1)
|
||||
{
|
||||
jQuery('#jform_php_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -101,11 +101,11 @@ function vvvvvyw(add_php_document_vvvvvyw)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyx function
|
||||
function vvvvvyx(add_css_document_vvvvvyx)
|
||||
// the vvvvvyz function
|
||||
function vvvvvyz(add_css_document_vvvvvyz)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_document_vvvvvyx == 1)
|
||||
if (add_css_document_vvvvvyz == 1)
|
||||
{
|
||||
jQuery('#jform_css_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -115,11 +115,11 @@ function vvvvvyx(add_css_document_vvvvvyx)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyy function
|
||||
function vvvvvyy(add_javascript_file_vvvvvyy)
|
||||
// the vvvvvza function
|
||||
function vvvvvza(add_javascript_file_vvvvvza)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_file_vvvvvyy == 1)
|
||||
if (add_javascript_file_vvvvvza == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_file-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -129,11 +129,11 @@ function vvvvvyy(add_javascript_file_vvvvvyy)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyz function
|
||||
function vvvvvyz(add_js_document_vvvvvyz)
|
||||
// the vvvvvzb function
|
||||
function vvvvvzb(add_js_document_vvvvvzb)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_js_document_vvvvvyz == 1)
|
||||
if (add_js_document_vvvvvzb == 1)
|
||||
{
|
||||
jQuery('#jform_js_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -143,11 +143,11 @@ function vvvvvyz(add_js_document_vvvvvyz)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvza function
|
||||
function vvvvvza(add_css_vvvvvza)
|
||||
// the vvvvvzc function
|
||||
function vvvvvzc(add_css_vvvvvzc)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_vvvvvza == 1)
|
||||
if (add_css_vvvvvzc == 1)
|
||||
{
|
||||
jQuery('#jform_css-lbl').closest('.control-group').show();
|
||||
}
|
||||
@ -157,11 +157,11 @@ function vvvvvza(add_css_vvvvvza)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvzb function
|
||||
function vvvvvzb(add_php_ajax_vvvvvzb)
|
||||
// the vvvvvzd function
|
||||
function vvvvvzd(add_php_ajax_vvvvvzd)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_ajax_vvvvvzb == 1)
|
||||
if (add_php_ajax_vvvvvzd == 1)
|
||||
{
|
||||
jQuery('#jform_ajax_input-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_ajaxmethod-lbl').closest('.control-group').show();
|
||||
@ -173,11 +173,11 @@ function vvvvvzb(add_php_ajax_vvvvvzb)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvzc function
|
||||
function vvvvvzc(add_custom_button_vvvvvzc)
|
||||
// the vvvvvze function
|
||||
function vvvvvze(add_custom_button_vvvvvze)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_button_vvvvvzc == 1)
|
||||
if (add_custom_button_vvvvvze == 1)
|
||||
{
|
||||
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_controller-lbl').closest('.control-group').show();
|
||||
@ -191,20 +191,20 @@ function vvvvvzc(add_custom_button_vvvvvzc)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvzd function
|
||||
function vvvvvzd(button_position_vvvvvzd)
|
||||
// the vvvvvzf function
|
||||
function vvvvvzf(button_position_vvvvvzf)
|
||||
{
|
||||
if (isSet(button_position_vvvvvzd) && button_position_vvvvvzd.constructor !== Array)
|
||||
if (isSet(button_position_vvvvvzf) && button_position_vvvvvzf.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvvzd = button_position_vvvvvzd;
|
||||
var button_position_vvvvvzd = [];
|
||||
button_position_vvvvvzd.push(temp_vvvvvzd);
|
||||
var temp_vvvvvzf = button_position_vvvvvzf;
|
||||
var button_position_vvvvvzf = [];
|
||||
button_position_vvvvvzf.push(temp_vvvvvzf);
|
||||
}
|
||||
else if (!isSet(button_position_vvvvvzd))
|
||||
else if (!isSet(button_position_vvvvvzf))
|
||||
{
|
||||
var button_position_vvvvvzd = [];
|
||||
var button_position_vvvvvzf = [];
|
||||
}
|
||||
var button_position = button_position_vvvvvzd.some(button_position_vvvvvzd_SomeFunc);
|
||||
var button_position = button_position_vvvvvzf.some(button_position_vvvvvzf_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@ -218,11 +218,11 @@ function vvvvvzd(button_position_vvvvvzd)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvzd Some function
|
||||
function button_position_vvvvvzd_SomeFunc(button_position_vvvvvzd)
|
||||
// the vvvvvzf Some function
|
||||
function button_position_vvvvvzf_SomeFunc(button_position_vvvvvzf)
|
||||
{
|
||||
// set the function logic
|
||||
if (button_position_vvvvvzd == 5)
|
||||
if (button_position_vvvvvzf == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -11,15 +11,15 @@
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
var add_php_view_vvvvvze = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvze(add_php_view_vvvvvze);
|
||||
var add_php_view_vvvvvzg = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvzg(add_php_view_vvvvvzg);
|
||||
});
|
||||
|
||||
// the vvvvvze function
|
||||
function vvvvvze(add_php_view_vvvvvze)
|
||||
// the vvvvvzg function
|
||||
function vvvvvzg(add_php_view_vvvvvzg)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_view_vvvvvze == 1)
|
||||
if (add_php_view_vvvvvzg == 1)
|
||||
{
|
||||
jQuery('#jform_php_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
|
@ -32,16 +32,16 @@ jQuery(document).ready(function()
|
||||
});
|
||||
|
||||
function getExistingValidationRuleCode_server(rulefilename){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getExistingValidationRuleCode&format=json");
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getExistingValidationRuleCode&format=json&raw=true");
|
||||
if(token.length > 0 && rulefilename.length > 0){
|
||||
var request = token+'=1&name='+rulefilename;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
|
||||
@ -84,16 +84,16 @@ function checkRuleName(ruleName) {
|
||||
}
|
||||
// check Function Name
|
||||
function checkRuleName_server(ruleName, ide){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.checkRuleName&format=json");
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.checkRuleName&format=json&raw=true");
|
||||
if(token.length > 0){
|
||||
var request = token+'=1&name='+ruleName+'&id='+ide;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'POST',
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
|
||||
|
1007
admin/models/joomla_plugin.php
Normal file
1007
admin/models/joomla_plugin.php
Normal file
File diff suppressed because it is too large
Load Diff
859
admin/models/joomla_plugin_group.php
Normal file
859
admin/models/joomla_plugin_group.php
Normal file
@ -0,0 +1,859 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
/**
|
||||
* Componentbuilder Joomla_plugin_group Model
|
||||
*/
|
||||
class ComponentbuilderModelJoomla_plugin_group extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tabLayoutFields = array(
|
||||
'details' => array(
|
||||
'left' => array(
|
||||
'name'
|
||||
),
|
||||
'right' => array(
|
||||
'class_extends'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* @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.joomla_plugin_group';
|
||||
|
||||
/**
|
||||
* 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 = 'joomla_plugin_group', $prefix = 'ComponentbuilderTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables');
|
||||
// get instance of the table
|
||||
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) && !is_array($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->id))
|
||||
{
|
||||
$item->tags = new JHelperTags;
|
||||
$item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin_group');
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.joomla_plugin_group', 'joomla_plugin_group', $options);
|
||||
|
||||
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.joomla_plugin_group.' . (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 view name
|
||||
$redirectedView = $jinput->get('ref', null, 'STRING');
|
||||
// Set field name (or fall back to view name)
|
||||
$redirectedField = $jinput->get('field', $redirectedView, 'STRING');
|
||||
// Set redirected view id
|
||||
$redirectedId = $jinput->get('refid', 0, 'INT');
|
||||
// Set field id (or fall back to redirected view id)
|
||||
$redirectedValue = $jinput->get('field_id', $redirectedId, '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/joomla_plugin_group.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.joomla_plugin_group.' . (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.joomla_plugin_group.' . (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.joomla_plugin_group.'. ((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_joomla_plugin_group'));
|
||||
$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.joomla_plugin_group.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('joomla_plugin_group');
|
||||
$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->canDo = ComponentbuilderHelper::getActions('joomla_plugin_group');
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// Only for strings
|
||||
if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name))
|
||||
{
|
||||
$this->table->name = $this->generateUniqe('name',$this->table->name);
|
||||
}
|
||||
|
||||
// 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->canDo = ComponentbuilderHelper::getActions('joomla_plugin_group');
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// make sure the name is safe to be used as a function name
|
||||
$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
|
||||
|
||||
// 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
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
250
admin/models/joomla_plugin_groups.php
Normal file
250
admin/models/joomla_plugin_groups.php
Normal file
@ -0,0 +1,250 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Joomla_plugin_groups Model
|
||||
*/
|
||||
class ComponentbuilderModelJoomla_plugin_groups 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',
|
||||
'a.name','name',
|
||||
'a.class_extends','class_extends'
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
|
||||
$this->setState('filter.name', $name);
|
||||
|
||||
$class_extends = $this->getUserStateFromRequest($this->context . '.filter.class_extends', 'filter_class_extends');
|
||||
$this->setState('filter.class_extends', $class_extends);
|
||||
|
||||
$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_joomla_plugin_group', 'a'));
|
||||
|
||||
// From the componentbuilder_class_extends table.
|
||||
$query->select($db->quoteName('g.name','class_extends_name'));
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_class_extends', 'g') . ' ON (' . $db->quoteName('a.class_extends') . ' = ' . $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)');
|
||||
}
|
||||
|
||||
// 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))
|
||||
{
|
||||
if (stripos($search, 'id:') === 0)
|
||||
{
|
||||
$query->where('a.id = ' . (int) substr($search, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.class_extends LIKE '.$search.' OR g.name LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by class_extends.
|
||||
if ($class_extends = $this->getState('filter.class_extends'))
|
||||
{
|
||||
$query->where('a.class_extends = ' . $db->quote($db->escape($class_extends)));
|
||||
}
|
||||
|
||||
// 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');
|
||||
$id .= ':' . $this->getState('filter.name');
|
||||
$id .= ':' . $this->getState('filter.class_extends');
|
||||
|
||||
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_joomla_plugin_group'));
|
||||
$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_joomla_plugin_group'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
571
admin/models/joomla_plugins.php
Normal file
571
admin/models/joomla_plugins.php
Normal file
@ -0,0 +1,571 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Joomla_plugins Model
|
||||
*/
|
||||
class ComponentbuilderModelJoomla_plugins 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',
|
||||
'a.name','name',
|
||||
'a.class_extends','class_extends',
|
||||
'a.joomla_plugin_group','joomla_plugin_group'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get Boilerplate
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getBoilerplate()
|
||||
{
|
||||
// get boilerplate repo root details
|
||||
if (($result = ComponentbuilderHelper::getFileContents(ComponentbuilderHelper::$bolerplateAPI)) !== false && ComponentbuilderHelper::checkJson($result))
|
||||
{
|
||||
$result = json_decode($result);
|
||||
// check if we have a three
|
||||
if (isset($result->tree) && ComponentbuilderHelper::checkArray($result->tree))
|
||||
{
|
||||
$found = array_values(array_filter(
|
||||
$result->tree,
|
||||
function($tree) {
|
||||
if (isset($tree->path) && $tree->path === 'plugins')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
));
|
||||
// make sure we have the correct boilerplate
|
||||
if (ComponentbuilderHelper::checkArray($found) && count($found) == 1 && method_exists(__CLASS__, 'getPluginsBoilerplate'))
|
||||
{
|
||||
// get the plugins boilerplate
|
||||
return $this->getPluginsBoilerplate($found[0]->url);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* get Plugin Boilerplate
|
||||
*
|
||||
* @return boolean true on success
|
||||
*
|
||||
*/
|
||||
protected function getPluginsBoilerplate($url)
|
||||
{
|
||||
// get boilerplate root for plugins
|
||||
if (($result = ComponentbuilderHelper::getFileContents($url)) !== false && ComponentbuilderHelper::checkJson($result))
|
||||
{
|
||||
$result = json_decode($result);
|
||||
// check if we have a tree
|
||||
if (isset($result->tree) && ComponentbuilderHelper::checkArray($result->tree))
|
||||
{
|
||||
// get the app object
|
||||
$app = JFactory::getApplication();
|
||||
// set the table names
|
||||
$tables = array();
|
||||
$tables['e'] = 'class_extends';
|
||||
$tables['g'] = 'joomla_plugin_group';
|
||||
$tables['m'] = 'class_method';
|
||||
$tables['p'] = 'class_property';
|
||||
// load the needed models
|
||||
$models = array();
|
||||
$models['e'] = ComponentbuilderHelper::getModel($tables['e']);
|
||||
$models['g'] = ComponentbuilderHelper::getModel($tables['g']);
|
||||
$models['p'] = ComponentbuilderHelper::getModel($tables['p']);
|
||||
$models['m'] = ComponentbuilderHelper::getModel($tables['m']);
|
||||
// get the needed data of each plugin group
|
||||
$groups = array_map(
|
||||
function($tree) use(&$app, &$models, &$tables){
|
||||
if (($fooClass = ComponentbuilderHelper::getFileContents(ComponentbuilderHelper::$bolerplatePath . '/plugins/' . $tree->path . '/foo.php')) !== false && ComponentbuilderHelper::checkString($fooClass))
|
||||
{
|
||||
// extract the boilerplate class extends and check if already set
|
||||
if (($classExtends = ComponentbuilderHelper::extractBoilerplateClassExtends($fooClass, 'plugins')) !== false &&
|
||||
($classExtendsID = ComponentbuilderHelper::getVar('class_extends', $classExtends, 'name', 'id')) === false)
|
||||
{
|
||||
// load the extends class name
|
||||
$class = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $classExtends);
|
||||
// extract the boilerplate class header
|
||||
$class['head'] = ComponentbuilderHelper::extractBoilerplateClassHeader($fooClass, $classExtends, 'plugins');
|
||||
// extract the boilerplate class comment
|
||||
$class['comment'] = ComponentbuilderHelper::extractBoilerplateClassComment($fooClass, $classExtends, 'plugins');
|
||||
// set the extension type
|
||||
$class['extension_type'] = 'plugins';
|
||||
// store the class
|
||||
$this->storePluginBoilerplate($tables['e'], $models['e'], $class, $app);
|
||||
// work around
|
||||
$classExtendsID = ComponentbuilderHelper::getVar('class_extends', $classExtends, 'name', 'id');
|
||||
}
|
||||
// set plugin group if not already set
|
||||
if (($pluginGroupID = ComponentbuilderHelper::getVar('joomla_plugin_group', $tree->path, 'name', 'id')) === false)
|
||||
{
|
||||
// load the plugin group name
|
||||
$pluginGroup = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $tree->path, 'class_extends' => $classExtendsID);
|
||||
// store the group
|
||||
$this->storePluginBoilerplate($tables['g'], $models['g'], $pluginGroup, $app);
|
||||
// work around
|
||||
$pluginGroupID = ComponentbuilderHelper::getVar('joomla_plugin_group', $tree->path, 'name', 'id');
|
||||
}
|
||||
// extract the boilerplate class property and methods
|
||||
if (($classProperiesMethods = ComponentbuilderHelper::extractBoilerplateClassPropertiesMethods($fooClass, $classExtends, 'plugins', $pluginGroupID)) !== false)
|
||||
{
|
||||
// create the properties found (TODO just create for now but we could later add a force update)
|
||||
if (isset($classProperiesMethods['property']) && ComponentbuilderHelper::checkArray($classProperiesMethods['property']))
|
||||
{
|
||||
foreach ($classProperiesMethods['property'] as $_property)
|
||||
{
|
||||
// does not exist, so create
|
||||
if ($_property['id'] == 0)
|
||||
{
|
||||
// store the property
|
||||
$this->storePluginBoilerplate($tables['p'], $models['p'], $_property, $app);
|
||||
}
|
||||
}
|
||||
}
|
||||
// create the method found (TODO just create for now but we could later add a force update)
|
||||
if (isset($classProperiesMethods['method']) && ComponentbuilderHelper::checkArray($classProperiesMethods['method']))
|
||||
{
|
||||
foreach ($classProperiesMethods['method'] as $_method)
|
||||
{
|
||||
// does not exist, so create
|
||||
if ($_method['id'] == 0)
|
||||
{
|
||||
// store the method
|
||||
$this->storePluginBoilerplate($tables['m'], $models['m'], $_method, $app);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
$result->tree
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* store Plugin Boilerplate
|
||||
*
|
||||
* @return boolean true on success
|
||||
*
|
||||
*/
|
||||
protected function storePluginBoilerplate(&$table, &$method, &$boilerplate, &$app)
|
||||
{
|
||||
// Sometimes the form needs some posted data, such as for plugins and modules.
|
||||
$form = $method->getForm($boilerplate, false);
|
||||
if (!$form)
|
||||
{
|
||||
$app->enqueueMessage($method->getError(), 'error');
|
||||
return false;
|
||||
}
|
||||
// Send an object which can be modified through the plugin event
|
||||
$objData = (object) $boilerplate;
|
||||
$app->triggerEvent(
|
||||
'onContentNormaliseRequestData',
|
||||
array('com_componentbuilder.' . $table, $objData, $form)
|
||||
);
|
||||
$boilerplate = (array) $objData;
|
||||
// Test whether the data is valid.
|
||||
$validData = $method->validate($form, $boilerplate);
|
||||
// Check for validation errors.
|
||||
if ($validData === false)
|
||||
{
|
||||
// Get the validation messages.
|
||||
$errors = $method->getErrors();
|
||||
// Push up to three validation messages out to the user.
|
||||
for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)
|
||||
{
|
||||
if ($errors[$i] instanceof \Exception)
|
||||
{
|
||||
$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
|
||||
}
|
||||
else
|
||||
{
|
||||
$app->enqueueMessage($errors[$i], 'warning');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Attempt to save the data.
|
||||
if (!$method->save($validData))
|
||||
{
|
||||
$app->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_BOILERPLATE_PLUGIN_S_DATA_COULD_NOT_BE_SAVED', $table), 'error');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
$name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name');
|
||||
$this->setState('filter.name', $name);
|
||||
|
||||
$class_extends = $this->getUserStateFromRequest($this->context . '.filter.class_extends', 'filter_class_extends');
|
||||
$this->setState('filter.class_extends', $class_extends);
|
||||
|
||||
$joomla_plugin_group = $this->getUserStateFromRequest($this->context . '.filter.joomla_plugin_group', 'filter_joomla_plugin_group');
|
||||
$this->setState('filter.joomla_plugin_group', $joomla_plugin_group);
|
||||
|
||||
$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();
|
||||
|
||||
// set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_plugin.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 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_joomla_plugin', 'a'));
|
||||
|
||||
// From the componentbuilder_class_extends table.
|
||||
$query->select($db->quoteName('g.name','class_extends_name'));
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_class_extends', 'g') . ' ON (' . $db->quoteName('a.class_extends') . ' = ' . $db->quoteName('g.id') . ')');
|
||||
|
||||
// From the componentbuilder_joomla_plugin_group table.
|
||||
$query->select($db->quoteName('h.name','joomla_plugin_group_name'));
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_plugin_group', 'h') . ' ON (' . $db->quoteName('a.joomla_plugin_group') . ' = ' . $db->quoteName('h.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)');
|
||||
}
|
||||
|
||||
// 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))
|
||||
{
|
||||
if (stripos($search, 'id:') === 0)
|
||||
{
|
||||
$query->where('a.id = ' . (int) substr($search, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||
$query->where('(a.name LIKE '.$search.' OR a.class_extends LIKE '.$search.' OR g.name LIKE '.$search.' OR a.joomla_plugin_group LIKE '.$search.' OR h.name LIKE '.$search.')');
|
||||
}
|
||||
}
|
||||
|
||||
// Filter by Name.
|
||||
if ($name = $this->getState('filter.name'))
|
||||
{
|
||||
$query->where('a.name = ' . $db->quote($db->escape($name)));
|
||||
}
|
||||
// Filter by class_extends.
|
||||
if ($class_extends = $this->getState('filter.class_extends'))
|
||||
{
|
||||
$query->where('a.class_extends = ' . $db->quote($db->escape($class_extends)));
|
||||
}
|
||||
// Filter by joomla_plugin_group.
|
||||
if ($joomla_plugin_group = $this->getState('filter.joomla_plugin_group'))
|
||||
{
|
||||
$query->where('a.joomla_plugin_group = ' . $db->quote($db->escape($joomla_plugin_group)));
|
||||
}
|
||||
|
||||
// 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 list export data.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks)
|
||||
{
|
||||
// setup the query
|
||||
if (ComponentbuilderHelper::checkArray($pks))
|
||||
{
|
||||
// Set a value to know this is exporting method.
|
||||
$_export = true;
|
||||
// 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_joomla_plugin table
|
||||
$query->from($db->quoteName('#__componentbuilder_joomla_plugin', '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');
|
||||
|
||||
// Load the items
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_plugin.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// decode main_class_code
|
||||
$item->main_class_code = base64_decode($item->main_class_code);
|
||||
// unset the values we don't want exported.
|
||||
unset($item->asset_id);
|
||||
unset($item->checked_out);
|
||||
unset($item->checked_out_time);
|
||||
}
|
||||
}
|
||||
// Add headers to items array.
|
||||
$headers = $this->getExImPortHeaders();
|
||||
if (ComponentbuilderHelper::checkObject($headers))
|
||||
{
|
||||
array_unshift($items,$headers);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get header.
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExImPortHeaders()
|
||||
{
|
||||
// Get a db connection.
|
||||
$db = JFactory::getDbo();
|
||||
// get the columns
|
||||
$columns = $db->getTableColumns("#__componentbuilder_joomla_plugin");
|
||||
if (ComponentbuilderHelper::checkArray($columns))
|
||||
{
|
||||
// remove the headers you don't import/export.
|
||||
unset($columns['asset_id']);
|
||||
unset($columns['checked_out']);
|
||||
unset($columns['checked_out_time']);
|
||||
$headers = new stdClass();
|
||||
foreach ($columns as $column => $type)
|
||||
{
|
||||
$headers->{$column} = $column;
|
||||
}
|
||||
return $headers;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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');
|
||||
$id .= ':' . $this->getState('filter.name');
|
||||
$id .= ':' . $this->getState('filter.class_extends');
|
||||
$id .= ':' . $this->getState('filter.joomla_plugin_group');
|
||||
|
||||
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_joomla_plugin'));
|
||||
$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_joomla_plugin'))->set($fields)->where($conditions);
|
||||
|
||||
$db->setQuery($query);
|
||||
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
@ -189,7 +189,7 @@ class ComponentbuilderModelServer extends JModelAdmin
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getVyalinked_components()
|
||||
public function getVyclinked_components()
|
||||
{
|
||||
// Get the user object.
|
||||
$user = JFactory::getUser();
|
||||
|
@ -74,10 +74,17 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* get VDM session key
|
||||
*
|
||||
* @return string the session key
|
||||
*
|
||||
*/
|
||||
public function getVDM()
|
||||
{
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to get a single record.
|
||||
|
Reference in New Issue
Block a user