Fixed gh-235 to insure that the public access switch for front-end views work. Resolved gh-236 to Auto save Name to System Name if blank. Added text area for private key of server. Fixed the getModel helper method. Fixed the batch methods. Maked a few tweaks to the compiler.

This commit is contained in:
Llewellyn van der Merwe 2018-02-27 14:17:38 +02:00
parent 61a8d6fe3f
commit 1b86f1539a
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
98 changed files with 1409 additions and 1169 deletions

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.16) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.17) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -126,13 +126,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 20th February, 2018 + *Last Build*: 27th February, 2018
+ *Version*: 2.6.16 + *Version*: 2.6.17
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **182404** + *Line count*: **183098**
+ *Field count*: **1639** + *Field count*: **1641**
+ *File count*: **1168** + *File count*: **1169**
+ *Folder count*: **188** + *Folder count*: **188**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.16) with **ALL** its features and **ALL** concepts totally open-source and free! You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.6.17) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -126,13 +126,13 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 20th February, 2018 + *Last Build*: 27th February, 2018
+ *Version*: 2.6.16 + *Version*: 2.6.17
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **182404** + *Line count*: **183098**
+ *Field count*: **1639** + *Field count*: **1641**
+ *File count*: **1168** + *File count*: **1169**
+ *Folder count*: **188** + *Folder count*: **188**
> This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com).

View File

@ -463,20 +463,43 @@ abstract class ###Component###Helper
/** /**
* Get any component's model * Get any component's model
**/ **/
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = '###component###') public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = '###Component###', $config = array())
{ {
// fix the name
$name = self::safeString($name);
// full path
$fullPath = $path . '/models';
// set prefix
$prefix = $component.'Model';
// load the model file // load the model file
JModelLegacy::addIncludePath( $path . '/models' ); JModelLegacy::addIncludePath($fullPath, $prefix);
// get instance // get instance
$model = JModelLegacy::getInstance( $name, $component.'Model' ); $model = JModelLegacy::getInstance($name, $prefix, $config);
// if model not found // if model not found (strange)
if ($model == false) if ($model == false)
{ {
// build class name jimport('joomla.filesystem.file');
$class = $prefix.$name; // get file path
// initilize the model $filePath = $path.'/'.$name.'.php';
new $class(); $fullPath = $fullPath.'/'.$name.'.php';
$model = JModelLegacy::getInstance($name, $prefix); // check if it exists
if (JFile::exists($filePath))
{
// get the file
require_once $filePath;
}
elseif (JFile::exists($fullPath))
{
// get the file
require_once $fullPath;
}
// build class names
$modelClass = $prefix.$name;
if (class_exists($modelClass))
{
// initialize the model
return new $modelClass($config);
}
} }
return $model; return $model;
} }

View File

@ -134,23 +134,43 @@ abstract class ###Component###Helper
/** /**
* Get any component's model * Get any component's model
**/ **/
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = '###component###') public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = '###Component###', $config = array())
{ {
// fix the name
$name = self::safeString($name);
// full path // full path
$fullPath = $path . '/models'; $fullPath = $path . '/models';
// set prefix
$prefix = $component.'Model';
// load the model file // load the model file
JModelLegacy::addIncludePath($fullPath); JModelLegacy::addIncludePath($fullPath, $prefix);
// get instance // get instance
$model = JModelLegacy::getInstance( $name, $component.'Model' ); $model = JModelLegacy::getInstance($name, $prefix, $config);
// if model not found // if model not found (strange)
if ($model == false) if ($model == false)
{ {
require_once $fullPath.'/'.strtolower($name).'.php'; jimport('joomla.filesystem.file');
// build class name // get file path
$class = $prefix.$name; $filePath = $path.'/'.$name.'.php';
// initialize the model $fullPath = $fullPath.'/'.$name.'.php';
new $class(); // check if it exists
$model = JModelLegacy::getInstance($name, $prefix); if (JFile::exists($filePath))
{
// get the file
require_once $filePath;
}
elseif (JFile::exists($fullPath))
{
// get the file
require_once $fullPath;
}
// build class names
$modelClass = $prefix.$name;
if (class_exists($modelClass))
{
// initialize the model
return new $modelClass($config);
}
} }
return $model; return $model;
} }

View File

@ -331,23 +331,24 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm
$oldID = $this->input->get('id', 0, 'INT'); $oldID = $this->input->get('id', 0, 'INT');
// linked tables to update // linked tables to update
$_tablesArray = array( $_tablesArray = array(
'component_admin_views', 'component_admin_views' => 'joomla_component',
'component_site_views', 'component_site_views' => 'joomla_component',
'component_custom_admin_views', 'component_custom_admin_views' => 'joomla_component',
'component_updates', 'component_updates' => 'joomla_component',
'component_mysql_tweaks', 'component_mysql_tweaks' => 'joomla_component',
'component_custom_admin_menus', 'component_custom_admin_menus' => 'joomla_component',
'component_config', 'component_config' => 'joomla_component',
'component_dashboard', 'component_dashboard' => 'joomla_component',
'component_files_folders' 'component_files_folders' => 'joomla_component',
'custom_code' => 'component'
); );
foreach($_tablesArray as $_updateTable) foreach($_tablesArray as $_updateTable => $_key)
{ {
// get the linked ID // get the linked ID
if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, 'joomla_component', 'id')) if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, $_key, 'id'))
{ {
// copy fields to new linked table // copy fields to new linked table
ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array('joomla_component' => $newID)); ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array($_key => $newID));
} }
} }
} }

View File

@ -239,7 +239,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error');
return; return;
} }
public function backup() public function backup()
{ {
// get params first // get params first
@ -399,7 +399,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error');
return; return;
} }
protected function getApiUser() protected function getApiUser()
{ {
// admin area does not have API user, only front-end (so we fallback on login user) // admin area does not have API user, only front-end (so we fallback on login user)

View File

@ -699,5 +699,4 @@ class Compiler extends Infusion
// any help to improve this is welcome... // any help to improve this is welcome...
} }
} }

View File

@ -5144,8 +5144,8 @@ class Get
else else
{ {
return array( return array(
'start' => "\t\t\t", 'start' => "",
'end' => "\t\t\t"); 'end' => "");
} }
break; break;
case 12: case 12:
@ -5159,8 +5159,8 @@ class Get
else else
{ {
return array( return array(
'start' => "\t\t\t", 'start' => "",
'end' => "\t\t\t"); 'end' => "");
} }
break; break;
case 21: case 21:
@ -5174,8 +5174,8 @@ class Get
else else
{ {
return array( return array(
'start' => "\t\t\t", 'start' => "",
'end' => "\t\t\t"); 'end' => "");
} }
break; break;
case 22: case 22:
@ -5189,14 +5189,14 @@ class Get
else else
{ {
return array( return array(
'start' => "\t\t\t", 'start' => "",
'end' => "\t\t\t"); 'end' => " ");
} }
break; break;
case 3: case 3:
return array( return array(
'start' => "\t\t\t", 'start' => "",
'end' => "\t\t\t"); 'end' => "");
break; break;
} }
return false; return false;

View File

@ -89,6 +89,13 @@ class Fields extends Structure
*/ */
public $doNotEscape = array(); public $doNotEscape = array();
/**
* list of classes used in the list view for the fields
*
* @var array
*/
public $listFieldClass = array();
/** /**
* tags builder * tags builder
* *
@ -1681,6 +1688,12 @@ class Fields extends Structure
// do some nice twigs beyond the default // do some nice twigs beyond the default
if (isset($fieldAttributes['name'])) if (isset($fieldAttributes['name']))
{ {
// check if we have class value for the list view of this field
$listclass = ComponentbuilderHelper::getBetween($field['settings']->xml, 'listclass="', '"');
if (ComponentbuilderHelper::checkString($listclass))
{
$this->listFieldClass[$listViewName][$fieldAttributes['name']] = $listclass;
}
// check if we find reason to remove this field from being escaped // check if we find reason to remove this field from being escaped
$escaped = ComponentbuilderHelper::getBetween($field['settings']->xml, 'escape="', '"'); $escaped = ComponentbuilderHelper::getBetween($field['settings']->xml, 'escape="', '"');
if (ComponentbuilderHelper::checkString($escaped)) if (ComponentbuilderHelper::checkString($escaped))

View File

@ -4996,8 +4996,6 @@ class Interpretation extends Fields
$batchmove[] = "\t\t\t\$this->user = JFactory::getUser();"; $batchmove[] = "\t\t\t\$this->user = JFactory::getUser();";
$batchmove[] = "\t\t\t\$this->table = \$this->getTable();"; $batchmove[] = "\t\t\t\$this->table = \$this->getTable();";
$batchmove[] = "\t\t\t\$this->tableClassName = get_class(\$this->table);"; $batchmove[] = "\t\t\t\$this->tableClassName = get_class(\$this->table);";
$batchmove[] = "\t\t\t\$this->contentType = new JUcmType;";
$batchmove[] = "\t\t\t\$this->type = \$this->contentType->getTypeByTable(\$this->tableClassName);";
$batchmove[] = "\t\t\t\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');"; $batchmove[] = "\t\t\t\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');";
$batchmove[] = "\t\t}"; $batchmove[] = "\t\t}";
@ -5062,7 +5060,7 @@ class Interpretation extends Fields
$batchmove[] = "\t\t\t{"; $batchmove[] = "\t\t\t{";
$batchmove[] = "\t\t\t\t\$this->setError(JText:".":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));"; $batchmove[] = "\t\t\t\t\$this->setError(JText:".":_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));";
$batchmove[] = PHP_EOL . "\t\t\t\treturn false;"; $batchmove[] = "\t\t\t\treturn false;";
$batchmove[] = "\t\t\t}"; $batchmove[] = "\t\t\t}";
$batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists"; $batchmove[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists";
@ -5073,7 +5071,7 @@ class Interpretation extends Fields
$batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fatal error"; $batchmove[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fatal error";
$batchmove[] = "\t\t\t\t\t\$this->setError(\$error);"; $batchmove[] = "\t\t\t\t\t\$this->setError(\$error);";
$batchmove[] = PHP_EOL . "\t\t\t\t\treturn false;"; $batchmove[] = "\t\t\t\t\treturn false;";
$batchmove[] = "\t\t\t\t}"; $batchmove[] = "\t\t\t\t}";
$batchmove[] = "\t\t\t\telse"; $batchmove[] = "\t\t\t\telse";
$batchmove[] = "\t\t\t\t{"; $batchmove[] = "\t\t\t\t{";
@ -5187,8 +5185,6 @@ class Interpretation extends Fields
$batchcopy[] = "\t\t\t\$this->user = JFactory::getUser();"; $batchcopy[] = "\t\t\t\$this->user = JFactory::getUser();";
$batchcopy[] = "\t\t\t\$this->table = \$this->getTable();"; $batchcopy[] = "\t\t\t\$this->table = \$this->getTable();";
$batchcopy[] = "\t\t\t\$this->tableClassName = get_class(\$this->table);"; $batchcopy[] = "\t\t\t\$this->tableClassName = get_class(\$this->table);";
$batchcopy[] = "\t\t\t\$this->contentType = new JUcmType;";
$batchcopy[] = "\t\t\t\$this->type = \$this->contentType->getTypeByTable(\$this->tableClassName);";
$batchcopy[] = "\t\t\t\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');"; $batchcopy[] = "\t\t\t\$this->canDo = " . $Helper . "::getActions('" . $viewName_single . "');";
$batchcopy[] = "\t\t}"; $batchcopy[] = "\t\t}";
if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']])) if ($coreLoad && isset($core['core.create']) && isset($this->permissionBuilder['global'][$core['core.create']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder['global'][$core['core.create']]) && in_array($viewName_single, $this->permissionBuilder['global'][$core['core.create']]))
@ -5245,7 +5241,7 @@ class Interpretation extends Fields
$batchcopy[] = PHP_EOL . "\t\t\$newIds = array();"; $batchcopy[] = PHP_EOL . "\t\t\$newIds = array();";
$batchcopy[] = PHP_EOL . "\t\t//" . $this->setLine(__LINE__) . " Parent exists so let's proceed"; $batchcopy[] = "\t\t//" . $this->setLine(__LINE__) . " Parent exists so let's proceed";
$batchcopy[] = "\t\twhile (!empty(\$pks))"; $batchcopy[] = "\t\twhile (!empty(\$pks))";
$batchcopy[] = "\t\t{"; $batchcopy[] = "\t\t{";
$batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " Pop the first ID off the stack"; $batchcopy[] = "\t\t\t//" . $this->setLine(__LINE__) . " Pop the first ID off the stack";
@ -5256,17 +5252,17 @@ class Interpretation extends Fields
$batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " only allow copy if user may edit this item."; $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " only allow copy if user may edit this item.";
if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']])) if ($coreLoad && isset($core['core.edit']) && isset($this->permissionBuilder[$core['core.edit']]) && ComponentbuilderHelper::checkArray($this->permissionBuilder[$core['core.edit']]) && in_array($viewName_single, $this->permissionBuilder[$core['core.edit']]))
{ {
$batchcopy[] = PHP_EOL . "\t\t\tif (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))"; $batchcopy[] = "\t\t\tif (!\$this->user->authorise('" . $core['core.edit'] . "', \$contexts[\$pk]))";
} }
else else
{ {
$batchcopy[] = PHP_EOL . "\t\t\tif (!\$this->user->authorise('core.edit', \$contexts[\$pk]))"; $batchcopy[] = "\t\t\tif (!\$this->user->authorise('core.edit', \$contexts[\$pk]))";
} }
$batchcopy[] = PHP_EOL . "\t\t\t{"; $batchcopy[] = "\t\t\t{";
$batchcopy[] = PHP_EOL . "\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error"; $batchcopy[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error";
$batchcopy[] = PHP_EOL . "\t\t\t\t\$this->setError(JText:".":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; $batchcopy[] = "\t\t\t\t\$this->setError(JText:".":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));";
$batchcopy[] = PHP_EOL . "\t\t\t\tcontinue;"; $batchcopy[] = "\t\t\t\tcontinue;";
$batchcopy[] = PHP_EOL . "\t\t\t}"; $batchcopy[] = "\t\t\t}";
$batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists"; $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists";
$batchcopy[] = "\t\t\tif (!\$this->table->load(\$pk))"; $batchcopy[] = "\t\t\tif (!\$this->table->load(\$pk))";
@ -5276,7 +5272,7 @@ class Interpretation extends Fields
$batchcopy[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fatal error"; $batchcopy[] = "\t\t\t\t\t//" . $this->setLine(__LINE__) . " Fatal error";
$batchcopy[] = "\t\t\t\t\t\$this->setError(\$error);"; $batchcopy[] = "\t\t\t\t\t\$this->setError(\$error);";
$batchcopy[] = PHP_EOL . "\t\t\t\t\treturn false;"; $batchcopy[] = "\t\t\t\t\treturn false;";
$batchcopy[] = "\t\t\t\t}"; $batchcopy[] = "\t\t\t\t}";
$batchcopy[] = "\t\t\t\telse"; $batchcopy[] = "\t\t\t\telse";
$batchcopy[] = "\t\t\t\t{"; $batchcopy[] = "\t\t\t\t{";
@ -5309,11 +5305,15 @@ class Interpretation extends Fields
} }
elseif (!$category && $alias && $title) elseif (!$category && $alias && $title)
{ {
$batchcopy[] = PHP_EOL . "\t\t\tlist(\$this->table->" . $title . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias . ", \$this->table->" . $title . ");"; $batchcopy[] = "\t\t\tlist(\$this->table->" . $title . ", \$this->table->" . $alias . ") = \$this->_generateNewTitle(\$this->table->" . $alias . ", \$this->table->" . $title . ");";
} }
elseif (!$category && !$alias && $title && $title != 'user' && $title != 'jobnumber') // TODO [jobnumber] just for one project (not ideal) elseif (!$category && !$alias && $title && $title != 'user' && $title != 'jobnumber') // TODO [jobnumber] just for one project (not ideal)
{ {
$batchcopy[] = PHP_EOL . "\t\t\t\$this->table->" . $title . " = \$this->generateUniqe('" . $title . "',\$this->table->" . $title . ");"; $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Only for strings";
$batchcopy[] = "\t\t\tif (" . $Helper . "::checkString(\$this->table->" . $title . ") && !is_numeric(\$this->table->" . $title . "))";
$batchcopy[] = "\t\t\t{";
$batchcopy[] = "\t\t\t\t\$this->table->" . $title . " = \$this->generateUniqe('" . $title . "',\$this->table->" . $title . ");";
$batchcopy[] = "\t\t\t}";
} }
$batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " insert all set values"; $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " insert all set values";
@ -6164,7 +6164,7 @@ class Interpretation extends Fields
{ {
$otherViews = $this->catCodeBuilder[$viewName_single]['views']; $otherViews = $this->catCodeBuilder[$viewName_single]['views'];
// category and linked // category and linked
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php if (\$this->user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (\$this->user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_categories&task=category.edit&id=<?php echo (int)$item->' . $item['code'] . '; ?>&extension=com_' . $this->fileContentStatic['###component###'] . '.' . $otherViews . '"><?php echo $this->escape($item->category_title); ?></a>'; $body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_categories&task=category.edit&id=<?php echo (int)$item->' . $item['code'] . '; ?>&extension=com_' . $this->fileContentStatic['###component###'] . '.' . $otherViews . '"><?php echo $this->escape($item->category_title); ?></a>';
$body .= PHP_EOL . "\t\t\t<?php else: ?>"; $body .= PHP_EOL . "\t\t\t<?php else: ?>";
@ -6176,7 +6176,7 @@ class Interpretation extends Fields
{ {
// user and linked // user and linked
$body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . "User = JFactory::getUser(\$item->" . $item['code'] . "); ?>"; $body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . "User = JFactory::getUser(\$item->" . $item['code'] . "); ?>";
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php if (\$this->user->authorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (\$this->user->authorise('core.edit', 'com_users')): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['code'] . ' ?>"><?php echo $' . $item['code'] . 'User->name; ?></a>'; $body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['code'] . ' ?>"><?php echo $' . $item['code'] . 'User->name; ?></a>';
$body .= PHP_EOL . "\t\t\t<?php else: ?>"; $body .= PHP_EOL . "\t\t\t<?php else: ?>";
@ -6212,7 +6212,7 @@ class Interpretation extends Fields
{ {
// user and linked // user and linked
$body .= PHP_EOL . "\t\t<?php \$" . $item['id'] . " = JFactory::getUser(\$item->" . $item['id'] . "); ?>"; $body .= PHP_EOL . "\t\t<?php \$" . $item['id'] . " = JFactory::getUser(\$item->" . $item['id'] . "); ?>";
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php if (\$this->user->authorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (\$this->user->authorise('core.edit', 'com_users')): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['id'] . ' ?>"><?php echo $' . $item['id'] . '->name; ?></a>'; $body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['id'] . ' ?>"><?php echo $' . $item['id'] . '->name; ?></a>';
$body .= PHP_EOL . "\t\t\t<?php else: ?>"; $body .= PHP_EOL . "\t\t\t<?php else: ?>";
@ -6261,7 +6261,7 @@ class Interpretation extends Fields
if ($add) if ($add)
{ {
// set as linked // set as linked
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php if (" . $accessCheck . "): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (" . $accessCheck . "): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<div class="name">' . PHP_EOL . "\t\t\t\t\t" . '<a href="' . $link . '">' . $itemCode . '</a>'; $body .= PHP_EOL . "\t\t\t\t" . '<div class="name">' . PHP_EOL . "\t\t\t\t\t" . '<a href="' . $link . '">' . $itemCode . '</a>';
if ($checkoutTriger) if ($checkoutTriger)
@ -6283,7 +6283,7 @@ class Interpretation extends Fields
{ {
if ($item['type'] === 'category') if ($item['type'] === 'category')
{ {
$body .= PHP_EOL . "\t\t<td class=\"hidden-phone\">"; $body .= PHP_EOL . "\t\t<td class=\"".$this->setListFieldClass($item['code'], $viewName_list, 'hidden-phone')."\">";
$body .= PHP_EOL . "\t\t\t<?php echo \$this->escape(\$item->category_title); ?>"; $body .= PHP_EOL . "\t\t\t<?php echo \$this->escape(\$item->category_title); ?>";
$body .= PHP_EOL . "\t\t</td>"; $body .= PHP_EOL . "\t\t</td>";
} }
@ -6291,7 +6291,7 @@ class Interpretation extends Fields
{ {
// custom user and linked // custom user and linked
$body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . " = JFactory::getUser(\$item->" . $item['id'] . "); ?>"; $body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . " = JFactory::getUser(\$item->" . $item['id'] . "); ?>";
$body .= PHP_EOL . "\t\t" . '<td class="nowrap hidden-phone">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap hidden-phone').'">';
$body .= PHP_EOL . "\t\t\t<?php if (\$this->user->authorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (\$this->user->authorise('core.edit', 'com_users')): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['id'] . ' ?>"><?php echo $' . $item['code'] . '->name; ?></a>'; $body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['id'] . ' ?>"><?php echo $' . $item['code'] . '->name; ?></a>';
$body .= PHP_EOL . "\t\t\t<?php else: ?>"; $body .= PHP_EOL . "\t\t\t<?php else: ?>";
@ -6303,14 +6303,14 @@ class Interpretation extends Fields
{ {
// user name only // user name only
$body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . "User = JFactory::getUser(\$item->" . $item['code'] . "); ?>"; $body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . "User = JFactory::getUser(\$item->" . $item['code'] . "); ?>";
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php echo \$" . $item['code'] . "User->name; ?>"; $body .= PHP_EOL . "\t\t\t<?php echo \$" . $item['code'] . "User->name; ?>";
$body .= PHP_EOL . "\t\t</td>"; $body .= PHP_EOL . "\t\t</td>";
} }
else else
{ {
// normal not linked // normal not linked
$body .= PHP_EOL . "\t\t<td class=\"hidden-phone\">"; $body .= PHP_EOL . "\t\t<td class=\"".$this->setListFieldClass($item['code'], $viewName_list, 'hidden-phone')."\">";
$body .= PHP_EOL . "\t\t\t" . $itemCode; $body .= PHP_EOL . "\t\t\t" . $itemCode;
$body .= PHP_EOL . "\t\t</td>"; $body .= PHP_EOL . "\t\t</td>";
} }
@ -6345,7 +6345,7 @@ class Interpretation extends Fields
} }
if (!isset($this->fieldsNames[$viewName_single]['id'])) if (!isset($this->fieldsNames[$viewName_single]['id']))
{ {
$body .= PHP_EOL . "\t\t" . '<td class="nowrap center hidden-phone">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap center hidden-phone').'">';
$body .= PHP_EOL . "\t\t\t<?php echo \$item->id; ?>"; $body .= PHP_EOL . "\t\t\t<?php echo \$item->id; ?>";
$body .= PHP_EOL . "\t\t</td>"; $body .= PHP_EOL . "\t\t</td>";
} }
@ -6357,6 +6357,11 @@ class Interpretation extends Fields
return ''; return '';
} }
protected function setListFieldClass($name, $listViewName, $default = '')
{
return (isset($this->listFieldClass[$listViewName]) && isset($this->listFieldClass[$listViewName][$name])) ? $this->listFieldClass[$listViewName][$name] : $default;
}
public function setListHead($viewName_single, $viewName_list) public function setListHead($viewName_single, $viewName_list)
{ {
if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list])) if (isset($this->listBuilder[$viewName_list]) && ComponentbuilderHelper::checkArray($this->listBuilder[$viewName_list]))
@ -7324,7 +7329,7 @@ class Interpretation extends Fields
{ {
$otherViews = $this->catCodeBuilder[$viewName_single]['views']; $otherViews = $this->catCodeBuilder[$viewName_single]['views'];
// category and linked // category and linked
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php if (\$user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (\$user->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_categories&task=category.edit&id=<?php echo (int)$item->' . $item['code'] . '; ?>&extension=com_' . $this->fileContentStatic['###component###'] . '.' . $otherViews . '"><?php echo $displayData->escape($item->category_title); ?></a>'; $body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_categories&task=category.edit&id=<?php echo (int)$item->' . $item['code'] . '; ?>&extension=com_' . $this->fileContentStatic['###component###'] . '.' . $otherViews . '"><?php echo $displayData->escape($item->category_title); ?></a>';
$body .= PHP_EOL . "\t\t\t<?php else: ?>"; $body .= PHP_EOL . "\t\t\t<?php else: ?>";
@ -7336,7 +7341,7 @@ class Interpretation extends Fields
{ {
// user and linked // user and linked
$body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . "User = JFactory::getUser(\$item->" . $item['code'] . "); ?>"; $body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . "User = JFactory::getUser(\$item->" . $item['code'] . "); ?>";
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php if (\$user->authorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (\$user->authorise('core.edit', 'com_users')): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['code'] . ' ?>"><?php echo $' . $item['code'] . 'User->name; ?></a>'; $body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['code'] . ' ?>"><?php echo $' . $item['code'] . 'User->name; ?></a>';
$body .= PHP_EOL . "\t\t\t<?php else: ?>"; $body .= PHP_EOL . "\t\t\t<?php else: ?>";
@ -7385,7 +7390,7 @@ class Interpretation extends Fields
{ {
// user and linked // user and linked
$body .= PHP_EOL . "\t\t<?php \$_" . $item['id'] . " = JFactory::getUser(\$item->" . $item['id'] . "); ?>"; $body .= PHP_EOL . "\t\t<?php \$_" . $item['id'] . " = JFactory::getUser(\$item->" . $item['id'] . "); ?>";
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php if (\$user->authorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (\$user->authorise('core.edit', 'com_users')): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['id'] . ' ?>"><?php echo $_' . $item['id'] . '->name; ?></a>'; $body .= PHP_EOL . "\t\t\t\t" . '<a href="index.php?option=com_users&task=user.edit&id=<?php echo (int) $item->' . $item['id'] . ' ?>"><?php echo $_' . $item['id'] . '->name; ?></a>';
$body .= PHP_EOL . "\t\t\t<?php else: ?>"; $body .= PHP_EOL . "\t\t\t<?php else: ?>";
@ -7433,7 +7438,7 @@ class Interpretation extends Fields
if ($add) if ($add)
{ {
// set as linked // set as linked
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php if (" . $accessCheck . "): ?>"; $body .= PHP_EOL . "\t\t\t<?php if (" . $accessCheck . "): ?>";
$body .= PHP_EOL . "\t\t\t\t" . '<a href="' . $link . '">' . $itemCode . '</a>'; $body .= PHP_EOL . "\t\t\t\t" . '<a href="' . $link . '">' . $itemCode . '</a>';
if ($checkoutTriger) if ($checkoutTriger)
@ -7474,7 +7479,7 @@ class Interpretation extends Fields
{ {
// user name only // user name only
$body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . "User = JFactory::getUser(\$item->" . $item['code'] . "); ?>"; $body .= PHP_EOL . "\t\t<?php \$" . $item['code'] . "User = JFactory::getUser(\$item->" . $item['code'] . "); ?>";
$body .= PHP_EOL . "\t\t" . '<td class="nowrap">'; $body .= PHP_EOL . "\t\t" . '<td class="'.$this->setListFieldClass($item['code'], $viewName_list, 'nowrap').'">';
$body .= PHP_EOL . "\t\t\t<?php echo \$" . $item['code'] . "User->name; ?>"; $body .= PHP_EOL . "\t\t\t<?php echo \$" . $item['code'] . "User->name; ?>";
$body .= PHP_EOL . "\t\t</td>"; $body .= PHP_EOL . "\t\t</td>";
} }
@ -14404,7 +14409,7 @@ function vdm_dkim() {
$this->componentGlobal[$sortKey] = "\t\t" . '<action name="site.' . $siteCode . '.access" title="' . $siteTitle . '" description="' . $siteDesc . '" />'; $this->componentGlobal[$sortKey] = "\t\t" . '<action name="site.' . $siteCode . '.access" title="' . $siteTitle . '" description="' . $siteDesc . '" />';
// check if this site view requires access rule to default to public // check if this site view requires access rule to default to public
if (isset($site_view['public']) && $site_view['public'] == 1) if (isset($site_view['public_access']) && $site_view['public_access'] == 1)
{ {
// we use one as public group (TODO we see if we run into any issues) // we use one as public group (TODO we see if we run into any issues)
$this->assetsRules[] = '"site.' . $siteCode . '.access":{"1":1}'; $this->assetsRules[] = '"site.' . $siteCode . '.access":{"1":1}';

View File

@ -157,7 +157,7 @@ abstract class ComponentbuilderHelper
} }
return $object; return $object;
} }
public static function getDynamicScripts($type, $fieldName = false) public static function getDynamicScripts($type, $fieldName = false)
{ {
// if field name is passed the convert to type // if field name is passed the convert to type
@ -876,7 +876,7 @@ abstract class ComponentbuilderHelper
} }
return false; return false;
} }
/** /**
* Run Global Updater if any are set * Run Global Updater if any are set
* *
@ -1303,7 +1303,7 @@ abstract class ComponentbuilderHelper
// load this for all // load this for all
jimport('joomla.application'); jimport('joomla.application');
} }
/** /**
* Remove folders with files * Remove folders with files
* *
@ -1369,7 +1369,7 @@ abstract class ComponentbuilderHelper
} }
return false; return false;
} }
/** /**
* The dynamic builder of views, tables and fields * The dynamic builder of views, tables and fields
**/ **/
@ -1378,7 +1378,7 @@ abstract class ComponentbuilderHelper
self::autoLoader('extrusion'); self::autoLoader('extrusion');
$extruder = new Extrusion($data); $extruder = new Extrusion($data);
} }
/** /**
* The zipper method * The zipper method
* *
@ -1428,8 +1428,8 @@ abstract class ComponentbuilderHelper
} }
return false; return false;
} }
/** /**
* Write a file to the server * Write a file to the server
* *
@ -1461,7 +1461,7 @@ abstract class ComponentbuilderHelper
} }
return $klaar; return $klaar;
} }
public static function getFieldOptions($value, $type, $settings = array()) public static function getFieldOptions($value, $type, $settings = array())
{ {
// Get a db connection. // Get a db connection.
@ -1663,7 +1663,7 @@ abstract class ComponentbuilderHelper
// noting for now // noting for now
return true; return true;
} }
/** /**
* the Butler * the Butler
**/ **/
@ -1711,7 +1711,7 @@ abstract class ComponentbuilderHelper
} }
return self::$localSession[$key]; return self::$localSession[$key];
} }
/** /**
* check if it is a new hash * check if it is a new hash
**/ **/
@ -1735,7 +1735,33 @@ abstract class ComponentbuilderHelper
} }
return false; return false;
} }
/**
* prepare base64 string for url
**/
public static function base64_urlencode($string, $encode = false)
{
if ($encode)
{
$string = base64_encode($string);
}
return str_replace(array('+', '/'), array('-', '_'), $string);
}
/**
* prepare base64 string form url
**/
public static function base64_urldecode($string, $decode = false)
{
$string = str_replace(array('-', '_'), array('+', '/'), $string);
if ($decode)
{
$string = base64_decode($string);
}
return $string;
}
/** /**
* Check if the url exist * Check if the url exist
* *
@ -1777,8 +1803,8 @@ abstract class ComponentbuilderHelper
} }
} }
return $exists; return $exists;
} }
/** /**
* Get the file path or url * Get the file path or url
* *
@ -1848,8 +1874,8 @@ abstract class ComponentbuilderHelper
// sanitize the path // sanitize the path
return '/' . trim( $filePath, '/' ) . '/' . $fileName; return '/' . trim( $filePath, '/' ) . '/' . $fileName;
} }
/** /**
* Get the file path or url * Get the file path or url
* *
@ -1889,8 +1915,8 @@ abstract class ComponentbuilderHelper
// sanitize the path // sanitize the path
return '/' . trim( $folderPath, '/' ) . '/'; return '/' . trim( $folderPath, '/' ) . '/';
} }
/** /**
* get the content of a file * get the content of a file
* *
@ -1942,17 +1968,28 @@ abstract class ComponentbuilderHelper
} }
return $none; return $none;
} }
/**
* Composer Switch
**/
protected static $composer = false;
/** /**
* Load the Composer Vendors * Load the Composer Vendors
**/ **/
public static function composerAutoload() public static function composerAutoload()
{ {
// load the autoloader // insure we load the composer vendors only once
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php'; if (!self::$composer)
} {
// load the autoloader
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php';
// do not load again
self::$composer = true;
}
}
/** /**
* Move File to Server * Move File to Server
* *
@ -2078,47 +2115,99 @@ abstract class ComponentbuilderHelper
} }
break; break;
case 2: // private key file case 2: // private key file
$rsa = new phpseclib\Crypt\RSA(); if (self::checkObject(self::crypt('RSA')))
// check if we have a passprase
if (self::checkString($server->secret))
{ {
$rsa->setPassword($server->secret); // check if we have a passprase
} if (self::checkString($server->secret))
// now load the key file {
if (!$rsa->loadKey(self::getFileContents($server->private, null))) self::crypt('RSA')->setPassword($server->secret);
{ }
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); // now load the key file
unset(self::$sftp[$server->cache]); if (!self::crypt('RSA')->loadKey(self::getFileContents($server->private, null)))
return false; {
} JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error');
// now login unset(self::$sftp[$server->cache]);
if (!self::$sftp[$server->cache]->login($server->username, $rsa)) return false;
{ }
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); // now login
unset(self::$sftp[$server->cache]); if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA')))
return false; {
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
} }
break; break;
case 3: // both password and private key file case 3: // both password and private key file
$rsa = new phpseclib\Crypt\RSA(); if (self::checkObject(self::crypt('RSA')))
// check if we have a passphrase
if (self::checkString($server->secret))
{ {
$rsa->setPassword($server->secret); // check if we have a passphrase
if (self::checkString($server->secret))
{
self::crypt('RSA')->setPassword($server->secret);
}
// now load the key file
if (!self::crypt('RSA')->loadKey(self::getFileContents($server->private, null)))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
// now login
if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA')))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
} }
// now load the key file break;
if (!$rsa->loadKey(self::getFileContents($server->private, null))) case 4: // private key field
if (self::checkObject(self::crypt('RSA')))
{ {
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); // check if we have a passprase
unset(self::$sftp[$server->cache]); if (self::checkString($server->secret))
return false; {
self::crypt('RSA')->setPassword($server->secret);
}
// now load the key field
if (!self::crypt('RSA')->loadKey($server->private_key))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
// now login
if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA')))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
} }
// now login break;
if (!self::$sftp[$server->cache]->login($server->username, $server->password, $rsa)) case 5: // both password and private key field
if (self::checkObject(self::crypt('RSA')))
{ {
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); // check if we have a passphrase
unset(self::$sftp[$server->cache]); if (self::checkString($server->secret))
return false; {
self::crypt('RSA')->setPassword($server->secret);
}
// now load the key file
if (!self::crypt('RSA')->loadKey($server->private_key))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
// now login
if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA')))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
} }
break; break;
} }
@ -2262,9 +2351,9 @@ abstract class ComponentbuilderHelper
if (2 == $protocol) if (2 == $protocol)
{ {
// SFTP // SFTP
$query->select($db->quoteName(array('name','authentication','username','host','password','path','port','private','secret'))); $query->select($db->quoteName(array('name','authentication','username','host','password','path','port','private','private_key','secret')));
// cache builder // cache builder
$cache = array('authentication','username','host','password','port','private','secret'); $cache = array('authentication','username','host','password','port','private','private_key','secret');
} }
else else
{ {
@ -2282,7 +2371,7 @@ abstract class ComponentbuilderHelper
{ {
$server = $db->loadObject(); $server = $db->loadObject();
// Get the basic encryption. // Get the basic encryption.
$basickey = self::getCryptKey('basic'); $basickey = self::getCryptKey('basic', 'Th1sMnsTbL0ck@d');
// Get the encryption object. // Get the encryption object.
$basic = new FOFEncryptAes($basickey, 128); $basic = new FOFEncryptAes($basickey, 128);
// start cache keys // start cache keys
@ -2320,7 +2409,6 @@ abstract class ComponentbuilderHelper
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error'); JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error');
return false; return false;
} }
/** /**
* Load the Component xml manifest. * Load the Component xml manifest.
**/ **/
@ -3178,20 +3266,43 @@ abstract class ComponentbuilderHelper
/** /**
* Get any component's model * Get any component's model
**/ **/
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'componentbuilder') public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'Componentbuilder', $config = array())
{ {
// fix the name
$name = self::safeString($name);
// full path
$fullPath = $path . '/models';
// set prefix
$prefix = $component.'Model';
// load the model file // load the model file
JModelLegacy::addIncludePath( $path . '/models' ); JModelLegacy::addIncludePath($fullPath, $prefix);
// get instance // get instance
$model = JModelLegacy::getInstance( $name, $component.'Model' ); $model = JModelLegacy::getInstance($name, $prefix, $config);
// if model not found // if model not found (strange)
if ($model == false) if ($model == false)
{ {
// build class name jimport('joomla.filesystem.file');
$class = $prefix.$name; // get file path
// initilize the model $filePath = $path.'/'.$name.'.php';
new $class(); $fullPath = $fullPath.'/'.$name.'.php';
$model = JModelLegacy::getInstance($name, $prefix); // check if it exists
if (JFile::exists($filePath))
{
// get the file
require_once $filePath;
}
elseif (JFile::exists($fullPath))
{
// get the file
require_once $fullPath;
}
// build class names
$modelClass = $prefix.$name;
if (class_exists($modelClass))
{
// initialize the model
return new $modelClass($config);
}
} }
return $model; return $model;
} }

