diff --git a/README.md b/README.md index 77975c248..9994258e8 100644 --- a/README.md +++ b/README.md @@ -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! -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) @@ -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) + *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *First Build*: 30th April, 2015 -+ *Last Build*: 20th February, 2018 -+ *Version*: 2.6.16 ++ *Last Build*: 27th February, 2018 ++ *Version*: 2.6.17 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **182404** -+ *Field count*: **1639** -+ *File count*: **1168** ++ *Line count*: **183098** ++ *Field count*: **1641** ++ *File count*: **1169** + *Folder count*: **188** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 77975c248..9994258e8 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -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! -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) @@ -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) + *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *First Build*: 30th April, 2015 -+ *Last Build*: 20th February, 2018 -+ *Version*: 2.6.16 ++ *Last Build*: 27th February, 2018 ++ *Version*: 2.6.17 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **182404** -+ *Field count*: **1639** -+ *File count*: **1168** ++ *Line count*: **183098** ++ *Field count*: **1641** ++ *File count*: **1169** + *Folder count*: **188** > This **component** was build with a Joomla [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index b7410f773..ac0351cad 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -463,20 +463,43 @@ abstract class ###Component###Helper /** * 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 - JModelLegacy::addIncludePath( $path . '/models' ); + JModelLegacy::addIncludePath($fullPath, $prefix); // get instance - $model = JModelLegacy::getInstance( $name, $component.'Model' ); - // if model not found + $model = JModelLegacy::getInstance($name, $prefix, $config); + // if model not found (strange) if ($model == false) { - // build class name - $class = $prefix.$name; - // initilize the model - new $class(); - $model = JModelLegacy::getInstance($name, $prefix); + jimport('joomla.filesystem.file'); + // get file path + $filePath = $path.'/'.$name.'.php'; + $fullPath = $fullPath.'/'.$name.'.php'; + // 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; } diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index 7be66c600..0ba4442b0 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -134,23 +134,43 @@ abstract class ###Component###Helper /** * 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 $fullPath = $path . '/models'; + // set prefix + $prefix = $component.'Model'; // load the model file - JModelLegacy::addIncludePath($fullPath); + JModelLegacy::addIncludePath($fullPath, $prefix); // get instance - $model = JModelLegacy::getInstance( $name, $component.'Model' ); - // if model not found + $model = JModelLegacy::getInstance($name, $prefix, $config); + // if model not found (strange) if ($model == false) { - require_once $fullPath.'/'.strtolower($name).'.php'; - // build class name - $class = $prefix.$name; - // initialize the model - new $class(); - $model = JModelLegacy::getInstance($name, $prefix); + jimport('joomla.filesystem.file'); + // get file path + $filePath = $path.'/'.$name.'.php'; + $fullPath = $fullPath.'/'.$name.'.php'; + // 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; } diff --git a/admin/controllers/joomla_component.php b/admin/controllers/joomla_component.php index b60cf1a71..557987b77 100644 --- a/admin/controllers/joomla_component.php +++ b/admin/controllers/joomla_component.php @@ -331,23 +331,24 @@ class ComponentbuilderControllerJoomla_component extends JControllerForm $oldID = $this->input->get('id', 0, 'INT'); // linked tables to update $_tablesArray = array( - 'component_admin_views', - 'component_site_views', - 'component_custom_admin_views', - 'component_updates', - 'component_mysql_tweaks', - 'component_custom_admin_menus', - 'component_config', - 'component_dashboard', - 'component_files_folders' + 'component_admin_views' => 'joomla_component', + 'component_site_views' => 'joomla_component', + 'component_custom_admin_views' => 'joomla_component', + 'component_updates' => 'joomla_component', + 'component_mysql_tweaks' => 'joomla_component', + 'component_custom_admin_menus' => 'joomla_component', + 'component_config' => 'joomla_component', + 'component_dashboard' => 'joomla_component', + 'component_files_folders' => 'joomla_component', + 'custom_code' => 'component' ); - foreach($_tablesArray as $_updateTable) + foreach($_tablesArray as $_updateTable => $_key) { // 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 - ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array('joomla_component' => $newID)); + ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array($_key => $newID)); } } } diff --git a/admin/controllers/joomla_components.php b/admin/controllers/joomla_components.php index 98ab69a6d..02810a3cf 100644 --- a/admin/controllers/joomla_components.php +++ b/admin/controllers/joomla_components.php @@ -239,7 +239,7 @@ class ComponentbuilderControllerJoomla_components extends JControllerAdmin $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } - + public function backup() { // 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'); return; } - + protected function getApiUser() { // admin area does not have API user, only front-end (so we fallback on login user) diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 591fe1b04..6254b8058 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -699,5 +699,4 @@ class Compiler extends Infusion // any help to improve this is welcome... } - } diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 49676de49..35de9b301 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -5144,8 +5144,8 @@ class Get else { return array( - 'start' => "\t\t\t", - 'end' => "\t\t\t"); + 'start' => "", + 'end' => ""); } break; case 12: @@ -5159,8 +5159,8 @@ class Get else { return array( - 'start' => "\t\t\t", - 'end' => "\t\t\t"); + 'start' => "", + 'end' => ""); } break; case 21: @@ -5174,8 +5174,8 @@ class Get else { return array( - 'start' => "\t\t\t", - 'end' => "\t\t\t"); + 'start' => "", + 'end' => ""); } break; case 22: @@ -5189,14 +5189,14 @@ class Get else { return array( - 'start' => "\t\t\t", - 'end' => "\t\t\t"); + 'start' => "", + 'end' => " "); } break; case 3: return array( - 'start' => "\t\t\t", - 'end' => "\t\t\t"); + 'start' => "", + 'end' => ""); break; } return false; diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 255592109..72e7e09b2 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -89,6 +89,13 @@ class Fields extends Structure */ public $doNotEscape = array(); + /** + * list of classes used in the list view for the fields + * + * @var array + */ + public $listFieldClass = array(); + /** * tags builder * @@ -1681,6 +1688,12 @@ class Fields extends Structure // do some nice twigs beyond the default 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 $escaped = ComponentbuilderHelper::getBetween($field['settings']->xml, 'escape="', '"'); if (ComponentbuilderHelper::checkString($escaped)) diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 616b54fd2..f6e11d16c 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -4996,8 +4996,6 @@ class Interpretation extends Fields $batchmove[] = "\t\t\t\$this->user = JFactory::getUser();"; $batchmove[] = "\t\t\t\$this->table = \$this->getTable();"; $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}"; @@ -5062,7 +5060,7 @@ class Interpretation extends Fields $batchmove[] = "\t\t\t{"; $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[] = 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->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\telse"; $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->table = \$this->getTable();"; $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}"; 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//" . $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\t{"; $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."; 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 { - $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[] = PHP_EOL . "\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[] = PHP_EOL . "\t\t\t\tcontinue;"; - $batchcopy[] = PHP_EOL . "\t\t\t}"; + $batchcopy[] = "\t\t\t{"; + $batchcopy[] = "\t\t\t\t//" . $this->setLine(__LINE__) . " Not fatal error"; + $batchcopy[] = "\t\t\t\t\$this->setError(JText:".":sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', \$pk));"; + $batchcopy[] = "\t\t\t\tcontinue;"; + $batchcopy[] = "\t\t\t}"; $batchcopy[] = PHP_EOL . "\t\t\t//" . $this->setLine(__LINE__) . " Check that the row actually exists"; $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->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\telse"; $batchcopy[] = "\t\t\t\t{"; @@ -5309,11 +5305,15 @@ class Interpretation extends Fields } 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) { - $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"; @@ -6164,7 +6164,7 @@ class Interpretation extends Fields { $otherViews = $this->catCodeBuilder[$viewName_single]['views']; // category and linked - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; $body .= PHP_EOL . "\t\t\t\t" . 'escape($item->category_title); ?>'; $body .= PHP_EOL . "\t\t\t"; @@ -6176,7 +6176,7 @@ class Interpretation extends Fields { // user and linked $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; $body .= PHP_EOL . "\t\t\t"; @@ -6212,7 +6212,7 @@ class Interpretation extends Fields { // user and linked $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; $body .= PHP_EOL . "\t\t\t"; @@ -6261,7 +6261,7 @@ class Interpretation extends Fields if ($add) { // set as linked - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\t"; $body .= PHP_EOL . "\t\t\t\t" . '
' . PHP_EOL . "\t\t\t\t\t" . '' . $itemCode . ''; if ($checkoutTriger) @@ -6283,7 +6283,7 @@ class Interpretation extends Fields { if ($item['type'] === 'category') { - $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\tsetListFieldClass($item['code'], $viewName_list, 'hidden-phone')."\">"; $body .= PHP_EOL . "\t\t\tescape(\$item->category_title); ?>"; $body .= PHP_EOL . "\t\t"; } @@ -6291,7 +6291,7 @@ class Interpretation extends Fields { // custom user and linked $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tuser->authorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; $body .= PHP_EOL . "\t\t\t"; @@ -6303,14 +6303,14 @@ class Interpretation extends Fields { // user name only $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tname; ?>"; $body .= PHP_EOL . "\t\t"; } else { // normal not linked - $body .= PHP_EOL . "\t\t"; + $body .= PHP_EOL . "\t\tsetListFieldClass($item['code'], $viewName_list, 'hidden-phone')."\">"; $body .= PHP_EOL . "\t\t\t" . $itemCode; $body .= PHP_EOL . "\t\t"; } @@ -6345,7 +6345,7 @@ class Interpretation extends Fields } if (!isset($this->fieldsNames[$viewName_single]['id'])) { - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tid; ?>"; $body .= PHP_EOL . "\t\t"; } @@ -6357,6 +6357,11 @@ class Interpretation extends Fields 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) { 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']; // category and linked - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_" . $this->fileContentStatic['###component###'] . "." . $otherViews . ".category.' . (int)\$item->" . $item['code'] . ")): ?>"; $body .= PHP_EOL . "\t\t\t\t" . 'escape($item->category_title); ?>'; $body .= PHP_EOL . "\t\t\t"; @@ -7336,7 +7341,7 @@ class Interpretation extends Fields { // user and linked $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; $body .= PHP_EOL . "\t\t\t"; @@ -7385,7 +7390,7 @@ class Interpretation extends Fields { // user and linked $body .= PHP_EOL . "\t\t" . $item['id'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tauthorise('core.edit', 'com_users')): ?>"; $body .= PHP_EOL . "\t\t\t\t" . 'name; ?>'; $body .= PHP_EOL . "\t\t\t"; @@ -7433,7 +7438,7 @@ class Interpretation extends Fields if ($add) { // set as linked - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\t"; $body .= PHP_EOL . "\t\t\t\t" . '' . $itemCode . ''; if ($checkoutTriger) @@ -7474,7 +7479,7 @@ class Interpretation extends Fields { // user name only $body .= PHP_EOL . "\t\t" . $item['code'] . "); ?>"; - $body .= PHP_EOL . "\t\t" . ''; + $body .= PHP_EOL . "\t\t" . ''; $body .= PHP_EOL . "\t\t\tname; ?>"; $body .= PHP_EOL . "\t\t"; } @@ -14404,7 +14409,7 @@ function vdm_dkim() { $this->componentGlobal[$sortKey] = "\t\t" . ''; // 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) $this->assetsRules[] = '"site.' . $siteCode . '.access":{"1":1}'; diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 0674a8926..8a9e2feff 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -157,7 +157,7 @@ abstract class ComponentbuilderHelper } return $object; } - + public static function getDynamicScripts($type, $fieldName = false) { // if field name is passed the convert to type @@ -876,7 +876,7 @@ abstract class ComponentbuilderHelper } return false; } - + /** * Run Global Updater if any are set * @@ -1303,7 +1303,7 @@ abstract class ComponentbuilderHelper // load this for all jimport('joomla.application'); } - + /** * Remove folders with files * @@ -1369,7 +1369,7 @@ abstract class ComponentbuilderHelper } return false; } - + /** * The dynamic builder of views, tables and fields **/ @@ -1378,7 +1378,7 @@ abstract class ComponentbuilderHelper self::autoLoader('extrusion'); $extruder = new Extrusion($data); } - + /** * The zipper method * @@ -1428,8 +1428,8 @@ abstract class ComponentbuilderHelper } return false; } - - + + /** * Write a file to the server * @@ -1461,7 +1461,7 @@ abstract class ComponentbuilderHelper } return $klaar; } - + public static function getFieldOptions($value, $type, $settings = array()) { // Get a db connection. @@ -1663,7 +1663,7 @@ abstract class ComponentbuilderHelper // noting for now return true; } - + /** * the Butler **/ @@ -1711,7 +1711,7 @@ abstract class ComponentbuilderHelper } return self::$localSession[$key]; } - + /** * check if it is a new hash **/ @@ -1735,7 +1735,33 @@ abstract class ComponentbuilderHelper } 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 * @@ -1777,8 +1803,8 @@ abstract class ComponentbuilderHelper } } return $exists; - } - + } + /** * Get the file path or url * @@ -1848,8 +1874,8 @@ abstract class ComponentbuilderHelper // sanitize the path return '/' . trim( $filePath, '/' ) . '/' . $fileName; } - - + + /** * Get the file path or url * @@ -1889,8 +1915,8 @@ abstract class ComponentbuilderHelper // sanitize the path return '/' . trim( $folderPath, '/' ) . '/'; } - - + + /** * get the content of a file * @@ -1942,17 +1968,28 @@ abstract class ComponentbuilderHelper } return $none; } - - + + + /** + * Composer Switch + **/ + protected static $composer = false; + /** * Load the Composer Vendors **/ public static function composerAutoload() { - // load the autoloader - require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php'; - } - + // insure we load the composer vendors only once + 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 * @@ -2078,47 +2115,99 @@ abstract class ComponentbuilderHelper } break; case 2: // private key file - $rsa = new phpseclib\Crypt\RSA(); - // check if we have a passprase - if (self::checkString($server->secret)) + if (self::checkObject(self::crypt('RSA'))) { - $rsa->setPassword($server->secret); - } - // now load the key file - if (!$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, $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; + // check if we have a passprase + 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, 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; case 3: // both password and private key file - $rsa = new phpseclib\Crypt\RSA(); - // check if we have a passphrase - if (self::checkString($server->secret)) + if (self::checkObject(self::crypt('RSA'))) { - $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 - if (!$rsa->loadKey(self::getFileContents($server->private, null))) + break; + 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'); - unset(self::$sftp[$server->cache]); - return false; + // check if we have a passprase + if (self::checkString($server->secret)) + { + 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 - if (!self::$sftp[$server->cache]->login($server->username, $server->password, $rsa)) + break; + 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'); - unset(self::$sftp[$server->cache]); - return false; + // 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($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; } @@ -2262,9 +2351,9 @@ abstract class ComponentbuilderHelper if (2 == $protocol) { // 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 = array('authentication','username','host','password','port','private','secret'); + $cache = array('authentication','username','host','password','port','private','private_key','secret'); } else { @@ -2282,7 +2371,7 @@ abstract class ComponentbuilderHelper { $server = $db->loadObject(); // Get the basic encryption. - $basickey = self::getCryptKey('basic'); + $basickey = self::getCryptKey('basic', 'Th1sMnsTbL0ck@d'); // Get the encryption object. $basic = new FOFEncryptAes($basickey, 128); // 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'); return false; } - /** * Load the Component xml manifest. **/ @@ -3178,20 +3266,43 @@ abstract class ComponentbuilderHelper /** * 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 - JModelLegacy::addIncludePath( $path . '/models' ); + JModelLegacy::addIncludePath($fullPath, $prefix); // get instance - $model = JModelLegacy::getInstance( $name, $component.'Model' ); - // if model not found + $model = JModelLegacy::getInstance($name, $prefix, $config); + // if model not found (strange) if ($model == false) { - // build class name - $class = $prefix.$name; - // initilize the model - new $class(); - $model = JModelLegacy::getInstance($name, $prefix); + jimport('joomla.filesystem.file'); + // get file path + $filePath = $path.'/'.$name.'.php'; + $fullPath = $fullPath.'/'.$name.'.php'; + // 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; } diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 304fd6978..3a9c848e9 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -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_DESCRIPTION="Select the authentication type to use with SFTP." 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_LABEL="Created By" 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_DESCRIPTION="Set the path to the private key." 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
(basic encryption)" +COM_COMPONENTBUILDER_SERVER_PRIVATE_KEY_TEXT_FIELD="Private Key - Text Field" COM_COMPONENTBUILDER_SERVER_PRIVATE_LABEL="Private Key Path
(basic encryption)" COM_COMPONENTBUILDER_SERVER_PRIVATE_MESSAGE="Error! Please add private key path." 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_PACKAGE_KEY_IS_CODESCODE="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 %s server!" COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for %s server!" 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 names of either or the snippet, library or snippet types 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 keep to the community naming 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." diff --git a/admin/layouts/server/details_right.php b/admin/layouts/server/details_right.php index 5ee444150..949e46120 100644 --- a/admin/layouts/server/details_right.php +++ b/admin/layouts/server/details_right.php @@ -33,6 +33,7 @@ $fields = $displayData->get('fields') ?: array( 'authentication', 'password', 'private', + 'private_key', 'secret' ); diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index 65ab05ca8..2e873c70e 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->wanlinked_components; +$items = $displayData->wamlinked_components; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; diff --git a/admin/models/admin_fields.php b/admin/models/admin_fields.php index efd71c8b2..f99da5933 100644 --- a/admin/models/admin_fields.php +++ b/admin/models/admin_fields.php @@ -546,8 +546,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('admin_fields'); } @@ -572,7 +570,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -582,17 +579,11 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('admin_fields.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -602,7 +593,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -695,8 +689,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('admin_fields'); } @@ -720,7 +712,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin if (!$this->user->authorise('admin_fields.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -731,7 +722,6 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/admin_fields_conditions.php b/admin/models/admin_fields_conditions.php index d314952a3..fe295d473 100644 --- a/admin/models/admin_fields_conditions.php +++ b/admin/models/admin_fields_conditions.php @@ -546,8 +546,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); } @@ -572,7 +570,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -582,17 +579,11 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -602,7 +593,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -695,8 +689,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); } @@ -720,7 +712,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin if (!$this->user->authorise('admin_fields_conditions.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -731,7 +722,6 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/admin_view.php b/admin/models/admin_view.php index c813d44f1..2068277b8 100644 --- a/admin/models/admin_view.php +++ b/admin/models/admin_view.php @@ -352,7 +352,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->php_import_ext = base64_decode($item->php_import_ext); } - + if (empty($item->id)) { $id = 0; @@ -371,7 +371,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $this->vastDevMod = ComponentbuilderHelper::randomkey(50); ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id); ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod); - } + } // update the fields $objectUpdate = new stdClass(); @@ -908,8 +908,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('admin_view'); } @@ -934,7 +932,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -944,17 +941,11 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('admin_view.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -964,7 +955,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -1029,7 +1019,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin // Add the new ID to the array $newIds[$pk] = $newId; } - + if (ComponentbuilderHelper::checkArray($newIds)) { foreach($newIds as $oldID => $newID) @@ -1048,7 +1038,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin } } } - + // Clean the cache $this->cleanCache(); @@ -1075,8 +1065,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('admin_view'); } @@ -1100,7 +1088,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin if (!$this->user->authorise('admin_view.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -1111,7 +1098,6 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -1192,6 +1178,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $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. if (isset($data['addtables']) && is_array($data['addtables'])) { diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 0c5f6afb5..39d61c045 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -44,7 +44,7 @@ class ComponentbuilderModelAjax extends JModelList } // Used in joomla_component - + /** * Check and if a vdm notice is new (per/user) **/ @@ -91,7 +91,7 @@ class ComponentbuilderModelAjax extends JModelList return true; } return false; - } + } /** * get the component details (html) **/ @@ -177,7 +177,7 @@ class ComponentbuilderModelAjax extends JModelList } // Used in admin_view - + protected $viewid = array(); protected function getViewID($call = 'table') @@ -209,7 +209,7 @@ class ComponentbuilderModelAjax extends JModelList } return false; } - + protected $buttonArray = array( 'library_config' => 'libraries_config', 'library_files_folders_urls' => 'libraries_files_folders_urls', @@ -226,7 +226,7 @@ class ComponentbuilderModelAjax extends JModelList 'component_dashboard' => 'components_dashboard', 'component_files_folders' => 'components_files_folders', 'language' => true); - + public function getButton($type) { if (isset($this->buttonArray[$type])) @@ -262,8 +262,8 @@ class ComponentbuilderModelAjax extends JModelList return ''; } return false; - } - + } + public function getButtonID($type, $size) { if (isset($this->buttonArray[$type])) @@ -331,7 +331,7 @@ class ComponentbuilderModelAjax extends JModelList } } return ''; - } + } public static function getDynamicScripts($type) { @@ -446,7 +446,7 @@ class ComponentbuilderModelAjax extends JModelList return ComponentbuilderHelper::safeString($keys[1], 'Ww'); } - + protected function getSubformTable($idName, $data) { // make sure we convert the json to array @@ -553,7 +553,7 @@ class ComponentbuilderModelAjax extends JModelList { $rows[$nr] .= ''.$value.''; } - } + } protected $ref; protected $fieldsArray = array( @@ -1840,7 +1840,7 @@ class ComponentbuilderModelAjax extends JModelList } return false; } - + /** * Get the keys of the values to search custom code in * @@ -1977,7 +1977,7 @@ class ComponentbuilderModelAjax extends JModelList return $targets[$target]; } return false; - } + } // Used in field public function getFieldOptions($id) @@ -1991,7 +1991,7 @@ class ComponentbuilderModelAjax extends JModelList } // Used in get_snippets - + public function getSnippets($libraries) { if (ComponentbuilderHelper::checkJson($libraries)) @@ -2074,7 +2074,7 @@ class ComponentbuilderModelAjax extends JModelList } } return false; - } + } public function getSnippetDetails($id) { // Get a db connection. diff --git a/admin/models/component_admin_views.php b/admin/models/component_admin_views.php index 932362916..c6a64412a 100644 --- a/admin/models/component_admin_views.php +++ b/admin/models/component_admin_views.php @@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_admin_views'); } @@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_admin_views'); } @@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/component_config.php b/admin/models/component_config.php index 259ed3452..36403d80f 100644 --- a/admin/models/component_config.php +++ b/admin/models/component_config.php @@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_config'); } @@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_config extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_config.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_config'); } @@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin if (!$this->user->authorise('component_config.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_config extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/component_custom_admin_menus.php b/admin/models/component_custom_admin_menus.php index 84e2e0d82..6edc57e37 100644 --- a/admin/models/component_custom_admin_menus.php +++ b/admin/models/component_custom_admin_menus.php @@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus'); } @@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('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])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/component_custom_admin_views.php b/admin/models/component_custom_admin_views.php index fe2394f94..0bc1c6f87 100644 --- a/admin/models/component_custom_admin_views.php +++ b/admin/models/component_custom_admin_views.php @@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views'); } @@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('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])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/component_dashboard.php b/admin/models/component_dashboard.php index 3aa7c2822..910e986b6 100644 --- a/admin/models/component_dashboard.php +++ b/admin/models/component_dashboard.php @@ -563,8 +563,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_dashboard'); } @@ -589,7 +587,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -599,17 +596,11 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -619,7 +610,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -712,8 +706,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_dashboard'); } @@ -737,7 +729,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -748,7 +739,6 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/component_files_folders.php b/admin/models/component_files_folders.php index 3ae44e163..fc73d1254 100644 --- a/admin/models/component_files_folders.php +++ b/admin/models/component_files_folders.php @@ -582,8 +582,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_files_folders'); } @@ -608,7 +606,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -618,17 +615,11 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -638,7 +629,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -731,8 +725,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_files_folders'); } @@ -756,7 +748,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -767,7 +758,6 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/component_mysql_tweaks.php b/admin/models/component_mysql_tweaks.php index e675b25a1..5d5d00a45 100644 --- a/admin/models/component_mysql_tweaks.php +++ b/admin/models/component_mysql_tweaks.php @@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks'); } @@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks'); } @@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/component_site_views.php b/admin/models/component_site_views.php index 5533be612..60d4acd63 100644 --- a/admin/models/component_site_views.php +++ b/admin/models/component_site_views.php @@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_site_views'); } @@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_site_views.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_site_views'); } @@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin if (!$this->user->authorise('component_site_views.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/component_updates.php b/admin/models/component_updates.php index b084c7541..104ba9ed7 100644 --- a/admin/models/component_updates.php +++ b/admin/models/component_updates.php @@ -557,8 +557,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_updates'); } @@ -583,7 +581,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -593,17 +590,11 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('component_updates.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -613,7 +604,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -706,8 +700,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('component_updates'); } @@ -731,7 +723,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin if (!$this->user->authorise('component_updates.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -742,7 +733,6 @@ class ComponentbuilderModelComponent_updates extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index 8c307c3a2..f87531edd 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -336,7 +336,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList return $icons; } - + public function getGithub() { // load jquery (not sure why... but else the timeago breaks) @@ -428,8 +428,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList 'closedissues' => $create.'
'.JText::_('COM_COMPONENTBUILDER_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING').'..
'.$moreclosed, 'tagreleases' => '
'.JText::_('COM_COMPONENTBUILDER_LAST_FEW_RELEASES_FROM_GITHUB_IS_LOADING').'..
'.$viewissues ); - } - + } + public function getWiki() { $document = JFactory::getDocument(); @@ -448,8 +448,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList return '
'.JText::_('COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING').'..
'; } - - + + public function getNoticeboard() { // get the document to load the scripts @@ -521,8 +521,8 @@ class ComponentbuilderModelComponentbuilder extends JModelList });'); return '
'.JText::_('COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING').'..
'; - } - + } + public function getReadme() { $document = JFactory::getDocument(); @@ -539,5 +539,5 @@ class ComponentbuilderModelComponentbuilder extends JModelList });'); return '
'.JText::_('COM_COMPONENTBUILDER_THE_README_IS_LOADING').'..
'; - } + } } diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php index ee5abd489..f955f7eb6 100644 --- a/admin/models/custom_admin_view.php +++ b/admin/models/custom_admin_view.php @@ -204,7 +204,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->php_model = base64_decode($item->php_model); } - + if (empty($item->id)) { $id = 0; @@ -223,7 +223,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $this->vastDevMod = ComponentbuilderHelper::randomkey(50); ComponentbuilderHelper::set($this->vastDevMod, 'custom_admin_view__'.$id); ComponentbuilderHelper::set('custom_admin_view__'.$id, $this->vastDevMod); - } + } // check what type of custom_button array we have here (should be subform... but just incase) // This could happen due to huge data sets @@ -703,8 +703,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('custom_admin_view'); } @@ -729,7 +727,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -739,17 +736,11 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('core.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -759,7 +750,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -852,8 +846,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('custom_admin_view'); } @@ -877,7 +869,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin if (!$this->user->authorise('core.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -888,7 +879,6 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/custom_code.php b/admin/models/custom_code.php index be0a2da74..e8b329707 100644 --- a/admin/models/custom_code.php +++ b/admin/models/custom_code.php @@ -560,8 +560,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('custom_code'); } @@ -586,7 +584,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -596,17 +593,11 @@ class ComponentbuilderModelCustom_code extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('custom_code.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -616,7 +607,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -709,8 +703,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('custom_code'); } @@ -734,7 +726,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin if (!$this->user->authorise('custom_code.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -745,7 +736,6 @@ class ComponentbuilderModelCustom_code extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/dynamic_get.php b/admin/models/dynamic_get.php index 8f12844c7..5adcf74ec 100644 --- a/admin/models/dynamic_get.php +++ b/admin/models/dynamic_get.php @@ -196,7 +196,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $item->php_calculation = base64_decode($item->php_calculation); } - + if (empty($item->id)) { $id = 0; @@ -215,7 +215,7 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $this->vastDevMod = ComponentbuilderHelper::randomkey(50); ComponentbuilderHelper::set($this->vastDevMod, 'dynamic_get__'.$id); ComponentbuilderHelper::set('dynamic_get__'.$id, $this->vastDevMod); - } + } // update the fields $objectUpdate = new stdClass(); @@ -710,8 +710,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('dynamic_get'); } @@ -736,7 +734,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -746,17 +743,11 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('dynamic_get.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -766,7 +757,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -859,8 +853,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('dynamic_get'); } @@ -884,7 +876,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin if (!$this->user->authorise('dynamic_get.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -895,7 +886,6 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/field.php b/admin/models/field.php index ea38efb14..1c7a1153e 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -130,7 +130,7 @@ class ComponentbuilderModelField extends JModelAdmin $item->javascript_views_footer = base64_decode($item->javascript_views_footer); } - + if (empty($item->id)) { $id = 0; @@ -149,7 +149,7 @@ class ComponentbuilderModelField extends JModelAdmin $this->vastDevMod = ComponentbuilderHelper::randomkey(50); ComponentbuilderHelper::set($this->vastDevMod, 'field__'.$id); ComponentbuilderHelper::set('field__'.$id, $this->vastDevMod); - } + } if (!empty($item->id)) { @@ -608,8 +608,6 @@ class ComponentbuilderModelField extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('field'); } @@ -649,7 +647,6 @@ class ComponentbuilderModelField extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -659,17 +656,11 @@ class ComponentbuilderModelField extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('field.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -679,7 +670,6 @@ class ComponentbuilderModelField extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -770,8 +760,6 @@ class ComponentbuilderModelField extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('field'); } @@ -811,7 +799,6 @@ class ComponentbuilderModelField extends JModelAdmin if (!$this->user->authorise('field.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -822,7 +809,6 @@ class ComponentbuilderModelField extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index 7b380ef57..9835abd82 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -791,8 +791,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('fieldtype'); } @@ -832,7 +830,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -842,17 +839,11 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('fieldtype.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -862,7 +853,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -953,8 +943,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('fieldtype'); } @@ -994,7 +982,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin if (!$this->user->authorise('fieldtype.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -1005,7 +992,6 @@ class ComponentbuilderModelFieldtype extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/forms/admin_view.js b/admin/models/forms/admin_view.js index 990e7eb70..db75962cd 100644 --- a/admin/models/forms/admin_view.js +++ b/admin/models/forms/admin_view.js @@ -1240,7 +1240,7 @@ function getAjaxDisplay_server(type){ function addData(result,where){ jQuery(result).insertAfter(jQuery(where).closest('.control-group')); } - + function addButtonID_server(type, size){ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); if(token.length > 0 && type.length > 0 && size > 0){ @@ -1264,8 +1264,8 @@ function addButtonID(type, where, size){ } } }); -} - +} + function addButton_server(type){ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ @@ -1285,8 +1285,8 @@ function addButton(type,where){ addData(result,'#jform_'+where); } }) -} - +} + function getLinked_server(type){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; if(token.length > 0 && type > 0){ @@ -1307,7 +1307,7 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} function getTableColumns_server(tableName){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.tableColumns&format=json&vdm="+vastDevMod; diff --git a/admin/models/forms/custom_admin_view.js b/admin/models/forms/custom_admin_view.js index 280c1c83a..251e6f816 100644 --- a/admin/models/forms/custom_admin_view.js +++ b/admin/models/forms/custom_admin_view.js @@ -443,7 +443,7 @@ jQuery(document).ready(function() // get the linked details getLinked(); }); - + function getLinked_server(type){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; if(token.length > 0 && type > 0){ @@ -464,8 +464,8 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} - +} + function getSnippetDetails_server(snippetId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json"; if(token.length > 0 && snippetId > 0){ @@ -513,8 +513,8 @@ function getSnippetDetails(id){ jQuery('.snippet-usage').append(usage); } }) -} - +} + function getDynamicValues_server(dynamicId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json"; if(token.length > 0 && dynamicId > 0){ @@ -540,8 +540,8 @@ function getDynamicValues(id){ }); } }) -} - +} + function getLayoutDetails_server(id){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json"; if(token.length > 0 && id > 0){ @@ -566,8 +566,8 @@ function getLayoutDetails(id){ }); } }) -} - +} + function getTemplateDetails_server(id){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json"; if(token.length > 0 && id > 0){ @@ -592,8 +592,8 @@ function getTemplateDetails(id){ }); } }) -} - +} + // set snippets that are on the page var snippetIds = []; var snippets = {}; @@ -664,4 +664,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/admin/models/forms/dynamic_get.js b/admin/models/forms/dynamic_get.js index 2307b8232..e505bd47e 100644 --- a/admin/models/forms/dynamic_get.js +++ b/admin/models/forms/dynamic_get.js @@ -1435,7 +1435,7 @@ jQuery(document).ready(function() var valueSwitch = jQuery("#jform_add_php_router_parse input[type='radio']:checked").val(); getDynamicScripts(valueSwitch); }); - + function getLinked_server(type){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; if(token.length > 0 && type > 0){ @@ -1456,7 +1456,7 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} function getViewTableColumns_server(viewId,asKey,rowType) { diff --git a/admin/models/forms/field.js b/admin/models/forms/field.js index 35d173058..840bb9ad1 100644 --- a/admin/models/forms/field.js +++ b/admin/models/forms/field.js @@ -514,7 +514,7 @@ jQuery(document).ready(function() // get the linked details getLinked(); }); - + function getLinked_server(type){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; if(token.length > 0 && type > 0){ @@ -535,7 +535,7 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} function getFieldOptions_server(fieldId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json"; diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index 6d7bb2a20..ae549f30f 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -23,289 +23,289 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvwazwao_required = false; -jform_vvvvwbawap_required = false; -jform_vvvvwbbwaq_required = false; -jform_vvvvwbcwar_required = false; -jform_vvvvwbdwas_required = false; -jform_vvvvwbewat_required = false; +jform_vvvvwbdwan_required = false; +jform_vvvvwbewao_required = false; +jform_vvvvwbfwap_required = false; +jform_vvvvwbgwaq_required = false; +jform_vvvvwbhwar_required = false; +jform_vvvvwbiwas_required = false; // Initial Script jQuery(document).ready(function() { - var location_vvvvwaz = jQuery("#jform_location input[type='radio']:checked").val(); - vvvvwaz(location_vvvvwaz); + var location_vvvvwbd = jQuery("#jform_location input[type='radio']:checked").val(); + vvvvwbd(location_vvvvwbd); - var location_vvvvwba = jQuery("#jform_location input[type='radio']:checked").val(); - vvvvwba(location_vvvvwba); + var location_vvvvwbe = jQuery("#jform_location input[type='radio']:checked").val(); + vvvvwbe(location_vvvvwbe); - var type_vvvvwbb = jQuery("#jform_type").val(); - vvvvwbb(type_vvvvwbb); + var type_vvvvwbf = jQuery("#jform_type").val(); + vvvvwbf(type_vvvvwbf); - var type_vvvvwbc = jQuery("#jform_type").val(); - vvvvwbc(type_vvvvwbc); + var type_vvvvwbg = jQuery("#jform_type").val(); + vvvvwbg(type_vvvvwbg); - var type_vvvvwbd = jQuery("#jform_type").val(); - vvvvwbd(type_vvvvwbd); + var type_vvvvwbh = jQuery("#jform_type").val(); + vvvvwbh(type_vvvvwbh); - var target_vvvvwbe = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvwbe(target_vvvvwbe); + var target_vvvvwbi = jQuery("#jform_target input[type='radio']:checked").val(); + vvvvwbi(target_vvvvwbi); }); -// the vvvvwaz function -function vvvvwaz(location_vvvvwaz) +// the vvvvwbd function +function vvvvwbd(location_vvvvwbd) { // set the function logic - if (location_vvvvwaz == 1) + if (location_vvvvwbd == 1) { jQuery('#jform_admin_view').closest('.control-group').show(); - if (jform_vvvvwazwao_required) + if (jform_vvvvwbdwan_required) { updateFieldRequired('admin_view',0); jQuery('#jform_admin_view').prop('required','required'); jQuery('#jform_admin_view').attr('aria-required',true); jQuery('#jform_admin_view').addClass('required'); - jform_vvvvwazwao_required = false; + jform_vvvvwbdwan_required = false; } } else { jQuery('#jform_admin_view').closest('.control-group').hide(); - if (!jform_vvvvwazwao_required) + if (!jform_vvvvwbdwan_required) { updateFieldRequired('admin_view',1); jQuery('#jform_admin_view').removeAttr('required'); jQuery('#jform_admin_view').removeAttr('aria-required'); jQuery('#jform_admin_view').removeClass('required'); - jform_vvvvwazwao_required = true; + jform_vvvvwbdwan_required = true; } } } -// the vvvvwba function -function vvvvwba(location_vvvvwba) +// the vvvvwbe function +function vvvvwbe(location_vvvvwbe) { // set the function logic - if (location_vvvvwba == 2) + if (location_vvvvwbe == 2) { jQuery('#jform_site_view').closest('.control-group').show(); - if (jform_vvvvwbawap_required) + if (jform_vvvvwbewao_required) { updateFieldRequired('site_view',0); jQuery('#jform_site_view').prop('required','required'); jQuery('#jform_site_view').attr('aria-required',true); jQuery('#jform_site_view').addClass('required'); - jform_vvvvwbawap_required = false; + jform_vvvvwbewao_required = false; } } else { jQuery('#jform_site_view').closest('.control-group').hide(); - if (!jform_vvvvwbawap_required) + if (!jform_vvvvwbewao_required) { updateFieldRequired('site_view',1); jQuery('#jform_site_view').removeAttr('required'); jQuery('#jform_site_view').removeAttr('aria-required'); jQuery('#jform_site_view').removeClass('required'); - jform_vvvvwbawap_required = true; + jform_vvvvwbewao_required = true; } } } -// the vvvvwbb function -function vvvvwbb(type_vvvvwbb) +// the vvvvwbf function +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 type_vvvvwbb = []; - type_vvvvwbb.push(temp_vvvvwbb); + var temp_vvvvwbf = type_vvvvwbf; + var type_vvvvwbf = []; + 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 if (type) { jQuery('#jform_url').closest('.control-group').show(); - if (jform_vvvvwbbwaq_required) + if (jform_vvvvwbfwap_required) { updateFieldRequired('url',0); jQuery('#jform_url').prop('required','required'); jQuery('#jform_url').attr('aria-required',true); jQuery('#jform_url').addClass('required'); - jform_vvvvwbbwaq_required = false; + jform_vvvvwbfwap_required = false; } } else { jQuery('#jform_url').closest('.control-group').hide(); - if (!jform_vvvvwbbwaq_required) + if (!jform_vvvvwbfwap_required) { updateFieldRequired('url',1); jQuery('#jform_url').removeAttr('required'); jQuery('#jform_url').removeAttr('aria-required'); jQuery('#jform_url').removeClass('required'); - jform_vvvvwbbwaq_required = true; + jform_vvvvwbfwap_required = true; } } } -// the vvvvwbb Some function -function type_vvvvwbb_SomeFunc(type_vvvvwbb) +// the vvvvwbf Some function +function type_vvvvwbf_SomeFunc(type_vvvvwbf) { // set the function logic - if (type_vvvvwbb == 3) + if (type_vvvvwbf == 3) { return true; } return false; } -// the vvvvwbc function -function vvvvwbc(type_vvvvwbc) +// the vvvvwbg function +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 type_vvvvwbc = []; - type_vvvvwbc.push(temp_vvvvwbc); + var temp_vvvvwbg = type_vvvvwbg; + var type_vvvvwbg = []; + 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 if (type) { jQuery('#jform_article').closest('.control-group').show(); - if (jform_vvvvwbcwar_required) + if (jform_vvvvwbgwaq_required) { updateFieldRequired('article',0); jQuery('#jform_article').prop('required','required'); jQuery('#jform_article').attr('aria-required',true); jQuery('#jform_article').addClass('required'); - jform_vvvvwbcwar_required = false; + jform_vvvvwbgwaq_required = false; } } else { jQuery('#jform_article').closest('.control-group').hide(); - if (!jform_vvvvwbcwar_required) + if (!jform_vvvvwbgwaq_required) { updateFieldRequired('article',1); jQuery('#jform_article').removeAttr('required'); jQuery('#jform_article').removeAttr('aria-required'); jQuery('#jform_article').removeClass('required'); - jform_vvvvwbcwar_required = true; + jform_vvvvwbgwaq_required = true; } } } -// the vvvvwbc Some function -function type_vvvvwbc_SomeFunc(type_vvvvwbc) +// the vvvvwbg Some function +function type_vvvvwbg_SomeFunc(type_vvvvwbg) { // set the function logic - if (type_vvvvwbc == 1) + if (type_vvvvwbg == 1) { return true; } return false; } -// the vvvvwbd function -function vvvvwbd(type_vvvvwbd) +// the vvvvwbh function +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 type_vvvvwbd = []; - type_vvvvwbd.push(temp_vvvvwbd); + var temp_vvvvwbh = type_vvvvwbh; + var type_vvvvwbh = []; + 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 if (type) { jQuery('#jform_content-lbl').closest('.control-group').show(); - if (jform_vvvvwbdwas_required) + if (jform_vvvvwbhwar_required) { updateFieldRequired('content',0); jQuery('#jform_content').prop('required','required'); jQuery('#jform_content').attr('aria-required',true); jQuery('#jform_content').addClass('required'); - jform_vvvvwbdwas_required = false; + jform_vvvvwbhwar_required = false; } } else { jQuery('#jform_content-lbl').closest('.control-group').hide(); - if (!jform_vvvvwbdwas_required) + if (!jform_vvvvwbhwar_required) { updateFieldRequired('content',1); jQuery('#jform_content').removeAttr('required'); jQuery('#jform_content').removeAttr('aria-required'); jQuery('#jform_content').removeClass('required'); - jform_vvvvwbdwas_required = true; + jform_vvvvwbhwar_required = true; } } } -// the vvvvwbd Some function -function type_vvvvwbd_SomeFunc(type_vvvvwbd) +// the vvvvwbh Some function +function type_vvvvwbh_SomeFunc(type_vvvvwbh) { // set the function logic - if (type_vvvvwbd == 2) + if (type_vvvvwbh == 2) { return true; } return false; } -// the vvvvwbe function -function vvvvwbe(target_vvvvwbe) +// the vvvvwbi function +function vvvvwbi(target_vvvvwbi) { // set the function logic - if (target_vvvvwbe == 1) + if (target_vvvvwbi == 1) { jQuery('#jform_groups').closest('.control-group').show(); - if (jform_vvvvwbewat_required) + if (jform_vvvvwbiwas_required) { updateFieldRequired('groups',0); jQuery('#jform_groups').prop('required','required'); jQuery('#jform_groups').attr('aria-required',true); jQuery('#jform_groups').addClass('required'); - jform_vvvvwbewat_required = false; + jform_vvvvwbiwas_required = false; } } else { jQuery('#jform_groups').closest('.control-group').hide(); - if (!jform_vvvvwbewat_required) + if (!jform_vvvvwbiwas_required) { updateFieldRequired('groups',1); jQuery('#jform_groups').removeAttr('required'); jQuery('#jform_groups').removeAttr('aria-required'); jQuery('#jform_groups').removeClass('required'); - jform_vvvvwbewat_required = true; + jform_vvvvwbiwas_required = true; } } } diff --git a/admin/models/forms/joomla_component.js b/admin/models/forms/joomla_component.js index a46843aa4..99ff42011 100644 --- a/admin/models/forms/joomla_component.js +++ b/admin/models/forms/joomla_component.js @@ -915,7 +915,7 @@ function addData(result, where){ jQuery(result).insertAfter(jQuery(where).closest('.control-group')); } - + function addButtonID_server(type, size){ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); if(token.length > 0 && type.length > 0 && size > 0){ @@ -939,8 +939,8 @@ function addButtonID(type, where, size){ } } }); -} - +} + function addButton_server(type){ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ @@ -960,5 +960,5 @@ function addButton(type,where){ addData(result,'#jform_'+where); } }) -} +} diff --git a/admin/models/forms/language_translation.js b/admin/models/forms/language_translation.js index 138e777f9..0170f7c31 100644 --- a/admin/models/forms/language_translation.js +++ b/admin/models/forms/language_translation.js @@ -32,7 +32,7 @@ jQuery(document).ready(function($) function addData(result,where){ jQuery(result).insertAfter(jQuery(where).closest('.control-group')); } - + function addButton_server(type){ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ @@ -52,4 +52,4 @@ function addButton(type,where){ addData(result,'#jform_'+where); } }) -} +} diff --git a/admin/models/forms/layout.js b/admin/models/forms/layout.js index 2a6459f0a..397bae8bd 100644 --- a/admin/models/forms/layout.js +++ b/admin/models/forms/layout.js @@ -99,7 +99,7 @@ function isSet(val) return false; } - + function getSnippetDetails_server(snippetId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json"; if(token.length > 0 && snippetId > 0){ @@ -147,8 +147,8 @@ function getSnippetDetails(id){ jQuery('.snippet-usage').append(usage); } }) -} - +} + function getDynamicValues_server(dynamicId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json"; if(token.length > 0 && dynamicId > 0){ @@ -174,8 +174,8 @@ function getDynamicValues(id){ }); } }) -} - +} + function getLayoutDetails_server(id){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json"; if(token.length > 0 && id > 0){ @@ -200,8 +200,8 @@ function getLayoutDetails(id){ }); } }) -} - +} + // set snippets that are on the page var snippetIds = []; var snippets = {}; @@ -272,4 +272,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/admin/models/forms/library.js b/admin/models/forms/library.js index bb8763f88..64464dc1a 100644 --- a/admin/models/forms/library.js +++ b/admin/models/forms/library.js @@ -426,7 +426,7 @@ jQuery(document).ready(function() function addData(result,where){ jQuery(result).insertAfter(jQuery(where).closest('.control-group')); } - + function addButtonID_server(type, size){ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&vdm="+vastDevMod); if(token.length > 0 && type.length > 0 && size > 0){ @@ -450,8 +450,8 @@ function addButtonID(type, where, size){ } } }); -} - +} + function addButton_server(type){ var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); if(token.length > 0 && type.length > 0){ @@ -471,8 +471,8 @@ function addButton(type,where){ addData(result,'#jform_'+where); } }) -} - +} + function getLinked_server(type){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; if(token.length > 0 && type > 0){ @@ -493,7 +493,7 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} function getAjaxDisplay(type){ getAjaxDisplay_server(type).done(function(result) { diff --git a/admin/models/forms/server.js b/admin/models/forms/server.js index 149a7b199..055a7ebfe 100644 --- a/admin/models/forms/server.js +++ b/admin/models/forms/server.js @@ -31,7 +31,6 @@ jform_vvvvwatwai_required = false; jform_vvvvwauwaj_required = false; jform_vvvvwavwak_required = false; jform_vvvvwaxwal_required = false; -jform_vvvvwaywam_required = false; // Initial Script jQuery(document).ready(function() @@ -50,9 +49,13 @@ jQuery(document).ready(function() var authentication_vvvvwax = jQuery("#jform_authentication").val(); vvvvwax(protocol_vvvvwax,authentication_vvvvwax); - var authentication_vvvvway = jQuery("#jform_authentication").val(); - var protocol_vvvvway = jQuery("#jform_protocol").val(); - vvvvway(authentication_vvvvway,protocol_vvvvway); + var protocol_vvvvwaz = jQuery("#jform_protocol").val(); + var authentication_vvvvwaz = jQuery("#jform_authentication").val(); + 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 @@ -316,7 +319,7 @@ function protocol_vvvvwav_SomeFunc(protocol_vvvvwav) function authentication_vvvvwav_SomeFunc(authentication_vvvvwav) { // set the function logic - if (authentication_vvvvwav == 1 || authentication_vvvvwav == 3) + if (authentication_vvvvwav == 1 || authentication_vvvvwav == 3 || authentication_vvvvwav == 5) { return true; } @@ -364,7 +367,6 @@ function vvvvwax(protocol_vvvvwax,authentication_vvvvwax) jform_vvvvwaxwal_required = false; } - jQuery('#jform_secret').closest('.control-group').show(); } else { @@ -377,7 +379,6 @@ function vvvvwax(protocol_vvvvwax,authentication_vvvvwax) jQuery('#jform_private').removeClass('required'); jform_vvvvwaxwal_required = true; } - jQuery('#jform_secret').closest('.control-group').hide(); } } @@ -403,80 +404,122 @@ function authentication_vvvvwax_SomeFunc(authentication_vvvvwax) return false; } -// the vvvvway function -function vvvvway(authentication_vvvvway,protocol_vvvvway) +// the vvvvwaz function +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 authentication_vvvvway = []; - authentication_vvvvway.push(temp_vvvvway); + var temp_vvvvwaz = protocol_vvvvwaz; + var protocol_vvvvwaz = []; + 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 protocol_vvvvway = []; - protocol_vvvvway.push(temp_vvvvway); + var temp_vvvvwaz = authentication_vvvvwaz; + var authentication_vvvvwaz = []; + 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 - if (authentication && protocol) + if (protocol && authentication) { - jQuery('#jform_private').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(); + jQuery('#jform_private_key').closest('.control-group').show(); } else { - jQuery('#jform_private').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(); + jQuery('#jform_private_key').closest('.control-group').hide(); } } -// the vvvvway Some function -function authentication_vvvvway_SomeFunc(authentication_vvvvway) +// the vvvvwaz Some function +function protocol_vvvvwaz_SomeFunc(protocol_vvvvwaz) { // set the function logic - if (authentication_vvvvway == 2 || authentication_vvvvway == 3) + if (protocol_vvvvwaz == 2) { return true; } return false; } -// the vvvvway Some function -function protocol_vvvvway_SomeFunc(protocol_vvvvway) +// the vvvvwaz Some function +function authentication_vvvvwaz_SomeFunc(authentication_vvvvwaz) { // 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; } diff --git a/admin/models/forms/server.xml b/admin/models/forms/server.xml index e9383e043..41db29e02 100644 --- a/admin/models/forms/server.xml +++ b/admin/models/forms/server.xml @@ -107,18 +107,6 @@ - - - - - - - - + + 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('')};" /> - - + + + + + + + + + + + + - - - - + + + + diff --git a/admin/models/forms/site_view.js b/admin/models/forms/site_view.js index d9c8a80e8..4c627099f 100644 --- a/admin/models/forms/site_view.js +++ b/admin/models/forms/site_view.js @@ -484,7 +484,7 @@ jQuery(document).ready(function() // get the linked details getLinked(); }); - + function getLinked_server(type){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&vdm="+vastDevMod; if(token.length > 0 && type > 0){ @@ -505,8 +505,8 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} - +} + function getSnippetDetails_server(snippetId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json"; if(token.length > 0 && snippetId > 0){ @@ -554,8 +554,8 @@ function getSnippetDetails(id){ jQuery('.snippet-usage').append(usage); } }) -} - +} + function getDynamicValues_server(dynamicId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json"; if(token.length > 0 && dynamicId > 0){ @@ -581,8 +581,8 @@ function getDynamicValues(id){ }); } }) -} - +} + function getLayoutDetails_server(id){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json"; if(token.length > 0 && id > 0){ @@ -607,8 +607,8 @@ function getLayoutDetails(id){ }); } }) -} - +} + function getTemplateDetails_server(id){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json"; if(token.length > 0 && id > 0){ @@ -633,8 +633,8 @@ function getTemplateDetails(id){ }); } }) -} - +} + // set snippets that are on the page var snippetIds = []; var snippets = {}; @@ -705,4 +705,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/admin/models/forms/template.js b/admin/models/forms/template.js index 6061198f6..e9e58f498 100644 --- a/admin/models/forms/template.js +++ b/admin/models/forms/template.js @@ -99,7 +99,7 @@ function isSet(val) return false; } - + function getSnippetDetails_server(snippetId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.snippetDetails&format=json"; if(token.length > 0 && snippetId > 0){ @@ -147,8 +147,8 @@ function getSnippetDetails(id){ jQuery('.snippet-usage').append(usage); } }) -} - +} + function getDynamicValues_server(dynamicId){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json"; if(token.length > 0 && dynamicId > 0){ @@ -174,8 +174,8 @@ function getDynamicValues(id){ }); } }) -} - +} + function getLayoutDetails_server(id){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json"; if(token.length > 0 && id > 0){ @@ -200,8 +200,8 @@ function getLayoutDetails(id){ }); } }) -} - +} + function getTemplateDetails_server(id){ var getUrl = "index.php?option=com_componentbuilder&task=ajax.templateDetails&format=json"; if(token.length > 0 && id > 0){ @@ -226,8 +226,8 @@ function getTemplateDetails(id){ }); } }) -} - +} + // set snippets that are on the page var snippetIds = []; var snippets = {}; @@ -298,4 +298,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/admin/models/help_document.php b/admin/models/help_document.php index fb1c087ba..9dcabbc4c 100644 --- a/admin/models/help_document.php +++ b/admin/models/help_document.php @@ -558,8 +558,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('help_document'); } @@ -584,7 +582,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -594,17 +591,11 @@ class ComponentbuilderModelHelp_document extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('help_document.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -614,7 +605,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -624,7 +614,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin continue; } } - list($this->table->title, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->title); // insert all set values @@ -707,8 +696,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('help_document'); } @@ -732,7 +719,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin if (!$this->user->authorise('help_document.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -743,7 +729,6 @@ class ComponentbuilderModelHelp_document extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/import_joomla_components.php b/admin/models/import_joomla_components.php index 475acea98..f8da89216 100644 --- a/admin/models/import_joomla_components.php +++ b/admin/models/import_joomla_components.php @@ -1507,6 +1507,18 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy } // remove from this dataset 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 $updaterR = array( // repeatablefield => checker @@ -2267,19 +2279,19 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy case 'joomla_component': if ($retry == 3) { - // get by name only - $getter = array('name', 'name_code'); // risky will look at this again + // get by names only + $getter = array('name', 'name_code', 'system_name'); } elseif ($retry == 2) { // 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; } else { // 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; } break; diff --git a/admin/models/joomla_component.php b/admin/models/joomla_component.php index 5e7ac68c9..87567bb34 100644 --- a/admin/models/joomla_component.php +++ b/admin/models/joomla_component.php @@ -221,7 +221,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $item->export_key = rtrim($basic->decryptString($item->export_key), "\0"); } - + if (empty($item->id)) { $id = 0; @@ -240,7 +240,7 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $this->vastDevMod = ComponentbuilderHelper::randomkey(50); ComponentbuilderHelper::set($this->vastDevMod, 'joomla_component__'.$id); ComponentbuilderHelper::set('joomla_component__'.$id, $this->vastDevMod); - } + } // update the fields $objectUpdate = new stdClass(); @@ -782,20 +782,21 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin if (ComponentbuilderHelper::checkArray($pks)) { $_tablesArray = array( - 'component_admin_views', - 'component_site_views', - 'component_custom_admin_views', - 'component_updates', - 'component_mysql_tweaks', - 'component_custom_admin_menus', - 'component_config', - 'component_dashboard', - 'component_files_folders' + 'component_admin_views' => 'joomla_component', + 'component_site_views' => 'joomla_component', + 'component_custom_admin_views' => 'joomla_component', + 'component_updates' => 'joomla_component', + 'component_mysql_tweaks' => 'joomla_component', + 'component_custom_admin_menus' => 'joomla_component', + 'component_config' => 'joomla_component', + 'component_dashboard' => 'joomla_component', + 'component_files_folders' => 'joomla_component', + 'custom_code' => 'component' ); - foreach($_tablesArray as $_updateTable) + foreach($_tablesArray as $_updateTable => $_key) { // get the linked IDs - if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, 'joomla_component', 'id')) + if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, $_key, 'id')) { // load the model $_Model = ComponentbuilderHelper::getModel($_updateTable); @@ -829,20 +830,21 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin if (ComponentbuilderHelper::checkArray($pks)) { $_tablesArray = array( - 'component_admin_views', - 'component_site_views', - 'component_custom_admin_views', - 'component_updates', - 'component_mysql_tweaks', - 'component_custom_admin_menus', - 'component_config', - 'component_dashboard', - 'component_files_folders' + 'component_admin_views' => 'joomla_component', + 'component_site_views' => 'joomla_component', + 'component_custom_admin_views' => 'joomla_component', + 'component_updates' => 'joomla_component', + 'component_mysql_tweaks' => 'joomla_component', + 'component_custom_admin_menus' => 'joomla_component', + 'component_config' => 'joomla_component', + 'component_dashboard' => 'joomla_component', + 'component_files_folders' => 'joomla_component', + 'custom_code' => 'component' ); - foreach($_tablesArray as $_updateTable) + foreach($_tablesArray as $_updateTable => $_key) { // get the linked IDs - if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, 'joomla_component', 'id')) + if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, $_key, 'id')) { // load the model $_Model = ComponentbuilderHelper::getModel($_updateTable); @@ -970,8 +972,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('joomla_component'); } @@ -996,7 +996,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -1006,17 +1005,11 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('joomla_component.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -1026,7 +1019,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -1119,8 +1115,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('joomla_component'); } @@ -1144,7 +1138,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin if (!$this->user->authorise('joomla_component.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -1155,7 +1148,6 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -1236,6 +1228,12 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin $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. if (isset($data['addcontributors']) && is_array($data['addcontributors'])) { diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 00960eb90..2322b7896 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -1252,7 +1252,7 @@ class ComponentbuilderModelJoomla_components extends JModelList } } } - + /** * Get the keys of the values to search custom code in * @@ -1389,7 +1389,7 @@ class ComponentbuilderModelJoomla_components extends JModelList return $targets[$target]; } return false; - } + } /** * Method to auto-populate the model state. diff --git a/admin/models/language.php b/admin/models/language.php index 6b38eedbd..2b9c98cb6 100644 --- a/admin/models/language.php +++ b/admin/models/language.php @@ -516,8 +516,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('language'); } @@ -542,7 +540,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -552,17 +549,11 @@ class ComponentbuilderModelLanguage extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('language.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -572,7 +563,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -665,8 +659,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('language'); } @@ -690,7 +682,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin if (!$this->user->authorise('language.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -701,7 +692,6 @@ class ComponentbuilderModelLanguage extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/language_translation.php b/admin/models/language_translation.php index 40ced8708..99acb372d 100644 --- a/admin/models/language_translation.php +++ b/admin/models/language_translation.php @@ -107,14 +107,14 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin $translation->loadString($item->translation); $item->translation = $translation->toArray(); } - + if (!empty($item->components)) { // JSON Decode components. $item->components = json_decode($item->components, true); } - - + + if (empty($item->id)) { $id = 0; @@ -133,7 +133,7 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin $this->vastDevMod = ComponentbuilderHelper::randomkey(50); ComponentbuilderHelper::set($this->vastDevMod, 'language_translation__'.$id); ComponentbuilderHelper::set('language_translation__'.$id, $this->vastDevMod); - } + } if (!empty($item->id)) { @@ -556,8 +556,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('language_translation'); } @@ -582,7 +580,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -592,17 +589,11 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('language_translation.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -612,7 +603,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -705,8 +699,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('language_translation'); } @@ -730,7 +722,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin if (!$this->user->authorise('language_translation.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -741,7 +732,6 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/layout.php b/admin/models/layout.php index 2fe6cd356..a2c60305d 100644 --- a/admin/models/layout.php +++ b/admin/models/layout.php @@ -572,8 +572,6 @@ class ComponentbuilderModelLayout extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('layout'); } @@ -598,7 +596,6 @@ class ComponentbuilderModelLayout extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -608,17 +605,11 @@ class ComponentbuilderModelLayout extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('core.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -628,7 +619,6 @@ class ComponentbuilderModelLayout extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -638,7 +628,6 @@ class ComponentbuilderModelLayout extends JModelAdmin continue; } } - list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name); // insert all set values @@ -721,8 +710,6 @@ class ComponentbuilderModelLayout extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('layout'); } @@ -746,7 +733,6 @@ class ComponentbuilderModelLayout extends JModelAdmin if (!$this->user->authorise('core.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -757,7 +743,6 @@ class ComponentbuilderModelLayout extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/libraries.php b/admin/models/libraries.php index fcd2ad2b1..08d458f57 100644 --- a/admin/models/libraries.php +++ b/admin/models/libraries.php @@ -139,10 +139,10 @@ class ComponentbuilderModelLibraries extends JModelList { // convert type $item->type = $this->selectionTranslation($item->type, 'type'); - + // convert how $item->how = $this->selectionTranslation($item->how, 'how'); - + } } @@ -171,7 +171,7 @@ class ComponentbuilderModelLibraries extends JModelList return $typeArray[$value]; } } - + // Array of how language strings if ($name === 'how') { @@ -188,7 +188,7 @@ class ComponentbuilderModelLibraries extends JModelList return JText::_($howArray[$value]); } } - + return $value; } diff --git a/admin/models/library.php b/admin/models/library.php index 169f1a950..b581c9283 100644 --- a/admin/models/library.php +++ b/admin/models/library.php @@ -122,7 +122,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin $item->php_setdocument = base64_decode($item->php_setdocument); } - + if (empty($item->id)) { $id = 0; @@ -141,7 +141,7 @@ class ComponentbuilderModelLibrary extends JModelAdmin $this->vastDevMod = ComponentbuilderHelper::randomkey(50); ComponentbuilderHelper::set($this->vastDevMod, 'library__'.$id); ComponentbuilderHelper::set('library__'.$id, $this->vastDevMod); - } + } if (!empty($item->id)) { @@ -443,9 +443,9 @@ class ComponentbuilderModelLibrary extends JModelAdmin */ protected function getUniqeFields() { - + return array('name'); - + } /** @@ -662,8 +662,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('library'); } @@ -688,7 +686,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -698,17 +695,11 @@ class ComponentbuilderModelLibrary extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('library.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -718,7 +709,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -811,8 +805,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('library'); } @@ -836,7 +828,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin if (!$this->user->authorise('library.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -847,7 +838,6 @@ class ComponentbuilderModelLibrary extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/library_config.php b/admin/models/library_config.php index d87387b5e..3a19e3a2a 100644 --- a/admin/models/library_config.php +++ b/admin/models/library_config.php @@ -526,8 +526,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('library_config'); } @@ -552,7 +550,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -562,17 +559,11 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('library_config.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -582,7 +573,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -675,8 +669,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('library_config'); } @@ -700,7 +692,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin if (!$this->user->authorise('library_config.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -711,7 +702,6 @@ class ComponentbuilderModelLibrary_config extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/library_files_folders_urls.php b/admin/models/library_files_folders_urls.php index 9a16d3da8..eac52191a 100644 --- a/admin/models/library_files_folders_urls.php +++ b/admin/models/library_files_folders_urls.php @@ -558,8 +558,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('library_files_folders_urls'); } @@ -584,7 +582,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -594,17 +591,11 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('library_files_folders_urls.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -614,7 +605,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -707,8 +701,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('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])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -743,7 +734,6 @@ class ComponentbuilderModelLibrary_files_folders_urls extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/server.php b/admin/models/server.php index 83c89048e..4625aae10 100644 --- a/admin/models/server.php +++ b/admin/models/server.php @@ -100,10 +100,10 @@ class ComponentbuilderModelServer extends JModelAdmin // Get the encryption object. $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. - $item->host = rtrim($basic->decryptString($item->host), "\0"); + // basic decrypt data path. + $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))) @@ -112,10 +112,10 @@ class ComponentbuilderModelServer extends JModelAdmin $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. - $item->path = rtrim($basic->decryptString($item->path), "\0"); + // basic decrypt data password. + $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))) @@ -124,18 +124,18 @@ class ComponentbuilderModelServer extends JModelAdmin $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))) { // basic decrypt data signature. $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))) { // basic decrypt data username. @@ -146,6 +146,12 @@ class ComponentbuilderModelServer extends JModelAdmin { // basic decrypt data private. $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)) @@ -164,7 +170,7 @@ class ComponentbuilderModelServer extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getWanlinked_components() + public function getWamlinked_components() { // Get the user object. $user = JFactory::getUser(); @@ -689,8 +695,6 @@ class ComponentbuilderModelServer extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('server'); } @@ -715,7 +719,6 @@ class ComponentbuilderModelServer extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -725,17 +728,11 @@ class ComponentbuilderModelServer extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('server.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -745,7 +742,6 @@ class ComponentbuilderModelServer extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -838,8 +838,6 @@ class ComponentbuilderModelServer extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('server'); } @@ -863,7 +861,6 @@ class ComponentbuilderModelServer extends JModelAdmin if (!$this->user->authorise('server.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -874,7 +871,6 @@ class ComponentbuilderModelServer extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -960,10 +956,10 @@ class ComponentbuilderModelServer extends JModelAdmin // Get the encryption object $basic = new FOFEncryptAes($basickey, 128); - // Encrypt data host. - if (isset($data['host']) && $basickey) + // Encrypt data path. + if (isset($data['path']) && $basickey) { - $data['host'] = $basic->encryptString($data['host']); + $data['path'] = $basic->encryptString($data['path']); } // Encrypt data port. @@ -972,10 +968,10 @@ class ComponentbuilderModelServer extends JModelAdmin $data['port'] = $basic->encryptString($data['port']); } - // Encrypt data path. - if (isset($data['path']) && $basickey) + // Encrypt data password. + if (isset($data['password']) && $basickey) { - $data['path'] = $basic->encryptString($data['path']); + $data['password'] = $basic->encryptString($data['password']); } // Encrypt data secret. @@ -984,18 +980,18 @@ class ComponentbuilderModelServer extends JModelAdmin $data['secret'] = $basic->encryptString($data['secret']); } + // Encrypt data host. + if (isset($data['host']) && $basickey) + { + $data['host'] = $basic->encryptString($data['host']); + } + // Encrypt data signature. if (isset($data['signature']) && $basickey) { $data['signature'] = $basic->encryptString($data['signature']); } - // Encrypt data password. - if (isset($data['password']) && $basickey) - { - $data['password'] = $basic->encryptString($data['password']); - } - // Encrypt data username. if (isset($data['username']) && $basickey) { @@ -1006,6 +1002,12 @@ class ComponentbuilderModelServer extends JModelAdmin if (isset($data['private']) && $basickey) { $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 diff --git a/admin/models/servers.php b/admin/models/servers.php index ba0d834d4..7397bf528 100644 --- a/admin/models/servers.php +++ b/admin/models/servers.php @@ -304,36 +304,36 @@ class ComponentbuilderModelServers extends JModelList 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 - $item->host = $basic->decryptString($item->host); + // decrypt path + $item->path = $basic->decryptString($item->path); } if ($basickey && !is_numeric($item->port) && $item->port === base64_encode(base64_decode($item->port, true))) { // decrypt 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 - $item->path = $basic->decryptString($item->path); + // decrypt password + $item->password = $basic->decryptString($item->password); } if ($basickey && !is_numeric($item->secret) && $item->secret === base64_encode(base64_decode($item->secret, true))) { // decrypt 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))) { // decrypt 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))) { // decrypt username @@ -344,6 +344,11 @@ class ComponentbuilderModelServers extends JModelList // decrypt 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($item->asset_id); unset($item->checked_out); diff --git a/admin/models/site_view.php b/admin/models/site_view.php index 286e13a9f..0b56555e3 100644 --- a/admin/models/site_view.php +++ b/admin/models/site_view.php @@ -204,7 +204,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin $item->php_controller = base64_decode($item->php_controller); } - + if (empty($item->id)) { $id = 0; @@ -223,7 +223,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin $this->vastDevMod = ComponentbuilderHelper::randomkey(50); ComponentbuilderHelper::set($this->vastDevMod, 'site_view__'.$id); ComponentbuilderHelper::set('site_view__'.$id, $this->vastDevMod); - } + } // update the fields $objectUpdate = new stdClass(); @@ -721,8 +721,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('site_view'); } @@ -747,7 +745,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -757,17 +754,11 @@ class ComponentbuilderModelSite_view extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('core.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -777,7 +768,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -870,8 +864,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('site_view'); } @@ -895,7 +887,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin if (!$this->user->authorise('core.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -906,7 +897,6 @@ class ComponentbuilderModelSite_view extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -988,7 +978,12 @@ class ComponentbuilderModelSite_view extends JModelAdmin } // 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. if (isset($data['libraries']) && is_array($data['libraries'])) diff --git a/admin/models/snippet.php b/admin/models/snippet.php index 135438e20..8b6908533 100644 --- a/admin/models/snippet.php +++ b/admin/models/snippet.php @@ -522,8 +522,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('snippet'); } @@ -548,7 +546,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -558,17 +555,11 @@ class ComponentbuilderModelSnippet extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('core.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -578,7 +569,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -671,8 +665,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('snippet'); } @@ -696,7 +688,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin if (!$this->user->authorise('core.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -707,7 +698,6 @@ class ComponentbuilderModelSnippet extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/snippet_type.php b/admin/models/snippet_type.php index 5c766b193..ac55032c3 100644 --- a/admin/models/snippet_type.php +++ b/admin/models/snippet_type.php @@ -516,8 +516,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('snippet_type'); } @@ -542,7 +540,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -552,17 +549,11 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('snippet_type.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -572,7 +563,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin { // Fatal error $this->setError($error); - return false; } 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 if (ComponentbuilderHelper::checkArray($values)) @@ -665,8 +659,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('snippet_type'); } @@ -690,7 +682,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin if (!$this->user->authorise('snippet_type.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -701,7 +692,6 @@ class ComponentbuilderModelSnippet_type extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/models/template.php b/admin/models/template.php index ddcaa1dd3..d1f58c3ce 100644 --- a/admin/models/template.php +++ b/admin/models/template.php @@ -572,8 +572,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('template'); } @@ -598,7 +596,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin } $newIds = array(); - // Parent exists so let's proceed while (!empty($pks)) { @@ -608,17 +605,11 @@ class ComponentbuilderModelTemplate extends JModelAdmin $this->table->reset(); // only allow copy if user may edit this item. - if (!$this->user->authorise('core.edit', $contexts[$pk])) - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } // Check that the row actually exists @@ -628,7 +619,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else @@ -638,7 +628,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin continue; } } - list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name); // insert all set values @@ -721,8 +710,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin $this->user = JFactory::getUser(); $this->table = $this->getTable(); $this->tableClassName = get_class($this->table); - $this->contentType = new JUcmType; - $this->type = $this->contentType->getTypeByTable($this->tableClassName); $this->canDo = ComponentbuilderHelper::getActions('template'); } @@ -746,7 +733,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin if (!$this->user->authorise('core.edit', $contexts[$pk])) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } @@ -757,7 +743,6 @@ class ComponentbuilderModelTemplate extends JModelAdmin { // Fatal error $this->setError($error); - return false; } else diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 932497305..ad32a28d1 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -803,6 +803,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_server` ( `path` TEXT NOT NULL, `port` TEXT NOT NULL, `private` TEXT NOT NULL, + `private_key` TEXT NOT NULL, `protocol` TINYINT(1) NOT NULL DEFAULT 0, `secret` 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, '', ''), (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, '', ''), -(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, '', ''), (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, '', ''), diff --git a/admin/sql/updates/mysql/2.6.16.sql b/admin/sql/updates/mysql/2.6.16.sql new file mode 100644 index 000000000..48d420d62 --- /dev/null +++ b/admin/sql/updates/mysql/2.6.16.sql @@ -0,0 +1 @@ +ALTER TABLE `#__componentbuilder_server` ADD `private_key` TEXT NOT NULL AFTER `private`; diff --git a/admin/views/admin_view/tmpl/edit.php b/admin/views/admin_view/tmpl/edit.php index ea61571c2..347952ce9 100644 --- a/admin/views/admin_view/tmpl/edit.php +++ b/admin/views/admin_view/tmpl/edit.php @@ -731,7 +731,7 @@ jQuery('#jform_add_custom_import').on('change',function() { var valueSwitch = jQuery("#jform_add_custom_import input[type='radio']:checked").val(); getDynamicScripts(valueSwitch); }); - + @@ -747,8 +747,8 @@ function JRouter(link) { } ?> return url+link; -} - +} + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -760,5 +760,5 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); +}); diff --git a/admin/views/admin_view/view.html.php b/admin/views/admin_view/view.html.php index c3e445aa9..1836e0d79 100644 --- a/admin/views/admin_view/view.html.php +++ b/admin/views/admin_view/view.html.php @@ -199,7 +199,7 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy $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() . "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 $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'); @@ -207,7 +207,7 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy // 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/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 $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); JText::script('view not acceptable. Error'); diff --git a/admin/views/admin_views/tmpl/default_body.php b/admin/views/admin_views/tmpl/default_body.php index 0f7b97fc9..65c030987 100644 --- a/admin/views/admin_views/tmpl/default_body.php +++ b/admin/views/admin_views/tmpl/default_body.php @@ -85,7 +85,7 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
escape($item->system_name); ?>
- +
get('admin_view.edit') && $admin_field_id = ComponentbuilderHelper::getVar('admin_fields', $item->id, 'admin_view', 'id')): ?> @@ -94,7 +94,7 @@ $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.
- + escape($item->name_single); ?> diff --git a/admin/views/compiler/tmpl/default.php b/admin/views/compiler/tmpl/default.php index e0ede51a0..3bdbf051d 100644 --- a/admin/views/compiler/tmpl/default.php +++ b/admin/views/compiler/tmpl/default.php @@ -166,7 +166,7 @@ jQuery('#compilerForm').on('change', '#component',function (e) jQuery('.notice').hide(); } }); - + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -178,8 +178,8 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); - +}); + @@ -195,7 +195,7 @@ function JRouter(link) { } ?> return url+link; -} +}

