Improved the get snippets area to load one library at a time. started on the adaptation of the compiler that is needed for the new libraries

This commit is contained in:
2017-12-03 20:09:04 +02:00
parent 82df61aa4a
commit 19d4d77305
45 changed files with 1841 additions and 712 deletions

View File

@ -1084,26 +1084,79 @@ class ComponentbuilderModelAjax extends JModelList
if (ComponentbuilderHelper::checkArray($libraries))
{
// insure we only have int values
$libraries = array_map( function($id){ return (int) $id; }, $libraries);
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName( array('a.id') ));
$query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
$query->where($db->quoteName('a.published') . ' = 1');
// check for country and region
$query->where($db->quoteName('a.library') . ' IN ('. implode(',',$libraries) .')');
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
if ($libraries = $this->checkLibraries($libraries))
{
return $db->loadColumn();
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName( array('a.id') ));
$query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
$query->where($db->quoteName('a.published') . ' = 1');
// check for country and region
$query->where($db->quoteName('a.library') . ' IN ('. implode(',',$libraries) .')');
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
return $db->loadColumn();
}
}
}
return false;
}
protected function checkLibraries($libraries)
{
$bucket = array();
$libraries = array_map( function($id) use (&$bucket) {
// now get bundled libraries
$type = ComponentbuilderHelper::getVar('library', (int) $id, 'id', 'type');
if (2 == $type && $bundled = ComponentbuilderHelper::getVar('library', (int) $id, 'id', 'libraries'))
{
// make sure we have an array if it was json
if (ComponentbuilderHelper::checkJson($bundled))
{
$bundled = json_decode($bundled, true);
}
// load in the values if we have an array
if (ComponentbuilderHelper::checkArray($bundled))
{
foreach ($bundled as $lib)
{
$bucket[$lib] = $lib;
}
}
elseif (is_numeric($bundled))
{
$bucket[(int) $bundled] = (int) $bundled;
}
}
else
{
return (int) $id;
}
}, $libraries);
// check if we have any bundled libraries
if (ComponentbuilderHelper::checkArray($bucket))
{
foreach ($bucket as $lib)
{
$libraries[] = (int) $lib;
}
}
// check that we have libraries
if (ComponentbuilderHelper::checkArray($libraries))
{
$libraries = array_values(array_unique(array_filter($libraries, function($id){return is_int($id);})));
// check if we have any libraries remaining
if (ComponentbuilderHelper::checkArray($libraries))
{
return $libraries;
}
}
return false;
}
// Used in template
public function getTemplateDetails($id)

View File