View File

@ -5246,7 +5246,8 @@ COM_COMPONENTBUILDER_SERVERS_SUBMENU_DESC="Allows the users in this group to upd
COM_COMPONENTBUILDER_SERVER_AUTHENTICATION="Authentication" COM_COMPONENTBUILDER_SERVER_AUTHENTICATION="Authentication"
COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_DESCRIPTION="Select the authentication type to use with SFTP." COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_DESCRIPTION="Select the authentication type to use with SFTP."
COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_LABEL="Authentication Type" COM_COMPONENTBUILDER_SERVER_AUTHENTICATION_LABEL="Authentication Type"
COM_COMPONENTBUILDER_SERVER_BOTH="Both" COM_COMPONENTBUILDER_SERVER_BOTH_PASSWORD_PRIVATE_KEY_FILE_PATH="Both Password & Private Key - File Path"
COM_COMPONENTBUILDER_SERVER_BOTH_PASSWORD_PRIVATE_KEY_TEXT_FIELD="Both Password & Private Key - Text Field"
COM_COMPONENTBUILDER_SERVER_CREATED_BY_DESC="The user that created this Server." COM_COMPONENTBUILDER_SERVER_CREATED_BY_DESC="The user that created this Server."
COM_COMPONENTBUILDER_SERVER_CREATED_BY_LABEL="Created By" COM_COMPONENTBUILDER_SERVER_CREATED_BY_LABEL="Created By"
COM_COMPONENTBUILDER_SERVER_CREATED_DATE_DESC="The date this Server was created." COM_COMPONENTBUILDER_SERVER_CREATED_DATE_DESC="The date this Server was created."
@ -5295,7 +5296,26 @@ COM_COMPONENTBUILDER_SERVER_PORT_MESSAGE="Error! Please add port number here."
COM_COMPONENTBUILDER_SERVER_PRIVATE="Private" COM_COMPONENTBUILDER_SERVER_PRIVATE="Private"
COM_COMPONENTBUILDER_SERVER_PRIVATE_DESCRIPTION="Set the path to the private key." COM_COMPONENTBUILDER_SERVER_PRIVATE_DESCRIPTION="Set the path to the private key."
COM_COMPONENTBUILDER_SERVER_PRIVATE_HINT="/home/username/.ssh/id_rsa" COM_COMPONENTBUILDER_SERVER_PRIVATE_HINT="/home/username/.ssh/id_rsa"
COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_FILE="Private Key File" COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY="Private Key"
COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_DESCRIPTION="Add your private key here! Yes this field in encrypted in the DB, but if your DB gets compromised this key must also be considered compromised. The system path option is considered more secure and seen as best practice."
COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_FILE_PATH="Private Key - File Path"
COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_HINT="-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDPF9uyDuHtD+sCYBaEIV34uAc+eRa62souVUcmsVwKUUBbk7sY
bnO6ixjouEbhis1L4m854895tJ99SSPu5cXxYTFimCJDjp47fjro4x8js9em10kK
VCP2fP60/jO+mTruGc25C1SksMtRj5XlsGW3avoOV2RjsqAwKxhk6AUF6QIDAQAB
AoGAYGGlMOB2S2NeJ7PaptH0rz3OuUeXyYzsDdZIj/x5bp/UCQrfR4aYO9hi1mR1
MKDt3QRcaZ/ZvrXOiHuSyquLjG0R1tVVR+OZE+haBSunUUq05ZFT7zUJRPHVKoSK
QOV/c831tCA5gCUupXiaak/vYMZRf+xs9wHDyuZstEoU8tUCQQD/GGV/8cuiYQK4
MlpXgvOeYEYayhbQ80qe2aVolQIlRXyY6N9dV1lfbUO8rlTJ2EDVOFc8NDkPHf2f
xzbplDCDAkEAz9PhT8ji8fJgKuDAhWDXF0TuwVWk2hjtYCVGsksE3w16lv9OCwoK
UuWOY2b7wEYh0y8Z9AKBDHM1xhS8Bl7MIwJBANAkNd1Zi5Aom7Fz1GcHQIR/hXQi
ZM+FU+OdLuvQeXmz4uBZUre0qAXG/7gafrBbNTtEx1kmO1BsZh9Syyl3csUCQQDF
MD4pm2tpMRV52YIRi07J70ex/PbLULd5cCTh6jgXAwz71AVSiBY/jTtKqV3YkzJo
09oGIZIcI/wzk1zLloqNAkB8qHxAtmUZFdo5sssaUDTOB82QAPfiHUqIFPaYuc0f
4NqtXZm+fv4liR3QJEo8zkiBs3NjBnm7Hh3BMSqGh3d+
-----END RSA PRIVATE KEY-----"
COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_LABEL="PRIVATE KEY<br /><small>(basic encryption)</small>"
COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_TEXT_FIELD="Private Key - Text Field"
COM_COMPONENTBUILDER_SERVER_PRIVATE_LABEL="Private Key Path<br /><small>(basic encryption)</small>" COM_COMPONENTBUILDER_SERVER_PRIVATE_LABEL="Private Key Path<br /><small>(basic encryption)</small>"
COM_COMPONENTBUILDER_SERVER_PRIVATE_MESSAGE="Error! Please add private key path." COM_COMPONENTBUILDER_SERVER_PRIVATE_MESSAGE="Error! Please add private key path."
COM_COMPONENTBUILDER_SERVER_PROTOCOL="Protocol" COM_COMPONENTBUILDER_SERVER_PROTOCOL="Protocol"
@ -6163,6 +6183,7 @@ COM_COMPONENTBUILDER_THE_NAME_OF_THIS_LIBRARY_BSB_CAN_NOT_BE_CHANGED_TO_BSB_OR_T
COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING="The notice board is loading" COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING="The notice board is loading"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: <code>%s</code>" COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: <code>%s</code>"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s" COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER="The private key field could not be loaded for <b>%s</b> server!"
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!" COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!"
COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading" COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading"
COM_COMPONENTBUILDER_THE_SEARCH_FOR_THE_SNIPPETS_ARE_CASE_SENSITIVE_SO_IF_YOU_CHANGED_THE_LOCAL_BNAMESB_OF_EITHER_OR_THE_BSNIPPET_LIBRARY_OR_SNIPPET_TYPESB_IN_ANY_SMALL_WAY_THE_SYSTEM_WILL_NOT_BE_ABLE_TO_CONNECT_YOUR_LOCAL_SNIPPETS_WITH_THOSE_IN_THE_COMMUNITY_REPOSITORY_SO_WE_STRONGLY_ADVICE_TO_BKEEP_TO_THE_COMMUNITY_NAMINGB_TO_AVOID_MISMATCHING_THAT_WILL_IN_TURN_CAUSE_DUPLICATION_SO_IF_YOU_CHANGED_ANY_NAMES_JUST_CHANGE_THEM_BACK_AND_ALL_WILL_AGAIN_WORK_AS_EXPECTED="The search for the snippets are case sensitive so if you changed the local <b>names</b> of either or the <b>snippet, library or snippet types</b> in any small way, the system will not be able to connect your local snippets with those in the community repository. So we strongly advice to <b>keep to the community naming</b> to avoid mismatching, that will in turn cause duplication. So if you changed any names, just change them back and all will again work as expected." COM_COMPONENTBUILDER_THE_SEARCH_FOR_THE_SNIPPETS_ARE_CASE_SENSITIVE_SO_IF_YOU_CHANGED_THE_LOCAL_BNAMESB_OF_EITHER_OR_THE_BSNIPPET_LIBRARY_OR_SNIPPET_TYPESB_IN_ANY_SMALL_WAY_THE_SYSTEM_WILL_NOT_BE_ABLE_TO_CONNECT_YOUR_LOCAL_SNIPPETS_WITH_THOSE_IN_THE_COMMUNITY_REPOSITORY_SO_WE_STRONGLY_ADVICE_TO_BKEEP_TO_THE_COMMUNITY_NAMINGB_TO_AVOID_MISMATCHING_THAT_WILL_IN_TURN_CAUSE_DUPLICATION_SO_IF_YOU_CHANGED_ANY_NAMES_JUST_CHANGE_THEM_BACK_AND_ALL_WILL_AGAIN_WORK_AS_EXPECTED="The search for the snippets are case sensitive so if you changed the local <b>names</b> of either or the <b>snippet, library or snippet types</b> in any small way, the system will not be able to connect your local snippets with those in the community repository. So we strongly advice to <b>keep to the community naming</b> to avoid mismatching, that will in turn cause duplication. So if you changed any names, just change them back and all will again work as expected."