diff --git a/admin/views/custom_admin_view/tmpl/edit.php b/admin/views/custom_admin_view/tmpl/edit.php index b0cf512b0..9419ea6c3 100644 --- a/admin/views/custom_admin_view/tmpl/edit.php +++ b/admin/views/custom_admin_view/tmpl/edit.php @@ -364,7 +364,7 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) { e.preventDefault(); getSnippets(); }); - + jQuery.fn.selText = function() { var obj = this[0]; if (jQuery.browser.msie) { @@ -382,7 +382,7 @@ jQuery.fn.selText = function() { selection.setBaseAndExtent(obj, 0, obj, 1); } return this; -} +} jQuery('#adminForm').on('change', '#jform_snippet',function (e) { e.preventDefault(); @@ -418,7 +418,7 @@ jQuery(document).ready(function() { // some lang strings var select_a_snippet = ''; var create_a_snippet = ''; - + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -430,5 +430,5 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); +}); diff --git a/admin/views/custom_admin_view/view.html.php b/admin/views/custom_admin_view/view.html.php index 7b1c165fa..8e5c26425 100644 --- a/admin/views/custom_admin_view/view.html.php +++ b/admin/views/custom_admin_view/view.html.php @@ -199,7 +199,7 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy $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() . "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 $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'); @@ -207,7 +207,7 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy // 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/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 $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); JText::script('view not acceptable. Error'); diff --git a/admin/views/custom_code/tmpl/edit.php b/admin/views/custom_code/tmpl/edit.php index d0186f837..0b2b75c88 100644 --- a/admin/views/custom_code/tmpl/edit.php +++ b/admin/views/custom_code/tmpl/edit.php @@ -264,7 +264,7 @@ jQuery('#adminForm').on('change', '#jform_comment_type',function (e) jQuery('#phpjs-comment-info').show(); } }); - + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -276,5 +276,5 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); +}); diff --git a/admin/views/custom_code/view.html.php b/admin/views/custom_code/view.html.php index e9be44546..26e4d4143 100644 --- a/admin/views/custom_code/view.html.php +++ b/admin/views/custom_code/view.html.php @@ -199,7 +199,7 @@ class ComponentbuilderViewCustom_code extends JViewLegacy $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() . "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 $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'); @@ -207,7 +207,7 @@ class ComponentbuilderViewCustom_code extends JViewLegacy // 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/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'); } } diff --git a/admin/views/dynamic_get/tmpl/edit.php b/admin/views/dynamic_get/tmpl/edit.php index 724f6a032..d49d944c4 100644 --- a/admin/views/dynamic_get/tmpl/edit.php +++ b/admin/views/dynamic_get/tmpl/edit.php @@ -654,7 +654,7 @@ jQuery('#jform_add_php_router_parse').on('change',function() { getDynamicScripts(valueSwitch); }); - + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -666,5 +666,5 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); +}); diff --git a/admin/views/dynamic_get/view.html.php b/admin/views/dynamic_get/view.html.php index 9fbccd7e0..c9a2a73a9 100644 --- a/admin/views/dynamic_get/view.html.php +++ b/admin/views/dynamic_get/view.html.php @@ -199,7 +199,7 @@ class ComponentbuilderViewDynamic_get extends JViewLegacy $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() . "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 $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'); @@ -207,7 +207,7 @@ class ComponentbuilderViewDynamic_get extends JViewLegacy // 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/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 $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); JText::script('view not acceptable. Error'); diff --git a/admin/views/field/tmpl/edit.php b/admin/views/field/tmpl/edit.php index afd40c59a..3b767bd13 100644 --- a/admin/views/field/tmpl/edit.php +++ b/admin/views/field/tmpl/edit.php @@ -333,7 +333,7 @@ jQuery(document).ready(function() { getFieldOptions(fieldId,false); } }); - + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -345,5 +345,5 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); +}); diff --git a/admin/views/field/view.html.php b/admin/views/field/view.html.php index e0fd7dc16..322c44a50 100644 --- a/admin/views/field/view.html.php +++ b/admin/views/field/view.html.php @@ -199,7 +199,7 @@ class ComponentbuilderViewField extends JViewLegacy $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() . "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 $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'); @@ -207,7 +207,7 @@ class ComponentbuilderViewField extends JViewLegacy // 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/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 $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); JText::script('view not acceptable. Error'); diff --git a/admin/views/get_snippets/tmpl/default.php b/admin/views/get_snippets/tmpl/default.php index 1c86a8b74..692969f1b 100644 --- a/admin/views/get_snippets/tmpl/default.php +++ b/admin/views/get_snippets/tmpl/default.php @@ -228,7 +228,7 @@ JHtml::_('behavior.keepalive');

diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php index 5361997e2..a9ceb3a3e 100644 --- a/admin/views/help_document/tmpl/edit.php +++ b/admin/views/help_document/tmpl/edit.php @@ -127,93 +127,93 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder'); diff --git a/admin/views/joomla_component/view.html.php b/admin/views/joomla_component/view.html.php index 47ac602f3..b5eb60cd9 100644 --- a/admin/views/joomla_component/view.html.php +++ b/admin/views/joomla_component/view.html.php @@ -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() . "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 $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'); @@ -220,7 +220,7 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy // 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/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 $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); JText::script('view not acceptable. Error'); diff --git a/admin/views/joomla_components/tmpl/default_body.php b/admin/views/joomla_components/tmpl/default_body.php index 394c1f546..ce1600d2f 100644 --- a/admin/views/joomla_components/tmpl/default_body.php +++ b/admin/views/joomla_components/tmpl/default_body.php @@ -85,7 +85,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
escape($item->system_name); ?>
- +
get('component_admin_views.edit') && $component_admin_views_id = ComponentbuilderHelper::getVar('component_admin_views', $item->id, 'joomla_component', 'id')): ?> @@ -129,7 +129,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
- + escape($item->companyname); ?> diff --git a/admin/views/language_translation/tmpl/edit.php b/admin/views/language_translation/tmpl/edit.php index f7b6bcf72..163c31ddf 100644 --- a/admin/views/language_translation/tmpl/edit.php +++ b/admin/views/language_translation/tmpl/edit.php @@ -118,7 +118,7 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder'); diff --git a/admin/views/layout/tmpl/edit.php b/admin/views/layout/tmpl/edit.php index 65879435f..7233cd52a 100644 --- a/admin/views/layout/tmpl/edit.php +++ b/admin/views/layout/tmpl/edit.php @@ -169,7 +169,7 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) { e.preventDefault(); getSnippets(); }); - + jQuery.fn.selText = function() { var obj = this[0]; if (jQuery.browser.msie) { @@ -187,7 +187,7 @@ jQuery.fn.selText = function() { selection.setBaseAndExtent(obj, 0, obj, 1); } return this; -} +} jQuery('#adminForm').on('change', '#jform_snippet',function (e) { e.preventDefault(); diff --git a/admin/views/libraries/tmpl/default_body.php b/admin/views/libraries/tmpl/default_body.php index 43316c806..8733ee276 100644 --- a/admin/views/libraries/tmpl/default_body.php +++ b/admin/views/libraries/tmpl/default_body.php @@ -85,7 +85,7 @@ $edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit"
escape($item->name); ?>
- +
get('library_config.edit') && $library_config_id = ComponentbuilderHelper::getVar('library_config', $item->id, 'library', 'id')): ?> @@ -94,7 +94,7 @@ $edit = "index.php?option=com_componentbuilder&view=libraries&task=library.edit"
- + escape($item->description); ?> diff --git a/admin/views/library/tmpl/edit.php b/admin/views/library/tmpl/edit.php index fab30427f..adbd19692 100644 --- a/admin/views/library/tmpl/edit.php +++ b/admin/views/library/tmpl/edit.php @@ -300,7 +300,7 @@ jQuery(document).ready(function(){ } }); }); - + @@ -316,8 +316,8 @@ function JRouter(link) { } ?> return url+link; -} - +} + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -329,5 +329,5 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); +}); diff --git a/admin/views/library/view.html.php b/admin/views/library/view.html.php index 597b905b4..7789a1db9 100644 --- a/admin/views/library/view.html.php +++ b/admin/views/library/view.html.php @@ -199,7 +199,7 @@ class ComponentbuilderViewLibrary extends JViewLegacy $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() . "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 $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'); @@ -207,7 +207,7 @@ class ComponentbuilderViewLibrary extends JViewLegacy // 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/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 $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); JText::script('view not acceptable. Error'); diff --git a/admin/views/server/tmpl/edit.php b/admin/views/server/tmpl/edit.php index cb3575c99..b39ddc78a 100644 --- a/admin/views/server/tmpl/edit.php +++ b/admin/views/server/tmpl/edit.php @@ -234,37 +234,71 @@ jQuery('#adminForm').on('change', '#jform_authentication',function (e) }); -// #jform_authentication listeners for authentication_vvvvway 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 +// #jform_protocol listeners for protocol_vvvvwaz function jQuery('#jform_protocol').on('keyup',function() { - var authentication_vvvvway = jQuery("#jform_authentication").val(); - var protocol_vvvvway = jQuery("#jform_protocol").val(); - vvvvway(authentication_vvvvway,protocol_vvvvway); + var protocol_vvvvwaz = jQuery("#jform_protocol").val(); + var authentication_vvvvwaz = jQuery("#jform_authentication").val(); + vvvvwaz(protocol_vvvvwaz,authentication_vvvvwaz); }); jQuery('#adminForm').on('change', '#jform_protocol',function (e) { e.preventDefault(); - var authentication_vvvvway = jQuery("#jform_authentication").val(); - var protocol_vvvvway = jQuery("#jform_protocol").val(); - vvvvway(authentication_vvvvway,protocol_vvvvway); + var protocol_vvvvwaz = jQuery("#jform_protocol").val(); + var authentication_vvvvwaz = jQuery("#jform_authentication").val(); + 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); }); diff --git a/admin/views/server/view.html.php b/admin/views/server/view.html.php index 993a06a09..ea5621a46 100644 --- a/admin/views/server/view.html.php +++ b/admin/views/server/view.html.php @@ -64,7 +64,7 @@ class ComponentbuilderViewServer extends JViewLegacy } // Get Linked view data - $this->wanlinked_components = $this->get('Wanlinked_components'); + $this->wamlinked_components = $this->get('Wamlinked_components'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/site_view/tmpl/edit.php b/admin/views/site_view/tmpl/edit.php index 4c75928d5..2f3d422c8 100644 --- a/admin/views/site_view/tmpl/edit.php +++ b/admin/views/site_view/tmpl/edit.php @@ -382,7 +382,7 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) { e.preventDefault(); getSnippets(); }); - + jQuery.fn.selText = function() { var obj = this[0]; if (jQuery.browser.msie) { @@ -400,7 +400,7 @@ jQuery.fn.selText = function() { selection.setBaseAndExtent(obj, 0, obj, 1); } return this; -} +} jQuery('#adminForm').on('change', '#jform_snippet',function (e) { e.preventDefault(); @@ -436,7 +436,7 @@ jQuery(document).ready(function() { // some lang strings var select_a_snippet = ''; var create_a_snippet = ''; - + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -448,5 +448,5 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); +}); diff --git a/admin/views/site_view/view.html.php b/admin/views/site_view/view.html.php index c37a58b80..4e46f8877 100644 --- a/admin/views/site_view/view.html.php +++ b/admin/views/site_view/view.html.php @@ -199,7 +199,7 @@ class ComponentbuilderViewSite_view extends JViewLegacy $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() . "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 $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'); @@ -207,7 +207,7 @@ class ComponentbuilderViewSite_view extends JViewLegacy // 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/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 $this->document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); JText::script('view not acceptable. Error'); diff --git a/admin/views/template/tmpl/edit.php b/admin/views/template/tmpl/edit.php index 694ef30cd..df5ed50d0 100644 --- a/admin/views/template/tmpl/edit.php +++ b/admin/views/template/tmpl/edit.php @@ -169,7 +169,7 @@ jQuery('#adminForm').on('change', '#jform_libraries',function (e) { e.preventDefault(); getSnippets(); }); - + jQuery.fn.selText = function() { var obj = this[0]; if (jQuery.browser.msie) { @@ -187,7 +187,7 @@ jQuery.fn.selText = function() { selection.setBaseAndExtent(obj, 0, obj, 1); } return this; -} +} jQuery('#adminForm').on('change', '#jform_snippet',function (e) { e.preventDefault(); diff --git a/componentbuilder.xml b/componentbuilder.xml index 5d9fdb75e..d9a248da1 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 20th February, 2018 + 27th February, 2018 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://joomlacomponentbuilder.com Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 2.6.16 + 2.6.17 Component Builder (v.2.6.16) +