@ -923,6 +923,9 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// always reset the snippets
$data['snippet'] = 0;
// Set the libraries items to data.
if (isset($data['libraries']) && is_array($data['libraries']))
{

View File

@ -0,0 +1,178 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.6.x
@created 30th April, 2015
@package Component Builder
@subpackage librariesx.php
@author Llewellyn van der Merwe <http://vdm.bz/component-builder>
@github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
* Librariesx Form Field class for the Componentbuilder component
*/
class JFormFieldLibrariesx extends JFormFieldList
{
/**
* The librariesx field type.
*
* @var string
*/
public $type = 'librariesx';
/**
* Override to add new button
*
* @return string The field input markup.
*
* @since 3.2
*/
protected function getInput()
{
// see if we should add buttons
$setButton = $this->getAttribute('button');
// get html
$html = parent::getInput();
// if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// get the input from url
$app = JFactory::getApplication();
$jinput = $app->input;
// get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// only add if user allowed to create library
if ($user->authorise('library.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_COMPONENTBUILDER_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_componentbuilder&amp;view=library&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// only add if user allowed to edit library
if (($buttonName === 'library' || $buttonName === 'libraries') && $user->authorise('library.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_COMPONENTBUILDER_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
".$buttonName."Button(".$buttonName."Value);
});
function ".$buttonName."Button(value) {
if (value > 0) {
// hide the create button
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
var url = 'index.php?option=com_componentbuilder&view=libraries&task=library.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
jQuery('#".$buttonName."Create').show();
// hide edit button
jQuery('#".$buttonName."Edit').hide();
}
}";
}
// check if button was created for library field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// return the button attached to input field.
return '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
return $html;
}
/**
* Method to get a list of options for a list input.
*
* @return array An array of JHtml options.
*/
public function getOptions()
{
// get the input from url
$jinput = JFactory::getApplication()->input;
// get the library id
$libID = $jinput->getInt('id', 0);
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name'),array('id','libraries_name')));
$query->from($db->quoteName('#__componentbuilder_library', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
if ($libID > 0)
{
$query->where($db->quoteName('a.id') . ' != ' . (int) $libID);
}
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->id, $item->libraries_name);
}
}
return $options;
}
}

View File

@ -153,7 +153,8 @@ class JFormFieldLibrary extends JFormFieldList
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name'),array('id','library_name')));
$query->from($db->quoteName('#__componentbuilder_library', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
$query->where($db->quoteName('a.published') . ' >= 1');
$query->where($db->quoteName('a.type') . ' = 1');
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();

View File

@ -139,7 +139,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVzwfields()
public function getVzxfields()
{
// Get the user object.
$user = JFactory::getUser();
@ -223,13 +223,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
foreach ($items as $nr => &$item)
{
// convert datatype
$item->datatype = $this->selectionTranslationVzwfields($item->datatype, 'datatype');
$item->datatype = $this->selectionTranslationVzxfields($item->datatype, 'datatype');
// convert indexes
$item->indexes = $this->selectionTranslationVzwfields($item->indexes, 'indexes');
$item->indexes = $this->selectionTranslationVzxfields($item->indexes, 'indexes');
// convert null_switch
$item->null_switch = $this->selectionTranslationVzwfields($item->null_switch, 'null_switch');
$item->null_switch = $this->selectionTranslationVzxfields($item->null_switch, 'null_switch');
// convert store
$item->store = $this->selectionTranslationVzwfields($item->store, 'store');
$item->store = $this->selectionTranslationVzxfields($item->store, 'store');
}
}
@ -243,7 +243,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return translatable string
*/
public function selectionTranslationVzwfields($value,$name)
public function selectionTranslationVzxfields($value,$name)
{
// Array of datatype language strings
if ($name === 'datatype')

View File

@ -107,12 +107,10 @@
type="subform"
name="addconfig"
label="COM_COMPONENTBUILDER_COMPONENT_CONFIG_ADDCONFIG_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_COMPONENT_CONFIG_ADDCONFIG_DESCRIPTION"
icon="list"
maximum="500"
filter="ARRAY">
maximum="500">
<form hidden="true" name="list_addconfig_modal" repeat="true">
<!-- Field Field. Type: Fields. (custom) -->
<field
@ -146,7 +144,7 @@
label="COM_COMPONENTBUILDER_COMPONENT_CONFIG_TABNAME_LABEL"
size="40"
maxlength="150"
default="Library"
default="Global"
description="COM_COMPONENTBUILDER_COMPONENT_CONFIG_TABNAME_DESCRIPTION"
class="text_area"
readonly="false"

View File

@ -23,151 +23,96 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvwaavzo_required = false;
jform_vvvvwabvzp_required = false;
jform_vvvvwacvzq_required = false;
jform_vvvvwadvzr_required = false;
jform_vvvvwagvzs_required = false;
jform_vvvvwaevzs_required = false;
jform_vvvvwahvzt_required = false;
jform_vvvvwaivzu_required = false;
jform_vvvvwajvzv_required = false;
jform_vvvvwakvzw_required = false;
// Initial Script
jQuery(document).ready(function()
{
var datalenght_vvvvwaa = jQuery("#jform_datalenght").val();
vvvvwaa(datalenght_vvvvwaa);
var datalenght_vvvvwab = jQuery("#jform_datalenght").val();
vvvvwab(datalenght_vvvvwab);
var datadefault_vvvvwab = jQuery("#jform_datadefault").val();
vvvvwab(datadefault_vvvvwab);
var datatype_vvvvwac = jQuery("#jform_datatype").val();
vvvvwac(datatype_vvvvwac);
var datadefault_vvvvwac = jQuery("#jform_datadefault").val();
vvvvwac(datadefault_vvvvwac);
var datatype_vvvvwad = jQuery("#jform_datatype").val();
vvvvwad(datatype_vvvvwad);
var store_vvvvwae = jQuery("#jform_store").val();
var datatype_vvvvwae = jQuery("#jform_datatype").val();
vvvvwae(store_vvvvwae,datatype_vvvvwae);
vvvvwae(datatype_vvvvwae);
var add_css_view_vvvvwag = jQuery("#jform_add_css_view input[type='radio']:checked").val();
vvvvwag(add_css_view_vvvvwag);
var store_vvvvwaf = jQuery("#jform_store").val();
var datatype_vvvvwaf = jQuery("#jform_datatype").val();
vvvvwaf(store_vvvvwaf,datatype_vvvvwaf);
var add_css_views_vvvvwah = jQuery("#jform_add_css_views input[type='radio']:checked").val();
vvvvwah(add_css_views_vvvvwah);
var add_css_view_vvvvwah = jQuery("#jform_add_css_view input[type='radio']:checked").val();
vvvvwah(add_css_view_vvvvwah);
var add_javascript_view_footer_vvvvwai = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
vvvvwai(add_javascript_view_footer_vvvvwai);
var add_css_views_vvvvwai = jQuery("#jform_add_css_views input[type='radio']:checked").val();
vvvvwai(add_css_views_vvvvwai);
var add_javascript_views_footer_vvvvwaj = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
vvvvwaj(add_javascript_views_footer_vvvvwaj);
var add_javascript_view_footer_vvvvwaj = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
vvvvwaj(add_javascript_view_footer_vvvvwaj);
var add_javascript_views_footer_vvvvwak = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
vvvvwak(add_javascript_views_footer_vvvvwak);
});
// the vvvvwaa function
function vvvvwaa(datalenght_vvvvwaa)
// the vvvvwab function
function vvvvwab(datalenght_vvvvwab)
{
if (isSet(datalenght_vvvvwaa) && datalenght_vvvvwaa.constructor !== Array)
if (isSet(datalenght_vvvvwab) && datalenght_vvvvwab.constructor !== Array)
{
var temp_vvvvwaa = datalenght_vvvvwaa;
var datalenght_vvvvwaa = [];
datalenght_vvvvwaa.push(temp_vvvvwaa);
var temp_vvvvwab = datalenght_vvvvwab;
var datalenght_vvvvwab = [];
datalenght_vvvvwab.push(temp_vvvvwab);
}
else if (!isSet(datalenght_vvvvwaa))
else if (!isSet(datalenght_vvvvwab))
{
var datalenght_vvvvwaa = [];
var datalenght_vvvvwab = [];
}
var datalenght = datalenght_vvvvwaa.some(datalenght_vvvvwaa_SomeFunc);
var datalenght = datalenght_vvvvwab.some(datalenght_vvvvwab_SomeFunc);
// set this function logic
if (datalenght)
{
jQuery('#jform_datalenght_other').closest('.control-group').show();
if (jform_vvvvwaavzo_required)
if (jform_vvvvwabvzp_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_vvvvwaavzo_required = false;
}
}
else
{
jQuery('#jform_datalenght_other').closest('.control-group').hide();
if (!jform_vvvvwaavzo_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_vvvvwaavzo_required = true;
}
}
}
// the vvvvwaa Some function
function datalenght_vvvvwaa_SomeFunc(datalenght_vvvvwaa)
{
// set the function logic
if (datalenght_vvvvwaa == 'Other')
{
return true;
}
return false;
}
// the vvvvwab function
function vvvvwab(datadefault_vvvvwab)
{
if (isSet(datadefault_vvvvwab) && datadefault_vvvvwab.constructor !== Array)
{
var temp_vvvvwab = datadefault_vvvvwab;
var datadefault_vvvvwab = [];
datadefault_vvvvwab.push(temp_vvvvwab);
}
else if (!isSet(datadefault_vvvvwab))
{
var datadefault_vvvvwab = [];
}
var datadefault = datadefault_vvvvwab.some(datadefault_vvvvwab_SomeFunc);
// set this function logic
if (datadefault)
{
jQuery('#jform_datadefault_other').closest('.control-group').show();
if (jform_vvvvwabvzp_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_vvvvwabvzp_required = false;
}
}
else
{
jQuery('#jform_datadefault_other').closest('.control-group').hide();
jQuery('#jform_datalenght_other').closest('.control-group').hide();
if (!jform_vvvvwabvzp_required)
{
updateFieldRequired('datadefault_other',1);
jQuery('#jform_datadefault_other').removeAttr('required');
jQuery('#jform_datadefault_other').removeAttr('aria-required');
jQuery('#jform_datadefault_other').removeClass('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_vvvvwabvzp_required = true;
}
}
}
// the vvvvwab Some function
function datadefault_vvvvwab_SomeFunc(datadefault_vvvvwab)
function datalenght_vvvvwab_SomeFunc(datalenght_vvvvwab)
{
// set the function logic
if (datadefault_vvvvwab == 'Other')
if (datalenght_vvvvwab == 'Other')
{
return true;
}
@ -175,58 +120,54 @@ function datadefault_vvvvwab_SomeFunc(datadefault_vvvvwab)
}
// the vvvvwac function
function vvvvwac(datatype_vvvvwac)
function vvvvwac(datadefault_vvvvwac)
{
if (isSet(datatype_vvvvwac) && datatype_vvvvwac.constructor !== Array)
if (isSet(datadefault_vvvvwac) && datadefault_vvvvwac.constructor !== Array)
{
var temp_vvvvwac = datatype_vvvvwac;
var datatype_vvvvwac = [];
datatype_vvvvwac.push(temp_vvvvwac);
var temp_vvvvwac = datadefault_vvvvwac;
var datadefault_vvvvwac = [];
datadefault_vvvvwac.push(temp_vvvvwac);
}
else if (!isSet(datatype_vvvvwac))
else if (!isSet(datadefault_vvvvwac))
{
var datatype_vvvvwac = [];
var datadefault_vvvvwac = [];
}
var datatype = datatype_vvvvwac.some(datatype_vvvvwac_SomeFunc);
var datadefault = datadefault_vvvvwac.some(datadefault_vvvvwac_SomeFunc);
// set this function logic
if (datatype)
if (datadefault)
{
jQuery('#jform_datadefault').closest('.control-group').show();
jQuery('#jform_datalenght').closest('.control-group').show();
jQuery('#jform_indexes').closest('.control-group').show();
jQuery('#jform_datadefault_other').closest('.control-group').show();
if (jform_vvvvwacvzq_required)
{
updateFieldRequired('indexes',0);
jQuery('#jform_indexes').prop('required','required');
jQuery('#jform_indexes').attr('aria-required',true);
jQuery('#jform_indexes').addClass('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_vvvvwacvzq_required = false;
}
}
else
{
jQuery('#jform_datadefault').closest('.control-group').hide();
jQuery('#jform_datalenght').closest('.control-group').hide();
jQuery('#jform_indexes').closest('.control-group').hide();
jQuery('#jform_datadefault_other').closest('.control-group').hide();
if (!jform_vvvvwacvzq_required)
{
updateFieldRequired('indexes',1);
jQuery('#jform_indexes').removeAttr('required');
jQuery('#jform_indexes').removeAttr('aria-required');
jQuery('#jform_indexes').removeClass('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_vvvvwacvzq_required = true;
}
}
}
// the vvvvwac Some function
function datatype_vvvvwac_SomeFunc(datatype_vvvvwac)
function datadefault_vvvvwac_SomeFunc(datadefault_vvvvwac)
{
// set the function logic
if (datatype_vvvvwac == 'CHAR' || datatype_vvvvwac == 'VARCHAR' || datatype_vvvvwac == 'DATETIME' || datatype_vvvvwac == 'DATE' || datatype_vvvvwac == 'TIME' || datatype_vvvvwac == 'INT' || datatype_vvvvwac == 'TINYINT' || datatype_vvvvwac == 'BIGINT' || datatype_vvvvwac == 'FLOAT' || datatype_vvvvwac == 'DECIMAL' || datatype_vvvvwac == 'DOUBLE')
if (datadefault_vvvvwac == 'Other')
{
return true;
}
@ -252,26 +193,30 @@ function vvvvwad(datatype_vvvvwad)
// set this function logic
if (datatype)
{
jQuery('#jform_store').closest('.control-group').show();
jQuery('#jform_datadefault').closest('.control-group').show();
jQuery('#jform_datalenght').closest('.control-group').show();
jQuery('#jform_indexes').closest('.control-group').show();
if (jform_vvvvwadvzr_required)
{
updateFieldRequired('store',0);
jQuery('#jform_store').prop('required','required');
jQuery('#jform_store').attr('aria-required',true);
jQuery('#jform_store').addClass('required');
updateFieldRequired('indexes',0);
jQuery('#jform_indexes').prop('required','required');
jQuery('#jform_indexes').attr('aria-required',true);
jQuery('#jform_indexes').addClass('required');
jform_vvvvwadvzr_required = false;
}
}
else
{
jQuery('#jform_store').closest('.control-group').hide();
jQuery('#jform_datadefault').closest('.control-group').hide();
jQuery('#jform_datalenght').closest('.control-group').hide();
jQuery('#jform_indexes').closest('.control-group').hide();
if (!jform_vvvvwadvzr_required)
{
updateFieldRequired('store',1);
jQuery('#jform_store').removeAttr('required');
jQuery('#jform_store').removeAttr('aria-required');
jQuery('#jform_store').removeClass('required');
updateFieldRequired('indexes',1);
jQuery('#jform_indexes').removeAttr('required');
jQuery('#jform_indexes').removeAttr('aria-required');
jQuery('#jform_indexes').removeClass('required');
jform_vvvvwadvzr_required = true;
}
}
@ -281,7 +226,7 @@ function vvvvwad(datatype_vvvvwad)
function datatype_vvvvwad_SomeFunc(datatype_vvvvwad)
{
// set the function logic
if (datatype_vvvvwad == 'CHAR' || datatype_vvvvwad == 'VARCHAR' || datatype_vvvvwad == 'TEXT' || datatype_vvvvwad == 'MEDIUMTEXT' || datatype_vvvvwad == 'LONGTEXT')
if (datatype_vvvvwad == 'CHAR' || datatype_vvvvwad == 'VARCHAR' || datatype_vvvvwad == 'DATETIME' || datatype_vvvvwad == 'DATE' || datatype_vvvvwad == 'TIME' || datatype_vvvvwad == 'INT' || datatype_vvvvwad == 'TINYINT' || datatype_vvvvwad == 'BIGINT' || datatype_vvvvwad == 'FLOAT' || datatype_vvvvwad == 'DECIMAL' || datatype_vvvvwad == 'DOUBLE')
{
return true;
}
@ -289,20 +234,8 @@ function datatype_vvvvwad_SomeFunc(datatype_vvvvwad)
}
// the vvvvwae function
function vvvvwae(store_vvvvwae,datatype_vvvvwae)
function vvvvwae(datatype_vvvvwae)
{
if (isSet(store_vvvvwae) && store_vvvvwae.constructor !== Array)
{
var temp_vvvvwae = store_vvvvwae;
var store_vvvvwae = [];
store_vvvvwae.push(temp_vvvvwae);
}
else if (!isSet(store_vvvvwae))
{
var store_vvvvwae = [];
}
var store = store_vvvvwae.some(store_vvvvwae_SomeFunc);
if (isSet(datatype_vvvvwae) && datatype_vvvvwae.constructor !== Array)
{
var temp_vvvvwae = datatype_vvvvwae;
@ -317,27 +250,33 @@ function vvvvwae(store_vvvvwae,datatype_vvvvwae)
// set this function logic
if (store && datatype)
if (datatype)
{
jQuery('.note_vdm_encryption').closest('.control-group').show();
jQuery('#jform_store').closest('.control-group').show();
if (jform_vvvvwaevzs_required)
{
updateFieldRequired('store',0);
jQuery('#jform_store').prop('required','required');
jQuery('#jform_store').attr('aria-required',true);
jQuery('#jform_store').addClass('required');
jform_vvvvwaevzs_required = false;
}
}
else
{
jQuery('.note_vdm_encryption').closest('.control-group').hide();
jQuery('#jform_store').closest('.control-group').hide();
if (!jform_vvvvwaevzs_required)
{
updateFieldRequired('store',1);
jQuery('#jform_store').removeAttr('required');
jQuery('#jform_store').removeAttr('aria-required');
jQuery('#jform_store').removeClass('required');
jform_vvvvwaevzs_required = true;
}
}
}
// the vvvvwae Some function
function store_vvvvwae_SomeFunc(store_vvvvwae)
{
// set the function logic
if (store_vvvvwae == 4)
{
return true;
}
return false;
}
// the vvvvwae Some function
function datatype_vvvvwae_SomeFunc(datatype_vvvvwae)
{
@ -349,126 +288,187 @@ function datatype_vvvvwae_SomeFunc(datatype_vvvvwae)
return false;
}
// the vvvvwag function
function vvvvwag(add_css_view_vvvvwag)
// the vvvvwaf function
function vvvvwaf(store_vvvvwaf,datatype_vvvvwaf)
{
if (isSet(store_vvvvwaf) && store_vvvvwaf.constructor !== Array)
{
var temp_vvvvwaf = store_vvvvwaf;
var store_vvvvwaf = [];
store_vvvvwaf.push(temp_vvvvwaf);
}
else if (!isSet(store_vvvvwaf))
{
var store_vvvvwaf = [];
}
var store = store_vvvvwaf.some(store_vvvvwaf_SomeFunc);
if (isSet(datatype_vvvvwaf) && datatype_vvvvwaf.constructor !== Array)
{
var temp_vvvvwaf = datatype_vvvvwaf;
var datatype_vvvvwaf = [];
datatype_vvvvwaf.push(temp_vvvvwaf);
}
else if (!isSet(datatype_vvvvwaf))
{
var datatype_vvvvwaf = [];
}
var datatype = datatype_vvvvwaf.some(datatype_vvvvwaf_SomeFunc);
// set this function logic
if (store && datatype)
{
jQuery('.note_vdm_encryption').closest('.control-group').show();
}
else
{
jQuery('.note_vdm_encryption').closest('.control-group').hide();
}
}
// the vvvvwaf Some function
function store_vvvvwaf_SomeFunc(store_vvvvwaf)
{
// set the function logic
if (add_css_view_vvvvwag == 1)
if (store_vvvvwaf == 4)
{
return true;
}
return false;
}
// the vvvvwaf Some function
function datatype_vvvvwaf_SomeFunc(datatype_vvvvwaf)
{
// set the function logic
if (datatype_vvvvwaf == 'CHAR' || datatype_vvvvwaf == 'VARCHAR' || datatype_vvvvwaf == 'TEXT' || datatype_vvvvwaf == 'MEDIUMTEXT' || datatype_vvvvwaf == 'LONGTEXT')
{
return true;
}
return false;
}
// the vvvvwah function
function vvvvwah(add_css_view_vvvvwah)
{
// set the function logic
if (add_css_view_vvvvwah == 1)
{
jQuery('#jform_css_view').closest('.control-group').show();
if (jform_vvvvwagvzs_required)
if (jform_vvvvwahvzt_required)
{
updateFieldRequired('css_view',0);
jQuery('#jform_css_view').prop('required','required');
jQuery('#jform_css_view').attr('aria-required',true);
jQuery('#jform_css_view').addClass('required');
jform_vvvvwagvzs_required = false;
}
}
else
{
jQuery('#jform_css_view').closest('.control-group').hide();
if (!jform_vvvvwagvzs_required)
{
updateFieldRequired('css_view',1);
jQuery('#jform_css_view').removeAttr('required');
jQuery('#jform_css_view').removeAttr('aria-required');
jQuery('#jform_css_view').removeClass('required');
jform_vvvvwagvzs_required = true;
}
}
}
// the vvvvwah function
function vvvvwah(add_css_views_vvvvwah)
{
// set the function logic
if (add_css_views_vvvvwah == 1)
{
jQuery('#jform_css_views').closest('.control-group').show();
if (jform_vvvvwahvzt_required)
{
updateFieldRequired('css_views',0);
jQuery('#jform_css_views').prop('required','required');
jQuery('#jform_css_views').attr('aria-required',true);
jQuery('#jform_css_views').addClass('required');
jform_vvvvwahvzt_required = false;
}
}
else
{
jQuery('#jform_css_views').closest('.control-group').hide();
jQuery('#jform_css_view').closest('.control-group').hide();
if (!jform_vvvvwahvzt_required)
{
updateFieldRequired('css_views',1);
jQuery('#jform_css_views').removeAttr('required');
jQuery('#jform_css_views').removeAttr('aria-required');
jQuery('#jform_css_views').removeClass('required');
updateFieldRequired('css_view',1);
jQuery('#jform_css_view').removeAttr('required');
jQuery('#jform_css_view').removeAttr('aria-required');
jQuery('#jform_css_view').removeClass('required');
jform_vvvvwahvzt_required = true;
}
}
}
// the vvvvwai function
function vvvvwai(add_javascript_view_footer_vvvvwai)
function vvvvwai(add_css_views_vvvvwai)
{
// set the function logic
if (add_javascript_view_footer_vvvvwai == 1)
if (add_css_views_vvvvwai == 1)
{
jQuery('#jform_javascript_view_footer').closest('.control-group').show();
jQuery('#jform_css_views').closest('.control-group').show();
if (jform_vvvvwaivzu_required)
{
updateFieldRequired('javascript_view_footer',0);
jQuery('#jform_javascript_view_footer').prop('required','required');
jQuery('#jform_javascript_view_footer').attr('aria-required',true);
jQuery('#jform_javascript_view_footer').addClass('required');
updateFieldRequired('css_views',0);
jQuery('#jform_css_views').prop('required','required');
jQuery('#jform_css_views').attr('aria-required',true);
jQuery('#jform_css_views').addClass('required');
jform_vvvvwaivzu_required = false;
}
}
else
{
jQuery('#jform_javascript_view_footer').closest('.control-group').hide();
jQuery('#jform_css_views').closest('.control-group').hide();
if (!jform_vvvvwaivzu_required)
{
updateFieldRequired('javascript_view_footer',1);
jQuery('#jform_javascript_view_footer').removeAttr('required');
jQuery('#jform_javascript_view_footer').removeAttr('aria-required');
jQuery('#jform_javascript_view_footer').removeClass('required');
updateFieldRequired('css_views',1);
jQuery('#jform_css_views').removeAttr('required');
jQuery('#jform_css_views').removeAttr('aria-required');
jQuery('#jform_css_views').removeClass('required');
jform_vvvvwaivzu_required = true;
}
}
}
// the vvvvwaj function
function vvvvwaj(add_javascript_views_footer_vvvvwaj)
function vvvvwaj(add_javascript_view_footer_vvvvwaj)
{
// set the function logic
if (add_javascript_views_footer_vvvvwaj == 1)
if (add_javascript_view_footer_vvvvwaj == 1)
{
jQuery('#jform_javascript_views_footer').closest('.control-group').show();
jQuery('#jform_javascript_view_footer').closest('.control-group').show();
if (jform_vvvvwajvzv_required)
{
updateFieldRequired('javascript_views_footer',0);
jQuery('#jform_javascript_views_footer').prop('required','required');
jQuery('#jform_javascript_views_footer').attr('aria-required',true);
jQuery('#jform_javascript_views_footer').addClass('required');
updateFieldRequired('javascript_view_footer',0);
jQuery('#jform_javascript_view_footer').prop('required','required');
jQuery('#jform_javascript_view_footer').attr('aria-required',true);
jQuery('#jform_javascript_view_footer').addClass('required');
jform_vvvvwajvzv_required = false;
}
}
else
{
jQuery('#jform_javascript_views_footer').closest('.control-group').hide();
jQuery('#jform_javascript_view_footer').closest('.control-group').hide();
if (!jform_vvvvwajvzv_required)
{
updateFieldRequired('javascript_view_footer',1);
jQuery('#jform_javascript_view_footer').removeAttr('required');
jQuery('#jform_javascript_view_footer').removeAttr('aria-required');
jQuery('#jform_javascript_view_footer').removeClass('required');
jform_vvvvwajvzv_required = true;
}
}
}
// the vvvvwak function
function vvvvwak(add_javascript_views_footer_vvvvwak)
{
// set the function logic
if (add_javascript_views_footer_vvvvwak == 1)
{
jQuery('#jform_javascript_views_footer').closest('.control-group').show();
if (jform_vvvvwakvzw_required)
{
updateFieldRequired('javascript_views_footer',0);
jQuery('#jform_javascript_views_footer').prop('required','required');
jQuery('#jform_javascript_views_footer').attr('aria-required',true);
jQuery('#jform_javascript_views_footer').addClass('required');
jform_vvvvwakvzw_required = false;
}
}
else
{
jQuery('#jform_javascript_views_footer').closest('.control-group').hide();
if (!jform_vvvvwakvzw_required)
{
updateFieldRequired('javascript_views_footer',1);
jQuery('#jform_javascript_views_footer').removeAttr('required');
jQuery('#jform_javascript_views_footer').removeAttr('aria-required');
jQuery('#jform_javascript_views_footer').removeClass('required');
jform_vvvvwajvzv_required = true;
jform_vvvvwakvzw_required = true;
}
}
}

View File

@ -23,24 +23,21 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvwakvzy_required = false;
jform_vvvvwalvzz_required = false;
jform_vvvvwamwaa_required = false;
jform_vvvvwanwab_required = false;
jform_vvvvwaowac_required = false;
jform_vvvvwapwad_required = false;
jform_vvvvwaqwae_required = false;
// Initial Script
jQuery(document).ready(function()
{
var location_vvvvwak = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwak(location_vvvvwak);
var location_vvvvwal = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwal(location_vvvvwal);
var type_vvvvwam = jQuery("#jform_type").val();
vvvvwam(type_vvvvwam);
var location_vvvvwam = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwam(location_vvvvwam);
var type_vvvvwan = jQuery("#jform_type").val();
vvvvwan(type_vvvvwan);
@ -48,127 +45,75 @@ jQuery(document).ready(function()
var type_vvvvwao = jQuery("#jform_type").val();
vvvvwao(type_vvvvwao);
var target_vvvvwap = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwap(target_vvvvwap);
var type_vvvvwap = jQuery("#jform_type").val();
vvvvwap(type_vvvvwap);
var target_vvvvwaq = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwaq(target_vvvvwaq);
});
// the vvvvwak function
function vvvvwak(location_vvvvwak)
{
// set the function logic
if (location_vvvvwak == 1)
{
jQuery('#jform_admin_view').closest('.control-group').show();
if (jform_vvvvwakvzy_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_vvvvwakvzy_required = false;
}
}
else
{
jQuery('#jform_admin_view').closest('.control-group').hide();
if (!jform_vvvvwakvzy_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_vvvvwakvzy_required = true;
}
}
}
// the vvvvwal function
function vvvvwal(location_vvvvwal)
{
// set the function logic
if (location_vvvvwal == 2)
if (location_vvvvwal == 1)
{
jQuery('#jform_site_view').closest('.control-group').show();
jQuery('#jform_admin_view').closest('.control-group').show();
if (jform_vvvvwalvzz_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');
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_vvvvwalvzz_required = false;
}
}
else
{
jQuery('#jform_site_view').closest('.control-group').hide();
jQuery('#jform_admin_view').closest('.control-group').hide();
if (!jform_vvvvwalvzz_required)
{
updateFieldRequired('site_view',1);
jQuery('#jform_site_view').removeAttr('required');
jQuery('#jform_site_view').removeAttr('aria-required');
jQuery('#jform_site_view').removeClass('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_vvvvwalvzz_required = true;
}
}
}
// the vvvvwam function
function vvvvwam(type_vvvvwam)
function vvvvwam(location_vvvvwam)
{
if (isSet(type_vvvvwam) && type_vvvvwam.constructor !== Array)
// set the function logic
if (location_vvvvwam == 2)
{
var temp_vvvvwam = type_vvvvwam;
var type_vvvvwam = [];
type_vvvvwam.push(temp_vvvvwam);
}
else if (!isSet(type_vvvvwam))
{
var type_vvvvwam = [];
}
var type = type_vvvvwam.some(type_vvvvwam_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_url').closest('.control-group').show();
jQuery('#jform_site_view').closest('.control-group').show();
if (jform_vvvvwamwaa_required)
{
updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('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_vvvvwamwaa_required = false;
}
}
else
{
jQuery('#jform_url').closest('.control-group').hide();
jQuery('#jform_site_view').closest('.control-group').hide();
if (!jform_vvvvwamwaa_required)
{
updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('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_vvvvwamwaa_required = true;
}
}
}
// the vvvvwam Some function
function type_vvvvwam_SomeFunc(type_vvvvwam)
{
// set the function logic
if (type_vvvvwam == 3)
{
return true;
}
return false;
}
// the vvvvwan function
function vvvvwan(type_vvvvwan)
{
@ -188,26 +133,26 @@ function vvvvwan(type_vvvvwan)
// set this function logic
if (type)
{
jQuery('#jform_article').closest('.control-group').show();
jQuery('#jform_url').closest('.control-group').show();
if (jform_vvvvwanwab_required)
{
updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required');
updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required');
jform_vvvvwanwab_required = false;
}
}
else
{
jQuery('#jform_article').closest('.control-group').hide();
jQuery('#jform_url').closest('.control-group').hide();
if (!jform_vvvvwanwab_required)
{
updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required');
updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required');
jform_vvvvwanwab_required = true;
}
}
@ -217,7 +162,7 @@ function vvvvwan(type_vvvvwan)
function type_vvvvwan_SomeFunc(type_vvvvwan)
{
// set the function logic
if (type_vvvvwan == 1)
if (type_vvvvwan == 3)
{
return true;
}
@ -243,26 +188,26 @@ function vvvvwao(type_vvvvwao)
// set this function logic
if (type)
{
jQuery('#jform_content-lbl').closest('.control-group').show();
jQuery('#jform_article').closest('.control-group').show();
if (jform_vvvvwaowac_required)
{
updateFieldRequired('content',0);
jQuery('#jform_content').prop('required','required');
jQuery('#jform_content').attr('aria-required',true);
jQuery('#jform_content').addClass('required');
updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required');
jform_vvvvwaowac_required = false;
}
}
else
{
jQuery('#jform_content-lbl').closest('.control-group').hide();
jQuery('#jform_article').closest('.control-group').hide();
if (!jform_vvvvwaowac_required)
{
updateFieldRequired('content',1);
jQuery('#jform_content').removeAttr('required');
jQuery('#jform_content').removeAttr('aria-required');
jQuery('#jform_content').removeClass('required');
updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required');
jform_vvvvwaowac_required = true;
}
}
@ -272,7 +217,7 @@ function vvvvwao(type_vvvvwao)
function type_vvvvwao_SomeFunc(type_vvvvwao)
{
// set the function logic
if (type_vvvvwao == 2)
if (type_vvvvwao == 1)
{
return true;
}
@ -280,32 +225,87 @@ function type_vvvvwao_SomeFunc(type_vvvvwao)
}
// the vvvvwap function
function vvvvwap(target_vvvvwap)
function vvvvwap(type_vvvvwap)
{
// set the function logic
if (target_vvvvwap == 1)
if (isSet(type_vvvvwap) && type_vvvvwap.constructor !== Array)
{
jQuery('#jform_groups').closest('.control-group').show();
var temp_vvvvwap = type_vvvvwap;
var type_vvvvwap = [];
type_vvvvwap.push(temp_vvvvwap);
}
else if (!isSet(type_vvvvwap))
{
var type_vvvvwap = [];
}
var type = type_vvvvwap.some(type_vvvvwap_SomeFunc);
// set this function logic
if (type)
{
jQuery('#jform_content-lbl').closest('.control-group').show();
if (jform_vvvvwapwad_required)
{
updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required');
updateFieldRequired('content',0);
jQuery('#jform_content').prop('required','required');
jQuery('#jform_content').attr('aria-required',true);
jQuery('#jform_content').addClass('required');
jform_vvvvwapwad_required = false;
}
}
else
{
jQuery('#jform_groups').closest('.control-group').hide();
jQuery('#jform_content-lbl').closest('.control-group').hide();
if (!jform_vvvvwapwad_required)
{
updateFieldRequired('content',1);
jQuery('#jform_content').removeAttr('required');
jQuery('#jform_content').removeAttr('aria-required');
jQuery('#jform_content').removeClass('required');
jform_vvvvwapwad_required = true;
}
}
}
// the vvvvwap Some function
function type_vvvvwap_SomeFunc(type_vvvvwap)
{
// set the function logic
if (type_vvvvwap == 2)
{
return true;
}
return false;
}
// the vvvvwaq function
function vvvvwaq(target_vvvvwaq)
{
// set the function logic
if (target_vvvvwaq == 1)
{
jQuery('#jform_groups').closest('.control-group').show();
if (jform_vvvvwaqwae_required)
{
updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required');
jform_vvvvwaqwae_required = false;
}
}
else
{
jQuery('#jform_groups').closest('.control-group').hide();
if (!jform_vvvvwaqwae_required)
{
updateFieldRequired('groups',1);
jQuery('#jform_groups').removeAttr('required');
jQuery('#jform_groups').removeAttr('aria-required');
jQuery('#jform_groups').removeClass('required');
jform_vvvvwapwad_required = true;
jform_vvvvwaqwae_required = true;
}
}
}

View File

@ -25,34 +25,51 @@
// Some Global Values
jform_vvvvvzvvzm_required = false;
jform_vvvvvzvvzn_required = false;
jform_vvvvwaavzo_required = false;
// Initial Script
jQuery(document).ready(function()
{
var how_vvvvvzu = jQuery("#jform_how input[type='radio']:checked").val();
var how_vvvvvzu = jQuery("#jform_how").val();
vvvvvzu(how_vvvvvzu);
var how_vvvvvzv = jQuery("#jform_how input[type='radio']:checked").val();
var how_vvvvvzv = jQuery("#jform_how").val();
vvvvvzv(how_vvvvvzv);
var how_vvvvvzw = jQuery("#jform_how input[type='radio']:checked").val();
var how_vvvvvzw = jQuery("#jform_how").val();
vvvvvzw(how_vvvvvzw);
var how_vvvvvzx = jQuery("#jform_how input[type='radio']:checked").val();
var how_vvvvvzx = jQuery("#jform_how").val();
vvvvvzx(how_vvvvvzx);
var how_vvvvvzy = jQuery("#jform_how input[type='radio']:checked").val();
var how_vvvvvzy = jQuery("#jform_how").val();
vvvvvzy(how_vvvvvzy);
var how_vvvvvzz = jQuery("#jform_how input[type='radio']:checked").val();
var how_vvvvvzz = jQuery("#jform_how").val();
vvvvvzz(how_vvvvvzz);
var type_vvvvwaa = jQuery("#jform_type input[type='radio']:checked").val();
vvvvwaa(type_vvvvwaa);
});
// the vvvvvzu function
function vvvvvzu(how_vvvvvzu)
{
// set the function logic
if (how_vvvvvzu == 2)
if (isSet(how_vvvvvzu) && how_vvvvvzu.constructor !== Array)
{
var temp_vvvvvzu = how_vvvvvzu;
var how_vvvvvzu = [];
how_vvvvvzu.push(temp_vvvvvzu);
}
else if (!isSet(how_vvvvvzu))
{
var how_vvvvvzu = [];
}
var how = how_vvvvvzu.some(how_vvvvvzu_SomeFunc);
// set this function logic
if (how)
{
jQuery('#jform_addconditions-lbl').closest('.control-group').show();
}
@ -62,11 +79,35 @@ function vvvvvzu(how_vvvvvzu)
}
}
// the vvvvvzu Some function
function how_vvvvvzu_SomeFunc(how_vvvvvzu)
{
// set the function logic
if (how_vvvvvzu == 2)
{
return true;
}
return false;
}
// the vvvvvzv function
function vvvvvzv(how_vvvvvzv)
{
// set the function logic
if (how_vvvvvzv == 3)
if (isSet(how_vvvvvzv) && how_vvvvvzv.constructor !== Array)
{
var temp_vvvvvzv = how_vvvvvzv;
var how_vvvvvzv = [];
how_vvvvvzv.push(temp_vvvvvzv);
}
else if (!isSet(how_vvvvvzv))
{
var how_vvvvvzv = [];
}
var how = how_vvvvvzv.some(how_vvvvvzv_SomeFunc);
// set this function logic
if (how)
{
jQuery('#jform_php_setdocument').closest('.control-group').show();
if (jform_vvvvvzvvzm_required)
@ -112,11 +153,35 @@ function vvvvvzv(how_vvvvvzv)
}
}
// the vvvvvzv Some function
function how_vvvvvzv_SomeFunc(how_vvvvvzv)
{
// set the function logic
if (how_vvvvvzv == 3)
{
return true;
}
return false;
}
// the vvvvvzw function
function vvvvvzw(how_vvvvvzw)
{
// set the function logic
if (how_vvvvvzw == 2 || how_vvvvvzw == 3)
if (isSet(how_vvvvvzw) && how_vvvvvzw.constructor !== Array)
{
var temp_vvvvvzw = how_vvvvvzw;
var how_vvvvvzw = [];
how_vvvvvzw.push(temp_vvvvvzw);
}
else if (!isSet(how_vvvvvzw))
{
var how_vvvvvzw = [];
}
var how = how_vvvvvzw.some(how_vvvvvzw_SomeFunc);
// set this function logic
if (how)
{
jQuery('.note_display_library_config').closest('.control-group').show();
}
@ -126,11 +191,35 @@ function vvvvvzw(how_vvvvvzw)
}
}
// the vvvvvzw Some function
function how_vvvvvzw_SomeFunc(how_vvvvvzw)
{
// set the function logic
if (how_vvvvvzw == 2 || how_vvvvvzw == 3)
{
return true;
}
return false;
}
// the vvvvvzx function
function vvvvvzx(how_vvvvvzx)
{
// set the function logic
if (how_vvvvvzx == 1 || how_vvvvvzx == 2 || how_vvvvvzx == 3)
if (isSet(how_vvvvvzx) && how_vvvvvzx.constructor !== Array)
{
var temp_vvvvvzx = how_vvvvvzx;
var how_vvvvvzx = [];
how_vvvvvzx.push(temp_vvvvvzx);
}
else if (!isSet(how_vvvvvzx))
{
var how_vvvvvzx = [];
}
var how = how_vvvvvzx.some(how_vvvvvzx_SomeFunc);
// set this function logic
if (how)
{
jQuery('.note_display_library_files_folders_urls').closest('.control-group').show();
}
@ -140,11 +229,35 @@ function vvvvvzx(how_vvvvvzx)
}
}
// the vvvvvzx Some function
function how_vvvvvzx_SomeFunc(how_vvvvvzx)
{
// set the function logic
if (how_vvvvvzx == 1 || how_vvvvvzx == 2 || how_vvvvvzx == 3)
{
return true;
}
return false;
}
// the vvvvvzy function
function vvvvvzy(how_vvvvvzy)
{
// set the function logic
if (how_vvvvvzy == 0)
if (isSet(how_vvvvvzy) && how_vvvvvzy.constructor !== Array)
{
var temp_vvvvvzy = how_vvvvvzy;
var how_vvvvvzy = [];
how_vvvvvzy.push(temp_vvvvvzy);
}
else if (!isSet(how_vvvvvzy))
{
var how_vvvvvzy = [];
}
var how = how_vvvvvzy.some(how_vvvvvzy_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();
@ -158,11 +271,35 @@ function vvvvvzy(how_vvvvvzy)
}
}
// the vvvvvzy Some function
function how_vvvvvzy_SomeFunc(how_vvvvvzy)
{
// set the function logic
if (how_vvvvvzy == 0)
{
return true;
}
return false;
}
// the vvvvvzz function
function vvvvvzz(how_vvvvvzz)
{
// set the function logic
if (how_vvvvvzz == 1)
if (isSet(how_vvvvvzz) && how_vvvvvzz.constructor !== Array)
{
var temp_vvvvvzz = how_vvvvvzz;
var how_vvvvvzz = [];
how_vvvvvzz.push(temp_vvvvvzz);
}
else if (!isSet(how_vvvvvzz))
{
var how_vvvvvzz = [];
}
var how = how_vvvvvzz.some(how_vvvvvzz_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();
@ -174,6 +311,48 @@ function vvvvvzz(how_vvvvvzz)
}
}
// the vvvvvzz Some function
function how_vvvvvzz_SomeFunc(how_vvvvvzz)
{
// set the function logic
if (how_vvvvvzz == 1)
{
return true;
}
return false;
}
// the vvvvwaa function
function vvvvwaa(type_vvvvwaa)
{
// set the function logic
if (type_vvvvwaa == 2)
{
jQuery('#jform_libraries').closest('.control-group').show();
if (jform_vvvvwaavzo_required)
{
updateFieldRequired('libraries',0);
jQuery('#jform_libraries').prop('required','required');
jQuery('#jform_libraries').attr('aria-required',true);
jQuery('#jform_libraries').addClass('required');
jform_vvvvwaavzo_required = false;
}
}
else
{
jQuery('#jform_libraries').closest('.control-group').hide();
if (!jform_vvvvwaavzo_required)
{
updateFieldRequired('libraries',1);
jQuery('#jform_libraries').removeAttr('required');
jQuery('#jform_libraries').removeAttr('aria-required');
jQuery('#jform_libraries').removeClass('required');
jform_vvvvwaavzo_required = true;
}
}
}
// update required fields
function updateFieldRequired(name,status)
{
@ -269,7 +448,7 @@ function addButton(type,where){
function getAjaxDisplay(type){
getAjaxDisplay_server(type).done(function(result) {
if(result){
if (result) {
jQuery('#display_'+type).html(result);
}
// set button
@ -279,7 +458,7 @@ function getAjaxDisplay(type){
function getAjaxDisplay_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&vdm="+vastDevMod;
if(token.length > 0 && type.length > 0){
if (token.length > 0 && type.length > 0) {
var request = 'token='+token+'&type=' + type;
}
return jQuery.ajax({
@ -293,7 +472,7 @@ function getAjaxDisplay_server(type){
function getFieldSelectOptions_server(fieldId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json";
if(token.length > 0 && fieldId > 0){
if (token.length > 0 && fieldId > 0) {
var request = 'token='+token+'&id='+fieldId;
}
return jQuery.ajax({
@ -310,11 +489,9 @@ function getFieldSelectOptions(fieldKey){
if(jQuery("#jform_addconditions__addconditions"+fieldKey+"__option_field").length) {
var fieldId = jQuery("#jform_addconditions__addconditions"+fieldKey+"__option_field option:selected").val();
getFieldSelectOptions_server(fieldId).done(function(result) {
if(result){
if(result) {
jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__field_options').val(result);
}
else
{
} else {
jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__field_options').val('');
}
});

View File

@ -122,15 +122,17 @@
message="COM_COMPONENTBUILDER_LIBRARY_DESCRIPTION_MESSAGE"
hint="COM_COMPONENTBUILDER_LIBRARY_DESCRIPTION_HINT"
/>
<!-- How Field. Type: Radio. (joomla) -->
<!-- How Field. Type: List. (joomla) -->
<field
type="radio"
type="list"
name="how"
label="COM_COMPONENTBUILDER_LIBRARY_HOW_LABEL"
description="COM_COMPONENTBUILDER_LIBRARY_HOW_DESCRIPTION"
class="btn-group btn-group-yesno"
default="2"
required="true">
class="list_class"
multiple="false"
filter="INT"
required="true"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_LIBRARY_ALWAYS_ADD</option>
@ -141,8 +143,29 @@
<option value="0">
COM_COMPONENTBUILDER_LIBRARY_DO_NOT_ADD</option>
</field>
<!-- Note_display_library_files_folders_urls Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_display_library_files_folders_urls" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_DISPLAY_LIBRARY_FILES_FOLDERS_URLS_DESCRIPTION" class="note_display_library_files_folders_urls" />
<!-- Type Field. Type: Radio. (joomla) -->
<field
type="radio"
name="type"
label="COM_COMPONENTBUILDER_LIBRARY_TYPE_LABEL"
description="COM_COMPONENTBUILDER_LIBRARY_TYPE_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1"
required="true">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_LIBRARY_MAIN</option>
<option value="2">
COM_COMPONENTBUILDER_LIBRARY_BUNDLE</option>
</field>
<!-- Not_required Field. Type: Hidden. (joomla) -->
<field
type="hidden"
name="not_required"
default="[]"
/>
<!-- Note_yes_behaviour_two Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_yes_behaviour_two" label="COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_TWO_LABEL" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_TWO_DESCRIPTION" heading="h4" class="alert alert-success note_yes_behaviour_two" />
<!-- Php_setdocument Field. Type: Textarea. (joomla) -->
<field
type="textarea"
@ -156,6 +179,21 @@
hint="COM_COMPONENTBUILDER_LIBRARY_PHP_SETDOCUMENT_HINT"
required="true"
/>
<!-- Note_display_library_files_folders_urls Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_display_library_files_folders_urls" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_DISPLAY_LIBRARY_FILES_FOLDERS_URLS_DESCRIPTION" class="note_display_library_files_folders_urls" />
<!-- Php_preparedocument Field. Type: Textarea. (joomla) -->
<field
type="textarea"
name="php_preparedocument"
label="COM_COMPONENTBUILDER_LIBRARY_PHP_PREPAREDOCUMENT_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_LIBRARY_PHP_PREPAREDOCUMENT_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_LIBRARY_PHP_PREPAREDOCUMENT_HINT"
required="true"
/>
<!-- Addconditions Field. Type: Subform. (joomla) -->
<field
type="subform"
@ -274,35 +312,26 @@
/>
</form>
</field>
<!-- Php_preparedocument Field. Type: Textarea. (joomla) -->
<!-- Libraries Field. Type: Librariesx. (custom) -->
<field
type="textarea"
name="php_preparedocument"
label="COM_COMPONENTBUILDER_LIBRARY_PHP_PREPAREDOCUMENT_LABEL"
rows="30"
cols="15"
description="COM_COMPONENTBUILDER_LIBRARY_PHP_PREPAREDOCUMENT_DESCRIPTION"
class="text_area span12"
filter="raw"
hint="COM_COMPONENTBUILDER_LIBRARY_PHP_PREPAREDOCUMENT_HINT"
required="true"
type="librariesx"
name="libraries"
label="COM_COMPONENTBUILDER_LIBRARY_LIBRARIES_LABEL"
description="COM_COMPONENTBUILDER_LIBRARY_LIBRARIES_DESCRIPTION"
class="list_class"
multiple="true"
default="0"
required="false"
button="true"
/>
<!-- Note_yes_behaviour_two Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_yes_behaviour_two" label="COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_TWO_LABEL" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_TWO_DESCRIPTION" heading="h4" class="alert alert-success note_yes_behaviour_two" />
<!-- Note_yes_behaviour_one Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_yes_behaviour_one" label="COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_ONE_LABEL" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_ONE_DESCRIPTION" heading="h4" class="alert alert-success note_yes_behaviour_one" />
<!-- Note_no_behaviour_three Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_no_behaviour_three" label="COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_THREE_LABEL" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_THREE_DESCRIPTION" heading="h4" class="alert alert-error note_no_behaviour_three" />
<!-- Note_no_behaviour_one Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_no_behaviour_one" label="COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_ONE_LABEL" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_ONE_DESCRIPTION" heading="h4" class="alert alert-error note_no_behaviour_one" />
<!-- Note_no_behaviour_two Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_no_behaviour_two" label="COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_TWO_LABEL" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_TWO_DESCRIPTION" heading="h4" class="alert alert-error note_no_behaviour_two" />
<!-- Not_required Field. Type: Hidden. (joomla) -->
<field
type="hidden"
name="not_required"
default="[]"
/>
<!-- Note_yes_behaviour_one Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_yes_behaviour_one" label="COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_ONE_LABEL" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_ONE_DESCRIPTION" heading="h4" class="alert alert-success note_yes_behaviour_one" />
<!-- Note_display_library_config Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_display_library_config" description="COM_COMPONENTBUILDER_LIBRARY_NOTE_DISPLAY_LIBRARY_CONFIG_DESCRIPTION" class="note_display_library_config" />
</fieldset>

View File

@ -107,12 +107,10 @@
type="subform"
name="addconfig"
label="COM_COMPONENTBUILDER_LIBRARY_CONFIG_ADDCONFIG_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
description="COM_COMPONENTBUILDER_LIBRARY_CONFIG_ADDCONFIG_DESCRIPTION"
icon="list"
maximum="500"
filter="ARRAY">
maximum="500">
<form hidden="true" name="list_addconfig_modal" repeat="true">
<!-- Field Field. Type: Fields. (custom) -->
<field
@ -146,7 +144,7 @@
label="COM_COMPONENTBUILDER_LIBRARY_CONFIG_TABNAME_LABEL"
size="40"
maxlength="150"
default="Library"
default="Global"
description="COM_COMPONENTBUILDER_LIBRARY_CONFIG_TABNAME_DESCRIPTION"
class="text_area"
readonly="false"

View File

@ -122,7 +122,7 @@ class ComponentbuilderModelFtp extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
public function getVzxlinked_components()
public function getVzylinked_components()
{
// Get the user object.
$user = JFactory::getUser();

View File

@ -838,6 +838,9 @@ class ComponentbuilderModelLayout extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// always reset the snippets
$data['snippet'] = 0;
// Set the libraries items to data.
if (isset($data['libraries']) && is_array($data['libraries']))
{

View File

@ -45,7 +45,9 @@ class ComponentbuilderModelLibraries extends JModelList
'a.created_by','created_by',
'a.modified_by','modified_by',
'a.name','name',
'a.description','description'
'a.description','description',
'a.type','type',
'a.how','how'
);
}
@ -70,7 +72,13 @@ class ComponentbuilderModelLibraries extends JModelList
$this->setState('filter.name', $name);
$description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description');
$this->setState('filter.description', $description);
$this->setState('filter.description', $description);
$type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type');
$this->setState('filter.type', $type);
$how = $this->getUserStateFromRequest($this->context . '.filter.how', 'filter_how');
$this->setState('filter.how', $how);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
$this->setState('filter.sorting', $sorting);
@ -131,6 +139,8 @@ class ComponentbuilderModelLibraries extends JModelList
{
// convert how
$item->how = $this->selectionTranslation($item->how, 'how');
// convert type
$item->type = $this->selectionTranslation($item->type, 'type');
}
}
@ -161,6 +171,19 @@ class ComponentbuilderModelLibraries extends JModelList
return $howArray[$value];
}
}
// Array of type language strings
if ($name === 'type')
{
$typeArray = array(
1 => 'COM_COMPONENTBUILDER_LIBRARY_MAIN',
2 => 'COM_COMPONENTBUILDER_LIBRARY_BUNDLE'
);
// Now check if value is found in this array
if (isset($typeArray[$value]) && ComponentbuilderHelper::checkString($typeArray[$value]))
{
return $typeArray[$value];
}
}
return $value;
}
@ -223,6 +246,16 @@ class ComponentbuilderModelLibraries extends JModelList
}
}
// Filter by How.
if ($how = $this->getState('filter.how'))
{
$query->where('a.how = ' . $db->quote($db->escape($how)));
}
// Filter by Type.
if ($type = $this->getState('filter.type'))
{
$query->where('a.type = ' . $db->quote($db->escape($type)));
}
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
@ -251,7 +284,9 @@ class ComponentbuilderModelLibraries extends JModelList
$id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by');
$id .= ':' . $this->getState('filter.name');
$id .= ':' . $this->getState('filter.description');
$id .= ':' . $this->getState('filter.description');
$id .= ':' . $this->getState('filter.type');
$id .= ':' . $this->getState('filter.how');
return parent::getStoreId($id);
}

View File

@ -108,6 +108,14 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$item->addconditions = $addconditions->toArray();
}
if (!empty($item->libraries))
{
// Convert the libraries field to an array.
$libraries = new Registry;
$libraries->loadString($item->libraries);
$item->libraries = $libraries->toArray();
}
if (!empty($item->php_setdocument))
{
// base64 Decode php_setdocument.
@ -441,7 +449,9 @@ class ComponentbuilderModelLibrary extends JModelAdmin
*/
protected function getUniqeFields()
{
return false;
return array('name');
}
/**
@ -937,6 +947,19 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$data['addconditions'] = '';
}
// Set the libraries items to data.
if (isset($data['libraries']) && is_array($data['libraries']))
{
$libraries = new JRegistry;
$libraries->loadArray($data['libraries']);
$data['libraries'] = (string) $libraries;
}
elseif (!isset($data['libraries']))
{
// Set the empty libraries to data
$data['libraries'] = '';
}
// Set the php_setdocument string to base64 string.
if (isset($data['php_setdocument']))
{
@ -962,6 +985,13 @@ class ComponentbuilderModelLibrary extends JModelAdmin
// give a notice that the name can not be changed
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_NAME_OF_THIS_LIBRARY_BSB_CAN_NOT_BE_CHANGED_TO_BSB_OR_THINGS_WILL_BREAK', $data['name'], $name_), 'warning');
}
// always insure they remain set a main libraries
$data['type'] = 1;
}
// also check to insure these names are not used again
if (!isset(ComponentbuilderHelper::$libraryNames[$data['id']]) && in_array($data['name'], ComponentbuilderHelper::$libraryNames))
{
$data['name'] = $this->generateUniqe('name', $data['name']);
}
// Set the Params Items to data

View File

@ -955,6 +955,9 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// always reset the snippets
$data['snippet'] = 0;
// Set the libraries items to data.
if (isset($data['libraries']) && is_array($data['libraries']))
{

View File

@ -838,6 +838,9 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// always reset the snippets
$data['snippet'] = 0;
// Set the libraries items to data.
if (isset($data['libraries']) && is_array($data['libraries']))
{