View File

@ -33,6 +33,7 @@ $fields = $displayData->get('fields') ?: array(
'authentication', 'authentication',
'password', 'password',
'private', 'private',
'private_key',
'secret' 'secret'
); );

View File

@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// set the defaults // set the defaults
$items = $displayData->wanlinked_components; $items = $displayData->wamlinked_components;
$user = JFactory::getUser(); $user = JFactory::getUser();
$id = $displayData->item->id; $id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";

View File

@ -546,8 +546,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields'); $this->canDo = ComponentbuilderHelper::getActions('admin_fields');
} }
@ -572,7 +570,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -582,17 +579,11 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('admin_fields.edit', $contexts[$pk])) if (!$this->user->authorise('admin_fields.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -602,7 +593,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -613,7 +603,11 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
} }
} }
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->admin_view) && !is_numeric($this->table->admin_view))
{
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -695,8 +689,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields'); $this->canDo = ComponentbuilderHelper::getActions('admin_fields');
} }
@ -720,7 +712,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
if (!$this->user->authorise('admin_fields.edit', $contexts[$pk])) if (!$this->user->authorise('admin_fields.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -731,7 +722,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -546,8 +546,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
} }
@ -572,7 +570,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -582,17 +579,11 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk])) if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -602,7 +593,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -613,7 +603,11 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
} }
} }
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->admin_view) && !is_numeric($this->table->admin_view))
{
$this->table->admin_view = $this->generateUniqe('admin_view',$this->table->admin_view);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -695,8 +689,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions');
} }
@ -720,7 +712,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk])) if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -731,7 +722,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -352,7 +352,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_import_ext = base64_decode($item->php_import_ext); $item->php_import_ext = base64_decode($item->php_import_ext);
} }
if (empty($item->id)) if (empty($item->id))
{ {
$id = 0; $id = 0;
@ -371,7 +371,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
} }
// update the fields // update the fields
$objectUpdate = new stdClass(); $objectUpdate = new stdClass();
@ -908,8 +908,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_view'); $this->canDo = ComponentbuilderHelper::getActions('admin_view');
} }
@ -934,7 +932,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -944,17 +941,11 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('admin_view.edit', $contexts[$pk])) if (!$this->user->authorise('admin_view.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -964,7 +955,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -1029,7 +1019,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// Add the new ID to the array // Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
if (ComponentbuilderHelper::checkArray($newIds)) if (ComponentbuilderHelper::checkArray($newIds))
{ {
foreach($newIds as $oldID => $newID) foreach($newIds as $oldID => $newID)
@ -1048,7 +1038,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
} }
} }
} }
// Clean the cache // Clean the cache
$this->cleanCache(); $this->cleanCache();
@ -1075,8 +1065,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('admin_view'); $this->canDo = ComponentbuilderHelper::getActions('admin_view');
} }
@ -1100,7 +1088,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
if (!$this->user->authorise('admin_view.edit', $contexts[$pk])) if (!$this->user->authorise('admin_view.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -1111,7 +1098,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -1192,6 +1178,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['metadata'] = (string) $metadata; $data['metadata'] = (string) $metadata;
} }
// if system name is empty create from name_single
if (empty($data['system_name']) || !ComponentbuilderHelper::checkString($data['system_name']))
{
$data['system_name'] = $data['name_single'];
}
// Set the addtables items to data. // Set the addtables items to data.
if (isset($data['addtables']) && is_array($data['addtables'])) if (isset($data['addtables']) && is_array($data['addtables']))
{ {

View File

@ -44,7 +44,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
// Used in joomla_component // Used in joomla_component
/** /**
* Check and if a vdm notice is new (per/user) * Check and if a vdm notice is new (per/user)
**/ **/
@ -91,7 +91,7 @@ class ComponentbuilderModelAjax extends JModelList
return true; return true;
} }
return false; return false;
} }
/** /**
* get the component details (html) * get the component details (html)
**/ **/
@ -177,7 +177,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
// Used in admin_view // Used in admin_view
protected $viewid = array(); protected $viewid = array();
protected function getViewID($call = 'table') protected function getViewID($call = 'table')
@ -209,7 +209,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
return false; return false;
} }
protected $buttonArray = array( protected $buttonArray = array(
'library_config' => 'libraries_config', 'library_config' => 'libraries_config',
'library_files_folders_urls' => 'libraries_files_folders_urls', 'library_files_folders_urls' => 'libraries_files_folders_urls',
@ -226,7 +226,7 @@ class ComponentbuilderModelAjax extends JModelList
'component_dashboard' => 'components_dashboard', 'component_dashboard' => 'components_dashboard',
'component_files_folders' => 'components_files_folders', 'component_files_folders' => 'components_files_folders',
'language' => true); 'language' => true);
public function getButton($type) public function getButton($type)
{ {
if (isset($this->buttonArray[$type])) if (isset($this->buttonArray[$type]))
@ -262,8 +262,8 @@ class ComponentbuilderModelAjax extends JModelList
return ''; return '';
} }
return false; return false;
} }
public function getButtonID($type, $size) public function getButtonID($type, $size)
{ {
if (isset($this->buttonArray[$type])) if (isset($this->buttonArray[$type]))
@ -331,7 +331,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
} }
return ''; return '';
} }
public static function getDynamicScripts($type) public static function getDynamicScripts($type)
{ {
@ -446,7 +446,7 @@ class ComponentbuilderModelAjax extends JModelList
return ComponentbuilderHelper::safeString($keys[1], 'Ww'); return ComponentbuilderHelper::safeString($keys[1], 'Ww');
} }
protected function getSubformTable($idName, $data) protected function getSubformTable($idName, $data)
{ {
// make sure we convert the json to array // make sure we convert the json to array
@ -553,7 +553,7 @@ class ComponentbuilderModelAjax extends JModelList
{ {
$rows[$nr] .= '<td data-column=" '.$_header.' ">'.$value.'</td>'; $rows[$nr] .= '<td data-column=" '.$_header.' ">'.$value.'</td>';
} }
} }
protected $ref; protected $ref;
protected $fieldsArray = array( protected $fieldsArray = array(
@ -1840,7 +1840,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
return false; return false;
} }
/** /**
* Get the keys of the values to search custom code in * Get the keys of the values to search custom code in
* *
@ -1977,7 +1977,7 @@ class ComponentbuilderModelAjax extends JModelList
return $targets[$target]; return $targets[$target];
} }
return false; return false;
} }
// Used in field // Used in field
public function getFieldOptions($id) public function getFieldOptions($id)
@ -1991,7 +1991,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
// Used in get_snippets // Used in get_snippets
public function getSnippets($libraries) public function getSnippets($libraries)
{ {
if (ComponentbuilderHelper::checkJson($libraries)) if (ComponentbuilderHelper::checkJson($libraries))
@ -2074,7 +2074,7 @@ class ComponentbuilderModelAjax extends JModelList
} }
} }
return false; return false;
} }
public function getSnippetDetails($id) public function getSnippetDetails($id)
{ {
// Get a db connection. // Get a db connection.

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views'); $this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
} }
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk])) if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_admin_views'); $this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
} }
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk])) if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_config'); $this->canDo = ComponentbuilderHelper::getActions('component_config');
} }
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_config.edit', $contexts[$pk])) if (!$this->user->authorise('component_config.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_config'); $this->canDo = ComponentbuilderHelper::getActions('component_config');
} }
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
if (!$this->user->authorise('component_config.edit', $contexts[$pk])) if (!$this->user->authorise('component_config.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus'); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
} }
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk])) if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus'); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
} }
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk])) if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views'); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
} }
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk])) if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views'); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
} }
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk])) if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -563,8 +563,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard'); $this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
} }
@ -589,7 +587,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -599,17 +596,11 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk])) if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -619,7 +610,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -630,7 +620,11 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -712,8 +706,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_dashboard'); $this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
} }
@ -737,7 +729,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk])) if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -748,7 +739,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -582,8 +582,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders'); $this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
} }
@ -608,7 +606,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -618,17 +615,11 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk])) if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -638,7 +629,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -649,7 +639,11 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -731,8 +725,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_files_folders'); $this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
} }
@ -756,7 +748,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk])) if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -767,7 +758,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks'); $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
} }
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk])) if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks'); $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
} }
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk])) if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_site_views'); $this->canDo = ComponentbuilderHelper::getActions('component_site_views');
} }
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_site_views.edit', $contexts[$pk])) if (!$this->user->authorise('component_site_views.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_site_views'); $this->canDo = ComponentbuilderHelper::getActions('component_site_views');
} }
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
if (!$this->user->authorise('component_site_views.edit', $contexts[$pk])) if (!$this->user->authorise('component_site_views.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_updates'); $this->canDo = ComponentbuilderHelper::getActions('component_updates');
} }
@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('component_updates.edit', $contexts[$pk])) if (!$this->user->authorise('component_updates.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -624,7 +614,11 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
} }
} }
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
{
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('component_updates'); $this->canDo = ComponentbuilderHelper::getActions('component_updates');
} }
@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
if (!$this->user->authorise('component_updates.edit', $contexts[$pk])) if (!$this->user->authorise('component_updates.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -336,7 +336,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList
return $icons; return $icons;
} }
public function getGithub() public function getGithub()
{ {
// load jquery (not sure why... but else the timeago breaks) // load jquery (not sure why... but else the timeago breaks)
@ -428,8 +428,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList
'closedissues' => $create.'<div id="closedissues">'.JText::_('COM_COMPONENTBUILDER_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'.$moreclosed, 'closedissues' => $create.'<div id="closedissues">'.JText::_('COM_COMPONENTBUILDER_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'.$moreclosed,
'tagreleases' => '<div id="tagreleases">'.JText::_('COM_COMPONENTBUILDER_LAST_FEW_RELEASES_FROM_GITHUB_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'.$viewissues 'tagreleases' => '<div id="tagreleases">'.JText::_('COM_COMPONENTBUILDER_LAST_FEW_RELEASES_FROM_GITHUB_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'.$viewissues
); );
} }
public function getWiki() public function getWiki()
{ {
$document = JFactory::getDocument(); $document = JFactory::getDocument();
@ -448,8 +448,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList
return '<div id="wiki-md"><small>'.JText::_('COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'; return '<div id="wiki-md"><small>'.JText::_('COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING').'.<span class="loading-dots">.</span></small></div>';
} }
public function getNoticeboard() public function getNoticeboard()
{ {
// get the document to load the scripts // get the document to load the scripts
@ -521,8 +521,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList
});'); });');
return '<div id="noticeboard-md">'.JText::_('COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'; return '<div id="noticeboard-md">'.JText::_('COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING').'.<span class="loading-dots">.</span></small></div>';
} }
public function getReadme() public function getReadme()
{ {
$document = JFactory::getDocument(); $document = JFactory::getDocument();
@ -539,5 +539,5 @@ class ComponentbuilderModelComponentbuilder extends JModelList
});'); });');
return '<div id="readme-md"><small>'.JText::_('COM_COMPONENTBUILDER_THE_README_IS_LOADING').'.<span class="loading-dots">.</span></small></div>'; return '<div id="readme-md"><small>'.JText::_('COM_COMPONENTBUILDER_THE_README_IS_LOADING').'.<span class="loading-dots">.</span></small></div>';
} }
} }

View File

@ -204,7 +204,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->php_model = base64_decode($item->php_model); $item->php_model = base64_decode($item->php_model);
} }
if (empty($item->id)) if (empty($item->id))
{ {
$id = 0; $id = 0;
@ -223,7 +223,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'custom_admin_view__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'custom_admin_view__'.$id);
ComponentbuilderHelper::set('custom_admin_view__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('custom_admin_view__'.$id, $this->vastDevMod);
} }
// check what type of custom_button array we have here (should be subform... but just incase) // check what type of custom_button array we have here (should be subform... but just incase)
// This could happen due to huge data sets // This could happen due to huge data sets
@ -703,8 +703,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('custom_admin_view'); $this->canDo = ComponentbuilderHelper::getActions('custom_admin_view');
} }
@ -729,7 +727,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -739,17 +736,11 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -759,7 +750,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -770,7 +760,11 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
} }
} }
$this->table->name = $this->generateUniqe('name',$this->table->name); // 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 // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -852,8 +846,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('custom_admin_view'); $this->canDo = ComponentbuilderHelper::getActions('custom_admin_view');
} }
@ -877,7 +869,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -888,7 +879,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -560,8 +560,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('custom_code'); $this->canDo = ComponentbuilderHelper::getActions('custom_code');
} }
@ -586,7 +584,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -596,17 +593,11 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('custom_code.edit', $contexts[$pk])) if (!$this->user->authorise('custom_code.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -616,7 +607,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -627,7 +617,11 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
} }
} }
$this->table->component = $this->generateUniqe('component',$this->table->component); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->component) && !is_numeric($this->table->component))
{
$this->table->component = $this->generateUniqe('component',$this->table->component);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -709,8 +703,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('custom_code'); $this->canDo = ComponentbuilderHelper::getActions('custom_code');
} }
@ -734,7 +726,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
if (!$this->user->authorise('custom_code.edit', $contexts[$pk])) if (!$this->user->authorise('custom_code.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -745,7 +736,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -196,7 +196,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$item->php_calculation = base64_decode($item->php_calculation); $item->php_calculation = base64_decode($item->php_calculation);
} }
if (empty($item->id)) if (empty($item->id))
{ {
$id = 0; $id = 0;
@ -215,7 +215,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'dynamic_get__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'dynamic_get__'.$id);
ComponentbuilderHelper::set('dynamic_get__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('dynamic_get__'.$id, $this->vastDevMod);
} }
// update the fields // update the fields
$objectUpdate = new stdClass(); $objectUpdate = new stdClass();
@ -710,8 +710,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('dynamic_get'); $this->canDo = ComponentbuilderHelper::getActions('dynamic_get');
} }
@ -736,7 +734,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -746,17 +743,11 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('dynamic_get.edit', $contexts[$pk])) if (!$this->user->authorise('dynamic_get.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -766,7 +757,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -777,7 +767,11 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
} }
} }
$this->table->name = $this->generateUniqe('name',$this->table->name); // 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 // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -859,8 +853,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('dynamic_get'); $this->canDo = ComponentbuilderHelper::getActions('dynamic_get');
} }
@ -884,7 +876,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
if (!$this->user->authorise('dynamic_get.edit', $contexts[$pk])) if (!$this->user->authorise('dynamic_get.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -895,7 +886,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -130,7 +130,7 @@ class ComponentbuilderModelField extends JModelAdmin
$item->javascript_views_footer = base64_decode($item->javascript_views_footer); $item->javascript_views_footer = base64_decode($item->javascript_views_footer);
} }
if (empty($item->id)) if (empty($item->id))
{ {
$id = 0; $id = 0;
@ -149,7 +149,7 @@ class ComponentbuilderModelField extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'field__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'field__'.$id);
ComponentbuilderHelper::set('field__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('field__'.$id, $this->vastDevMod);
} }
if (!empty($item->id)) if (!empty($item->id))
{ {
@ -608,8 +608,6 @@ class ComponentbuilderModelField extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('field'); $this->canDo = ComponentbuilderHelper::getActions('field');
} }
@ -649,7 +647,6 @@ class ComponentbuilderModelField extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -659,17 +656,11 @@ class ComponentbuilderModelField extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('field.edit', $contexts[$pk])) if (!$this->user->authorise('field.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -679,7 +670,6 @@ class ComponentbuilderModelField extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -770,8 +760,6 @@ class ComponentbuilderModelField extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('field'); $this->canDo = ComponentbuilderHelper::getActions('field');
} }
@ -811,7 +799,6 @@ class ComponentbuilderModelField extends JModelAdmin
if (!$this->user->authorise('field.edit', $contexts[$pk])) if (!$this->user->authorise('field.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -822,7 +809,6 @@ class ComponentbuilderModelField extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -791,8 +791,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('fieldtype'); $this->canDo = ComponentbuilderHelper::getActions('fieldtype');
} }
@ -832,7 +830,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -842,17 +839,11 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('fieldtype.edit', $contexts[$pk])) if (!$this->user->authorise('fieldtype.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -862,7 +853,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -953,8 +943,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('fieldtype'); $this->canDo = ComponentbuilderHelper::getActions('fieldtype');
} }
@ -994,7 +982,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
if (!$this->user->authorise('fieldtype.edit', $contexts[$pk])) if (!$this->user->authorise('fieldtype.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -1005,7 +992,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -1240,7 +1240,7 @@ function getAjaxDisplay_server(type){
function addData(result,where){ function addData(result,where){
jQuery(result).insertAfter(jQuery(where).closest('.control-group')); jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
} }
function addButtonID_server(type, size){ function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){ if(token.length > 0 && type.length > 0 && size > 0){
@ -1264,8 +1264,8 @@ function addButtonID(type, where, size){
} }
} }
}); });
} }
function addButton_server(type){ function addButton_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){ if(token.length > 0 && type.length > 0){
@ -1285,8 +1285,8 @@ function addButton(type,where){
addData(result,'#jform_'+where); addData(result,'#jform_'+where);
} }
}) })
} }
function getLinked_server(type){ function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){ if(token.length > 0 && type > 0){
@ -1307,7 +1307,7 @@ function getLinked(){
jQuery('#display_linked_to').html(result); jQuery('#display_linked_to').html(result);
} }
}); });
} }
function getTableColumns_server(tableName){ function getTableColumns_server(tableName){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&vdm="+vastDevMod; var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&vdm="+vastDevMod;

View File

@ -443,7 +443,7 @@ jQuery(document).ready(function()
// get the linked details // get the linked details
getLinked(); getLinked();
}); });
function getLinked_server(type){ function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){ if(token.length > 0 && type > 0){
@ -464,8 +464,8 @@ function getLinked(){
jQuery('#display_linked_to').html(result); jQuery('#display_linked_to').html(result);
} }
}); });
} }
function getSnippetDetails_server(snippetId){ function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){ if(token.length > 0 && snippetId > 0){
@ -513,8 +513,8 @@ function getSnippetDetails(id){
jQuery('.snippet-usage').append(usage); jQuery('.snippet-usage').append(usage);
} }
}) })
} }
function getDynamicValues_server(dynamicId){ function getDynamicValues_server(dynamicId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json";
if(token.length > 0 && dynamicId > 0){ if(token.length > 0 && dynamicId > 0){
@ -540,8 +540,8 @@ function getDynamicValues(id){
}); });
} }
}) })
} }
function getLayoutDetails_server(id){ function getLayoutDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json";
if(token.length > 0 && id > 0){ if(token.length > 0 && id > 0){
@ -566,8 +566,8 @@ function getLayoutDetails(id){
}); });
} }
}) })
} }
function getTemplateDetails_server(id){ function getTemplateDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json";
if(token.length > 0 && id > 0){ if(token.length > 0 && id > 0){
@ -592,8 +592,8 @@ function getTemplateDetails(id){
}); });
} }
}) })
} }
// set snippets that are on the page // set snippets that are on the page
var snippetIds = []; var snippetIds = [];
var snippets = {}; var snippets = {};
@ -664,4 +664,4 @@ function setSnippets(array){
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>'); jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
} }
jQuery('#jform_snippet').trigger('liszt:updated'); jQuery('#jform_snippet').trigger('liszt:updated');
} }

View File

@ -1435,7 +1435,7 @@ jQuery(document).ready(function()
var valueSwitch = jQuery("#jform_add_php_router_parse input[type='radio']:checked").val(); var valueSwitch = jQuery("#jform_add_php_router_parse input[type='radio']:checked").val();
getDynamicScripts(valueSwitch); getDynamicScripts(valueSwitch);
}); });
function getLinked_server(type){ function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){ if(token.length > 0 && type > 0){
@ -1456,7 +1456,7 @@ function getLinked(){
jQuery('#display_linked_to').html(result); jQuery('#display_linked_to').html(result);
} }
}); });
} }
function getViewTableColumns_server(viewId,asKey,rowType) function getViewTableColumns_server(viewId,asKey,rowType)
{ {

View File

@ -514,7 +514,7 @@ jQuery(document).ready(function()
// get the linked details // get the linked details
getLinked(); getLinked();
}); });
function getLinked_server(type){ function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){ if(token.length > 0 && type > 0){
@ -535,7 +535,7 @@ function getLinked(){
jQuery('#display_linked_to').html(result); jQuery('#display_linked_to').html(result);
} }
}); });
} }
function getFieldOptions_server(fieldId){ function getFieldOptions_server(fieldId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json";

View File

@ -23,289 +23,289 @@
/-----------------------------------------------------------------------------------------------------------------------------*/ /-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values // Some Global Values
jform_vvvvwazwao_required = false; jform_vvvvwbdwan_required = false;
jform_vvvvwbawap_required = false; jform_vvvvwbewao_required = false;
jform_vvvvwbbwaq_required = false; jform_vvvvwbfwap_required = false;
jform_vvvvwbcwar_required = false; jform_vvvvwbgwaq_required = false;
jform_vvvvwbdwas_required = false; jform_vvvvwbhwar_required = false;
jform_vvvvwbewat_required = false; jform_vvvvwbiwas_required = false;
// Initial Script // Initial Script
jQuery(document).ready(function() jQuery(document).ready(function()
{ {
var location_vvvvwaz = jQuery("#jform_location input[type='radio']:checked").val(); var location_vvvvwbd = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwaz(location_vvvvwaz); vvvvwbd(location_vvvvwbd);
var location_vvvvwba = jQuery("#jform_location input[type='radio']:checked").val(); var location_vvvvwbe = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwba(location_vvvvwba); vvvvwbe(location_vvvvwbe);
var type_vvvvwbb = jQuery("#jform_type").val(); var type_vvvvwbf = jQuery("#jform_type").val();
vvvvwbb(type_vvvvwbb); vvvvwbf(type_vvvvwbf);
var type_vvvvwbc = jQuery("#jform_type").val(); var type_vvvvwbg = jQuery("#jform_type").val();
vvvvwbc(type_vvvvwbc); vvvvwbg(type_vvvvwbg);
var type_vvvvwbd = jQuery("#jform_type").val(); var type_vvvvwbh = jQuery("#jform_type").val();
vvvvwbd(type_vvvvwbd); vvvvwbh(type_vvvvwbh);
var target_vvvvwbe = jQuery("#jform_target input[type='radio']:checked").val(); var target_vvvvwbi = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwbe(target_vvvvwbe); vvvvwbi(target_vvvvwbi);
}); });
// the vvvvwaz function // the vvvvwbd function
function vvvvwaz(location_vvvvwaz) function vvvvwbd(location_vvvvwbd)
{ {
// set the function logic // set the function logic
if (location_vvvvwaz == 1) if (location_vvvvwbd == 1)
{ {
jQuery('#jform_admin_view').closest('.control-group').show(); jQuery('#jform_admin_view').closest('.control-group').show();
if (jform_vvvvwazwao_required) if (jform_vvvvwbdwan_required)
{ {
updateFieldRequired('admin_view',0); updateFieldRequired('admin_view',0);
jQuery('#jform_admin_view').prop('required','required'); jQuery('#jform_admin_view').prop('required','required');
jQuery('#jform_admin_view').attr('aria-required',true); jQuery('#jform_admin_view').attr('aria-required',true);
jQuery('#jform_admin_view').addClass('required'); jQuery('#jform_admin_view').addClass('required');
jform_vvvvwazwao_required = false; jform_vvvvwbdwan_required = false;
} }
} }
else else
{ {
jQuery('#jform_admin_view').closest('.control-group').hide(); jQuery('#jform_admin_view').closest('.control-group').hide();
if (!jform_vvvvwazwao_required) if (!jform_vvvvwbdwan_required)
{ {
updateFieldRequired('admin_view',1); updateFieldRequired('admin_view',1);
jQuery('#jform_admin_view').removeAttr('required'); jQuery('#jform_admin_view').removeAttr('required');
jQuery('#jform_admin_view').removeAttr('aria-required'); jQuery('#jform_admin_view').removeAttr('aria-required');
jQuery('#jform_admin_view').removeClass('required'); jQuery('#jform_admin_view').removeClass('required');
jform_vvvvwazwao_required = true; jform_vvvvwbdwan_required = true;
} }
} }
} }
// the vvvvwba function // the vvvvwbe function
function vvvvwba(location_vvvvwba) function vvvvwbe(location_vvvvwbe)
{ {
// set the function logic // set the function logic
if (location_vvvvwba == 2) if (location_vvvvwbe == 2)
{ {
jQuery('#jform_site_view').closest('.control-group').show(); jQuery('#jform_site_view').closest('.control-group').show();
if (jform_vvvvwbawap_required) if (jform_vvvvwbewao_required)
{ {
updateFieldRequired('site_view',0); updateFieldRequired('site_view',0);
jQuery('#jform_site_view').prop('required','required'); jQuery('#jform_site_view').prop('required','required');
jQuery('#jform_site_view').attr('aria-required',true); jQuery('#jform_site_view').attr('aria-required',true);
jQuery('#jform_site_view').addClass('required'); jQuery('#jform_site_view').addClass('required');
jform_vvvvwbawap_required = false; jform_vvvvwbewao_required = false;
} }
} }
else else
{ {
jQuery('#jform_site_view').closest('.control-group').hide(); jQuery('#jform_site_view').closest('.control-group').hide();
if (!jform_vvvvwbawap_required) if (!jform_vvvvwbewao_required)
{ {
updateFieldRequired('site_view',1); updateFieldRequired('site_view',1);
jQuery('#jform_site_view').removeAttr('required'); jQuery('#jform_site_view').removeAttr('required');
jQuery('#jform_site_view').removeAttr('aria-required'); jQuery('#jform_site_view').removeAttr('aria-required');
jQuery('#jform_site_view').removeClass('required'); jQuery('#jform_site_view').removeClass('required');
jform_vvvvwbawap_required = true; jform_vvvvwbewao_required = true;
} }
} }
} }
// the vvvvwbb function // the vvvvwbf function
function vvvvwbb(type_vvvvwbb) function vvvvwbf(type_vvvvwbf)
{ {
if (isSet(type_vvvvwbb) && type_vvvvwbb.constructor !== Array) if (isSet(type_vvvvwbf) && type_vvvvwbf.constructor !== Array)
{ {
var temp_vvvvwbb = type_vvvvwbb; var temp_vvvvwbf = type_vvvvwbf;
var type_vvvvwbb = []; var type_vvvvwbf = [];
type_vvvvwbb.push(temp_vvvvwbb); type_vvvvwbf.push(temp_vvvvwbf);
} }
else if (!isSet(type_vvvvwbb)) else if (!isSet(type_vvvvwbf))
{ {
var type_vvvvwbb = []; var type_vvvvwbf = [];
} }
var type = type_vvvvwbb.some(type_vvvvwbb_SomeFunc); var type = type_vvvvwbf.some(type_vvvvwbf_SomeFunc);
// set this function logic // set this function logic
if (type) if (type)
{ {
jQuery('#jform_url').closest('.control-group').show(); jQuery('#jform_url').closest('.control-group').show();
if (jform_vvvvwbbwaq_required) if (jform_vvvvwbfwap_required)
{ {
updateFieldRequired('url',0); updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required'); jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true); jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required'); jQuery('#jform_url').addClass('required');
jform_vvvvwbbwaq_required = false; jform_vvvvwbfwap_required = false;
} }
} }
else else
{ {
jQuery('#jform_url').closest('.control-group').hide(); jQuery('#jform_url').closest('.control-group').hide();
if (!jform_vvvvwbbwaq_required) if (!jform_vvvvwbfwap_required)
{ {
updateFieldRequired('url',1); updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required'); jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required'); jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required'); jQuery('#jform_url').removeClass('required');
jform_vvvvwbbwaq_required = true; jform_vvvvwbfwap_required = true;
} }
} }
} }
// the vvvvwbb Some function // the vvvvwbf Some function
function type_vvvvwbb_SomeFunc(type_vvvvwbb) function type_vvvvwbf_SomeFunc(type_vvvvwbf)
{ {
// set the function logic // set the function logic
if (type_vvvvwbb == 3) if (type_vvvvwbf == 3)
{ {
return true; return true;
} }
return false; return false;
} }
// the vvvvwbc function // the vvvvwbg function
function vvvvwbc(type_vvvvwbc) function vvvvwbg(type_vvvvwbg)
{ {
if (isSet(type_vvvvwbc) && type_vvvvwbc.constructor !== Array) if (isSet(type_vvvvwbg) && type_vvvvwbg.constructor !== Array)
{ {
var temp_vvvvwbc = type_vvvvwbc; var temp_vvvvwbg = type_vvvvwbg;
var type_vvvvwbc = []; var type_vvvvwbg = [];
type_vvvvwbc.push(temp_vvvvwbc); type_vvvvwbg.push(temp_vvvvwbg);
} }
else if (!isSet(type_vvvvwbc)) else if (!isSet(type_vvvvwbg))
{ {
var type_vvvvwbc = []; var type_vvvvwbg = [];
} }
var type = type_vvvvwbc.some(type_vvvvwbc_SomeFunc); var type = type_vvvvwbg.some(type_vvvvwbg_SomeFunc);
// set this function logic // set this function logic
if (type) if (type)
{ {
jQuery('#jform_article').closest('.control-group').show(); jQuery('#jform_article').closest('.control-group').show();
if (jform_vvvvwbcwar_required) if (jform_vvvvwbgwaq_required)
{ {
updateFieldRequired('article',0); updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required'); jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true); jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required'); jQuery('#jform_article').addClass('required');
jform_vvvvwbcwar_required = false; jform_vvvvwbgwaq_required = false;
} }
} }
else else
{ {
jQuery('#jform_article').closest('.control-group').hide(); jQuery('#jform_article').closest('.control-group').hide();
if (!jform_vvvvwbcwar_required) if (!jform_vvvvwbgwaq_required)
{ {
updateFieldRequired('article',1); updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required'); jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required'); jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required'); jQuery('#jform_article').removeClass('required');
jform_vvvvwbcwar_required = true; jform_vvvvwbgwaq_required = true;
} }
} }
} }
// the vvvvwbc Some function // the vvvvwbg Some function
function type_vvvvwbc_SomeFunc(type_vvvvwbc) function type_vvvvwbg_SomeFunc(type_vvvvwbg)
{ {
// set the function logic // set the function logic
if (type_vvvvwbc == 1) if (type_vvvvwbg == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the vvvvwbd function // the vvvvwbh function
function vvvvwbd(type_vvvvwbd) function vvvvwbh(type_vvvvwbh)
{ {
if (isSet(type_vvvvwbd) && type_vvvvwbd.constructor !== Array) if (isSet(type_vvvvwbh) && type_vvvvwbh.constructor !== Array)
{ {
var temp_vvvvwbd = type_vvvvwbd; var temp_vvvvwbh = type_vvvvwbh;
var type_vvvvwbd = []; var type_vvvvwbh = [];
type_vvvvwbd.push(temp_vvvvwbd); type_vvvvwbh.push(temp_vvvvwbh);
} }
else if (!isSet(type_vvvvwbd)) else if (!isSet(type_vvvvwbh))
{ {
var type_vvvvwbd = []; var type_vvvvwbh = [];
} }
var type = type_vvvvwbd.some(type_vvvvwbd_SomeFunc); var type = type_vvvvwbh.some(type_vvvvwbh_SomeFunc);
// set this function logic // set this function logic
if (type) if (type)
{ {
jQuery('#jform_content-lbl').closest('.control-group').show(); jQuery('#jform_content-lbl').closest('.control-group').show();
if (jform_vvvvwbdwas_required) if (jform_vvvvwbhwar_required)
{ {
updateFieldRequired('content',0); updateFieldRequired('content',0);
jQuery('#jform_content').prop('required','required'); jQuery('#jform_content').prop('required','required');
jQuery('#jform_content').attr('aria-required',true); jQuery('#jform_content').attr('aria-required',true);
jQuery('#jform_content').addClass('required'); jQuery('#jform_content').addClass('required');
jform_vvvvwbdwas_required = false; jform_vvvvwbhwar_required = false;
} }
} }
else else
{ {
jQuery('#jform_content-lbl').closest('.control-group').hide(); jQuery('#jform_content-lbl').closest('.control-group').hide();
if (!jform_vvvvwbdwas_required) if (!jform_vvvvwbhwar_required)
{ {
updateFieldRequired('content',1); updateFieldRequired('content',1);
jQuery('#jform_content').removeAttr('required'); jQuery('#jform_content').removeAttr('required');
jQuery('#jform_content').removeAttr('aria-required'); jQuery('#jform_content').removeAttr('aria-required');
jQuery('#jform_content').removeClass('required'); jQuery('#jform_content').removeClass('required');
jform_vvvvwbdwas_required = true; jform_vvvvwbhwar_required = true;
} }
} }
} }
// the vvvvwbd Some function // the vvvvwbh Some function
function type_vvvvwbd_SomeFunc(type_vvvvwbd) function type_vvvvwbh_SomeFunc(type_vvvvwbh)
{ {
// set the function logic // set the function logic
if (type_vvvvwbd == 2) if (type_vvvvwbh == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the vvvvwbe function // the vvvvwbi function
function vvvvwbe(target_vvvvwbe) function vvvvwbi(target_vvvvwbi)
{ {
// set the function logic // set the function logic
if (target_vvvvwbe == 1) if (target_vvvvwbi == 1)
{ {
jQuery('#jform_groups').closest('.control-group').show(); jQuery('#jform_groups').closest('.control-group').show();
if (jform_vvvvwbewat_required) if (jform_vvvvwbiwas_required)
{ {
updateFieldRequired('groups',0); updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required'); jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true); jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required'); jQuery('#jform_groups').addClass('required');
jform_vvvvwbewat_required = false; jform_vvvvwbiwas_required = false;
} }
} }
else else
{ {
jQuery('#jform_groups').closest('.control-group').hide(); jQuery('#jform_groups').closest('.control-group').hide();
if (!jform_vvvvwbewat_required) if (!jform_vvvvwbiwas_required)
{ {
updateFieldRequired('groups',1); updateFieldRequired('groups',1);
jQuery('#jform_groups').removeAttr('required'); jQuery('#jform_groups').removeAttr('required');
jQuery('#jform_groups').removeAttr('aria-required'); jQuery('#jform_groups').removeAttr('aria-required');
jQuery('#jform_groups').removeClass('required'); jQuery('#jform_groups').removeClass('required');
jform_vvvvwbewat_required = true; jform_vvvvwbiwas_required = true;
} }
} }
} }

View File

@ -915,7 +915,7 @@ function addData(result, where){
jQuery(result).insertAfter(jQuery(where).closest('.control-group')); jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
} }
function addButtonID_server(type, size){ function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){ if(token.length > 0 && type.length > 0 && size > 0){
@ -939,8 +939,8 @@ function addButtonID(type, where, size){
} }
} }
}); });
} }
function addButton_server(type){ function addButton_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){ if(token.length > 0 && type.length > 0){
@ -960,5 +960,5 @@ function addButton(type,where){
addData(result,'#jform_'+where); addData(result,'#jform_'+where);
} }
}) })
} }