Component Builder (v.2.6.17)

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. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index 158e30f10..92e6cff93 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -441,4 +441,21 @@ http://joomlacomponentbuilder.com + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.6.17 + http://joomlacomponentbuilder.com + + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.6.17/JCB_v2.6.17.zip + + + stable + + Llewellyn van der Merwe + http://joomlacomponentbuilder.com + + \ No newline at end of file diff --git a/script.php b/script.php index 370646267..80a1309dc 100644 --- a/script.php +++ b/script.php @@ -3398,7 +3398,7 @@ class com_componentbuilderInstallerScript $server->type_title = '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->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->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_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->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->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 ' -

Upgrade to Version 2.6.16 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 2.6.17 Was Successful! Let us know if anything is not working as expected.

'; } } } diff --git a/site/controllers/api.php b/site/controllers/api.php index 8d20f0a69..d06725dff 100644 --- a/site/controllers/api.php +++ b/site/controllers/api.php @@ -49,7 +49,116 @@ class ComponentbuilderControllerApi extends JControllerForm 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() { // 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'); return; } - + protected function getApiUser() { // return user object diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index f07f952ad..8d312f13c 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -369,7 +369,7 @@ abstract class ComponentbuilderHelper // load this for all jimport('joomla.application'); } - + /** * Remove folders with files * @@ -435,7 +435,7 @@ abstract class ComponentbuilderHelper } return false; } - + /** * The dynamic builder of views, tables and fields **/ @@ -444,7 +444,7 @@ abstract class ComponentbuilderHelper self::autoLoader('extrusion'); $extruder = new Extrusion($data); } - + /** * The zipper method * @@ -494,8 +494,8 @@ abstract class ComponentbuilderHelper } return false; } - - + + /** * Write a file to the server * @@ -527,7 +527,7 @@ abstract class ComponentbuilderHelper } return $klaar; } - + public static function getFieldOptions($value, $type, $settings = array()) { // Get a db connection. @@ -729,7 +729,7 @@ abstract class ComponentbuilderHelper // noting for now return true; } - + /** * the Butler **/ @@ -777,7 +777,7 @@ abstract class ComponentbuilderHelper } return self::$localSession[$key]; } - + /** * check if it is a new hash **/ @@ -801,7 +801,33 @@ abstract class ComponentbuilderHelper } 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 * @@ -843,8 +869,8 @@ abstract class ComponentbuilderHelper } } return $exists; - } - + } + /** * Get the file path or url * @@ -914,8 +940,8 @@ abstract class ComponentbuilderHelper // sanitize the path return '/' . trim( $filePath, '/' ) . '/' . $fileName; } - - + + /** * Get the file path or url * @@ -955,8 +981,8 @@ abstract class ComponentbuilderHelper // sanitize the path return '/' . trim( $folderPath, '/' ) . '/'; } - - + + /** * get the content of a file * @@ -1008,17 +1034,28 @@ abstract class ComponentbuilderHelper } return $none; } - - + + + /** + * Composer Switch + **/ + protected static $composer = false; + /** * Load the Composer Vendors **/ public static function composerAutoload() { - // load the autoloader - require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/vendor/autoload.php'; - } - + // insure we load the composer vendors only once + 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 * @@ -1144,47 +1181,99 @@ abstract class ComponentbuilderHelper } break; case 2: // private key file - $rsa = new phpseclib\Crypt\RSA(); - // check if we have a passprase - if (self::checkString($server->secret)) + if (self::checkObject(self::crypt('RSA'))) { - $rsa->setPassword($server->secret); - } - // now load the key file - if (!$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, $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; + // check if we have a passprase + 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, 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; case 3: // both password and private key file - $rsa = new phpseclib\Crypt\RSA(); - // check if we have a passphrase - if (self::checkString($server->secret)) + if (self::checkObject(self::crypt('RSA'))) { - $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 - if (!$rsa->loadKey(self::getFileContents($server->private, null))) + break; + 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'); - unset(self::$sftp[$server->cache]); - return false; + // check if we have a passprase + if (self::checkString($server->secret)) + { + 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 - if (!self::$sftp[$server->cache]->login($server->username, $server->password, $rsa)) + break; + 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'); - unset(self::$sftp[$server->cache]); - return false; + // 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($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; } @@ -1328,9 +1417,9 @@ abstract class ComponentbuilderHelper if (2 == $protocol) { // 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 = array('authentication','username','host','password','port','private','secret'); + $cache = array('authentication','username','host','password','port','private','private_key','secret'); } else { @@ -1348,7 +1437,7 @@ abstract class ComponentbuilderHelper { $server = $db->loadObject(); // Get the basic encryption. - $basickey = self::getCryptKey('basic'); + $basickey = self::getCryptKey('basic', 'Th1sMnsTbL0ck@d'); // Get the encryption object. $basic = new FOFEncryptAes($basickey, 128); // 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'); return false; } - public static function jsonToString($value, $sperator = ", ", $table = null) { @@ -1559,23 +1647,43 @@ abstract class ComponentbuilderHelper /** * 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 $fullPath = $path . '/models'; + // set prefix + $prefix = $component.'Model'; // load the model file - JModelLegacy::addIncludePath($fullPath); + JModelLegacy::addIncludePath($fullPath, $prefix); // get instance - $model = JModelLegacy::getInstance( $name, $component.'Model' ); - // if model not found + $model = JModelLegacy::getInstance($name, $prefix, $config); + // if model not found (strange) if ($model == false) { - require_once $fullPath.'/'.strtolower($name).'.php'; - // build class name - $class = $prefix.$name; - // initialize the model - new $class(); - $model = JModelLegacy::getInstance($name, $prefix); + jimport('joomla.filesystem.file'); + // get file path + $filePath = $path.'/'.$name.'.php'; + $fullPath = $fullPath.'/'.$name.'.php'; + // 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; } diff --git a/site/language/en-GB/en-GB.com_componentbuilder.ini b/site/language/en-GB/en-GB.com_componentbuilder.ini index 8a60fd1a0..9a74d9c42 100644 --- a/site/language/en-GB/en-GB.com_componentbuilder.ini +++ b/site/language/en-GB/en-GB.com_componentbuilder.ini @@ -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 %s has failed, please check that your details are correct!" COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="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 %s server!" COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for %s server!" COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED="The server details for (ID: %s) could not be retrieved!" COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."