View File

@ -32,7 +32,7 @@ jQuery(document).ready(function($)
function addData(result,where){ function addData(result,where){
jQuery(result).insertAfter(jQuery(where).closest('.control-group')); jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
} }
function addButton_server(type){ function addButton_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){ if(token.length > 0 && type.length > 0){
@ -52,4 +52,4 @@ function addButton(type,where){
addData(result,'#jform_'+where); addData(result,'#jform_'+where);
} }
}) })
} }

View File

@ -99,7 +99,7 @@ function isSet(val)
return false; return false;
} }
function getSnippetDetails_server(snippetId){ function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){ if(token.length > 0 && snippetId > 0){
@ -147,8 +147,8 @@ function getSnippetDetails(id){
jQuery('.snippet-usage').append(usage); jQuery('.snippet-usage').append(usage);
} }
}) })
} }
function getDynamicValues_server(dynamicId){ function getDynamicValues_server(dynamicId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json";
if(token.length > 0 && dynamicId > 0){ if(token.length > 0 && dynamicId > 0){
@ -174,8 +174,8 @@ function getDynamicValues(id){
}); });
} }
}) })
} }
function getLayoutDetails_server(id){ function getLayoutDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json";
if(token.length > 0 && id > 0){ if(token.length > 0 && id > 0){
@ -200,8 +200,8 @@ function getLayoutDetails(id){
}); });
} }
}) })
} }
// set snippets that are on the page // set snippets that are on the page
var snippetIds = []; var snippetIds = [];
var snippets = {}; var snippets = {};
@ -272,4 +272,4 @@ function setSnippets(array){
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>'); jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
} }
jQuery('#jform_snippet').trigger('liszt:updated'); jQuery('#jform_snippet').trigger('liszt:updated');
} }

View File

@ -426,7 +426,7 @@ jQuery(document).ready(function()
function addData(result,where){ function addData(result,where){
jQuery(result).insertAfter(jQuery(where).closest('.control-group')); jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
} }
function addButtonID_server(type, size){ function addButtonID_server(type, size){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0 && size > 0){ if(token.length > 0 && type.length > 0 && size > 0){
@ -450,8 +450,8 @@ function addButtonID(type, where, size){
} }
} }
}); });
} }
function addButton_server(type){ function addButton_server(type){
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod);
if(token.length > 0 && type.length > 0){ if(token.length > 0 && type.length > 0){
@ -471,8 +471,8 @@ function addButton(type,where){
addData(result,'#jform_'+where); addData(result,'#jform_'+where);
} }
}) })
} }
function getLinked_server(type){ function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){ if(token.length > 0 && type > 0){
@ -493,7 +493,7 @@ function getLinked(){
jQuery('#display_linked_to').html(result); jQuery('#display_linked_to').html(result);
} }
}); });
} }
function getAjaxDisplay(type){ function getAjaxDisplay(type){
getAjaxDisplay_server(type).done(function(result) { getAjaxDisplay_server(type).done(function(result) {

View File

@ -31,7 +31,6 @@ jform_vvvvwatwai_required = false;
jform_vvvvwauwaj_required = false; jform_vvvvwauwaj_required = false;
jform_vvvvwavwak_required = false; jform_vvvvwavwak_required = false;
jform_vvvvwaxwal_required = false; jform_vvvvwaxwal_required = false;
jform_vvvvwaywam_required = false;
// Initial Script // Initial Script
jQuery(document).ready(function() jQuery(document).ready(function()
@ -50,9 +49,13 @@ jQuery(document).ready(function()
var authentication_vvvvwax = jQuery("#jform_authentication").val(); var authentication_vvvvwax = jQuery("#jform_authentication").val();
vvvvwax(protocol_vvvvwax,authentication_vvvvwax); vvvvwax(protocol_vvvvwax,authentication_vvvvwax);
var authentication_vvvvway = jQuery("#jform_authentication").val(); var protocol_vvvvwaz = jQuery("#jform_protocol").val();
var protocol_vvvvway = jQuery("#jform_protocol").val(); var authentication_vvvvwaz = jQuery("#jform_authentication").val();
vvvvway(authentication_vvvvway,protocol_vvvvway); vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz);
var protocol_vvvvwbb = jQuery("#jform_protocol").val();
var authentication_vvvvwbb = jQuery("#jform_authentication").val();
vvvvwbb(protocol_vvvvwbb,authentication_vvvvwbb);
}); });
// the vvvvwat function // the vvvvwat function
@ -316,7 +319,7 @@ function protocol_vvvvwav_SomeFunc(protocol_vvvvwav)
function authentication_vvvvwav_SomeFunc(authentication_vvvvwav) function authentication_vvvvwav_SomeFunc(authentication_vvvvwav)
{ {
// set the function logic // set the function logic
if (authentication_vvvvwav == 1 || authentication_vvvvwav == 3) if (authentication_vvvvwav == 1 || authentication_vvvvwav == 3 || authentication_vvvvwav == 5)
{ {
return true; return true;
} }
@ -364,7 +367,6 @@ function vvvvwax(protocol_vvvvwax,authentication_vvvvwax)
jform_vvvvwaxwal_required = false; jform_vvvvwaxwal_required = false;
} }
jQuery('#jform_secret').closest('.control-group').show();
} }
else else
{ {
@ -377,7 +379,6 @@ function vvvvwax(protocol_vvvvwax,authentication_vvvvwax)
jQuery('#jform_private').removeClass('required'); jQuery('#jform_private').removeClass('required');
jform_vvvvwaxwal_required = true; jform_vvvvwaxwal_required = true;
} }
jQuery('#jform_secret').closest('.control-group').hide();
} }
} }
@ -403,80 +404,122 @@ function authentication_vvvvwax_SomeFunc(authentication_vvvvwax)
return false; return false;
} }
// the vvvvway function // the vvvvwaz function
function vvvvway(authentication_vvvvway,protocol_vvvvway) function vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz)
{ {
if (isSet(authentication_vvvvway) && authentication_vvvvway.constructor !== Array) if (isSet(protocol_vvvvwaz) && protocol_vvvvwaz.constructor !== Array)
{ {
var temp_vvvvway = authentication_vvvvway; var temp_vvvvwaz = protocol_vvvvwaz;
var authentication_vvvvway = []; var protocol_vvvvwaz = [];
authentication_vvvvway.push(temp_vvvvway); protocol_vvvvwaz.push(temp_vvvvwaz);
} }
else if (!isSet(authentication_vvvvway)) else if (!isSet(protocol_vvvvwaz))
{ {
var authentication_vvvvway = []; var protocol_vvvvwaz = [];
} }
var authentication = authentication_vvvvway.some(authentication_vvvvway_SomeFunc); var protocol = protocol_vvvvwaz.some(protocol_vvvvwaz_SomeFunc);
if (isSet(protocol_vvvvway) && protocol_vvvvway.constructor !== Array) if (isSet(authentication_vvvvwaz) && authentication_vvvvwaz.constructor !== Array)
{ {
var temp_vvvvway = protocol_vvvvway; var temp_vvvvwaz = authentication_vvvvwaz;
var protocol_vvvvway = []; var authentication_vvvvwaz = [];
protocol_vvvvway.push(temp_vvvvway); authentication_vvvvwaz.push(temp_vvvvwaz);
} }
else if (!isSet(protocol_vvvvway)) else if (!isSet(authentication_vvvvwaz))
{ {
var protocol_vvvvway = []; var authentication_vvvvwaz = [];
} }
var protocol = protocol_vvvvway.some(protocol_vvvvway_SomeFunc); var authentication = authentication_vvvvwaz.some(authentication_vvvvwaz_SomeFunc);
// set this function logic // set this function logic
if (authentication && protocol) if (protocol && authentication)
{ {
jQuery('#jform_private').closest('.control-group').show(); jQuery('#jform_private_key').closest('.control-group').show();
if (jform_vvvvwaywam_required)
{
updateFieldRequired('private',0);
jQuery('#jform_private').prop('required','required');
jQuery('#jform_private').attr('aria-required',true);
jQuery('#jform_private').addClass('required');
jform_vvvvwaywam_required = false;
}
jQuery('#jform_secret').closest('.control-group').show();
} }
else else
{ {
jQuery('#jform_private').closest('.control-group').hide(); jQuery('#jform_private_key').closest('.control-group').hide();
if (!jform_vvvvwaywam_required)
{
updateFieldRequired('private',1);
jQuery('#jform_private').removeAttr('required');
jQuery('#jform_private').removeAttr('aria-required');
jQuery('#jform_private').removeClass('required');
jform_vvvvwaywam_required = true;
}
jQuery('#jform_secret').closest('.control-group').hide();
} }
} }
// the vvvvway Some function // the vvvvwaz Some function
function authentication_vvvvway_SomeFunc(authentication_vvvvway) function protocol_vvvvwaz_SomeFunc(protocol_vvvvwaz)
{ {
// set the function logic // set the function logic
if (authentication_vvvvway == 2 || authentication_vvvvway == 3) if (protocol_vvvvwaz == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the vvvvway Some function // the vvvvwaz Some function
function protocol_vvvvway_SomeFunc(protocol_vvvvway) function authentication_vvvvwaz_SomeFunc(authentication_vvvvwaz)
{ {
// set the function logic // set the function logic
if (protocol_vvvvway == 2) if (authentication_vvvvwaz == 4 || authentication_vvvvwaz == 5)
{
return true;
}
return false;
}
// the vvvvwbb function
function vvvvwbb(protocol_vvvvwbb,authentication_vvvvwbb)
{
if (isSet(protocol_vvvvwbb) && protocol_vvvvwbb.constructor !== Array)
{
var temp_vvvvwbb = protocol_vvvvwbb;
var protocol_vvvvwbb = [];
protocol_vvvvwbb.push(temp_vvvvwbb);
}
else if (!isSet(protocol_vvvvwbb))
{
var protocol_vvvvwbb = [];
}
var protocol = protocol_vvvvwbb.some(protocol_vvvvwbb_SomeFunc);
if (isSet(authentication_vvvvwbb) && authentication_vvvvwbb.constructor !== Array)
{
var temp_vvvvwbb = authentication_vvvvwbb;
var authentication_vvvvwbb = [];
authentication_vvvvwbb.push(temp_vvvvwbb);
}
else if (!isSet(authentication_vvvvwbb))
{
var authentication_vvvvwbb = [];
}
var authentication = authentication_vvvvwbb.some(authentication_vvvvwbb_SomeFunc);
// set this function logic
if (protocol && authentication)
{
jQuery('#jform_secret').closest('.control-group').show();
}
else
{
jQuery('#jform_secret').closest('.control-group').hide();
}
}
// the vvvvwbb Some function
function protocol_vvvvwbb_SomeFunc(protocol_vvvvwbb)
{
// set the function logic
if (protocol_vvvvwbb == 2)
{
return true;
}
return false;
}
// the vvvvwbb Some function
function authentication_vvvvwbb_SomeFunc(authentication_vvvvwbb)
{
// set the function logic
if (authentication_vvvvwbb == 2 || authentication_vvvvwbb == 3 || authentication_vvvvwbb == 4 || authentication_vvvvwbb == 5)
{ {
return true; return true;
} }

View File

@ -107,18 +107,6 @@
<option value="1">COM_COMPONENTBUILDER_SERVER_FTP</option> <option value="1">COM_COMPONENTBUILDER_SERVER_FTP</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_SFTP</option> <option value="2">COM_COMPONENTBUILDER_SERVER_SFTP</option>
</field> </field>
<!-- Host Field. Type: Text. (joomla)-->
<field type="text"
name="host"
label="COM_COMPONENTBUILDER_SERVER_HOST_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_HOST_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_HOST_HINT" />
<!-- Note_ftp_signature Field. Type: Note. A None Database Field. (joomla)--> <!-- Note_ftp_signature Field. Type: Note. A None Database Field. (joomla)-->
<field type="note" <field type="note"
name="note_ftp_signature" name="note_ftp_signature"
@ -126,27 +114,6 @@
description="COM_COMPONENTBUILDER_SERVER_NOTE_FTP_SIGNATURE_DESCRIPTION" description="COM_COMPONENTBUILDER_SERVER_NOTE_FTP_SIGNATURE_DESCRIPTION"
heading="h4" heading="h4"
class="alert alert-success note_ftp_signature" /> class="alert alert-success note_ftp_signature" />
<!-- Note_ssh_security Field. Type: Note. A None Database Field. (joomla)-->
<field type="note"
name="note_ssh_security"
label="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_LABEL"
description="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION"
heading="h4"
class="alert alert-info note_ssh_security" />
<!-- Port Field. Type: Text. (joomla)-->
<field type="text"
name="port"
label="COM_COMPONENTBUILDER_SERVER_PORT_LABEL"
size="10"
maxlength="50"
default="22"
description="COM_COMPONENTBUILDER_SERVER_PORT_DESCRIPTION"
class="text_area"
required="true"
filter="INT"
message="COM_COMPONENTBUILDER_SERVER_PORT_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PORT_HINT"
onchange="if(!jQuery(this).val().match(/^\d+$/)){jQuery(this).val('')};" />
<!-- Path Field. Type: Text. (joomla)--> <!-- Path Field. Type: Text. (joomla)-->
<field type="text" <field type="text"
name="path" name="path"
@ -161,15 +128,20 @@
filter="PATH" filter="PATH"
message="COM_COMPONENTBUILDER_SERVER_PATH_MESSAGE" message="COM_COMPONENTBUILDER_SERVER_PATH_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PATH_HINT" /> hint="COM_COMPONENTBUILDER_SERVER_PATH_HINT" />
<!-- Secret Field. Type: Password. (joomla)--> <!-- Port Field. Type: Text. (joomla)-->
<field type="password" <field type="text"
name="secret" name="port"
label="COM_COMPONENTBUILDER_SERVER_SECRET_LABEL" label="COM_COMPONENTBUILDER_SERVER_PORT_LABEL"
size="60" size="10"
description="COM_COMPONENTBUILDER_SERVER_SECRET_DESCRIPTION" maxlength="50"
message="Error! Please add the passphrase here." default="22"
description="COM_COMPONENTBUILDER_SERVER_PORT_DESCRIPTION"
class="text_area" class="text_area"
filter="raw" /> required="true"
filter="INT"
message="COM_COMPONENTBUILDER_SERVER_PORT_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PORT_HINT"
onchange="if(!jQuery(this).val().match(/^\d+$/)){jQuery(this).val('')};" />
<!-- Authentication Field. Type: List. (joomla)--> <!-- Authentication Field. Type: List. (joomla)-->
<field type="list" <field type="list"
name="authentication" name="authentication"
@ -182,9 +154,49 @@
<!-- Option Set.--> <!-- Option Set.-->
<option value="">COM_COMPONENTBUILDER_SERVER_SELECT_AN_OPTION</option> <option value="">COM_COMPONENTBUILDER_SERVER_SELECT_AN_OPTION</option>
<option value="1">COM_COMPONENTBUILDER_SERVER_PASSWORD</option> <option value="1">COM_COMPONENTBUILDER_SERVER_PASSWORD</option>
<option value="2">COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_FILE</option> <option value="2">COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_FILE_PATH</option>
<option value="3">COM_COMPONENTBUILDER_SERVER_BOTH</option> <option value="3">COM_COMPONENTBUILDER_SERVER_BOTH_PASSWORD_PRIVATE_KEY_FILE_PATH</option>
<option value="4">COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_TEXT_FIELD</option>
<option value="5">COM_COMPONENTBUILDER_SERVER_BOTH_PASSWORD_PRIVATE_KEY_TEXT_FIELD</option>
</field> </field>
<!-- Note_ssh_security Field. Type: Note. A None Database Field. (joomla)-->
<field type="note"
name="note_ssh_security"
label="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_LABEL"
description="COM_COMPONENTBUILDER_SERVER_NOTE_SSH_SECURITY_DESCRIPTION"
heading="h4"
class="alert alert-info note_ssh_security" />
<!-- Password Field. Type: Password. (joomla)-->
<field type="password"
name="password"
label="COM_COMPONENTBUILDER_SERVER_PASSWORD_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_PASSWORD_DESCRIPTION"
message="Error! Please add the password here."
class="text_area"
required="true"
filter="raw" />
<!-- Secret Field. Type: Password. (joomla)-->
<field type="password"
name="secret"
label="COM_COMPONENTBUILDER_SERVER_SECRET_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_SECRET_DESCRIPTION"
message="Error! Please add the passphrase here."
class="text_area"
filter="raw" />
<!-- Host Field. Type: Text. (joomla)-->
<field type="text"
name="host"
label="COM_COMPONENTBUILDER_SERVER_HOST_LABEL"
size="40"
maxlength="150"
description="COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION"
class="text_area"
required="true"
filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_HOST_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_HOST_HINT" />
<!-- Signature Field. Type: Text. (joomla)--> <!-- Signature Field. Type: Text. (joomla)-->
<field type="text" <field type="text"
name="signature" name="signature"
@ -198,20 +210,6 @@
message="COM_COMPONENTBUILDER_SERVER_SIGNATURE_MESSAGE" message="COM_COMPONENTBUILDER_SERVER_SIGNATURE_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_SIGNATURE_HINT" hint="COM_COMPONENTBUILDER_SERVER_SIGNATURE_HINT"
autocomplete="off" /> autocomplete="off" />
<!-- Password Field. Type: Password. (joomla)-->
<field type="password"
name="password"
label="COM_COMPONENTBUILDER_SERVER_PASSWORD_LABEL"
size="60"
description="COM_COMPONENTBUILDER_SERVER_PASSWORD_DESCRIPTION"
message="Error! Please add the password here."
class="text_area"
required="true"
filter="raw" />
<!-- Not_required Field. Type: Hidden. (joomla)-->
<field type="hidden"
name="not_required"
default="[]" />
<!-- Username Field. Type: Text. (joomla)--> <!-- Username Field. Type: Text. (joomla)-->
<field type="text" <field type="text"
name="username" name="username"
@ -224,6 +222,10 @@
filter="STRING" filter="STRING"
message="COM_COMPONENTBUILDER_SERVER_USERNAME_MESSAGE" message="COM_COMPONENTBUILDER_SERVER_USERNAME_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_USERNAME_HINT" /> hint="COM_COMPONENTBUILDER_SERVER_USERNAME_HINT" />
<!-- Not_required Field. Type: Hidden. (joomla)-->
<field type="hidden"
name="not_required"
default="[]" />
<!-- Private Field. Type: Text. (joomla)--> <!-- Private Field. Type: Text. (joomla)-->
<field type="text" <field type="text"
name="private" name="private"
@ -238,6 +240,15 @@
filter="PATH" filter="PATH"
message="COM_COMPONENTBUILDER_SERVER_PRIVATE_MESSAGE" message="COM_COMPONENTBUILDER_SERVER_PRIVATE_MESSAGE"
hint="COM_COMPONENTBUILDER_SERVER_PRIVATE_HINT" /> hint="COM_COMPONENTBUILDER_SERVER_PRIVATE_HINT" />
<!-- Private_key Field. Type: Textarea. (joomla)-->
<field type="textarea"
name="private_key"
label="COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_LABEL"
rows="15"
cols="5"
description="COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_DESCRIPTION"
class="input-xxlarge span12"
hint="COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_HINT" />
</fieldset> </fieldset>
<!-- Access Control Fields. --> <!-- Access Control Fields. -->

View File

@ -484,7 +484,7 @@ jQuery(document).ready(function()
// get the linked details // get the linked details
getLinked(); getLinked();
}); });
function getLinked_server(type){ function getLinked_server(type){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod;
if(token.length > 0 && type > 0){ if(token.length > 0 && type > 0){
@ -505,8 +505,8 @@ function getLinked(){
jQuery('#display_linked_to').html(result); jQuery('#display_linked_to').html(result);
} }
}); });
} }
function getSnippetDetails_server(snippetId){ function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){ if(token.length > 0 && snippetId > 0){
@ -554,8 +554,8 @@ function getSnippetDetails(id){
jQuery('.snippet-usage').append(usage); jQuery('.snippet-usage').append(usage);
} }
}) })
} }
function getDynamicValues_server(dynamicId){ function getDynamicValues_server(dynamicId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json";
if(token.length > 0 && dynamicId > 0){ if(token.length > 0 && dynamicId > 0){
@ -581,8 +581,8 @@ function getDynamicValues(id){
}); });
} }
}) })
} }
function getLayoutDetails_server(id){ function getLayoutDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json";
if(token.length > 0 && id > 0){ if(token.length > 0 && id > 0){
@ -607,8 +607,8 @@ function getLayoutDetails(id){
}); });
} }
}) })
} }
function getTemplateDetails_server(id){ function getTemplateDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json";
if(token.length > 0 && id > 0){ if(token.length > 0 && id > 0){
@ -633,8 +633,8 @@ function getTemplateDetails(id){
}); });
} }
}) })
} }
// set snippets that are on the page // set snippets that are on the page
var snippetIds = []; var snippetIds = [];
var snippets = {}; var snippets = {};
@ -705,4 +705,4 @@ function setSnippets(array){
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>'); jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
} }
jQuery('#jform_snippet').trigger('liszt:updated'); jQuery('#jform_snippet').trigger('liszt:updated');
} }

View File

@ -99,7 +99,7 @@ function isSet(val)
return false; return false;
} }
function getSnippetDetails_server(snippetId){ function getSnippetDetails_server(snippetId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json";
if(token.length > 0 && snippetId > 0){ if(token.length > 0 && snippetId > 0){
@ -147,8 +147,8 @@ function getSnippetDetails(id){
jQuery('.snippet-usage').append(usage); jQuery('.snippet-usage').append(usage);
} }
}) })
} }
function getDynamicValues_server(dynamicId){ function getDynamicValues_server(dynamicId){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json";
if(token.length > 0 && dynamicId > 0){ if(token.length > 0 && dynamicId > 0){
@ -174,8 +174,8 @@ function getDynamicValues(id){
}); });
} }
}) })
} }
function getLayoutDetails_server(id){ function getLayoutDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json";
if(token.length > 0 && id > 0){ if(token.length > 0 && id > 0){
@ -200,8 +200,8 @@ function getLayoutDetails(id){
}); });
} }
}) })
} }
function getTemplateDetails_server(id){ function getTemplateDetails_server(id){
var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json"; var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json";
if(token.length > 0 && id > 0){ if(token.length > 0 && id > 0){
@ -226,8 +226,8 @@ function getTemplateDetails(id){
}); });
} }
}) })
} }
// set snippets that are on the page // set snippets that are on the page
var snippetIds = []; var snippetIds = [];
var snippets = {}; var snippets = {};
@ -298,4 +298,4 @@ function setSnippets(array){
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>'); jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
} }
jQuery('#jform_snippet').trigger('liszt:updated'); jQuery('#jform_snippet').trigger('liszt:updated');
} }

View File

@ -558,8 +558,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('help_document'); $this->canDo = ComponentbuilderHelper::getActions('help_document');
} }
@ -584,7 +582,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -594,17 +591,11 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('help_document.edit', $contexts[$pk])) if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -614,7 +605,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -624,7 +614,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
continue; continue;
} }
} }
list($this->table->title, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->title); list($this->table->title, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->title);
// insert all set values // insert all set values
@ -707,8 +696,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('help_document'); $this->canDo = ComponentbuilderHelper::getActions('help_document');
} }
@ -732,7 +719,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
if (!$this->user->authorise('help_document.edit', $contexts[$pk])) if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -743,7 +729,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -1507,6 +1507,18 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
} }
// remove from this dataset // remove from this dataset
unset($item->css); unset($item->css);
// rename sales_server_ftp field
if (isset($item->sales_server_ftp))
{
$item->sales_server = $item->sales_server_ftp;
unset($item->sales_server_ftp);
}
// rename update_server_ftp field
if (isset($item->update_server_ftp))
{
$item->update_server = $item->update_server_ftp;
unset($item->update_server_ftp);
}
// repeatable fields to update // repeatable fields to update
$updaterR = array( $updaterR = array(
// repeatablefield => checker // repeatablefield => checker
@ -2267,19 +2279,19 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
case 'joomla_component': case 'joomla_component':
if ($retry == 3) if ($retry == 3)
{ {
// get by name only // get by names only
$getter = array('name', 'name_code'); // risky will look at this again $getter = array('name', 'name_code', 'system_name');
} }
elseif ($retry == 2) elseif ($retry == 2)
{ {
// get by name ... // get by name ...
$getter = array('name', 'name_code', 'short_description', 'author', 'email', 'component_version', 'companyname', 'system_name', 'website', 'bom', 'copyright', 'license'); // risky will look at this again $getter = array('name', 'name_code', 'short_description', 'author', 'email', 'component_version', 'companyname', 'system_name', 'website', 'bom', 'copyright', 'license');
$retryAgain = 3; $retryAgain = 3;
} }
else else
{ {
// get by id name ... // get by id name ...
$getter = array('id', 'name', 'name_code', 'short_description', 'author', 'component_version', 'companyname', 'system_name'); // risky will look at this again $getter = array('id', 'name', 'name_code', 'short_description', 'author', 'component_version', 'companyname', 'system_name');
$retryAgain = 2; $retryAgain = 2;
} }
break; break;

View File

@ -221,7 +221,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$item->export_key = rtrim($basic->decryptString($item->export_key), "\0"); $item->export_key = rtrim($basic->decryptString($item->export_key), "\0");
} }
if (empty($item->id)) if (empty($item->id))
{ {
$id = 0; $id = 0;
@ -240,7 +240,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'joomla_component__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'joomla_component__'.$id);
ComponentbuilderHelper::set('joomla_component__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('joomla_component__'.$id, $this->vastDevMod);
} }
// update the fields // update the fields
$objectUpdate = new stdClass(); $objectUpdate = new stdClass();
@ -782,20 +782,21 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
if (ComponentbuilderHelper::checkArray($pks)) if (ComponentbuilderHelper::checkArray($pks))
{ {
$_tablesArray = array( $_tablesArray = array(
'component_admin_views', 'component_admin_views' => 'joomla_component',
'component_site_views', 'component_site_views' => 'joomla_component',
'component_custom_admin_views', 'component_custom_admin_views' => 'joomla_component',
'component_updates', 'component_updates' => 'joomla_component',
'component_mysql_tweaks', 'component_mysql_tweaks' => 'joomla_component',
'component_custom_admin_menus', 'component_custom_admin_menus' => 'joomla_component',
'component_config', 'component_config' => 'joomla_component',
'component_dashboard', 'component_dashboard' => 'joomla_component',
'component_files_folders' 'component_files_folders' => 'joomla_component',
'custom_code' => 'component'
); );
foreach($_tablesArray as $_updateTable) foreach($_tablesArray as $_updateTable => $_key)
{ {
// get the linked IDs // get the linked IDs
if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, 'joomla_component', 'id')) if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, $_key, 'id'))
{ {
// load the model // load the model
$_Model = ComponentbuilderHelper::getModel($_updateTable); $_Model = ComponentbuilderHelper::getModel($_updateTable);
@ -829,20 +830,21 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
if (ComponentbuilderHelper::checkArray($pks)) if (ComponentbuilderHelper::checkArray($pks))
{ {
$_tablesArray = array( $_tablesArray = array(
'component_admin_views', 'component_admin_views' => 'joomla_component',
'component_site_views', 'component_site_views' => 'joomla_component',
'component_custom_admin_views', 'component_custom_admin_views' => 'joomla_component',
'component_updates', 'component_updates' => 'joomla_component',
'component_mysql_tweaks', 'component_mysql_tweaks' => 'joomla_component',
'component_custom_admin_menus', 'component_custom_admin_menus' => 'joomla_component',
'component_config', 'component_config' => 'joomla_component',
'component_dashboard', 'component_dashboard' => 'joomla_component',
'component_files_folders' 'component_files_folders' => 'joomla_component',
'custom_code' => 'component'
); );
foreach($_tablesArray as $_updateTable) foreach($_tablesArray as $_updateTable => $_key)
{ {
// get the linked IDs // get the linked IDs
if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, 'joomla_component', 'id')) if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, $_key, 'id'))
{ {
// load the model // load the model
$_Model = ComponentbuilderHelper::getModel($_updateTable); $_Model = ComponentbuilderHelper::getModel($_updateTable);
@ -970,8 +972,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('joomla_component'); $this->canDo = ComponentbuilderHelper::getActions('joomla_component');
} }
@ -996,7 +996,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -1006,17 +1005,11 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('joomla_component.edit', $contexts[$pk])) if (!$this->user->authorise('joomla_component.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -1026,7 +1019,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -1037,7 +1029,11 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
} }
} }
$this->table->system_name = $this->generateUniqe('system_name',$this->table->system_name); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->system_name) && !is_numeric($this->table->system_name))
{
$this->table->system_name = $this->generateUniqe('system_name',$this->table->system_name);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -1119,8 +1115,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('joomla_component'); $this->canDo = ComponentbuilderHelper::getActions('joomla_component');
} }
@ -1144,7 +1138,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
if (!$this->user->authorise('joomla_component.edit', $contexts[$pk])) if (!$this->user->authorise('joomla_component.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -1155,7 +1148,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -1236,6 +1228,12 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin
$data['metadata'] = (string) $metadata; $data['metadata'] = (string) $metadata;
} }
// if system name is empty create from name
if (empty($data['system_name']) || !ComponentbuilderHelper::checkString($data['system_name']))
{
$data['system_name'] = $data['name'];
}
// Set the addcontributors items to data. // Set the addcontributors items to data.
if (isset($data['addcontributors']) && is_array($data['addcontributors'])) if (isset($data['addcontributors']) && is_array($data['addcontributors']))
{ {

View File

@ -1252,7 +1252,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
} }
} }
} }
/** /**
* Get the keys of the values to search custom code in * Get the keys of the values to search custom code in
* *
@ -1389,7 +1389,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
return $targets[$target]; return $targets[$target];
} }
return false; return false;
} }
/** /**
* Method to auto-populate the model state. * Method to auto-populate the model state.

View File

@ -516,8 +516,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('language'); $this->canDo = ComponentbuilderHelper::getActions('language');
} }
@ -542,7 +540,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -552,17 +549,11 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('language.edit', $contexts[$pk])) if (!$this->user->authorise('language.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -572,7 +563,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -583,7 +573,11 @@ class ComponentbuilderModelLanguage extends JModelAdmin
} }
} }
$this->table->name = $this->generateUniqe('name',$this->table->name); // 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 // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -665,8 +659,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('language'); $this->canDo = ComponentbuilderHelper::getActions('language');
} }
@ -690,7 +682,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
if (!$this->user->authorise('language.edit', $contexts[$pk])) if (!$this->user->authorise('language.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -701,7 +692,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -107,14 +107,14 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$translation->loadString($item->translation); $translation->loadString($item->translation);
$item->translation = $translation->toArray(); $item->translation = $translation->toArray();
} }
if (!empty($item->components)) if (!empty($item->components))
{ {
// JSON Decode components. // JSON Decode components.
$item->components = json_decode($item->components, true); $item->components = json_decode($item->components, true);
} }
if (empty($item->id)) if (empty($item->id))
{ {
$id = 0; $id = 0;
@ -133,7 +133,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'language_translation__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'language_translation__'.$id);
ComponentbuilderHelper::set('language_translation__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('language_translation__'.$id, $this->vastDevMod);
} }
if (!empty($item->id)) if (!empty($item->id))
{ {
@ -556,8 +556,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('language_translation'); $this->canDo = ComponentbuilderHelper::getActions('language_translation');
} }
@ -582,7 +580,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -592,17 +589,11 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('language_translation.edit', $contexts[$pk])) if (!$this->user->authorise('language_translation.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -612,7 +603,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -623,7 +613,11 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
} }
} }
$this->table->entranslation = $this->generateUniqe('entranslation',$this->table->entranslation); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->entranslation) && !is_numeric($this->table->entranslation))
{
$this->table->entranslation = $this->generateUniqe('entranslation',$this->table->entranslation);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -705,8 +699,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('language_translation'); $this->canDo = ComponentbuilderHelper::getActions('language_translation');
} }
@ -730,7 +722,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
if (!$this->user->authorise('language_translation.edit', $contexts[$pk])) if (!$this->user->authorise('language_translation.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -741,7 +732,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -572,8 +572,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('layout'); $this->canDo = ComponentbuilderHelper::getActions('layout');
} }
@ -598,7 +596,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -608,17 +605,11 @@ class ComponentbuilderModelLayout extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -628,7 +619,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -638,7 +628,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
continue; continue;
} }
} }
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name); list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// insert all set values // insert all set values
@ -721,8 +710,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('layout'); $this->canDo = ComponentbuilderHelper::getActions('layout');
} }
@ -746,7 +733,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -757,7 +743,6 @@ class ComponentbuilderModelLayout extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -139,10 +139,10 @@ class ComponentbuilderModelLibraries extends JModelList
{ {
// convert type // convert type
$item->type = $this->selectionTranslation($item->type, 'type'); $item->type = $this->selectionTranslation($item->type, 'type');
// convert how // convert how
$item->how = $this->selectionTranslation($item->how, 'how'); $item->how = $this->selectionTranslation($item->how, 'how');
} }
} }
@ -171,7 +171,7 @@ class ComponentbuilderModelLibraries extends JModelList
return $typeArray[$value]; return $typeArray[$value];
} }
} }
// Array of how language strings // Array of how language strings
if ($name === 'how') if ($name === 'how')
{ {
@ -188,7 +188,7 @@ class ComponentbuilderModelLibraries extends JModelList
return JText::_($howArray[$value]); return JText::_($howArray[$value]);
} }
} }
return $value; return $value;
} }

View File

@ -122,7 +122,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$item->php_setdocument = base64_decode($item->php_setdocument); $item->php_setdocument = base64_decode($item->php_setdocument);
} }
if (empty($item->id)) if (empty($item->id))
{ {
$id = 0; $id = 0;
@ -141,7 +141,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'library__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'library__'.$id);
ComponentbuilderHelper::set('library__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('library__'.$id, $this->vastDevMod);
} }
if (!empty($item->id)) if (!empty($item->id))
{ {
@ -443,9 +443,9 @@ class ComponentbuilderModelLibrary extends JModelAdmin
*/ */
protected function getUniqeFields() protected function getUniqeFields()
{ {
return array('name'); return array('name');
} }
/** /**
@ -662,8 +662,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library'); $this->canDo = ComponentbuilderHelper::getActions('library');
} }
@ -688,7 +686,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -698,17 +695,11 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('library.edit', $contexts[$pk])) if (!$this->user->authorise('library.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -718,7 +709,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -729,7 +719,11 @@ class ComponentbuilderModelLibrary extends JModelAdmin
} }
} }
$this->table->name = $this->generateUniqe('name',$this->table->name); // 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 // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -811,8 +805,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library'); $this->canDo = ComponentbuilderHelper::getActions('library');
} }
@ -836,7 +828,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
if (!$this->user->authorise('library.edit', $contexts[$pk])) if (!$this->user->authorise('library.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -847,7 +838,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -526,8 +526,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library_config'); $this->canDo = ComponentbuilderHelper::getActions('library_config');
} }
@ -552,7 +550,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -562,17 +559,11 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('library_config.edit', $contexts[$pk])) if (!$this->user->authorise('library_config.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -582,7 +573,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -593,7 +583,11 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
} }
} }
$this->table->library = $this->generateUniqe('library',$this->table->library); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->library) && !is_numeric($this->table->library))
{
$this->table->library = $this->generateUniqe('library',$this->table->library);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -675,8 +669,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library_config'); $this->canDo = ComponentbuilderHelper::getActions('library_config');
} }
@ -700,7 +692,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
if (!$this->user->authorise('library_config.edit', $contexts[$pk])) if (!$this->user->authorise('library_config.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -711,7 +702,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -558,8 +558,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls'); $this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls');
} }
@ -584,7 +582,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -594,17 +591,11 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('library_files_folders_urls.edit', $contexts[$pk])) if (!$this->user->authorise('library_files_folders_urls.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -614,7 +605,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -625,7 +615,11 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
} }
} }
$this->table->library = $this->generateUniqe('library',$this->table->library); // Only for strings
if (ComponentbuilderHelper::checkString($this->table->library) && !is_numeric($this->table->library))
{
$this->table->library = $this->generateUniqe('library',$this->table->library);
}
// insert all set values // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -707,8 +701,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls'); $this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls');
} }
@ -732,7 +724,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
if (!$this->user->authorise('library_files_folders_urls.edit', $contexts[$pk])) if (!$this->user->authorise('library_files_folders_urls.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -743,7 +734,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -100,10 +100,10 @@ class ComponentbuilderModelServer extends JModelAdmin
// Get the encryption object. // Get the encryption object.
$basic = new FOFEncryptAes($basickey, 128); $basic = new FOFEncryptAes($basickey, 128);
if (!empty($item->host) && $basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true))) if (!empty($item->path) && $basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
{ {
// basic decrypt data host. // basic decrypt data path.
$item->host = rtrim($basic->decryptString($item->host), "\0"); $item->path = rtrim($basic->decryptString($item->path), "\0");
} }
if (!empty($item->port) && $basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true))) if (!empty($item->port) && $basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true)))
@ -112,10 +112,10 @@ class ComponentbuilderModelServer extends JModelAdmin
$item->port = rtrim($basic->decryptString($item->port), "\0"); $item->port = rtrim($basic->decryptString($item->port), "\0");
} }
if (!empty($item->path) && $basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true))) if (!empty($item->password) && $basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{ {
// basic decrypt data path. // basic decrypt data password.
$item->path = rtrim($basic->decryptString($item->path), "\0"); $item->password = rtrim($basic->decryptString($item->password), "\0");
} }
if (!empty($item->secret) && $basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true))) if (!empty($item->secret) && $basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true)))
@ -124,18 +124,18 @@ class ComponentbuilderModelServer extends JModelAdmin
$item->secret = rtrim($basic->decryptString($item->secret), "\0"); $item->secret = rtrim($basic->decryptString($item->secret), "\0");
} }
if (!empty($item->host) && $basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
{
// basic decrypt data host.
$item->host = rtrim($basic->decryptString($item->host), "\0");
}
if (!empty($item->signature) && $basickey && !is_numeric($item->signature) && $item->signature === base64_encode(base64_decode($item->signature, true))) if (!empty($item->signature) && $basickey && !is_numeric($item->signature) && $item->signature === base64_encode(base64_decode($item->signature, true)))
{ {
// basic decrypt data signature. // basic decrypt data signature.
$item->signature = rtrim($basic->decryptString($item->signature), "\0"); $item->signature = rtrim($basic->decryptString($item->signature), "\0");
} }
if (!empty($item->password) && $basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{
// basic decrypt data password.
$item->password = rtrim($basic->decryptString($item->password), "\0");
}
if (!empty($item->username) && $basickey && !is_numeric($item->username) && $item->username === base64_encode(base64_decode($item->username, true))) if (!empty($item->username) && $basickey && !is_numeric($item->username) && $item->username === base64_encode(base64_decode($item->username, true)))
{ {
// basic decrypt data username. // basic decrypt data username.
@ -146,6 +146,12 @@ class ComponentbuilderModelServer extends JModelAdmin
{ {
// basic decrypt data private. // basic decrypt data private.
$item->private = rtrim($basic->decryptString($item->private), "\0"); $item->private = rtrim($basic->decryptString($item->private), "\0");
}
if (!empty($item->private_key) && $basickey && !is_numeric($item->private_key) && $item->private_key === base64_encode(base64_decode($item->private_key, true)))
{
// basic decrypt data private_key.
$item->private_key = rtrim($basic->decryptString($item->private_key), "\0");
} }
if (!empty($item->id)) if (!empty($item->id))
@ -164,7 +170,7 @@ class ComponentbuilderModelServer extends JModelAdmin
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getWanlinked_components() public function getWamlinked_components()
{ {
// Get the user object. // Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
@ -689,8 +695,6 @@ class ComponentbuilderModelServer extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('server'); $this->canDo = ComponentbuilderHelper::getActions('server');
} }
@ -715,7 +719,6 @@ class ComponentbuilderModelServer extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -725,17 +728,11 @@ class ComponentbuilderModelServer extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('server.edit', $contexts[$pk])) if (!$this->user->authorise('server.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -745,7 +742,6 @@ class ComponentbuilderModelServer extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -756,7 +752,11 @@ class ComponentbuilderModelServer extends JModelAdmin
} }
} }
$this->table->name = $this->generateUniqe('name',$this->table->name); // 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 // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -838,8 +838,6 @@ class ComponentbuilderModelServer extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('server'); $this->canDo = ComponentbuilderHelper::getActions('server');
} }
@ -863,7 +861,6 @@ class ComponentbuilderModelServer extends JModelAdmin
if (!$this->user->authorise('server.edit', $contexts[$pk])) if (!$this->user->authorise('server.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -874,7 +871,6 @@ class ComponentbuilderModelServer extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -960,10 +956,10 @@ class ComponentbuilderModelServer extends JModelAdmin
// Get the encryption object // Get the encryption object
$basic = new FOFEncryptAes($basickey, 128); $basic = new FOFEncryptAes($basickey, 128);
// Encrypt data host. // Encrypt data path.
if (isset($data['host']) && $basickey) if (isset($data['path']) && $basickey)
{ {
$data['host'] = $basic->encryptString($data['host']); $data['path'] = $basic->encryptString($data['path']);
} }
// Encrypt data port. // Encrypt data port.
@ -972,10 +968,10 @@ class ComponentbuilderModelServer extends JModelAdmin
$data['port'] = $basic->encryptString($data['port']); $data['port'] = $basic->encryptString($data['port']);
} }
// Encrypt data path. // Encrypt data password.
if (isset($data['path']) && $basickey) if (isset($data['password']) && $basickey)
{ {
$data['path'] = $basic->encryptString($data['path']); $data['password'] = $basic->encryptString($data['password']);
} }
// Encrypt data secret. // Encrypt data secret.
@ -984,18 +980,18 @@ class ComponentbuilderModelServer extends JModelAdmin
$data['secret'] = $basic->encryptString($data['secret']); $data['secret'] = $basic->encryptString($data['secret']);
} }
// Encrypt data host.
if (isset($data['host']) && $basickey)
{
$data['host'] = $basic->encryptString($data['host']);
}
// Encrypt data signature. // Encrypt data signature.
if (isset($data['signature']) && $basickey) if (isset($data['signature']) && $basickey)
{ {
$data['signature'] = $basic->encryptString($data['signature']); $data['signature'] = $basic->encryptString($data['signature']);
} }
// Encrypt data password.
if (isset($data['password']) && $basickey)
{
$data['password'] = $basic->encryptString($data['password']);
}
// Encrypt data username. // Encrypt data username.
if (isset($data['username']) && $basickey) if (isset($data['username']) && $basickey)
{ {
@ -1006,6 +1002,12 @@ class ComponentbuilderModelServer extends JModelAdmin
if (isset($data['private']) && $basickey) if (isset($data['private']) && $basickey)
{ {
$data['private'] = $basic->encryptString($data['private']); $data['private'] = $basic->encryptString($data['private']);
}
// Encrypt data private_key.
if (isset($data['private_key']) && $basickey)
{
$data['private_key'] = $basic->encryptString($data['private_key']);
} }
// Set the Params Items to data // Set the Params Items to data

View File

@ -304,36 +304,36 @@ class ComponentbuilderModelServers extends JModelList
continue; continue;
} }
if ($basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true))) if ($basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true)))
{ {
// decrypt host // decrypt path
$item->host = $basic->decryptString($item->host); $item->path = $basic->decryptString($item->path);
} }
if ($basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true))) if ($basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true)))
{ {
// decrypt port // decrypt port
$item->port = $basic->decryptString($item->port); $item->port = $basic->decryptString($item->port);
} }
if ($basickey && !is_numeric($item->path) && $item->path === base64_encode(base64_decode($item->path, true))) if ($basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{ {
// decrypt path // decrypt password
$item->path = $basic->decryptString($item->path); $item->password = $basic->decryptString($item->password);
} }
if ($basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true))) if ($basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true)))
{ {
// decrypt secret // decrypt secret
$item->secret = $basic->decryptString($item->secret); $item->secret = $basic->decryptString($item->secret);
} }
if ($basickey && !is_numeric($item->host) && $item->host === base64_encode(base64_decode($item->host, true)))
{
// decrypt host
$item->host = $basic->decryptString($item->host);
}
if ($basickey && !is_numeric($item->signature) && $item->signature === base64_encode(base64_decode($item->signature, true))) if ($basickey && !is_numeric($item->signature) && $item->signature === base64_encode(base64_decode($item->signature, true)))
{ {
// decrypt signature // decrypt signature
$item->signature = $basic->decryptString($item->signature); $item->signature = $basic->decryptString($item->signature);
} }
if ($basickey && !is_numeric($item->password) && $item->password === base64_encode(base64_decode($item->password, true)))
{
// decrypt password
$item->password = $basic->decryptString($item->password);
}
if ($basickey && !is_numeric($item->username) && $item->username === base64_encode(base64_decode($item->username, true))) if ($basickey && !is_numeric($item->username) && $item->username === base64_encode(base64_decode($item->username, true)))
{ {
// decrypt username // decrypt username
@ -344,6 +344,11 @@ class ComponentbuilderModelServers extends JModelList
// decrypt private // decrypt private
$item->private = $basic->decryptString($item->private); $item->private = $basic->decryptString($item->private);
} }
if ($basickey && !is_numeric($item->private_key) && $item->private_key === base64_encode(base64_decode($item->private_key, true)))
{
// decrypt private_key
$item->private_key = $basic->decryptString($item->private_key);
}
// unset the values we don't want exported. // unset the values we don't want exported.
unset($item->asset_id); unset($item->asset_id);
unset($item->checked_out); unset($item->checked_out);

View File

@ -204,7 +204,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$item->php_controller = base64_decode($item->php_controller); $item->php_controller = base64_decode($item->php_controller);
} }
if (empty($item->id)) if (empty($item->id))
{ {
$id = 0; $id = 0;
@ -223,7 +223,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->vastDevMod = ComponentbuilderHelper::randomkey(50); $this->vastDevMod = ComponentbuilderHelper::randomkey(50);
ComponentbuilderHelper::set($this->vastDevMod, 'site_view__'.$id); ComponentbuilderHelper::set($this->vastDevMod, 'site_view__'.$id);
ComponentbuilderHelper::set('site_view__'.$id, $this->vastDevMod); ComponentbuilderHelper::set('site_view__'.$id, $this->vastDevMod);
} }
// update the fields // update the fields
$objectUpdate = new stdClass(); $objectUpdate = new stdClass();
@ -721,8 +721,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('site_view'); $this->canDo = ComponentbuilderHelper::getActions('site_view');
} }
@ -747,7 +745,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -757,17 +754,11 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -777,7 +768,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -788,7 +778,11 @@ class ComponentbuilderModelSite_view extends JModelAdmin
} }
} }
$this->table->name = $this->generateUniqe('name',$this->table->name); // 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 // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -870,8 +864,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('site_view'); $this->canDo = ComponentbuilderHelper::getActions('site_view');
} }
@ -895,7 +887,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -906,7 +897,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -988,7 +978,12 @@ class ComponentbuilderModelSite_view extends JModelAdmin
} }
// always reset the snippets // always reset the snippets
$data['snippet'] = 0; $data['snippet'] = 0;
// if system name is empty create from name
if (empty($data['system_name']) || !ComponentbuilderHelper::checkString($data['system_name']))
{
$data['system_name'] = $data['name'];
}
// Set the libraries items to data. // Set the libraries items to data.
if (isset($data['libraries']) && is_array($data['libraries'])) if (isset($data['libraries']) && is_array($data['libraries']))

View File

@ -522,8 +522,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('snippet'); $this->canDo = ComponentbuilderHelper::getActions('snippet');
} }
@ -548,7 +546,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -558,17 +555,11 @@ class ComponentbuilderModelSnippet extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -578,7 +569,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -589,7 +579,11 @@ class ComponentbuilderModelSnippet extends JModelAdmin
} }
} }
$this->table->name = $this->generateUniqe('name',$this->table->name); // 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 // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -671,8 +665,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('snippet'); $this->canDo = ComponentbuilderHelper::getActions('snippet');
} }
@ -696,7 +688,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -707,7 +698,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -516,8 +516,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('snippet_type'); $this->canDo = ComponentbuilderHelper::getActions('snippet_type');
} }
@ -542,7 +540,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -552,17 +549,11 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('snippet_type.edit', $contexts[$pk])) if (!$this->user->authorise('snippet_type.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -572,7 +563,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -583,7 +573,11 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
} }
} }
$this->table->name = $this->generateUniqe('name',$this->table->name); // 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 // insert all set values
if (ComponentbuilderHelper::checkArray($values)) if (ComponentbuilderHelper::checkArray($values))
@ -665,8 +659,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('snippet_type'); $this->canDo = ComponentbuilderHelper::getActions('snippet_type');
} }
@ -690,7 +682,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
if (!$this->user->authorise('snippet_type.edit', $contexts[$pk])) if (!$this->user->authorise('snippet_type.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -701,7 +692,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -572,8 +572,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('template'); $this->canDo = ComponentbuilderHelper::getActions('template');
} }
@ -598,7 +596,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
} }
$newIds = array(); $newIds = array();
// Parent exists so let's proceed // Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
@ -608,17 +605,11 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$this->table->reset(); $this->table->reset();
// only allow copy if user may edit this item. // only allow copy if user may edit this item.
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
// Not fatal error // Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
// Check that the row actually exists // Check that the row actually exists
@ -628,7 +619,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
@ -638,7 +628,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
continue; continue;
} }
} }
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name); list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// insert all set values // insert all set values
@ -721,8 +710,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
$this->contentType = new JUcmType;
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
$this->canDo = ComponentbuilderHelper::getActions('template'); $this->canDo = ComponentbuilderHelper::getActions('template');
} }
@ -746,7 +733,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
if (!$this->user->authorise('core.edit', $contexts[$pk])) if (!$this->user->authorise('core.edit', $contexts[$pk]))
{ {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
return false; return false;
} }
@ -757,7 +743,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin
{ {
// Fatal error // Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else

View File

@ -803,6 +803,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_server` (
`path` TEXT NOT NULL, `path` TEXT NOT NULL,
`port` TEXT NOT NULL, `port` TEXT NOT NULL,
`private` TEXT NOT NULL, `private` TEXT NOT NULL,
`private_key` TEXT NOT NULL,
`protocol` TINYINT(1) NOT NULL DEFAULT 0, `protocol` TINYINT(1) NOT NULL DEFAULT 0,
`secret` TEXT NOT NULL, `secret` TEXT NOT NULL,
`signature` TEXT NOT NULL, `signature` TEXT NOT NULL,
@ -1476,7 +1477,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name
(14, '', 'This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without hav', 'Note', '{\"properties0\":{\"name\":\"type\",\"example\":\"note\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be note\"},\"properties1\":{\"name\":\"name\",\"example\":\"note_one\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(mandatory or optional if using description) (translatable) is the descriptive title of the note \"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional if using label)(translatable) the description\\/text of the note \"},\"properties4\":{\"name\":\"heading\",\"example\":\"h4\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) the type of heading element to use for the label (default: h4)\"},\"properties5\":{\"name\":\"class\",\"example\":\"alert\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) a class name (or class names), like these examples ( alert, alert alert-info, alert alert-success, alert alert-error )\"},\"properties6\":{\"name\":\"close\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) a value of \'true\' (for alerts) or the value for the data-dismiss of the bootstrap close icon\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"}}', 'supports a one line text field.', '', 1, 3, '', ''), (14, '', 'This form field makes it possible to create titles, texts, descriptions and even alert boxes. It also allows you to bring order in the settings for extensions, by separating them with useful titles. Or adding descriptions for certain settings (without hav', 'Note', '{\"properties0\":{\"name\":\"type\",\"example\":\"note\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be note\"},\"properties1\":{\"name\":\"name\",\"example\":\"note_one\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(mandatory or optional if using description) (translatable) is the descriptive title of the note \"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional if using label)(translatable) the description\\/text of the note \"},\"properties4\":{\"name\":\"heading\",\"example\":\"h4\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) the type of heading element to use for the label (default: h4)\"},\"properties5\":{\"name\":\"class\",\"example\":\"alert\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) a class name (or class names), like these examples ( alert, alert alert-info, alert alert-success, alert alert-error )\"},\"properties6\":{\"name\":\"close\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) a value of \'true\' (for alerts) or the value for the data-dismiss of the bootstrap close icon\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"}}', 'supports a one line text field.', '', 1, 3, '', ''),
(15, '', 'Provides a one line text box with up-down handles to set a number in the field.', 'Number', '{\"properties0\":{\"name\":\"type\",\"example\":\"number\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be number.\"},\"properties1\":{\"name\":\"name\",\"example\":\"number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties8\":{\"name\":\"max\",\"example\":\"40\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties9\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) Javascript that should run on changing of the value.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a one line text box with up-down handles to set a number in the field.', '', 1, 2, '', ''), (15, '', 'Provides a one line text box with up-down handles to set a number in the field.', 'Number', '{\"properties0\":{\"name\":\"type\",\"example\":\"number\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be number.\"},\"properties1\":{\"name\":\"name\",\"example\":\"number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Number\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties7\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) this value is the lowest on the list.\"},\"properties8\":{\"name\":\"max\",\"example\":\"40\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) this value is the highest on the list.\"},\"properties9\":{\"name\":\"step\",\"example\":\"5\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties10\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) Javascript that should run on changing of the value.\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a one line text box with up-down handles to set a number in the field.', '', 1, 2, '', ''),
(16, '', 'The password form field type provides a text box for entry of a password. The password characters will be obscured as they are entered. If the field has a saved value this is entered (in obscured form) into the text box. If not, the default value (if any)', 'Password', '{\"properties0\":{\"name\":\"type\",\"example\":\"password\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be password.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mypassword\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter A Password\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"default\",\"example\":\"secret\",\"adjustable\":\"1\",\"description\":\"(optional) is the default password.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties11\":{\"name\":\"message\",\"example\":\"Error! Please add password here.\",\"adjustable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties6\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties17\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"hint\",\"example\":\"Your Password Here\",\"adjustable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text box for entry of a password. The password characters will be obscured as they are entered.', '', 1, 5, '', ''), (16, '', 'The password form field type provides a text box for entry of a password. The password characters will be obscured as they are entered. If the field has a saved value this is entered (in obscured form) into the text box. If not, the default value (if any)', 'Password', '{\"properties0\":{\"name\":\"type\",\"example\":\"password\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be password.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mypassword\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Enter A Password\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"default\",\"example\":\"secret\",\"adjustable\":\"1\",\"description\":\"(optional) is the default password.\"},\"properties5\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties11\":{\"name\":\"message\",\"example\":\"Error! Please add password here.\",\"adjustable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties6\":{\"name\":\"class\",\"example\":\"text_area\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties7\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties8\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties9\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties17\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"filter\",\"example\":\"raw\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"hint\",\"example\":\"Your Password Here\",\"adjustable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a text box for entry of a password. The password characters will be obscured as they are entered.', '', 1, 5, '', ''),
(17, '', 'The radio form field type provides radio buttons to select different options. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Radio', '{\"properties0\":{\"name\":\"type\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be radio.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myradiovalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"btn-group btn-group-yesno\",\"adjustable\":\"1\",\"description\":\"(optional) New in Joomla 3, if set to class=\\\"btn-group btn-group-yesno\\\" will show the nice coloured buttons\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|Yes,0|No\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default radio button item value.\"},\"properties12\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties7\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties8\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides radio buttons to select different options.', '', 1, 5, '', ''), (17, '', 'The radio form field type provides radio buttons to select different options. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Radio', '{\"properties0\":{\"name\":\"type\",\"example\":\"radio\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be radio.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myradiovalue\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"class\",\"example\":\"btn-group btn-group-yesno\",\"adjustable\":\"1\",\"description\":\"(optional) New in Joomla 3, if set to class=\\\"btn-group btn-group-yesno\\\" will show the nice coloured buttons\"},\"properties5\":{\"name\":\"option\",\"example\":\"1|Yes,0|No\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties6\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default radio button item value.\"},\"properties7\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties14\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties10\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties11\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties12\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides radio buttons to select different options.', '', 1, 7, '', ''),
(18, '', 'Provides a horizontal scroll bar to specify a value in a range.', 'Range', '{\"properties0\":{\"name\":\"type\",\"example\":\"range\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be range.\"},\"properties1\":{\"name\":\"name\",\"example\":\"range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties14\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties7\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties8\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties12\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties13\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"jQuery(\'#jform_range\').closest(\'.controls\').find(\'span\').remove(); var value = jQuery(\'#jform_range\').val();jQuery(\'#jform_range\').closest(\'.controls\').append(\' \'+value+\'\');\",\"adjustable\":\"1\",\"description\":\"(optional) javascript to run when the range is changed\"},\"properties10\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a horizontal scroll bar to specify a value in a range.', '', 1, 3, '', ''), (18, '', 'Provides a horizontal scroll bar to specify a value in a range.', 'Range', '{\"properties0\":{\"name\":\"type\",\"example\":\"range\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be range.\"},\"properties1\":{\"name\":\"name\",\"example\":\"range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Range\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"9\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties14\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties6\":{\"name\":\"min\",\"example\":\"1\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the min on the meter.\"},\"properties7\":{\"name\":\"max\",\"example\":\"20\",\"adjustable\":\"1\",\"description\":\"(mandatory) this value is the max on meter.\"},\"properties8\":{\"name\":\"step\",\"example\":\"1\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) each option will be the previous option incremented by this integer, starting with the first value until the last value is reached.\"},\"properties12\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties13\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties9\":{\"name\":\"onchange\",\"example\":\"jQuery(\'#jform_range\').closest(\'.controls\').find(\'span\').remove(); var value = jQuery(\'#jform_range\').val();jQuery(\'#jform_range\').closest(\'.controls\').append(\' \'+value+\'\');\",\"adjustable\":\"1\",\"description\":\"(optional) javascript to run when the range is changed\"},\"properties10\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a horizontal scroll bar to specify a value in a range.', '', 1, 3, '', ''),
(19, '', 'Provides a modal with rows of formfields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Repeatable', '{\"properties0\":{\"name\":\"type\",\"example\":\"repeatable\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) must be repeatable.\"},\"properties1\":{\"name\":\"name\",\"example\":\"repeatable_list\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Repeatable List\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"aid\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) id of the hidden from field. (the modal will have this id with an added suffix of \\\"_modal\\\" and the table within the modal will have this id with a suffix of _modal_table\\\")\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) class of the table.\"},\"properties7\":{\"name\":\"select\",\"example\":\"Click here\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) The text to show on the modal button.\"},\"properties8\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties9\":{\"name\":\"maximum\",\"example\":\"50\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties10\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 4, '', ''), (19, '', 'Provides a modal with rows of formfields that you specify. As many options can be added as desired. Note this form field has a jQuery based javascript file as a dependency.', 'Repeatable', '{\"properties0\":{\"name\":\"type\",\"example\":\"repeatable\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) must be repeatable.\"},\"properties1\":{\"name\":\"name\",\"example\":\"repeatable_list\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the parameter\"},\"properties2\":{\"name\":\"label\",\"example\":\"The Repeatable List\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties4\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties5\":{\"name\":\"id\",\"example\":\"aid\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) id of the hidden from field. (the modal will have this id with an added suffix of \\\"_modal\\\" and the table within the modal will have this id with a suffix of _modal_table\\\")\"},\"properties6\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) class of the table.\"},\"properties7\":{\"name\":\"select\",\"example\":\"Click here\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) The text to show on the modal button.\"},\"properties8\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties9\":{\"name\":\"maximum\",\"example\":\"50\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties10\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties12\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 4, '', ''),
(20, '', 'The spacer form field type provides a visual separator between parameter field elements. It is purely a visual aid and no field value is stored.', 'Spacer', '{\"properties0\":{\"name\":\"type\",\"example\":\"spacer\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be spacer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myspacer\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the text to use as a spacer.\"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"hr\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is whether to display a horizontal rule (\'true\' or \'false\'). If this attribute is \'true\', the label attribute will be ignored.\"},\"properties5\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"}}', 'provides a visual separator between form fields. It is purely a visual aid and no value is stored.', '', 1, 1, '', ''), (20, '', 'The spacer form field type provides a visual separator between parameter field elements. It is purely a visual aid and no field value is stored.', 'Spacer', '{\"properties0\":{\"name\":\"type\",\"example\":\"spacer\",\"adjustable\":\"0\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) must be spacer.\"},\"properties1\":{\"name\":\"name\",\"example\":\"myspacer\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"0\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"The notice\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is the text to use as a spacer.\"},\"properties3\":{\"name\":\"description\",\"example\":\"The notice description\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"hr\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is whether to display a horizontal rule (\'true\' or \'false\'). If this attribute is \'true\', the label attribute will be ignored.\"},\"properties5\":{\"name\":\"class\",\"example\":\"\",\"adjustable\":\"1\",\"mandatory\":\"0\",\"translatable\":\"0\",\"description\":\"(optional) is a CSS class name for the HTML form field.\"}}', 'provides a visual separator between form fields. It is purely a visual aid and no value is stored.', '', 1, 1, '', ''),

View File

@ -0,0 +1 @@
ALTER TABLE `#__componentbuilder_server` ADD `private_key` TEXT NOT NULL AFTER `private`;

View File

@ -731,7 +731,7 @@ jQuery('#jform_add_custom_import').on('change',function() {
var valueSwitch = jQuery("#jform_add_custom_import input[type='radio']:checked").val(); var valueSwitch = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
getDynamicScripts(valueSwitch); getDynamicScripts(valueSwitch);
}); });
<?php <?php
$app = JFactory::getApplication(); $app = JFactory::getApplication();
?> ?>
@ -747,8 +747,8 @@ function JRouter(link) {
} }
?> ?>
return url+link; return url+link;
} }
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -760,5 +760,5 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>

View File

@ -199,7 +199,7 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_view/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/admin_view/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets // add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
@ -207,7 +207,7 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy
// add Uikit v2 JavaScripts // add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
// add var key // add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');

View File

@ -85,7 +85,7 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
<?php else: ?> <?php else: ?>
<div class="name"><?php echo $this->escape($item->system_name); ?></div> <div class="name"><?php echo $this->escape($item->system_name); ?></div>
<?php endif; ?> <?php endif; ?>
<div class="btn-group" style="margin: 5px 0 0 0;"> <div class="btn-group" style="margin: 5px 0 0 0;">
<?php if ($canDo->get('admin_view.edit') && $admin_field_id = ComponentbuilderHelper::getVar('admin_fields', $item->id, 'admin_view', 'id')): ?> <?php if ($canDo->get('admin_view.edit') && $admin_field_id = ComponentbuilderHelper::getVar('admin_fields', $item->id, 'admin_view', 'id')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=admins_fields&task=admin_fields.edit&id=<?php echo $admin_field_id; ?>&ref=admin_views" title="<?php echo JText::_('COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS'); ?>" ><span class="icon-list"></span></a> <a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=admins_fields&task=admin_fields.edit&id=<?php echo $admin_field_id; ?>&ref=admin_views" title="<?php echo JText::_('COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS'); ?>" ><span class="icon-list"></span></a>
@ -94,7 +94,7 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=admins_fields_conditions&task=admin_fields_conditions.edit&id=<?php echo $admin_condition_id; ?>&ref=admin_views" title="<?php echo JText::_('COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_CONDITIONS'); ?>" ><span class="icon-shuffle"></span></a> <a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=admins_fields_conditions&task=admin_fields_conditions.edit&id=<?php echo $admin_condition_id; ?>&ref=admin_views" title="<?php echo JText::_('COM_COMPONENTBUILDER_EDIT_THE_ADMIN_FIELDS_CONDITIONS'); ?>" ><span class="icon-shuffle"></span></a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</td> </td>
<td class="hidden-phone"> <td class="hidden-phone">
<?php echo $this->escape($item->name_single); ?> <?php echo $this->escape($item->name_single); ?>

View File

@ -166,7 +166,7 @@ jQuery('#compilerForm').on('change', '#component',function (e)
jQuery('.notice').hide(); jQuery('.notice').hide();
} }
}); });
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -178,8 +178,8 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
<?php <?php
$app = JFactory::getApplication(); $app = JFactory::getApplication();
?> ?>
@ -195,7 +195,7 @@ function JRouter(link) {
} }
?> ?>
return url+link; return url+link;
} }
</script> </script>
<?php else: ?> <?php else: ?>
<h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1> <h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>

View File

@ -364,7 +364,7 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) {
e.preventDefault(); e.preventDefault();
getSnippets(); getSnippets();
}); });
jQuery.fn.selText = function() { jQuery.fn.selText = function() {
var obj = this[0]; var obj = this[0];
if (jQuery.browser.msie) { if (jQuery.browser.msie) {
@ -382,7 +382,7 @@ jQuery.fn.selText = function() {
selection.setBaseAndExtent(obj, 0, obj, 1); selection.setBaseAndExtent(obj, 0, obj, 1);
} }
return this; return this;
} }
jQuery('#adminForm').on('change', '#jform_snippet',function (e) { jQuery('#adminForm').on('change', '#jform_snippet',function (e) {
e.preventDefault(); e.preventDefault();
@ -418,7 +418,7 @@ jQuery(document).ready(function() {
// some lang strings // some lang strings
var select_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_SELECT_A_SNIPPET'); ?>'; var select_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_SELECT_A_SNIPPET'); ?>';
var create_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_CREATE_A_SNIPPET'); ?>'; var create_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_CREATE_A_SNIPPET'); ?>';
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -430,5 +430,5 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>

View File

@ -199,7 +199,7 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/custom_admin_view/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/custom_admin_view/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets // add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
@ -207,7 +207,7 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy
// add Uikit v2 JavaScripts // add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
// add var key // add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');

View File

@ -264,7 +264,7 @@ jQuery('#adminForm').on('change', '#jform_comment_type',function (e)
jQuery('#phpjs-comment-info').show(); jQuery('#phpjs-comment-info').show();
} }
}); });
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -276,5 +276,5 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>

View File

@ -199,7 +199,7 @@ class ComponentbuilderViewCustom_code extends JViewLegacy
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/custom_code/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/custom_code/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets // add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
@ -207,7 +207,7 @@ class ComponentbuilderViewCustom_code extends JViewLegacy
// add Uikit v2 JavaScripts // add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');
} }
} }

View File

@ -654,7 +654,7 @@ jQuery('#jform_add_php_router_parse').on('change',function() {
getDynamicScripts(valueSwitch); getDynamicScripts(valueSwitch);
}); });
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -666,5 +666,5 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>

View File

@ -199,7 +199,7 @@ class ComponentbuilderViewDynamic_get extends JViewLegacy
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/dynamic_get/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/dynamic_get/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets // add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
@ -207,7 +207,7 @@ class ComponentbuilderViewDynamic_get extends JViewLegacy
// add Uikit v2 JavaScripts // add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
// add var key // add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');

View File

@ -333,7 +333,7 @@ jQuery(document).ready(function() {
getFieldOptions(fieldId,false); getFieldOptions(fieldId,false);
} }
}); });
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -345,5 +345,5 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>

View File

@ -199,7 +199,7 @@ class ComponentbuilderViewField extends JViewLegacy
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/field/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/field/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets // add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
@ -207,7 +207,7 @@ class ComponentbuilderViewField extends JViewLegacy
// add Uikit v2 JavaScripts // add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
// add var key // add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');

View File

@ -228,7 +228,7 @@ JHtml::_('behavior.keepalive');
</div> </div>
<div id="loading" style="display: none;"><br /><h3><?php echo JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING'); ?>.<span class="loading-dots">.</span></h3></div> <div id="loading" style="display: none;"><br /><h3><?php echo JText::_('COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING'); ?>.<span class="loading-dots">.</span></h3></div>
<script type="text/javascript"> <script type="text/javascript">
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -240,7 +240,7 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>
<?php else: ?> <?php else: ?>
<h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1> <h1><?php echo JText::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>

View File

@ -127,93 +127,93 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
<script type="text/javascript"> <script type="text/javascript">
// #jform_location listeners for location_vvvvwaz function // #jform_location listeners for location_vvvvwbd function
jQuery('#jform_location').on('keyup',function() jQuery('#jform_location').on('keyup',function()
{ {
var location_vvvvwaz = jQuery("#jform_location input[type='radio']:checked").val(); var location_vvvvwbd = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwaz(location_vvvvwaz); vvvvwbd(location_vvvvwbd);
}); });
jQuery('#adminForm').on('change', '#jform_location',function (e) jQuery('#adminForm').on('change', '#jform_location',function (e)
{ {
e.preventDefault(); e.preventDefault();
var location_vvvvwaz = jQuery("#jform_location input[type='radio']:checked").val(); var location_vvvvwbd = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwaz(location_vvvvwaz); vvvvwbd(location_vvvvwbd);
}); });
// #jform_location listeners for location_vvvvwba function // #jform_location listeners for location_vvvvwbe function
jQuery('#jform_location').on('keyup',function() jQuery('#jform_location').on('keyup',function()
{ {
var location_vvvvwba = jQuery("#jform_location input[type='radio']:checked").val(); var location_vvvvwbe = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwba(location_vvvvwba); vvvvwbe(location_vvvvwbe);
}); });
jQuery('#adminForm').on('change', '#jform_location',function (e) jQuery('#adminForm').on('change', '#jform_location',function (e)
{ {
e.preventDefault(); e.preventDefault();
var location_vvvvwba = jQuery("#jform_location input[type='radio']:checked").val(); var location_vvvvwbe = jQuery("#jform_location input[type='radio']:checked").val();
vvvvwba(location_vvvvwba); vvvvwbe(location_vvvvwbe);
}); });
// #jform_type listeners for type_vvvvwbb function // #jform_type listeners for type_vvvvwbf function
jQuery('#jform_type').on('keyup',function() jQuery('#jform_type').on('keyup',function()
{ {
var type_vvvvwbb = jQuery("#jform_type").val(); var type_vvvvwbf = jQuery("#jform_type").val();
vvvvwbb(type_vvvvwbb); vvvvwbf(type_vvvvwbf);
}); });
jQuery('#adminForm').on('change', '#jform_type',function (e) jQuery('#adminForm').on('change', '#jform_type',function (e)
{ {
e.preventDefault(); e.preventDefault();
var type_vvvvwbb = jQuery("#jform_type").val(); var type_vvvvwbf = jQuery("#jform_type").val();
vvvvwbb(type_vvvvwbb); vvvvwbf(type_vvvvwbf);
}); });
// #jform_type listeners for type_vvvvwbc function // #jform_type listeners for type_vvvvwbg function
jQuery('#jform_type').on('keyup',function() jQuery('#jform_type').on('keyup',function()
{ {
var type_vvvvwbc = jQuery("#jform_type").val(); var type_vvvvwbg = jQuery("#jform_type").val();
vvvvwbc(type_vvvvwbc); vvvvwbg(type_vvvvwbg);
}); });
jQuery('#adminForm').on('change', '#jform_type',function (e) jQuery('#adminForm').on('change', '#jform_type',function (e)
{ {
e.preventDefault(); e.preventDefault();
var type_vvvvwbc = jQuery("#jform_type").val(); var type_vvvvwbg = jQuery("#jform_type").val();
vvvvwbc(type_vvvvwbc); vvvvwbg(type_vvvvwbg);
}); });
// #jform_type listeners for type_vvvvwbd function // #jform_type listeners for type_vvvvwbh function
jQuery('#jform_type').on('keyup',function() jQuery('#jform_type').on('keyup',function()
{ {
var type_vvvvwbd = jQuery("#jform_type").val(); var type_vvvvwbh = jQuery("#jform_type").val();
vvvvwbd(type_vvvvwbd); vvvvwbh(type_vvvvwbh);
}); });
jQuery('#adminForm').on('change', '#jform_type',function (e) jQuery('#adminForm').on('change', '#jform_type',function (e)
{ {
e.preventDefault(); e.preventDefault();
var type_vvvvwbd = jQuery("#jform_type").val(); var type_vvvvwbh = jQuery("#jform_type").val();
vvvvwbd(type_vvvvwbd); vvvvwbh(type_vvvvwbh);
}); });
// #jform_target listeners for target_vvvvwbe function // #jform_target listeners for target_vvvvwbi function
jQuery('#jform_target').on('keyup',function() jQuery('#jform_target').on('keyup',function()
{ {
var target_vvvvwbe = jQuery("#jform_target input[type='radio']:checked").val(); var target_vvvvwbi = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwbe(target_vvvvwbe); vvvvwbi(target_vvvvwbi);
}); });
jQuery('#adminForm').on('change', '#jform_target',function (e) jQuery('#adminForm').on('change', '#jform_target',function (e)
{ {
e.preventDefault(); e.preventDefault();
var target_vvvvwbe = jQuery("#jform_target input[type='radio']:checked").val(); var target_vvvvwbi = jQuery("#jform_target input[type='radio']:checked").val();
vvvvwbe(target_vvvvwbe); vvvvwbi(target_vvvvwbi);
}); });

View File

@ -711,7 +711,7 @@ jQuery('#adminForm').on('change', '#jform_buildcomp',function (e)
}); });
<?php <?php
$app = JFactory::getApplication(); $app = JFactory::getApplication();
?> ?>
@ -727,8 +727,8 @@ function JRouter(link) {
} }
?> ?>
return url+link; return url+link;
} }
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -740,5 +740,5 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>

View File

@ -212,7 +212,7 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/joomla_component/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/joomla_component/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets // add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
@ -220,7 +220,7 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy
// add Uikit v2 JavaScripts // add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
// add var key // add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');

View File

@ -85,7 +85,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
<?php else: ?> <?php else: ?>
<div class="name"><?php echo $this->escape($item->system_name); ?></div> <div class="name"><?php echo $this->escape($item->system_name); ?></div>
<?php endif; ?> <?php endif; ?>
<div class="btn-group" style="margin: 5px 0 0 0;"> <div class="btn-group" style="margin: 5px 0 0 0;">
<?php if ($canDo->get('component_admin_views.edit') && $component_admin_views_id = ComponentbuilderHelper::getVar('component_admin_views', $item->id, 'joomla_component', 'id')): ?> <?php if ($canDo->get('component_admin_views.edit') && $component_admin_views_id = ComponentbuilderHelper::getVar('component_admin_views', $item->id, 'joomla_component', 'id')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=components_admin_views&task=component_admin_views.edit&id=<?php echo $component_admin_views_id; ?>&ref=joomla_components" title="<?php echo JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'); ?>" ><span class="icon-stack"></span></a> <a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=components_admin_views&task=component_admin_views.edit&id=<?php echo $component_admin_views_id; ?>&ref=joomla_components" title="<?php echo JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'); ?>" ><span class="icon-stack"></span></a>
@ -129,7 +129,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
<?php endif; ?> <?php endif; ?>
</div> </div>
</td> </td>
<td class="hidden-phone"> <td class="hidden-phone">
<?php echo $this->escape($item->companyname); ?> <?php echo $this->escape($item->companyname); ?>
</td> </td>

View File

@ -118,7 +118,7 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
<script type="text/javascript"> <script type="text/javascript">
<?php <?php
$app = JFactory::getApplication(); $app = JFactory::getApplication();
?> ?>
@ -134,5 +134,5 @@ function JRouter(link) {
} }
?> ?>
return url+link; return url+link;
} }
</script> </script>

View File

@ -169,7 +169,7 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) {
e.preventDefault(); e.preventDefault();
getSnippets(); getSnippets();
}); });
jQuery.fn.selText = function() { jQuery.fn.selText = function() {
var obj = this[0]; var obj = this[0];
if (jQuery.browser.msie) { if (jQuery.browser.msie) {
@ -187,7 +187,7 @@ jQuery.fn.selText = function() {
selection.setBaseAndExtent(obj, 0, obj, 1); selection.setBaseAndExtent(obj, 0, obj, 1);
} }
return this; return this;
} }
jQuery('#adminForm').on('change', '#jform_snippet',function (e) { jQuery('#adminForm').on('change', '#jform_snippet',function (e) {
e.preventDefault(); e.preventDefault();

View File

@ -85,7 +85,7 @@ $edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit"
<?php else: ?> <?php else: ?>
<div class="name"><?php echo $this->escape($item->name); ?></div> <div class="name"><?php echo $this->escape($item->name); ?></div>
<?php endif; ?> <?php endif; ?>
<div class="btn-group" style="margin: 5px 0 0 0;"> <div class="btn-group" style="margin: 5px 0 0 0;">
<?php if ($canDo->get('library_config.edit') && $library_config_id = ComponentbuilderHelper::getVar('library_config', $item->id, 'library', 'id')): ?> <?php if ($canDo->get('library_config.edit') && $library_config_id = ComponentbuilderHelper::getVar('library_config', $item->id, 'library', 'id')): ?>
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=libraries_config&task=library_config.edit&id=<?php echo $library_config_id; ?>&ref=libraries" title="<?php echo JText::_('COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS'); ?>" ><span class="icon-options"></span></a> <a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=libraries_config&task=library_config.edit&id=<?php echo $library_config_id; ?>&ref=libraries" title="<?php echo JText::_('COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS'); ?>" ><span class="icon-options"></span></a>
@ -94,7 +94,7 @@ $edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit"
<a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=libraries_files_folders_urls&task=library_files_folders_urls.edit&id=<?php echo $library_files_folders_urls_id; ?>&ref=libraries" title="<?php echo JText::_('COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS'); ?>" ><span class="icon-briefcase"></span></a> <a class="hasTooltip btn btn-mini" href="index.php?option=com_componentbuilder&view=libraries_files_folders_urls&task=library_files_folders_urls.edit&id=<?php echo $library_files_folders_urls_id; ?>&ref=libraries" title="<?php echo JText::_('COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS'); ?>" ><span class="icon-briefcase"></span></a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</td> </td>
<td class="hidden-phone"> <td class="hidden-phone">
<?php echo $this->escape($item->description); ?> <?php echo $this->escape($item->description); ?>

View File

@ -300,7 +300,7 @@ jQuery(document).ready(function(){
} }
}); });
}); });
<?php <?php
$app = JFactory::getApplication(); $app = JFactory::getApplication();
?> ?>
@ -316,8 +316,8 @@ function JRouter(link) {
} }
?> ?>
return url+link; return url+link;
} }
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -329,5 +329,5 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>

View File

@ -199,7 +199,7 @@ class ComponentbuilderViewLibrary extends JViewLegacy
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/library/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/library/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets // add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
@ -207,7 +207,7 @@ class ComponentbuilderViewLibrary extends JViewLegacy
// add Uikit v2 JavaScripts // add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
// add var key // add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');

View File

@ -234,37 +234,71 @@ jQuery('#adminForm').on('change', '#jform_authentication',function (e)
}); });
// #jform_authentication listeners for authentication_vvvvway function // #jform_protocol listeners for protocol_vvvvwaz function
jQuery('#jform_authentication').on('keyup',function()
{
var authentication_vvvvway = jQuery("#jform_authentication").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
});
jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var authentication_vvvvway = jQuery("#jform_authentication").val();
var protocol_vvvvway = jQuery("#jform_protocol").val();
vvvvway(authentication_vvvvway,protocol_vvvvway);
});
// #jform_protocol listeners for protocol_vvvvway function
jQuery('#jform_protocol').on('keyup',function() jQuery('#jform_protocol').on('keyup',function()
{ {
var authentication_vvvvway = jQuery("#jform_authentication").val(); var protocol_vvvvwaz = jQuery("#jform_protocol").val();
var protocol_vvvvway = jQuery("#jform_protocol").val(); var authentication_vvvvwaz = jQuery("#jform_authentication").val();
vvvvway(authentication_vvvvway,protocol_vvvvway); vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz);
}); });
jQuery('#adminForm').on('change', '#jform_protocol',function (e) jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{ {
e.preventDefault(); e.preventDefault();
var authentication_vvvvway = jQuery("#jform_authentication").val(); var protocol_vvvvwaz = jQuery("#jform_protocol").val();
var protocol_vvvvway = jQuery("#jform_protocol").val(); var authentication_vvvvwaz = jQuery("#jform_authentication").val();
vvvvway(authentication_vvvvway,protocol_vvvvway); vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz);
});
// #jform_authentication listeners for authentication_vvvvwaz function
jQuery('#jform_authentication').on('keyup',function()
{
var protocol_vvvvwaz = jQuery("#jform_protocol").val();
var authentication_vvvvwaz = jQuery("#jform_authentication").val();
vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz);
});
jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var protocol_vvvvwaz = jQuery("#jform_protocol").val();
var authentication_vvvvwaz = jQuery("#jform_authentication").val();
vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz);
});
// #jform_protocol listeners for protocol_vvvvwbb function
jQuery('#jform_protocol').on('keyup',function()
{
var protocol_vvvvwbb = jQuery("#jform_protocol").val();
var authentication_vvvvwbb = jQuery("#jform_authentication").val();
vvvvwbb(protocol_vvvvwbb,authentication_vvvvwbb);
});
jQuery('#adminForm').on('change', '#jform_protocol',function (e)
{
e.preventDefault();
var protocol_vvvvwbb = jQuery("#jform_protocol").val();
var authentication_vvvvwbb = jQuery("#jform_authentication").val();
vvvvwbb(protocol_vvvvwbb,authentication_vvvvwbb);
});
// #jform_authentication listeners for authentication_vvvvwbb function
jQuery('#jform_authentication').on('keyup',function()
{
var protocol_vvvvwbb = jQuery("#jform_protocol").val();
var authentication_vvvvwbb = jQuery("#jform_authentication").val();
vvvvwbb(protocol_vvvvwbb,authentication_vvvvwbb);
});
jQuery('#adminForm').on('change', '#jform_authentication',function (e)
{
e.preventDefault();
var protocol_vvvvwbb = jQuery("#jform_protocol").val();
var authentication_vvvvwbb = jQuery("#jform_authentication").val();
vvvvwbb(protocol_vvvvwbb,authentication_vvvvwbb);
}); });

View File

@ -64,7 +64,7 @@ class ComponentbuilderViewServer extends JViewLegacy
} }
// Get Linked view data // Get Linked view data
$this->wanlinked_components = $this->get('Wanlinked_components'); $this->wamlinked_components = $this->get('Wamlinked_components');
// Set the toolbar // Set the toolbar
$this->addToolBar(); $this->addToolBar();

View File

@ -382,7 +382,7 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) {
e.preventDefault(); e.preventDefault();
getSnippets(); getSnippets();
}); });
jQuery.fn.selText = function() { jQuery.fn.selText = function() {
var obj = this[0]; var obj = this[0];
if (jQuery.browser.msie) { if (jQuery.browser.msie) {
@ -400,7 +400,7 @@ jQuery.fn.selText = function() {
selection.setBaseAndExtent(obj, 0, obj, 1); selection.setBaseAndExtent(obj, 0, obj, 1);
} }
return this; return this;
} }
jQuery('#adminForm').on('change', '#jform_snippet',function (e) { jQuery('#adminForm').on('change', '#jform_snippet',function (e) {
e.preventDefault(); e.preventDefault();
@ -436,7 +436,7 @@ jQuery(document).ready(function() {
// some lang strings // some lang strings
var select_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_SELECT_A_SNIPPET'); ?>'; var select_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_SELECT_A_SNIPPET'); ?>';
var create_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_CREATE_A_SNIPPET'); ?>'; var create_a_snippet = '<?php echo JText::_('COM_COMPONENTBUILDER_CREATE_A_SNIPPET'); ?>';
// nice little dot trick :) // nice little dot trick :)
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var x=0; var x=0;
@ -448,5 +448,5 @@ jQuery(document).ready( function($) {
} }
$(".loading-dots").text(dots); $(".loading-dots").text(dots);
} , 500); } , 500);
}); });
</script> </script>

View File

@ -199,7 +199,7 @@ class ComponentbuilderViewSite_view extends JViewLegacy
$this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';");
$this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/site_view/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/site_view/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
// add the Uikit v2 style sheets // add the Uikit v2 style sheets
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
$this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
@ -207,7 +207,7 @@ class ComponentbuilderViewSite_view extends JViewLegacy
// add Uikit v2 JavaScripts // add Uikit v2 JavaScripts
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
$this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
// add var key // add var key
$this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
JText::script('view not acceptable. Error'); JText::script('view not acceptable. Error');

View File

@ -169,7 +169,7 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) {
e.preventDefault(); e.preventDefault();
getSnippets(); getSnippets();
}); });
jQuery.fn.selText = function() { jQuery.fn.selText = function() {
var obj = this[0]; var obj = this[0];
if (jQuery.browser.msie) { if (jQuery.browser.msie) {
@ -187,7 +187,7 @@ jQuery.fn.selText = function() {
selection.setBaseAndExtent(obj, 0, obj, 1); selection.setBaseAndExtent(obj, 0, obj, 1);
} }
return this; return this;
} }
jQuery('#adminForm').on('change', '#jform_snippet',function (e) { jQuery('#adminForm').on('change', '#jform_snippet',function (e) {
e.preventDefault(); e.preventDefault();

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>20th February, 2018</creationDate> <creationDate>27th February, 2018</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail> <authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://joomlacomponentbuilder.com</authorUrl> <authorUrl>http://joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright> <copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license> <license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.6.16</version> <version>2.6.17</version>
<description><![CDATA[ <description><![CDATA[
<h1>Component Builder (v.2.6.16)</h1> <h1>Component Builder (v.2.6.17)</h1>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. <p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -441,4 +441,21 @@
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl> <maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/> <targetplatform name="joomla" version="3.*"/>
</update> </update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.6.17</version>
<infourl title="Component Builder!">http://joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.17/JCB_v2.6.17.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates> </updates>

View File

@ -3398,7 +3398,7 @@ class com_componentbuilderInstallerScript
$server->type_title = 'Componentbuilder Server'; $server->type_title = 'Componentbuilder Server';
$server->type_alias = 'com_componentbuilder.server'; $server->type_alias = 'com_componentbuilder.server';
$server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","host":"host","port":"port","path":"path","secret":"secret","authentication":"authentication","signature":"signature","password":"password","not_required":"not_required","username":"username","private":"private"}}'; $server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","path":"path","port":"port","authentication":"authentication","password":"password","secret":"secret","host":"host","signature":"signature","username":"username","not_required":"not_required","private":"private","private_key":"private_key"}}';
$server->router = 'ComponentbuilderHelperRoute::getServerRoute'; $server->router = 'ComponentbuilderHelperRoute::getServerRoute';
$server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
@ -4080,7 +4080,7 @@ class com_componentbuilderInstallerScript
$server->type_title = 'Componentbuilder Server'; $server->type_title = 'Componentbuilder Server';
$server->type_alias = 'com_componentbuilder.server'; $server->type_alias = 'com_componentbuilder.server';
$server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","host":"host","port":"port","path":"path","secret":"secret","authentication":"authentication","signature":"signature","password":"password","not_required":"not_required","username":"username","private":"private"}}'; $server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","path":"path","port":"port","authentication":"authentication","password":"password","secret":"secret","host":"host","signature":"signature","username":"username","not_required":"not_required","private":"private","private_key":"private_key"}}';
$server->router = 'ComponentbuilderHelperRoute::getServerRoute'; $server->router = 'ComponentbuilderHelperRoute::getServerRoute';
$server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication","not_required"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
@ -4739,7 +4739,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://joomlacomponentbuilder.com" title="Component Builder"> echo '<a target="_blank" href="http://joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/> <img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a> </a>
<h3>Upgrade to Version 2.6.16 Was Successful! Let us know if anything is not working as expected.</h3>'; <h3>Upgrade to Version 2.6.17 Was Successful! Let us know if anything is not working as expected.</h3>';
} }
} }
} }

View File

@ -49,7 +49,116 @@ class ComponentbuilderControllerApi extends JControllerForm
parent::__construct($config); parent::__construct($config);
} }
public function handshake()
{
// get input values
$input = JFactory::getApplication()->input;
// get Trust
$PUBLIC = $input->post->get('VDM_PUBLIC', null, 'STRING');
$SECRET = $input->post->get('VDM_SECRET', null, 'STRING');
$ID = $input->post->get('VDM_ID', null, 'STRING');
// check if correct value is given
if (ComponentbuilderHelper::checkString($PUBLIC) && ComponentbuilderHelper::checkString($SECRET) && ComponentbuilderHelper::checkString($ID))
{
// use the JCB open public protocol to open this
$opened = ComponentbuilderHelper::openPublicProtocol($SECRET, $ID, $PUBLIC);
// simple check to have a little more hoops
if (ComponentbuilderHelper::checkString($opened['public']) && ComponentbuilderHelper::checkString($opened['id'])
&& strpos($opened['public'], '-----BEGIN PUBLIC KEY-----') !== false
&& strpos($opened['public'], '-----END PUBLIC KEY-----') !== false
&& strpos($opened['id'], 'VDM_') !== false
&& strpos($opened['id'], '_SP') !== false)
&& ComponentbuilderHelper::checkObject(ComponentbuilderHelper::crypt('RSA')))
{
array('public' => ComponentbuilderHelper::getPublicKey($opened['id'], $opened['public']), 'id' => $opened['id']), $opened['public']
ComponentbuilderHelper::crypt();
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
}
}
// die since have no trust
echo 12;
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
public function trust()
{
// get input values
$input = JFactory::getApplication()->input;
// get Trust
$TRUST = $input->post->get('VDM_TRUST', null, 'STRING');
// check if correct value is given
if (ComponentbuilderHelper::checkString($TRUST))
{
$key = ComponentbuilderHelper::salt(1, 2);
// get the trust
$trustArray = ComponentbuilderHelper::unlock($TRUST, $key, null);
// check the array
if (ComponentbuilderHelper::checkArray($trustArray)
&& isset($trustArray['request_id']) && is_numeric($trustArray['request_id'])
&& isset($trustArray['chain']) && ComponentbuilderHelper::checkArray($trustArray['chain'])
&& isset($trustArray['url']) && ComponentbuilderHelper::checkString($trustArray['url'])
&& isset($trustArray['path']) && ComponentbuilderHelper::checkString($trustArray['path'])
&& isset($trustArray['email']) && ComponentbuilderHelper::checkString($trustArray['email'])
&& isset($trustArray['name']) && ComponentbuilderHelper::checkString($trustArray['name'])
&& isset($trustArray['method']) && is_numeric($trustArray['method']) && $trustArray['method'] > 0)
{
// send the request
echo ComponentbuilderHelper::requestTrust($trustArray);
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
}
// die since have no trust
echo 12;
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
public function itrust()
{
// get input values
$input = JFactory::getApplication()->input;
// get allowed string
$allow = $input->get('allow', null, 'STRING');
// check if correct value is given
if (ComponentbuilderHelper::checkString($allow))
{
// get the request ID
$request_id = ComponentbuilderHelper::unlock($allow, null, 4);
// check the array
if (ComponentbuilderHelper::checkString($request_id)
&& strpos($request_id, 'VDM_') !== false
&& strpos($request_id, '_SP') !== false)
{
$request_id = str_replace(array('VDM_', '_SP'), '', $request_id);
$request_id = (string) 'VDM_' . preg_replace("/[^0-9]/", "", $request_id) . '_SP';
if ($id = ComponentbuilderHelper::getVar('trust_site', $request_id, 'request_id', 'id'))
{
if ($message = ComponentbuilderHelper::confirmTrust($id))
{
// push out the message
echo $message;
// clear session
JFactory::getApplication()->getSession()->destroy();
jexit();
}
}
}
}
// clear session
JFactory::getApplication()->getSession()->destroy();
// die since have no trust
jexit('Restricted access');
}
public function backup() public function backup()
{ {
// get params first // get params first
@ -209,7 +318,7 @@ class ComponentbuilderControllerApi extends JControllerForm
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error');
return; return;
} }
protected function getApiUser() protected function getApiUser()
{ {
// return user object // return user object

View File

@ -369,7 +369,7 @@ abstract class ComponentbuilderHelper
// load this for all // load this for all
jimport('joomla.application'); jimport('joomla.application');
} }
/** /**
* Remove folders with files * Remove folders with files
* *
@ -435,7 +435,7 @@ abstract class ComponentbuilderHelper
} }
return false; return false;
} }
/** /**
* The dynamic builder of views, tables and fields * The dynamic builder of views, tables and fields
**/ **/
@ -444,7 +444,7 @@ abstract class ComponentbuilderHelper
self::autoLoader('extrusion'); self::autoLoader('extrusion');
$extruder = new Extrusion($data); $extruder = new Extrusion($data);
} }
/** /**
* The zipper method * The zipper method
* *
@ -494,8 +494,8 @@ abstract class ComponentbuilderHelper
} }
return false; return false;
} }
/** /**
* Write a file to the server * Write a file to the server
* *
@ -527,7 +527,7 @@ abstract class ComponentbuilderHelper
} }
return $klaar; return $klaar;
} }
public static function getFieldOptions($value, $type, $settings = array()) public static function getFieldOptions($value, $type, $settings = array())
{ {
// Get a db connection. // Get a db connection.
@ -729,7 +729,7 @@ abstract class ComponentbuilderHelper
// noting for now // noting for now
return true; return true;
} }
/** /**
* the Butler * the Butler
**/ **/
@ -777,7 +777,7 @@ abstract class ComponentbuilderHelper
} }
return self::$localSession[$key]; return self::$localSession[$key];
} }
/** /**
* check if it is a new hash * check if it is a new hash
**/ **/
@ -801,7 +801,33 @@ abstract class ComponentbuilderHelper
} }
return false; return false;
} }
/**
* prepare base64 string for url
**/
public static function base64_urlencode($string, $encode = false)
{
if ($encode)
{
$string = base64_encode($string);
}
return str_replace(array('+', '/'), array('-', '_'), $string);
}
/**
* prepare base64 string form url
**/
public static function base64_urldecode($string, $decode = false)
{
$string = str_replace(array('-', '_'), array('+', '/'), $string);
if ($decode)
{
$string = base64_decode($string);
}
return $string;
}
/** /**
* Check if the url exist * Check if the url exist
* *
@ -843,8 +869,8 @@ abstract class ComponentbuilderHelper
} }
} }
return $exists; return $exists;
} }
/** /**
* Get the file path or url * Get the file path or url
* *
@ -914,8 +940,8 @@ abstract class ComponentbuilderHelper
// sanitize the path // sanitize the path
return '/' . trim( $filePath, '/' ) . '/' . $fileName; return '/' . trim( $filePath, '/' ) . '/' . $fileName;
} }
/** /**
* Get the file path or url * Get the file path or url
* *
@ -955,8 +981,8 @@ abstract class ComponentbuilderHelper
// sanitize the path // sanitize the path
return '/' . trim( $folderPath, '/' ) . '/'; return '/' . trim( $folderPath, '/' ) . '/';
} }
/** /**
* get the content of a file * get the content of a file
* *
@ -1008,17 +1034,28 @@ abstract class ComponentbuilderHelper
} }
return $none; return $none;
} }
/**
* Composer Switch
**/
protected static $composer = false;
/** /**
* Load the Composer Vendors * Load the Composer Vendors
**/ **/
public static function composerAutoload() public static function composerAutoload()
{ {
// load the autoloader // insure we load the composer vendors only once
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php'; if (!self::$composer)
} {
// load the autoloader
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php';
// do not load again
self::$composer = true;
}
}
/** /**
* Move File to Server * Move File to Server
* *
@ -1144,47 +1181,99 @@ abstract class ComponentbuilderHelper
} }
break; break;
case 2: // private key file case 2: // private key file
$rsa = new phpseclib\Crypt\RSA(); if (self::checkObject(self::crypt('RSA')))
// check if we have a passprase
if (self::checkString($server->secret))
{ {
$rsa->setPassword($server->secret); // check if we have a passprase
} if (self::checkString($server->secret))
// now load the key file {
if (!$rsa->loadKey(self::getFileContents($server->private, null))) self::crypt('RSA')->setPassword($server->secret);
{ }
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); // now load the key file
unset(self::$sftp[$server->cache]); if (!self::crypt('RSA')->loadKey(self::getFileContents($server->private, null)))
return false; {
} JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error');
// now login unset(self::$sftp[$server->cache]);
if (!self::$sftp[$server->cache]->login($server->username, $rsa)) return false;
{ }
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); // now login
unset(self::$sftp[$server->cache]); if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA')))
return false; {
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
} }
break; break;
case 3: // both password and private key file case 3: // both password and private key file
$rsa = new phpseclib\Crypt\RSA(); if (self::checkObject(self::crypt('RSA')))
// check if we have a passphrase
if (self::checkString($server->secret))
{ {
$rsa->setPassword($server->secret); // check if we have a passphrase
if (self::checkString($server->secret))
{
self::crypt('RSA')->setPassword($server->secret);
}
// now load the key file
if (!self::crypt('RSA')->loadKey(self::getFileContents($server->private, null)))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
// now login
if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA')))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
} }
// now load the key file break;
if (!$rsa->loadKey(self::getFileContents($server->private, null))) case 4: // private key field
if (self::checkObject(self::crypt('RSA')))
{ {
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); // check if we have a passprase
unset(self::$sftp[$server->cache]); if (self::checkString($server->secret))
return false; {
self::crypt('RSA')->setPassword($server->secret);
}
// now load the key field
if (!self::crypt('RSA')->loadKey($server->private_key))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
// now login
if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA')))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
} }
// now login break;
if (!self::$sftp[$server->cache]->login($server->username, $server->password, $rsa)) case 5: // both password and private key field
if (self::checkObject(self::crypt('RSA')))
{ {
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); // check if we have a passphrase
unset(self::$sftp[$server->cache]); if (self::checkString($server->secret))
return false; {
self::crypt('RSA')->setPassword($server->secret);
}
// now load the key file
if (!self::crypt('RSA')->loadKey($server->private_key))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
// now login
if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA')))
{
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error');
unset(self::$sftp[$server->cache]);
return false;
}
} }
break; break;
} }
@ -1328,9 +1417,9 @@ abstract class ComponentbuilderHelper
if (2 == $protocol) if (2 == $protocol)
{ {
// SFTP // SFTP
$query->select($db->quoteName(array('name','authentication','username','host','password','path','port','private','secret'))); $query->select($db->quoteName(array('name','authentication','username','host','password','path','port','private','private_key','secret')));
// cache builder // cache builder
$cache = array('authentication','username','host','password','port','private','secret'); $cache = array('authentication','username','host','password','port','private','private_key','secret');
} }
else else
{ {
@ -1348,7 +1437,7 @@ abstract class ComponentbuilderHelper
{ {
$server = $db->loadObject(); $server = $db->loadObject();
// Get the basic encryption. // Get the basic encryption.
$basickey = self::getCryptKey('basic'); $basickey = self::getCryptKey('basic', 'Th1sMnsTbL0ck@d');
// Get the encryption object. // Get the encryption object.
$basic = new FOFEncryptAes($basickey, 128); $basic = new FOFEncryptAes($basickey, 128);
// start cache keys // start cache keys
@ -1386,7 +1475,6 @@ abstract class ComponentbuilderHelper
JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error'); JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error');
return false; return false;
} }
public static function jsonToString($value, $sperator = ", ", $table = null) public static function jsonToString($value, $sperator = ", ", $table = null)
{ {
@ -1559,23 +1647,43 @@ abstract class ComponentbuilderHelper
/** /**
* Get any component's model * Get any component's model
**/ **/
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = 'componentbuilder') public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = 'Componentbuilder', $config = array())
{ {
// fix the name
$name = self::safeString($name);
// full path // full path
$fullPath = $path . '/models'; $fullPath = $path . '/models';
// set prefix
$prefix = $component.'Model';
// load the model file // load the model file
JModelLegacy::addIncludePath($fullPath); JModelLegacy::addIncludePath($fullPath, $prefix);
// get instance // get instance
$model = JModelLegacy::getInstance( $name, $component.'Model' ); $model = JModelLegacy::getInstance($name, $prefix, $config);
// if model not found // if model not found (strange)
if ($model == false) if ($model == false)
{ {
require_once $fullPath.'/'.strtolower($name).'.php'; jimport('joomla.filesystem.file');
// build class name // get file path
$class = $prefix.$name; $filePath = $path.'/'.$name.'.php';
// initialize the model $fullPath = $fullPath.'/'.$name.'.php';
new $class(); // check if it exists
$model = JModelLegacy::getInstance($name, $prefix); if (JFile::exists($filePath))
{
// get the file
require_once $filePath;
}
elseif (JFile::exists($fullPath))
{
// get the file
require_once $fullPath;
}
// build class names
$modelClass = $prefix.$name;
if (class_exists($modelClass))
{
// initialize the model
return new $modelClass($config);
}
} }
return $model; return $model;
} }

View File

@ -46,6 +46,7 @@ COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your details are correct!" COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your details are correct!"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: <code>%s</code>" COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: <code>%s</code>"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s" COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER="The private key field could not be loaded for <b>%s</b> server!"
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!" COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!"
COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED="The server details for <b>(ID: %s)</b> could not be retrieved!" COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED="The server details for <b>(ID: %s)</b> could not be retrieved!"
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key." COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."