diff --git a/README.md b/README.md index b2a86bc53..1c130f6d8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,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.9.21) 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.9.32) 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) @@ -146,14 +146,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 8th July, 2019 -+ *Version*: 2.9.21 ++ *Last Build*: 15th July, 2019 ++ *Version*: 2.9.32 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **210080** -+ *Field count*: **1143** -+ *File count*: **1346** -+ *Folder count*: **209** ++ *Line count*: **232323** ++ *Field count*: **1221** ++ *File count*: **1497** ++ *Folder count*: **229** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index b2a86bc53..1c130f6d8 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,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.9.21) 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.9.32) 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) @@ -146,14 +146,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 8th July, 2019 -+ *Version*: 2.9.21 ++ *Last Build*: 15th July, 2019 ++ *Version*: 2.9.32 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **210080** -+ *Field count*: **1143** -+ *File count*: **1346** -+ *Folder count*: **209** ++ *Line count*: **232323** ++ *Field count*: **1221** ++ *File count*: **1497** ++ *Folder count*: **229** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/access.xml b/admin/access.xml index f2126b51a..7e62111cc 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -71,6 +71,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -271,7 +305,6 @@ - @@ -281,6 +314,25 @@ + + + + + + + + + + + + + + + + + + + @@ -406,6 +458,7 @@ + @@ -430,6 +483,17 @@ +
+ + + + + + + + + +
@@ -497,6 +561,28 @@
+
+ + + + + + + + + +
+
+ + + + + + + + + +
@@ -774,6 +860,20 @@
+
+ + + + + + + + + +
+
+ +
diff --git a/admin/assets/css/class_extendings.css b/admin/assets/css/class_extendings.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/class_extendings.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/class_extends.css b/admin/assets/css/class_extends.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/class_extends.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/class_method.css b/admin/assets/css/class_method.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/class_method.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/class_methods.css b/admin/assets/css/class_methods.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/class_methods.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/class_properties.css b/admin/assets/css/class_properties.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/class_properties.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/class_property.css b/admin/assets/css/class_property.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/class_property.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/joomla_plugin.css b/admin/assets/css/joomla_plugin.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/joomla_plugin.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/joomla_plugin_group.css b/admin/assets/css/joomla_plugin_group.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/joomla_plugin_group.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/joomla_plugin_groups.css b/admin/assets/css/joomla_plugin_groups.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/joomla_plugin_groups.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/joomla_plugins.css b/admin/assets/css/joomla_plugins.css new file mode 100644 index 000000000..3d7b98b8f --- /dev/null +++ b/admin/assets/css/joomla_plugins.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/images/icons/joomla_component_add.png b/admin/assets/images/icons/joomla_component_add.png deleted file mode 100644 index cf9ee7dc5..000000000 Binary files a/admin/assets/images/icons/joomla_component_add.png and /dev/null differ diff --git a/admin/assets/images/icons/joomla_plugins.png b/admin/assets/images/icons/joomla_plugins.png new file mode 100644 index 000000000..72ea64609 Binary files /dev/null and b/admin/assets/images/icons/joomla_plugins.png differ diff --git a/admin/controller.php b/admin/controller.php index bf6e8d93d..df9e9fdbf 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -91,6 +91,7 @@ class ComponentbuilderController extends JControllerLegacy // the view relationships $views = array( 'joomla_component' => 'joomla_components', + 'joomla_plugin' => 'joomla_plugins', 'admin_view' => 'admin_views', 'custom_admin_view' => 'custom_admin_views', 'site_view' => 'site_views', @@ -98,6 +99,8 @@ class ComponentbuilderController extends JControllerLegacy 'layout' => 'layouts', 'dynamic_get' => 'dynamic_gets', 'custom_code' => 'custom_codes', + 'class_property' => 'class_properties', + 'class_method' => 'class_methods', 'placeholder' => 'placeholders', 'library' => 'libraries', 'snippet' => 'snippets', @@ -124,7 +127,9 @@ class ComponentbuilderController extends JControllerLegacy 'component_placeholders' => 'components_placeholders', 'snippet_type' => 'snippet_types', 'library_config' => 'libraries_config', - 'library_files_folders_urls' => 'libraries_files_folders_urls' + 'library_files_folders_urls' => 'libraries_files_folders_urls', + 'class_extends' => 'class_extendings', + 'joomla_plugin_group' => 'joomla_plugin_groups' ); // check if this is a list view if (in_array($view, $views)) diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 53ff59742..3a4830f3b 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -31,6 +31,8 @@ class ComponentbuilderControllerAjax extends JControllerLegacy $this->registerTask('getCronPath', 'ajax'); $this->registerTask('getJCBpackageInfo', 'ajax'); $this->registerTask('getCrowdinDetails', 'ajax'); + $this->registerTask('getClassCode', 'ajax'); + $this->registerTask('getClassCodeIds', 'ajax'); $this->registerTask('tableColumns', 'ajax'); $this->registerTask('fieldSelectOptions', 'ajax'); $this->registerTask('getDynamicScripts', 'ajax'); @@ -301,6 +303,84 @@ class ComponentbuilderControllerAjax extends JControllerLegacy } } break; + case 'getClassCode': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $idValue = $jinput->get('id', NULL, 'INT'); + $typeValue = $jinput->get('type', NULL, 'WORD'); + if($idValue && $typeValue && $user->id != 0) + { + $result = $this->getModel('ajax')->getClassCode($idValue, $typeValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } + break; + case 'getClassCodeIds': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $idValue = $jinput->get('id', NULL, 'INT'); + $typeValue = $jinput->get('type', NULL, 'WORD'); + if($idValue && $typeValue && $user->id != 0) + { + $result = $this->getModel('ajax')->getClassCodeIds($idValue, $typeValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } + break; case 'tableColumns': try { diff --git a/admin/controllers/class_extendings.php b/admin/controllers/class_extendings.php new file mode 100644 index 000000000..fdd10006d --- /dev/null +++ b/admin/controllers/class_extendings.php @@ -0,0 +1,43 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_extendings Controller + */ +class ComponentbuilderControllerClass_extendings extends JControllerAdmin +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER_CLASS_EXTENDINGS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Class_extends', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true)) + { + return parent::getModel($name, $prefix, $config); + } +} diff --git a/admin/controllers/class_extends.php b/admin/controllers/class_extends.php new file mode 100644 index 000000000..5464f7dd5 --- /dev/null +++ b/admin/controllers/class_extends.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_extends Controller + */ +class ComponentbuilderControllerClass_extends extends JControllerForm +{ + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ + public function __construct($config = array()) + { + $this->view_list = 'Class_extendings'; // safeguard for setting the return view listing to the main view. + parent::__construct($config); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = array()) + { + // Get user object. + $user = JFactory::getUser(); + // Access check. + $access = $user->authorise('class_extends.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + + // In the absense of better information, revert to the component permissions. + return $user->authorise('class_extends.create', $this->option); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // get user object. + $user = JFactory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + // Access check. + $access = ($user->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $recordId) && $user->authorise('class_extends.access', 'com_componentbuilder')); + if (!$access) + { + return false; + } + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('class_extends.edit.own', 'com_componentbuilder.class_extends.' . $recordId)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + if (empty($ownerId)) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + $ownerId = $record->created_by; + } + + // If the owner matches 'me' then allow. + if ($ownerId == $user->id) + { + if ($user->authorise('class_extends.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return $user->authorise('class_extends.edit', $this->option); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 1.6 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); + + // set the referral options + if ($refid && $ref) + { + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + } + elseif ($ref) + { + $append = '&ref='. (string)$ref . $append; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Class_extends', '', array()); + + // Preset the redirect + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_extendings' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + + $cancel = parent::cancel($key); + + if (!is_null($return) && JUri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + return; + } + +} diff --git a/admin/controllers/class_method.php b/admin/controllers/class_method.php new file mode 100644 index 000000000..986fa6fb4 --- /dev/null +++ b/admin/controllers/class_method.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_method Controller + */ +class ComponentbuilderControllerClass_method extends JControllerForm +{ + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ + public function __construct($config = array()) + { + $this->view_list = 'Class_methods'; // safeguard for setting the return view listing to the main view. + parent::__construct($config); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = array()) + { + // Get user object. + $user = JFactory::getUser(); + // Access check. + $access = $user->authorise('class_method.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + + // In the absense of better information, revert to the component permissions. + return $user->authorise('class_method.create', $this->option); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // get user object. + $user = JFactory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + // Access check. + $access = ($user->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $recordId) && $user->authorise('class_method.access', 'com_componentbuilder')); + if (!$access) + { + return false; + } + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('class_method.edit', 'com_componentbuilder.class_method.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('class_method.edit.own', 'com_componentbuilder.class_method.' . $recordId)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + if (empty($ownerId)) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + $ownerId = $record->created_by; + } + + // If the owner matches 'me' then allow. + if ($ownerId == $user->id) + { + if ($user->authorise('class_method.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return $user->authorise('class_method.edit', $this->option); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 1.6 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); + + // set the referral options + if ($refid && $ref) + { + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + } + elseif ($ref) + { + $append = '&ref='. (string)$ref . $append; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Class_method', '', array()); + + // Preset the redirect + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + + $cancel = parent::cancel($key); + + if (!is_null($return) && JUri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + return; + } + +} diff --git a/admin/controllers/class_methods.php b/admin/controllers/class_methods.php new file mode 100644 index 000000000..af11b3c2c --- /dev/null +++ b/admin/controllers/class_methods.php @@ -0,0 +1,106 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_methods Controller + */ +class ComponentbuilderControllerClass_methods extends JControllerAdmin +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER_CLASS_METHODS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Class_method', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true)) + { + return parent::getModel($name, $prefix, $config); + } + + public function exportData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if export is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('class_method.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) + { + // Get the input + $input = JFactory::getApplication()->input; + $pks = $input->post->get('cid', array(), 'array'); + // Sanitize the input + JArrayHelper::toInteger($pks); + // Get the model + $model = $this->getModel('Class_methods'); + // get the data to export + $data = $model->getExportData($pks); + if (ComponentbuilderHelper::checkArray($data)) + { + // now set the data to the spreadsheet + $date = JFactory::getDate(); + ComponentbuilderHelper::xls($data,'Class_methods_'.$date->format('jS_F_Y'),'Class methods exported ('.$date->format('jS F, Y').')','class methods'); + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); + return; + } + + + public function importData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if import is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('class_method.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) + { + // Get the import model + $model = $this->getModel('Class_methods'); + // get the headers to import + $headers = $model->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + // Load headers to session. + $session = JFactory::getSession(); + $headers = json_encode($headers); + $session->set('class_method_VDM_IMPORTHEADERS', $headers); + $session->set('backto_VDM_IMPORT', 'class_methods'); + $session->set('dataType_VDM_IMPORTINTO', 'class_method'); + // Redirect to import view. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_METHODS'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + return; + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); + return; + } +} diff --git a/admin/controllers/class_properties.php b/admin/controllers/class_properties.php new file mode 100644 index 000000000..80b1b40e0 --- /dev/null +++ b/admin/controllers/class_properties.php @@ -0,0 +1,106 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_properties Controller + */ +class ComponentbuilderControllerClass_properties extends JControllerAdmin +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER_CLASS_PROPERTIES'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Class_property', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true)) + { + return parent::getModel($name, $prefix, $config); + } + + public function exportData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if export is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('class_property.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) + { + // Get the input + $input = JFactory::getApplication()->input; + $pks = $input->post->get('cid', array(), 'array'); + // Sanitize the input + JArrayHelper::toInteger($pks); + // Get the model + $model = $this->getModel('Class_properties'); + // get the data to export + $data = $model->getExportData($pks); + if (ComponentbuilderHelper::checkArray($data)) + { + // now set the data to the spreadsheet + $date = JFactory::getDate(); + ComponentbuilderHelper::xls($data,'Class_properties_'.$date->format('jS_F_Y'),'Class properties exported ('.$date->format('jS F, Y').')','class properties'); + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); + return; + } + + + public function importData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if import is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('class_property.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) + { + // Get the import model + $model = $this->getModel('Class_properties'); + // get the headers to import + $headers = $model->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + // Load headers to session. + $session = JFactory::getSession(); + $headers = json_encode($headers); + $session->set('class_property_VDM_IMPORTHEADERS', $headers); + $session->set('backto_VDM_IMPORT', 'class_properties'); + $session->set('dataType_VDM_IMPORTINTO', 'class_property'); + // Redirect to import view. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_PROPERTIES'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + return; + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); + return; + } +} diff --git a/admin/controllers/class_property.php b/admin/controllers/class_property.php new file mode 100644 index 000000000..2dc93983d --- /dev/null +++ b/admin/controllers/class_property.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_property Controller + */ +class ComponentbuilderControllerClass_property extends JControllerForm +{ + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ + public function __construct($config = array()) + { + $this->view_list = 'Class_properties'; // safeguard for setting the return view listing to the main view. + parent::__construct($config); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = array()) + { + // Get user object. + $user = JFactory::getUser(); + // Access check. + $access = $user->authorise('class_property.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + + // In the absense of better information, revert to the component permissions. + return $user->authorise('class_property.create', $this->option); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // get user object. + $user = JFactory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + // Access check. + $access = ($user->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $recordId) && $user->authorise('class_property.access', 'com_componentbuilder')); + if (!$access) + { + return false; + } + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('class_property.edit', 'com_componentbuilder.class_property.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('class_property.edit.own', 'com_componentbuilder.class_property.' . $recordId)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + if (empty($ownerId)) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + $ownerId = $record->created_by; + } + + // If the owner matches 'me' then allow. + if ($ownerId == $user->id) + { + if ($user->authorise('class_property.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return $user->authorise('class_property.edit', $this->option); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 1.6 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); + + // set the referral options + if ($refid && $ref) + { + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + } + elseif ($ref) + { + $append = '&ref='. (string)$ref . $append; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Class_property', '', array()); + + // Preset the redirect + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + + $cancel = parent::cancel($key); + + if (!is_null($return) && JUri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + return; + } + +} diff --git a/admin/controllers/joomla_plugin.php b/admin/controllers/joomla_plugin.php new file mode 100644 index 000000000..9ed910e52 --- /dev/null +++ b/admin/controllers/joomla_plugin.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Joomla_plugin Controller + */ +class ComponentbuilderControllerJoomla_plugin extends JControllerForm +{ + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ + public function __construct($config = array()) + { + $this->view_list = 'Joomla_plugins'; // safeguard for setting the return view listing to the main view. + parent::__construct($config); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = array()) + { + // Get user object. + $user = JFactory::getUser(); + // Access check. + $access = $user->authorise('joomla_plugin.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + + // In the absense of better information, revert to the component permissions. + return $user->authorise('joomla_plugin.create', $this->option); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // get user object. + $user = JFactory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + // Access check. + $access = ($user->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $recordId) && $user->authorise('joomla_plugin.access', 'com_componentbuilder')); + if (!$access) + { + return false; + } + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('joomla_plugin.edit', 'com_componentbuilder.joomla_plugin.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('joomla_plugin.edit.own', 'com_componentbuilder.joomla_plugin.' . $recordId)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + if (empty($ownerId)) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + $ownerId = $record->created_by; + } + + // If the owner matches 'me' then allow. + if ($ownerId == $user->id) + { + if ($user->authorise('joomla_plugin.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return $user->authorise('joomla_plugin.edit', $this->option); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 1.6 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); + + // set the referral options + if ($refid && $ref) + { + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + } + elseif ($ref) + { + $append = '&ref='. (string)$ref . $append; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Joomla_plugin', '', array()); + + // Preset the redirect + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + + $cancel = parent::cancel($key); + + if (!is_null($return) && JUri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + return; + } + +} diff --git a/admin/controllers/joomla_plugin_group.php b/admin/controllers/joomla_plugin_group.php new file mode 100644 index 000000000..b22c31396 --- /dev/null +++ b/admin/controllers/joomla_plugin_group.php @@ -0,0 +1,314 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Joomla_plugin_group Controller + */ +class ComponentbuilderControllerJoomla_plugin_group extends JControllerForm +{ + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ + public function __construct($config = array()) + { + $this->view_list = 'Joomla_plugin_groups'; // safeguard for setting the return view listing to the main view. + parent::__construct($config); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = array()) + { + // Get user object. + $user = JFactory::getUser(); + // Access check. + $access = $user->authorise('joomla_plugin_group.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + + // In the absense of better information, revert to the component permissions. + return parent::allowAdd($data); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // get user object. + $user = JFactory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('core.edit', 'com_componentbuilder.joomla_plugin_group.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('core.edit.own', 'com_componentbuilder.joomla_plugin_group.' . $recordId)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + if (empty($ownerId)) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + $ownerId = $record->created_by; + } + + // If the owner matches 'me' then allow. + if ($ownerId == $user->id) + { + if ($user->authorise('core.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return parent::allowEdit($data, $key); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 1.6 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); + + // set the referral options + if ($refid && $ref) + { + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + } + elseif ($ref) + { + $append = '&ref='. (string)$ref . $append; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Joomla_plugin_group', '', array()); + + // Preset the redirect + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugin_groups' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + + $cancel = parent::cancel($key); + + if (!is_null($return) && JUri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + return; + } + +} diff --git a/admin/controllers/joomla_plugin_groups.php b/admin/controllers/joomla_plugin_groups.php new file mode 100644 index 000000000..3cee15bba --- /dev/null +++ b/admin/controllers/joomla_plugin_groups.php @@ -0,0 +1,43 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Joomla_plugin_groups Controller + */ +class ComponentbuilderControllerJoomla_plugin_groups extends JControllerAdmin +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Joomla_plugin_group', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true)) + { + return parent::getModel($name, $prefix, $config); + } +} diff --git a/admin/controllers/joomla_plugins.php b/admin/controllers/joomla_plugins.php new file mode 100644 index 000000000..b78efc394 --- /dev/null +++ b/admin/controllers/joomla_plugins.php @@ -0,0 +1,182 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Joomla_plugins Controller + */ +class ComponentbuilderControllerJoomla_plugins extends JControllerAdmin +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER_JOOMLA_PLUGINS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Joomla_plugin', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true)) + { + return parent::getModel($name, $prefix, $config); + } + + public function exportData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if export is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('joomla_plugin.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) + { + // Get the input + $input = JFactory::getApplication()->input; + $pks = $input->post->get('cid', array(), 'array'); + // Sanitize the input + JArrayHelper::toInteger($pks); + // Get the model + $model = $this->getModel('Joomla_plugins'); + // get the data to export + $data = $model->getExportData($pks); + if (ComponentbuilderHelper::checkArray($data)) + { + // now set the data to the spreadsheet + $date = JFactory::getDate(); + ComponentbuilderHelper::xls($data,'Joomla_plugins_'.$date->format('jS_F_Y'),'Joomla plugins exported ('.$date->format('jS F, Y').')','joomla plugins'); + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins', false), $message, 'error'); + return; + } + + + public function importData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if import is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('joomla_plugin.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) + { + // Get the import model + $model = $this->getModel('Joomla_plugins'); + // get the headers to import + $headers = $model->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + // Load headers to session. + $session = JFactory::getSession(); + $headers = json_encode($headers); + $session->set('joomla_plugin_VDM_IMPORTHEADERS', $headers); + $session->set('backto_VDM_IMPORT', 'joomla_plugins'); + $session->set('dataType_VDM_IMPORTINTO', 'joomla_plugin'); + // Redirect to import view. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_PLUGINS'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + return; + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins', false), $message, 'error'); + return; + } + + + /** + * Run the Expansion + * + * @return void + */ + public function runExpansion() + { + // Check for request forgeries + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + // check if user has the right + $user = JFactory::getUser(); + // set page redirect + $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins', false); + // set massage + $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + // check if this user has the right to run expansion + if($user->authorise('joomla_plugins.run_expansion', 'com_componentbuilder')) + { + // set massage + $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + // run expansion via API + $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + // is there a message returned + if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) + { + $this->setRedirect($redirect_url, $result); + return true; + } + elseif (is_numeric($result) && 1 == $result) + { + $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $this->setRedirect($redirect_url, $message, 'message'); + return true; + } + } + $this->setRedirect($redirect_url, $message, 'error'); + return false; + } + + + /** + * get Boilerplate + * + * @return boolean + */ + public function getBoilerplate() + { + // Check for request forgeries + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + // check if user has the right + $user = JFactory::getUser(); + // set page redirect + $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins', false); + // set massage + $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_GET_BOILERPLATE_MODULE'); + // check if this user has the right to run expansion + if($user->authorise('joomla_plugin.get_boilerplate', 'com_componentbuilder')) + { + // set massage + $message = JText::_('COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_FAILED_IF_THE_ISSUE_CONTINUES_INFORM_YOUR_SYSTEM_ADMINISTRATOR'); + // Get the model + $model = $this->getModel('joomla_plugins'); + // check if there is any selections + if (!$model->getBoilerplate()) + { + $message = '' . JText::_('COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_WAS_SUCCESSFULLY') . ''; + $this->setRedirect($redirect_url, $message, 'message'); + return true; + } + } + $this->setRedirect($redirect_url, $message, 'error'); + return false; + } + +} diff --git a/admin/controllers/validation_rules.php b/admin/controllers/validation_rules.php index 02462dc22..ee89c1c18 100644 --- a/admin/controllers/validation_rules.php +++ b/admin/controllers/validation_rules.php @@ -102,5 +102,46 @@ class ComponentbuilderControllerValidation_rules extends JControllerAdmin $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=validation_rules', false), $message, 'error'); return; + } + + + /** + * Run the Expansion + * + * @return void + */ + public function runExpansion() + { + // Check for request forgeries + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + // check if user has the right + $user = JFactory::getUser(); + // set page redirect + $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=validation_rules', false); + // set massage + $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + // check if this user has the right to run expansion + if($user->authorise('validation_rules.run_expansion', 'com_componentbuilder')) + { + // set massage + $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + // run expansion via API + $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + // is there a message returned + if (!is_numeric($result) && ComponentbuilderHelper::checkString($result)) + { + $this->setRedirect($redirect_url, $result); + return true; + } + elseif (is_numeric($result) && 1 == $result) + { + $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $this->setRedirect($redirect_url, $message, 'message'); + return true; + } + } + $this->setRedirect($redirect_url, $message, 'error'); + return false; } + } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index d3dfb9d3e..e21f8ffdb 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -70,6 +70,12 @@ abstract class ComponentbuilderHelper public static $jcbGithubPackagesUrl = "https://api.github.com/repos/vdm-io/JCB-Community-Packages/git/trees/master"; public static $jcbGithubPackageUrl = "https://github.com/vdm-io/JCB-Community-Packages/raw/master/"; + /** + * The bolerplate paths + **/ + public static $bolerplatePath = 'https://raw.githubusercontent.com/vdm-io/boilerplate/jcb/'; + public static $bolerplateAPI = 'https://api.github.com/repos/vdm-io/boilerplate/git/trees/jcb'; + // not needed at this time (maybe latter) public static $accessToken = ""; @@ -125,64 +131,509 @@ abstract class ComponentbuilderHelper ); /** - * get the method code + * get the class method or property * - * @input int The method ID + * @input int The method/property ID + * @input string The target type * * @returns string on success **/ - public static function getMethodCode($id) + public static function getClassCode($id, $type) { - // Get a db connection. - $db = JFactory::getDbo(); - // Create a new query object. - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.comment','a.name','a.visibility','a.params','a.code'))); - $query->from($db->quoteName('#__componentbuilder_method','a')); - $query->where($db->quoteName('a.id') . ' = ' . (int) $id); - // Implement View Level Access - if (!$user->authorise('core.options', 'com_componentbuilder')) + if ('property' === $type || 'method' === $type) { - $columns = $db->getTableColumns('#__componentbuilder_method'); - if(isset($columns['access'])) + // Get a db connection. + $db = JFactory::getDbo(); + // Get user object + $user = JFactory::getUser(); + // Create a new query object. + $query = $db->getQuery(true); + // get method + if ('method' === $type) { - $groups = implode(',', $user->getAuthorisedViewLevels()); - $query->where('a.access IN (' . $groups . ')'); + $query->select($db->quoteName(array('a.comment','a.name','a.visibility','a.arguments','a.code'))); } - } - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) - { - // get the method - $method = $db->loadObject; - // combine method values - $combinded = array(); - // add comment if set - if (self::checkString($method->comment)) + // get property + elseif ('property' === $type) { - $combinded[] = $method->comment; + $query->select($db->quoteName(array('a.comment','a.name','a.visibility','a.default'))); } - // set the method sginature - $combinded[] = "\t" . $method->visibility . ' function ' . $method->name . '(' . $method->params . ')'; - // set the method code - $combinded[] = "\t" . "{"; - // add comment if set - if (self::checkString($method->code)) + $query->from($db->quoteName('#__componentbuilder_class_' . $type,'a')); + $query->where($db->quoteName('a.id') . ' = ' . (int) $id); + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) { - $combinded[] = $method->code; + $columns = $db->getTableColumns('#__componentbuilder_class_' . $type); + if(isset($columns['access'])) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } } - else + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) { - $combinded[] = "\t\t// add your code here"; + // get the code + $code = $db->loadObject(); + // combine method values + $combinded = array(); + // add comment if set + if (self::checkString($code->comment)) + { + $comment = array_map('trim', (array) explode(PHP_EOL, base64_decode($code->comment))); + $combinded[] = "\t" . implode(PHP_EOL . "\t ", $comment); + } + // build method + if ('method' === $type) + { + // set the method signature + if (self::checkString($code->arguments)) + { + $combinded[] = "\t" . $code->visibility . ' function ' . $code->name . '(' . base64_decode($code->arguments) . ')'; + } + else + { + $combinded[] = "\t" . $code->visibility . ' function ' . $code->name . '()'; + } + // set the method code + $combinded[] = "\t" . "{"; + // add code if set + if (self::checkString(trim($code->code))) + { + $combinded[] = base64_decode($code->code); + } + else + { + $combinded[] = "\t\t// add your code here"; + } + $combinded[] = "\t" . "}"; + } + else + { + if (self::checkString($code->default)) + { + $code->default = base64_decode($code->default); + if (is_int($code->default)) + { + // set the class property + $combinded[] = "\t" . $code->visibility . ' $' . $code->name . ' = ' . (int) $code->default . ';'; + } + elseif (is_float($code->default)) + { + // set the class property + $combinded[] = "\t" . $code->visibility . ' $' . $code->name . ' = ' . (float) $code->default . ';'; + } + elseif (('false' === $code->default || 'true' === $code->default) + || (self::checkString($code->default) && (strpos($code->default, 'array(') !== false || strpos($code->default, '"') !== false))) + { + // set the class property + $combinded[] = "\t" . $code->visibility . ' $' . $code->name . ' = ' . $code->default . ';'; + } + elseif (self::checkString($code->default) && strpos($code->default, '"') === false) + { + // set the class property + $combinded[] = "\t" . $code->visibility . ' $' . $code->name . ' = "' . $code->default . '";'; + } + else + { + // set the class property + $combinded[] = "\t" . $code->visibility . ' $' . $code->name . ';'; + } + } + else + { + // set the class property + $combinded[] = "\t" . $code->visibility . ' $' . $code->name . ';'; + } + } + // return the code + return implode(PHP_EOL, $combinded); } - $combinded[] = "\t" . "}"; - // return the method - return implode(PHP_EOL, $combinded); } return false; } + /** + * extract Boilerplate Class Extends + * + * @input string The class as a string + * @input string The type of class/extension + * + * @returns string on success + **/ + public static function extractBoilerplateClassExtends(&$class, $type) + { + if (($strings = self::getAllBetween($class, 'class ', '}')) !== false && self::checkArray($strings)) + { + foreach ($strings as $string) + { + if (($extends = self::getBetween($string, 'extends ', '{')) !== false && self::checkString($extends)) + { + return trim($extends); + } + } + } + return false; + } + + /** + * extract Boilerplate Class Header + * + * @input string The class as a string + * @input string The class being extended + * @input string The type of class/extension + * + * @returns string on success + **/ + public static function extractBoilerplateClassHeader(&$class, $extends, $type) + { + if (($string = self::getBetween($class, "defined('_JEXEC')", 'extends ' . $extends)) !== false && self::checkString($string)) + { + $headArray = explode(PHP_EOL, $string); + if (self::checkArray($headArray) && count($headArray) > 3) + { + // remove first since it still has the [or die;] string in it + array_shift($headArray); + // remove the last since it has the class declaration + array_pop($headArray); + // at this point we have the class comment still in as part of the header, lets remove that + $last = count($headArray); + while ($last > 0) + { + $last--; + if (isset($headArray[$last]) && strpos($headArray[$last], '*') !== false) + { + unset($headArray[$last]); + } + else + { + // moment the comment stops, we break out + $last = 0; + } + } + // make sure we only return if we have values + if (self::checkArray($headArray)) + { + return implode(PHP_EOL, $headArray); + } + } + } + return false; + } + + /** + * extract Boilerplate Class Comment + * + * @input string The class as a string + * @input string The class being extended + * @input string The type of class/extension + * + * @returns string on success + **/ + public static function extractBoilerplateClassComment(&$class, $extends, $type) + { + if (($string = self::getBetween($class, "defined('_JEXEC')", 'extends ' . $extends)) !== false && self::checkString($string)) + { + $headArray = explode(PHP_EOL, $string); + if (self::checkArray($headArray) && count($headArray) > 3) + { + $comment = array(); + // remove the last since it has the class declaration + array_pop($headArray); + // at this point we have the class comment still in as part of the header, lets remove that + $last = count($headArray); + while ($last > 0) + { + $last--; + if (isset($headArray[$last]) && strpos($headArray[$last], '*') !== false) + { + $comment[$last] = $headArray[$last]; + } + else + { + // moment the comment stops, we break out + $last = 0; + } + } + // make sure we only return if we have values + if (self::checkArray($comment)) + { + // set the correct order + ksort($comment); + return implode(PHP_EOL, $comment); + } + } + } + return false; + } + + /** + * extract Boilerplate Class Properties & Methods + * + * @input string The class as a string + * @input string The class being extended + * @input string The type of class/extension + * @input int The plugin groups + * + * @returns string on success + **/ + public static function extractBoilerplateClassPropertiesMethods(&$class, $extends, $type, $plugin_group = null) + { + $bucket = array('property' => array(), 'method' => array()); + // get the class code, and remove the head + $codeArrayTmp = explode('extends ' . $extends, $class); + // make sure we have the correct result + if (self::checkArray($codeArrayTmp) && count($codeArrayTmp) == 2) + { + // the triggers + $triggers = array('public' => 1, 'protected' => 2, 'private' => 3); + $codeArray = explode(PHP_EOL, $codeArrayTmp[1]); + unset($codeArrayTmp); + // clean the code + self::cleanBoilerplateCode($codeArray); + // temp bucket + $name = null; + $arg = null; + $target = null; + $visibility = null; + $tmp = array(); + $comment = array(); + // load method + $loadCode = function (&$bucket, &$target, &$name, &$arg, &$visibility, &$tmp, &$comment) use($type, $plugin_group){ + $_tmp = array( + 'name' => $name, + 'visibility' => $visibility, + 'extension_type' => $type + ); + // build filter + $filters = array('extension_type' => $type); + // add more data based on target + if ('method' === $target && self::checkArray($tmp)) + { + // clean the code + self::cleanBoilerplateCode($tmp); + // only load if there are values + if (self::checkArray($tmp, true)) + { + $_tmp['code'] = implode(PHP_EOL, $tmp); + } + else + { + $_tmp['code'] = ''; + } + // load arguments only if set + if (self::checkString($arg)) + { + $_tmp['arguments'] = $arg; + } + } + elseif ('property' === $target) + { + // load default only if set + if (self::checkString($arg)) + { + $_tmp['default'] = $arg; + } + } + // load comment only if set + if (self::checkArray($comment, true)) + { + $_tmp['comment'] = implode(PHP_EOL, $comment); + } + // load the group target + if ($plugin_group) + { + $_tmp['joomla_plugin_group'] = $plugin_group; + $filters['joomla_plugin_group'] = $plugin_group; + } + // load the local values + if (($locals = self::getLocalBoilerplate($name, $target, $type, $filters)) !== false) + { + foreach ($locals as $key => $value) + { + $_tmp[$key] = $value; + } + } + else + { + $_tmp['id'] = 0; + $_tmp['published'] = 1; + $_tmp['version'] = 1; + } + // store the data based on target + $bucket[$target][] = $_tmp; + }; + // now we start loading + foreach($codeArray as $line) + { + if ($visibility && $target && $name && strpos($line, '/**') !== false) + { + $loadCode($bucket, $target, $name, $arg, $visibility, $tmp, $comment); + // reset loop buckets + $name = null; + $arg = null; + $target = null; + $visibility = null; + $tmp = array(); + $comment = array(); + } + // load the comment before method/property + if (!$visibility && !$target && !$name && strpos($line, '*') !== false) + { + $comment[] = rtrim($line); + } + else + { + if (!$visibility && !$target && !$name) + { + // get the line values + $lineArray = array_values(array_map('trim', preg_split('/\s+/', trim($line)))); + // check if we are at the main line + if (isset($lineArray[0]) && isset($triggers[$lineArray[0]])) + { + $visibility = $lineArray[0]; + if (strpos($line, 'function') !== false) + { + $target = 'method'; + // get the name + $name = trim(self::getBetween($line, 'function ', '(')); + // get the arguments + $arg = trim(self::getBetween($line, ' ' . $name . '(', ')')); + } + else + { + $target = 'property'; + if (strpos($line, '=') !== false) + { + // get the name + $name = trim(self::getBetween($line, '$', '=')); + // get the default + $arg = trim(self::getBetween($line, '=', ';')); + } + else + { + // get the name + $name = trim(self::getBetween($line, '$', ';')); + } + } + } + } + else + { + $tmp[] = rtrim($line); + } + } + } + // check if a last method is still around + if ($visibility && $target && $name) + { + $loadCode($bucket, $target, $name, $arg, $visibility, $tmp, $comment); + // reset loop buckets + $name = null; + $arg = null; + $target = null; + $visibility = null; + $tmp = array(); + $comment = array(); + } + return $bucket; + } + return false; + } + + protected static function getLocalBoilerplate($name, $table, $extension_type, $filters = array()) + { + if ('property' === $table || 'method' === $table) + { + // Get a db connection. + $db = JFactory::getDbo(); + // Create a new query object. + $query = $db->getQuery(true); + // get method + $query->select($db->quoteName(array('a.id','a.published','a.version'))); + $query->from($db->quoteName('#__componentbuilder_class_' . $table,'a')); + $query->where($db->quoteName('a.name') . ' = ' . $db->quote($name)); + $query->where($db->quoteName('a.extension_type') . ' = ' . $db->quote($extension_type)); + // add more filters + if (self::checkArray($filters)) + { + foreach($filters as $where => $value) + { + if (is_numeric($value)) + { + $query->where($db->quoteName('a.' . $where) . ' = ' . $value); + } + else + { + $query->where($db->quoteName('a.' . $where) . ' = ' . $db->quote($value)); + } + } + } + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // get the code + return $db->loadAssoc(); + } + } + return false; + } + + protected static function cleanBoilerplateCode(&$code) + { + // remove the first lines until a { is found + $key = 0; + $found = false; + while (!$found) + { + if (isset($code[$key])) + { + if (strpos($code[$key], '{') !== false) + { + unset($code[$key]); + // only remove the first } found + $found = true; + } + // remove empty lines + elseif (!self::checkString(trim($code[$key]))) + { + unset($code[$key]); + } + } + // check next line + $key++; + // stop loop at line 30 (really this should never happen) + if ($key > 30) + { + $found = true; + } + } + // reset all keys + $code = array_values($code); + // remove last lines until } + $last = count($code); + while ($last > 0) + { + $last--; + if (isset($code[$last])) + { + if (strpos($code[$last], '}') !== false) + { + unset($code[$last]); + // only remove the first } found + $last = 0; + } + // remove empty lines + elseif (!self::checkString(trim($code[$last]))) + { + unset($code[$last]); + } + } + } + } + /** * Making class or function name safe * @@ -198,7 +649,7 @@ abstract class ComponentbuilderHelper $name = self::replaceNumbers($name); } // remove all spaces and strange characters - return trim(reg_replace("/[^A-Za-z0-9]/", '', $name)); + return trim(preg_replace("/[^A-Za-z0-9_-]/", '', $name)); } /** @@ -4862,6 +5313,10 @@ abstract class ComponentbuilderHelper { JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS'), 'index.php?option=com_componentbuilder&view=joomla_components', $submenu === 'joomla_components'); } + if ($user->authorise('joomla_plugin.access', 'com_componentbuilder') && $user->authorise('joomla_plugin.submenu', 'com_componentbuilder')) + { + JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_PLUGINS'), 'index.php?option=com_componentbuilder&view=joomla_plugins', $submenu === 'joomla_plugins'); + } if ($user->authorise('admin_view.access', 'com_componentbuilder') && $user->authorise('admin_view.submenu', 'com_componentbuilder')) { JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_ADMIN_VIEWS'), 'index.php?option=com_componentbuilder&view=admin_views', $submenu === 'admin_views'); diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 3968e9ea5..9f437be66 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -189,7 +189,11 @@ COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_CREATED_DATE_DESC="The date this Admin Cu COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT="Editing the Admin Custom Tabs" COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ERROR_UNIQUE_ALIAS="Another Admin Custom Tabs has the same alias." -COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_HTML_HINT="// Add the tab HTML here. To access php values methodname->value; ?>" +COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_HTML_HINT="// Add the tab HTML here. +// To access php values MethodName->value; ?> +// Note the convention, if in the PHP area above you added a method called getMethodName() +// Then [MethodName] becomes a class variable called $this->MethodName +// Which will hold the value/s your method returned." COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_HTML_LABEL="HTML" COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ID="Id" COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_MODIFIED_BY_DESC="The last user that modified this Admin Custom Tabs." @@ -1370,6 +1374,7 @@ COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME="All is good, t COM_COMPONENTBUILDER_ALL_OF_THESE_PACKAGES_ARE_A_FULLY_DEVELOPEDMAPPED_COMPONENTS_FOR_JCB_THEY_CAN_BE_SEEN_AS_DEMO_CONTENT_OR_BASE_IMAGES_FROM_WHICH_TO_START_YOUR_PROJECTBR_ALWAYS_MAKE_SURE_YOU_ARE_ON_THE_LATEST_VERSION_OF_JCB_BEFORE_IMPORTING_ANY_OF_THESE_PACKAGES_SHOULD_ANY_OF_THEM_FAIL_TO_IMPORT_A_S_PLEASE_LET_US_KNOWA="All of these packages are a fully developed/mapped components for JCB. They can be seen as demo content, or base images from which to start your project.
Always make sure you are on the latest version of JCB before importing any of these packages, should any of them fail to import please let us know." COM_COMPONENTBUILDER_ALL_THE_LANGUAGES_FOUND_IN_JOOMLA_WERE_SUCCESSFULLY_IMPORTED="All the languages found in Joomla were successfully imported." COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="All unsaved work on this page will be lost, are you sure you want to continue?" +COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER="Already selected, try another." COM_COMPONENTBUILDER_ALWAYS_ADD="Always Add" COM_COMPONENTBUILDER_ALWAYS_INSURE_THAT_YOU_HAVE_YOUR_LOCAL_COMPONENTS_BACKED_UP_BY_MAKING_AN_EXPORT_OF_ALL_YOUR_LOCAL_COMPONENTS_BEFORE_IMPORTING_ANY_NEW_COMPONENTS_SMALLMAKE_BSUREB_TO_MOVE_THIS_ZIPPED_BACKUP_PACKAGE_OUT_OF_THE_TMP_FOLDER_BEFORE_DOING_AN_IMPORTSMALLBR_IF_YOU_ARE_IMPORTING_A_PACKAGE_OF_A_THREERD_PARTY_JCB_PACKAGE_DEVELOPER_BMAKE_SURE_IT_IS_A_REPUTABLE_JCB_PACKAGE_DEVELOPERSB_A_SFIND_OUT_WHYA="Always insure that you have your local components backed up, by making an export of all your local components before importing any new components. (Make SURE to move this zipped backup package out of the tmp folder before doing an import)
If you are importing a package of a 3rd party JCB package developer, make sure it is a reputable JCB package developers! Find out why!" COM_COMPONENTBUILDER_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST="Any Selection (only 4 list/radio/checkboxes/dynamic_list)" @@ -1410,6 +1415,7 @@ COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA="Get the key from %s< COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA="Get the key from %s for %s" COM_COMPONENTBUILDER_BIMAGESB_NOT_MOVED_TO_CORRECT_LOCATION="Images not moved to correct location!" COM_COMPONENTBUILDER_BMULTIPLE_FIELD_REPEATABLE_MODEB_IDS_MISMATCH_IN_BFIELDSB_AND_WAS_EMREMOVEDEM_FROM_THE_FIELD="Multiple Field (repeatable mode) id:%s mismatch in field:%s, and was removed from the field." +COM_COMPONENTBUILDER_BOILERPLATE_PLUGIN_S_DATA_COULD_NOT_BE_SAVED="Boilerplate (plugin - %s) data could not be saved" COM_COMPONENTBUILDER_BSBS_IN_BSB_HAS_ID_MISMATCH_SO_THE_BSB_WAS_REMOVED="%s->%s in %s has id mismatch. So the %s was removed!" COM_COMPONENTBUILDER_BSB_COULD_NOT_BE_IMPORTEDS="%s could not be imported%s" COM_COMPONENTBUILDER_BSB_HAS_BEEN_IMPORTED="%s has been imported!" @@ -1430,6 +1436,290 @@ COM_COMPONENTBUILDER_BUTTON_TO_CREATE_S_WILL_SHOW_ONCE_S_IS_SAVED_FOR_THE_FIRST_ COM_COMPONENTBUILDER_CANCEL="Cancel" COM_COMPONENTBUILDER_CHAIN="Chain" COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="Check your owner details, it has not been set. Open the JCB Global Options, go to the Company tab and add the correct company details there." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS="Class Extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_ACCESS="Class Extendings Access" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_ACCESS_DESC="Allows the users in this group to access access class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_OPTIONS="Batch process the selected Class Extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_TIP="All changes will be applied to all selected Class Extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_USE="Class Extendings Batch Use" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_CREATE="Class Extendings Create" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_CREATE_DESC="Allows the users in this group to create create class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_DELETE="Class Extendings Delete" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_DELETE_DESC="Allows the users in this group to delete delete class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT="Class Extendings Edit" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_CREATED_BY="Class Extendings Edit Created By" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_CREATED_DATE="Class Extendings Edit Created Date" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_DESC="Allows the users in this group to edit the class extends" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_OWN="Class Extendings Edit Own" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_OWN_DESC="Allows the users in this group to edit edit own class extendings created by them" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_STATE="Class Extendings Edit State" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_STATE_DESC="Allows the users in this group to update the state of the class extends" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_VERSION="Class Extendings Edit Version" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_ARCHIVED="%s Class Extendings archived." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_ARCHIVED_1="%s Class Extends archived." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_CHECKED_IN_0="No Class Extends successfully checked in." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_CHECKED_IN_1="%d Class Extends successfully checked in." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_CHECKED_IN_MORE="%d Class Extendings successfully checked in." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_DELETED="%s Class Extendings deleted." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_DELETED_1="%s Class Extends deleted." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_FEATURED="%s Class Extendings featured." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_FEATURED_1="%s Class Extends featured." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_PUBLISHED="%s Class Extendings published." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_PUBLISHED_1="%s Class Extends published." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_TRASHED="%s Class Extendings trashed." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_TRASHED_1="%s Class Extends trashed." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_UNFEATURED="%s Class Extendings unfeatured." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_UNFEATURED_1="%s Class Extends unfeatured." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_UNPUBLISHED="%s Class Extendings unpublished." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_N_ITEMS_UNPUBLISHED_1="%s Class Extends unpublished." +COM_COMPONENTBUILDER_CLASS_EXTENDS="Class Extends" +COM_COMPONENTBUILDER_CLASS_EXTENDS_COMMENT="Comment" +COM_COMPONENTBUILDER_CLASS_EXTENDS_COMMENT_DESCRIPTION="The class comment" +COM_COMPONENTBUILDER_CLASS_EXTENDS_COMMENT_HINT="/** + * [NAME] + * + * @package [COMPONENT_NAME] + */" +COM_COMPONENTBUILDER_CLASS_EXTENDS_COMMENT_LABEL="Class Comment" +COM_COMPONENTBUILDER_CLASS_EXTENDS_COMPONENTS="components" +COM_COMPONENTBUILDER_CLASS_EXTENDS_CREATED_BY_DESC="The user that created this Class Extends." +COM_COMPONENTBUILDER_CLASS_EXTENDS_CREATED_BY_LABEL="Created By" +COM_COMPONENTBUILDER_CLASS_EXTENDS_CREATED_DATE_DESC="The date this Class Extends was created." +COM_COMPONENTBUILDER_CLASS_EXTENDS_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_CLASS_EXTENDS_DETAILS="Details" +COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT="Editing the Class Extends" +COM_COMPONENTBUILDER_CLASS_EXTENDS_ERROR_UNIQUE_ALIAS="Another Class Extends has the same alias." +COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE="Extension Type" +COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_DESCRIPTION="Extension type this class_extends belongs to." +COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL="Extension Type" +COM_COMPONENTBUILDER_CLASS_EXTENDS_HEAD="Head" +COM_COMPONENTBUILDER_CLASS_EXTENDS_HEAD_DESCRIPTION="The class head, where JLoader, namespace and use is added, so that class being extended will work." +COM_COMPONENTBUILDER_CLASS_EXTENDS_HEAD_LABEL="Class Head" +COM_COMPONENTBUILDER_CLASS_EXTENDS_ID="Id" +COM_COMPONENTBUILDER_CLASS_EXTENDS_MODIFIED_BY_DESC="The last user that modified this Class Extends." +COM_COMPONENTBUILDER_CLASS_EXTENDS_MODIFIED_BY_LABEL="Modified By" +COM_COMPONENTBUILDER_CLASS_EXTENDS_MODIFIED_DATE_DESC="The date this Class Extends was modified." +COM_COMPONENTBUILDER_CLASS_EXTENDS_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_CLASS_EXTENDS_MODULES="modules" +COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME="Name" +COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_DESCRIPTION="Enter Name Here" +COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_HINT="Name Here" +COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL="Name" +COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_MESSAGE="Error! Please add name here." +COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW="A New Class Extends" +COM_COMPONENTBUILDER_CLASS_EXTENDS_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_CLASS_EXTENDS_PERMISSION="Permissions" +COM_COMPONENTBUILDER_CLASS_EXTENDS_PLUGINS="plugins" +COM_COMPONENTBUILDER_CLASS_EXTENDS_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_CLASS_EXTENDS_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Class Extends to customise the alias." +COM_COMPONENTBUILDER_CLASS_EXTENDS_SELECT_AN_OPTION="Select an option" +COM_COMPONENTBUILDER_CLASS_EXTENDS_STATUS="Status" +COM_COMPONENTBUILDER_CLASS_EXTENDS_VERSION_DESC="A count of the number of times this Class Extends has been revised." +COM_COMPONENTBUILDER_CLASS_EXTENDS_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_CLASS_METHOD="Class Method" +COM_COMPONENTBUILDER_CLASS_METHODS="Class Methods" +COM_COMPONENTBUILDER_CLASS_METHODS_ACCESS="Class Methods Access" +COM_COMPONENTBUILDER_CLASS_METHODS_ACCESS_DESC="Allows the users in this group to access access class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_OPTIONS="Batch process the selected Class Methods" +COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_TIP="All changes will be applied to all selected Class Methods" +COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_USE="Class Methods Batch Use" +COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_CREATE="Class Methods Create" +COM_COMPONENTBUILDER_CLASS_METHODS_CREATE_DESC="Allows the users in this group to create create class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_DELETE="Class Methods Delete" +COM_COMPONENTBUILDER_CLASS_METHODS_DELETE_DESC="Allows the users in this group to delete delete class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT="Class Methods Edit" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_CREATED_BY="Class Methods Edit Created By" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_CREATED_DATE="Class Methods Edit Created Date" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_DESC="Allows the users in this group to edit the class method" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_OWN="Class Methods Edit Own" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_OWN_DESC="Allows the users in this group to edit edit own class methods created by them" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_STATE="Class Methods Edit State" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_STATE_DESC="Allows the users in this group to update the state of the class method" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_VERSION="Class Methods Edit Version" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_EXPORT="Class Methods Export" +COM_COMPONENTBUILDER_CLASS_METHODS_EXPORT_DESC="Allows the users in this group to export export class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_IMPORT="Class Methods Import" +COM_COMPONENTBUILDER_CLASS_METHODS_IMPORT_DESC="Allows the users in this group to import import class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_ARCHIVED="%s Class Methods archived." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_ARCHIVED_1="%s Class Method archived." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_CHECKED_IN_0="No Class Method successfully checked in." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_CHECKED_IN_1="%d Class Method successfully checked in." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_CHECKED_IN_MORE="%d Class Methods successfully checked in." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_DELETED="%s Class Methods deleted." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_DELETED_1="%s Class Method deleted." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_FEATURED="%s Class Methods featured." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_FEATURED_1="%s Class Method featured." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_PUBLISHED="%s Class Methods published." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_PUBLISHED_1="%s Class Method published." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_TRASHED="%s Class Methods trashed." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_TRASHED_1="%s Class Method trashed." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_UNFEATURED="%s Class Methods unfeatured." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_UNFEATURED_1="%s Class Method unfeatured." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_UNPUBLISHED="%s Class Methods unpublished." +COM_COMPONENTBUILDER_CLASS_METHODS_N_ITEMS_UNPUBLISHED_1="%s Class Method unpublished." +COM_COMPONENTBUILDER_CLASS_METHOD_ARGUMENTS="Arguments" +COM_COMPONENTBUILDER_CLASS_METHOD_ARGUMENTS_DESCRIPTION="You can add as many as you need, with comma separation." +COM_COMPONENTBUILDER_CLASS_METHOD_ARGUMENTS_HINT="$context, &$value" +COM_COMPONENTBUILDER_CLASS_METHOD_ARGUMENTS_LABEL="Params
Method Arguments" +COM_COMPONENTBUILDER_CLASS_METHOD_CODE="Code" +COM_COMPONENTBUILDER_CLASS_METHOD_CODE_DESCRIPTION="Add the code here." +COM_COMPONENTBUILDER_CLASS_METHOD_CODE_LABEL="Code" +COM_COMPONENTBUILDER_CLASS_METHOD_COMMENT="Comment" +COM_COMPONENTBUILDER_CLASS_METHOD_COMMENT_DESCRIPTION="The comment" +COM_COMPONENTBUILDER_CLASS_METHOD_COMMENT_HINT="/** + * [NAME] + * + * [PARAMS] + * + */" +COM_COMPONENTBUILDER_CLASS_METHOD_COMMENT_LABEL="Comment" +COM_COMPONENTBUILDER_CLASS_METHOD_COMPONENTS="components" +COM_COMPONENTBUILDER_CLASS_METHOD_CREATED_BY_DESC="The user that created this Class Method." +COM_COMPONENTBUILDER_CLASS_METHOD_CREATED_BY_LABEL="Created By" +COM_COMPONENTBUILDER_CLASS_METHOD_CREATED_DATE_DESC="The date this Class Method was created." +COM_COMPONENTBUILDER_CLASS_METHOD_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_CLASS_METHOD_DETAILS="Details" +COM_COMPONENTBUILDER_CLASS_METHOD_EDIT="Editing the Class Method" +COM_COMPONENTBUILDER_CLASS_METHOD_ERROR_UNIQUE_ALIAS="Another Class Method has the same alias." +COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE="Extension Type" +COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_DESCRIPTION="Extension type this class_method belongs to." +COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL="Extension Type" +COM_COMPONENTBUILDER_CLASS_METHOD_ID="Id" +COM_COMPONENTBUILDER_CLASS_METHOD_JOOMLA_PLUGIN_GROUP="Joomla Plugin Group" +COM_COMPONENTBUILDER_CLASS_METHOD_JOOMLA_PLUGIN_GROUP_LABEL="Joomla Plugin Group" +COM_COMPONENTBUILDER_CLASS_METHOD_MODIFIED_BY_DESC="The last user that modified this Class Method." +COM_COMPONENTBUILDER_CLASS_METHOD_MODIFIED_BY_LABEL="Modified By" +COM_COMPONENTBUILDER_CLASS_METHOD_MODIFIED_DATE_DESC="The date this Class Method was modified." +COM_COMPONENTBUILDER_CLASS_METHOD_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_CLASS_METHOD_MODULES="modules" +COM_COMPONENTBUILDER_CLASS_METHOD_NAME="Name" +COM_COMPONENTBUILDER_CLASS_METHOD_NAME_DESCRIPTION="Enter Name Here" +COM_COMPONENTBUILDER_CLASS_METHOD_NAME_HINT="Name Here" +COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL="Name" +COM_COMPONENTBUILDER_CLASS_METHOD_NAME_MESSAGE="Error! Please add name here." +COM_COMPONENTBUILDER_CLASS_METHOD_NEW="A New Class Method" +COM_COMPONENTBUILDER_CLASS_METHOD_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_CLASS_METHOD_PERMISSION="Permissions" +COM_COMPONENTBUILDER_CLASS_METHOD_PLUGINS="plugins" +COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE="private" +COM_COMPONENTBUILDER_CLASS_METHOD_PROTECTED="protected" +COM_COMPONENTBUILDER_CLASS_METHOD_PUBLIC="public" +COM_COMPONENTBUILDER_CLASS_METHOD_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_CLASS_METHOD_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Class Method to customise the alias." +COM_COMPONENTBUILDER_CLASS_METHOD_SELECT_AN_OPTION="Select an option" +COM_COMPONENTBUILDER_CLASS_METHOD_STATUS="Status" +COM_COMPONENTBUILDER_CLASS_METHOD_VERSION_DESC="A count of the number of times this Class Method has been revised." +COM_COMPONENTBUILDER_CLASS_METHOD_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY="Visibility" +COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_DESCRIPTION="The visibility of a function/method or property can be defined by prefixing the declaration with the keywords public, protected or private." +COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL="Visibility" +COM_COMPONENTBUILDER_CLASS_PROPERTIES="Class Properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_ACCESS="Class Properties Access" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_ACCESS_DESC="Allows the users in this group to access access class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_OPTIONS="Batch process the selected Class Properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_TIP="All changes will be applied to all selected Class Properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_USE="Class Properties Batch Use" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_CREATE="Class Properties Create" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_CREATE_DESC="Allows the users in this group to create create class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_DELETE="Class Properties Delete" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_DELETE_DESC="Allows the users in this group to delete delete class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT="Class Properties Edit" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_CREATED_BY="Class Properties Edit Created By" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_CREATED_DATE="Class Properties Edit Created Date" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_DESC="Allows the users in this group to edit the class property" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_OWN="Class Properties Edit Own" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own class properties created by them" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_STATE="Class Properties Edit State" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the class property" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_VERSION="Class Properties Edit Version" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EXPORT="Class Properties Export" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EXPORT_DESC="Allows the users in this group to export export class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_IMPORT="Class Properties Import" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_IMPORT_DESC="Allows the users in this group to import import class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_ARCHIVED="%s Class Properties archived." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_ARCHIVED_1="%s Class Property archived." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_CHECKED_IN_0="No Class Property successfully checked in." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_CHECKED_IN_1="%d Class Property successfully checked in." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_CHECKED_IN_MORE="%d Class Properties successfully checked in." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_DELETED="%s Class Properties deleted." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_DELETED_1="%s Class Property deleted." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_FEATURED="%s Class Properties featured." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_FEATURED_1="%s Class Property featured." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_PUBLISHED="%s Class Properties published." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_PUBLISHED_1="%s Class Property published." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_TRASHED="%s Class Properties trashed." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_TRASHED_1="%s Class Property trashed." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_UNFEATURED="%s Class Properties unfeatured." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_UNFEATURED_1="%s Class Property unfeatured." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_UNPUBLISHED="%s Class Properties unpublished." +COM_COMPONENTBUILDER_CLASS_PROPERTIES_N_ITEMS_UNPUBLISHED_1="%s Class Property unpublished." +COM_COMPONENTBUILDER_CLASS_PROPERTY="Class Property" +COM_COMPONENTBUILDER_CLASS_PROPERTY_COMMENT="Comment" +COM_COMPONENTBUILDER_CLASS_PROPERTY_COMMENT_DESCRIPTION="The comment" +COM_COMPONENTBUILDER_CLASS_PROPERTY_COMMENT_HINT="/** + * [NAME] + * + * [PARAMS] + * + */" +COM_COMPONENTBUILDER_CLASS_PROPERTY_COMMENT_LABEL="Comment" +COM_COMPONENTBUILDER_CLASS_PROPERTY_COMPONENTS="components" +COM_COMPONENTBUILDER_CLASS_PROPERTY_CREATED_BY_DESC="The user that created this Class Property." +COM_COMPONENTBUILDER_CLASS_PROPERTY_CREATED_BY_LABEL="Created By" +COM_COMPONENTBUILDER_CLASS_PROPERTY_CREATED_DATE_DESC="The date this Class Property was created." +COM_COMPONENTBUILDER_CLASS_PROPERTY_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT="Default" +COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_DESCRIPTION="Enter default value" +COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_HINT="Default Value Here" +COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_LABEL="Default" +COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_MESSAGE="Error! Please add default value here." +COM_COMPONENTBUILDER_CLASS_PROPERTY_DETAILS="Details" +COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT="Editing the Class Property" +COM_COMPONENTBUILDER_CLASS_PROPERTY_ERROR_UNIQUE_ALIAS="Another Class Property has the same alias." +COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE="Extension Type" +COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_DESCRIPTION="Extension type this class_property belongs to." +COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL="Extension Type" +COM_COMPONENTBUILDER_CLASS_PROPERTY_ID="Id" +COM_COMPONENTBUILDER_CLASS_PROPERTY_JOOMLA_PLUGIN_GROUP="Joomla Plugin Group" +COM_COMPONENTBUILDER_CLASS_PROPERTY_JOOMLA_PLUGIN_GROUP_LABEL="Joomla Plugin Group" +COM_COMPONENTBUILDER_CLASS_PROPERTY_MODIFIED_BY_DESC="The last user that modified this Class Property." +COM_COMPONENTBUILDER_CLASS_PROPERTY_MODIFIED_BY_LABEL="Modified By" +COM_COMPONENTBUILDER_CLASS_PROPERTY_MODIFIED_DATE_DESC="The date this Class Property was modified." +COM_COMPONENTBUILDER_CLASS_PROPERTY_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_CLASS_PROPERTY_MODULES="modules" +COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME="Name" +COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_DESCRIPTION="Enter Name Here" +COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_HINT="Name Here" +COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL="Name" +COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_MESSAGE="Error! Please add name here." +COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW="A New Class Property" +COM_COMPONENTBUILDER_CLASS_PROPERTY_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PERMISSION="Permissions" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PLUGINS="plugins" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE="private" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PROTECTED="protected" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLIC="public" +COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_CLASS_PROPERTY_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Class Property to customise the alias." +COM_COMPONENTBUILDER_CLASS_PROPERTY_SELECT_AN_OPTION="Select an option" +COM_COMPONENTBUILDER_CLASS_PROPERTY_STATUS="Status" +COM_COMPONENTBUILDER_CLASS_PROPERTY_VERSION_DESC="A count of the number of times this Class Property has been revised." +COM_COMPONENTBUILDER_CLASS_PROPERTY_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY="Visibility" +COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_DESCRIPTION="The visibility of a function/method or property can be defined by prefixing the declaration with the keywords public, protected or private." +COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL="Visibility" COM_COMPONENTBUILDER_CLEAR_TMP="Clear tmp" COM_COMPONENTBUILDER_CLONE="Clone" COM_COMPONENTBUILDER_CLONE_FAILED="Clone failed!" @@ -2485,7 +2775,11 @@ COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HEADER_DESCRIPTION="Enter Header Here" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HEADER_HINT="Header Here" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HEADER_LABEL="Header" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HEADER_MESSAGE="Error! Please add header here." -COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HTML_HINT="// Add the tab HTML here. To access php values methodname->value; ?>" +COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HTML_HINT="// Add the tab HTML here. +// To access php values MethodName->value; ?> +// Note the convention, if in the PHP area above you added a method called getMethodName() +// Then [MethodName] becomes a class variable called $this->MethodName +// Which will hold the value/s your method returned." COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HTML_LABEL="HTML" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_ID="Id" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_JOOMLA_COMPONENT="Joomla Component" @@ -2500,6 +2794,7 @@ COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NAME_HINT="Name Here" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NAME_LABEL="Name" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NAME_MESSAGE="Error! Please add name here." COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW="A New Component Dashboard" +COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NOTE_PHP_DASHBOARD_NOTE_DESCRIPTION="Adding custom PHP method to the dashboard model
use the public function getMethodName() to insure the data is set to the view,
Note the convention public function get...() replace the ... with the unique method name." COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PERMISSION="Permissions" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_PHP_DASHBOARD_METHODS="Php Dashboard Methods" @@ -3885,7 +4180,7 @@ COM_COMPONENTBUILDER_DASHBOARD_GET_SNIPPETS="Get Snippets

" COM_COMPONENTBUILDER_DASHBOARD_HELP_DOCUMENTS="Help Documents

" COM_COMPONENTBUILDER_DASHBOARD_IMPORTJCBPACKAGES="Import JCB Packages

" COM_COMPONENTBUILDER_DASHBOARD_JOOMLA_COMPONENTS="Joomla Components

" -COM_COMPONENTBUILDER_DASHBOARD_JOOMLA_COMPONENT_ADD="Add Joomla Component

" +COM_COMPONENTBUILDER_DASHBOARD_JOOMLA_PLUGINS="Joomla Plugins

" COM_COMPONENTBUILDER_DASHBOARD_LANGUAGE_TRANSLATIONS="Language Translations

" COM_COMPONENTBUILDER_DASHBOARD_LAYOUTS="Layouts

" COM_COMPONENTBUILDER_DASHBOARD_LAYOUT_ADD="Add Layout

" @@ -4746,8 +5041,11 @@ COM_COMPONENTBUILDER_FULL_WIDTH_IN_TAB="Full Width in Tab" COM_COMPONENTBUILDER_FUNCTION_NAME_ALREADY_TAKEN_PLEASE_TRY_AGAIN="Function name already taken, please try again." COM_COMPONENTBUILDER_GENERAL_OVERVIEW_OF_HOW_THINGS_WORK_BSB="General overview of how things work: %s" COM_COMPONENTBUILDER_GETTING_AVAILABLE_LIBRARIES="Getting available libraries" +COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_FAILED_IF_THE_ISSUE_CONTINUES_INFORM_YOUR_SYSTEM_ADMINISTRATOR="Getting joomla_plugin boilerplate failed, if the issue continues, inform your system administrator!" +COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_WAS_SUCCESSFULLY="Getting joomla_plugin boilerplate was successfully!" COM_COMPONENTBUILDER_GET_ALL_NEW_SNIPPETS="Get All New Snippets" COM_COMPONENTBUILDER_GET_AN_ACCOUNT_WITH_GITHUB_BSB="Get an Account with gitHub: %s" +COM_COMPONENTBUILDER_GET_BOILERPLATE="Get Boilerplate" COM_COMPONENTBUILDER_GET_PACKAGE="Get Package" COM_COMPONENTBUILDER_GET_SNIPPET="Get snippet" COM_COMPONENTBUILDER_GET_SNIPPETS="Get Snippets" @@ -4777,6 +5075,7 @@ COM_COMPONENTBUILDER_GLUECODE="Glue/Code" COM_COMPONENTBUILDER_GREAT_THIS_FUNCTION_NAME_WILL_WORK="Great, this function name will work!" COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK="Great, this placeholder will work!" COM_COMPONENTBUILDER_GREAT_THIS_VALIDATION_RULE_NAME_S_WILL_WORK="Great, this validation rule name (%s) will work!" +COM_COMPONENTBUILDER_GROUP="group" COM_COMPONENTBUILDER_HAS_METADATA="Has Metadata" COM_COMPONENTBUILDER_HELP_DOCUMENT="Help Document" COM_COMPONENTBUILDER_HELP_DOCUMENTS="Help Documents" @@ -4933,6 +5232,8 @@ COM_COMPONENTBUILDER_IMPORT_S="Import %s" COM_COMPONENTBUILDER_IMPORT_SELECT_FILE="Select File" COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_DIRECTORY="Set the path to file" COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_ADMIN_VIEWS="Select the file to import data to admin_views." +COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_METHODS="Select the file to import data to class_methods." +COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_PROPERTIES="Select the file to import data to class_properties." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CUSTOM_ADMIN_VIEWS="Select the file to import data to custom_admin_views." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CUSTOM_CODES="Select the file to import data to custom_codes." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_DYNAMIC_GETS="Select the file to import data to dynamic_gets." @@ -4940,6 +5241,7 @@ COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_FIELDS="Select the file to import da COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_FIELDTYPES="Select the file to import data to fieldtypes." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS="Select the file to import data to help_documents." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_COMPONENTS="Select the file to import data to joomla_components." +COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_PLUGINS="Select the file to import data to joomla_plugins." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGES="Select the file to import data to languages." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_TRANSLATIONS="Select the file to import data to language_translations." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LAYOUTS="Select the file to import data to layouts." @@ -4982,8 +5284,6 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_CODE_NAME="Code Name" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_COMPANY_DETAILS="Company Details" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_CREATE="Joomla Components Create" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_CREATE_DESC="Allows the users in this group to create create joomla components" -COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD="Joomla Components Dashboard Add" -COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of joomla component" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST="Joomla Components Dashboard List" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of joomla component" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DELETE="Joomla Components Delete" @@ -5482,6 +5782,168 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_MESSAGE="Error! Please add websi COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES="Yes" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZIP="ZIP" COM_COMPONENTBUILDER_JOOMLA_FIELDS="Joomla fields" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN="Joomla Plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS="Joomla Plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_ACCESS="Joomla Plugins Access" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_ACCESS_DESC="Allows the users in this group to access access joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_OPTIONS="Batch process the selected Joomla Plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_TIP="All changes will be applied to all selected Joomla Plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_USE="Joomla Plugins Batch Use" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_CREATE="Joomla Plugins Create" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_CREATE_DESC="Allows the users in this group to create create joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_DASHBOARD_LIST="Joomla Plugins Dashboard List" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of joomla plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_DELETE="Joomla Plugins Delete" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_DELETE_DESC="Allows the users in this group to delete delete joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT="Joomla Plugins Edit" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_CREATED_BY="Joomla Plugins Edit Created By" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_CREATED_DATE="Joomla Plugins Edit Created Date" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_DESC="Allows the users in this group to edit the joomla plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_OWN="Joomla Plugins Edit Own" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_OWN_DESC="Allows the users in this group to edit edit own joomla plugins created by them" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_STATE="Joomla Plugins Edit State" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_VERSION="Joomla Plugins Edit Version" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EXPORT="Joomla Plugins Export" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EXPORT_DESC="Allows the users in this group to export export joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_IMPORT="Joomla Plugins Import" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_IMPORT_DESC="Allows the users in this group to import import joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_ARCHIVED="%s Joomla Plugins archived." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_ARCHIVED_1="%s Joomla Plugin archived." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_CHECKED_IN_0="No Joomla Plugin successfully checked in." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_CHECKED_IN_1="%d Joomla Plugin successfully checked in." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_CHECKED_IN_MORE="%d Joomla Plugins successfully checked in." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_DELETED="%s Joomla Plugins deleted." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_DELETED_1="%s Joomla Plugin deleted." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_FEATURED="%s Joomla Plugins featured." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_FEATURED_1="%s Joomla Plugin featured." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_PUBLISHED="%s Joomla Plugins published." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_PUBLISHED_1="%s Joomla Plugin published." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_TRASHED="%s Joomla Plugins trashed." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_TRASHED_1="%s Joomla Plugin trashed." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_UNFEATURED="%s Joomla Plugins unfeatured." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_UNFEATURED_1="%s Joomla Plugin unfeatured." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_UNPUBLISHED="%s Joomla Plugins unpublished." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_N_ITEMS_UNPUBLISHED_1="%s Joomla Plugin unpublished." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_SUBMENU="Joomla Plugins Submenu" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_SUBMENU_DESC="Allows the users in this group to submenu of joomla plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS="Class Extends" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL="Extends" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CONFIGPARAMS="Config/Params" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CREATED_BY_DESC="The user that created this Joomla Plugin." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CREATED_BY_LABEL="Created By" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CREATED_DATE_DESC="The date this Joomla Plugin was created." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CUSTOM_VALUE_DESCRIPTION="Enter custom value if needed" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CUSTOM_VALUE_HINT="Custom Value Here" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CUSTOM_VALUE_LABEL="Custom Value" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_DETAILS="Details" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_EDIT="Editing the Joomla Plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ERROR_UNIQUE_ALIAS="Another Joomla Plugin has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD="Field" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELDS="Fields" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELDS_LABEL="Fields" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD_DESCRIPTION="Select a field" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD_LABEL="Field" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GET_BOILERPLATE_BUTTON_ACCESS="Joomla Plugin Get Boilerplate Button Access" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GET_BOILERPLATE_BUTTON_ACCESS_DESC="Allows the users in this group to access the get boilerplate button." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP="Joomla Plugin Group" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS="Joomla Plugin Groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_ACCESS="Joomla Plugin Groups Access" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_ACCESS_DESC="Allows the users in this group to access access joomla plugin groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_OPTIONS="Batch process the selected Joomla Plugin Groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_TIP="All changes will be applied to all selected Joomla Plugin Groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE="Joomla Plugin Groups Batch Use" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla plugin groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_EDIT_VERSION="Joomla Plugin Groups Edit Version" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla plugin groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_ARCHIVED="%s Joomla Plugin Groups archived." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_ARCHIVED_1="%s Joomla Plugin Group archived." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_CHECKED_IN_0="No Joomla Plugin Group successfully checked in." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_CHECKED_IN_1="%d Joomla Plugin Group successfully checked in." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_CHECKED_IN_MORE="%d Joomla Plugin Groups successfully checked in." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_DELETED="%s Joomla Plugin Groups deleted." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_DELETED_1="%s Joomla Plugin Group deleted." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_FEATURED="%s Joomla Plugin Groups featured." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_FEATURED_1="%s Joomla Plugin Group featured." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_PUBLISHED="%s Joomla Plugin Groups published." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_PUBLISHED_1="%s Joomla Plugin Group published." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_TRASHED="%s Joomla Plugin Groups trashed." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_TRASHED_1="%s Joomla Plugin Group trashed." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_UNFEATURED="%s Joomla Plugin Groups unfeatured." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_UNFEATURED_1="%s Joomla Plugin Group unfeatured." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_UNPUBLISHED="%s Joomla Plugin Groups unpublished." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_N_ITEMS_UNPUBLISHED_1="%s Joomla Plugin Group unpublished." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS="Class Extends" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_LABEL="Extends" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CREATED_BY_DESC="The user that created this Joomla Plugin Group." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CREATED_BY_LABEL="Created By" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CREATED_DATE_DESC="The date this Joomla Plugin Group was created." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_DETAILS="Details" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_EDIT="Editing the Joomla Plugin Group" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ERROR_UNIQUE_ALIAS="Another Joomla Plugin Group has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ID="Id" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_BY_DESC="The last user that modified this Joomla Plugin Group." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_BY_LABEL="Modified By" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_DATE_DESC="The date this Joomla Plugin Group was modified." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME="Name" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_DESCRIPTION="Enter Name Here" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_HINT="Name Here" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_LABEL="Name" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_MESSAGE="Error! Please add name here." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NEW="A New Joomla Plugin Group" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_PERMISSION="Permissions" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Joomla Plugin Group to customise the alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_STATUS="Status" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_VERSION_DESC="A count of the number of times this Joomla Plugin Group has been revised." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ID="Id" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP="Joomla Plugin Group" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL="Joomla Plugin Group" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE="Main Class Code" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE_DESCRIPTION="Add the class properties & methods here." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE_LABEL="Class Properties & Methods" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD="Method" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_LABEL="Methods" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION="Method Selection" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION_DESCRIPTION="Select methods you want to use in your plugin class." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION_LABEL="Method Selection" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MODIFIED_BY_DESC="The last user that modified this Joomla Plugin." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MODIFIED_BY_LABEL="Modified By" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MODIFIED_DATE_DESC="The date this Joomla Plugin was modified." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME="Name" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_DESCRIPTION="Enter Name Here" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_HINT="Name Here" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL="Name" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_MESSAGE="Error! Please add name here." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NEW="A New Joomla Plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_BETA_STAGE_DESCRIPTION="This area is still in beta, and is not ready for use. Things may work, but they are not wired up to the back-end/compiler. You are already seeing it since JCB is being developed in a reverse motion of front-end/GUI to back-end/Compiler approach. We first build the GUI... and then the Back-end, which is not normally how it is done, or so I was told.... But anyway that is how JCB is being build, we get the idea, look at all the relationships and build the tables, and columns, which then map to views and fields (GUI), we then build the functions in the compiler to act upon these new data-sets, and whammm the full functionality/idea becomes stable and ready. So in due time this area will become available for your use, and then this message will go away! (or the whole area will just disappear if it does not work out :)" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_BETA_STAGE_LABEL="Beta Stage" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_PLUGIN_DESCRIPTION="

So over here you are able to manually code your plugin methods which usually will be the event name you are targeting.

We have also added some methods via the boilerplate repo that can serve as a starting point, simple select them and it will be added to your code.

If you have added any fields in the Config/Params tab, these fields will be available to you in the $this->params object, and can be accessed via the field name $this->params->get('fieldname'); with the get method.

" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_PLUGIN_LABEL="Easy Plugin Build Options" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PERMISSION="Permissions" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY="Property" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_LABEL="Properties" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION="Property Selection" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION_DESCRIPTION="Select properties you want to use in your plugin class." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION_LABEL="Property Selection" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_RUN_EXPANSION_BUTTON_ACCESS="Joomla Plugin Run Expansion Button Access" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Joomla Plugin to customise the alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_STATUS="Status" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_VERSION_DESC="A count of the number of times this Joomla Plugin has been revised." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_VERSION_LABEL="Revision" COM_COMPONENTBUILDER_JUST_GET_ALL_SNIPPETS="Just Get All Snippets" COM_COMPONENTBUILDER_KEEP_HISTORY="Keep History" COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS="- Keep Original Access -" @@ -7207,6 +7669,7 @@ COM_COMPONENTBUILDER_SUBMENU_FIELDTYPES="Fieldtypes" COM_COMPONENTBUILDER_SUBMENU_GET_SNIPPETS="Get Snippets" COM_COMPONENTBUILDER_SUBMENU_HELP_DOCUMENTS="Help Documents" COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS="Joomla Components" +COM_COMPONENTBUILDER_SUBMENU_JOOMLA_PLUGINS="Joomla Plugins" COM_COMPONENTBUILDER_SUBMENU_LANGUAGES="Languages" COM_COMPONENTBUILDER_SUBMENU_LANGUAGE_TRANSLATIONS="Language Translations" COM_COMPONENTBUILDER_SUBMENU_LAYOUTS="Layouts" @@ -7511,6 +7974,8 @@ COM_COMPONENTBUILDER_VALIDATION_RULE_PHP_DESCRIPTION="Add your PHP here! [Do not COM_COMPONENTBUILDER_VALIDATION_RULE_PHP_HINT="// PHP class methods and fields can be added here" COM_COMPONENTBUILDER_VALIDATION_RULE_PHP_LABEL="PHP (class methods)" COM_COMPONENTBUILDER_VALIDATION_RULE_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_VALIDATION_RULE_RUN_EXPANSION_BUTTON_ACCESS="Validation Rule Run Expansion Button Access" +COM_COMPONENTBUILDER_VALIDATION_RULE_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button." COM_COMPONENTBUILDER_VALIDATION_RULE_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Validation Rule to customise the alias." COM_COMPONENTBUILDER_VALIDATION_RULE_SHORT_DESCRIPTION="Short Description" COM_COMPONENTBUILDER_VALIDATION_RULE_SHORT_DESCRIPTION_DESCRIPTION="Enter short description" @@ -7551,6 +8016,7 @@ COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_ COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to clone a component, please contact your system administrator for more help." COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to import a component, please contact your system administrator for more help." COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE="You do not have permission to run the expansion module!" +COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_GET_BOILERPLATE_MODULE="You do not have permission to run the get boilerplate module!" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_TRANSLATOR_MODULE="You do not have permission to run the translator module!" COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_SHARE_THE_SNIPPETS_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to share the snippets, please contact your system administrator for more help." COM_COMPONENTBUILDER_YOU_HAVE_S_S_ADDING_MORE_THEN_S_S_IS_CONSIDERED_BAD_PRACTICE="You have %s %s. Adding more then %s %s is considered bad practice." diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index 4d342ddc2..5a9e24166 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -111,6 +111,74 @@ COM_COMPONENTBUILDER_ADMIN_VIEWS_SUBMENU="Admin Views Submenu" COM_COMPONENTBUILDER_ADMIN_VIEWS_SUBMENU_DESC="Allows the users in this group to submenu of admin view" COM_COMPONENTBUILDER_ADMIN_VIEW_RUN_EXPANSION_BUTTON_ACCESS="Admin View Run Expansion Button Access" COM_COMPONENTBUILDER_ADMIN_VIEW_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button." +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_ACCESS="Class Extendings Access" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_ACCESS_DESC="Allows the users in this group to access access class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_USE="Class Extendings Batch Use" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_CREATE="Class Extendings Create" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_CREATE_DESC="Allows the users in this group to create create class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_DELETE="Class Extendings Delete" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_DELETE_DESC="Allows the users in this group to delete delete class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT="Class Extendings Edit" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_CREATED_BY="Class Extendings Edit Created By" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_CREATED_DATE="Class Extendings Edit Created Date" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created class extendings" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_DESC="Allows the users in this group to edit the class extends" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_OWN="Class Extendings Edit Own" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_OWN_DESC="Allows the users in this group to edit edit own class extendings created by them" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_STATE="Class Extendings Edit State" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_STATE_DESC="Allows the users in this group to update the state of the class extends" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_VERSION="Class Extendings Edit Version" +COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version class extendings" +COM_COMPONENTBUILDER_CLASS_METHODS_ACCESS="Class Methods Access" +COM_COMPONENTBUILDER_CLASS_METHODS_ACCESS_DESC="Allows the users in this group to access access class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_USE="Class Methods Batch Use" +COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_CREATE="Class Methods Create" +COM_COMPONENTBUILDER_CLASS_METHODS_CREATE_DESC="Allows the users in this group to create create class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_DELETE="Class Methods Delete" +COM_COMPONENTBUILDER_CLASS_METHODS_DELETE_DESC="Allows the users in this group to delete delete class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT="Class Methods Edit" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_CREATED_BY="Class Methods Edit Created By" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_CREATED_DATE="Class Methods Edit Created Date" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_DESC="Allows the users in this group to edit the class method" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_OWN="Class Methods Edit Own" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_OWN_DESC="Allows the users in this group to edit edit own class methods created by them" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_STATE="Class Methods Edit State" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_STATE_DESC="Allows the users in this group to update the state of the class method" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_VERSION="Class Methods Edit Version" +COM_COMPONENTBUILDER_CLASS_METHODS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_EXPORT="Class Methods Export" +COM_COMPONENTBUILDER_CLASS_METHODS_EXPORT_DESC="Allows the users in this group to export export class methods" +COM_COMPONENTBUILDER_CLASS_METHODS_IMPORT="Class Methods Import" +COM_COMPONENTBUILDER_CLASS_METHODS_IMPORT_DESC="Allows the users in this group to import import class methods" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_ACCESS="Class Properties Access" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_ACCESS_DESC="Allows the users in this group to access access class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_USE="Class Properties Batch Use" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_CREATE="Class Properties Create" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_CREATE_DESC="Allows the users in this group to create create class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_DELETE="Class Properties Delete" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_DELETE_DESC="Allows the users in this group to delete delete class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT="Class Properties Edit" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_CREATED_BY="Class Properties Edit Created By" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_CREATED_DATE="Class Properties Edit Created Date" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_DESC="Allows the users in this group to edit the class property" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_OWN="Class Properties Edit Own" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own class properties created by them" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_STATE="Class Properties Edit State" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the class property" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_VERSION="Class Properties Edit Version" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EXPORT="Class Properties Export" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_EXPORT_DESC="Allows the users in this group to export export class properties" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_IMPORT="Class Properties Import" +COM_COMPONENTBUILDER_CLASS_PROPERTIES_IMPORT_DESC="Allows the users in this group to import import class properties" COM_COMPONENTBUILDER_COMPILER_ACCESS="Compiler Access" COM_COMPONENTBUILDER_COMPILER_ACCESS_DESC="Allows the users in this group to access compiler." COM_COMPONENTBUILDER_COMPILER_CLEAR_TMP_BUTTON_ACCESS="Compiler Clear tmp Button Access" @@ -520,8 +588,6 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_USE="Joomla Components Batch Use" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla components" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_CREATE="Joomla Components Create" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_CREATE_DESC="Allows the users in this group to create create joomla components" -COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD="Joomla Components Dashboard Add" -COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of joomla component" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST="Joomla Components Dashboard List" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of joomla component" COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_DELETE="Joomla Components Delete" @@ -552,6 +618,44 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMPORT_JCB_PACKAGES_BUTTON_ACCESS="Joomla COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMPORT_JCB_PACKAGES_BUTTON_ACCESS_DESC="Allows the users in this group to access the import jcb packages button." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_RUN_EXPANSION_BUTTON_ACCESS="Joomla Component Run Expansion Button Access" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button." +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_ACCESS="Joomla Plugins Access" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_ACCESS_DESC="Allows the users in this group to access access joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_USE="Joomla Plugins Batch Use" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_CREATE="Joomla Plugins Create" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_CREATE_DESC="Allows the users in this group to create create joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_DASHBOARD_LIST="Joomla Plugins Dashboard List" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of joomla plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_DELETE="Joomla Plugins Delete" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_DELETE_DESC="Allows the users in this group to delete delete joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT="Joomla Plugins Edit" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_CREATED_BY="Joomla Plugins Edit Created By" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_CREATED_DATE="Joomla Plugins Edit Created Date" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_DESC="Allows the users in this group to edit the joomla plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_OWN="Joomla Plugins Edit Own" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_OWN_DESC="Allows the users in this group to edit edit own joomla plugins created by them" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_STATE="Joomla Plugins Edit State" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_VERSION="Joomla Plugins Edit Version" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EXPORT="Joomla Plugins Export" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EXPORT_DESC="Allows the users in this group to export export joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_IMPORT="Joomla Plugins Import" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_IMPORT_DESC="Allows the users in this group to import import joomla plugins" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_SUBMENU="Joomla Plugins Submenu" +COM_COMPONENTBUILDER_JOOMLA_PLUGINS_SUBMENU_DESC="Allows the users in this group to submenu of joomla plugin" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GET_BOILERPLATE_BUTTON_ACCESS="Joomla Plugin Get Boilerplate Button Access" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GET_BOILERPLATE_BUTTON_ACCESS_DESC="Allows the users in this group to access the get boilerplate button." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_ACCESS="Joomla Plugin Groups Access" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_ACCESS_DESC="Allows the users in this group to access access joomla plugin groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE="Joomla Plugin Groups Batch Use" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla plugin groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_EDIT_VERSION="Joomla Plugin Groups Edit Version" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla plugin groups" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_RUN_EXPANSION_BUTTON_ACCESS="Joomla Plugin Run Expansion Button Access" +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button." COM_COMPONENTBUILDER_LANGUAGES_ACCESS="Languages Access" COM_COMPONENTBUILDER_LANGUAGES_ACCESS_DESC="Allows the users in this group to access access languages" COM_COMPONENTBUILDER_LANGUAGES_BATCH_USE="Languages Batch Use" @@ -700,6 +804,7 @@ COM_COMPONENTBUILDER_MENU_FIELDS="Fields" COM_COMPONENTBUILDER_MENU_FIELDTYPES="Fieldtypes" COM_COMPONENTBUILDER_MENU_HELP_DOCUMENTS="Help Documents" COM_COMPONENTBUILDER_MENU_JOOMLA_COMPONENTS="Joomla Components" +COM_COMPONENTBUILDER_MENU_JOOMLA_PLUGINS="Joomla Plugins" COM_COMPONENTBUILDER_MENU_LANGUAGE_TRANSLATIONS="Language Translations" COM_COMPONENTBUILDER_MENU_LAYOUTS="Layouts" COM_COMPONENTBUILDER_MENU_LIBRARIES="Libraries" @@ -885,4 +990,6 @@ COM_COMPONENTBUILDER_VALIDATION_RULES_EXPORT_DESC="Allows the users in this grou COM_COMPONENTBUILDER_VALIDATION_RULES_IMPORT="Validation Rules Import" COM_COMPONENTBUILDER_VALIDATION_RULES_IMPORT_DESC="Allows the users in this group to import import validation rules" COM_COMPONENTBUILDER_VALIDATION_RULES_SUBMENU="Validation Rules Submenu" -COM_COMPONENTBUILDER_VALIDATION_RULES_SUBMENU_DESC="Allows the users in this group to submenu of validation rule" \ No newline at end of file +COM_COMPONENTBUILDER_VALIDATION_RULES_SUBMENU_DESC="Allows the users in this group to submenu of validation rule" +COM_COMPONENTBUILDER_VALIDATION_RULE_RUN_EXPANSION_BUTTON_ACCESS="Validation Rule Run Expansion Button Access" +COM_COMPONENTBUILDER_VALIDATION_RULE_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button." \ No newline at end of file diff --git a/admin/layouts/class_extends/details_fullwidth.php b/admin/layouts/class_extends/details_fullwidth.php new file mode 100644 index 000000000..ea642173e --- /dev/null +++ b/admin/layouts/class_extends/details_fullwidth.php @@ -0,0 +1,44 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'head' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/class_extends/details_left.php b/admin/layouts/class_extends/details_left.php new file mode 100644 index 000000000..58bb36566 --- /dev/null +++ b/admin/layouts/class_extends/details_left.php @@ -0,0 +1,43 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'name', + 'extension_type' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_extends/details_right.php b/admin/layouts/class_extends/details_right.php new file mode 100644 index 000000000..b8b2905dc --- /dev/null +++ b/admin/layouts/class_extends/details_right.php @@ -0,0 +1,42 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'comment' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_extends/index.html b/admin/layouts/class_extends/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/class_extends/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/class_extends/publishing.php b/admin/layouts/class_extends/publishing.php new file mode 100644 index 000000000..68e3657ce --- /dev/null +++ b/admin/layouts/class_extends/publishing.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_extends/publlshing.php b/admin/layouts/class_extends/publlshing.php new file mode 100644 index 000000000..a7ff8580c --- /dev/null +++ b/admin/layouts/class_extends/publlshing.php @@ -0,0 +1,47 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_method/details_fullwidth.php b/admin/layouts/class_method/details_fullwidth.php new file mode 100644 index 000000000..9ca23c02f --- /dev/null +++ b/admin/layouts/class_method/details_fullwidth.php @@ -0,0 +1,44 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'code' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/class_method/details_left.php b/admin/layouts/class_method/details_left.php new file mode 100644 index 000000000..ebfdf3913 --- /dev/null +++ b/admin/layouts/class_method/details_left.php @@ -0,0 +1,46 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'name', + 'arguments', + 'visibility', + 'extension_type', + 'joomla_plugin_group' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_method/details_right.php b/admin/layouts/class_method/details_right.php new file mode 100644 index 000000000..b8b2905dc --- /dev/null +++ b/admin/layouts/class_method/details_right.php @@ -0,0 +1,42 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'comment' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_method/index.html b/admin/layouts/class_method/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/class_method/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/class_method/publishing.php b/admin/layouts/class_method/publishing.php new file mode 100644 index 000000000..68e3657ce --- /dev/null +++ b/admin/layouts/class_method/publishing.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_method/publlshing.php b/admin/layouts/class_method/publlshing.php new file mode 100644 index 000000000..a7ff8580c --- /dev/null +++ b/admin/layouts/class_method/publlshing.php @@ -0,0 +1,47 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_property/details_left.php b/admin/layouts/class_property/details_left.php new file mode 100644 index 000000000..8b5a1db11 --- /dev/null +++ b/admin/layouts/class_property/details_left.php @@ -0,0 +1,46 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'name', + 'visibility', + 'default', + 'extension_type', + 'joomla_plugin_group' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_property/details_right.php b/admin/layouts/class_property/details_right.php new file mode 100644 index 000000000..b8b2905dc --- /dev/null +++ b/admin/layouts/class_property/details_right.php @@ -0,0 +1,42 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'comment' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_property/index.html b/admin/layouts/class_property/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/class_property/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/class_property/publishing.php b/admin/layouts/class_property/publishing.php new file mode 100644 index 000000000..68e3657ce --- /dev/null +++ b/admin/layouts/class_property/publishing.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/class_property/publlshing.php b/admin/layouts/class_property/publlshing.php new file mode 100644 index 000000000..a7ff8580c --- /dev/null +++ b/admin/layouts/class_property/publlshing.php @@ -0,0 +1,47 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/component_dashboard/dashboard_fullwidth.php b/admin/layouts/component_dashboard/dashboard_fullwidth.php index 075cab4d6..86317ad03 100644 --- a/admin/layouts/component_dashboard/dashboard_fullwidth.php +++ b/admin/layouts/component_dashboard/dashboard_fullwidth.php @@ -26,6 +26,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'note_php_dashboard_note', 'php_dashboard_methods', 'dashboard_tab' ); diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index 4968f6ab3..2c946f2bf 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -13,7 +13,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vxqfields; +$items = $displayData->vxsfields; $user = JFactory::getUser(); $id = $displayData->item->id; // set the edit URL diff --git a/admin/layouts/joomla_plugin/configparams_fullwidth.php b/admin/layouts/joomla_plugin/configparams_fullwidth.php new file mode 100644 index 000000000..c3f86b0bd --- /dev/null +++ b/admin/layouts/joomla_plugin/configparams_fullwidth.php @@ -0,0 +1,44 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'fields' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/joomla_plugin/details_above.php b/admin/layouts/joomla_plugin/details_above.php new file mode 100644 index 000000000..8e191208e --- /dev/null +++ b/admin/layouts/joomla_plugin/details_above.php @@ -0,0 +1,46 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'name', + 'class_extends', + 'joomla_plugin_group' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/joomla_plugin/details_fullwidth.php b/admin/layouts/joomla_plugin/details_fullwidth.php new file mode 100644 index 000000000..3405d91b5 --- /dev/null +++ b/admin/layouts/joomla_plugin/details_fullwidth.php @@ -0,0 +1,44 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'main_class_code' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/joomla_plugin/details_left.php b/admin/layouts/joomla_plugin/details_left.php new file mode 100644 index 000000000..a1a01c5ee --- /dev/null +++ b/admin/layouts/joomla_plugin/details_left.php @@ -0,0 +1,43 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'note_beta_stage', + 'note_plugin' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/joomla_plugin/details_right.php b/admin/layouts/joomla_plugin/details_right.php new file mode 100644 index 000000000..3758c5d79 --- /dev/null +++ b/admin/layouts/joomla_plugin/details_right.php @@ -0,0 +1,43 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'property_selection', + 'method_selection' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/joomla_plugin/index.html b/admin/layouts/joomla_plugin/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/joomla_plugin/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/joomla_plugin/publishing.php b/admin/layouts/joomla_plugin/publishing.php new file mode 100644 index 000000000..68e3657ce --- /dev/null +++ b/admin/layouts/joomla_plugin/publishing.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/joomla_plugin/publlshing.php b/admin/layouts/joomla_plugin/publlshing.php new file mode 100644 index 000000000..a7ff8580c --- /dev/null +++ b/admin/layouts/joomla_plugin/publlshing.php @@ -0,0 +1,47 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/joomla_plugin_group/details_left.php b/admin/layouts/joomla_plugin_group/details_left.php new file mode 100644 index 000000000..18159298f --- /dev/null +++ b/admin/layouts/joomla_plugin_group/details_left.php @@ -0,0 +1,42 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'name' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/joomla_plugin_group/details_right.php b/admin/layouts/joomla_plugin_group/details_right.php new file mode 100644 index 000000000..897b29793 --- /dev/null +++ b/admin/layouts/joomla_plugin_group/details_right.php @@ -0,0 +1,42 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'class_extends' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/joomla_plugin_group/index.html b/admin/layouts/joomla_plugin_group/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/joomla_plugin_group/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/joomla_plugin_group/publishing.php b/admin/layouts/joomla_plugin_group/publishing.php new file mode 100644 index 000000000..68e3657ce --- /dev/null +++ b/admin/layouts/joomla_plugin_group/publishing.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/joomla_plugin_group/publlshing.php b/admin/layouts/joomla_plugin_group/publlshing.php new file mode 100644 index 000000000..a7ff8580c --- /dev/null +++ b/admin/layouts/joomla_plugin_group/publlshing.php @@ -0,0 +1,47 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index 70894c881..a2678ba90 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -13,7 +13,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vyalinked_components; +$items = $displayData->vyclinked_components; $user = JFactory::getUser(); $id = $displayData->item->id; // set the edit URL diff --git a/admin/models/ajax.php b/admin/models/ajax.php index c72d9bd91..9990e6570 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -249,6 +249,27 @@ class ComponentbuilderModelAjax extends JModelList return function_exists('curl_version'); } + // Used in joomla_plugin + public function getClassCode($id, $type) + { + return ComponentbuilderHelper::getClassCode($id, $type); + } + + + public function getClassCodeIds($id, $type) + { + if ('property' === $type || 'method' === $type) + { + return ComponentbuilderHelper::getVars('class_' . $type, $id, 'joomla_plugin_group', 'id'); + } + elseif ('joomla_plugin_group' === $type) + { + return ComponentbuilderHelper::getVars($type, $id, 'class_extends', 'id'); + } + return false; + } + + // Used in admin_view protected $viewid = array(); @@ -2721,7 +2742,7 @@ class ComponentbuilderModelAjax extends JModelList foreach($field['php'] as $name => $values) { $value = implode(PHP_EOL, $values['value']); - $textarea = $this->buildFieldTexteara($name, $values['desc'], $value, substr_count( $value, PHP_EOL )); + $textarea = $this->buildFieldTextarea($name, $values['desc'], $value, substr_count( $value, PHP_EOL )); // load the html $field['textarea'][] = '
'. $textarea->label . '
' . $textarea->input . '

'; } @@ -2761,7 +2782,7 @@ class ComponentbuilderModelAjax extends JModelList return null; } - protected function buildFieldTexteara($name, $desc, $default, $rows) + protected function buildFieldTextarea($name, $desc, $default, $rows) { // get the textarea $textarea = JFormHelper::loadFieldType('textarea', true); diff --git a/admin/models/class_extendings.php b/admin/models/class_extendings.php new file mode 100644 index 000000000..37a3781f0 --- /dev/null +++ b/admin/models/class_extendings.php @@ -0,0 +1,297 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_extendings Model + */ +class ComponentbuilderModelClass_extendings extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'a.id','id', + 'a.published','published', + 'a.ordering','ordering', + 'a.created_by','created_by', + 'a.modified_by','modified_by', + 'a.name','name', + 'a.extension_type','extension_type' + ); + } + + parent::__construct($config); + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); + $this->setState('filter.name', $name); + + $extension_type = $this->getUserStateFromRequest($this->context . '.filter.extension_type', 'filter_extension_type'); + $this->setState('filter.extension_type', $extension_type); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() + { + // check in items + $this->checkInNow(); + + // load parent items + $items = parent::getItems(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + $access = (JFactory::getUser()->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $item->id) && JFactory::getUser()->authorise('class_extends.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + } + } + + // set selection value to a translatable value + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + // convert extension_type + $item->extension_type = $this->selectionTranslation($item->extension_type, 'extension_type'); + } + } + + + // return items + return $items; + } + + /** + * Method to convert selection values to translatable string. + * + * @return translatable string + */ + public function selectionTranslation($value,$name) + { + // Array of extension_type language strings + if ($name === 'extension_type') + { + $extension_typeArray = array( + 0 => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_SELECT_AN_OPTION', + 'components' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_COMPONENTS', + 'plugins' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_PLUGINS', + 'modules' => 'COM_COMPONENTBUILDER_CLASS_EXTENDS_MODULES' + ); + // Now check if value is found in this array + if (isset($extension_typeArray[$value]) && ComponentbuilderHelper::checkString($extension_typeArray[$value])) + { + return $extension_typeArray[$value]; + } + } + return $value; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_item table + $query->from($db->quoteName('#__componentbuilder_class_extends', 'a')); + + // Filter by published state + $published = $this->getState('filter.published'); + if (is_numeric($published)) + { + $query->where('a.published = ' . (int) $published); + } + elseif ($published === '') + { + $query->where('(a.published = 0 OR a.published = 1)'); + } + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + // Filter by search. + $search = $this->getState('filter.search'); + if (!empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where('a.id = ' . (int) substr($search, 3)); + } + else + { + $search = $db->quote('%' . $db->escape($search) . '%'); + $query->where('(a.name LIKE '.$search.' OR a.extension_type LIKE '.$search.' OR a.head LIKE '.$search.' OR a.comment LIKE '.$search.')'); + } + } + + // Filter by Extension_type. + if ($extension_type = $this->getState('filter.extension_type')) + { + $query->where('a.extension_type = ' . $db->quote($db->escape($extension_type))); + } + + // Add the list ordering clause. + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'asc'); + if ($orderCol != '') + { + $query->order($db->escape($orderCol . ' ' . $orderDirn)); + } + + return $query; + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.id'); + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.ordering'); + $id .= ':' . $this->getState('filter.created_by'); + $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.extension_type'); + + return parent::getStoreId($id); + } + + /** + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ + protected function checkInNow() + { + // Get set check in time + $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); + + if ($time) + { + + // Get a db connection. + $db = JFactory::getDbo(); + // reset query + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->quoteName('#__componentbuilder_class_extends')); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // Get Yesterdays date + $date = JFactory::getDate()->modify($time)->toSql(); + // reset query + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', + $db->quoteName('checked_out') . '=0' + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('checked_out') . '!=0', + $db->quoteName('checked_out_time') . '<\''.$date.'\'' + ); + + // Check table + $query->update($db->quoteName('#__componentbuilder_class_extends'))->set($fields)->where($conditions); + + $db->setQuery($query); + + $db->execute(); + } + } + + return false; + } +} diff --git a/admin/models/class_extends.php b/admin/models/class_extends.php new file mode 100644 index 000000000..161971607 --- /dev/null +++ b/admin/models/class_extends.php @@ -0,0 +1,907 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Componentbuilder Class_extends Model + */ +class ComponentbuilderModelClass_extends extends JModelAdmin +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'name', + 'extension_type' + ), + 'right' => array( + 'comment' + ), + 'fullwidth' => array( + 'head' + ) + ) + ); + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_componentbuilder.class_extends'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JTable A database object + * + * @since 1.6 + */ + public function getTable($type = 'class_extends', $prefix = 'ComponentbuilderTable', $config = array()) + { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables'); + // get instance of the table + return JTable::getInstance($type, $prefix, $config); + } + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + { + if ($item = parent::getItem($pk)) + { + if (!empty($item->params) && !is_array($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + } + + if (!empty($item->head)) + { + // base64 Decode head. + $item->head = base64_decode($item->head); + } + + if (!empty($item->comment)) + { + // base64 Decode comment. + $item->comment = base64_decode($item->comment); + } + + if (!empty($item->id)) + { + $item->tags = new JHelperTags; + $item->tags->getTagIds($item->id, 'com_componentbuilder.class_extends'); + } + } + + return $item; + } + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; + // Get the form. + $form = $this->loadForm('com_componentbuilder.class_extends', 'class_extends', $options); + + if (empty($form)) + { + return false; + } + + $jinput = JFactory::getApplication()->input; + + // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + if ($jinput->get('a_id')) + { + $id = $jinput->get('a_id', 0, 'INT'); + } + // The back end uses id so we use that the rest of the time and set it to 0 by default. + else + { + $id = $jinput->get('id', 0, 'INT'); + } + + $user = JFactory::getUser(); + + // Check for existing item. + // Modify the form based on Edit State access controls. + if ($id != 0 && (!$user->authorise('class_extends.edit.state', 'com_componentbuilder.class_extends.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_extends.edit.state', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('published', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('published', 'filter', 'unset'); + } + // If this is a new item insure the greated by is set. + if (0 == $id) + { + // Set the created_by to this user + $form->setValue('created_by', null, $user->id); + } + // Modify the form based on Edit Creaded By access controls. + if ($id != 0 && (!$user->authorise('class_extends.edit.created_by', 'com_componentbuilder.class_extends.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_extends.edit.created_by', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created_by', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('created_by', 'readonly', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created_by', 'filter', 'unset'); + } + // Modify the form based on Edit Creaded Date access controls. + if ($id != 0 && (!$user->authorise('class_extends.edit.created', 'com_componentbuilder.class_extends.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_extends.edit.created', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created', 'filter', 'unset'); + } + // Only load these values if no id is found + if (0 == $id) + { + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); + if (0 != $redirectedValue && $redirectedField) + { + // Now set the local-redirected field default value + $form->setValue($redirectedField, null, $redirectedValue); + } + } + + // update all editors to use this components global editor + $global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none'); + // now get all the editor fields + $editors = $form->getXml()->xpath("//field[@type='editor']"); + // check if we found any + if (ComponentbuilderHelper::checkArray($editors)) + { + foreach ($editors as $editor) + { + // get the field names + $name = (string) $editor['name']; + // set the field editor value (with none as fallback) + $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); + } + } + + return $form; + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'administrator/components/com_componentbuilder/models/forms/class_extends.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->published != -2) + { + return; + } + + $user = JFactory::getUser(); + // The record has been set. Check the record permissions. + return $user->authorise('class_extends.delete', 'com_componentbuilder.class_extends.' . (int) $record->id); + } + return false; + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + $recordId = (!empty($record->id)) ? $record->id : 0; + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('class_extends.edit.state', 'com_componentbuilder.class_extends.' . (int) $recordId); + if (!$permission && !is_null($permission)) + { + return false; + } + } + // In the absense of better information, revert to the component permissions. + return $user->authorise('class_extends.edit.state', 'com_componentbuilder'); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // Check specific edit permission then general edit permission. + $user = JFactory::getUser(); + + return $user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('class_extends.edit', 'com_componentbuilder'); + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param JTable $table A JTable object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__componentbuilder_class_extends')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.class_extends.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + } + + return $data; + } + + /** + * Method to get the unique fields of this table. + * + * @return mixed An array of field names, boolean false if none is set. + * + * @since 3.0 + */ + protected function getUniqeFields() + { + return false; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + { + if (!parent::delete($pks)) + { + return false; + } + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + { + if (!parent::publish($pks, $value)) + { + return false; + } + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + JArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('class_extends'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new JUcmType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + } + + /** + * Batch copy items to a new category or current. + * + * @param integer $values The new values. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return mixed An array of new IDs on success, boolean false on failure. + * + * @since 12.2 + */ + protected function batchCopy($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('class_extends'); + } + + if (!$this->canDo->get('class_extends.create') && !$this->canDo->get('class_extends.batch')) + { + return false; + } + + // get list of uniqe fields + $uniqeFields = $this->getUniqeFields(); + // remove move_copy from array + unset($values['move_copy']); + + // make sure published is set + if (!isset($values['published'])) + { + $values['published'] = 0; + } + elseif (isset($values['published']) && !$this->canDo->get('class_extends.edit.state')) + { + $values['published'] = 0; + } + + $newIds = array(); + // Parent exists so let's proceed + while (!empty($pks)) + { + // Pop the first ID off the stack + $pk = array_shift($pks); + + $this->table->reset(); + + // only allow copy if user may edit this item. + if (!$this->user->authorise('class_extends.edit', $contexts[$pk])) + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // Only for strings + if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name)) + { + $this->table->name = $this->generateUniqe('name',$this->table->name); + } + + // insert all set values + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + if (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + // update all uniqe fields + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField); + } + } + + // Reset the ID because we are making a copy + $this->table->id = 0; + + // TODO: Deal with ordering? + // $this->table->ordering = 1; + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + + // Get the new item ID + $newId = $this->table->get('id'); + + // Add the new ID to the array + $newIds[$pk] = $newId; + } + + // Clean the cache + $this->cleanCache(); + + return $newIds; + } + + /** + * Batch move items to a new category + * + * @param integer $value The new category ID. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 12.2 + */ + protected function batchMove($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('class_extends'); + } + + if (!$this->canDo->get('class_extends.edit') && !$this->canDo->get('class_extends.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // make sure published only updates if user has the permission. + if (isset($values['published']) && !$this->canDo->get('class_extends.edit.state')) + { + unset($values['published']); + } + // remove move_copy from array + unset($values['move_copy']); + + // Parent exists so we proceed + foreach ($pks as $pk) + { + if (!$this->user->authorise('class_extends.edit', $contexts[$pk])) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // insert all set values. + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + // Do special action for access. + if ('access' === $key && strlen($value) > 0) + { + $this->table->$key = $value; + } + elseif (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + } + + // Clean the cache + $this->cleanCache(); + + return true; + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = JFactory::getApplication()->input; + $filter = JFilterInput::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new JRegistry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + } + + // make sure the name is safe to be used as a class name + $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + + // Set the head string to base64 string. + if (isset($data['head'])) + { + $data['head'] = base64_encode($data['head']); + } + + // Set the comment string to base64 string. + if (isset($data['comment'])) + { + $data['comment'] = base64_encode($data['comment']); + } + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new JRegistry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + } + + // Alter the uniqe field for save as copy + if ($input->get('task') === 'save2copy') + { + // Automatic handling of other uniqe fields + $uniqeFields = $this->getUniqeFields(); + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]); + } + } + } + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUniqe($field,$value) + { + + // set field value uniqe + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = JString::increment($value); + } + + return $value; + } + + /** + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ + protected function _generateNewTitle($title) + { + + // Alter the title + $table = $this->getTable(); + + while ($table->load(array('title' => $title))) + { + $title = JString::increment($title); + } + + return $title; + } +} diff --git a/admin/models/class_method.php b/admin/models/class_method.php new file mode 100644 index 000000000..987395b88 --- /dev/null +++ b/admin/models/class_method.php @@ -0,0 +1,958 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Componentbuilder Class_method Model + */ +class ComponentbuilderModelClass_method extends JModelAdmin +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'name', + 'arguments', + 'visibility', + 'extension_type', + 'joomla_plugin_group' + ), + 'right' => array( + 'comment' + ), + 'fullwidth' => array( + 'code' + ) + ) + ); + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_componentbuilder.class_method'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JTable A database object + * + * @since 1.6 + */ + public function getTable($type = 'class_method', $prefix = 'ComponentbuilderTable', $config = array()) + { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables'); + // get instance of the table + return JTable::getInstance($type, $prefix, $config); + } + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + { + if ($item = parent::getItem($pk)) + { + if (!empty($item->params) && !is_array($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + } + + if (!empty($item->code)) + { + // base64 Decode code. + $item->code = base64_decode($item->code); + } + + if (!empty($item->comment)) + { + // base64 Decode comment. + $item->comment = base64_decode($item->comment); + } + + if (!empty($item->arguments)) + { + // base64 Decode arguments. + $item->arguments = base64_decode($item->arguments); + } + + if (!empty($item->id)) + { + $item->tags = new JHelperTags; + $item->tags->getTagIds($item->id, 'com_componentbuilder.class_method'); + } + } + + return $item; + } + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; + // Get the form. + $form = $this->loadForm('com_componentbuilder.class_method', 'class_method', $options); + + if (empty($form)) + { + return false; + } + + $jinput = JFactory::getApplication()->input; + + // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + if ($jinput->get('a_id')) + { + $id = $jinput->get('a_id', 0, 'INT'); + } + // The back end uses id so we use that the rest of the time and set it to 0 by default. + else + { + $id = $jinput->get('id', 0, 'INT'); + } + + $user = JFactory::getUser(); + + // Check for existing item. + // Modify the form based on Edit State access controls. + if ($id != 0 && (!$user->authorise('class_method.edit.state', 'com_componentbuilder.class_method.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_method.edit.state', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('published', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('published', 'filter', 'unset'); + } + // If this is a new item insure the greated by is set. + if (0 == $id) + { + // Set the created_by to this user + $form->setValue('created_by', null, $user->id); + } + // Modify the form based on Edit Creaded By access controls. + if ($id != 0 && (!$user->authorise('class_method.edit.created_by', 'com_componentbuilder.class_method.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_method.edit.created_by', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created_by', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('created_by', 'readonly', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created_by', 'filter', 'unset'); + } + // Modify the form based on Edit Creaded Date access controls. + if ($id != 0 && (!$user->authorise('class_method.edit.created', 'com_componentbuilder.class_method.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_method.edit.created', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created', 'filter', 'unset'); + } + // Only load these values if no id is found + if (0 == $id) + { + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); + if (0 != $redirectedValue && $redirectedField) + { + // Now set the local-redirected field default value + $form->setValue($redirectedField, null, $redirectedValue); + } + } + + // update all editors to use this components global editor + $global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none'); + // now get all the editor fields + $editors = $form->getXml()->xpath("//field[@type='editor']"); + // check if we found any + if (ComponentbuilderHelper::checkArray($editors)) + { + foreach ($editors as $editor) + { + // get the field names + $name = (string) $editor['name']; + // set the field editor value (with none as fallback) + $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); + } + } + + return $form; + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'administrator/components/com_componentbuilder/models/forms/class_method.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->published != -2) + { + return; + } + + $user = JFactory::getUser(); + // The record has been set. Check the record permissions. + return $user->authorise('class_method.delete', 'com_componentbuilder.class_method.' . (int) $record->id); + } + return false; + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + $recordId = (!empty($record->id)) ? $record->id : 0; + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('class_method.edit.state', 'com_componentbuilder.class_method.' . (int) $recordId); + if (!$permission && !is_null($permission)) + { + return false; + } + } + // In the absense of better information, revert to the component permissions. + return $user->authorise('class_method.edit.state', 'com_componentbuilder'); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // Check specific edit permission then general edit permission. + $user = JFactory::getUser(); + + return $user->authorise('class_method.edit', 'com_componentbuilder.class_method.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('class_method.edit', 'com_componentbuilder'); + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param JTable $table A JTable object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__componentbuilder_class_method')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.class_method.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + } + + return $data; + } + + /** + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ + public function validate($form, $data, $group = null) + { + // check if the not_required field is set + if (ComponentbuilderHelper::checkString($data['not_required'])) + { + $requiredFields = (array) explode(',',(string) $data['not_required']); + $requiredFields = array_unique($requiredFields); + // now change the required field attributes value + foreach ($requiredFields as $requiredField) + { + // make sure there is a string value + if (ComponentbuilderHelper::checkString($requiredField)) + { + // change to false + $form->setFieldAttribute($requiredField, 'required', 'false'); + // also clear the data set + $data[$requiredField] = ''; + } + } + } + return parent::validate($form, $data, $group); + } + + /** + * Method to get the unique fields of this table. + * + * @return mixed An array of field names, boolean false if none is set. + * + * @since 3.0 + */ + protected function getUniqeFields() + { + return false; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + { + if (!parent::delete($pks)) + { + return false; + } + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + { + if (!parent::publish($pks, $value)) + { + return false; + } + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + JArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('class_method'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new JUcmType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + } + + /** + * Batch copy items to a new category or current. + * + * @param integer $values The new values. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return mixed An array of new IDs on success, boolean false on failure. + * + * @since 12.2 + */ + protected function batchCopy($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('class_method'); + } + + if (!$this->canDo->get('class_method.create') && !$this->canDo->get('class_method.batch')) + { + return false; + } + + // get list of uniqe fields + $uniqeFields = $this->getUniqeFields(); + // remove move_copy from array + unset($values['move_copy']); + + // make sure published is set + if (!isset($values['published'])) + { + $values['published'] = 0; + } + elseif (isset($values['published']) && !$this->canDo->get('class_method.edit.state')) + { + $values['published'] = 0; + } + + $newIds = array(); + // Parent exists so let's proceed + while (!empty($pks)) + { + // Pop the first ID off the stack + $pk = array_shift($pks); + + $this->table->reset(); + + // only allow copy if user may edit this item. + if (!$this->user->authorise('class_method.edit', $contexts[$pk])) + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // Only for strings + if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name)) + { + $this->table->name = $this->generateUniqe('name',$this->table->name); + } + + // insert all set values + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + if (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + // update all uniqe fields + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField); + } + } + + // Reset the ID because we are making a copy + $this->table->id = 0; + + // TODO: Deal with ordering? + // $this->table->ordering = 1; + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + + // Get the new item ID + $newId = $this->table->get('id'); + + // Add the new ID to the array + $newIds[$pk] = $newId; + } + + // Clean the cache + $this->cleanCache(); + + return $newIds; + } + + /** + * Batch move items to a new category + * + * @param integer $value The new category ID. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 12.2 + */ + protected function batchMove($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('class_method'); + } + + if (!$this->canDo->get('class_method.edit') && !$this->canDo->get('class_method.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // make sure published only updates if user has the permission. + if (isset($values['published']) && !$this->canDo->get('class_method.edit.state')) + { + unset($values['published']); + } + // remove move_copy from array + unset($values['move_copy']); + + // Parent exists so we proceed + foreach ($pks as $pk) + { + if (!$this->user->authorise('class_method.edit', $contexts[$pk])) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // insert all set values. + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + // Do special action for access. + if ('access' === $key && strlen($value) > 0) + { + $this->table->$key = $value; + } + elseif (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + } + + // Clean the cache + $this->cleanCache(); + + return true; + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = JFactory::getApplication()->input; + $filter = JFilterInput::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new JRegistry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + } + + // make sure the name is safe to be used as a function name + $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + + // Set the code string to base64 string. + if (isset($data['code'])) + { + $data['code'] = base64_encode($data['code']); + } + + // Set the comment string to base64 string. + if (isset($data['comment'])) + { + $data['comment'] = base64_encode($data['comment']); + } + + // Set the arguments string to base64 string. + if (isset($data['arguments'])) + { + $data['arguments'] = base64_encode($data['arguments']); + } + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new JRegistry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + } + + // Alter the uniqe field for save as copy + if ($input->get('task') === 'save2copy') + { + // Automatic handling of other uniqe fields + $uniqeFields = $this->getUniqeFields(); + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]); + } + } + } + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUniqe($field,$value) + { + + // set field value uniqe + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = JString::increment($value); + } + + return $value; + } + + /** + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ + protected function _generateNewTitle($title) + { + + // Alter the title + $table = $this->getTable(); + + while ($table->load(array('title' => $title))) + { + $title = JString::increment($title); + } + + return $title; + } +} diff --git a/admin/models/class_methods.php b/admin/models/class_methods.php new file mode 100644 index 000000000..fd5ee8b88 --- /dev/null +++ b/admin/models/class_methods.php @@ -0,0 +1,431 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_methods Model + */ +class ComponentbuilderModelClass_methods extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'a.id','id', + 'a.published','published', + 'a.ordering','ordering', + 'a.created_by','created_by', + 'a.modified_by','modified_by', + 'a.name','name', + 'a.visibility','visibility', + 'a.extension_type','extension_type' + ); + } + + parent::__construct($config); + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); + $this->setState('filter.name', $name); + + $visibility = $this->getUserStateFromRequest($this->context . '.filter.visibility', 'filter_visibility'); + $this->setState('filter.visibility', $visibility); + + $extension_type = $this->getUserStateFromRequest($this->context . '.filter.extension_type', 'filter_extension_type'); + $this->setState('filter.extension_type', $extension_type); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() + { + // check in items + $this->checkInNow(); + + // load parent items + $items = parent::getItems(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + $access = (JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $item->id) && JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + } + } + + // set selection value to a translatable value + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + // convert visibility + $item->visibility = $this->selectionTranslation($item->visibility, 'visibility'); + // convert extension_type + $item->extension_type = $this->selectionTranslation($item->extension_type, 'extension_type'); + } + } + + + // return items + return $items; + } + + /** + * Method to convert selection values to translatable string. + * + * @return translatable string + */ + public function selectionTranslation($value,$name) + { + // Array of visibility language strings + if ($name === 'visibility') + { + $visibilityArray = array( + 'public' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PUBLIC', + 'protected' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PROTECTED', + 'private' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PRIVATE' + ); + // Now check if value is found in this array + if (isset($visibilityArray[$value]) && ComponentbuilderHelper::checkString($visibilityArray[$value])) + { + return $visibilityArray[$value]; + } + } + // Array of extension_type language strings + if ($name === 'extension_type') + { + $extension_typeArray = array( + 0 => 'COM_COMPONENTBUILDER_CLASS_METHOD_SELECT_AN_OPTION', + 'components' => 'COM_COMPONENTBUILDER_CLASS_METHOD_COMPONENTS', + 'plugins' => 'COM_COMPONENTBUILDER_CLASS_METHOD_PLUGINS', + 'modules' => 'COM_COMPONENTBUILDER_CLASS_METHOD_MODULES' + ); + // Now check if value is found in this array + if (isset($extension_typeArray[$value]) && ComponentbuilderHelper::checkString($extension_typeArray[$value])) + { + return $extension_typeArray[$value]; + } + } + return $value; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_item table + $query->from($db->quoteName('#__componentbuilder_class_method', 'a')); + + // From the componentbuilder_joomla_plugin_group table. + $query->select($db->quoteName('g.name','joomla_plugin_group_name')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_plugin_group', 'g') . ' ON (' . $db->quoteName('a.joomla_plugin_group') . ' = ' . $db->quoteName('g.id') . ')'); + + // Filter by published state + $published = $this->getState('filter.published'); + if (is_numeric($published)) + { + $query->where('a.published = ' . (int) $published); + } + elseif ($published === '') + { + $query->where('(a.published = 0 OR a.published = 1)'); + } + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + // Filter by search. + $search = $this->getState('filter.search'); + if (!empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where('a.id = ' . (int) substr($search, 3)); + } + else + { + $search = $db->quote('%' . $db->escape($search) . '%'); + $query->where('(a.name LIKE '.$search.' OR a.visibility LIKE '.$search.' OR a.extension_type LIKE '.$search.' OR a.comment LIKE '.$search.' OR a.arguments LIKE '.$search.')'); + } + } + + // Filter by Visibility. + if ($visibility = $this->getState('filter.visibility')) + { + $query->where('a.visibility = ' . $db->quote($db->escape($visibility))); + } + // Filter by Extension_type. + if ($extension_type = $this->getState('filter.extension_type')) + { + $query->where('a.extension_type = ' . $db->quote($db->escape($extension_type))); + } + + // Add the list ordering clause. + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'asc'); + if ($orderCol != '') + { + $query->order($db->escape($orderCol . ' ' . $orderDirn)); + } + + return $query; + } + + /** + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExportData($pks) + { + // setup the query + if (ComponentbuilderHelper::checkArray($pks)) + { + // Set a value to know this is exporting method. + $_export = true; + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_class_method table + $query->from($db->quoteName('#__componentbuilder_class_method', 'a')); + $query->where('a.id IN (' . implode(',',$pks) . ')'); + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Order the results by ordering + $query->order('a.ordering ASC'); + + // Load the items + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $items = $db->loadObjectList(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + $access = (JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $item->id) && JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + // decode code + $item->code = base64_decode($item->code); + // decode comment + $item->comment = base64_decode($item->comment); + // decode arguments + $item->arguments = base64_decode($item->arguments); + // unset the values we don't want exported. + unset($item->asset_id); + unset($item->checked_out); + unset($item->checked_out_time); + } + } + // Add headers to items array. + $headers = $this->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + array_unshift($items,$headers); + } + return $items; + } + } + return false; + } + + /** + * Method to get header. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExImPortHeaders() + { + // Get a db connection. + $db = JFactory::getDbo(); + // get the columns + $columns = $db->getTableColumns("#__componentbuilder_class_method"); + if (ComponentbuilderHelper::checkArray($columns)) + { + // remove the headers you don't import/export. + unset($columns['asset_id']); + unset($columns['checked_out']); + unset($columns['checked_out_time']); + $headers = new stdClass(); + foreach ($columns as $column => $type) + { + $headers->{$column} = $column; + } + return $headers; + } + return false; + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.id'); + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.ordering'); + $id .= ':' . $this->getState('filter.created_by'); + $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.visibility'); + $id .= ':' . $this->getState('filter.extension_type'); + + return parent::getStoreId($id); + } + + /** + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ + protected function checkInNow() + { + // Get set check in time + $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); + + if ($time) + { + + // Get a db connection. + $db = JFactory::getDbo(); + // reset query + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->quoteName('#__componentbuilder_class_method')); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // Get Yesterdays date + $date = JFactory::getDate()->modify($time)->toSql(); + // reset query + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', + $db->quoteName('checked_out') . '=0' + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('checked_out') . '!=0', + $db->quoteName('checked_out_time') . '<\''.$date.'\'' + ); + + // Check table + $query->update($db->quoteName('#__componentbuilder_class_method'))->set($fields)->where($conditions); + + $db->setQuery($query); + + $db->execute(); + } + } + + return false; + } +} diff --git a/admin/models/class_properties.php b/admin/models/class_properties.php new file mode 100644 index 000000000..e5d157df0 --- /dev/null +++ b/admin/models/class_properties.php @@ -0,0 +1,429 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_properties Model + */ +class ComponentbuilderModelClass_properties extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'a.id','id', + 'a.published','published', + 'a.ordering','ordering', + 'a.created_by','created_by', + 'a.modified_by','modified_by', + 'a.name','name', + 'a.visibility','visibility', + 'a.extension_type','extension_type' + ); + } + + parent::__construct($config); + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); + $this->setState('filter.name', $name); + + $visibility = $this->getUserStateFromRequest($this->context . '.filter.visibility', 'filter_visibility'); + $this->setState('filter.visibility', $visibility); + + $extension_type = $this->getUserStateFromRequest($this->context . '.filter.extension_type', 'filter_extension_type'); + $this->setState('filter.extension_type', $extension_type); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() + { + // check in items + $this->checkInNow(); + + // load parent items + $items = parent::getItems(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + $access = (JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $item->id) && JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + } + } + + // set selection value to a translatable value + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + // convert visibility + $item->visibility = $this->selectionTranslation($item->visibility, 'visibility'); + // convert extension_type + $item->extension_type = $this->selectionTranslation($item->extension_type, 'extension_type'); + } + } + + + // return items + return $items; + } + + /** + * Method to convert selection values to translatable string. + * + * @return translatable string + */ + public function selectionTranslation($value,$name) + { + // Array of visibility language strings + if ($name === 'visibility') + { + $visibilityArray = array( + 'public' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PUBLIC', + 'protected' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PROTECTED', + 'private' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PRIVATE' + ); + // Now check if value is found in this array + if (isset($visibilityArray[$value]) && ComponentbuilderHelper::checkString($visibilityArray[$value])) + { + return $visibilityArray[$value]; + } + } + // Array of extension_type language strings + if ($name === 'extension_type') + { + $extension_typeArray = array( + 0 => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_SELECT_AN_OPTION', + 'components' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_COMPONENTS', + 'plugins' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_PLUGINS', + 'modules' => 'COM_COMPONENTBUILDER_CLASS_PROPERTY_MODULES' + ); + // Now check if value is found in this array + if (isset($extension_typeArray[$value]) && ComponentbuilderHelper::checkString($extension_typeArray[$value])) + { + return $extension_typeArray[$value]; + } + } + return $value; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_item table + $query->from($db->quoteName('#__componentbuilder_class_property', 'a')); + + // From the componentbuilder_joomla_plugin_group table. + $query->select($db->quoteName('g.name','joomla_plugin_group_name')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_plugin_group', 'g') . ' ON (' . $db->quoteName('a.joomla_plugin_group') . ' = ' . $db->quoteName('g.id') . ')'); + + // Filter by published state + $published = $this->getState('filter.published'); + if (is_numeric($published)) + { + $query->where('a.published = ' . (int) $published); + } + elseif ($published === '') + { + $query->where('(a.published = 0 OR a.published = 1)'); + } + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + // Filter by search. + $search = $this->getState('filter.search'); + if (!empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where('a.id = ' . (int) substr($search, 3)); + } + else + { + $search = $db->quote('%' . $db->escape($search) . '%'); + $query->where('(a.name LIKE '.$search.' OR a.visibility LIKE '.$search.' OR a.extension_type LIKE '.$search.' OR a.comment LIKE '.$search.')'); + } + } + + // Filter by Visibility. + if ($visibility = $this->getState('filter.visibility')) + { + $query->where('a.visibility = ' . $db->quote($db->escape($visibility))); + } + // Filter by Extension_type. + if ($extension_type = $this->getState('filter.extension_type')) + { + $query->where('a.extension_type = ' . $db->quote($db->escape($extension_type))); + } + + // Add the list ordering clause. + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'asc'); + if ($orderCol != '') + { + $query->order($db->escape($orderCol . ' ' . $orderDirn)); + } + + return $query; + } + + /** + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExportData($pks) + { + // setup the query + if (ComponentbuilderHelper::checkArray($pks)) + { + // Set a value to know this is exporting method. + $_export = true; + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_class_property table + $query->from($db->quoteName('#__componentbuilder_class_property', 'a')); + $query->where('a.id IN (' . implode(',',$pks) . ')'); + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Order the results by ordering + $query->order('a.ordering ASC'); + + // Load the items + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $items = $db->loadObjectList(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + $access = (JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $item->id) && JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + // decode comment + $item->comment = base64_decode($item->comment); + // decode default + $item->default = base64_decode($item->default); + // unset the values we don't want exported. + unset($item->asset_id); + unset($item->checked_out); + unset($item->checked_out_time); + } + } + // Add headers to items array. + $headers = $this->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + array_unshift($items,$headers); + } + return $items; + } + } + return false; + } + + /** + * Method to get header. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExImPortHeaders() + { + // Get a db connection. + $db = JFactory::getDbo(); + // get the columns + $columns = $db->getTableColumns("#__componentbuilder_class_property"); + if (ComponentbuilderHelper::checkArray($columns)) + { + // remove the headers you don't import/export. + unset($columns['asset_id']); + unset($columns['checked_out']); + unset($columns['checked_out_time']); + $headers = new stdClass(); + foreach ($columns as $column => $type) + { + $headers->{$column} = $column; + } + return $headers; + } + return false; + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.id'); + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.ordering'); + $id .= ':' . $this->getState('filter.created_by'); + $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.visibility'); + $id .= ':' . $this->getState('filter.extension_type'); + + return parent::getStoreId($id); + } + + /** + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ + protected function checkInNow() + { + // Get set check in time + $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); + + if ($time) + { + + // Get a db connection. + $db = JFactory::getDbo(); + // reset query + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->quoteName('#__componentbuilder_class_property')); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // Get Yesterdays date + $date = JFactory::getDate()->modify($time)->toSql(); + // reset query + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', + $db->quoteName('checked_out') . '=0' + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('checked_out') . '!=0', + $db->quoteName('checked_out_time') . '<\''.$date.'\'' + ); + + // Check table + $query->update($db->quoteName('#__componentbuilder_class_property'))->set($fields)->where($conditions); + + $db->setQuery($query); + + $db->execute(); + } + } + + return false; + } +} diff --git a/admin/models/class_property.php b/admin/models/class_property.php new file mode 100644 index 000000000..4557ceb53 --- /dev/null +++ b/admin/models/class_property.php @@ -0,0 +1,943 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Componentbuilder Class_property Model + */ +class ComponentbuilderModelClass_property extends JModelAdmin +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'name', + 'visibility', + 'default', + 'extension_type', + 'joomla_plugin_group' + ), + 'right' => array( + 'comment' + ) + ) + ); + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_componentbuilder.class_property'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JTable A database object + * + * @since 1.6 + */ + public function getTable($type = 'class_property', $prefix = 'ComponentbuilderTable', $config = array()) + { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables'); + // get instance of the table + return JTable::getInstance($type, $prefix, $config); + } + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + { + if ($item = parent::getItem($pk)) + { + if (!empty($item->params) && !is_array($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + } + + if (!empty($item->comment)) + { + // base64 Decode comment. + $item->comment = base64_decode($item->comment); + } + + if (!empty($item->default)) + { + // base64 Decode default. + $item->default = base64_decode($item->default); + } + + if (!empty($item->id)) + { + $item->tags = new JHelperTags; + $item->tags->getTagIds($item->id, 'com_componentbuilder.class_property'); + } + } + + return $item; + } + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; + // Get the form. + $form = $this->loadForm('com_componentbuilder.class_property', 'class_property', $options); + + if (empty($form)) + { + return false; + } + + $jinput = JFactory::getApplication()->input; + + // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + if ($jinput->get('a_id')) + { + $id = $jinput->get('a_id', 0, 'INT'); + } + // The back end uses id so we use that the rest of the time and set it to 0 by default. + else + { + $id = $jinput->get('id', 0, 'INT'); + } + + $user = JFactory::getUser(); + + // Check for existing item. + // Modify the form based on Edit State access controls. + if ($id != 0 && (!$user->authorise('class_property.edit.state', 'com_componentbuilder.class_property.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_property.edit.state', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('published', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('published', 'filter', 'unset'); + } + // If this is a new item insure the greated by is set. + if (0 == $id) + { + // Set the created_by to this user + $form->setValue('created_by', null, $user->id); + } + // Modify the form based on Edit Creaded By access controls. + if ($id != 0 && (!$user->authorise('class_property.edit.created_by', 'com_componentbuilder.class_property.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_property.edit.created_by', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created_by', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('created_by', 'readonly', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created_by', 'filter', 'unset'); + } + // Modify the form based on Edit Creaded Date access controls. + if ($id != 0 && (!$user->authorise('class_property.edit.created', 'com_componentbuilder.class_property.' . (int) $id)) + || ($id == 0 && !$user->authorise('class_property.edit.created', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created', 'filter', 'unset'); + } + // Only load these values if no id is found + if (0 == $id) + { + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); + if (0 != $redirectedValue && $redirectedField) + { + // Now set the local-redirected field default value + $form->setValue($redirectedField, null, $redirectedValue); + } + } + + // update all editors to use this components global editor + $global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none'); + // now get all the editor fields + $editors = $form->getXml()->xpath("//field[@type='editor']"); + // check if we found any + if (ComponentbuilderHelper::checkArray($editors)) + { + foreach ($editors as $editor) + { + // get the field names + $name = (string) $editor['name']; + // set the field editor value (with none as fallback) + $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); + } + } + + return $form; + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'administrator/components/com_componentbuilder/models/forms/class_property.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->published != -2) + { + return; + } + + $user = JFactory::getUser(); + // The record has been set. Check the record permissions. + return $user->authorise('class_property.delete', 'com_componentbuilder.class_property.' . (int) $record->id); + } + return false; + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + $recordId = (!empty($record->id)) ? $record->id : 0; + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('class_property.edit.state', 'com_componentbuilder.class_property.' . (int) $recordId); + if (!$permission && !is_null($permission)) + { + return false; + } + } + // In the absense of better information, revert to the component permissions. + return $user->authorise('class_property.edit.state', 'com_componentbuilder'); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // Check specific edit permission then general edit permission. + $user = JFactory::getUser(); + + return $user->authorise('class_property.edit', 'com_componentbuilder.class_property.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('class_property.edit', 'com_componentbuilder'); + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param JTable $table A JTable object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__componentbuilder_class_property')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.class_property.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + } + + return $data; + } + + /** + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ + public function validate($form, $data, $group = null) + { + // check if the not_required field is set + if (ComponentbuilderHelper::checkString($data['not_required'])) + { + $requiredFields = (array) explode(',',(string) $data['not_required']); + $requiredFields = array_unique($requiredFields); + // now change the required field attributes value + foreach ($requiredFields as $requiredField) + { + // make sure there is a string value + if (ComponentbuilderHelper::checkString($requiredField)) + { + // change to false + $form->setFieldAttribute($requiredField, 'required', 'false'); + // also clear the data set + $data[$requiredField] = ''; + } + } + } + return parent::validate($form, $data, $group); + } + + /** + * Method to get the unique fields of this table. + * + * @return mixed An array of field names, boolean false if none is set. + * + * @since 3.0 + */ + protected function getUniqeFields() + { + return false; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + { + if (!parent::delete($pks)) + { + return false; + } + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + { + if (!parent::publish($pks, $value)) + { + return false; + } + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + JArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('class_property'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new JUcmType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + } + + /** + * Batch copy items to a new category or current. + * + * @param integer $values The new values. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return mixed An array of new IDs on success, boolean false on failure. + * + * @since 12.2 + */ + protected function batchCopy($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('class_property'); + } + + if (!$this->canDo->get('class_property.create') && !$this->canDo->get('class_property.batch')) + { + return false; + } + + // get list of uniqe fields + $uniqeFields = $this->getUniqeFields(); + // remove move_copy from array + unset($values['move_copy']); + + // make sure published is set + if (!isset($values['published'])) + { + $values['published'] = 0; + } + elseif (isset($values['published']) && !$this->canDo->get('class_property.edit.state')) + { + $values['published'] = 0; + } + + $newIds = array(); + // Parent exists so let's proceed + while (!empty($pks)) + { + // Pop the first ID off the stack + $pk = array_shift($pks); + + $this->table->reset(); + + // only allow copy if user may edit this item. + if (!$this->user->authorise('class_property.edit', $contexts[$pk])) + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // Only for strings + if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name)) + { + $this->table->name = $this->generateUniqe('name',$this->table->name); + } + + // insert all set values + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + if (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + // update all uniqe fields + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField); + } + } + + // Reset the ID because we are making a copy + $this->table->id = 0; + + // TODO: Deal with ordering? + // $this->table->ordering = 1; + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + + // Get the new item ID + $newId = $this->table->get('id'); + + // Add the new ID to the array + $newIds[$pk] = $newId; + } + + // Clean the cache + $this->cleanCache(); + + return $newIds; + } + + /** + * Batch move items to a new category + * + * @param integer $value The new category ID. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 12.2 + */ + protected function batchMove($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('class_property'); + } + + if (!$this->canDo->get('class_property.edit') && !$this->canDo->get('class_property.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // make sure published only updates if user has the permission. + if (isset($values['published']) && !$this->canDo->get('class_property.edit.state')) + { + unset($values['published']); + } + // remove move_copy from array + unset($values['move_copy']); + + // Parent exists so we proceed + foreach ($pks as $pk) + { + if (!$this->user->authorise('class_property.edit', $contexts[$pk])) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // insert all set values. + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + // Do special action for access. + if ('access' === $key && strlen($value) > 0) + { + $this->table->$key = $value; + } + elseif (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + } + + // Clean the cache + $this->cleanCache(); + + return true; + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = JFactory::getApplication()->input; + $filter = JFilterInput::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new JRegistry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + } + + // make sure the name is safe to be used as a function name + $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + + // Set the comment string to base64 string. + if (isset($data['comment'])) + { + $data['comment'] = base64_encode($data['comment']); + } + + // Set the default string to base64 string. + if (isset($data['default'])) + { + $data['default'] = base64_encode($data['default']); + } + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new JRegistry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + } + + // Alter the uniqe field for save as copy + if ($input->get('task') === 'save2copy') + { + // Automatic handling of other uniqe fields + $uniqeFields = $this->getUniqeFields(); + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]); + } + } + } + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUniqe($field,$value) + { + + // set field value uniqe + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = JString::increment($value); + } + + return $value; + } + + /** + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ + protected function _generateNewTitle($title) + { + + // Alter the title + $table = $this->getTable(); + + while ($table->load(array('title' => $title))) + { + $title = JString::increment($title); + } + + return $title; + } +} diff --git a/admin/models/component_dashboard.php b/admin/models/component_dashboard.php index 3c386aeeb..38d85aca3 100644 --- a/admin/models/component_dashboard.php +++ b/admin/models/component_dashboard.php @@ -27,6 +27,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin protected $tabLayoutFields = array( 'dashboard' => array( 'fullwidth' => array( + 'note_php_dashboard_note', 'php_dashboard_methods', 'dashboard_tab' ), diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index b59609f41..d727bbf87 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -25,7 +25,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList $icons = array(); // view groups array $viewGroups = array( - 'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png||importjcbpackages||index.php?option=com_componentbuilder&view=joomla_components&task=joomla_components.smartImport', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.get_snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.servers', 'png.help_documents') + 'main' => array('png.compiler', 'png.joomla_components', 'png.joomla_plugins', 'png.admin_view.add', 'png.admin_views', 'png||importjcbpackages||index.php?option=com_componentbuilder&view=joomla_components&task=joomla_components.smartImport', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.placeholders', 'png.libraries', 'png.snippets', 'png.get_snippets', 'png.validation_rules', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.servers', 'png.help_documents') ); // view access array $viewAccess = array( @@ -38,7 +38,11 @@ class ComponentbuilderModelComponentbuilder extends JModelList 'joomla_component.access' => 'joomla_component.access', 'joomla_components.submenu' => 'joomla_component.submenu', 'joomla_components.dashboard_list' => 'joomla_component.dashboard_list', - 'joomla_component.dashboard_add' => 'joomla_component.dashboard_add', + 'joomla_plugin.create' => 'joomla_plugin.create', + 'joomla_plugins.access' => 'joomla_plugin.access', + 'joomla_plugin.access' => 'joomla_plugin.access', + 'joomla_plugins.submenu' => 'joomla_plugin.submenu', + 'joomla_plugins.dashboard_list' => 'joomla_plugin.dashboard_list', 'admin_view.create' => 'admin_view.create', 'admin_views.access' => 'admin_view.access', 'admin_view.access' => 'admin_view.access', @@ -76,6 +80,12 @@ class ComponentbuilderModelComponentbuilder extends JModelList 'custom_code.access' => 'custom_code.access', 'custom_codes.submenu' => 'custom_code.submenu', 'custom_codes.dashboard_list' => 'custom_code.dashboard_list', + 'class_property.create' => 'class_property.create', + 'class_properties.access' => 'class_property.access', + 'class_property.access' => 'class_property.access', + 'class_method.create' => 'class_method.create', + 'class_methods.access' => 'class_method.access', + 'class_method.access' => 'class_method.access', 'placeholder.create' => 'placeholder.create', 'placeholders.access' => 'placeholder.access', 'placeholder.access' => 'placeholder.access', @@ -175,7 +185,12 @@ class ComponentbuilderModelComponentbuilder extends JModelList 'library_config.access' => 'library_config.access', 'library_files_folders_urls.create' => 'library_files_folders_urls.create', 'libraries_files_folders_urls.access' => 'library_files_folders_urls.access', - 'library_files_folders_urls.access' => 'library_files_folders_urls.access'); + 'library_files_folders_urls.access' => 'library_files_folders_urls.access', + 'class_extends.create' => 'class_extends.create', + 'class_extendings.access' => 'class_extends.access', + 'class_extends.access' => 'class_extends.access', + 'joomla_plugin_groups.access' => 'joomla_plugin_group.access', + 'joomla_plugin_group.access' => 'joomla_plugin_group.access'); // loop over the $views foreach($viewGroups as $group => $views) { diff --git a/admin/models/fields/classextends.php b/admin/models/fields/classextends.php new file mode 100644 index 000000000..5fdc5bc83 --- /dev/null +++ b/admin/models/fields/classextends.php @@ -0,0 +1,174 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Classextends Form Field class for the Componentbuilder component + */ +class JFormFieldClassextends extends JFormFieldList +{ + /** + * The classextends field type. + * + * @var string + */ + public $type = 'classextends'; + + /** + * Override to add new button + * + * @return string The field input markup. + * + * @since 3.2 + */ + protected function getInput() + { + // see if we should add buttons + $set_button = $this->getAttribute('button'); + // get html + $html = parent::getInput(); + // if true set button + if ($set_button === 'true') + { + $button = array(); + $script = array(); + $button_code_name = $this->getAttribute('name'); + // get the input from url + $app = JFactory::getApplication(); + $jinput = $app->input; + // get the view name & id + $values = $jinput->getArray(array( + 'id' => 'int', + 'view' => 'word' + )); + // check if new item + $ref = ''; + $refJ = ''; + if (!is_null($values['id']) && strlen($values['view'])) + { + // only load referral if not new item. + $ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; + $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; + // get the return value. + $_uri = (string) JUri::getInstance(); + $_return = urlencode(base64_encode($_uri)); + // load return value. + $ref .= '&return=' . $_return; + $refJ .= '&return=' . $_return; + } + // get button label + $button_label = trim($button_code_name); + $button_label = preg_replace('/_+/', ' ', $button_label); + $button_label = preg_replace('/\s+/', ' ', $button_label); + $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label); + $button_label = ucfirst(strtolower($button_label)); + // get user object + $user = JFactory::getUser(); + // only add if user allowed to create class_extends + if ($user->authorise('class_extends.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build Create button + $button[] = ' + '; + } + // only add if user allowed to edit class_extends + if ($user->authorise('class_extends.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build edit button + $button[] = ''; + // build script + $script[] = " + jQuery(document).ready(function() { + jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) { + e.preventDefault(); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); + }); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); + }); + function ".$button_code_name."Button(value) { + if (value > 0) { + // hide the create button + jQuery('#".$button_code_name."Create').hide(); + // show edit button + jQuery('#".$button_code_name."Edit').show(); + var url = 'index.php?option=com_componentbuilder&view=class_extendings&task=class_extends.edit&id='+value+'".$refJ."'; + jQuery('#".$button_code_name."Edit').attr('href', url); + } else { + // show the create button + jQuery('#".$button_code_name."Create').show(); + // hide edit button + jQuery('#".$button_code_name."Edit').hide(); + } + }"; + } + // check if button was created for class_extends field. + if (is_array($button) && count($button) > 0) + { + // Load the needed script. + $document = JFactory::getDocument(); + $document->addScriptDeclaration(implode(' ',$script)); + // return the button attached to input field. + return '
' .$html . implode('',$button).'
'; + } + } + return $html; + } + + /** + * Method to get a list of options for a list input. + * + * @return array An array of JHtml options. + */ + protected function getOptions() + { + // Get the user object. + $user = JFactory::getUser(); + // Get the databse object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name'),array('id','class_extends_name'))); + $query->from($db->quoteName('#__componentbuilder_class_extends', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->order('a.name ASC'); + // Implement View Level Access (if set in table) + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $columns = $db->getTableColumns('#__componentbuilder_class_extends'); + if(isset($columns['access'])) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + } + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + $options[] = JHtml::_('select.option', '', 'Select a class'); + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->class_extends_name); + } + } + return $options; + } +} diff --git a/admin/models/fields/joomlaplugingroups.php b/admin/models/fields/joomlaplugingroups.php new file mode 100644 index 000000000..92ec0955c --- /dev/null +++ b/admin/models/fields/joomlaplugingroups.php @@ -0,0 +1,174 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Joomlaplugingroups Form Field class for the Componentbuilder component + */ +class JFormFieldJoomlaplugingroups extends JFormFieldList +{ + /** + * The joomlaplugingroups field type. + * + * @var string + */ + public $type = 'joomlaplugingroups'; + + /** + * Override to add new button + * + * @return string The field input markup. + * + * @since 3.2 + */ + protected function getInput() + { + // see if we should add buttons + $set_button = $this->getAttribute('button'); + // get html + $html = parent::getInput(); + // if true set button + if ($set_button === 'true') + { + $button = array(); + $script = array(); + $button_code_name = $this->getAttribute('name'); + // get the input from url + $app = JFactory::getApplication(); + $jinput = $app->input; + // get the view name & id + $values = $jinput->getArray(array( + 'id' => 'int', + 'view' => 'word' + )); + // check if new item + $ref = ''; + $refJ = ''; + if (!is_null($values['id']) && strlen($values['view'])) + { + // only load referral if not new item. + $ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; + $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; + // get the return value. + $_uri = (string) JUri::getInstance(); + $_return = urlencode(base64_encode($_uri)); + // load return value. + $ref .= '&return=' . $_return; + $refJ .= '&return=' . $_return; + } + // get button label + $button_label = trim($button_code_name); + $button_label = preg_replace('/_+/', ' ', $button_label); + $button_label = preg_replace('/\s+/', ' ', $button_label); + $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label); + $button_label = ucfirst(strtolower($button_label)); + // get user object + $user = JFactory::getUser(); + // only add if user allowed to create joomla_plugin_group + if ($user->authorise('core.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build Create button + $button[] = ' + '; + } + // only add if user allowed to edit joomla_plugin_group + if ($user->authorise('core.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build edit button + $button[] = ''; + // build script + $script[] = " + jQuery(document).ready(function() { + jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) { + e.preventDefault(); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); + }); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); + }); + function ".$button_code_name."Button(value) { + if (value > 0) { + // hide the create button + jQuery('#".$button_code_name."Create').hide(); + // show edit button + jQuery('#".$button_code_name."Edit').show(); + var url = 'index.php?option=com_componentbuilder&view=joomla_plugin_groups&task=joomla_plugin_group.edit&id='+value+'".$refJ."'; + jQuery('#".$button_code_name."Edit').attr('href', url); + } else { + // show the create button + jQuery('#".$button_code_name."Create').show(); + // hide edit button + jQuery('#".$button_code_name."Edit').hide(); + } + }"; + } + // check if button was created for joomla_plugin_group field. + if (is_array($button) && count($button) > 0) + { + // Load the needed script. + $document = JFactory::getDocument(); + $document->addScriptDeclaration(implode(' ',$script)); + // return the button attached to input field. + return '
' .$html . implode('',$button).'
'; + } + } + return $html; + } + + /** + * Method to get a list of options for a list input. + * + * @return array An array of JHtml options. + */ + protected function getOptions() + { + // Get the user object. + $user = JFactory::getUser(); + // Get the databse object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name'),array('id','joomla_plugin_group_name'))); + $query->from($db->quoteName('#__componentbuilder_joomla_plugin_group', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->order('a.name ASC'); + // Implement View Level Access (if set in table) + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $columns = $db->getTableColumns('#__componentbuilder_joomla_plugin_group'); + if(isset($columns['access'])) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + } + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + $options[] = JHtml::_('select.option', '', 'Select a group'); + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->joomla_plugin_group_name); + } + } + return $options; + } +} diff --git a/admin/models/fields/pluginsclassmethods.php b/admin/models/fields/pluginsclassmethods.php new file mode 100644 index 000000000..c59817bbe --- /dev/null +++ b/admin/models/fields/pluginsclassmethods.php @@ -0,0 +1,81 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Pluginsclassmethods Form Field class for the Componentbuilder component + */ +class JFormFieldPluginsclassmethods extends JFormFieldList +{ + /** + * The pluginsclassmethods field type. + * + * @var string + */ + public $type = 'pluginsclassmethods'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of JHtml options. + */ + protected function getOptions() + { + +// Get the user object. + $user = JFactory::getUser(); + // Get the databse object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name','a.visibility'),array('id','method_name','visibility'))); + $query->from($db->quoteName('#__componentbuilder_class_method', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->where($db->quoteName('a.extension_type') . ' = ' . $db->quote('plugins')); + $query->order('a.name ASC'); + // Implement View Level Access (if set in table) + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $columns = $db->getTableColumns('#__componentbuilder_class_method'); + if(isset($columns['access'])) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + } + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + $options[] = JHtml::_('select.option', '', 'Select a method'); + foreach($items as $item) + { + // we are using this code in more then one field JCB custom_code + if ('method' === 'method') + { + $select = $item->visibility . ' function ' . $item->method_name . '()'; + } + else + { + $select = $item->visibility . ' $' . $item->method_name; + } + $options[] = JHtml::_('select.option', $item->id, $select); + } + } + return $options; + } +} diff --git a/admin/models/fields/pluginsclassproperties.php b/admin/models/fields/pluginsclassproperties.php new file mode 100644 index 000000000..6aa830d64 --- /dev/null +++ b/admin/models/fields/pluginsclassproperties.php @@ -0,0 +1,81 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Pluginsclassproperties Form Field class for the Componentbuilder component + */ +class JFormFieldPluginsclassproperties extends JFormFieldList +{ + /** + * The pluginsclassproperties field type. + * + * @var string + */ + public $type = 'pluginsclassproperties'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of JHtml options. + */ + protected function getOptions() + { + +// Get the user object. + $user = JFactory::getUser(); + // Get the databse object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.name','a.visibility'),array('id','property_name','visibility'))); + $query->from($db->quoteName('#__componentbuilder_class_property', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->where($db->quoteName('a.extension_type') . ' = ' . $db->quote('plugins')); + $query->order('a.name ASC'); + // Implement View Level Access (if set in table) + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $columns = $db->getTableColumns('#__componentbuilder_class_property'); + if(isset($columns['access'])) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + } + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + $options[] = JHtml::_('select.option', '', 'Select a property'); + foreach($items as $item) + { + // we are using this code in more then one field JCB custom_code + if ('method' === 'property') + { + $select = $item->visibility . ' function ' . $item->property_name . '()'; + } + else + { + $select = $item->visibility . ' $' . $item->property_name; + } + $options[] = JHtml::_('select.option', $item->id, $select); + } + } + return $options; + } +} diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index 1c4f8c295..04bfa9450 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -203,7 +203,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVxqfields() + public function getVxsfields() { // Get the user object. $user = JFactory::getUser(); @@ -285,13 +285,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin foreach ($items as $nr => &$item) { // convert datatype - $item->datatype = $this->selectionTranslationVxqfields($item->datatype, 'datatype'); + $item->datatype = $this->selectionTranslationVxsfields($item->datatype, 'datatype'); // convert indexes - $item->indexes = $this->selectionTranslationVxqfields($item->indexes, 'indexes'); + $item->indexes = $this->selectionTranslationVxsfields($item->indexes, 'indexes'); // convert null_switch - $item->null_switch = $this->selectionTranslationVxqfields($item->null_switch, 'null_switch'); + $item->null_switch = $this->selectionTranslationVxsfields($item->null_switch, 'null_switch'); // convert store - $item->store = $this->selectionTranslationVxqfields($item->store, 'store'); + $item->store = $this->selectionTranslationVxsfields($item->store, 'store'); } } @@ -305,7 +305,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return translatable string */ - public function selectionTranslationVxqfields($value,$name) + public function selectionTranslationVxsfields($value,$name) { // Array of datatype language strings if ($name === 'datatype') diff --git a/admin/models/forms/admin_view.js b/admin/models/forms/admin_view.js index d4c61abbc..14d738498 100644 --- a/admin/models/forms/admin_view.js +++ b/admin/models/forms/admin_view.js @@ -9,123 +9,123 @@ */ // Some Global Values -jform_vvvvvybvwd_required = false; -jform_vvvvvycvwe_required = false; -jform_vvvvvygvwf_required = false; -jform_vvvvvygvwg_required = false; -jform_vvvvvygvwh_required = false; -jform_vvvvvygvwi_required = false; -jform_vvvvvygvwj_required = false; -jform_vvvvvygvwk_required = false; -jform_vvvvvygvwl_required = false; +jform_vvvvvydvwd_required = false; +jform_vvvvvyevwe_required = false; +jform_vvvvvyivwf_required = false; +jform_vvvvvyivwg_required = false; +jform_vvvvvyivwh_required = false; +jform_vvvvvyivwi_required = false; +jform_vvvvvyivwj_required = false; +jform_vvvvvyivwk_required = false; +jform_vvvvvyivwl_required = false; // Initial Script jQuery(document).ready(function() { - var add_css_view_vvvvvxb = jQuery("#jform_add_css_view input[type='radio']:checked").val(); - vvvvvxb(add_css_view_vvvvvxb); + var add_css_view_vvvvvxd = jQuery("#jform_add_css_view input[type='radio']:checked").val(); + vvvvvxd(add_css_view_vvvvvxd); - var add_css_views_vvvvvxc = jQuery("#jform_add_css_views input[type='radio']:checked").val(); - vvvvvxc(add_css_views_vvvvvxc); + var add_css_views_vvvvvxe = jQuery("#jform_add_css_views input[type='radio']:checked").val(); + vvvvvxe(add_css_views_vvvvvxe); - var add_javascript_view_file_vvvvvxd = jQuery("#jform_add_javascript_view_file input[type='radio']:checked").val(); - vvvvvxd(add_javascript_view_file_vvvvvxd); + var add_javascript_view_file_vvvvvxf = jQuery("#jform_add_javascript_view_file input[type='radio']:checked").val(); + vvvvvxf(add_javascript_view_file_vvvvvxf); - var add_javascript_views_file_vvvvvxe = jQuery("#jform_add_javascript_views_file input[type='radio']:checked").val(); - vvvvvxe(add_javascript_views_file_vvvvvxe); + var add_javascript_views_file_vvvvvxg = jQuery("#jform_add_javascript_views_file input[type='radio']:checked").val(); + vvvvvxg(add_javascript_views_file_vvvvvxg); - var add_javascript_view_footer_vvvvvxf = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val(); - vvvvvxf(add_javascript_view_footer_vvvvvxf); + var add_javascript_view_footer_vvvvvxh = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val(); + vvvvvxh(add_javascript_view_footer_vvvvvxh); - var add_javascript_views_footer_vvvvvxg = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val(); - vvvvvxg(add_javascript_views_footer_vvvvvxg); + var add_javascript_views_footer_vvvvvxi = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val(); + vvvvvxi(add_javascript_views_footer_vvvvvxi); - var add_php_ajax_vvvvvxh = jQuery("#jform_add_php_ajax input[type='radio']:checked").val(); - vvvvvxh(add_php_ajax_vvvvvxh); + var add_php_ajax_vvvvvxj = jQuery("#jform_add_php_ajax input[type='radio']:checked").val(); + vvvvvxj(add_php_ajax_vvvvvxj); - var add_php_getitem_vvvvvxi = jQuery("#jform_add_php_getitem input[type='radio']:checked").val(); - vvvvvxi(add_php_getitem_vvvvvxi); + var add_php_getitem_vvvvvxk = jQuery("#jform_add_php_getitem input[type='radio']:checked").val(); + vvvvvxk(add_php_getitem_vvvvvxk); - var add_php_getitems_vvvvvxj = jQuery("#jform_add_php_getitems input[type='radio']:checked").val(); - vvvvvxj(add_php_getitems_vvvvvxj); + var add_php_getitems_vvvvvxl = jQuery("#jform_add_php_getitems input[type='radio']:checked").val(); + vvvvvxl(add_php_getitems_vvvvvxl); - var add_php_getitems_after_all_vvvvvxk = jQuery("#jform_add_php_getitems_after_all input[type='radio']:checked").val(); - vvvvvxk(add_php_getitems_after_all_vvvvvxk); + var add_php_getitems_after_all_vvvvvxm = jQuery("#jform_add_php_getitems_after_all input[type='radio']:checked").val(); + vvvvvxm(add_php_getitems_after_all_vvvvvxm); - var add_php_getlistquery_vvvvvxl = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val(); - vvvvvxl(add_php_getlistquery_vvvvvxl); + var add_php_getlistquery_vvvvvxn = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val(); + vvvvvxn(add_php_getlistquery_vvvvvxn); - var add_php_getform_vvvvvxm = jQuery("#jform_add_php_getform input[type='radio']:checked").val(); - vvvvvxm(add_php_getform_vvvvvxm); + var add_php_getform_vvvvvxo = jQuery("#jform_add_php_getform input[type='radio']:checked").val(); + vvvvvxo(add_php_getform_vvvvvxo); - var add_php_before_save_vvvvvxn = jQuery("#jform_add_php_before_save input[type='radio']:checked").val(); - vvvvvxn(add_php_before_save_vvvvvxn); + var add_php_before_save_vvvvvxp = jQuery("#jform_add_php_before_save input[type='radio']:checked").val(); + vvvvvxp(add_php_before_save_vvvvvxp); - var add_php_save_vvvvvxo = jQuery("#jform_add_php_save input[type='radio']:checked").val(); - vvvvvxo(add_php_save_vvvvvxo); + var add_php_save_vvvvvxq = jQuery("#jform_add_php_save input[type='radio']:checked").val(); + vvvvvxq(add_php_save_vvvvvxq); - var add_php_postsavehook_vvvvvxp = jQuery("#jform_add_php_postsavehook input[type='radio']:checked").val(); - vvvvvxp(add_php_postsavehook_vvvvvxp); + var add_php_postsavehook_vvvvvxr = jQuery("#jform_add_php_postsavehook input[type='radio']:checked").val(); + vvvvvxr(add_php_postsavehook_vvvvvxr); - var add_php_allowadd_vvvvvxq = jQuery("#jform_add_php_allowadd input[type='radio']:checked").val(); - vvvvvxq(add_php_allowadd_vvvvvxq); + var add_php_allowadd_vvvvvxs = jQuery("#jform_add_php_allowadd input[type='radio']:checked").val(); + vvvvvxs(add_php_allowadd_vvvvvxs); - var add_php_allowedit_vvvvvxr = jQuery("#jform_add_php_allowedit input[type='radio']:checked").val(); - vvvvvxr(add_php_allowedit_vvvvvxr); + var add_php_allowedit_vvvvvxt = jQuery("#jform_add_php_allowedit input[type='radio']:checked").val(); + vvvvvxt(add_php_allowedit_vvvvvxt); - var add_php_before_cancel_vvvvvxs = jQuery("#jform_add_php_before_cancel input[type='radio']:checked").val(); - vvvvvxs(add_php_before_cancel_vvvvvxs); + var add_php_before_cancel_vvvvvxu = jQuery("#jform_add_php_before_cancel input[type='radio']:checked").val(); + vvvvvxu(add_php_before_cancel_vvvvvxu); - var add_php_after_cancel_vvvvvxt = jQuery("#jform_add_php_after_cancel input[type='radio']:checked").val(); - vvvvvxt(add_php_after_cancel_vvvvvxt); + var add_php_after_cancel_vvvvvxv = jQuery("#jform_add_php_after_cancel input[type='radio']:checked").val(); + vvvvvxv(add_php_after_cancel_vvvvvxv); - var add_php_batchcopy_vvvvvxu = jQuery("#jform_add_php_batchcopy input[type='radio']:checked").val(); - vvvvvxu(add_php_batchcopy_vvvvvxu); + var add_php_batchcopy_vvvvvxw = jQuery("#jform_add_php_batchcopy input[type='radio']:checked").val(); + vvvvvxw(add_php_batchcopy_vvvvvxw); - var add_php_batchmove_vvvvvxv = jQuery("#jform_add_php_batchmove input[type='radio']:checked").val(); - vvvvvxv(add_php_batchmove_vvvvvxv); + var add_php_batchmove_vvvvvxx = jQuery("#jform_add_php_batchmove input[type='radio']:checked").val(); + vvvvvxx(add_php_batchmove_vvvvvxx); - var add_php_before_publish_vvvvvxw = jQuery("#jform_add_php_before_publish input[type='radio']:checked").val(); - vvvvvxw(add_php_before_publish_vvvvvxw); + var add_php_before_publish_vvvvvxy = jQuery("#jform_add_php_before_publish input[type='radio']:checked").val(); + vvvvvxy(add_php_before_publish_vvvvvxy); - var add_php_after_publish_vvvvvxx = jQuery("#jform_add_php_after_publish input[type='radio']:checked").val(); - vvvvvxx(add_php_after_publish_vvvvvxx); + var add_php_after_publish_vvvvvxz = jQuery("#jform_add_php_after_publish input[type='radio']:checked").val(); + vvvvvxz(add_php_after_publish_vvvvvxz); - var add_php_before_delete_vvvvvxy = jQuery("#jform_add_php_before_delete input[type='radio']:checked").val(); - vvvvvxy(add_php_before_delete_vvvvvxy); + var add_php_before_delete_vvvvvya = jQuery("#jform_add_php_before_delete input[type='radio']:checked").val(); + vvvvvya(add_php_before_delete_vvvvvya); - var add_php_after_delete_vvvvvxz = jQuery("#jform_add_php_after_delete input[type='radio']:checked").val(); - vvvvvxz(add_php_after_delete_vvvvvxz); + var add_php_after_delete_vvvvvyb = jQuery("#jform_add_php_after_delete input[type='radio']:checked").val(); + vvvvvyb(add_php_after_delete_vvvvvyb); - var add_php_document_vvvvvya = jQuery("#jform_add_php_document input[type='radio']:checked").val(); - vvvvvya(add_php_document_vvvvvya); + var add_php_document_vvvvvyc = jQuery("#jform_add_php_document input[type='radio']:checked").val(); + vvvvvyc(add_php_document_vvvvvyc); - var add_sql_vvvvvyb = jQuery("#jform_add_sql input[type='radio']:checked").val(); - vvvvvyb(add_sql_vvvvvyb); - - var source_vvvvvyc = jQuery("#jform_source input[type='radio']:checked").val(); - var add_sql_vvvvvyc = jQuery("#jform_add_sql input[type='radio']:checked").val(); - vvvvvyc(source_vvvvvyc,add_sql_vvvvvyc); + var add_sql_vvvvvyd = jQuery("#jform_add_sql input[type='radio']:checked").val(); + vvvvvyd(add_sql_vvvvvyd); var source_vvvvvye = jQuery("#jform_source input[type='radio']:checked").val(); var add_sql_vvvvvye = jQuery("#jform_add_sql input[type='radio']:checked").val(); vvvvvye(source_vvvvvye,add_sql_vvvvvye); - var add_custom_import_vvvvvyg = jQuery("#jform_add_custom_import input[type='radio']:checked").val(); - vvvvvyg(add_custom_import_vvvvvyg); + var source_vvvvvyg = jQuery("#jform_source input[type='radio']:checked").val(); + var add_sql_vvvvvyg = jQuery("#jform_add_sql input[type='radio']:checked").val(); + vvvvvyg(source_vvvvvyg,add_sql_vvvvvyg); - var add_custom_import_vvvvvyh = jQuery("#jform_add_custom_import input[type='radio']:checked").val(); - vvvvvyh(add_custom_import_vvvvvyh); + var add_custom_import_vvvvvyi = jQuery("#jform_add_custom_import input[type='radio']:checked").val(); + vvvvvyi(add_custom_import_vvvvvyi); - var add_custom_button_vvvvvyi = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); - vvvvvyi(add_custom_button_vvvvvyi); + var add_custom_import_vvvvvyj = jQuery("#jform_add_custom_import input[type='radio']:checked").val(); + vvvvvyj(add_custom_import_vvvvvyj); + + var add_custom_button_vvvvvyk = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); + vvvvvyk(add_custom_button_vvvvvyk); }); -// the vvvvvxb function -function vvvvvxb(add_css_view_vvvvvxb) +// the vvvvvxd function +function vvvvvxd(add_css_view_vvvvvxd) { // set the function logic - if (add_css_view_vvvvvxb == 1) + if (add_css_view_vvvvvxd == 1) { jQuery('#jform_css_view-lbl').closest('.control-group').show(); } @@ -135,11 +135,11 @@ function vvvvvxb(add_css_view_vvvvvxb) } } -// the vvvvvxc function -function vvvvvxc(add_css_views_vvvvvxc) +// the vvvvvxe function +function vvvvvxe(add_css_views_vvvvvxe) { // set the function logic - if (add_css_views_vvvvvxc == 1) + if (add_css_views_vvvvvxe == 1) { jQuery('#jform_css_views-lbl').closest('.control-group').show(); } @@ -149,11 +149,11 @@ function vvvvvxc(add_css_views_vvvvvxc) } } -// the vvvvvxd function -function vvvvvxd(add_javascript_view_file_vvvvvxd) +// the vvvvvxf function +function vvvvvxf(add_javascript_view_file_vvvvvxf) { // set the function logic - if (add_javascript_view_file_vvvvvxd == 1) + if (add_javascript_view_file_vvvvvxf == 1) { jQuery('#jform_javascript_view_file-lbl').closest('.control-group').show(); } @@ -163,11 +163,11 @@ function vvvvvxd(add_javascript_view_file_vvvvvxd) } } -// the vvvvvxe function -function vvvvvxe(add_javascript_views_file_vvvvvxe) +// the vvvvvxg function +function vvvvvxg(add_javascript_views_file_vvvvvxg) { // set the function logic - if (add_javascript_views_file_vvvvvxe == 1) + if (add_javascript_views_file_vvvvvxg == 1) { jQuery('#jform_javascript_views_file-lbl').closest('.control-group').show(); } @@ -177,11 +177,11 @@ function vvvvvxe(add_javascript_views_file_vvvvvxe) } } -// the vvvvvxf function -function vvvvvxf(add_javascript_view_footer_vvvvvxf) +// the vvvvvxh function +function vvvvvxh(add_javascript_view_footer_vvvvvxh) { // set the function logic - if (add_javascript_view_footer_vvvvvxf == 1) + if (add_javascript_view_footer_vvvvvxh == 1) { jQuery('#jform_javascript_view_footer-lbl').closest('.control-group').show(); } @@ -191,11 +191,11 @@ function vvvvvxf(add_javascript_view_footer_vvvvvxf) } } -// the vvvvvxg function -function vvvvvxg(add_javascript_views_footer_vvvvvxg) +// the vvvvvxi function +function vvvvvxi(add_javascript_views_footer_vvvvvxi) { // set the function logic - if (add_javascript_views_footer_vvvvvxg == 1) + if (add_javascript_views_footer_vvvvvxi == 1) { jQuery('#jform_javascript_views_footer-lbl').closest('.control-group').show(); } @@ -205,11 +205,11 @@ function vvvvvxg(add_javascript_views_footer_vvvvvxg) } } -// the vvvvvxh function -function vvvvvxh(add_php_ajax_vvvvvxh) +// the vvvvvxj function +function vvvvvxj(add_php_ajax_vvvvvxj) { // set the function logic - if (add_php_ajax_vvvvvxh == 1) + if (add_php_ajax_vvvvvxj == 1) { jQuery('#jform_ajax_input-lbl').closest('.control-group').show(); jQuery('#jform_php_ajaxmethod-lbl').closest('.control-group').show(); @@ -221,11 +221,11 @@ function vvvvvxh(add_php_ajax_vvvvvxh) } } -// the vvvvvxi function -function vvvvvxi(add_php_getitem_vvvvvxi) +// the vvvvvxk function +function vvvvvxk(add_php_getitem_vvvvvxk) { // set the function logic - if (add_php_getitem_vvvvvxi == 1) + if (add_php_getitem_vvvvvxk == 1) { jQuery('#jform_php_getitem-lbl').closest('.control-group').show(); } @@ -235,11 +235,11 @@ function vvvvvxi(add_php_getitem_vvvvvxi) } } -// the vvvvvxj function -function vvvvvxj(add_php_getitems_vvvvvxj) +// the vvvvvxl function +function vvvvvxl(add_php_getitems_vvvvvxl) { // set the function logic - if (add_php_getitems_vvvvvxj == 1) + if (add_php_getitems_vvvvvxl == 1) { jQuery('#jform_php_getitems-lbl').closest('.control-group').show(); } @@ -249,11 +249,11 @@ function vvvvvxj(add_php_getitems_vvvvvxj) } } -// the vvvvvxk function -function vvvvvxk(add_php_getitems_after_all_vvvvvxk) +// the vvvvvxm function +function vvvvvxm(add_php_getitems_after_all_vvvvvxm) { // set the function logic - if (add_php_getitems_after_all_vvvvvxk == 1) + if (add_php_getitems_after_all_vvvvvxm == 1) { jQuery('#jform_php_getitems_after_all-lbl').closest('.control-group').show(); } @@ -263,11 +263,11 @@ function vvvvvxk(add_php_getitems_after_all_vvvvvxk) } } -// the vvvvvxl function -function vvvvvxl(add_php_getlistquery_vvvvvxl) +// the vvvvvxn function +function vvvvvxn(add_php_getlistquery_vvvvvxn) { // set the function logic - if (add_php_getlistquery_vvvvvxl == 1) + if (add_php_getlistquery_vvvvvxn == 1) { jQuery('#jform_php_getlistquery-lbl').closest('.control-group').show(); } @@ -277,11 +277,11 @@ function vvvvvxl(add_php_getlistquery_vvvvvxl) } } -// the vvvvvxm function -function vvvvvxm(add_php_getform_vvvvvxm) +// the vvvvvxo function +function vvvvvxo(add_php_getform_vvvvvxo) { // set the function logic - if (add_php_getform_vvvvvxm == 1) + if (add_php_getform_vvvvvxo == 1) { jQuery('#jform_php_getform-lbl').closest('.control-group').show(); } @@ -291,11 +291,11 @@ function vvvvvxm(add_php_getform_vvvvvxm) } } -// the vvvvvxn function -function vvvvvxn(add_php_before_save_vvvvvxn) +// the vvvvvxp function +function vvvvvxp(add_php_before_save_vvvvvxp) { // set the function logic - if (add_php_before_save_vvvvvxn == 1) + if (add_php_before_save_vvvvvxp == 1) { jQuery('#jform_php_before_save-lbl').closest('.control-group').show(); } @@ -305,11 +305,11 @@ function vvvvvxn(add_php_before_save_vvvvvxn) } } -// the vvvvvxo function -function vvvvvxo(add_php_save_vvvvvxo) +// the vvvvvxq function +function vvvvvxq(add_php_save_vvvvvxq) { // set the function logic - if (add_php_save_vvvvvxo == 1) + if (add_php_save_vvvvvxq == 1) { jQuery('#jform_php_save-lbl').closest('.control-group').show(); } @@ -319,11 +319,11 @@ function vvvvvxo(add_php_save_vvvvvxo) } } -// the vvvvvxp function -function vvvvvxp(add_php_postsavehook_vvvvvxp) +// the vvvvvxr function +function vvvvvxr(add_php_postsavehook_vvvvvxr) { // set the function logic - if (add_php_postsavehook_vvvvvxp == 1) + if (add_php_postsavehook_vvvvvxr == 1) { jQuery('#jform_php_postsavehook-lbl').closest('.control-group').show(); } @@ -333,11 +333,11 @@ function vvvvvxp(add_php_postsavehook_vvvvvxp) } } -// the vvvvvxq function -function vvvvvxq(add_php_allowadd_vvvvvxq) +// the vvvvvxs function +function vvvvvxs(add_php_allowadd_vvvvvxs) { // set the function logic - if (add_php_allowadd_vvvvvxq == 1) + if (add_php_allowadd_vvvvvxs == 1) { jQuery('#jform_php_allowadd-lbl').closest('.control-group').show(); } @@ -347,11 +347,11 @@ function vvvvvxq(add_php_allowadd_vvvvvxq) } } -// the vvvvvxr function -function vvvvvxr(add_php_allowedit_vvvvvxr) +// the vvvvvxt function +function vvvvvxt(add_php_allowedit_vvvvvxt) { // set the function logic - if (add_php_allowedit_vvvvvxr == 1) + if (add_php_allowedit_vvvvvxt == 1) { jQuery('#jform_php_allowedit-lbl').closest('.control-group').show(); } @@ -361,11 +361,11 @@ function vvvvvxr(add_php_allowedit_vvvvvxr) } } -// the vvvvvxs function -function vvvvvxs(add_php_before_cancel_vvvvvxs) +// the vvvvvxu function +function vvvvvxu(add_php_before_cancel_vvvvvxu) { // set the function logic - if (add_php_before_cancel_vvvvvxs == 1) + if (add_php_before_cancel_vvvvvxu == 1) { jQuery('#jform_php_before_cancel-lbl').closest('.control-group').show(); } @@ -375,11 +375,11 @@ function vvvvvxs(add_php_before_cancel_vvvvvxs) } } -// the vvvvvxt function -function vvvvvxt(add_php_after_cancel_vvvvvxt) +// the vvvvvxv function +function vvvvvxv(add_php_after_cancel_vvvvvxv) { // set the function logic - if (add_php_after_cancel_vvvvvxt == 1) + if (add_php_after_cancel_vvvvvxv == 1) { jQuery('#jform_php_after_cancel-lbl').closest('.control-group').show(); } @@ -389,11 +389,11 @@ function vvvvvxt(add_php_after_cancel_vvvvvxt) } } -// the vvvvvxu function -function vvvvvxu(add_php_batchcopy_vvvvvxu) +// the vvvvvxw function +function vvvvvxw(add_php_batchcopy_vvvvvxw) { // set the function logic - if (add_php_batchcopy_vvvvvxu == 1) + if (add_php_batchcopy_vvvvvxw == 1) { jQuery('#jform_php_batchcopy-lbl').closest('.control-group').show(); } @@ -403,11 +403,11 @@ function vvvvvxu(add_php_batchcopy_vvvvvxu) } } -// the vvvvvxv function -function vvvvvxv(add_php_batchmove_vvvvvxv) +// the vvvvvxx function +function vvvvvxx(add_php_batchmove_vvvvvxx) { // set the function logic - if (add_php_batchmove_vvvvvxv == 1) + if (add_php_batchmove_vvvvvxx == 1) { jQuery('#jform_php_batchmove-lbl').closest('.control-group').show(); } @@ -417,11 +417,11 @@ function vvvvvxv(add_php_batchmove_vvvvvxv) } } -// the vvvvvxw function -function vvvvvxw(add_php_before_publish_vvvvvxw) +// the vvvvvxy function +function vvvvvxy(add_php_before_publish_vvvvvxy) { // set the function logic - if (add_php_before_publish_vvvvvxw == 1) + if (add_php_before_publish_vvvvvxy == 1) { jQuery('#jform_php_before_publish-lbl').closest('.control-group').show(); } @@ -431,11 +431,11 @@ function vvvvvxw(add_php_before_publish_vvvvvxw) } } -// the vvvvvxx function -function vvvvvxx(add_php_after_publish_vvvvvxx) +// the vvvvvxz function +function vvvvvxz(add_php_after_publish_vvvvvxz) { // set the function logic - if (add_php_after_publish_vvvvvxx == 1) + if (add_php_after_publish_vvvvvxz == 1) { jQuery('#jform_php_after_publish-lbl').closest('.control-group').show(); } @@ -445,11 +445,11 @@ function vvvvvxx(add_php_after_publish_vvvvvxx) } } -// the vvvvvxy function -function vvvvvxy(add_php_before_delete_vvvvvxy) +// the vvvvvya function +function vvvvvya(add_php_before_delete_vvvvvya) { // set the function logic - if (add_php_before_delete_vvvvvxy == 1) + if (add_php_before_delete_vvvvvya == 1) { jQuery('#jform_php_before_delete-lbl').closest('.control-group').show(); } @@ -459,11 +459,11 @@ function vvvvvxy(add_php_before_delete_vvvvvxy) } } -// the vvvvvxz function -function vvvvvxz(add_php_after_delete_vvvvvxz) +// the vvvvvyb function +function vvvvvyb(add_php_after_delete_vvvvvyb) { // set the function logic - if (add_php_after_delete_vvvvvxz == 1) + if (add_php_after_delete_vvvvvyb == 1) { jQuery('#jform_php_after_delete-lbl').closest('.control-group').show(); } @@ -473,11 +473,11 @@ function vvvvvxz(add_php_after_delete_vvvvvxz) } } -// the vvvvvya function -function vvvvvya(add_php_document_vvvvvya) +// the vvvvvyc function +function vvvvvyc(add_php_document_vvvvvyc) { // set the function logic - if (add_php_document_vvvvvya == 1) + if (add_php_document_vvvvvyc == 1) { jQuery('#jform_php_document-lbl').closest('.control-group').show(); } @@ -487,66 +487,34 @@ function vvvvvya(add_php_document_vvvvvya) } } -// the vvvvvyb function -function vvvvvyb(add_sql_vvvvvyb) +// the vvvvvyd function +function vvvvvyd(add_sql_vvvvvyd) { // set the function logic - if (add_sql_vvvvvyb == 1) + if (add_sql_vvvvvyd == 1) { jQuery('#jform_source').closest('.control-group').show(); // add required attribute to source field - if (jform_vvvvvybvwd_required) + if (jform_vvvvvydvwd_required) { updateFieldRequired('source',0); jQuery('#jform_source').prop('required','required'); jQuery('#jform_source').attr('aria-required',true); jQuery('#jform_source').addClass('required'); - jform_vvvvvybvwd_required = false; + jform_vvvvvydvwd_required = false; } } else { jQuery('#jform_source').closest('.control-group').hide(); // remove required attribute from source field - if (!jform_vvvvvybvwd_required) + if (!jform_vvvvvydvwd_required) { updateFieldRequired('source',1); jQuery('#jform_source').removeAttr('required'); jQuery('#jform_source').removeAttr('aria-required'); jQuery('#jform_source').removeClass('required'); - jform_vvvvvybvwd_required = true; - } - } -} - -// the vvvvvyc function -function vvvvvyc(source_vvvvvyc,add_sql_vvvvvyc) -{ - // set the function logic - if (source_vvvvvyc == 2 && add_sql_vvvvvyc == 1) - { - jQuery('#jform_sql').closest('.control-group').show(); - // add required attribute to sql field - if (jform_vvvvvycvwe_required) - { - updateFieldRequired('sql',0); - jQuery('#jform_sql').prop('required','required'); - jQuery('#jform_sql').attr('aria-required',true); - jQuery('#jform_sql').addClass('required'); - jform_vvvvvycvwe_required = false; - } - } - else - { - jQuery('#jform_sql').closest('.control-group').hide(); - // remove required attribute from sql field - if (!jform_vvvvvycvwe_required) - { - updateFieldRequired('sql',1); - jQuery('#jform_sql').removeAttr('required'); - jQuery('#jform_sql').removeAttr('aria-required'); - jQuery('#jform_sql').removeClass('required'); - jform_vvvvvycvwe_required = true; + jform_vvvvvydvwd_required = true; } } } @@ -555,7 +523,39 @@ function vvvvvyc(source_vvvvvyc,add_sql_vvvvvyc) function vvvvvye(source_vvvvvye,add_sql_vvvvvye) { // set the function logic - if (source_vvvvvye == 1 && add_sql_vvvvvye == 1) + if (source_vvvvvye == 2 && add_sql_vvvvvye == 1) + { + jQuery('#jform_sql').closest('.control-group').show(); + // add required attribute to sql field + if (jform_vvvvvyevwe_required) + { + updateFieldRequired('sql',0); + jQuery('#jform_sql').prop('required','required'); + jQuery('#jform_sql').attr('aria-required',true); + jQuery('#jform_sql').addClass('required'); + jform_vvvvvyevwe_required = false; + } + } + else + { + jQuery('#jform_sql').closest('.control-group').hide(); + // remove required attribute from sql field + if (!jform_vvvvvyevwe_required) + { + updateFieldRequired('sql',1); + jQuery('#jform_sql').removeAttr('required'); + jQuery('#jform_sql').removeAttr('aria-required'); + jQuery('#jform_sql').removeClass('required'); + jform_vvvvvyevwe_required = true; + } + } +} + +// the vvvvvyg function +function vvvvvyg(source_vvvvvyg,add_sql_vvvvvyg) +{ + // set the function logic + if (source_vvvvvyg == 1 && add_sql_vvvvvyg == 1) { jQuery('#jform_addtables-lbl').closest('.control-group').show(); } @@ -565,165 +565,165 @@ function vvvvvye(source_vvvvvye,add_sql_vvvvvye) } } -// the vvvvvyg function -function vvvvvyg(add_custom_import_vvvvvyg) +// the vvvvvyi function +function vvvvvyi(add_custom_import_vvvvvyi) { // set the function logic - if (add_custom_import_vvvvvyg == 1) + if (add_custom_import_vvvvvyi == 1) { jQuery('#jform_html_import_view').closest('.control-group').show(); // add required attribute to html_import_view field - if (jform_vvvvvygvwf_required) + if (jform_vvvvvyivwf_required) { updateFieldRequired('html_import_view',0); jQuery('#jform_html_import_view').prop('required','required'); jQuery('#jform_html_import_view').attr('aria-required',true); jQuery('#jform_html_import_view').addClass('required'); - jform_vvvvvygvwf_required = false; + jform_vvvvvyivwf_required = false; } jQuery('.note_advanced_import').closest('.control-group').show(); jQuery('#jform_php_import_display').closest('.control-group').show(); // add required attribute to php_import_display field - if (jform_vvvvvygvwg_required) + if (jform_vvvvvyivwg_required) { updateFieldRequired('php_import_display',0); jQuery('#jform_php_import_display').prop('required','required'); jQuery('#jform_php_import_display').attr('aria-required',true); jQuery('#jform_php_import_display').addClass('required'); - jform_vvvvvygvwg_required = false; + jform_vvvvvyivwg_required = false; } jQuery('#jform_php_import_ext').closest('.control-group').show(); // add required attribute to php_import_ext field - if (jform_vvvvvygvwh_required) + if (jform_vvvvvyivwh_required) { updateFieldRequired('php_import_ext',0); jQuery('#jform_php_import_ext').prop('required','required'); jQuery('#jform_php_import_ext').attr('aria-required',true); jQuery('#jform_php_import_ext').addClass('required'); - jform_vvvvvygvwh_required = false; + jform_vvvvvyivwh_required = false; } jQuery('#jform_php_import_headers').closest('.control-group').show(); // add required attribute to php_import_headers field - if (jform_vvvvvygvwi_required) + if (jform_vvvvvyivwi_required) { updateFieldRequired('php_import_headers',0); jQuery('#jform_php_import_headers').prop('required','required'); jQuery('#jform_php_import_headers').attr('aria-required',true); jQuery('#jform_php_import_headers').addClass('required'); - jform_vvvvvygvwi_required = false; + jform_vvvvvyivwi_required = false; } jQuery('#jform_php_import').closest('.control-group').show(); // add required attribute to php_import field - if (jform_vvvvvygvwj_required) + if (jform_vvvvvyivwj_required) { updateFieldRequired('php_import',0); jQuery('#jform_php_import').prop('required','required'); jQuery('#jform_php_import').attr('aria-required',true); jQuery('#jform_php_import').addClass('required'); - jform_vvvvvygvwj_required = false; + jform_vvvvvyivwj_required = false; } jQuery('#jform_php_import_save').closest('.control-group').show(); // add required attribute to php_import_save field - if (jform_vvvvvygvwk_required) + if (jform_vvvvvyivwk_required) { updateFieldRequired('php_import_save',0); jQuery('#jform_php_import_save').prop('required','required'); jQuery('#jform_php_import_save').attr('aria-required',true); jQuery('#jform_php_import_save').addClass('required'); - jform_vvvvvygvwk_required = false; + jform_vvvvvyivwk_required = false; } jQuery('#jform_php_import_setdata').closest('.control-group').show(); // add required attribute to php_import_setdata field - if (jform_vvvvvygvwl_required) + if (jform_vvvvvyivwl_required) { updateFieldRequired('php_import_setdata',0); jQuery('#jform_php_import_setdata').prop('required','required'); jQuery('#jform_php_import_setdata').attr('aria-required',true); jQuery('#jform_php_import_setdata').addClass('required'); - jform_vvvvvygvwl_required = false; + jform_vvvvvyivwl_required = false; } } else { jQuery('#jform_html_import_view').closest('.control-group').hide(); // remove required attribute from html_import_view field - if (!jform_vvvvvygvwf_required) + if (!jform_vvvvvyivwf_required) { updateFieldRequired('html_import_view',1); jQuery('#jform_html_import_view').removeAttr('required'); jQuery('#jform_html_import_view').removeAttr('aria-required'); jQuery('#jform_html_import_view').removeClass('required'); - jform_vvvvvygvwf_required = true; + jform_vvvvvyivwf_required = true; } jQuery('.note_advanced_import').closest('.control-group').hide(); jQuery('#jform_php_import_display').closest('.control-group').hide(); // remove required attribute from php_import_display field - if (!jform_vvvvvygvwg_required) + if (!jform_vvvvvyivwg_required) { updateFieldRequired('php_import_display',1); jQuery('#jform_php_import_display').removeAttr('required'); jQuery('#jform_php_import_display').removeAttr('aria-required'); jQuery('#jform_php_import_display').removeClass('required'); - jform_vvvvvygvwg_required = true; + jform_vvvvvyivwg_required = true; } jQuery('#jform_php_import_ext').closest('.control-group').hide(); // remove required attribute from php_import_ext field - if (!jform_vvvvvygvwh_required) + if (!jform_vvvvvyivwh_required) { updateFieldRequired('php_import_ext',1); jQuery('#jform_php_import_ext').removeAttr('required'); jQuery('#jform_php_import_ext').removeAttr('aria-required'); jQuery('#jform_php_import_ext').removeClass('required'); - jform_vvvvvygvwh_required = true; + jform_vvvvvyivwh_required = true; } jQuery('#jform_php_import_headers').closest('.control-group').hide(); // remove required attribute from php_import_headers field - if (!jform_vvvvvygvwi_required) + if (!jform_vvvvvyivwi_required) { updateFieldRequired('php_import_headers',1); jQuery('#jform_php_import_headers').removeAttr('required'); jQuery('#jform_php_import_headers').removeAttr('aria-required'); jQuery('#jform_php_import_headers').removeClass('required'); - jform_vvvvvygvwi_required = true; + jform_vvvvvyivwi_required = true; } jQuery('#jform_php_import').closest('.control-group').hide(); // remove required attribute from php_import field - if (!jform_vvvvvygvwj_required) + if (!jform_vvvvvyivwj_required) { updateFieldRequired('php_import',1); jQuery('#jform_php_import').removeAttr('required'); jQuery('#jform_php_import').removeAttr('aria-required'); jQuery('#jform_php_import').removeClass('required'); - jform_vvvvvygvwj_required = true; + jform_vvvvvyivwj_required = true; } jQuery('#jform_php_import_save').closest('.control-group').hide(); // remove required attribute from php_import_save field - if (!jform_vvvvvygvwk_required) + if (!jform_vvvvvyivwk_required) { updateFieldRequired('php_import_save',1); jQuery('#jform_php_import_save').removeAttr('required'); jQuery('#jform_php_import_save').removeAttr('aria-required'); jQuery('#jform_php_import_save').removeClass('required'); - jform_vvvvvygvwk_required = true; + jform_vvvvvyivwk_required = true; } jQuery('#jform_php_import_setdata').closest('.control-group').hide(); // remove required attribute from php_import_setdata field - if (!jform_vvvvvygvwl_required) + if (!jform_vvvvvyivwl_required) { updateFieldRequired('php_import_setdata',1); jQuery('#jform_php_import_setdata').removeAttr('required'); jQuery('#jform_php_import_setdata').removeAttr('aria-required'); jQuery('#jform_php_import_setdata').removeClass('required'); - jform_vvvvvygvwl_required = true; + jform_vvvvvyivwl_required = true; } } } -// the vvvvvyh function -function vvvvvyh(add_custom_import_vvvvvyh) +// the vvvvvyj function +function vvvvvyj(add_custom_import_vvvvvyj) { // set the function logic - if (add_custom_import_vvvvvyh == 0) + if (add_custom_import_vvvvvyj == 0) { jQuery('.note_beginner_import').closest('.control-group').show(); } @@ -733,11 +733,11 @@ function vvvvvyh(add_custom_import_vvvvvyh) } } -// the vvvvvyi function -function vvvvvyi(add_custom_button_vvvvvyi) +// the vvvvvyk function +function vvvvvyk(add_custom_button_vvvvvyk) { // set the function logic - if (add_custom_button_vvvvvyi == 1) + if (add_custom_button_vvvvvyk == 1) { jQuery('#jform_custom_button-lbl').closest('.control-group').show(); jQuery('#jform_php_controller-lbl').closest('.control-group').show(); diff --git a/admin/models/forms/class_extends.js b/admin/models/forms/class_extends.js new file mode 100644 index 000000000..406de38ba --- /dev/null +++ b/admin/models/forms/class_extends.js @@ -0,0 +1,11 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + + diff --git a/admin/models/forms/class_extends.xml b/admin/models/forms/class_extends.xml new file mode 100644 index 000000000..7f418a370 --- /dev/null +++ b/admin/models/forms/class_extends.xml @@ -0,0 +1,176 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+
\ No newline at end of file diff --git a/admin/models/forms/class_method.js b/admin/models/forms/class_method.js new file mode 100644 index 000000000..2f850ef20 --- /dev/null +++ b/admin/models/forms/class_method.js @@ -0,0 +1,111 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// Some Global Values +jform_vvvvwaovxe_required = false; + +// Initial Script +jQuery(document).ready(function() +{ + var extension_type_vvvvwao = jQuery("#jform_extension_type").val(); + vvvvwao(extension_type_vvvvwao); +}); + +// the vvvvwao function +function vvvvwao(extension_type_vvvvwao) +{ + if (isSet(extension_type_vvvvwao) && extension_type_vvvvwao.constructor !== Array) + { + var temp_vvvvwao = extension_type_vvvvwao; + var extension_type_vvvvwao = []; + extension_type_vvvvwao.push(temp_vvvvwao); + } + else if (!isSet(extension_type_vvvvwao)) + { + var extension_type_vvvvwao = []; + } + var extension_type = extension_type_vvvvwao.some(extension_type_vvvvwao_SomeFunc); + + + // set this function logic + if (extension_type) + { + jQuery('#jform_joomla_plugin_group').closest('.control-group').show(); + // add required attribute to joomla_plugin_group field + if (jform_vvvvwaovxe_required) + { + updateFieldRequired('joomla_plugin_group',0); + jQuery('#jform_joomla_plugin_group').prop('required','required'); + jQuery('#jform_joomla_plugin_group').attr('aria-required',true); + jQuery('#jform_joomla_plugin_group').addClass('required'); + jform_vvvvwaovxe_required = false; + } + } + else + { + jQuery('#jform_joomla_plugin_group').closest('.control-group').hide(); + // remove required attribute from joomla_plugin_group field + if (!jform_vvvvwaovxe_required) + { + updateFieldRequired('joomla_plugin_group',1); + jQuery('#jform_joomla_plugin_group').removeAttr('required'); + jQuery('#jform_joomla_plugin_group').removeAttr('aria-required'); + jQuery('#jform_joomla_plugin_group').removeClass('required'); + jform_vvvvwaovxe_required = true; + } + } +} + +// the vvvvwao Some function +function extension_type_vvvvwao_SomeFunc(extension_type_vvvvwao) +{ + // set the function logic + if (extension_type_vvvvwao == 'plugins' || extension_type_vvvvwao == 'plugin') + { + return true; + } + return false; +} + +// update required fields +function updateFieldRequired(name,status) +{ + var not_required = jQuery('#jform_not_required').val(); + + if(status == 1) + { + if (isSet(not_required) && not_required != 0) + { + not_required = not_required+','+name; + } + else + { + not_required = ','+name; + } + } + else + { + if (isSet(not_required) && not_required != 0) + { + not_required = not_required.replace(','+name,''); + } + } + + jQuery('#jform_not_required').val(not_required); +} + +// the isSet function +function isSet(val) +{ + if ((val != undefined) && (val != null) && 0 !== val.length){ + return true; + } + return false; +} diff --git a/admin/models/forms/class_method.xml b/admin/models/forms/class_method.xml new file mode 100644 index 000000000..9c65bf583 --- /dev/null +++ b/admin/models/forms/class_method.xml @@ -0,0 +1,217 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+
\ No newline at end of file diff --git a/admin/models/forms/class_property.js b/admin/models/forms/class_property.js new file mode 100644 index 000000000..c048e3d67 --- /dev/null +++ b/admin/models/forms/class_property.js @@ -0,0 +1,111 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// Some Global Values +jform_vvvvwanvxd_required = false; + +// Initial Script +jQuery(document).ready(function() +{ + var extension_type_vvvvwan = jQuery("#jform_extension_type").val(); + vvvvwan(extension_type_vvvvwan); +}); + +// the vvvvwan function +function vvvvwan(extension_type_vvvvwan) +{ + if (isSet(extension_type_vvvvwan) && extension_type_vvvvwan.constructor !== Array) + { + var temp_vvvvwan = extension_type_vvvvwan; + var extension_type_vvvvwan = []; + extension_type_vvvvwan.push(temp_vvvvwan); + } + else if (!isSet(extension_type_vvvvwan)) + { + var extension_type_vvvvwan = []; + } + var extension_type = extension_type_vvvvwan.some(extension_type_vvvvwan_SomeFunc); + + + // set this function logic + if (extension_type) + { + jQuery('#jform_joomla_plugin_group').closest('.control-group').show(); + // add required attribute to joomla_plugin_group field + if (jform_vvvvwanvxd_required) + { + updateFieldRequired('joomla_plugin_group',0); + jQuery('#jform_joomla_plugin_group').prop('required','required'); + jQuery('#jform_joomla_plugin_group').attr('aria-required',true); + jQuery('#jform_joomla_plugin_group').addClass('required'); + jform_vvvvwanvxd_required = false; + } + } + else + { + jQuery('#jform_joomla_plugin_group').closest('.control-group').hide(); + // remove required attribute from joomla_plugin_group field + if (!jform_vvvvwanvxd_required) + { + updateFieldRequired('joomla_plugin_group',1); + jQuery('#jform_joomla_plugin_group').removeAttr('required'); + jQuery('#jform_joomla_plugin_group').removeAttr('aria-required'); + jQuery('#jform_joomla_plugin_group').removeClass('required'); + jform_vvvvwanvxd_required = true; + } + } +} + +// the vvvvwan Some function +function extension_type_vvvvwan_SomeFunc(extension_type_vvvvwan) +{ + // set the function logic + if (extension_type_vvvvwan == 'plugins' || extension_type_vvvvwan == 'plugin') + { + return true; + } + return false; +} + +// update required fields +function updateFieldRequired(name,status) +{ + var not_required = jQuery('#jform_not_required').val(); + + if(status == 1) + { + if (isSet(not_required) && not_required != 0) + { + not_required = not_required+','+name; + } + else + { + not_required = ','+name; + } + } + else + { + if (isSet(not_required) && not_required != 0) + { + not_required = not_required.replace(','+name,''); + } + } + + jQuery('#jform_not_required').val(not_required); +} + +// the isSet function +function isSet(val) +{ + if ((val != undefined) && (val != null) && 0 !== val.length){ + return true; + } + return false; +} diff --git a/admin/models/forms/class_property.xml b/admin/models/forms/class_property.xml new file mode 100644 index 000000000..f72397049 --- /dev/null +++ b/admin/models/forms/class_property.xml @@ -0,0 +1,201 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+
\ No newline at end of file diff --git a/admin/models/forms/component_dashboard.xml b/admin/models/forms/component_dashboard.xml index cc70427cd..c9df3de30 100644 --- a/admin/models/forms/component_dashboard.xml +++ b/admin/models/forms/component_dashboard.xml @@ -98,6 +98,19 @@ readonly="true" button="false" /> + + - - + + diff --git a/admin/models/forms/custom_admin_view.js b/admin/models/forms/custom_admin_view.js index f14df1c29..e457b475f 100644 --- a/admin/models/forms/custom_admin_view.js +++ b/admin/models/forms/custom_admin_view.js @@ -11,42 +11,42 @@ // Initial Script jQuery(document).ready(function() { - var add_php_view_vvvvvyj = jQuery("#jform_add_php_view input[type='radio']:checked").val(); - vvvvvyj(add_php_view_vvvvvyj); + var add_php_view_vvvvvyl = jQuery("#jform_add_php_view input[type='radio']:checked").val(); + vvvvvyl(add_php_view_vvvvvyl); - var add_php_jview_display_vvvvvyk = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val(); - vvvvvyk(add_php_jview_display_vvvvvyk); + var add_php_jview_display_vvvvvym = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val(); + vvvvvym(add_php_jview_display_vvvvvym); - var add_php_jview_vvvvvyl = jQuery("#jform_add_php_jview input[type='radio']:checked").val(); - vvvvvyl(add_php_jview_vvvvvyl); + var add_php_jview_vvvvvyn = jQuery("#jform_add_php_jview input[type='radio']:checked").val(); + vvvvvyn(add_php_jview_vvvvvyn); - var add_php_document_vvvvvym = jQuery("#jform_add_php_document input[type='radio']:checked").val(); - vvvvvym(add_php_document_vvvvvym); + var add_php_document_vvvvvyo = jQuery("#jform_add_php_document input[type='radio']:checked").val(); + vvvvvyo(add_php_document_vvvvvyo); - var add_css_document_vvvvvyn = jQuery("#jform_add_css_document input[type='radio']:checked").val(); - vvvvvyn(add_css_document_vvvvvyn); + var add_css_document_vvvvvyp = jQuery("#jform_add_css_document input[type='radio']:checked").val(); + vvvvvyp(add_css_document_vvvvvyp); - var add_javascript_file_vvvvvyo = jQuery("#jform_add_javascript_file input[type='radio']:checked").val(); - vvvvvyo(add_javascript_file_vvvvvyo); + var add_javascript_file_vvvvvyq = jQuery("#jform_add_javascript_file input[type='radio']:checked").val(); + vvvvvyq(add_javascript_file_vvvvvyq); - var add_js_document_vvvvvyp = jQuery("#jform_add_js_document input[type='radio']:checked").val(); - vvvvvyp(add_js_document_vvvvvyp); + var add_js_document_vvvvvyr = jQuery("#jform_add_js_document input[type='radio']:checked").val(); + vvvvvyr(add_js_document_vvvvvyr); - var add_custom_button_vvvvvyq = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); - vvvvvyq(add_custom_button_vvvvvyq); + var add_custom_button_vvvvvys = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); + vvvvvys(add_custom_button_vvvvvys); - var add_css_vvvvvyr = jQuery("#jform_add_css input[type='radio']:checked").val(); - vvvvvyr(add_css_vvvvvyr); + var add_css_vvvvvyt = jQuery("#jform_add_css input[type='radio']:checked").val(); + vvvvvyt(add_css_vvvvvyt); - var add_php_ajax_vvvvvys = jQuery("#jform_add_php_ajax input[type='radio']:checked").val(); - vvvvvys(add_php_ajax_vvvvvys); + var add_php_ajax_vvvvvyu = jQuery("#jform_add_php_ajax input[type='radio']:checked").val(); + vvvvvyu(add_php_ajax_vvvvvyu); }); -// the vvvvvyj function -function vvvvvyj(add_php_view_vvvvvyj) +// the vvvvvyl function +function vvvvvyl(add_php_view_vvvvvyl) { // set the function logic - if (add_php_view_vvvvvyj == 1) + if (add_php_view_vvvvvyl == 1) { jQuery('#jform_php_view-lbl').closest('.control-group').show(); } @@ -56,11 +56,11 @@ function vvvvvyj(add_php_view_vvvvvyj) } } -// the vvvvvyk function -function vvvvvyk(add_php_jview_display_vvvvvyk) +// the vvvvvym function +function vvvvvym(add_php_jview_display_vvvvvym) { // set the function logic - if (add_php_jview_display_vvvvvyk == 1) + if (add_php_jview_display_vvvvvym == 1) { jQuery('#jform_php_jview_display-lbl').closest('.control-group').show(); } @@ -70,11 +70,11 @@ function vvvvvyk(add_php_jview_display_vvvvvyk) } } -// the vvvvvyl function -function vvvvvyl(add_php_jview_vvvvvyl) +// the vvvvvyn function +function vvvvvyn(add_php_jview_vvvvvyn) { // set the function logic - if (add_php_jview_vvvvvyl == 1) + if (add_php_jview_vvvvvyn == 1) { jQuery('#jform_php_jview-lbl').closest('.control-group').show(); } @@ -84,11 +84,11 @@ function vvvvvyl(add_php_jview_vvvvvyl) } } -// the vvvvvym function -function vvvvvym(add_php_document_vvvvvym) +// the vvvvvyo function +function vvvvvyo(add_php_document_vvvvvyo) { // set the function logic - if (add_php_document_vvvvvym == 1) + if (add_php_document_vvvvvyo == 1) { jQuery('#jform_php_document-lbl').closest('.control-group').show(); } @@ -98,11 +98,11 @@ function vvvvvym(add_php_document_vvvvvym) } } -// the vvvvvyn function -function vvvvvyn(add_css_document_vvvvvyn) +// the vvvvvyp function +function vvvvvyp(add_css_document_vvvvvyp) { // set the function logic - if (add_css_document_vvvvvyn == 1) + if (add_css_document_vvvvvyp == 1) { jQuery('#jform_css_document-lbl').closest('.control-group').show(); } @@ -112,11 +112,11 @@ function vvvvvyn(add_css_document_vvvvvyn) } } -// the vvvvvyo function -function vvvvvyo(add_javascript_file_vvvvvyo) +// the vvvvvyq function +function vvvvvyq(add_javascript_file_vvvvvyq) { // set the function logic - if (add_javascript_file_vvvvvyo == 1) + if (add_javascript_file_vvvvvyq == 1) { jQuery('#jform_javascript_file-lbl').closest('.control-group').show(); } @@ -126,11 +126,11 @@ function vvvvvyo(add_javascript_file_vvvvvyo) } } -// the vvvvvyp function -function vvvvvyp(add_js_document_vvvvvyp) +// the vvvvvyr function +function vvvvvyr(add_js_document_vvvvvyr) { // set the function logic - if (add_js_document_vvvvvyp == 1) + if (add_js_document_vvvvvyr == 1) { jQuery('#jform_js_document-lbl').closest('.control-group').show(); } @@ -140,11 +140,11 @@ function vvvvvyp(add_js_document_vvvvvyp) } } -// the vvvvvyq function -function vvvvvyq(add_custom_button_vvvvvyq) +// the vvvvvys function +function vvvvvys(add_custom_button_vvvvvys) { // set the function logic - if (add_custom_button_vvvvvyq == 1) + if (add_custom_button_vvvvvys == 1) { jQuery('#jform_custom_button-lbl').closest('.control-group').show(); jQuery('#jform_php_controller-lbl').closest('.control-group').show(); @@ -158,11 +158,11 @@ function vvvvvyq(add_custom_button_vvvvvyq) } } -// the vvvvvyr function -function vvvvvyr(add_css_vvvvvyr) +// the vvvvvyt function +function vvvvvyt(add_css_vvvvvyt) { // set the function logic - if (add_css_vvvvvyr == 1) + if (add_css_vvvvvyt == 1) { jQuery('#jform_css-lbl').closest('.control-group').show(); } @@ -172,11 +172,11 @@ function vvvvvyr(add_css_vvvvvyr) } } -// the vvvvvys function -function vvvvvys(add_php_ajax_vvvvvys) +// the vvvvvyu function +function vvvvvyu(add_php_ajax_vvvvvyu) { // set the function logic - if (add_php_ajax_vvvvvys == 1) + if (add_php_ajax_vvvvvyu == 1) { jQuery('#jform_ajax_input-lbl').closest('.control-group').show(); jQuery('#jform_php_ajaxmethod-lbl').closest('.control-group').show(); diff --git a/admin/models/forms/custom_code.js b/admin/models/forms/custom_code.js index 061338a81..95e2b0589 100644 --- a/admin/models/forms/custom_code.js +++ b/admin/models/forms/custom_code.js @@ -9,44 +9,44 @@ */ // Some Global Values -jform_vvvvwahvwz_required = false; -jform_vvvvwaivxa_required = false; -jform_vvvvwaivxb_required = false; -jform_vvvvwaivxc_required = false; +jform_vvvvwajvwz_required = false; +jform_vvvvwakvxa_required = false; +jform_vvvvwakvxb_required = false; +jform_vvvvwakvxc_required = false; // Initial Script jQuery(document).ready(function() { - var target_vvvvwah = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvwah(target_vvvvwah); - - var target_vvvvwai = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvwai(target_vvvvwai); - var target_vvvvwaj = jQuery("#jform_target input[type='radio']:checked").val(); - var type_vvvvwaj = jQuery("#jform_type input[type='radio']:checked").val(); - vvvvwaj(target_vvvvwaj,type_vvvvwaj); + vvvvwaj(target_vvvvwaj); - var type_vvvvwak = jQuery("#jform_type input[type='radio']:checked").val(); var target_vvvvwak = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvwak(type_vvvvwak,target_vvvvwak); + vvvvwak(target_vvvvwak); + + var target_vvvvwal = jQuery("#jform_target input[type='radio']:checked").val(); + var type_vvvvwal = jQuery("#jform_type input[type='radio']:checked").val(); + vvvvwal(target_vvvvwal,type_vvvvwal); + + var type_vvvvwam = jQuery("#jform_type input[type='radio']:checked").val(); + var target_vvvvwam = jQuery("#jform_target input[type='radio']:checked").val(); + vvvvwam(type_vvvvwam,target_vvvvwam); }); -// the vvvvwah function -function vvvvwah(target_vvvvwah) +// the vvvvwaj function +function vvvvwaj(target_vvvvwaj) { // set the function logic - if (target_vvvvwah == 2) + if (target_vvvvwaj == 2) { jQuery('#jform_function_name').closest('.control-group').show(); // add required attribute to function_name field - if (jform_vvvvwahvwz_required) + if (jform_vvvvwajvwz_required) { updateFieldRequired('function_name',0); jQuery('#jform_function_name').prop('required','required'); jQuery('#jform_function_name').attr('aria-required',true); jQuery('#jform_function_name').addClass('required'); - jform_vvvvwahvwz_required = false; + jform_vvvvwajvwz_required = false; } jQuery('.note_jcb_placeholder').closest('.control-group').show(); jQuery('#jform_system_name').closest('.control-group').show(); @@ -55,102 +55,102 @@ function vvvvwah(target_vvvvwah) { jQuery('#jform_function_name').closest('.control-group').hide(); // remove required attribute from function_name field - if (!jform_vvvvwahvwz_required) + if (!jform_vvvvwajvwz_required) { updateFieldRequired('function_name',1); jQuery('#jform_function_name').removeAttr('required'); jQuery('#jform_function_name').removeAttr('aria-required'); jQuery('#jform_function_name').removeClass('required'); - jform_vvvvwahvwz_required = true; + jform_vvvvwajvwz_required = true; } jQuery('.note_jcb_placeholder').closest('.control-group').hide(); jQuery('#jform_system_name').closest('.control-group').hide(); } } -// the vvvvwai function -function vvvvwai(target_vvvvwai) +// the vvvvwak function +function vvvvwak(target_vvvvwak) { // set the function logic - if (target_vvvvwai == 1) + if (target_vvvvwak == 1) { jQuery('#jform_component').closest('.control-group').show(); // add required attribute to component field - if (jform_vvvvwaivxa_required) + if (jform_vvvvwakvxa_required) { updateFieldRequired('component',0); jQuery('#jform_component').prop('required','required'); jQuery('#jform_component').attr('aria-required',true); jQuery('#jform_component').addClass('required'); - jform_vvvvwaivxa_required = false; + jform_vvvvwakvxa_required = false; } jQuery('#jform_path').closest('.control-group').show(); // add required attribute to path field - if (jform_vvvvwaivxb_required) + if (jform_vvvvwakvxb_required) { updateFieldRequired('path',0); jQuery('#jform_path').prop('required','required'); jQuery('#jform_path').attr('aria-required',true); jQuery('#jform_path').addClass('required'); - jform_vvvvwaivxb_required = false; + jform_vvvvwakvxb_required = false; } jQuery('#jform_from_line').closest('.control-group').show(); jQuery('#jform_hashtarget').closest('.control-group').show(); jQuery('#jform_to_line').closest('.control-group').show(); jQuery('#jform_type').closest('.control-group').show(); // add required attribute to type field - if (jform_vvvvwaivxc_required) + if (jform_vvvvwakvxc_required) { updateFieldRequired('type',0); jQuery('#jform_type').prop('required','required'); jQuery('#jform_type').attr('aria-required',true); jQuery('#jform_type').addClass('required'); - jform_vvvvwaivxc_required = false; + jform_vvvvwakvxc_required = false; } } else { jQuery('#jform_component').closest('.control-group').hide(); // remove required attribute from component field - if (!jform_vvvvwaivxa_required) + if (!jform_vvvvwakvxa_required) { updateFieldRequired('component',1); jQuery('#jform_component').removeAttr('required'); jQuery('#jform_component').removeAttr('aria-required'); jQuery('#jform_component').removeClass('required'); - jform_vvvvwaivxa_required = true; + jform_vvvvwakvxa_required = true; } jQuery('#jform_path').closest('.control-group').hide(); // remove required attribute from path field - if (!jform_vvvvwaivxb_required) + if (!jform_vvvvwakvxb_required) { updateFieldRequired('path',1); jQuery('#jform_path').removeAttr('required'); jQuery('#jform_path').removeAttr('aria-required'); jQuery('#jform_path').removeClass('required'); - jform_vvvvwaivxb_required = true; + jform_vvvvwakvxb_required = true; } jQuery('#jform_from_line').closest('.control-group').hide(); jQuery('#jform_hashtarget').closest('.control-group').hide(); jQuery('#jform_to_line').closest('.control-group').hide(); jQuery('#jform_type').closest('.control-group').hide(); // remove required attribute from type field - if (!jform_vvvvwaivxc_required) + if (!jform_vvvvwakvxc_required) { updateFieldRequired('type',1); jQuery('#jform_type').removeAttr('required'); jQuery('#jform_type').removeAttr('aria-required'); jQuery('#jform_type').removeClass('required'); - jform_vvvvwaivxc_required = true; + jform_vvvvwakvxc_required = true; } } } -// the vvvvwaj function -function vvvvwaj(target_vvvvwaj,type_vvvvwaj) +// the vvvvwal function +function vvvvwal(target_vvvvwal,type_vvvvwal) { // set the function logic - if (target_vvvvwaj == 1 && type_vvvvwaj == 1) + if (target_vvvvwal == 1 && type_vvvvwal == 1) { jQuery('#jform_hashendtarget').closest('.control-group').show(); jQuery('#jform_to_line').closest('.control-group').show(); @@ -162,11 +162,11 @@ function vvvvwaj(target_vvvvwaj,type_vvvvwaj) } } -// the vvvvwak function -function vvvvwak(type_vvvvwak,target_vvvvwak) +// the vvvvwam function +function vvvvwam(type_vvvvwam,target_vvvvwam) { // set the function logic - if (type_vvvvwak == 1 && target_vvvvwak == 1) + if (type_vvvvwam == 1 && target_vvvvwam == 1) { jQuery('#jform_hashendtarget').closest('.control-group').show(); jQuery('#jform_to_line').closest('.control-group').show(); diff --git a/admin/models/forms/dynamic_get.js b/admin/models/forms/dynamic_get.js index b527188fa..b9eea9c07 100644 --- a/admin/models/forms/dynamic_get.js +++ b/admin/models/forms/dynamic_get.js @@ -9,31 +9,25 @@ */ // Some Global Values -jform_vvvvvzgvwm_required = false; -jform_vvvvvzivwn_required = false; -jform_vvvvvzjvwo_required = false; -jform_vvvvvzkvwp_required = false; -jform_vvvvvzlvwq_required = false; -jform_vvvvvzwvwr_required = false; -jform_vvvvvzwvws_required = false; -jform_vvvvwabvwt_required = false; -jform_vvvvwabvwu_required = false; -jform_vvvvwabvwv_required = false; -jform_vvvvwacvww_required = false; -jform_vvvvwadvwx_required = false; -jform_vvvvwaevwy_required = false; +jform_vvvvvzivwm_required = false; +jform_vvvvvzkvwn_required = false; +jform_vvvvvzlvwo_required = false; +jform_vvvvvzmvwp_required = false; +jform_vvvvvznvwq_required = false; +jform_vvvvvzyvwr_required = false; +jform_vvvvvzyvws_required = false; +jform_vvvvwadvwt_required = false; +jform_vvvvwadvwu_required = false; +jform_vvvvwadvwv_required = false; +jform_vvvvwaevww_required = false; +jform_vvvvwafvwx_required = false; +jform_vvvvwagvwy_required = false; // Initial Script jQuery(document).ready(function() { - var gettype_vvvvvzg = jQuery("#jform_gettype").val(); - vvvvvzg(gettype_vvvvvzg); - - var main_source_vvvvvzh = jQuery("#jform_main_source").val(); - vvvvvzh(main_source_vvvvvzh); - - var main_source_vvvvvzi = jQuery("#jform_main_source").val(); - vvvvvzi(main_source_vvvvvzi); + var gettype_vvvvvzi = jQuery("#jform_gettype").val(); + vvvvvzi(gettype_vvvvvzi); var main_source_vvvvvzj = jQuery("#jform_main_source").val(); vvvvvzj(main_source_vvvvvzj); @@ -44,77 +38,83 @@ jQuery(document).ready(function() var main_source_vvvvvzl = jQuery("#jform_main_source").val(); vvvvvzl(main_source_vvvvvzl); - var addcalculation_vvvvvzm = jQuery("#jform_addcalculation input[type='radio']:checked").val(); - vvvvvzm(addcalculation_vvvvvzm); + var main_source_vvvvvzm = jQuery("#jform_main_source").val(); + vvvvvzm(main_source_vvvvvzm); - var addcalculation_vvvvvzn = jQuery("#jform_addcalculation input[type='radio']:checked").val(); - var gettype_vvvvvzn = jQuery("#jform_gettype").val(); - vvvvvzn(addcalculation_vvvvvzn,gettype_vvvvvzn); + var main_source_vvvvvzn = jQuery("#jform_main_source").val(); + vvvvvzn(main_source_vvvvvzn); var addcalculation_vvvvvzo = jQuery("#jform_addcalculation input[type='radio']:checked").val(); - var gettype_vvvvvzo = jQuery("#jform_gettype").val(); - vvvvvzo(addcalculation_vvvvvzo,gettype_vvvvvzo); + vvvvvzo(addcalculation_vvvvvzo); - var main_source_vvvvvzr = jQuery("#jform_main_source").val(); - vvvvvzr(main_source_vvvvvzr); + var addcalculation_vvvvvzp = jQuery("#jform_addcalculation input[type='radio']:checked").val(); + var gettype_vvvvvzp = jQuery("#jform_gettype").val(); + vvvvvzp(addcalculation_vvvvvzp,gettype_vvvvvzp); - var main_source_vvvvvzs = jQuery("#jform_main_source").val(); - vvvvvzs(main_source_vvvvvzs); + var addcalculation_vvvvvzq = jQuery("#jform_addcalculation input[type='radio']:checked").val(); + var gettype_vvvvvzq = jQuery("#jform_gettype").val(); + vvvvvzq(addcalculation_vvvvvzq,gettype_vvvvvzq); - var add_php_before_getitem_vvvvvzt = jQuery("#jform_add_php_before_getitem input[type='radio']:checked").val(); - var gettype_vvvvvzt = jQuery("#jform_gettype").val(); - vvvvvzt(add_php_before_getitem_vvvvvzt,gettype_vvvvvzt); + var main_source_vvvvvzt = jQuery("#jform_main_source").val(); + vvvvvzt(main_source_vvvvvzt); - var add_php_after_getitem_vvvvvzu = jQuery("#jform_add_php_after_getitem input[type='radio']:checked").val(); - var gettype_vvvvvzu = jQuery("#jform_gettype").val(); - vvvvvzu(add_php_after_getitem_vvvvvzu,gettype_vvvvvzu); + var main_source_vvvvvzu = jQuery("#jform_main_source").val(); + vvvvvzu(main_source_vvvvvzu); + var add_php_before_getitem_vvvvvzv = jQuery("#jform_add_php_before_getitem input[type='radio']:checked").val(); + var gettype_vvvvvzv = jQuery("#jform_gettype").val(); + vvvvvzv(add_php_before_getitem_vvvvvzv,gettype_vvvvvzv); + + var add_php_after_getitem_vvvvvzw = jQuery("#jform_add_php_after_getitem input[type='radio']:checked").val(); var gettype_vvvvvzw = jQuery("#jform_gettype").val(); - vvvvvzw(gettype_vvvvvzw); + vvvvvzw(add_php_after_getitem_vvvvvzw,gettype_vvvvvzw); - var add_php_getlistquery_vvvvvzx = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val(); - var gettype_vvvvvzx = jQuery("#jform_gettype").val(); - vvvvvzx(add_php_getlistquery_vvvvvzx,gettype_vvvvvzx); - - var add_php_before_getitems_vvvvvzy = jQuery("#jform_add_php_before_getitems input[type='radio']:checked").val(); var gettype_vvvvvzy = jQuery("#jform_gettype").val(); - vvvvvzy(add_php_before_getitems_vvvvvzy,gettype_vvvvvzy); + vvvvvzy(gettype_vvvvvzy); - var add_php_after_getitems_vvvvvzz = jQuery("#jform_add_php_after_getitems input[type='radio']:checked").val(); + var add_php_getlistquery_vvvvvzz = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val(); var gettype_vvvvvzz = jQuery("#jform_gettype").val(); - vvvvvzz(add_php_after_getitems_vvvvvzz,gettype_vvvvvzz); + vvvvvzz(add_php_getlistquery_vvvvvzz,gettype_vvvvvzz); + var add_php_before_getitems_vvvvwaa = jQuery("#jform_add_php_before_getitems input[type='radio']:checked").val(); + var gettype_vvvvwaa = jQuery("#jform_gettype").val(); + vvvvwaa(add_php_before_getitems_vvvvwaa,gettype_vvvvwaa); + + var add_php_after_getitems_vvvvwab = jQuery("#jform_add_php_after_getitems input[type='radio']:checked").val(); var gettype_vvvvwab = jQuery("#jform_gettype").val(); - vvvvwab(gettype_vvvvwab); - - var gettype_vvvvwac = jQuery("#jform_gettype").val(); - vvvvwac(gettype_vvvvwac); + vvvvwab(add_php_after_getitems_vvvvwab,gettype_vvvvwab); var gettype_vvvvwad = jQuery("#jform_gettype").val(); vvvvwad(gettype_vvvvwad); var gettype_vvvvwae = jQuery("#jform_gettype").val(); - var add_php_router_parse_vvvvwae = jQuery("#jform_add_php_router_parse input[type='radio']:checked").val(); - vvvvwae(gettype_vvvvwae,add_php_router_parse_vvvvwae); + vvvvwae(gettype_vvvvwae); + + var gettype_vvvvwaf = jQuery("#jform_gettype").val(); + vvvvwaf(gettype_vvvvwaf); var gettype_vvvvwag = jQuery("#jform_gettype").val(); - vvvvwag(gettype_vvvvwag); + var add_php_router_parse_vvvvwag = jQuery("#jform_add_php_router_parse input[type='radio']:checked").val(); + vvvvwag(gettype_vvvvwag,add_php_router_parse_vvvvwag); + + var gettype_vvvvwai = jQuery("#jform_gettype").val(); + vvvvwai(gettype_vvvvwai); }); -// the vvvvvzg function -function vvvvvzg(gettype_vvvvvzg) +// the vvvvvzi function +function vvvvvzi(gettype_vvvvvzi) { - if (isSet(gettype_vvvvvzg) && gettype_vvvvvzg.constructor !== Array) + if (isSet(gettype_vvvvvzi) && gettype_vvvvvzi.constructor !== Array) { - var temp_vvvvvzg = gettype_vvvvvzg; - var gettype_vvvvvzg = []; - gettype_vvvvvzg.push(temp_vvvvvzg); + var temp_vvvvvzi = gettype_vvvvvzi; + var gettype_vvvvvzi = []; + gettype_vvvvvzi.push(temp_vvvvvzi); } - else if (!isSet(gettype_vvvvvzg)) + else if (!isSet(gettype_vvvvvzi)) { - var gettype_vvvvvzg = []; + var gettype_vvvvvzi = []; } - var gettype = gettype_vvvvvzg.some(gettype_vvvvvzg_SomeFunc); + var gettype = gettype_vvvvvzi.some(gettype_vvvvvzi_SomeFunc); // set this function logic @@ -122,129 +122,35 @@ function vvvvvzg(gettype_vvvvvzg) { jQuery('#jform_getcustom').closest('.control-group').show(); // add required attribute to getcustom field - if (jform_vvvvvzgvwm_required) + if (jform_vvvvvzivwm_required) { updateFieldRequired('getcustom',0); jQuery('#jform_getcustom').prop('required','required'); jQuery('#jform_getcustom').attr('aria-required',true); jQuery('#jform_getcustom').addClass('required'); - jform_vvvvvzgvwm_required = false; + jform_vvvvvzivwm_required = false; } } else { jQuery('#jform_getcustom').closest('.control-group').hide(); // remove required attribute from getcustom field - if (!jform_vvvvvzgvwm_required) + if (!jform_vvvvvzivwm_required) { updateFieldRequired('getcustom',1); jQuery('#jform_getcustom').removeAttr('required'); jQuery('#jform_getcustom').removeAttr('aria-required'); jQuery('#jform_getcustom').removeClass('required'); - jform_vvvvvzgvwm_required = true; - } - } -} - -// the vvvvvzg Some function -function gettype_vvvvvzg_SomeFunc(gettype_vvvvvzg) -{ - // set the function logic - if (gettype_vvvvvzg == 3 || gettype_vvvvvzg == 4) - { - return true; - } - return false; -} - -// the vvvvvzh function -function vvvvvzh(main_source_vvvvvzh) -{ - if (isSet(main_source_vvvvvzh) && main_source_vvvvvzh.constructor !== Array) - { - var temp_vvvvvzh = main_source_vvvvvzh; - var main_source_vvvvvzh = []; - main_source_vvvvvzh.push(temp_vvvvvzh); - } - else if (!isSet(main_source_vvvvvzh)) - { - var main_source_vvvvvzh = []; - } - var main_source = main_source_vvvvvzh.some(main_source_vvvvvzh_SomeFunc); - - - // set this function logic - if (main_source) - { - jQuery('#jform_select_all').closest('.control-group').show(); - } - else - { - jQuery('#jform_select_all').closest('.control-group').hide(); - } -} - -// the vvvvvzh Some function -function main_source_vvvvvzh_SomeFunc(main_source_vvvvvzh) -{ - // set the function logic - if (main_source_vvvvvzh == 1 || main_source_vvvvvzh == 2) - { - return true; - } - return false; -} - -// the vvvvvzi function -function vvvvvzi(main_source_vvvvvzi) -{ - if (isSet(main_source_vvvvvzi) && main_source_vvvvvzi.constructor !== Array) - { - var temp_vvvvvzi = main_source_vvvvvzi; - var main_source_vvvvvzi = []; - main_source_vvvvvzi.push(temp_vvvvvzi); - } - else if (!isSet(main_source_vvvvvzi)) - { - var main_source_vvvvvzi = []; - } - var main_source = main_source_vvvvvzi.some(main_source_vvvvvzi_SomeFunc); - - - // set this function logic - if (main_source) - { - jQuery('#jform_view_table_main').closest('.control-group').show(); - // add required attribute to view_table_main field - if (jform_vvvvvzivwn_required) - { - updateFieldRequired('view_table_main',0); - jQuery('#jform_view_table_main').prop('required','required'); - jQuery('#jform_view_table_main').attr('aria-required',true); - jQuery('#jform_view_table_main').addClass('required'); - jform_vvvvvzivwn_required = false; - } - } - else - { - jQuery('#jform_view_table_main').closest('.control-group').hide(); - // remove required attribute from view_table_main field - if (!jform_vvvvvzivwn_required) - { - updateFieldRequired('view_table_main',1); - jQuery('#jform_view_table_main').removeAttr('required'); - jQuery('#jform_view_table_main').removeAttr('aria-required'); - jQuery('#jform_view_table_main').removeClass('required'); - jform_vvvvvzivwn_required = true; + jform_vvvvvzivwm_required = true; } } } // the vvvvvzi Some function -function main_source_vvvvvzi_SomeFunc(main_source_vvvvvzi) +function gettype_vvvvvzi_SomeFunc(gettype_vvvvvzi) { // set the function logic - if (main_source_vvvvvzi == 1) + if (gettype_vvvvvzi == 3 || gettype_vvvvvzi == 4) { return true; } @@ -270,29 +176,11 @@ function vvvvvzj(main_source_vvvvvzj) // set this function logic if (main_source) { - jQuery('#jform_view_selection').closest('.control-group').show(); - // add required attribute to view_selection field - if (jform_vvvvvzjvwo_required) - { - updateFieldRequired('view_selection',0); - jQuery('#jform_view_selection').prop('required','required'); - jQuery('#jform_view_selection').attr('aria-required',true); - jQuery('#jform_view_selection').addClass('required'); - jform_vvvvvzjvwo_required = false; - } + jQuery('#jform_select_all').closest('.control-group').show(); } else { - jQuery('#jform_view_selection').closest('.control-group').hide(); - // remove required attribute from view_selection field - if (!jform_vvvvvzjvwo_required) - { - updateFieldRequired('view_selection',1); - jQuery('#jform_view_selection').removeAttr('required'); - jQuery('#jform_view_selection').removeAttr('aria-required'); - jQuery('#jform_view_selection').removeClass('required'); - jform_vvvvvzjvwo_required = true; - } + jQuery('#jform_select_all').closest('.control-group').hide(); } } @@ -300,7 +188,7 @@ function vvvvvzj(main_source_vvvvvzj) function main_source_vvvvvzj_SomeFunc(main_source_vvvvvzj) { // set the function logic - if (main_source_vvvvvzj == 1) + if (main_source_vvvvvzj == 1 || main_source_vvvvvzj == 2) { return true; } @@ -326,28 +214,28 @@ function vvvvvzk(main_source_vvvvvzk) // set this function logic if (main_source) { - jQuery('#jform_db_table_main').closest('.control-group').show(); - // add required attribute to db_table_main field - if (jform_vvvvvzkvwp_required) + jQuery('#jform_view_table_main').closest('.control-group').show(); + // add required attribute to view_table_main field + if (jform_vvvvvzkvwn_required) { - updateFieldRequired('db_table_main',0); - jQuery('#jform_db_table_main').prop('required','required'); - jQuery('#jform_db_table_main').attr('aria-required',true); - jQuery('#jform_db_table_main').addClass('required'); - jform_vvvvvzkvwp_required = false; + updateFieldRequired('view_table_main',0); + jQuery('#jform_view_table_main').prop('required','required'); + jQuery('#jform_view_table_main').attr('aria-required',true); + jQuery('#jform_view_table_main').addClass('required'); + jform_vvvvvzkvwn_required = false; } } else { - jQuery('#jform_db_table_main').closest('.control-group').hide(); - // remove required attribute from db_table_main field - if (!jform_vvvvvzkvwp_required) + jQuery('#jform_view_table_main').closest('.control-group').hide(); + // remove required attribute from view_table_main field + if (!jform_vvvvvzkvwn_required) { - updateFieldRequired('db_table_main',1); - jQuery('#jform_db_table_main').removeAttr('required'); - jQuery('#jform_db_table_main').removeAttr('aria-required'); - jQuery('#jform_db_table_main').removeClass('required'); - jform_vvvvvzkvwp_required = true; + updateFieldRequired('view_table_main',1); + jQuery('#jform_view_table_main').removeAttr('required'); + jQuery('#jform_view_table_main').removeAttr('aria-required'); + jQuery('#jform_view_table_main').removeClass('required'); + jform_vvvvvzkvwn_required = true; } } } @@ -356,7 +244,7 @@ function vvvvvzk(main_source_vvvvvzk) function main_source_vvvvvzk_SomeFunc(main_source_vvvvvzk) { // set the function logic - if (main_source_vvvvvzk == 2) + if (main_source_vvvvvzk == 1) { return true; } @@ -382,28 +270,28 @@ function vvvvvzl(main_source_vvvvvzl) // set this function logic if (main_source) { - jQuery('#jform_db_selection').closest('.control-group').show(); - // add required attribute to db_selection field - if (jform_vvvvvzlvwq_required) + jQuery('#jform_view_selection').closest('.control-group').show(); + // add required attribute to view_selection field + if (jform_vvvvvzlvwo_required) { - updateFieldRequired('db_selection',0); - jQuery('#jform_db_selection').prop('required','required'); - jQuery('#jform_db_selection').attr('aria-required',true); - jQuery('#jform_db_selection').addClass('required'); - jform_vvvvvzlvwq_required = false; + updateFieldRequired('view_selection',0); + jQuery('#jform_view_selection').prop('required','required'); + jQuery('#jform_view_selection').attr('aria-required',true); + jQuery('#jform_view_selection').addClass('required'); + jform_vvvvvzlvwo_required = false; } } else { - jQuery('#jform_db_selection').closest('.control-group').hide(); - // remove required attribute from db_selection field - if (!jform_vvvvvzlvwq_required) + jQuery('#jform_view_selection').closest('.control-group').hide(); + // remove required attribute from view_selection field + if (!jform_vvvvvzlvwo_required) { - updateFieldRequired('db_selection',1); - jQuery('#jform_db_selection').removeAttr('required'); - jQuery('#jform_db_selection').removeAttr('aria-required'); - jQuery('#jform_db_selection').removeClass('required'); - jform_vvvvvzlvwq_required = true; + updateFieldRequired('view_selection',1); + jQuery('#jform_view_selection').removeAttr('required'); + jQuery('#jform_view_selection').removeAttr('aria-required'); + jQuery('#jform_view_selection').removeClass('required'); + jform_vvvvvzlvwo_required = true; } } } @@ -412,7 +300,7 @@ function vvvvvzl(main_source_vvvvvzl) function main_source_vvvvvzl_SomeFunc(main_source_vvvvvzl) { // set the function logic - if (main_source_vvvvvzl == 2) + if (main_source_vvvvvzl == 1) { return true; } @@ -420,10 +308,122 @@ function main_source_vvvvvzl_SomeFunc(main_source_vvvvvzl) } // the vvvvvzm function -function vvvvvzm(addcalculation_vvvvvzm) +function vvvvvzm(main_source_vvvvvzm) +{ + if (isSet(main_source_vvvvvzm) && main_source_vvvvvzm.constructor !== Array) + { + var temp_vvvvvzm = main_source_vvvvvzm; + var main_source_vvvvvzm = []; + main_source_vvvvvzm.push(temp_vvvvvzm); + } + else if (!isSet(main_source_vvvvvzm)) + { + var main_source_vvvvvzm = []; + } + var main_source = main_source_vvvvvzm.some(main_source_vvvvvzm_SomeFunc); + + + // set this function logic + if (main_source) + { + jQuery('#jform_db_table_main').closest('.control-group').show(); + // add required attribute to db_table_main field + if (jform_vvvvvzmvwp_required) + { + updateFieldRequired('db_table_main',0); + jQuery('#jform_db_table_main').prop('required','required'); + jQuery('#jform_db_table_main').attr('aria-required',true); + jQuery('#jform_db_table_main').addClass('required'); + jform_vvvvvzmvwp_required = false; + } + } + else + { + jQuery('#jform_db_table_main').closest('.control-group').hide(); + // remove required attribute from db_table_main field + if (!jform_vvvvvzmvwp_required) + { + updateFieldRequired('db_table_main',1); + jQuery('#jform_db_table_main').removeAttr('required'); + jQuery('#jform_db_table_main').removeAttr('aria-required'); + jQuery('#jform_db_table_main').removeClass('required'); + jform_vvvvvzmvwp_required = true; + } + } +} + +// the vvvvvzm Some function +function main_source_vvvvvzm_SomeFunc(main_source_vvvvvzm) { // set the function logic - if (addcalculation_vvvvvzm == 1) + if (main_source_vvvvvzm == 2) + { + return true; + } + return false; +} + +// the vvvvvzn function +function vvvvvzn(main_source_vvvvvzn) +{ + if (isSet(main_source_vvvvvzn) && main_source_vvvvvzn.constructor !== Array) + { + var temp_vvvvvzn = main_source_vvvvvzn; + var main_source_vvvvvzn = []; + main_source_vvvvvzn.push(temp_vvvvvzn); + } + else if (!isSet(main_source_vvvvvzn)) + { + var main_source_vvvvvzn = []; + } + var main_source = main_source_vvvvvzn.some(main_source_vvvvvzn_SomeFunc); + + + // set this function logic + if (main_source) + { + jQuery('#jform_db_selection').closest('.control-group').show(); + // add required attribute to db_selection field + if (jform_vvvvvznvwq_required) + { + updateFieldRequired('db_selection',0); + jQuery('#jform_db_selection').prop('required','required'); + jQuery('#jform_db_selection').attr('aria-required',true); + jQuery('#jform_db_selection').addClass('required'); + jform_vvvvvznvwq_required = false; + } + } + else + { + jQuery('#jform_db_selection').closest('.control-group').hide(); + // remove required attribute from db_selection field + if (!jform_vvvvvznvwq_required) + { + updateFieldRequired('db_selection',1); + jQuery('#jform_db_selection').removeAttr('required'); + jQuery('#jform_db_selection').removeAttr('aria-required'); + jQuery('#jform_db_selection').removeClass('required'); + jform_vvvvvznvwq_required = true; + } + } +} + +// the vvvvvzn Some function +function main_source_vvvvvzn_SomeFunc(main_source_vvvvvzn) +{ + // set the function logic + if (main_source_vvvvvzn == 2) + { + return true; + } + return false; +} + +// the vvvvvzo function +function vvvvvzo(addcalculation_vvvvvzo) +{ + // set the function logic + if (addcalculation_vvvvvzo == 1) { jQuery('#jform_php_calculation-lbl').closest('.control-group').show(); } @@ -433,32 +433,32 @@ function vvvvvzm(addcalculation_vvvvvzm) } } -// the vvvvvzn function -function vvvvvzn(addcalculation_vvvvvzn,gettype_vvvvvzn) +// the vvvvvzp function +function vvvvvzp(addcalculation_vvvvvzp,gettype_vvvvvzp) { - if (isSet(addcalculation_vvvvvzn) && addcalculation_vvvvvzn.constructor !== Array) + if (isSet(addcalculation_vvvvvzp) && addcalculation_vvvvvzp.constructor !== Array) { - var temp_vvvvvzn = addcalculation_vvvvvzn; - var addcalculation_vvvvvzn = []; - addcalculation_vvvvvzn.push(temp_vvvvvzn); + var temp_vvvvvzp = addcalculation_vvvvvzp; + var addcalculation_vvvvvzp = []; + addcalculation_vvvvvzp.push(temp_vvvvvzp); } - else if (!isSet(addcalculation_vvvvvzn)) + else if (!isSet(addcalculation_vvvvvzp)) { - var addcalculation_vvvvvzn = []; + var addcalculation_vvvvvzp = []; } - var addcalculation = addcalculation_vvvvvzn.some(addcalculation_vvvvvzn_SomeFunc); + var addcalculation = addcalculation_vvvvvzp.some(addcalculation_vvvvvzp_SomeFunc); - if (isSet(gettype_vvvvvzn) && gettype_vvvvvzn.constructor !== Array) + if (isSet(gettype_vvvvvzp) && gettype_vvvvvzp.constructor !== Array) { - var temp_vvvvvzn = gettype_vvvvvzn; - var gettype_vvvvvzn = []; - gettype_vvvvvzn.push(temp_vvvvvzn); + var temp_vvvvvzp = gettype_vvvvvzp; + var gettype_vvvvvzp = []; + gettype_vvvvvzp.push(temp_vvvvvzp); } - else if (!isSet(gettype_vvvvvzn)) + else if (!isSet(gettype_vvvvvzp)) { - var gettype_vvvvvzn = []; + var gettype_vvvvvzp = []; } - var gettype = gettype_vvvvvzn.some(gettype_vvvvvzn_SomeFunc); + var gettype = gettype_vvvvvzp.some(gettype_vvvvvzp_SomeFunc); // set this function logic @@ -472,54 +472,54 @@ function vvvvvzn(addcalculation_vvvvvzn,gettype_vvvvvzn) } } -// the vvvvvzn Some function -function addcalculation_vvvvvzn_SomeFunc(addcalculation_vvvvvzn) +// the vvvvvzp Some function +function addcalculation_vvvvvzp_SomeFunc(addcalculation_vvvvvzp) { // set the function logic - if (addcalculation_vvvvvzn == 1) + if (addcalculation_vvvvvzp == 1) { return true; } return false; } -// the vvvvvzn Some function -function gettype_vvvvvzn_SomeFunc(gettype_vvvvvzn) +// the vvvvvzp Some function +function gettype_vvvvvzp_SomeFunc(gettype_vvvvvzp) { // set the function logic - if (gettype_vvvvvzn == 1 || gettype_vvvvvzn == 3) + if (gettype_vvvvvzp == 1 || gettype_vvvvvzp == 3) { return true; } return false; } -// the vvvvvzo function -function vvvvvzo(addcalculation_vvvvvzo,gettype_vvvvvzo) +// the vvvvvzq function +function vvvvvzq(addcalculation_vvvvvzq,gettype_vvvvvzq) { - if (isSet(addcalculation_vvvvvzo) && addcalculation_vvvvvzo.constructor !== Array) + if (isSet(addcalculation_vvvvvzq) && addcalculation_vvvvvzq.constructor !== Array) { - var temp_vvvvvzo = addcalculation_vvvvvzo; - var addcalculation_vvvvvzo = []; - addcalculation_vvvvvzo.push(temp_vvvvvzo); + var temp_vvvvvzq = addcalculation_vvvvvzq; + var addcalculation_vvvvvzq = []; + addcalculation_vvvvvzq.push(temp_vvvvvzq); } - else if (!isSet(addcalculation_vvvvvzo)) + else if (!isSet(addcalculation_vvvvvzq)) { - var addcalculation_vvvvvzo = []; + var addcalculation_vvvvvzq = []; } - var addcalculation = addcalculation_vvvvvzo.some(addcalculation_vvvvvzo_SomeFunc); + var addcalculation = addcalculation_vvvvvzq.some(addcalculation_vvvvvzq_SomeFunc); - if (isSet(gettype_vvvvvzo) && gettype_vvvvvzo.constructor !== Array) + if (isSet(gettype_vvvvvzq) && gettype_vvvvvzq.constructor !== Array) { - var temp_vvvvvzo = gettype_vvvvvzo; - var gettype_vvvvvzo = []; - gettype_vvvvvzo.push(temp_vvvvvzo); + var temp_vvvvvzq = gettype_vvvvvzq; + var gettype_vvvvvzq = []; + gettype_vvvvvzq.push(temp_vvvvvzq); } - else if (!isSet(gettype_vvvvvzo)) + else if (!isSet(gettype_vvvvvzq)) { - var gettype_vvvvvzo = []; + var gettype_vvvvvzq = []; } - var gettype = gettype_vvvvvzo.some(gettype_vvvvvzo_SomeFunc); + var gettype = gettype_vvvvvzq.some(gettype_vvvvvzq_SomeFunc); // set this function logic @@ -533,42 +533,42 @@ function vvvvvzo(addcalculation_vvvvvzo,gettype_vvvvvzo) } } -// the vvvvvzo Some function -function addcalculation_vvvvvzo_SomeFunc(addcalculation_vvvvvzo) +// the vvvvvzq Some function +function addcalculation_vvvvvzq_SomeFunc(addcalculation_vvvvvzq) { // set the function logic - if (addcalculation_vvvvvzo == 1) + if (addcalculation_vvvvvzq == 1) { return true; } return false; } -// the vvvvvzo Some function -function gettype_vvvvvzo_SomeFunc(gettype_vvvvvzo) +// the vvvvvzq Some function +function gettype_vvvvvzq_SomeFunc(gettype_vvvvvzq) { // set the function logic - if (gettype_vvvvvzo == 2 || gettype_vvvvvzo == 4) + if (gettype_vvvvvzq == 2 || gettype_vvvvvzq == 4) { return true; } return false; } -// the vvvvvzr function -function vvvvvzr(main_source_vvvvvzr) +// the vvvvvzt function +function vvvvvzt(main_source_vvvvvzt) { - if (isSet(main_source_vvvvvzr) && main_source_vvvvvzr.constructor !== Array) + if (isSet(main_source_vvvvvzt) && main_source_vvvvvzt.constructor !== Array) { - var temp_vvvvvzr = main_source_vvvvvzr; - var main_source_vvvvvzr = []; - main_source_vvvvvzr.push(temp_vvvvvzr); + var temp_vvvvvzt = main_source_vvvvvzt; + var main_source_vvvvvzt = []; + main_source_vvvvvzt.push(temp_vvvvvzt); } - else if (!isSet(main_source_vvvvvzr)) + else if (!isSet(main_source_vvvvvzt)) { - var main_source_vvvvvzr = []; + var main_source_vvvvvzt = []; } - var main_source = main_source_vvvvvzr.some(main_source_vvvvvzr_SomeFunc); + var main_source = main_source_vvvvvzt.some(main_source_vvvvvzt_SomeFunc); // set this function logic @@ -582,31 +582,31 @@ function vvvvvzr(main_source_vvvvvzr) } } -// the vvvvvzr Some function -function main_source_vvvvvzr_SomeFunc(main_source_vvvvvzr) +// the vvvvvzt Some function +function main_source_vvvvvzt_SomeFunc(main_source_vvvvvzt) { // set the function logic - if (main_source_vvvvvzr == 3) + if (main_source_vvvvvzt == 3) { return true; } return false; } -// the vvvvvzs function -function vvvvvzs(main_source_vvvvvzs) +// the vvvvvzu function +function vvvvvzu(main_source_vvvvvzu) { - if (isSet(main_source_vvvvvzs) && main_source_vvvvvzs.constructor !== Array) + if (isSet(main_source_vvvvvzu) && main_source_vvvvvzu.constructor !== Array) { - var temp_vvvvvzs = main_source_vvvvvzs; - var main_source_vvvvvzs = []; - main_source_vvvvvzs.push(temp_vvvvvzs); + var temp_vvvvvzu = main_source_vvvvvzu; + var main_source_vvvvvzu = []; + main_source_vvvvvzu.push(temp_vvvvvzu); } - else if (!isSet(main_source_vvvvvzs)) + else if (!isSet(main_source_vvvvvzu)) { - var main_source_vvvvvzs = []; + var main_source_vvvvvzu = []; } - var main_source = main_source_vvvvvzs.some(main_source_vvvvvzs_SomeFunc); + var main_source = main_source_vvvvvzu.some(main_source_vvvvvzu_SomeFunc); // set this function logic @@ -632,43 +632,43 @@ function vvvvvzs(main_source_vvvvvzs) } } -// the vvvvvzs Some function -function main_source_vvvvvzs_SomeFunc(main_source_vvvvvzs) +// the vvvvvzu Some function +function main_source_vvvvvzu_SomeFunc(main_source_vvvvvzu) { // set the function logic - if (main_source_vvvvvzs == 1 || main_source_vvvvvzs == 2) + if (main_source_vvvvvzu == 1 || main_source_vvvvvzu == 2) { return true; } return false; } -// the vvvvvzt function -function vvvvvzt(add_php_before_getitem_vvvvvzt,gettype_vvvvvzt) +// the vvvvvzv function +function vvvvvzv(add_php_before_getitem_vvvvvzv,gettype_vvvvvzv) { - if (isSet(add_php_before_getitem_vvvvvzt) && add_php_before_getitem_vvvvvzt.constructor !== Array) + if (isSet(add_php_before_getitem_vvvvvzv) && add_php_before_getitem_vvvvvzv.constructor !== Array) { - var temp_vvvvvzt = add_php_before_getitem_vvvvvzt; - var add_php_before_getitem_vvvvvzt = []; - add_php_before_getitem_vvvvvzt.push(temp_vvvvvzt); + var temp_vvvvvzv = add_php_before_getitem_vvvvvzv; + var add_php_before_getitem_vvvvvzv = []; + add_php_before_getitem_vvvvvzv.push(temp_vvvvvzv); } - else if (!isSet(add_php_before_getitem_vvvvvzt)) + else if (!isSet(add_php_before_getitem_vvvvvzv)) { - var add_php_before_getitem_vvvvvzt = []; + var add_php_before_getitem_vvvvvzv = []; } - var add_php_before_getitem = add_php_before_getitem_vvvvvzt.some(add_php_before_getitem_vvvvvzt_SomeFunc); + var add_php_before_getitem = add_php_before_getitem_vvvvvzv.some(add_php_before_getitem_vvvvvzv_SomeFunc); - if (isSet(gettype_vvvvvzt) && gettype_vvvvvzt.constructor !== Array) + if (isSet(gettype_vvvvvzv) && gettype_vvvvvzv.constructor !== Array) { - var temp_vvvvvzt = gettype_vvvvvzt; - var gettype_vvvvvzt = []; - gettype_vvvvvzt.push(temp_vvvvvzt); + var temp_vvvvvzv = gettype_vvvvvzv; + var gettype_vvvvvzv = []; + gettype_vvvvvzv.push(temp_vvvvvzv); } - else if (!isSet(gettype_vvvvvzt)) + else if (!isSet(gettype_vvvvvzv)) { - var gettype_vvvvvzt = []; + var gettype_vvvvvzv = []; } - var gettype = gettype_vvvvvzt.some(gettype_vvvvvzt_SomeFunc); + var gettype = gettype_vvvvvzv.some(gettype_vvvvvzv_SomeFunc); // set this function logic @@ -682,83 +682,22 @@ function vvvvvzt(add_php_before_getitem_vvvvvzt,gettype_vvvvvzt) } } -// the vvvvvzt Some function -function add_php_before_getitem_vvvvvzt_SomeFunc(add_php_before_getitem_vvvvvzt) +// the vvvvvzv Some function +function add_php_before_getitem_vvvvvzv_SomeFunc(add_php_before_getitem_vvvvvzv) { // set the function logic - if (add_php_before_getitem_vvvvvzt == 1) + if (add_php_before_getitem_vvvvvzv == 1) { return true; } return false; } -// the vvvvvzt Some function -function gettype_vvvvvzt_SomeFunc(gettype_vvvvvzt) +// the vvvvvzv Some function +function gettype_vvvvvzv_SomeFunc(gettype_vvvvvzv) { // set the function logic - if (gettype_vvvvvzt == 1 || gettype_vvvvvzt == 3) - { - return true; - } - return false; -} - -// the vvvvvzu function -function vvvvvzu(add_php_after_getitem_vvvvvzu,gettype_vvvvvzu) -{ - if (isSet(add_php_after_getitem_vvvvvzu) && add_php_after_getitem_vvvvvzu.constructor !== Array) - { - var temp_vvvvvzu = add_php_after_getitem_vvvvvzu; - var add_php_after_getitem_vvvvvzu = []; - add_php_after_getitem_vvvvvzu.push(temp_vvvvvzu); - } - else if (!isSet(add_php_after_getitem_vvvvvzu)) - { - var add_php_after_getitem_vvvvvzu = []; - } - var add_php_after_getitem = add_php_after_getitem_vvvvvzu.some(add_php_after_getitem_vvvvvzu_SomeFunc); - - if (isSet(gettype_vvvvvzu) && gettype_vvvvvzu.constructor !== Array) - { - var temp_vvvvvzu = gettype_vvvvvzu; - var gettype_vvvvvzu = []; - gettype_vvvvvzu.push(temp_vvvvvzu); - } - else if (!isSet(gettype_vvvvvzu)) - { - var gettype_vvvvvzu = []; - } - var gettype = gettype_vvvvvzu.some(gettype_vvvvvzu_SomeFunc); - - - // set this function logic - if (add_php_after_getitem && gettype) - { - jQuery('#jform_php_after_getitem-lbl').closest('.control-group').show(); - } - else - { - jQuery('#jform_php_after_getitem-lbl').closest('.control-group').hide(); - } -} - -// the vvvvvzu Some function -function add_php_after_getitem_vvvvvzu_SomeFunc(add_php_after_getitem_vvvvvzu) -{ - // set the function logic - if (add_php_after_getitem_vvvvvzu == 1) - { - return true; - } - return false; -} - -// the vvvvvzu Some function -function gettype_vvvvvzu_SomeFunc(gettype_vvvvvzu) -{ - // set the function logic - if (gettype_vvvvvzu == 1 || gettype_vvvvvzu == 3) + if (gettype_vvvvvzv == 1 || gettype_vvvvvzv == 3) { return true; } @@ -766,8 +705,20 @@ function gettype_vvvvvzu_SomeFunc(gettype_vvvvvzu) } // the vvvvvzw function -function vvvvvzw(gettype_vvvvvzw) +function vvvvvzw(add_php_after_getitem_vvvvvzw,gettype_vvvvvzw) { + if (isSet(add_php_after_getitem_vvvvvzw) && add_php_after_getitem_vvvvvzw.constructor !== Array) + { + var temp_vvvvvzw = add_php_after_getitem_vvvvvzw; + var add_php_after_getitem_vvvvvzw = []; + add_php_after_getitem_vvvvvzw.push(temp_vvvvvzw); + } + else if (!isSet(add_php_after_getitem_vvvvvzw)) + { + var add_php_after_getitem_vvvvvzw = []; + } + var add_php_after_getitem = add_php_after_getitem_vvvvvzw.some(add_php_after_getitem_vvvvvzw_SomeFunc); + if (isSet(gettype_vvvvvzw) && gettype_vvvvvzw.constructor !== Array) { var temp_vvvvvzw = gettype_vvvvvzw; @@ -782,54 +733,27 @@ function vvvvvzw(gettype_vvvvvzw) // set this function logic - if (gettype) + if (add_php_after_getitem && gettype) { - jQuery('#jform_add_php_after_getitem').closest('.control-group').show(); - // add required attribute to add_php_after_getitem field - if (jform_vvvvvzwvwr_required) - { - updateFieldRequired('add_php_after_getitem',0); - jQuery('#jform_add_php_after_getitem').prop('required','required'); - jQuery('#jform_add_php_after_getitem').attr('aria-required',true); - jQuery('#jform_add_php_after_getitem').addClass('required'); - jform_vvvvvzwvwr_required = false; - } - jQuery('#jform_add_php_before_getitem').closest('.control-group').show(); - // add required attribute to add_php_before_getitem field - if (jform_vvvvvzwvws_required) - { - updateFieldRequired('add_php_before_getitem',0); - jQuery('#jform_add_php_before_getitem').prop('required','required'); - jQuery('#jform_add_php_before_getitem').attr('aria-required',true); - jQuery('#jform_add_php_before_getitem').addClass('required'); - jform_vvvvvzwvws_required = false; - } + jQuery('#jform_php_after_getitem-lbl').closest('.control-group').show(); } else { - jQuery('#jform_add_php_after_getitem').closest('.control-group').hide(); - // remove required attribute from add_php_after_getitem field - if (!jform_vvvvvzwvwr_required) - { - updateFieldRequired('add_php_after_getitem',1); - jQuery('#jform_add_php_after_getitem').removeAttr('required'); - jQuery('#jform_add_php_after_getitem').removeAttr('aria-required'); - jQuery('#jform_add_php_after_getitem').removeClass('required'); - jform_vvvvvzwvwr_required = true; - } - jQuery('#jform_add_php_before_getitem').closest('.control-group').hide(); - // remove required attribute from add_php_before_getitem field - if (!jform_vvvvvzwvws_required) - { - updateFieldRequired('add_php_before_getitem',1); - jQuery('#jform_add_php_before_getitem').removeAttr('required'); - jQuery('#jform_add_php_before_getitem').removeAttr('aria-required'); - jQuery('#jform_add_php_before_getitem').removeClass('required'); - jform_vvvvvzwvws_required = true; - } + jQuery('#jform_php_after_getitem-lbl').closest('.control-group').hide(); } } +// the vvvvvzw Some function +function add_php_after_getitem_vvvvvzw_SomeFunc(add_php_after_getitem_vvvvvzw) +{ + // set the function logic + if (add_php_after_getitem_vvvvvzw == 1) + { + return true; + } + return false; +} + // the vvvvvzw Some function function gettype_vvvvvzw_SomeFunc(gettype_vvvvvzw) { @@ -841,82 +765,9 @@ function gettype_vvvvvzw_SomeFunc(gettype_vvvvvzw) return false; } -// the vvvvvzx function -function vvvvvzx(add_php_getlistquery_vvvvvzx,gettype_vvvvvzx) -{ - if (isSet(add_php_getlistquery_vvvvvzx) && add_php_getlistquery_vvvvvzx.constructor !== Array) - { - var temp_vvvvvzx = add_php_getlistquery_vvvvvzx; - var add_php_getlistquery_vvvvvzx = []; - add_php_getlistquery_vvvvvzx.push(temp_vvvvvzx); - } - else if (!isSet(add_php_getlistquery_vvvvvzx)) - { - var add_php_getlistquery_vvvvvzx = []; - } - var add_php_getlistquery = add_php_getlistquery_vvvvvzx.some(add_php_getlistquery_vvvvvzx_SomeFunc); - - if (isSet(gettype_vvvvvzx) && gettype_vvvvvzx.constructor !== Array) - { - var temp_vvvvvzx = gettype_vvvvvzx; - var gettype_vvvvvzx = []; - gettype_vvvvvzx.push(temp_vvvvvzx); - } - else if (!isSet(gettype_vvvvvzx)) - { - var gettype_vvvvvzx = []; - } - var gettype = gettype_vvvvvzx.some(gettype_vvvvvzx_SomeFunc); - - - // set this function logic - if (add_php_getlistquery && gettype) - { - jQuery('#jform_php_getlistquery-lbl').closest('.control-group').show(); - } - else - { - jQuery('#jform_php_getlistquery-lbl').closest('.control-group').hide(); - } -} - -// the vvvvvzx Some function -function add_php_getlistquery_vvvvvzx_SomeFunc(add_php_getlistquery_vvvvvzx) -{ - // set the function logic - if (add_php_getlistquery_vvvvvzx == 1) - { - return true; - } - return false; -} - -// the vvvvvzx Some function -function gettype_vvvvvzx_SomeFunc(gettype_vvvvvzx) -{ - // set the function logic - if (gettype_vvvvvzx == 2 || gettype_vvvvvzx == 4) - { - return true; - } - return false; -} - // the vvvvvzy function -function vvvvvzy(add_php_before_getitems_vvvvvzy,gettype_vvvvvzy) +function vvvvvzy(gettype_vvvvvzy) { - if (isSet(add_php_before_getitems_vvvvvzy) && add_php_before_getitems_vvvvvzy.constructor !== Array) - { - var temp_vvvvvzy = add_php_before_getitems_vvvvvzy; - var add_php_before_getitems_vvvvvzy = []; - add_php_before_getitems_vvvvvzy.push(temp_vvvvvzy); - } - else if (!isSet(add_php_before_getitems_vvvvvzy)) - { - var add_php_before_getitems_vvvvvzy = []; - } - var add_php_before_getitems = add_php_before_getitems_vvvvvzy.some(add_php_before_getitems_vvvvvzy_SomeFunc); - if (isSet(gettype_vvvvvzy) && gettype_vvvvvzy.constructor !== Array) { var temp_vvvvvzy = gettype_vvvvvzy; @@ -931,32 +782,59 @@ function vvvvvzy(add_php_before_getitems_vvvvvzy,gettype_vvvvvzy) // set this function logic - if (add_php_before_getitems && gettype) + if (gettype) { - jQuery('#jform_php_before_getitems-lbl').closest('.control-group').show(); + jQuery('#jform_add_php_after_getitem').closest('.control-group').show(); + // add required attribute to add_php_after_getitem field + if (jform_vvvvvzyvwr_required) + { + updateFieldRequired('add_php_after_getitem',0); + jQuery('#jform_add_php_after_getitem').prop('required','required'); + jQuery('#jform_add_php_after_getitem').attr('aria-required',true); + jQuery('#jform_add_php_after_getitem').addClass('required'); + jform_vvvvvzyvwr_required = false; + } + jQuery('#jform_add_php_before_getitem').closest('.control-group').show(); + // add required attribute to add_php_before_getitem field + if (jform_vvvvvzyvws_required) + { + updateFieldRequired('add_php_before_getitem',0); + jQuery('#jform_add_php_before_getitem').prop('required','required'); + jQuery('#jform_add_php_before_getitem').attr('aria-required',true); + jQuery('#jform_add_php_before_getitem').addClass('required'); + jform_vvvvvzyvws_required = false; + } } else { - jQuery('#jform_php_before_getitems-lbl').closest('.control-group').hide(); + jQuery('#jform_add_php_after_getitem').closest('.control-group').hide(); + // remove required attribute from add_php_after_getitem field + if (!jform_vvvvvzyvwr_required) + { + updateFieldRequired('add_php_after_getitem',1); + jQuery('#jform_add_php_after_getitem').removeAttr('required'); + jQuery('#jform_add_php_after_getitem').removeAttr('aria-required'); + jQuery('#jform_add_php_after_getitem').removeClass('required'); + jform_vvvvvzyvwr_required = true; + } + jQuery('#jform_add_php_before_getitem').closest('.control-group').hide(); + // remove required attribute from add_php_before_getitem field + if (!jform_vvvvvzyvws_required) + { + updateFieldRequired('add_php_before_getitem',1); + jQuery('#jform_add_php_before_getitem').removeAttr('required'); + jQuery('#jform_add_php_before_getitem').removeAttr('aria-required'); + jQuery('#jform_add_php_before_getitem').removeClass('required'); + jform_vvvvvzyvws_required = true; + } } } -// the vvvvvzy Some function -function add_php_before_getitems_vvvvvzy_SomeFunc(add_php_before_getitems_vvvvvzy) -{ - // set the function logic - if (add_php_before_getitems_vvvvvzy == 1) - { - return true; - } - return false; -} - // the vvvvvzy Some function function gettype_vvvvvzy_SomeFunc(gettype_vvvvvzy) { // set the function logic - if (gettype_vvvvvzy == 2 || gettype_vvvvvzy == 4) + if (gettype_vvvvvzy == 1 || gettype_vvvvvzy == 3) { return true; } @@ -964,19 +842,19 @@ function gettype_vvvvvzy_SomeFunc(gettype_vvvvvzy) } // the vvvvvzz function -function vvvvvzz(add_php_after_getitems_vvvvvzz,gettype_vvvvvzz) +function vvvvvzz(add_php_getlistquery_vvvvvzz,gettype_vvvvvzz) { - if (isSet(add_php_after_getitems_vvvvvzz) && add_php_after_getitems_vvvvvzz.constructor !== Array) + if (isSet(add_php_getlistquery_vvvvvzz) && add_php_getlistquery_vvvvvzz.constructor !== Array) { - var temp_vvvvvzz = add_php_after_getitems_vvvvvzz; - var add_php_after_getitems_vvvvvzz = []; - add_php_after_getitems_vvvvvzz.push(temp_vvvvvzz); + var temp_vvvvvzz = add_php_getlistquery_vvvvvzz; + var add_php_getlistquery_vvvvvzz = []; + add_php_getlistquery_vvvvvzz.push(temp_vvvvvzz); } - else if (!isSet(add_php_after_getitems_vvvvvzz)) + else if (!isSet(add_php_getlistquery_vvvvvzz)) { - var add_php_after_getitems_vvvvvzz = []; + var add_php_getlistquery_vvvvvzz = []; } - var add_php_after_getitems = add_php_after_getitems_vvvvvzz.some(add_php_after_getitems_vvvvvzz_SomeFunc); + var add_php_getlistquery = add_php_getlistquery_vvvvvzz.some(add_php_getlistquery_vvvvvzz_SomeFunc); if (isSet(gettype_vvvvvzz) && gettype_vvvvvzz.constructor !== Array) { @@ -992,21 +870,21 @@ function vvvvvzz(add_php_after_getitems_vvvvvzz,gettype_vvvvvzz) // set this function logic - if (add_php_after_getitems && gettype) + if (add_php_getlistquery && gettype) { - jQuery('#jform_php_after_getitems-lbl').closest('.control-group').show(); + jQuery('#jform_php_getlistquery-lbl').closest('.control-group').show(); } else { - jQuery('#jform_php_after_getitems-lbl').closest('.control-group').hide(); + jQuery('#jform_php_getlistquery-lbl').closest('.control-group').hide(); } } // the vvvvvzz Some function -function add_php_after_getitems_vvvvvzz_SomeFunc(add_php_after_getitems_vvvvvzz) +function add_php_getlistquery_vvvvvzz_SomeFunc(add_php_getlistquery_vvvvvzz) { // set the function logic - if (add_php_after_getitems_vvvvvzz == 1) + if (add_php_getlistquery_vvvvvzz == 1) { return true; } @@ -1024,9 +902,82 @@ function gettype_vvvvvzz_SomeFunc(gettype_vvvvvzz) return false; } -// the vvvvwab function -function vvvvwab(gettype_vvvvwab) +// the vvvvwaa function +function vvvvwaa(add_php_before_getitems_vvvvwaa,gettype_vvvvwaa) { + if (isSet(add_php_before_getitems_vvvvwaa) && add_php_before_getitems_vvvvwaa.constructor !== Array) + { + var temp_vvvvwaa = add_php_before_getitems_vvvvwaa; + var add_php_before_getitems_vvvvwaa = []; + add_php_before_getitems_vvvvwaa.push(temp_vvvvwaa); + } + else if (!isSet(add_php_before_getitems_vvvvwaa)) + { + var add_php_before_getitems_vvvvwaa = []; + } + var add_php_before_getitems = add_php_before_getitems_vvvvwaa.some(add_php_before_getitems_vvvvwaa_SomeFunc); + + if (isSet(gettype_vvvvwaa) && gettype_vvvvwaa.constructor !== Array) + { + var temp_vvvvwaa = gettype_vvvvwaa; + var gettype_vvvvwaa = []; + gettype_vvvvwaa.push(temp_vvvvwaa); + } + else if (!isSet(gettype_vvvvwaa)) + { + var gettype_vvvvwaa = []; + } + var gettype = gettype_vvvvwaa.some(gettype_vvvvwaa_SomeFunc); + + + // set this function logic + if (add_php_before_getitems && gettype) + { + jQuery('#jform_php_before_getitems-lbl').closest('.control-group').show(); + } + else + { + jQuery('#jform_php_before_getitems-lbl').closest('.control-group').hide(); + } +} + +// the vvvvwaa Some function +function add_php_before_getitems_vvvvwaa_SomeFunc(add_php_before_getitems_vvvvwaa) +{ + // set the function logic + if (add_php_before_getitems_vvvvwaa == 1) + { + return true; + } + return false; +} + +// the vvvvwaa Some function +function gettype_vvvvwaa_SomeFunc(gettype_vvvvwaa) +{ + // set the function logic + if (gettype_vvvvwaa == 2 || gettype_vvvvwaa == 4) + { + return true; + } + return false; +} + +// the vvvvwab function +function vvvvwab(add_php_after_getitems_vvvvwab,gettype_vvvvwab) +{ + if (isSet(add_php_after_getitems_vvvvwab) && add_php_after_getitems_vvvvwab.constructor !== Array) + { + var temp_vvvvwab = add_php_after_getitems_vvvvwab; + var add_php_after_getitems_vvvvwab = []; + add_php_after_getitems_vvvvwab.push(temp_vvvvwab); + } + else if (!isSet(add_php_after_getitems_vvvvwab)) + { + var add_php_after_getitems_vvvvwab = []; + } + var add_php_after_getitems = add_php_after_getitems_vvvvwab.some(add_php_after_getitems_vvvvwab_SomeFunc); + if (isSet(gettype_vvvvwab) && gettype_vvvvwab.constructor !== Array) { var temp_vvvvwab = gettype_vvvvwab; @@ -1041,74 +992,27 @@ function vvvvwab(gettype_vvvvwab) // set this function logic - if (gettype) + if (add_php_after_getitems && gettype) { - jQuery('#jform_add_php_after_getitems').closest('.control-group').show(); - // add required attribute to add_php_after_getitems field - if (jform_vvvvwabvwt_required) - { - updateFieldRequired('add_php_after_getitems',0); - jQuery('#jform_add_php_after_getitems').prop('required','required'); - jQuery('#jform_add_php_after_getitems').attr('aria-required',true); - jQuery('#jform_add_php_after_getitems').addClass('required'); - jform_vvvvwabvwt_required = false; - } - jQuery('#jform_add_php_before_getitems').closest('.control-group').show(); - // add required attribute to add_php_before_getitems field - if (jform_vvvvwabvwu_required) - { - updateFieldRequired('add_php_before_getitems',0); - jQuery('#jform_add_php_before_getitems').prop('required','required'); - jQuery('#jform_add_php_before_getitems').attr('aria-required',true); - jQuery('#jform_add_php_before_getitems').addClass('required'); - jform_vvvvwabvwu_required = false; - } - jQuery('#jform_add_php_getlistquery').closest('.control-group').show(); - // add required attribute to add_php_getlistquery field - if (jform_vvvvwabvwv_required) - { - updateFieldRequired('add_php_getlistquery',0); - jQuery('#jform_add_php_getlistquery').prop('required','required'); - jQuery('#jform_add_php_getlistquery').attr('aria-required',true); - jQuery('#jform_add_php_getlistquery').addClass('required'); - jform_vvvvwabvwv_required = false; - } + jQuery('#jform_php_after_getitems-lbl').closest('.control-group').show(); } else { - jQuery('#jform_add_php_after_getitems').closest('.control-group').hide(); - // remove required attribute from add_php_after_getitems field - if (!jform_vvvvwabvwt_required) - { - updateFieldRequired('add_php_after_getitems',1); - jQuery('#jform_add_php_after_getitems').removeAttr('required'); - jQuery('#jform_add_php_after_getitems').removeAttr('aria-required'); - jQuery('#jform_add_php_after_getitems').removeClass('required'); - jform_vvvvwabvwt_required = true; - } - jQuery('#jform_add_php_before_getitems').closest('.control-group').hide(); - // remove required attribute from add_php_before_getitems field - if (!jform_vvvvwabvwu_required) - { - updateFieldRequired('add_php_before_getitems',1); - jQuery('#jform_add_php_before_getitems').removeAttr('required'); - jQuery('#jform_add_php_before_getitems').removeAttr('aria-required'); - jQuery('#jform_add_php_before_getitems').removeClass('required'); - jform_vvvvwabvwu_required = true; - } - jQuery('#jform_add_php_getlistquery').closest('.control-group').hide(); - // remove required attribute from add_php_getlistquery field - if (!jform_vvvvwabvwv_required) - { - updateFieldRequired('add_php_getlistquery',1); - jQuery('#jform_add_php_getlistquery').removeAttr('required'); - jQuery('#jform_add_php_getlistquery').removeAttr('aria-required'); - jQuery('#jform_add_php_getlistquery').removeClass('required'); - jform_vvvvwabvwv_required = true; - } + jQuery('#jform_php_after_getitems-lbl').closest('.control-group').hide(); } } +// the vvvvwab Some function +function add_php_after_getitems_vvvvwab_SomeFunc(add_php_after_getitems_vvvvwab) +{ + // set the function logic + if (add_php_after_getitems_vvvvwab == 1) + { + return true; + } + return false; +} + // the vvvvwab Some function function gettype_vvvvwab_SomeFunc(gettype_vvvvwab) { @@ -1120,62 +1024,6 @@ function gettype_vvvvwab_SomeFunc(gettype_vvvvwab) return false; } -// the vvvvwac function -function vvvvwac(gettype_vvvvwac) -{ - if (isSet(gettype_vvvvwac) && gettype_vvvvwac.constructor !== Array) - { - var temp_vvvvwac = gettype_vvvvwac; - var gettype_vvvvwac = []; - gettype_vvvvwac.push(temp_vvvvwac); - } - else if (!isSet(gettype_vvvvwac)) - { - var gettype_vvvvwac = []; - } - var gettype = gettype_vvvvwac.some(gettype_vvvvwac_SomeFunc); - - - // set this function logic - if (gettype) - { - jQuery('#jform_pagination').closest('.control-group').show(); - // add required attribute to pagination field - if (jform_vvvvwacvww_required) - { - updateFieldRequired('pagination',0); - jQuery('#jform_pagination').prop('required','required'); - jQuery('#jform_pagination').attr('aria-required',true); - jQuery('#jform_pagination').addClass('required'); - jform_vvvvwacvww_required = false; - } - } - else - { - jQuery('#jform_pagination').closest('.control-group').hide(); - // remove required attribute from pagination field - if (!jform_vvvvwacvww_required) - { - updateFieldRequired('pagination',1); - jQuery('#jform_pagination').removeAttr('required'); - jQuery('#jform_pagination').removeAttr('aria-required'); - jQuery('#jform_pagination').removeClass('required'); - jform_vvvvwacvww_required = true; - } - } -} - -// the vvvvwac Some function -function gettype_vvvvwac_SomeFunc(gettype_vvvvwac) -{ - // set the function logic - if (gettype_vvvvwac == 2) - { - return true; - } - return false; -} - // the vvvvwad function function vvvvwad(gettype_vvvvwad) { @@ -1195,28 +1043,68 @@ function vvvvwad(gettype_vvvvwad) // set this function logic if (gettype) { - jQuery('#jform_add_php_router_parse').closest('.control-group').show(); - // add required attribute to add_php_router_parse field - if (jform_vvvvwadvwx_required) + jQuery('#jform_add_php_after_getitems').closest('.control-group').show(); + // add required attribute to add_php_after_getitems field + if (jform_vvvvwadvwt_required) { - updateFieldRequired('add_php_router_parse',0); - jQuery('#jform_add_php_router_parse').prop('required','required'); - jQuery('#jform_add_php_router_parse').attr('aria-required',true); - jQuery('#jform_add_php_router_parse').addClass('required'); - jform_vvvvwadvwx_required = false; + updateFieldRequired('add_php_after_getitems',0); + jQuery('#jform_add_php_after_getitems').prop('required','required'); + jQuery('#jform_add_php_after_getitems').attr('aria-required',true); + jQuery('#jform_add_php_after_getitems').addClass('required'); + jform_vvvvwadvwt_required = false; + } + jQuery('#jform_add_php_before_getitems').closest('.control-group').show(); + // add required attribute to add_php_before_getitems field + if (jform_vvvvwadvwu_required) + { + updateFieldRequired('add_php_before_getitems',0); + jQuery('#jform_add_php_before_getitems').prop('required','required'); + jQuery('#jform_add_php_before_getitems').attr('aria-required',true); + jQuery('#jform_add_php_before_getitems').addClass('required'); + jform_vvvvwadvwu_required = false; + } + jQuery('#jform_add_php_getlistquery').closest('.control-group').show(); + // add required attribute to add_php_getlistquery field + if (jform_vvvvwadvwv_required) + { + updateFieldRequired('add_php_getlistquery',0); + jQuery('#jform_add_php_getlistquery').prop('required','required'); + jQuery('#jform_add_php_getlistquery').attr('aria-required',true); + jQuery('#jform_add_php_getlistquery').addClass('required'); + jform_vvvvwadvwv_required = false; } } else { - jQuery('#jform_add_php_router_parse').closest('.control-group').hide(); - // remove required attribute from add_php_router_parse field - if (!jform_vvvvwadvwx_required) + jQuery('#jform_add_php_after_getitems').closest('.control-group').hide(); + // remove required attribute from add_php_after_getitems field + if (!jform_vvvvwadvwt_required) { - updateFieldRequired('add_php_router_parse',1); - jQuery('#jform_add_php_router_parse').removeAttr('required'); - jQuery('#jform_add_php_router_parse').removeAttr('aria-required'); - jQuery('#jform_add_php_router_parse').removeClass('required'); - jform_vvvvwadvwx_required = true; + updateFieldRequired('add_php_after_getitems',1); + jQuery('#jform_add_php_after_getitems').removeAttr('required'); + jQuery('#jform_add_php_after_getitems').removeAttr('aria-required'); + jQuery('#jform_add_php_after_getitems').removeClass('required'); + jform_vvvvwadvwt_required = true; + } + jQuery('#jform_add_php_before_getitems').closest('.control-group').hide(); + // remove required attribute from add_php_before_getitems field + if (!jform_vvvvwadvwu_required) + { + updateFieldRequired('add_php_before_getitems',1); + jQuery('#jform_add_php_before_getitems').removeAttr('required'); + jQuery('#jform_add_php_before_getitems').removeAttr('aria-required'); + jQuery('#jform_add_php_before_getitems').removeClass('required'); + jform_vvvvwadvwu_required = true; + } + jQuery('#jform_add_php_getlistquery').closest('.control-group').hide(); + // remove required attribute from add_php_getlistquery field + if (!jform_vvvvwadvwv_required) + { + updateFieldRequired('add_php_getlistquery',1); + jQuery('#jform_add_php_getlistquery').removeAttr('required'); + jQuery('#jform_add_php_getlistquery').removeAttr('aria-required'); + jQuery('#jform_add_php_getlistquery').removeClass('required'); + jform_vvvvwadvwv_required = true; } } } @@ -1225,7 +1113,7 @@ function vvvvwad(gettype_vvvvwad) function gettype_vvvvwad_SomeFunc(gettype_vvvvwad) { // set the function logic - if (gettype_vvvvwad == 1 || gettype_vvvvwad == 2) + if (gettype_vvvvwad == 2 || gettype_vvvvwad == 4) { return true; } @@ -1233,7 +1121,7 @@ function gettype_vvvvwad_SomeFunc(gettype_vvvvwad) } // the vvvvwae function -function vvvvwae(gettype_vvvvwae,add_php_router_parse_vvvvwae) +function vvvvwae(gettype_vvvvwae) { if (isSet(gettype_vvvvwae) && gettype_vvvvwae.constructor !== Array) { @@ -1247,44 +1135,32 @@ function vvvvwae(gettype_vvvvwae,add_php_router_parse_vvvvwae) } var gettype = gettype_vvvvwae.some(gettype_vvvvwae_SomeFunc); - if (isSet(add_php_router_parse_vvvvwae) && add_php_router_parse_vvvvwae.constructor !== Array) - { - var temp_vvvvwae = add_php_router_parse_vvvvwae; - var add_php_router_parse_vvvvwae = []; - add_php_router_parse_vvvvwae.push(temp_vvvvwae); - } - else if (!isSet(add_php_router_parse_vvvvwae)) - { - var add_php_router_parse_vvvvwae = []; - } - var add_php_router_parse = add_php_router_parse_vvvvwae.some(add_php_router_parse_vvvvwae_SomeFunc); - // set this function logic - if (gettype && add_php_router_parse) + if (gettype) { - jQuery('#jform_php_router_parse').closest('.control-group').show(); - // add required attribute to php_router_parse field - if (jform_vvvvwaevwy_required) + jQuery('#jform_pagination').closest('.control-group').show(); + // add required attribute to pagination field + if (jform_vvvvwaevww_required) { - updateFieldRequired('php_router_parse',0); - jQuery('#jform_php_router_parse').prop('required','required'); - jQuery('#jform_php_router_parse').attr('aria-required',true); - jQuery('#jform_php_router_parse').addClass('required'); - jform_vvvvwaevwy_required = false; + updateFieldRequired('pagination',0); + jQuery('#jform_pagination').prop('required','required'); + jQuery('#jform_pagination').attr('aria-required',true); + jQuery('#jform_pagination').addClass('required'); + jform_vvvvwaevww_required = false; } } else { - jQuery('#jform_php_router_parse').closest('.control-group').hide(); - // remove required attribute from php_router_parse field - if (!jform_vvvvwaevwy_required) + jQuery('#jform_pagination').closest('.control-group').hide(); + // remove required attribute from pagination field + if (!jform_vvvvwaevww_required) { - updateFieldRequired('php_router_parse',1); - jQuery('#jform_php_router_parse').removeAttr('required'); - jQuery('#jform_php_router_parse').removeAttr('aria-required'); - jQuery('#jform_php_router_parse').removeClass('required'); - jform_vvvvwaevwy_required = true; + updateFieldRequired('pagination',1); + jQuery('#jform_pagination').removeAttr('required'); + jQuery('#jform_pagination').removeAttr('aria-required'); + jQuery('#jform_pagination').removeClass('required'); + jform_vvvvwaevww_required = true; } } } @@ -1293,18 +1169,63 @@ function vvvvwae(gettype_vvvvwae,add_php_router_parse_vvvvwae) function gettype_vvvvwae_SomeFunc(gettype_vvvvwae) { // set the function logic - if (gettype_vvvvwae == 1 || gettype_vvvvwae == 2) + if (gettype_vvvvwae == 2) { return true; } return false; } -// the vvvvwae Some function -function add_php_router_parse_vvvvwae_SomeFunc(add_php_router_parse_vvvvwae) +// the vvvvwaf function +function vvvvwaf(gettype_vvvvwaf) +{ + if (isSet(gettype_vvvvwaf) && gettype_vvvvwaf.constructor !== Array) + { + var temp_vvvvwaf = gettype_vvvvwaf; + var gettype_vvvvwaf = []; + gettype_vvvvwaf.push(temp_vvvvwaf); + } + else if (!isSet(gettype_vvvvwaf)) + { + var gettype_vvvvwaf = []; + } + var gettype = gettype_vvvvwaf.some(gettype_vvvvwaf_SomeFunc); + + + // set this function logic + if (gettype) + { + jQuery('#jform_add_php_router_parse').closest('.control-group').show(); + // add required attribute to add_php_router_parse field + if (jform_vvvvwafvwx_required) + { + updateFieldRequired('add_php_router_parse',0); + jQuery('#jform_add_php_router_parse').prop('required','required'); + jQuery('#jform_add_php_router_parse').attr('aria-required',true); + jQuery('#jform_add_php_router_parse').addClass('required'); + jform_vvvvwafvwx_required = false; + } + } + else + { + jQuery('#jform_add_php_router_parse').closest('.control-group').hide(); + // remove required attribute from add_php_router_parse field + if (!jform_vvvvwafvwx_required) + { + updateFieldRequired('add_php_router_parse',1); + jQuery('#jform_add_php_router_parse').removeAttr('required'); + jQuery('#jform_add_php_router_parse').removeAttr('aria-required'); + jQuery('#jform_add_php_router_parse').removeClass('required'); + jform_vvvvwafvwx_required = true; + } + } +} + +// the vvvvwaf Some function +function gettype_vvvvwaf_SomeFunc(gettype_vvvvwaf) { // set the function logic - if (add_php_router_parse_vvvvwae == 1) + if (gettype_vvvvwaf == 1 || gettype_vvvvwaf == 2) { return true; } @@ -1312,7 +1233,7 @@ function add_php_router_parse_vvvvwae_SomeFunc(add_php_router_parse_vvvvwae) } // the vvvvwag function -function vvvvwag(gettype_vvvvwag) +function vvvvwag(gettype_vvvvwag,add_php_router_parse_vvvvwag) { if (isSet(gettype_vvvvwag) && gettype_vvvvwag.constructor !== Array) { @@ -1326,6 +1247,85 @@ function vvvvwag(gettype_vvvvwag) } var gettype = gettype_vvvvwag.some(gettype_vvvvwag_SomeFunc); + if (isSet(add_php_router_parse_vvvvwag) && add_php_router_parse_vvvvwag.constructor !== Array) + { + var temp_vvvvwag = add_php_router_parse_vvvvwag; + var add_php_router_parse_vvvvwag = []; + add_php_router_parse_vvvvwag.push(temp_vvvvwag); + } + else if (!isSet(add_php_router_parse_vvvvwag)) + { + var add_php_router_parse_vvvvwag = []; + } + var add_php_router_parse = add_php_router_parse_vvvvwag.some(add_php_router_parse_vvvvwag_SomeFunc); + + + // set this function logic + if (gettype && add_php_router_parse) + { + jQuery('#jform_php_router_parse').closest('.control-group').show(); + // add required attribute to php_router_parse field + if (jform_vvvvwagvwy_required) + { + updateFieldRequired('php_router_parse',0); + jQuery('#jform_php_router_parse').prop('required','required'); + jQuery('#jform_php_router_parse').attr('aria-required',true); + jQuery('#jform_php_router_parse').addClass('required'); + jform_vvvvwagvwy_required = false; + } + } + else + { + jQuery('#jform_php_router_parse').closest('.control-group').hide(); + // remove required attribute from php_router_parse field + if (!jform_vvvvwagvwy_required) + { + updateFieldRequired('php_router_parse',1); + jQuery('#jform_php_router_parse').removeAttr('required'); + jQuery('#jform_php_router_parse').removeAttr('aria-required'); + jQuery('#jform_php_router_parse').removeClass('required'); + jform_vvvvwagvwy_required = true; + } + } +} + +// the vvvvwag Some function +function gettype_vvvvwag_SomeFunc(gettype_vvvvwag) +{ + // set the function logic + if (gettype_vvvvwag == 1 || gettype_vvvvwag == 2) + { + return true; + } + return false; +} + +// the vvvvwag Some function +function add_php_router_parse_vvvvwag_SomeFunc(add_php_router_parse_vvvvwag) +{ + // set the function logic + if (add_php_router_parse_vvvvwag == 1) + { + return true; + } + return false; +} + +// the vvvvwai function +function vvvvwai(gettype_vvvvwai) +{ + if (isSet(gettype_vvvvwai) && gettype_vvvvwai.constructor !== Array) + { + var temp_vvvvwai = gettype_vvvvwai; + var gettype_vvvvwai = []; + gettype_vvvvwai.push(temp_vvvvwai); + } + else if (!isSet(gettype_vvvvwai)) + { + var gettype_vvvvwai = []; + } + var gettype = gettype_vvvvwai.some(gettype_vvvvwai_SomeFunc); + // set this function logic if (gettype) @@ -1338,11 +1338,11 @@ function vvvvwag(gettype_vvvvwag) } } -// the vvvvwag Some function -function gettype_vvvvwag_SomeFunc(gettype_vvvvwag) +// the vvvvwai Some function +function gettype_vvvvwai_SomeFunc(gettype_vvvvwai) { // set the function logic - if (gettype_vvvvwag == 1) + if (gettype_vvvvwai == 1) { return true; } diff --git a/admin/models/forms/field.js b/admin/models/forms/field.js index 9593549a9..9aa9a6970 100644 --- a/admin/models/forms/field.js +++ b/admin/models/forms/field.js @@ -9,57 +9,57 @@ */ // Some Global Values -jform_vvvvwatvxf_required = false; -jform_vvvvwauvxg_required = false; -jform_vvvvwavvxh_required = false; -jform_vvvvwawvxi_required = false; +jform_vvvvwaxvxh_required = false; +jform_vvvvwayvxi_required = false; +jform_vvvvwazvxj_required = false; +jform_vvvvwbavxk_required = false; // Initial Script jQuery(document).ready(function() { - var datalenght_vvvvwat = jQuery("#jform_datalenght").val(); - vvvvwat(datalenght_vvvvwat); + var datalenght_vvvvwax = jQuery("#jform_datalenght").val(); + vvvvwax(datalenght_vvvvwax); - var datadefault_vvvvwau = jQuery("#jform_datadefault").val(); - vvvvwau(datadefault_vvvvwau); + var datadefault_vvvvway = jQuery("#jform_datadefault").val(); + vvvvway(datadefault_vvvvway); - var datatype_vvvvwav = jQuery("#jform_datatype").val(); - vvvvwav(datatype_vvvvwav); + var datatype_vvvvwaz = jQuery("#jform_datatype").val(); + vvvvwaz(datatype_vvvvwaz); - var datatype_vvvvwaw = jQuery("#jform_datatype").val(); - vvvvwaw(datatype_vvvvwaw); + var datatype_vvvvwba = jQuery("#jform_datatype").val(); + vvvvwba(datatype_vvvvwba); - var store_vvvvwax = jQuery("#jform_store").val(); - var datatype_vvvvwax = jQuery("#jform_datatype").val(); - vvvvwax(store_vvvvwax,datatype_vvvvwax); + var store_vvvvwbb = jQuery("#jform_store").val(); + var datatype_vvvvwbb = jQuery("#jform_datatype").val(); + vvvvwbb(store_vvvvwbb,datatype_vvvvwbb); - var add_css_view_vvvvwaz = jQuery("#jform_add_css_view input[type='radio']:checked").val(); - vvvvwaz(add_css_view_vvvvwaz); + var add_css_view_vvvvwbd = jQuery("#jform_add_css_view input[type='radio']:checked").val(); + vvvvwbd(add_css_view_vvvvwbd); - var add_css_views_vvvvwba = jQuery("#jform_add_css_views input[type='radio']:checked").val(); - vvvvwba(add_css_views_vvvvwba); + var add_css_views_vvvvwbe = jQuery("#jform_add_css_views input[type='radio']:checked").val(); + vvvvwbe(add_css_views_vvvvwbe); - var add_javascript_view_footer_vvvvwbb = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val(); - vvvvwbb(add_javascript_view_footer_vvvvwbb); + var add_javascript_view_footer_vvvvwbf = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val(); + vvvvwbf(add_javascript_view_footer_vvvvwbf); - var add_javascript_views_footer_vvvvwbc = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val(); - vvvvwbc(add_javascript_views_footer_vvvvwbc); + var add_javascript_views_footer_vvvvwbg = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val(); + vvvvwbg(add_javascript_views_footer_vvvvwbg); }); -// the vvvvwat function -function vvvvwat(datalenght_vvvvwat) +// the vvvvwax function +function vvvvwax(datalenght_vvvvwax) { - if (isSet(datalenght_vvvvwat) && datalenght_vvvvwat.constructor !== Array) + if (isSet(datalenght_vvvvwax) && datalenght_vvvvwax.constructor !== Array) { - var temp_vvvvwat = datalenght_vvvvwat; - var datalenght_vvvvwat = []; - datalenght_vvvvwat.push(temp_vvvvwat); + var temp_vvvvwax = datalenght_vvvvwax; + var datalenght_vvvvwax = []; + datalenght_vvvvwax.push(temp_vvvvwax); } - else if (!isSet(datalenght_vvvvwat)) + else if (!isSet(datalenght_vvvvwax)) { - var datalenght_vvvvwat = []; + var datalenght_vvvvwax = []; } - var datalenght = datalenght_vvvvwat.some(datalenght_vvvvwat_SomeFunc); + var datalenght = datalenght_vvvvwax.some(datalenght_vvvvwax_SomeFunc); // set this function logic @@ -67,55 +67,55 @@ function vvvvwat(datalenght_vvvvwat) { jQuery('#jform_datalenght_other').closest('.control-group').show(); // add required attribute to datalenght_other field - if (jform_vvvvwatvxf_required) + if (jform_vvvvwaxvxh_required) { updateFieldRequired('datalenght_other',0); jQuery('#jform_datalenght_other').prop('required','required'); jQuery('#jform_datalenght_other').attr('aria-required',true); jQuery('#jform_datalenght_other').addClass('required'); - jform_vvvvwatvxf_required = false; + jform_vvvvwaxvxh_required = false; } } else { jQuery('#jform_datalenght_other').closest('.control-group').hide(); // remove required attribute from datalenght_other field - if (!jform_vvvvwatvxf_required) + if (!jform_vvvvwaxvxh_required) { updateFieldRequired('datalenght_other',1); jQuery('#jform_datalenght_other').removeAttr('required'); jQuery('#jform_datalenght_other').removeAttr('aria-required'); jQuery('#jform_datalenght_other').removeClass('required'); - jform_vvvvwatvxf_required = true; + jform_vvvvwaxvxh_required = true; } } } -// the vvvvwat Some function -function datalenght_vvvvwat_SomeFunc(datalenght_vvvvwat) +// the vvvvwax Some function +function datalenght_vvvvwax_SomeFunc(datalenght_vvvvwax) { // set the function logic - if (datalenght_vvvvwat == 'Other') + if (datalenght_vvvvwax == 'Other') { return true; } return false; } -// the vvvvwau function -function vvvvwau(datadefault_vvvvwau) +// the vvvvway function +function vvvvway(datadefault_vvvvway) { - if (isSet(datadefault_vvvvwau) && datadefault_vvvvwau.constructor !== Array) + if (isSet(datadefault_vvvvway) && datadefault_vvvvway.constructor !== Array) { - var temp_vvvvwau = datadefault_vvvvwau; - var datadefault_vvvvwau = []; - datadefault_vvvvwau.push(temp_vvvvwau); + var temp_vvvvway = datadefault_vvvvway; + var datadefault_vvvvway = []; + datadefault_vvvvway.push(temp_vvvvway); } - else if (!isSet(datadefault_vvvvwau)) + else if (!isSet(datadefault_vvvvway)) { - var datadefault_vvvvwau = []; + var datadefault_vvvvway = []; } - var datadefault = datadefault_vvvvwau.some(datadefault_vvvvwau_SomeFunc); + var datadefault = datadefault_vvvvway.some(datadefault_vvvvway_SomeFunc); // set this function logic @@ -123,55 +123,55 @@ function vvvvwau(datadefault_vvvvwau) { jQuery('#jform_datadefault_other').closest('.control-group').show(); // add required attribute to datadefault_other field - if (jform_vvvvwauvxg_required) + if (jform_vvvvwayvxi_required) { updateFieldRequired('datadefault_other',0); jQuery('#jform_datadefault_other').prop('required','required'); jQuery('#jform_datadefault_other').attr('aria-required',true); jQuery('#jform_datadefault_other').addClass('required'); - jform_vvvvwauvxg_required = false; + jform_vvvvwayvxi_required = false; } } else { jQuery('#jform_datadefault_other').closest('.control-group').hide(); // remove required attribute from datadefault_other field - if (!jform_vvvvwauvxg_required) + if (!jform_vvvvwayvxi_required) { updateFieldRequired('datadefault_other',1); jQuery('#jform_datadefault_other').removeAttr('required'); jQuery('#jform_datadefault_other').removeAttr('aria-required'); jQuery('#jform_datadefault_other').removeClass('required'); - jform_vvvvwauvxg_required = true; + jform_vvvvwayvxi_required = true; } } } -// the vvvvwau Some function -function datadefault_vvvvwau_SomeFunc(datadefault_vvvvwau) +// the vvvvway Some function +function datadefault_vvvvway_SomeFunc(datadefault_vvvvway) { // set the function logic - if (datadefault_vvvvwau == 'Other') + if (datadefault_vvvvway == 'Other') { return true; } return false; } -// the vvvvwav function -function vvvvwav(datatype_vvvvwav) +// the vvvvwaz function +function vvvvwaz(datatype_vvvvwaz) { - if (isSet(datatype_vvvvwav) && datatype_vvvvwav.constructor !== Array) + if (isSet(datatype_vvvvwaz) && datatype_vvvvwaz.constructor !== Array) { - var temp_vvvvwav = datatype_vvvvwav; - var datatype_vvvvwav = []; - datatype_vvvvwav.push(temp_vvvvwav); + var temp_vvvvwaz = datatype_vvvvwaz; + var datatype_vvvvwaz = []; + datatype_vvvvwaz.push(temp_vvvvwaz); } - else if (!isSet(datatype_vvvvwav)) + else if (!isSet(datatype_vvvvwaz)) { - var datatype_vvvvwav = []; + var datatype_vvvvwaz = []; } - var datatype = datatype_vvvvwav.some(datatype_vvvvwav_SomeFunc); + var datatype = datatype_vvvvwaz.some(datatype_vvvvwaz_SomeFunc); // set this function logic @@ -181,13 +181,13 @@ function vvvvwav(datatype_vvvvwav) jQuery('#jform_datalenght').closest('.control-group').show(); jQuery('#jform_indexes').closest('.control-group').show(); // add required attribute to indexes field - if (jform_vvvvwavvxh_required) + if (jform_vvvvwazvxj_required) { updateFieldRequired('indexes',0); jQuery('#jform_indexes').prop('required','required'); jQuery('#jform_indexes').attr('aria-required',true); jQuery('#jform_indexes').addClass('required'); - jform_vvvvwavvxh_required = false; + jform_vvvvwazvxj_required = false; } } else @@ -196,42 +196,42 @@ function vvvvwav(datatype_vvvvwav) jQuery('#jform_datalenght').closest('.control-group').hide(); jQuery('#jform_indexes').closest('.control-group').hide(); // remove required attribute from indexes field - if (!jform_vvvvwavvxh_required) + if (!jform_vvvvwazvxj_required) { updateFieldRequired('indexes',1); jQuery('#jform_indexes').removeAttr('required'); jQuery('#jform_indexes').removeAttr('aria-required'); jQuery('#jform_indexes').removeClass('required'); - jform_vvvvwavvxh_required = true; + jform_vvvvwazvxj_required = true; } } } -// the vvvvwav Some function -function datatype_vvvvwav_SomeFunc(datatype_vvvvwav) +// the vvvvwaz Some function +function datatype_vvvvwaz_SomeFunc(datatype_vvvvwaz) { // set the function logic - if (datatype_vvvvwav == 'CHAR' || datatype_vvvvwav == 'VARCHAR' || datatype_vvvvwav == 'DATETIME' || datatype_vvvvwav == 'DATE' || datatype_vvvvwav == 'TIME' || datatype_vvvvwav == 'INT' || datatype_vvvvwav == 'TINYINT' || datatype_vvvvwav == 'BIGINT' || datatype_vvvvwav == 'FLOAT' || datatype_vvvvwav == 'DECIMAL' || datatype_vvvvwav == 'DOUBLE') + if (datatype_vvvvwaz == 'CHAR' || datatype_vvvvwaz == 'VARCHAR' || datatype_vvvvwaz == 'DATETIME' || datatype_vvvvwaz == 'DATE' || datatype_vvvvwaz == 'TIME' || datatype_vvvvwaz == 'INT' || datatype_vvvvwaz == 'TINYINT' || datatype_vvvvwaz == 'BIGINT' || datatype_vvvvwaz == 'FLOAT' || datatype_vvvvwaz == 'DECIMAL' || datatype_vvvvwaz == 'DOUBLE') { return true; } return false; } -// the vvvvwaw function -function vvvvwaw(datatype_vvvvwaw) +// the vvvvwba function +function vvvvwba(datatype_vvvvwba) { - if (isSet(datatype_vvvvwaw) && datatype_vvvvwaw.constructor !== Array) + if (isSet(datatype_vvvvwba) && datatype_vvvvwba.constructor !== Array) { - var temp_vvvvwaw = datatype_vvvvwaw; - var datatype_vvvvwaw = []; - datatype_vvvvwaw.push(temp_vvvvwaw); + var temp_vvvvwba = datatype_vvvvwba; + var datatype_vvvvwba = []; + datatype_vvvvwba.push(temp_vvvvwba); } - else if (!isSet(datatype_vvvvwaw)) + else if (!isSet(datatype_vvvvwba)) { - var datatype_vvvvwaw = []; + var datatype_vvvvwba = []; } - var datatype = datatype_vvvvwaw.some(datatype_vvvvwaw_SomeFunc); + var datatype = datatype_vvvvwba.some(datatype_vvvvwba_SomeFunc); // set this function logic @@ -239,67 +239,67 @@ function vvvvwaw(datatype_vvvvwaw) { jQuery('#jform_store').closest('.control-group').show(); // add required attribute to store field - if (jform_vvvvwawvxi_required) + if (jform_vvvvwbavxk_required) { updateFieldRequired('store',0); jQuery('#jform_store').prop('required','required'); jQuery('#jform_store').attr('aria-required',true); jQuery('#jform_store').addClass('required'); - jform_vvvvwawvxi_required = false; + jform_vvvvwbavxk_required = false; } } else { jQuery('#jform_store').closest('.control-group').hide(); // remove required attribute from store field - if (!jform_vvvvwawvxi_required) + if (!jform_vvvvwbavxk_required) { updateFieldRequired('store',1); jQuery('#jform_store').removeAttr('required'); jQuery('#jform_store').removeAttr('aria-required'); jQuery('#jform_store').removeClass('required'); - jform_vvvvwawvxi_required = true; + jform_vvvvwbavxk_required = true; } } } -// the vvvvwaw Some function -function datatype_vvvvwaw_SomeFunc(datatype_vvvvwaw) +// the vvvvwba Some function +function datatype_vvvvwba_SomeFunc(datatype_vvvvwba) { // set the function logic - if (datatype_vvvvwaw == 'CHAR' || datatype_vvvvwaw == 'VARCHAR' || datatype_vvvvwaw == 'TEXT' || datatype_vvvvwaw == 'MEDIUMTEXT' || datatype_vvvvwaw == 'LONGTEXT' || datatype_vvvvwaw == 'BLOB' || datatype_vvvvwaw == 'TINYBLOB' || datatype_vvvvwaw == 'MEDIUMBLOB' || datatype_vvvvwaw == 'LONGBLOB') + if (datatype_vvvvwba == 'CHAR' || datatype_vvvvwba == 'VARCHAR' || datatype_vvvvwba == 'TEXT' || datatype_vvvvwba == 'MEDIUMTEXT' || datatype_vvvvwba == 'LONGTEXT' || datatype_vvvvwba == 'BLOB' || datatype_vvvvwba == 'TINYBLOB' || datatype_vvvvwba == 'MEDIUMBLOB' || datatype_vvvvwba == 'LONGBLOB') { return true; } return false; } -// the vvvvwax function -function vvvvwax(store_vvvvwax,datatype_vvvvwax) +// the vvvvwbb function +function vvvvwbb(store_vvvvwbb,datatype_vvvvwbb) { - if (isSet(store_vvvvwax) && store_vvvvwax.constructor !== Array) + if (isSet(store_vvvvwbb) && store_vvvvwbb.constructor !== Array) { - var temp_vvvvwax = store_vvvvwax; - var store_vvvvwax = []; - store_vvvvwax.push(temp_vvvvwax); + var temp_vvvvwbb = store_vvvvwbb; + var store_vvvvwbb = []; + store_vvvvwbb.push(temp_vvvvwbb); } - else if (!isSet(store_vvvvwax)) + else if (!isSet(store_vvvvwbb)) { - var store_vvvvwax = []; + var store_vvvvwbb = []; } - var store = store_vvvvwax.some(store_vvvvwax_SomeFunc); + var store = store_vvvvwbb.some(store_vvvvwbb_SomeFunc); - if (isSet(datatype_vvvvwax) && datatype_vvvvwax.constructor !== Array) + if (isSet(datatype_vvvvwbb) && datatype_vvvvwbb.constructor !== Array) { - var temp_vvvvwax = datatype_vvvvwax; - var datatype_vvvvwax = []; - datatype_vvvvwax.push(temp_vvvvwax); + var temp_vvvvwbb = datatype_vvvvwbb; + var datatype_vvvvwbb = []; + datatype_vvvvwbb.push(temp_vvvvwbb); } - else if (!isSet(datatype_vvvvwax)) + else if (!isSet(datatype_vvvvwbb)) { - var datatype_vvvvwax = []; + var datatype_vvvvwbb = []; } - var datatype = datatype_vvvvwax.some(datatype_vvvvwax_SomeFunc); + var datatype = datatype_vvvvwbb.some(datatype_vvvvwbb_SomeFunc); // set this function logic @@ -313,33 +313,33 @@ function vvvvwax(store_vvvvwax,datatype_vvvvwax) } } -// the vvvvwax Some function -function store_vvvvwax_SomeFunc(store_vvvvwax) +// the vvvvwbb Some function +function store_vvvvwbb_SomeFunc(store_vvvvwbb) { // set the function logic - if (store_vvvvwax == 4) + if (store_vvvvwbb == 4) { return true; } return false; } -// the vvvvwax Some function -function datatype_vvvvwax_SomeFunc(datatype_vvvvwax) +// the vvvvwbb Some function +function datatype_vvvvwbb_SomeFunc(datatype_vvvvwbb) { // set the function logic - if (datatype_vvvvwax == 'CHAR' || datatype_vvvvwax == 'VARCHAR' || datatype_vvvvwax == 'TEXT' || datatype_vvvvwax == 'MEDIUMTEXT' || datatype_vvvvwax == 'LONGTEXT' || datatype_vvvvwax == 'BLOB' || datatype_vvvvwax == 'TINYBLOB' || datatype_vvvvwax == 'MEDIUMBLOB' || datatype_vvvvwax == 'LONGBLOB') + if (datatype_vvvvwbb == 'CHAR' || datatype_vvvvwbb == 'VARCHAR' || datatype_vvvvwbb == 'TEXT' || datatype_vvvvwbb == 'MEDIUMTEXT' || datatype_vvvvwbb == 'LONGTEXT' || datatype_vvvvwbb == 'BLOB' || datatype_vvvvwbb == 'TINYBLOB' || datatype_vvvvwbb == 'MEDIUMBLOB' || datatype_vvvvwbb == 'LONGBLOB') { return true; } return false; } -// the vvvvwaz function -function vvvvwaz(add_css_view_vvvvwaz) +// the vvvvwbd function +function vvvvwbd(add_css_view_vvvvwbd) { // set the function logic - if (add_css_view_vvvvwaz == 1) + if (add_css_view_vvvvwbd == 1) { jQuery('#jform_css_view-lbl').closest('.control-group').show(); } @@ -349,11 +349,11 @@ function vvvvwaz(add_css_view_vvvvwaz) } } -// the vvvvwba function -function vvvvwba(add_css_views_vvvvwba) +// the vvvvwbe function +function vvvvwbe(add_css_views_vvvvwbe) { // set the function logic - if (add_css_views_vvvvwba == 1) + if (add_css_views_vvvvwbe == 1) { jQuery('#jform_css_views-lbl').closest('.control-group').show(); } @@ -363,11 +363,11 @@ function vvvvwba(add_css_views_vvvvwba) } } -// the vvvvwbb function -function vvvvwbb(add_javascript_view_footer_vvvvwbb) +// the vvvvwbf function +function vvvvwbf(add_javascript_view_footer_vvvvwbf) { // set the function logic - if (add_javascript_view_footer_vvvvwbb == 1) + if (add_javascript_view_footer_vvvvwbf == 1) { jQuery('#jform_javascript_view_footer-lbl').closest('.control-group').show(); } @@ -377,11 +377,11 @@ function vvvvwbb(add_javascript_view_footer_vvvvwbb) } } -// the vvvvwbc function -function vvvvwbc(add_javascript_views_footer_vvvvwbc) +// the vvvvwbg function +function vvvvwbg(add_javascript_views_footer_vvvvwbg) { // set the function logic - if (add_javascript_views_footer_vvvvwbc == 1) + if (add_javascript_views_footer_vvvvwbg == 1) { jQuery('#jform_javascript_views_footer-lbl').closest('.control-group').show(); } diff --git a/admin/models/forms/fieldtype.js b/admin/models/forms/fieldtype.js index 6769d90f8..27bb8c29a 100644 --- a/admin/models/forms/fieldtype.js +++ b/admin/models/forms/fieldtype.js @@ -9,228 +9,70 @@ */ // Some Global Values -jform_vvvvwbdvxj_required = false; -jform_vvvvwbfvxk_required = false; jform_vvvvwbhvxl_required = false; -jform_vvvvwbivxm_required = false; -jform_vvvvwbjvxn_required = false; -jform_vvvvwbovxo_required = false; -jform_vvvvwbovxp_required = false; +jform_vvvvwbjvxm_required = false; +jform_vvvvwblvxn_required = false; +jform_vvvvwbmvxo_required = false; +jform_vvvvwbnvxp_required = false; +jform_vvvvwbsvxq_required = false; +jform_vvvvwbsvxr_required = false; // Initial Script jQuery(document).ready(function() { - var datalenght_vvvvwbd = jQuery("#jform_datalenght").val(); - var has_defaults_vvvvwbd = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - vvvvwbd(datalenght_vvvvwbd,has_defaults_vvvvwbd); - - var datadefault_vvvvwbf = jQuery("#jform_datadefault").val(); - var has_defaults_vvvvwbf = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - vvvvwbf(datadefault_vvvvwbf,has_defaults_vvvvwbf); - - var datatype_vvvvwbh = jQuery("#jform_datatype").val(); + var datalenght_vvvvwbh = jQuery("#jform_datalenght").val(); var has_defaults_vvvvwbh = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - vvvvwbh(datatype_vvvvwbh,has_defaults_vvvvwbh); + vvvvwbh(datalenght_vvvvwbh,has_defaults_vvvvwbh); - var has_defaults_vvvvwbi = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - var datatype_vvvvwbi = jQuery("#jform_datatype").val(); - vvvvwbi(has_defaults_vvvvwbi,datatype_vvvvwbi); - - var datatype_vvvvwbj = jQuery("#jform_datatype").val(); + var datadefault_vvvvwbj = jQuery("#jform_datadefault").val(); var has_defaults_vvvvwbj = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - vvvvwbj(datatype_vvvvwbj,has_defaults_vvvvwbj); + vvvvwbj(datadefault_vvvvwbj,has_defaults_vvvvwbj); - var store_vvvvwbl = jQuery("#jform_store").val(); var datatype_vvvvwbl = jQuery("#jform_datatype").val(); var has_defaults_vvvvwbl = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - vvvvwbl(store_vvvvwbl,datatype_vvvvwbl,has_defaults_vvvvwbl); + vvvvwbl(datatype_vvvvwbl,has_defaults_vvvvwbl); - var datatype_vvvvwbm = jQuery("#jform_datatype").val(); - var store_vvvvwbm = jQuery("#jform_store").val(); var has_defaults_vvvvwbm = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - vvvvwbm(datatype_vvvvwbm,store_vvvvwbm,has_defaults_vvvvwbm); + var datatype_vvvvwbm = jQuery("#jform_datatype").val(); + vvvvwbm(has_defaults_vvvvwbm,datatype_vvvvwbm); - var has_defaults_vvvvwbn = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - var store_vvvvwbn = jQuery("#jform_store").val(); var datatype_vvvvwbn = jQuery("#jform_datatype").val(); - vvvvwbn(has_defaults_vvvvwbn,store_vvvvwbn,datatype_vvvvwbn); + var has_defaults_vvvvwbn = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbn(datatype_vvvvwbn,has_defaults_vvvvwbn); - var has_defaults_vvvvwbo = jQuery("#jform_has_defaults input[type='radio']:checked").val(); - vvvvwbo(has_defaults_vvvvwbo); + var store_vvvvwbp = jQuery("#jform_store").val(); + var datatype_vvvvwbp = jQuery("#jform_datatype").val(); + var has_defaults_vvvvwbp = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbp(store_vvvvwbp,datatype_vvvvwbp,has_defaults_vvvvwbp); + + var datatype_vvvvwbq = jQuery("#jform_datatype").val(); + var store_vvvvwbq = jQuery("#jform_store").val(); + var has_defaults_vvvvwbq = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbq(datatype_vvvvwbq,store_vvvvwbq,has_defaults_vvvvwbq); + + var has_defaults_vvvvwbr = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + var store_vvvvwbr = jQuery("#jform_store").val(); + var datatype_vvvvwbr = jQuery("#jform_datatype").val(); + vvvvwbr(has_defaults_vvvvwbr,store_vvvvwbr,datatype_vvvvwbr); + + var has_defaults_vvvvwbs = jQuery("#jform_has_defaults input[type='radio']:checked").val(); + vvvvwbs(has_defaults_vvvvwbs); }); -// the vvvvwbd function -function vvvvwbd(datalenght_vvvvwbd,has_defaults_vvvvwbd) -{ - if (isSet(datalenght_vvvvwbd) && datalenght_vvvvwbd.constructor !== Array) - { - var temp_vvvvwbd = datalenght_vvvvwbd; - var datalenght_vvvvwbd = []; - datalenght_vvvvwbd.push(temp_vvvvwbd); - } - else if (!isSet(datalenght_vvvvwbd)) - { - var datalenght_vvvvwbd = []; - } - var datalenght = datalenght_vvvvwbd.some(datalenght_vvvvwbd_SomeFunc); - - if (isSet(has_defaults_vvvvwbd) && has_defaults_vvvvwbd.constructor !== Array) - { - var temp_vvvvwbd = has_defaults_vvvvwbd; - var has_defaults_vvvvwbd = []; - has_defaults_vvvvwbd.push(temp_vvvvwbd); - } - else if (!isSet(has_defaults_vvvvwbd)) - { - var has_defaults_vvvvwbd = []; - } - var has_defaults = has_defaults_vvvvwbd.some(has_defaults_vvvvwbd_SomeFunc); - - - // set this function logic - if (datalenght && has_defaults) - { - jQuery('#jform_datalenght_other').closest('.control-group').show(); - // add required attribute to datalenght_other field - if (jform_vvvvwbdvxj_required) - { - updateFieldRequired('datalenght_other',0); - jQuery('#jform_datalenght_other').prop('required','required'); - jQuery('#jform_datalenght_other').attr('aria-required',true); - jQuery('#jform_datalenght_other').addClass('required'); - jform_vvvvwbdvxj_required = false; - } - } - else - { - jQuery('#jform_datalenght_other').closest('.control-group').hide(); - // remove required attribute from datalenght_other field - if (!jform_vvvvwbdvxj_required) - { - updateFieldRequired('datalenght_other',1); - jQuery('#jform_datalenght_other').removeAttr('required'); - jQuery('#jform_datalenght_other').removeAttr('aria-required'); - jQuery('#jform_datalenght_other').removeClass('required'); - jform_vvvvwbdvxj_required = true; - } - } -} - -// the vvvvwbd Some function -function datalenght_vvvvwbd_SomeFunc(datalenght_vvvvwbd) -{ - // set the function logic - if (datalenght_vvvvwbd == 'Other') - { - return true; - } - return false; -} - -// the vvvvwbd Some function -function has_defaults_vvvvwbd_SomeFunc(has_defaults_vvvvwbd) -{ - // set the function logic - if (has_defaults_vvvvwbd == 1) - { - return true; - } - return false; -} - -// the vvvvwbf function -function vvvvwbf(datadefault_vvvvwbf,has_defaults_vvvvwbf) -{ - if (isSet(datadefault_vvvvwbf) && datadefault_vvvvwbf.constructor !== Array) - { - var temp_vvvvwbf = datadefault_vvvvwbf; - var datadefault_vvvvwbf = []; - datadefault_vvvvwbf.push(temp_vvvvwbf); - } - else if (!isSet(datadefault_vvvvwbf)) - { - var datadefault_vvvvwbf = []; - } - var datadefault = datadefault_vvvvwbf.some(datadefault_vvvvwbf_SomeFunc); - - if (isSet(has_defaults_vvvvwbf) && has_defaults_vvvvwbf.constructor !== Array) - { - var temp_vvvvwbf = has_defaults_vvvvwbf; - var has_defaults_vvvvwbf = []; - has_defaults_vvvvwbf.push(temp_vvvvwbf); - } - else if (!isSet(has_defaults_vvvvwbf)) - { - var has_defaults_vvvvwbf = []; - } - var has_defaults = has_defaults_vvvvwbf.some(has_defaults_vvvvwbf_SomeFunc); - - - // set this function logic - if (datadefault && has_defaults) - { - jQuery('#jform_datadefault_other').closest('.control-group').show(); - // add required attribute to datadefault_other field - if (jform_vvvvwbfvxk_required) - { - updateFieldRequired('datadefault_other',0); - jQuery('#jform_datadefault_other').prop('required','required'); - jQuery('#jform_datadefault_other').attr('aria-required',true); - jQuery('#jform_datadefault_other').addClass('required'); - jform_vvvvwbfvxk_required = false; - } - } - else - { - jQuery('#jform_datadefault_other').closest('.control-group').hide(); - // remove required attribute from datadefault_other field - if (!jform_vvvvwbfvxk_required) - { - updateFieldRequired('datadefault_other',1); - jQuery('#jform_datadefault_other').removeAttr('required'); - jQuery('#jform_datadefault_other').removeAttr('aria-required'); - jQuery('#jform_datadefault_other').removeClass('required'); - jform_vvvvwbfvxk_required = true; - } - } -} - -// the vvvvwbf Some function -function datadefault_vvvvwbf_SomeFunc(datadefault_vvvvwbf) -{ - // set the function logic - if (datadefault_vvvvwbf == 'Other') - { - return true; - } - return false; -} - -// the vvvvwbf Some function -function has_defaults_vvvvwbf_SomeFunc(has_defaults_vvvvwbf) -{ - // set the function logic - if (has_defaults_vvvvwbf == 1) - { - return true; - } - return false; -} - // the vvvvwbh function -function vvvvwbh(datatype_vvvvwbh,has_defaults_vvvvwbh) +function vvvvwbh(datalenght_vvvvwbh,has_defaults_vvvvwbh) { - if (isSet(datatype_vvvvwbh) && datatype_vvvvwbh.constructor !== Array) + if (isSet(datalenght_vvvvwbh) && datalenght_vvvvwbh.constructor !== Array) { - var temp_vvvvwbh = datatype_vvvvwbh; - var datatype_vvvvwbh = []; - datatype_vvvvwbh.push(temp_vvvvwbh); + var temp_vvvvwbh = datalenght_vvvvwbh; + var datalenght_vvvvwbh = []; + datalenght_vvvvwbh.push(temp_vvvvwbh); } - else if (!isSet(datatype_vvvvwbh)) + else if (!isSet(datalenght_vvvvwbh)) { - var datatype_vvvvwbh = []; + var datalenght_vvvvwbh = []; } - var datatype = datatype_vvvvwbh.some(datatype_vvvvwbh_SomeFunc); + var datalenght = datalenght_vvvvwbh.some(datalenght_vvvvwbh_SomeFunc); if (isSet(has_defaults_vvvvwbh) && has_defaults_vvvvwbh.constructor !== Array) { @@ -246,43 +88,39 @@ function vvvvwbh(datatype_vvvvwbh,has_defaults_vvvvwbh) // set this function logic - if (datatype && has_defaults) + if (datalenght && has_defaults) { - jQuery('#jform_datadefault').closest('.control-group').show(); - jQuery('#jform_datalenght').closest('.control-group').show(); - jQuery('#jform_indexes').closest('.control-group').show(); - // add required attribute to indexes field + jQuery('#jform_datalenght_other').closest('.control-group').show(); + // add required attribute to datalenght_other field if (jform_vvvvwbhvxl_required) { - updateFieldRequired('indexes',0); - jQuery('#jform_indexes').prop('required','required'); - jQuery('#jform_indexes').attr('aria-required',true); - jQuery('#jform_indexes').addClass('required'); + updateFieldRequired('datalenght_other',0); + jQuery('#jform_datalenght_other').prop('required','required'); + jQuery('#jform_datalenght_other').attr('aria-required',true); + jQuery('#jform_datalenght_other').addClass('required'); jform_vvvvwbhvxl_required = false; } } else { - jQuery('#jform_datadefault').closest('.control-group').hide(); - jQuery('#jform_datalenght').closest('.control-group').hide(); - jQuery('#jform_indexes').closest('.control-group').hide(); - // remove required attribute from indexes field + jQuery('#jform_datalenght_other').closest('.control-group').hide(); + // remove required attribute from datalenght_other field if (!jform_vvvvwbhvxl_required) { - updateFieldRequired('indexes',1); - jQuery('#jform_indexes').removeAttr('required'); - jQuery('#jform_indexes').removeAttr('aria-required'); - jQuery('#jform_indexes').removeClass('required'); + updateFieldRequired('datalenght_other',1); + jQuery('#jform_datalenght_other').removeAttr('required'); + jQuery('#jform_datalenght_other').removeAttr('aria-required'); + jQuery('#jform_datalenght_other').removeClass('required'); jform_vvvvwbhvxl_required = true; } } } // the vvvvwbh Some function -function datatype_vvvvwbh_SomeFunc(datatype_vvvvwbh) +function datalenght_vvvvwbh_SomeFunc(datalenght_vvvvwbh) { // set the function logic - if (datatype_vvvvwbh == 'CHAR' || datatype_vvvvwbh == 'VARCHAR' || datatype_vvvvwbh == 'DATETIME' || datatype_vvvvwbh == 'DATE' || datatype_vvvvwbh == 'TIME' || datatype_vvvvwbh == 'INT' || datatype_vvvvwbh == 'TINYINT' || datatype_vvvvwbh == 'BIGINT' || datatype_vvvvwbh == 'FLOAT' || datatype_vvvvwbh == 'DECIMAL' || datatype_vvvvwbh == 'DOUBLE') + if (datalenght_vvvvwbh == 'Other') { return true; } @@ -300,103 +138,20 @@ function has_defaults_vvvvwbh_SomeFunc(has_defaults_vvvvwbh) return false; } -// the vvvvwbi function -function vvvvwbi(has_defaults_vvvvwbi,datatype_vvvvwbi) -{ - if (isSet(has_defaults_vvvvwbi) && has_defaults_vvvvwbi.constructor !== Array) - { - var temp_vvvvwbi = has_defaults_vvvvwbi; - var has_defaults_vvvvwbi = []; - has_defaults_vvvvwbi.push(temp_vvvvwbi); - } - else if (!isSet(has_defaults_vvvvwbi)) - { - var has_defaults_vvvvwbi = []; - } - var has_defaults = has_defaults_vvvvwbi.some(has_defaults_vvvvwbi_SomeFunc); - - if (isSet(datatype_vvvvwbi) && datatype_vvvvwbi.constructor !== Array) - { - var temp_vvvvwbi = datatype_vvvvwbi; - var datatype_vvvvwbi = []; - datatype_vvvvwbi.push(temp_vvvvwbi); - } - else if (!isSet(datatype_vvvvwbi)) - { - var datatype_vvvvwbi = []; - } - var datatype = datatype_vvvvwbi.some(datatype_vvvvwbi_SomeFunc); - - - // set this function logic - if (has_defaults && datatype) - { - jQuery('#jform_datadefault').closest('.control-group').show(); - jQuery('#jform_datalenght').closest('.control-group').show(); - jQuery('#jform_indexes').closest('.control-group').show(); - // add required attribute to indexes field - if (jform_vvvvwbivxm_required) - { - updateFieldRequired('indexes',0); - jQuery('#jform_indexes').prop('required','required'); - jQuery('#jform_indexes').attr('aria-required',true); - jQuery('#jform_indexes').addClass('required'); - jform_vvvvwbivxm_required = false; - } - } - else - { - jQuery('#jform_datadefault').closest('.control-group').hide(); - jQuery('#jform_datalenght').closest('.control-group').hide(); - jQuery('#jform_indexes').closest('.control-group').hide(); - // remove required attribute from indexes field - if (!jform_vvvvwbivxm_required) - { - updateFieldRequired('indexes',1); - jQuery('#jform_indexes').removeAttr('required'); - jQuery('#jform_indexes').removeAttr('aria-required'); - jQuery('#jform_indexes').removeClass('required'); - jform_vvvvwbivxm_required = true; - } - } -} - -// the vvvvwbi Some function -function has_defaults_vvvvwbi_SomeFunc(has_defaults_vvvvwbi) -{ - // set the function logic - if (has_defaults_vvvvwbi == 1) - { - return true; - } - return false; -} - -// the vvvvwbi Some function -function datatype_vvvvwbi_SomeFunc(datatype_vvvvwbi) -{ - // set the function logic - if (datatype_vvvvwbi == 'CHAR' || datatype_vvvvwbi == 'VARCHAR' || datatype_vvvvwbi == 'DATETIME' || datatype_vvvvwbi == 'DATE' || datatype_vvvvwbi == 'TIME' || datatype_vvvvwbi == 'INT' || datatype_vvvvwbi == 'TINYINT' || datatype_vvvvwbi == 'BIGINT' || datatype_vvvvwbi == 'FLOAT' || datatype_vvvvwbi == 'DECIMAL' || datatype_vvvvwbi == 'DOUBLE') - { - return true; - } - return false; -} - // the vvvvwbj function -function vvvvwbj(datatype_vvvvwbj,has_defaults_vvvvwbj) +function vvvvwbj(datadefault_vvvvwbj,has_defaults_vvvvwbj) { - if (isSet(datatype_vvvvwbj) && datatype_vvvvwbj.constructor !== Array) + if (isSet(datadefault_vvvvwbj) && datadefault_vvvvwbj.constructor !== Array) { - var temp_vvvvwbj = datatype_vvvvwbj; - var datatype_vvvvwbj = []; - datatype_vvvvwbj.push(temp_vvvvwbj); + var temp_vvvvwbj = datadefault_vvvvwbj; + var datadefault_vvvvwbj = []; + datadefault_vvvvwbj.push(temp_vvvvwbj); } - else if (!isSet(datatype_vvvvwbj)) + else if (!isSet(datadefault_vvvvwbj)) { - var datatype_vvvvwbj = []; + var datadefault_vvvvwbj = []; } - var datatype = datatype_vvvvwbj.some(datatype_vvvvwbj_SomeFunc); + var datadefault = datadefault_vvvvwbj.some(datadefault_vvvvwbj_SomeFunc); if (isSet(has_defaults_vvvvwbj) && has_defaults_vvvvwbj.constructor !== Array) { @@ -412,39 +167,39 @@ function vvvvwbj(datatype_vvvvwbj,has_defaults_vvvvwbj) // set this function logic - if (datatype && has_defaults) + if (datadefault && has_defaults) { - jQuery('#jform_store').closest('.control-group').show(); - // add required attribute to store field - if (jform_vvvvwbjvxn_required) + jQuery('#jform_datadefault_other').closest('.control-group').show(); + // add required attribute to datadefault_other field + if (jform_vvvvwbjvxm_required) { - updateFieldRequired('store',0); - jQuery('#jform_store').prop('required','required'); - jQuery('#jform_store').attr('aria-required',true); - jQuery('#jform_store').addClass('required'); - jform_vvvvwbjvxn_required = false; + updateFieldRequired('datadefault_other',0); + jQuery('#jform_datadefault_other').prop('required','required'); + jQuery('#jform_datadefault_other').attr('aria-required',true); + jQuery('#jform_datadefault_other').addClass('required'); + jform_vvvvwbjvxm_required = false; } } else { - jQuery('#jform_store').closest('.control-group').hide(); - // remove required attribute from store field - if (!jform_vvvvwbjvxn_required) + jQuery('#jform_datadefault_other').closest('.control-group').hide(); + // remove required attribute from datadefault_other field + if (!jform_vvvvwbjvxm_required) { - updateFieldRequired('store',1); - jQuery('#jform_store').removeAttr('required'); - jQuery('#jform_store').removeAttr('aria-required'); - jQuery('#jform_store').removeClass('required'); - jform_vvvvwbjvxn_required = true; + updateFieldRequired('datadefault_other',1); + jQuery('#jform_datadefault_other').removeAttr('required'); + jQuery('#jform_datadefault_other').removeAttr('aria-required'); + jQuery('#jform_datadefault_other').removeClass('required'); + jform_vvvvwbjvxm_required = true; } } } // the vvvvwbj Some function -function datatype_vvvvwbj_SomeFunc(datatype_vvvvwbj) +function datadefault_vvvvwbj_SomeFunc(datadefault_vvvvwbj) { // set the function logic - if (datatype_vvvvwbj == 'CHAR' || datatype_vvvvwbj == 'VARCHAR' || datatype_vvvvwbj == 'TEXT' || datatype_vvvvwbj == 'MEDIUMTEXT' || datatype_vvvvwbj == 'LONGTEXT' || datatype_vvvvwbj == 'BLOB' || datatype_vvvvwbj == 'TINYBLOB' || datatype_vvvvwbj == 'MEDIUMBLOB' || datatype_vvvvwbj == 'LONGBLOB') + if (datadefault_vvvvwbj == 'Other') { return true; } @@ -463,20 +218,8 @@ function has_defaults_vvvvwbj_SomeFunc(has_defaults_vvvvwbj) } // the vvvvwbl function -function vvvvwbl(store_vvvvwbl,datatype_vvvvwbl,has_defaults_vvvvwbl) +function vvvvwbl(datatype_vvvvwbl,has_defaults_vvvvwbl) { - if (isSet(store_vvvvwbl) && store_vvvvwbl.constructor !== Array) - { - var temp_vvvvwbl = store_vvvvwbl; - var store_vvvvwbl = []; - store_vvvvwbl.push(temp_vvvvwbl); - } - else if (!isSet(store_vvvvwbl)) - { - var store_vvvvwbl = []; - } - var store = store_vvvvwbl.some(store_vvvvwbl_SomeFunc); - if (isSet(datatype_vvvvwbl) && datatype_vvvvwbl.constructor !== Array) { var temp_vvvvwbl = datatype_vvvvwbl; @@ -503,32 +246,43 @@ function vvvvwbl(store_vvvvwbl,datatype_vvvvwbl,has_defaults_vvvvwbl) // set this function logic - if (store && datatype && has_defaults) + if (datatype && has_defaults) { - jQuery('.note_whmcs_encryption').closest('.control-group').show(); + jQuery('#jform_datadefault').closest('.control-group').show(); + jQuery('#jform_datalenght').closest('.control-group').show(); + jQuery('#jform_indexes').closest('.control-group').show(); + // add required attribute to indexes field + if (jform_vvvvwblvxn_required) + { + updateFieldRequired('indexes',0); + jQuery('#jform_indexes').prop('required','required'); + jQuery('#jform_indexes').attr('aria-required',true); + jQuery('#jform_indexes').addClass('required'); + jform_vvvvwblvxn_required = false; + } } else { - jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + jQuery('#jform_datadefault').closest('.control-group').hide(); + jQuery('#jform_datalenght').closest('.control-group').hide(); + jQuery('#jform_indexes').closest('.control-group').hide(); + // remove required attribute from indexes field + if (!jform_vvvvwblvxn_required) + { + updateFieldRequired('indexes',1); + jQuery('#jform_indexes').removeAttr('required'); + jQuery('#jform_indexes').removeAttr('aria-required'); + jQuery('#jform_indexes').removeClass('required'); + jform_vvvvwblvxn_required = true; + } } } -// the vvvvwbl Some function -function store_vvvvwbl_SomeFunc(store_vvvvwbl) -{ - // set the function logic - if (store_vvvvwbl == 4) - { - return true; - } - return false; -} - // the vvvvwbl Some function function datatype_vvvvwbl_SomeFunc(datatype_vvvvwbl) { // set the function logic - if (datatype_vvvvwbl == 'CHAR' || datatype_vvvvwbl == 'VARCHAR' || datatype_vvvvwbl == 'TEXT' || datatype_vvvvwbl == 'MEDIUMTEXT' || datatype_vvvvwbl == 'LONGTEXT' || datatype_vvvvwbl == 'BLOB' || datatype_vvvvwbl == 'TINYBLOB' || datatype_vvvvwbl == 'MEDIUMBLOB' || datatype_vvvvwbl == 'LONGBLOB') + if (datatype_vvvvwbl == 'CHAR' || datatype_vvvvwbl == 'VARCHAR' || datatype_vvvvwbl == 'DATETIME' || datatype_vvvvwbl == 'DATE' || datatype_vvvvwbl == 'TIME' || datatype_vvvvwbl == 'INT' || datatype_vvvvwbl == 'TINYINT' || datatype_vvvvwbl == 'BIGINT' || datatype_vvvvwbl == 'FLOAT' || datatype_vvvvwbl == 'DECIMAL' || datatype_vvvvwbl == 'DOUBLE') { return true; } @@ -547,32 +301,8 @@ function has_defaults_vvvvwbl_SomeFunc(has_defaults_vvvvwbl) } // the vvvvwbm function -function vvvvwbm(datatype_vvvvwbm,store_vvvvwbm,has_defaults_vvvvwbm) +function vvvvwbm(has_defaults_vvvvwbm,datatype_vvvvwbm) { - if (isSet(datatype_vvvvwbm) && datatype_vvvvwbm.constructor !== Array) - { - var temp_vvvvwbm = datatype_vvvvwbm; - var datatype_vvvvwbm = []; - datatype_vvvvwbm.push(temp_vvvvwbm); - } - else if (!isSet(datatype_vvvvwbm)) - { - var datatype_vvvvwbm = []; - } - var datatype = datatype_vvvvwbm.some(datatype_vvvvwbm_SomeFunc); - - if (isSet(store_vvvvwbm) && store_vvvvwbm.constructor !== Array) - { - var temp_vvvvwbm = store_vvvvwbm; - var store_vvvvwbm = []; - store_vvvvwbm.push(temp_vvvvwbm); - } - else if (!isSet(store_vvvvwbm)) - { - var store_vvvvwbm = []; - } - var store = store_vvvvwbm.some(store_vvvvwbm_SomeFunc); - if (isSet(has_defaults_vvvvwbm) && has_defaults_vvvvwbm.constructor !== Array) { var temp_vvvvwbm = has_defaults_vvvvwbm; @@ -585,40 +315,52 @@ function vvvvwbm(datatype_vvvvwbm,store_vvvvwbm,has_defaults_vvvvwbm) } var has_defaults = has_defaults_vvvvwbm.some(has_defaults_vvvvwbm_SomeFunc); + if (isSet(datatype_vvvvwbm) && datatype_vvvvwbm.constructor !== Array) + { + var temp_vvvvwbm = datatype_vvvvwbm; + var datatype_vvvvwbm = []; + datatype_vvvvwbm.push(temp_vvvvwbm); + } + else if (!isSet(datatype_vvvvwbm)) + { + var datatype_vvvvwbm = []; + } + var datatype = datatype_vvvvwbm.some(datatype_vvvvwbm_SomeFunc); + // set this function logic - if (datatype && store && has_defaults) + if (has_defaults && datatype) { - jQuery('.note_whmcs_encryption').closest('.control-group').show(); + jQuery('#jform_datadefault').closest('.control-group').show(); + jQuery('#jform_datalenght').closest('.control-group').show(); + jQuery('#jform_indexes').closest('.control-group').show(); + // add required attribute to indexes field + if (jform_vvvvwbmvxo_required) + { + updateFieldRequired('indexes',0); + jQuery('#jform_indexes').prop('required','required'); + jQuery('#jform_indexes').attr('aria-required',true); + jQuery('#jform_indexes').addClass('required'); + jform_vvvvwbmvxo_required = false; + } } else { - jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + jQuery('#jform_datadefault').closest('.control-group').hide(); + jQuery('#jform_datalenght').closest('.control-group').hide(); + jQuery('#jform_indexes').closest('.control-group').hide(); + // remove required attribute from indexes field + if (!jform_vvvvwbmvxo_required) + { + updateFieldRequired('indexes',1); + jQuery('#jform_indexes').removeAttr('required'); + jQuery('#jform_indexes').removeAttr('aria-required'); + jQuery('#jform_indexes').removeClass('required'); + jform_vvvvwbmvxo_required = true; + } } } -// the vvvvwbm Some function -function datatype_vvvvwbm_SomeFunc(datatype_vvvvwbm) -{ - // set the function logic - if (datatype_vvvvwbm == 'CHAR' || datatype_vvvvwbm == 'VARCHAR' || datatype_vvvvwbm == 'TEXT' || datatype_vvvvwbm == 'MEDIUMTEXT' || datatype_vvvvwbm == 'LONGTEXT' || datatype_vvvvwbm == 'BLOB' || datatype_vvvvwbm == 'TINYBLOB' || datatype_vvvvwbm == 'MEDIUMBLOB' || datatype_vvvvwbm == 'LONGBLOB') - { - return true; - } - return false; -} - -// the vvvvwbm Some function -function store_vvvvwbm_SomeFunc(store_vvvvwbm) -{ - // set the function logic - if (store_vvvvwbm == 4) - { - return true; - } - return false; -} - // the vvvvwbm Some function function has_defaults_vvvvwbm_SomeFunc(has_defaults_vvvvwbm) { @@ -630,33 +372,20 @@ function has_defaults_vvvvwbm_SomeFunc(has_defaults_vvvvwbm) return false; } -// the vvvvwbn function -function vvvvwbn(has_defaults_vvvvwbn,store_vvvvwbn,datatype_vvvvwbn) +// the vvvvwbm Some function +function datatype_vvvvwbm_SomeFunc(datatype_vvvvwbm) { - if (isSet(has_defaults_vvvvwbn) && has_defaults_vvvvwbn.constructor !== Array) + // set the function logic + if (datatype_vvvvwbm == 'CHAR' || datatype_vvvvwbm == 'VARCHAR' || datatype_vvvvwbm == 'DATETIME' || datatype_vvvvwbm == 'DATE' || datatype_vvvvwbm == 'TIME' || datatype_vvvvwbm == 'INT' || datatype_vvvvwbm == 'TINYINT' || datatype_vvvvwbm == 'BIGINT' || datatype_vvvvwbm == 'FLOAT' || datatype_vvvvwbm == 'DECIMAL' || datatype_vvvvwbm == 'DOUBLE') { - var temp_vvvvwbn = has_defaults_vvvvwbn; - var has_defaults_vvvvwbn = []; - has_defaults_vvvvwbn.push(temp_vvvvwbn); + return true; } - else if (!isSet(has_defaults_vvvvwbn)) - { - var has_defaults_vvvvwbn = []; - } - var has_defaults = has_defaults_vvvvwbn.some(has_defaults_vvvvwbn_SomeFunc); - - if (isSet(store_vvvvwbn) && store_vvvvwbn.constructor !== Array) - { - var temp_vvvvwbn = store_vvvvwbn; - var store_vvvvwbn = []; - store_vvvvwbn.push(temp_vvvvwbn); - } - else if (!isSet(store_vvvvwbn)) - { - var store_vvvvwbn = []; - } - var store = store_vvvvwbn.some(store_vvvvwbn_SomeFunc); + return false; +} +// the vvvvwbn function +function vvvvwbn(datatype_vvvvwbn,has_defaults_vvvvwbn) +{ if (isSet(datatype_vvvvwbn) && datatype_vvvvwbn.constructor !== Array) { var temp_vvvvwbn = datatype_vvvvwbn; @@ -669,40 +398,48 @@ function vvvvwbn(has_defaults_vvvvwbn,store_vvvvwbn,datatype_vvvvwbn) } var datatype = datatype_vvvvwbn.some(datatype_vvvvwbn_SomeFunc); + if (isSet(has_defaults_vvvvwbn) && has_defaults_vvvvwbn.constructor !== Array) + { + var temp_vvvvwbn = has_defaults_vvvvwbn; + var has_defaults_vvvvwbn = []; + has_defaults_vvvvwbn.push(temp_vvvvwbn); + } + else if (!isSet(has_defaults_vvvvwbn)) + { + var has_defaults_vvvvwbn = []; + } + var has_defaults = has_defaults_vvvvwbn.some(has_defaults_vvvvwbn_SomeFunc); + // set this function logic - if (has_defaults && store && datatype) + if (datatype && has_defaults) { - jQuery('.note_whmcs_encryption').closest('.control-group').show(); + jQuery('#jform_store').closest('.control-group').show(); + // add required attribute to store field + if (jform_vvvvwbnvxp_required) + { + updateFieldRequired('store',0); + jQuery('#jform_store').prop('required','required'); + jQuery('#jform_store').attr('aria-required',true); + jQuery('#jform_store').addClass('required'); + jform_vvvvwbnvxp_required = false; + } } else { - jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + jQuery('#jform_store').closest('.control-group').hide(); + // remove required attribute from store field + if (!jform_vvvvwbnvxp_required) + { + updateFieldRequired('store',1); + jQuery('#jform_store').removeAttr('required'); + jQuery('#jform_store').removeAttr('aria-required'); + jQuery('#jform_store').removeClass('required'); + jform_vvvvwbnvxp_required = true; + } } } -// the vvvvwbn Some function -function has_defaults_vvvvwbn_SomeFunc(has_defaults_vvvvwbn) -{ - // set the function logic - if (has_defaults_vvvvwbn == 1) - { - return true; - } - return false; -} - -// the vvvvwbn Some function -function store_vvvvwbn_SomeFunc(store_vvvvwbn) -{ - // set the function logic - if (store_vvvvwbn == 4) - { - return true; - } - return false; -} - // the vvvvwbn Some function function datatype_vvvvwbn_SomeFunc(datatype_vvvvwbn) { @@ -714,54 +451,317 @@ function datatype_vvvvwbn_SomeFunc(datatype_vvvvwbn) return false; } -// the vvvvwbo function -function vvvvwbo(has_defaults_vvvvwbo) +// the vvvvwbn Some function +function has_defaults_vvvvwbn_SomeFunc(has_defaults_vvvvwbn) { // set the function logic - if (has_defaults_vvvvwbo == 1) + if (has_defaults_vvvvwbn == 1) + { + return true; + } + return false; +} + +// the vvvvwbp function +function vvvvwbp(store_vvvvwbp,datatype_vvvvwbp,has_defaults_vvvvwbp) +{ + if (isSet(store_vvvvwbp) && store_vvvvwbp.constructor !== Array) + { + var temp_vvvvwbp = store_vvvvwbp; + var store_vvvvwbp = []; + store_vvvvwbp.push(temp_vvvvwbp); + } + else if (!isSet(store_vvvvwbp)) + { + var store_vvvvwbp = []; + } + var store = store_vvvvwbp.some(store_vvvvwbp_SomeFunc); + + if (isSet(datatype_vvvvwbp) && datatype_vvvvwbp.constructor !== Array) + { + var temp_vvvvwbp = datatype_vvvvwbp; + var datatype_vvvvwbp = []; + datatype_vvvvwbp.push(temp_vvvvwbp); + } + else if (!isSet(datatype_vvvvwbp)) + { + var datatype_vvvvwbp = []; + } + var datatype = datatype_vvvvwbp.some(datatype_vvvvwbp_SomeFunc); + + if (isSet(has_defaults_vvvvwbp) && has_defaults_vvvvwbp.constructor !== Array) + { + var temp_vvvvwbp = has_defaults_vvvvwbp; + var has_defaults_vvvvwbp = []; + has_defaults_vvvvwbp.push(temp_vvvvwbp); + } + else if (!isSet(has_defaults_vvvvwbp)) + { + var has_defaults_vvvvwbp = []; + } + var has_defaults = has_defaults_vvvvwbp.some(has_defaults_vvvvwbp_SomeFunc); + + + // set this function logic + if (store && datatype && has_defaults) + { + jQuery('.note_whmcs_encryption').closest('.control-group').show(); + } + else + { + jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + } +} + +// the vvvvwbp Some function +function store_vvvvwbp_SomeFunc(store_vvvvwbp) +{ + // set the function logic + if (store_vvvvwbp == 4) + { + return true; + } + return false; +} + +// the vvvvwbp Some function +function datatype_vvvvwbp_SomeFunc(datatype_vvvvwbp) +{ + // set the function logic + if (datatype_vvvvwbp == 'CHAR' || datatype_vvvvwbp == 'VARCHAR' || datatype_vvvvwbp == 'TEXT' || datatype_vvvvwbp == 'MEDIUMTEXT' || datatype_vvvvwbp == 'LONGTEXT' || datatype_vvvvwbp == 'BLOB' || datatype_vvvvwbp == 'TINYBLOB' || datatype_vvvvwbp == 'MEDIUMBLOB' || datatype_vvvvwbp == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwbp Some function +function has_defaults_vvvvwbp_SomeFunc(has_defaults_vvvvwbp) +{ + // set the function logic + if (has_defaults_vvvvwbp == 1) + { + return true; + } + return false; +} + +// the vvvvwbq function +function vvvvwbq(datatype_vvvvwbq,store_vvvvwbq,has_defaults_vvvvwbq) +{ + if (isSet(datatype_vvvvwbq) && datatype_vvvvwbq.constructor !== Array) + { + var temp_vvvvwbq = datatype_vvvvwbq; + var datatype_vvvvwbq = []; + datatype_vvvvwbq.push(temp_vvvvwbq); + } + else if (!isSet(datatype_vvvvwbq)) + { + var datatype_vvvvwbq = []; + } + var datatype = datatype_vvvvwbq.some(datatype_vvvvwbq_SomeFunc); + + if (isSet(store_vvvvwbq) && store_vvvvwbq.constructor !== Array) + { + var temp_vvvvwbq = store_vvvvwbq; + var store_vvvvwbq = []; + store_vvvvwbq.push(temp_vvvvwbq); + } + else if (!isSet(store_vvvvwbq)) + { + var store_vvvvwbq = []; + } + var store = store_vvvvwbq.some(store_vvvvwbq_SomeFunc); + + if (isSet(has_defaults_vvvvwbq) && has_defaults_vvvvwbq.constructor !== Array) + { + var temp_vvvvwbq = has_defaults_vvvvwbq; + var has_defaults_vvvvwbq = []; + has_defaults_vvvvwbq.push(temp_vvvvwbq); + } + else if (!isSet(has_defaults_vvvvwbq)) + { + var has_defaults_vvvvwbq = []; + } + var has_defaults = has_defaults_vvvvwbq.some(has_defaults_vvvvwbq_SomeFunc); + + + // set this function logic + if (datatype && store && has_defaults) + { + jQuery('.note_whmcs_encryption').closest('.control-group').show(); + } + else + { + jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + } +} + +// the vvvvwbq Some function +function datatype_vvvvwbq_SomeFunc(datatype_vvvvwbq) +{ + // set the function logic + if (datatype_vvvvwbq == 'CHAR' || datatype_vvvvwbq == 'VARCHAR' || datatype_vvvvwbq == 'TEXT' || datatype_vvvvwbq == 'MEDIUMTEXT' || datatype_vvvvwbq == 'LONGTEXT' || datatype_vvvvwbq == 'BLOB' || datatype_vvvvwbq == 'TINYBLOB' || datatype_vvvvwbq == 'MEDIUMBLOB' || datatype_vvvvwbq == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwbq Some function +function store_vvvvwbq_SomeFunc(store_vvvvwbq) +{ + // set the function logic + if (store_vvvvwbq == 4) + { + return true; + } + return false; +} + +// the vvvvwbq Some function +function has_defaults_vvvvwbq_SomeFunc(has_defaults_vvvvwbq) +{ + // set the function logic + if (has_defaults_vvvvwbq == 1) + { + return true; + } + return false; +} + +// the vvvvwbr function +function vvvvwbr(has_defaults_vvvvwbr,store_vvvvwbr,datatype_vvvvwbr) +{ + if (isSet(has_defaults_vvvvwbr) && has_defaults_vvvvwbr.constructor !== Array) + { + var temp_vvvvwbr = has_defaults_vvvvwbr; + var has_defaults_vvvvwbr = []; + has_defaults_vvvvwbr.push(temp_vvvvwbr); + } + else if (!isSet(has_defaults_vvvvwbr)) + { + var has_defaults_vvvvwbr = []; + } + var has_defaults = has_defaults_vvvvwbr.some(has_defaults_vvvvwbr_SomeFunc); + + if (isSet(store_vvvvwbr) && store_vvvvwbr.constructor !== Array) + { + var temp_vvvvwbr = store_vvvvwbr; + var store_vvvvwbr = []; + store_vvvvwbr.push(temp_vvvvwbr); + } + else if (!isSet(store_vvvvwbr)) + { + var store_vvvvwbr = []; + } + var store = store_vvvvwbr.some(store_vvvvwbr_SomeFunc); + + if (isSet(datatype_vvvvwbr) && datatype_vvvvwbr.constructor !== Array) + { + var temp_vvvvwbr = datatype_vvvvwbr; + var datatype_vvvvwbr = []; + datatype_vvvvwbr.push(temp_vvvvwbr); + } + else if (!isSet(datatype_vvvvwbr)) + { + var datatype_vvvvwbr = []; + } + var datatype = datatype_vvvvwbr.some(datatype_vvvvwbr_SomeFunc); + + + // set this function logic + if (has_defaults && store && datatype) + { + jQuery('.note_whmcs_encryption').closest('.control-group').show(); + } + else + { + jQuery('.note_whmcs_encryption').closest('.control-group').hide(); + } +} + +// the vvvvwbr Some function +function has_defaults_vvvvwbr_SomeFunc(has_defaults_vvvvwbr) +{ + // set the function logic + if (has_defaults_vvvvwbr == 1) + { + return true; + } + return false; +} + +// the vvvvwbr Some function +function store_vvvvwbr_SomeFunc(store_vvvvwbr) +{ + // set the function logic + if (store_vvvvwbr == 4) + { + return true; + } + return false; +} + +// the vvvvwbr Some function +function datatype_vvvvwbr_SomeFunc(datatype_vvvvwbr) +{ + // set the function logic + if (datatype_vvvvwbr == 'CHAR' || datatype_vvvvwbr == 'VARCHAR' || datatype_vvvvwbr == 'TEXT' || datatype_vvvvwbr == 'MEDIUMTEXT' || datatype_vvvvwbr == 'LONGTEXT' || datatype_vvvvwbr == 'BLOB' || datatype_vvvvwbr == 'TINYBLOB' || datatype_vvvvwbr == 'MEDIUMBLOB' || datatype_vvvvwbr == 'LONGBLOB') + { + return true; + } + return false; +} + +// the vvvvwbs function +function vvvvwbs(has_defaults_vvvvwbs) +{ + // set the function logic + if (has_defaults_vvvvwbs == 1) { jQuery('#jform_datatype').closest('.control-group').show(); // add required attribute to datatype field - if (jform_vvvvwbovxo_required) + if (jform_vvvvwbsvxq_required) { updateFieldRequired('datatype',0); jQuery('#jform_datatype').prop('required','required'); jQuery('#jform_datatype').attr('aria-required',true); jQuery('#jform_datatype').addClass('required'); - jform_vvvvwbovxo_required = false; + jform_vvvvwbsvxq_required = false; } jQuery('#jform_null_switch').closest('.control-group').show(); // add required attribute to null_switch field - if (jform_vvvvwbovxp_required) + if (jform_vvvvwbsvxr_required) { updateFieldRequired('null_switch',0); jQuery('#jform_null_switch').prop('required','required'); jQuery('#jform_null_switch').attr('aria-required',true); jQuery('#jform_null_switch').addClass('required'); - jform_vvvvwbovxp_required = false; + jform_vvvvwbsvxr_required = false; } } else { jQuery('#jform_datatype').closest('.control-group').hide(); // remove required attribute from datatype field - if (!jform_vvvvwbovxo_required) + if (!jform_vvvvwbsvxq_required) { updateFieldRequired('datatype',1); jQuery('#jform_datatype').removeAttr('required'); jQuery('#jform_datatype').removeAttr('aria-required'); jQuery('#jform_datatype').removeClass('required'); - jform_vvvvwbovxo_required = true; + jform_vvvvwbsvxq_required = true; } jQuery('#jform_null_switch').closest('.control-group').hide(); // remove required attribute from null_switch field - if (!jform_vvvvwbovxp_required) + if (!jform_vvvvwbsvxr_required) { updateFieldRequired('null_switch',1); jQuery('#jform_null_switch').removeAttr('required'); jQuery('#jform_null_switch').removeAttr('aria-required'); jQuery('#jform_null_switch').removeClass('required'); - jform_vvvvwbovxp_required = true; + jform_vvvvwbsvxr_required = true; } } } diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index 6937a7a24..70dc34927 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -9,112 +9,112 @@ */ // Some Global Values -jform_vvvvwbzvyb_required = false; -jform_vvvvwcavyc_required = false; -jform_vvvvwcbvyd_required = false; -jform_vvvvwccvye_required = false; -jform_vvvvwcevyf_required = false; +jform_vvvvwcdvyd_required = false; +jform_vvvvwcevye_required = false; +jform_vvvvwcfvyf_required = false; +jform_vvvvwcgvyg_required = false; +jform_vvvvwcivyh_required = false; // Initial Script jQuery(document).ready(function() { - var location_vvvvwbz = jQuery("#jform_location input[type='radio']:checked").val(); - vvvvwbz(location_vvvvwbz); + var location_vvvvwcd = jQuery("#jform_location input[type='radio']:checked").val(); + vvvvwcd(location_vvvvwcd); - var location_vvvvwca = jQuery("#jform_location input[type='radio']:checked").val(); - vvvvwca(location_vvvvwca); + var location_vvvvwce = jQuery("#jform_location input[type='radio']:checked").val(); + vvvvwce(location_vvvvwce); - var type_vvvvwcb = jQuery("#jform_type").val(); - vvvvwcb(type_vvvvwcb); + var type_vvvvwcf = jQuery("#jform_type").val(); + vvvvwcf(type_vvvvwcf); - var type_vvvvwcc = jQuery("#jform_type").val(); - vvvvwcc(type_vvvvwcc); + var type_vvvvwcg = jQuery("#jform_type").val(); + vvvvwcg(type_vvvvwcg); - var type_vvvvwcd = jQuery("#jform_type").val(); - vvvvwcd(type_vvvvwcd); + var type_vvvvwch = jQuery("#jform_type").val(); + vvvvwch(type_vvvvwch); - var target_vvvvwce = jQuery("#jform_target input[type='radio']:checked").val(); - vvvvwce(target_vvvvwce); + var target_vvvvwci = jQuery("#jform_target input[type='radio']:checked").val(); + vvvvwci(target_vvvvwci); }); -// the vvvvwbz function -function vvvvwbz(location_vvvvwbz) +// the vvvvwcd function +function vvvvwcd(location_vvvvwcd) { // set the function logic - if (location_vvvvwbz == 1) + if (location_vvvvwcd == 1) { jQuery('#jform_admin_view').closest('.control-group').show(); // add required attribute to admin_view field - if (jform_vvvvwbzvyb_required) + if (jform_vvvvwcdvyd_required) { updateFieldRequired('admin_view',0); jQuery('#jform_admin_view').prop('required','required'); jQuery('#jform_admin_view').attr('aria-required',true); jQuery('#jform_admin_view').addClass('required'); - jform_vvvvwbzvyb_required = false; + jform_vvvvwcdvyd_required = false; } } else { jQuery('#jform_admin_view').closest('.control-group').hide(); // remove required attribute from admin_view field - if (!jform_vvvvwbzvyb_required) + if (!jform_vvvvwcdvyd_required) { updateFieldRequired('admin_view',1); jQuery('#jform_admin_view').removeAttr('required'); jQuery('#jform_admin_view').removeAttr('aria-required'); jQuery('#jform_admin_view').removeClass('required'); - jform_vvvvwbzvyb_required = true; + jform_vvvvwcdvyd_required = true; } } } -// the vvvvwca function -function vvvvwca(location_vvvvwca) +// the vvvvwce function +function vvvvwce(location_vvvvwce) { // set the function logic - if (location_vvvvwca == 2) + if (location_vvvvwce == 2) { jQuery('#jform_site_view').closest('.control-group').show(); // add required attribute to site_view field - if (jform_vvvvwcavyc_required) + if (jform_vvvvwcevye_required) { updateFieldRequired('site_view',0); jQuery('#jform_site_view').prop('required','required'); jQuery('#jform_site_view').attr('aria-required',true); jQuery('#jform_site_view').addClass('required'); - jform_vvvvwcavyc_required = false; + jform_vvvvwcevye_required = false; } } else { jQuery('#jform_site_view').closest('.control-group').hide(); // remove required attribute from site_view field - if (!jform_vvvvwcavyc_required) + if (!jform_vvvvwcevye_required) { updateFieldRequired('site_view',1); jQuery('#jform_site_view').removeAttr('required'); jQuery('#jform_site_view').removeAttr('aria-required'); jQuery('#jform_site_view').removeClass('required'); - jform_vvvvwcavyc_required = true; + jform_vvvvwcevye_required = true; } } } -// the vvvvwcb function -function vvvvwcb(type_vvvvwcb) +// the vvvvwcf function +function vvvvwcf(type_vvvvwcf) { - if (isSet(type_vvvvwcb) && type_vvvvwcb.constructor !== Array) + if (isSet(type_vvvvwcf) && type_vvvvwcf.constructor !== Array) { - var temp_vvvvwcb = type_vvvvwcb; - var type_vvvvwcb = []; - type_vvvvwcb.push(temp_vvvvwcb); + var temp_vvvvwcf = type_vvvvwcf; + var type_vvvvwcf = []; + type_vvvvwcf.push(temp_vvvvwcf); } - else if (!isSet(type_vvvvwcb)) + else if (!isSet(type_vvvvwcf)) { - var type_vvvvwcb = []; + var type_vvvvwcf = []; } - var type = type_vvvvwcb.some(type_vvvvwcb_SomeFunc); + var type = type_vvvvwcf.some(type_vvvvwcf_SomeFunc); // set this function logic @@ -122,55 +122,55 @@ function vvvvwcb(type_vvvvwcb) { jQuery('#jform_url').closest('.control-group').show(); // add required attribute to url field - if (jform_vvvvwcbvyd_required) + if (jform_vvvvwcfvyf_required) { updateFieldRequired('url',0); jQuery('#jform_url').prop('required','required'); jQuery('#jform_url').attr('aria-required',true); jQuery('#jform_url').addClass('required'); - jform_vvvvwcbvyd_required = false; + jform_vvvvwcfvyf_required = false; } } else { jQuery('#jform_url').closest('.control-group').hide(); // remove required attribute from url field - if (!jform_vvvvwcbvyd_required) + if (!jform_vvvvwcfvyf_required) { updateFieldRequired('url',1); jQuery('#jform_url').removeAttr('required'); jQuery('#jform_url').removeAttr('aria-required'); jQuery('#jform_url').removeClass('required'); - jform_vvvvwcbvyd_required = true; + jform_vvvvwcfvyf_required = true; } } } -// the vvvvwcb Some function -function type_vvvvwcb_SomeFunc(type_vvvvwcb) +// the vvvvwcf Some function +function type_vvvvwcf_SomeFunc(type_vvvvwcf) { // set the function logic - if (type_vvvvwcb == 3) + if (type_vvvvwcf == 3) { return true; } return false; } -// the vvvvwcc function -function vvvvwcc(type_vvvvwcc) +// the vvvvwcg function +function vvvvwcg(type_vvvvwcg) { - if (isSet(type_vvvvwcc) && type_vvvvwcc.constructor !== Array) + if (isSet(type_vvvvwcg) && type_vvvvwcg.constructor !== Array) { - var temp_vvvvwcc = type_vvvvwcc; - var type_vvvvwcc = []; - type_vvvvwcc.push(temp_vvvvwcc); + var temp_vvvvwcg = type_vvvvwcg; + var type_vvvvwcg = []; + type_vvvvwcg.push(temp_vvvvwcg); } - else if (!isSet(type_vvvvwcc)) + else if (!isSet(type_vvvvwcg)) { - var type_vvvvwcc = []; + var type_vvvvwcg = []; } - var type = type_vvvvwcc.some(type_vvvvwcc_SomeFunc); + var type = type_vvvvwcg.some(type_vvvvwcg_SomeFunc); // set this function logic @@ -178,55 +178,55 @@ function vvvvwcc(type_vvvvwcc) { jQuery('#jform_article').closest('.control-group').show(); // add required attribute to article field - if (jform_vvvvwccvye_required) + if (jform_vvvvwcgvyg_required) { updateFieldRequired('article',0); jQuery('#jform_article').prop('required','required'); jQuery('#jform_article').attr('aria-required',true); jQuery('#jform_article').addClass('required'); - jform_vvvvwccvye_required = false; + jform_vvvvwcgvyg_required = false; } } else { jQuery('#jform_article').closest('.control-group').hide(); // remove required attribute from article field - if (!jform_vvvvwccvye_required) + if (!jform_vvvvwcgvyg_required) { updateFieldRequired('article',1); jQuery('#jform_article').removeAttr('required'); jQuery('#jform_article').removeAttr('aria-required'); jQuery('#jform_article').removeClass('required'); - jform_vvvvwccvye_required = true; + jform_vvvvwcgvyg_required = true; } } } -// the vvvvwcc Some function -function type_vvvvwcc_SomeFunc(type_vvvvwcc) +// the vvvvwcg Some function +function type_vvvvwcg_SomeFunc(type_vvvvwcg) { // set the function logic - if (type_vvvvwcc == 1) + if (type_vvvvwcg == 1) { return true; } return false; } -// the vvvvwcd function -function vvvvwcd(type_vvvvwcd) +// the vvvvwch function +function vvvvwch(type_vvvvwch) { - if (isSet(type_vvvvwcd) && type_vvvvwcd.constructor !== Array) + if (isSet(type_vvvvwch) && type_vvvvwch.constructor !== Array) { - var temp_vvvvwcd = type_vvvvwcd; - var type_vvvvwcd = []; - type_vvvvwcd.push(temp_vvvvwcd); + var temp_vvvvwch = type_vvvvwch; + var type_vvvvwch = []; + type_vvvvwch.push(temp_vvvvwch); } - else if (!isSet(type_vvvvwcd)) + else if (!isSet(type_vvvvwch)) { - var type_vvvvwcd = []; + var type_vvvvwch = []; } - var type = type_vvvvwcd.some(type_vvvvwcd_SomeFunc); + var type = type_vvvvwch.some(type_vvvvwch_SomeFunc); // set this function logic @@ -240,45 +240,45 @@ function vvvvwcd(type_vvvvwcd) } } -// the vvvvwcd Some function -function type_vvvvwcd_SomeFunc(type_vvvvwcd) +// the vvvvwch Some function +function type_vvvvwch_SomeFunc(type_vvvvwch) { // set the function logic - if (type_vvvvwcd == 2) + if (type_vvvvwch == 2) { return true; } return false; } -// the vvvvwce function -function vvvvwce(target_vvvvwce) +// the vvvvwci function +function vvvvwci(target_vvvvwci) { // set the function logic - if (target_vvvvwce == 1) + if (target_vvvvwci == 1) { jQuery('#jform_groups').closest('.control-group').show(); // add required attribute to groups field - if (jform_vvvvwcevyf_required) + if (jform_vvvvwcivyh_required) { updateFieldRequired('groups',0); jQuery('#jform_groups').prop('required','required'); jQuery('#jform_groups').attr('aria-required',true); jQuery('#jform_groups').addClass('required'); - jform_vvvvwcevyf_required = false; + jform_vvvvwcivyh_required = false; } } else { jQuery('#jform_groups').closest('.control-group').hide(); // remove required attribute from groups field - if (!jform_vvvvwcevyf_required) + if (!jform_vvvvwcivyh_required) { updateFieldRequired('groups',1); jQuery('#jform_groups').removeAttr('required'); jQuery('#jform_groups').removeAttr('aria-required'); jQuery('#jform_groups').removeClass('required'); - jform_vvvvwcevyf_required = true; + jform_vvvvwcivyh_required = true; } } } diff --git a/admin/models/forms/joomla_plugin.js b/admin/models/forms/joomla_plugin.js new file mode 100644 index 000000000..fe93ad56b --- /dev/null +++ b/admin/models/forms/joomla_plugin.js @@ -0,0 +1,491 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// Initial Script +jQuery(document).ready(function() +{ + var class_extends_vvvvvxb = jQuery("#jform_class_extends").val(); + var joomla_plugin_group_vvvvvxb = jQuery("#jform_joomla_plugin_group").val(); + vvvvvxb(class_extends_vvvvvxb,joomla_plugin_group_vvvvvxb); + + var joomla_plugin_group_vvvvvxc = jQuery("#jform_joomla_plugin_group").val(); + var class_extends_vvvvvxc = jQuery("#jform_class_extends").val(); + vvvvvxc(joomla_plugin_group_vvvvvxc,class_extends_vvvvvxc); +}); + +// the vvvvvxb function +function vvvvvxb(class_extends_vvvvvxb,joomla_plugin_group_vvvvvxb) +{ + if (isSet(class_extends_vvvvvxb) && class_extends_vvvvvxb.constructor !== Array) + { + var temp_vvvvvxb = class_extends_vvvvvxb; + var class_extends_vvvvvxb = []; + class_extends_vvvvvxb.push(temp_vvvvvxb); + } + else if (!isSet(class_extends_vvvvvxb)) + { + var class_extends_vvvvvxb = []; + } + var class_extends = class_extends_vvvvvxb.some(class_extends_vvvvvxb_SomeFunc); + + if (isSet(joomla_plugin_group_vvvvvxb) && joomla_plugin_group_vvvvvxb.constructor !== Array) + { + var temp_vvvvvxb = joomla_plugin_group_vvvvvxb; + var joomla_plugin_group_vvvvvxb = []; + joomla_plugin_group_vvvvvxb.push(temp_vvvvvxb); + } + else if (!isSet(joomla_plugin_group_vvvvvxb)) + { + var joomla_plugin_group_vvvvvxb = []; + } + var joomla_plugin_group = joomla_plugin_group_vvvvvxb.some(joomla_plugin_group_vvvvvxb_SomeFunc); + + + // set this function logic + if (class_extends && joomla_plugin_group) + { + jQuery('#jform_main_class_code-lbl').closest('.control-group').show(); + jQuery('#jform_method_selection-lbl').closest('.control-group').show(); + jQuery('#jform_property_selection-lbl').closest('.control-group').show(); + } + else + { + jQuery('#jform_main_class_code-lbl').closest('.control-group').hide(); + jQuery('#jform_method_selection-lbl').closest('.control-group').hide(); + jQuery('#jform_property_selection-lbl').closest('.control-group').hide(); + } +} + +// the vvvvvxb Some function +function class_extends_vvvvvxb_SomeFunc(class_extends_vvvvvxb) +{ + // set the function logic + if (isSet(class_extends_vvvvvxb)) + { + return true; + } + return false; +} + +// the vvvvvxb Some function +function joomla_plugin_group_vvvvvxb_SomeFunc(joomla_plugin_group_vvvvvxb) +{ + // set the function logic + if (isSet(joomla_plugin_group_vvvvvxb)) + { + return true; + } + return false; +} + +// the vvvvvxc function +function vvvvvxc(joomla_plugin_group_vvvvvxc,class_extends_vvvvvxc) +{ + if (isSet(joomla_plugin_group_vvvvvxc) && joomla_plugin_group_vvvvvxc.constructor !== Array) + { + var temp_vvvvvxc = joomla_plugin_group_vvvvvxc; + var joomla_plugin_group_vvvvvxc = []; + joomla_plugin_group_vvvvvxc.push(temp_vvvvvxc); + } + else if (!isSet(joomla_plugin_group_vvvvvxc)) + { + var joomla_plugin_group_vvvvvxc = []; + } + var joomla_plugin_group = joomla_plugin_group_vvvvvxc.some(joomla_plugin_group_vvvvvxc_SomeFunc); + + if (isSet(class_extends_vvvvvxc) && class_extends_vvvvvxc.constructor !== Array) + { + var temp_vvvvvxc = class_extends_vvvvvxc; + var class_extends_vvvvvxc = []; + class_extends_vvvvvxc.push(temp_vvvvvxc); + } + else if (!isSet(class_extends_vvvvvxc)) + { + var class_extends_vvvvvxc = []; + } + var class_extends = class_extends_vvvvvxc.some(class_extends_vvvvvxc_SomeFunc); + + + // set this function logic + if (joomla_plugin_group && class_extends) + { + jQuery('#jform_main_class_code-lbl').closest('.control-group').show(); + jQuery('#jform_method_selection-lbl').closest('.control-group').show(); + jQuery('#jform_property_selection-lbl').closest('.control-group').show(); + } + else + { + jQuery('#jform_main_class_code-lbl').closest('.control-group').hide(); + jQuery('#jform_method_selection-lbl').closest('.control-group').hide(); + jQuery('#jform_property_selection-lbl').closest('.control-group').hide(); + } +} + +// the vvvvvxc Some function +function joomla_plugin_group_vvvvvxc_SomeFunc(joomla_plugin_group_vvvvvxc) +{ + // set the function logic + if (isSet(joomla_plugin_group_vvvvvxc)) + { + return true; + } + return false; +} + +// the vvvvvxc Some function +function class_extends_vvvvvxc_SomeFunc(class_extends_vvvvvxc) +{ + // set the function logic + if (isSet(class_extends_vvvvvxc)) + { + return true; + } + return false; +} + +// the isSet function +function isSet(val) +{ + if ((val != undefined) && (val != null) && 0 !== val.length){ + return true; + } + return false; +} + + +jQuery(document).ready(function() +{ + // load the active array values + buildSelectionArray('property'); + buildSelectionArray('method'); + // set joomla_plugin_group Array + selectionArray['joomla_plugin_group'] = {}; + jQuery("#jform_joomla_plugin_group option").each(function() { + var key = jQuery(this).val(); + var text = jQuery(this).text(); + selectionArray['joomla_plugin_group'][key] = text; + }); + // load the active selection array values + getClassCodeIds('joomla_plugin_group', 'jform_class_extends', false); + getClassCodeIds('property', 'jform_joomla_plugin_group', false); + getClassCodeIds('method', 'jform_joomla_plugin_group', false); + // load the used in div + // jQuery('#usedin').show(); + // check and load all the customcode edit buttons + // setTimeout(getEditCustomCodeButtons, 300); + + rowWatcher(); +}); + +function getClassStuff_server(id, type, callingName){ + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax."+callingName+"&format=json&raw=true"); + if(token.length > 0 && id > 0 && type.length > 0){ + var request = token+'=1&type=' + type + '&id=' + id; + } + return jQuery.ajax({ + type: 'GET', + url: getUrl, + dataType: 'json', + data: request, + jsonp: false + }); +} + +function getClassCodeIds(type, target_field, reset_all){ + // now get the value + var value = jQuery('#'+target_field).val(); + // now get the code + getClassStuff_server(value, type, 'getClassCodeIds').done(function(result) { + if(result){ + // reset the selection + selectionActiveArray[type] = {}; + // update the active array + jQuery.each( result, function(i, prop) { + selectionActiveArray[type][prop] = selectionArray[type][prop]; + }); + // update the active field selection + updateActiveFieldSelection(type, reset_all); + } + }); +} + +function updateActiveFieldSelection(type, reset_all){ + // update the selection options + if ('joomla_plugin_group' === type) { + // get value if not going to reset all + if (!reset_all){ + // get the active values + var activeValue = jQuery("#jform_"+type+" option:selected").val(); + var activeText = jQuery("#jform_"+type+" option:selected").text(); + // clear the options out + jQuery("#jform_"+type).find('option').remove().end(); + // add the active selection back (must be what is available) + jQuery("#jform_"+type).append(''); + // now add the lists back + jQuery.each( selectionActiveArray[type], function(aValue, aText ) { + if (activeValue !== aValue) { + jQuery("#jform_"+type).append(''); + } + }); + jQuery("#jform_"+type).val(activeValue); + } else { + // clear the options out + jQuery("#jform_"+type).find('option').remove().end(); + // now add the lists back + jQuery.each( selectionActiveArray[type], function(aValue, aText ) { + jQuery("#jform_"+type).append(''); + }); + jQuery("#jform_"+type).val(''); + } + jQuery("#jform_"+type).trigger('liszt:updated'); + // reset all when global update is made + if (reset_all) { + resetAll('method'); + resetAll('property'); + } + } else { + selectionDynamicUpdate(type); + // reset all when global update is made + if (reset_all) { + resetAll(type); + } + } +} + +function resetAll(type) { + var i; + for (i = 0; i < 10; i++) { + // build ID + var id_check = 'jform_'+type+'_selection'+'__'+type+'_selection'+i+'__'+type; + // first check if Id is on page as that not the same as the one currently calling + if (jQuery("#"+id_check).length) { + if (i == 0) { + jQuery('#'+id_check).val(''); + jQuery('#'+id_check).trigger('liszt:updated'); + } else { + // remove the row + jQuery('#'+id_check).closest('tr').remove(); + } + } + } + Joomla.editors.instances['jform_main_class_code'].setValue(''); +} + +function getClassCode(field, type){ + // get the ID + var id = jQuery(field).attr('id'); + // now get the value + var value = jQuery('#' + id).val(); + if (propertyIsSet(value, id, type)) { + // reset the selection + jQuery('#'+id).val(''); + jQuery('#'+id).trigger("liszt:updated"); + // give out a notice + jQuery.UIkit.notify({message: Joomla.JText._('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER'), timeout: 5000, status: 'warning', pos: 'top-center'}); + } else { + // set the active removed value + selectedIdRemoved[type] = value; + // do a dynamic update (to remove what was already used) + selectionDynamicUpdate(type); + // now get the code + getClassStuff_server(value, type, 'getClassCode').done(function(result) { + if(result){ + if (Joomla.editors.instances.hasOwnProperty("jform_main_class_code")) { + var old_result = Joomla.editors.instances['jform_main_class_code'].getValue(); + if (old_result.length > 0) { + // make sure not to load the same string twice + if (old_result.indexOf(result) !== -1) { + // reset the selection + jQuery('#'+id).val(''); + jQuery('#'+id).trigger("liszt:updated"); + // give out a notice + jQuery.UIkit.notify({message: Joomla.JText._('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER'), timeout: 5000, status: 'warning', pos: 'top-center'}); + } else { + Joomla.editors.instances['jform_main_class_code'].setValue(old_result + "\n\n" + result); + } + } else { + Joomla.editors.instances['jform_main_class_code'].setValue(result); + } + } else { + var old_result = jQuery('textarea#jform_main_class_code').val(); + if (old_result.length > 0) { + // make sure not to load the same string twice + if (old_result.indexOf(result) !== -1) { + // reset the selection + jQuery('#'+id).val(''); + jQuery('#'+id).trigger("liszt:updated"); + // give out a notice + jQuery.UIkit.notify({message: Joomla.JText._('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER'), timeout: 5000, status: 'warning', pos: 'top-center'}); + } else { + jQuery('textarea#jform_main_class_code').val(old_result + "\n\n" + result); + } + } else { + jQuery('textarea#jform_main_class_code').val(result); + } + } + } + }); + } +} + +// set selection the options +selectionArray = {'property':{},'method':{}}; +selectionActiveArray = {'property':{},'method':{}}; +selectedIdRemoved = {'property':'not','method':'not'}; +justonce = {'property':1,'method':1}; + +function buildSelectionArray(type) { + var i; + for (i = 0; i < 10; i++) { + // build ID + var id_check = 'jform_'+type+'_selection'+'__'+type+'_selection'+i+'__'+type; + // first check if Id is on page as that not the same as the one currently calling + if (justonce[type] == 1 && jQuery("#"+id_check).length) { + // set buckets + jQuery("#"+id_check+" option").each(function() { + var key = jQuery(this).val(); + var text = jQuery(this).text(); + selectionArray[type][key] = text; + }); + justonce[type]++; + } + } +} + +function selectionDynamicUpdate(type) { + selectionAvailable = {}; + selectionSelectedArray = {}; + selectionTrackerArray = {}; + var i; + for (i = 0; i < 70; i++) { // for now this is the number of field we should check + // build ID + var id_check = 'jform_'+type+'_selection'+'__'+type+'_selection'+i+'__'+type; + // first check if Id is on page as that not the same as the one currently calling + if (jQuery("#"+id_check).length && selectedIdRemoved[type] !== id_check) { + // build the selected array + var key = jQuery("#"+id_check+" option:selected").val(); + var text = jQuery("#"+id_check+" option:selected").text(); + selectionSelectedArray[key] = text; + // keep track of the value set + selectionTrackerArray[id_check] = key; + // clear the options out + jQuery("#"+id_check).find('option').remove().end(); + } + } + // trigger chosen on the list fields + // jQuery('.'+type+'_selection_list').chosen({"disable_search_threshold":10,"search_contains":true,"allow_single_deselect":true,"placeholder_text_multiple":Joomla.JText._("COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS"),"placeholder_text_single":Joomla.JText._("COM_COMPONENTBUILDER_SELECT_A_PROPERTY"),"no_results_text":Joomla.JText._("COM_COMPONENTBUILDER_NO_RESULTS_MATCH")}); + // now build the list to keep + jQuery.each( selectionActiveArray[type], function( prop, name ) { + if (!selectionSelectedArray.hasOwnProperty(prop)) { + selectionAvailable[prop] = name; + } + }); + // now add the lists back + jQuery.each( selectionTrackerArray, function( tId, tKey ) { + if (jQuery('#'+tId).length) { + jQuery('#'+tId).append(''); + jQuery.each( selectionAvailable, function( aKey, aValue ) { + jQuery('#'+tId).append(''); + }); + jQuery('#'+tId).val(tKey); + jQuery('#'+tId).trigger('liszt:updated'); + } + }); +} + +function rowWatcher() { + jQuery(document).on('subform-row-remove', function(event, row){ + // we first chck if this is a method call + var valid_call = jQuery(row.innerHTML).find('.method_selection_list').attr('id'); + var type_call = 'method'; + if (!isSet(valid_call)){ + // now lets see if this is a property call + var valid_call = jQuery(row.innerHTML).find('.property_selection_list').attr('id'); + var type_call = 'property'; + } + // so lets update selection if call valid + if (isSet(valid_call)){ + selectedIdRemoved[type_call] = valid_call; + selectionDynamicUpdate(type_call); + } + }); + jQuery(document).on('subform-row-add', function(event, row){ + // we first chck if this is a method call + var valid_call = jQuery(row.innerHTML).find('.method_selection_list').attr('id'); + var type_call = 'method'; + if (!isSet(valid_call)){ + // now lets see if this is a property call + var valid_call = jQuery(row.innerHTML).find('.property_selection_list').attr('id'); + var type_call = 'property'; + } + // so lets update selection if call valid + if (isSet(valid_call)){ + selectedIdRemoved[type_call] = 'not'; + selectionDynamicUpdate(type_call); + } + }); +} + +function propertyIsSet(prop, id, type) { + var i; + for (i = 0; i < 70; i++) { // for now this is the number of field we should check + // build ID + var id_check = 'jform_'+type+'_selection'+'__'+type+'_selection'+i+'__'+type; + // first check if Id is on page as that not the same as the one currently calling + if (jQuery("#"+id_check).length && id_check != id) { + // get the property value + var tmp = jQuery("#"+id_check+" option:selected").val(); + // now validate + if (tmp === prop) { + return true; + } + } + } + return false; +} + +function getEditCustomCodeButtons_server(id){ + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); + if(token.length > 0 && id > 0){ + var request = token+'=1&id='+id+'&return_here='+return_here; + } + return jQuery.ajax({ + type: 'GET', + url: getUrl, + dataType: 'json', + data: request, + jsonp: false + }); +} + +function getEditCustomCodeButtons(){ + // get the id + id = jQuery("#jform_id").val(); + getEditCustomCodeButtons_server(id).done(function(result) { + if(isObject(result)){ + jQuery.each(result, function( field, buttons ) { + jQuery('
').insertBefore(".control-wrapper-"+ field); + jQuery.each(buttons, function( name, button ) { + jQuery(".control-customcode-buttons-"+field).append(button); + }); + }); + } + }) +} + +// check object is not empty +function isObject(obj) { + for(var prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + return true; + } + } + return false; +} diff --git a/admin/models/forms/joomla_plugin.xml b/admin/models/forms/joomla_plugin.xml new file mode 100644 index 000000000..a4734482b --- /dev/null +++ b/admin/models/forms/joomla_plugin.xml @@ -0,0 +1,260 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+ \ No newline at end of file diff --git a/admin/models/forms/joomla_plugin_group.js b/admin/models/forms/joomla_plugin_group.js new file mode 100644 index 000000000..406de38ba --- /dev/null +++ b/admin/models/forms/joomla_plugin_group.js @@ -0,0 +1,11 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + + diff --git a/admin/models/forms/joomla_plugin_group.xml b/admin/models/forms/joomla_plugin_group.xml new file mode 100644 index 000000000..2612c8858 --- /dev/null +++ b/admin/models/forms/joomla_plugin_group.xml @@ -0,0 +1,138 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+
\ No newline at end of file diff --git a/admin/models/forms/layout.js b/admin/models/forms/layout.js index 1996b5f44..f676d5719 100644 --- a/admin/models/forms/layout.js +++ b/admin/models/forms/layout.js @@ -11,15 +11,15 @@ // Initial Script jQuery(document).ready(function() { - var add_php_view_vvvvvzf = jQuery("#jform_add_php_view input[type='radio']:checked").val(); - vvvvvzf(add_php_view_vvvvvzf); + var add_php_view_vvvvvzh = jQuery("#jform_add_php_view input[type='radio']:checked").val(); + vvvvvzh(add_php_view_vvvvvzh); }); -// the vvvvvzf function -function vvvvvzf(add_php_view_vvvvvzf) +// the vvvvvzh function +function vvvvvzh(add_php_view_vvvvvzh) { // set the function logic - if (add_php_view_vvvvvzf == 1) + if (add_php_view_vvvvvzh == 1) { jQuery('#jform_php_view-lbl').closest('.control-group').show(); } diff --git a/admin/models/forms/library.js b/admin/models/forms/library.js index 7007280d1..653d0d802 100644 --- a/admin/models/forms/library.js +++ b/admin/models/forms/library.js @@ -9,24 +9,12 @@ */ // Some Global Values -jform_vvvvwamvxd_required = false; -jform_vvvvwasvxe_required = false; +jform_vvvvwaqvxf_required = false; +jform_vvvvwawvxg_required = false; // Initial Script jQuery(document).ready(function() { - var how_vvvvwal = jQuery("#jform_how").val(); - vvvvwal(how_vvvvwal); - - var how_vvvvwam = jQuery("#jform_how").val(); - vvvvwam(how_vvvvwam); - - var how_vvvvwan = jQuery("#jform_how").val(); - vvvvwan(how_vvvvwan); - - var how_vvvvwao = jQuery("#jform_how").val(); - vvvvwao(how_vvvvwao); - var how_vvvvwap = jQuery("#jform_how").val(); vvvvwap(how_vvvvwap); @@ -36,180 +24,22 @@ jQuery(document).ready(function() var how_vvvvwar = jQuery("#jform_how").val(); vvvvwar(how_vvvvwar); - var type_vvvvwas = jQuery("#jform_type input[type='radio']:checked").val(); - vvvvwas(type_vvvvwas); + var how_vvvvwas = jQuery("#jform_how").val(); + vvvvwas(how_vvvvwas); + + var how_vvvvwat = jQuery("#jform_how").val(); + vvvvwat(how_vvvvwat); + + var how_vvvvwau = jQuery("#jform_how").val(); + vvvvwau(how_vvvvwau); + + var how_vvvvwav = jQuery("#jform_how").val(); + vvvvwav(how_vvvvwav); + + var type_vvvvwaw = jQuery("#jform_type input[type='radio']:checked").val(); + vvvvwaw(type_vvvvwaw); }); -// the vvvvwal function -function vvvvwal(how_vvvvwal) -{ - if (isSet(how_vvvvwal) && how_vvvvwal.constructor !== Array) - { - var temp_vvvvwal = how_vvvvwal; - var how_vvvvwal = []; - how_vvvvwal.push(temp_vvvvwal); - } - else if (!isSet(how_vvvvwal)) - { - var how_vvvvwal = []; - } - var how = how_vvvvwal.some(how_vvvvwal_SomeFunc); - - - // set this function logic - if (how) - { - jQuery('#jform_addconditions-lbl').closest('.control-group').show(); - } - else - { - jQuery('#jform_addconditions-lbl').closest('.control-group').hide(); - } -} - -// the vvvvwal Some function -function how_vvvvwal_SomeFunc(how_vvvvwal) -{ - // set the function logic - if (how_vvvvwal == 2) - { - return true; - } - return false; -} - -// the vvvvwam function -function vvvvwam(how_vvvvwam) -{ - if (isSet(how_vvvvwam) && how_vvvvwam.constructor !== Array) - { - var temp_vvvvwam = how_vvvvwam; - var how_vvvvwam = []; - how_vvvvwam.push(temp_vvvvwam); - } - else if (!isSet(how_vvvvwam)) - { - var how_vvvvwam = []; - } - var how = how_vvvvwam.some(how_vvvvwam_SomeFunc); - - - // set this function logic - if (how) - { - jQuery('#jform_php_setdocument').closest('.control-group').show(); - // add required attribute to php_setdocument field - if (jform_vvvvwamvxd_required) - { - updateFieldRequired('php_setdocument',0); - jQuery('#jform_php_setdocument').prop('required','required'); - jQuery('#jform_php_setdocument').attr('aria-required',true); - jQuery('#jform_php_setdocument').addClass('required'); - jform_vvvvwamvxd_required = false; - } - } - else - { - jQuery('#jform_php_setdocument').closest('.control-group').hide(); - // remove required attribute from php_setdocument field - if (!jform_vvvvwamvxd_required) - { - updateFieldRequired('php_setdocument',1); - jQuery('#jform_php_setdocument').removeAttr('required'); - jQuery('#jform_php_setdocument').removeAttr('aria-required'); - jQuery('#jform_php_setdocument').removeClass('required'); - jform_vvvvwamvxd_required = true; - } - } -} - -// the vvvvwam Some function -function how_vvvvwam_SomeFunc(how_vvvvwam) -{ - // set the function logic - if (how_vvvvwam == 3) - { - return true; - } - return false; -} - -// the vvvvwan function -function vvvvwan(how_vvvvwan) -{ - if (isSet(how_vvvvwan) && how_vvvvwan.constructor !== Array) - { - var temp_vvvvwan = how_vvvvwan; - var how_vvvvwan = []; - how_vvvvwan.push(temp_vvvvwan); - } - else if (!isSet(how_vvvvwan)) - { - var how_vvvvwan = []; - } - var how = how_vvvvwan.some(how_vvvvwan_SomeFunc); - - - // set this function logic - if (how) - { - jQuery('.note_display_library_config').closest('.control-group').show(); - } - else - { - jQuery('.note_display_library_config').closest('.control-group').hide(); - } -} - -// the vvvvwan Some function -function how_vvvvwan_SomeFunc(how_vvvvwan) -{ - // set the function logic - if (how_vvvvwan == 2 || how_vvvvwan == 3) - { - return true; - } - return false; -} - -// the vvvvwao function -function vvvvwao(how_vvvvwao) -{ - if (isSet(how_vvvvwao) && how_vvvvwao.constructor !== Array) - { - var temp_vvvvwao = how_vvvvwao; - var how_vvvvwao = []; - how_vvvvwao.push(temp_vvvvwao); - } - else if (!isSet(how_vvvvwao)) - { - var how_vvvvwao = []; - } - var how = how_vvvvwao.some(how_vvvvwao_SomeFunc); - - - // set this function logic - if (how) - { - jQuery('.note_display_library_files_folders_urls').closest('.control-group').show(); - } - else - { - jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide(); - } -} - -// the vvvvwao Some function -function how_vvvvwao_SomeFunc(how_vvvvwao) -{ - // set the function logic - if (how_vvvvwao == 1 || how_vvvvwao == 2 || how_vvvvwao == 3) - { - return true; - } - return false; -} - // the vvvvwap function function vvvvwap(how_vvvvwap) { @@ -229,15 +59,11 @@ function vvvvwap(how_vvvvwap) // set this function logic if (how) { - jQuery('.note_no_behaviour_one').closest('.control-group').show(); - jQuery('.note_no_behaviour_three').closest('.control-group').show(); - jQuery('.note_no_behaviour_two').closest('.control-group').show(); + jQuery('#jform_addconditions-lbl').closest('.control-group').show(); } else { - jQuery('.note_no_behaviour_one').closest('.control-group').hide(); - jQuery('.note_no_behaviour_three').closest('.control-group').hide(); - jQuery('.note_no_behaviour_two').closest('.control-group').hide(); + jQuery('#jform_addconditions-lbl').closest('.control-group').hide(); } } @@ -245,7 +71,7 @@ function vvvvwap(how_vvvvwap) function how_vvvvwap_SomeFunc(how_vvvvwap) { // set the function logic - if (how_vvvvwap == 0) + if (how_vvvvwap == 2) { return true; } @@ -271,13 +97,29 @@ function vvvvwaq(how_vvvvwaq) // set this function logic if (how) { - jQuery('.note_yes_behaviour_one').closest('.control-group').show(); - jQuery('.note_yes_behaviour_two').closest('.control-group').show(); + jQuery('#jform_php_setdocument').closest('.control-group').show(); + // add required attribute to php_setdocument field + if (jform_vvvvwaqvxf_required) + { + updateFieldRequired('php_setdocument',0); + jQuery('#jform_php_setdocument').prop('required','required'); + jQuery('#jform_php_setdocument').attr('aria-required',true); + jQuery('#jform_php_setdocument').addClass('required'); + jform_vvvvwaqvxf_required = false; + } } else { - jQuery('.note_yes_behaviour_one').closest('.control-group').hide(); - jQuery('.note_yes_behaviour_two').closest('.control-group').hide(); + jQuery('#jform_php_setdocument').closest('.control-group').hide(); + // remove required attribute from php_setdocument field + if (!jform_vvvvwaqvxf_required) + { + updateFieldRequired('php_setdocument',1); + jQuery('#jform_php_setdocument').removeAttr('required'); + jQuery('#jform_php_setdocument').removeAttr('aria-required'); + jQuery('#jform_php_setdocument').removeClass('required'); + jform_vvvvwaqvxf_required = true; + } } } @@ -285,7 +127,7 @@ function vvvvwaq(how_vvvvwaq) function how_vvvvwaq_SomeFunc(how_vvvvwaq) { // set the function logic - if (how_vvvvwaq == 1) + if (how_vvvvwaq == 3) { return true; } @@ -308,6 +150,164 @@ function vvvvwar(how_vvvvwar) var how = how_vvvvwar.some(how_vvvvwar_SomeFunc); + // set this function logic + if (how) + { + jQuery('.note_display_library_config').closest('.control-group').show(); + } + else + { + jQuery('.note_display_library_config').closest('.control-group').hide(); + } +} + +// the vvvvwar Some function +function how_vvvvwar_SomeFunc(how_vvvvwar) +{ + // set the function logic + if (how_vvvvwar == 2 || how_vvvvwar == 3) + { + return true; + } + return false; +} + +// the vvvvwas function +function vvvvwas(how_vvvvwas) +{ + if (isSet(how_vvvvwas) && how_vvvvwas.constructor !== Array) + { + var temp_vvvvwas = how_vvvvwas; + var how_vvvvwas = []; + how_vvvvwas.push(temp_vvvvwas); + } + else if (!isSet(how_vvvvwas)) + { + var how_vvvvwas = []; + } + var how = how_vvvvwas.some(how_vvvvwas_SomeFunc); + + + // set this function logic + if (how) + { + jQuery('.note_display_library_files_folders_urls').closest('.control-group').show(); + } + else + { + jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide(); + } +} + +// the vvvvwas Some function +function how_vvvvwas_SomeFunc(how_vvvvwas) +{ + // set the function logic + if (how_vvvvwas == 1 || how_vvvvwas == 2 || how_vvvvwas == 3) + { + return true; + } + return false; +} + +// the vvvvwat function +function vvvvwat(how_vvvvwat) +{ + if (isSet(how_vvvvwat) && how_vvvvwat.constructor !== Array) + { + var temp_vvvvwat = how_vvvvwat; + var how_vvvvwat = []; + how_vvvvwat.push(temp_vvvvwat); + } + else if (!isSet(how_vvvvwat)) + { + var how_vvvvwat = []; + } + var how = how_vvvvwat.some(how_vvvvwat_SomeFunc); + + + // set this function logic + if (how) + { + jQuery('.note_no_behaviour_one').closest('.control-group').show(); + jQuery('.note_no_behaviour_three').closest('.control-group').show(); + jQuery('.note_no_behaviour_two').closest('.control-group').show(); + } + else + { + jQuery('.note_no_behaviour_one').closest('.control-group').hide(); + jQuery('.note_no_behaviour_three').closest('.control-group').hide(); + jQuery('.note_no_behaviour_two').closest('.control-group').hide(); + } +} + +// the vvvvwat Some function +function how_vvvvwat_SomeFunc(how_vvvvwat) +{ + // set the function logic + if (how_vvvvwat == 0) + { + return true; + } + return false; +} + +// the vvvvwau function +function vvvvwau(how_vvvvwau) +{ + if (isSet(how_vvvvwau) && how_vvvvwau.constructor !== Array) + { + var temp_vvvvwau = how_vvvvwau; + var how_vvvvwau = []; + how_vvvvwau.push(temp_vvvvwau); + } + else if (!isSet(how_vvvvwau)) + { + var how_vvvvwau = []; + } + var how = how_vvvvwau.some(how_vvvvwau_SomeFunc); + + + // set this function logic + if (how) + { + jQuery('.note_yes_behaviour_one').closest('.control-group').show(); + jQuery('.note_yes_behaviour_two').closest('.control-group').show(); + } + else + { + jQuery('.note_yes_behaviour_one').closest('.control-group').hide(); + jQuery('.note_yes_behaviour_two').closest('.control-group').hide(); + } +} + +// the vvvvwau Some function +function how_vvvvwau_SomeFunc(how_vvvvwau) +{ + // set the function logic + if (how_vvvvwau == 1) + { + return true; + } + return false; +} + +// the vvvvwav function +function vvvvwav(how_vvvvwav) +{ + if (isSet(how_vvvvwav) && how_vvvvwav.constructor !== Array) + { + var temp_vvvvwav = how_vvvvwav; + var how_vvvvwav = []; + how_vvvvwav.push(temp_vvvvwav); + } + else if (!isSet(how_vvvvwav)) + { + var how_vvvvwav = []; + } + var how = how_vvvvwav.some(how_vvvvwav_SomeFunc); + + // set this function logic if (how) { @@ -323,45 +323,45 @@ function vvvvwar(how_vvvvwar) } } -// the vvvvwar Some function -function how_vvvvwar_SomeFunc(how_vvvvwar) +// the vvvvwav Some function +function how_vvvvwav_SomeFunc(how_vvvvwav) { // set the function logic - if (how_vvvvwar == 4) + if (how_vvvvwav == 4) { return true; } return false; } -// the vvvvwas function -function vvvvwas(type_vvvvwas) +// the vvvvwaw function +function vvvvwaw(type_vvvvwaw) { // set the function logic - if (type_vvvvwas == 2) + if (type_vvvvwaw == 2) { jQuery('#jform_libraries').closest('.control-group').show(); // add required attribute to libraries field - if (jform_vvvvwasvxe_required) + if (jform_vvvvwawvxg_required) { updateFieldRequired('libraries',0); jQuery('#jform_libraries').prop('required','required'); jQuery('#jform_libraries').attr('aria-required',true); jQuery('#jform_libraries').addClass('required'); - jform_vvvvwasvxe_required = false; + jform_vvvvwawvxg_required = false; } } else { jQuery('#jform_libraries').closest('.control-group').hide(); // remove required attribute from libraries field - if (!jform_vvvvwasvxe_required) + if (!jform_vvvvwawvxg_required) { updateFieldRequired('libraries',1); jQuery('#jform_libraries').removeAttr('required'); jQuery('#jform_libraries').removeAttr('aria-required'); jQuery('#jform_libraries').removeClass('required'); - jform_vvvvwasvxe_required = true; + jform_vvvvwawvxg_required = true; } } } diff --git a/admin/models/forms/server.js b/admin/models/forms/server.js index 6483e214f..a85edeee0 100644 --- a/admin/models/forms/server.js +++ b/admin/models/forms/server.js @@ -9,32 +9,24 @@ */ // Some Global Values -jform_vvvvwbpvxr_required = false; -jform_vvvvwbpvxs_required = false; -jform_vvvvwbpvxt_required = false; -jform_vvvvwbpvxu_required = false; -jform_vvvvwbpvxv_required = false; -jform_vvvvwbqvxw_required = false; -jform_vvvvwbrvxx_required = false; -jform_vvvvwbtvxy_required = false; +jform_vvvvwbtvxt_required = false; +jform_vvvvwbtvxu_required = false; +jform_vvvvwbtvxv_required = false; +jform_vvvvwbtvxw_required = false; +jform_vvvvwbtvxx_required = false; +jform_vvvvwbuvxy_required = false; jform_vvvvwbvvxz_required = false; +jform_vvvvwbxvya_required = false; +jform_vvvvwbzvyb_required = false; // Initial Script jQuery(document).ready(function() { - var protocol_vvvvwbp = jQuery("#jform_protocol").val(); - vvvvwbp(protocol_vvvvwbp); - - var protocol_vvvvwbq = jQuery("#jform_protocol").val(); - vvvvwbq(protocol_vvvvwbq); - - var protocol_vvvvwbr = jQuery("#jform_protocol").val(); - var authentication_vvvvwbr = jQuery("#jform_authentication").val(); - vvvvwbr(protocol_vvvvwbr,authentication_vvvvwbr); - var protocol_vvvvwbt = jQuery("#jform_protocol").val(); - var authentication_vvvvwbt = jQuery("#jform_authentication").val(); - vvvvwbt(protocol_vvvvwbt,authentication_vvvvwbt); + vvvvwbt(protocol_vvvvwbt); + + var protocol_vvvvwbu = jQuery("#jform_protocol").val(); + vvvvwbu(protocol_vvvvwbu); var protocol_vvvvwbv = jQuery("#jform_protocol").val(); var authentication_vvvvwbv = jQuery("#jform_authentication").val(); @@ -43,285 +35,18 @@ jQuery(document).ready(function() var protocol_vvvvwbx = jQuery("#jform_protocol").val(); var authentication_vvvvwbx = jQuery("#jform_authentication").val(); vvvvwbx(protocol_vvvvwbx,authentication_vvvvwbx); + + var protocol_vvvvwbz = jQuery("#jform_protocol").val(); + var authentication_vvvvwbz = jQuery("#jform_authentication").val(); + vvvvwbz(protocol_vvvvwbz,authentication_vvvvwbz); + + var protocol_vvvvwcb = jQuery("#jform_protocol").val(); + var authentication_vvvvwcb = jQuery("#jform_authentication").val(); + vvvvwcb(protocol_vvvvwcb,authentication_vvvvwcb); }); -// the vvvvwbp function -function vvvvwbp(protocol_vvvvwbp) -{ - if (isSet(protocol_vvvvwbp) && protocol_vvvvwbp.constructor !== Array) - { - var temp_vvvvwbp = protocol_vvvvwbp; - var protocol_vvvvwbp = []; - protocol_vvvvwbp.push(temp_vvvvwbp); - } - else if (!isSet(protocol_vvvvwbp)) - { - var protocol_vvvvwbp = []; - } - var protocol = protocol_vvvvwbp.some(protocol_vvvvwbp_SomeFunc); - - - // set this function logic - if (protocol) - { - jQuery('#jform_authentication').closest('.control-group').show(); - // add required attribute to authentication field - if (jform_vvvvwbpvxr_required) - { - updateFieldRequired('authentication',0); - jQuery('#jform_authentication').prop('required','required'); - jQuery('#jform_authentication').attr('aria-required',true); - jQuery('#jform_authentication').addClass('required'); - jform_vvvvwbpvxr_required = false; - } - jQuery('#jform_host').closest('.control-group').show(); - // add required attribute to host field - if (jform_vvvvwbpvxs_required) - { - updateFieldRequired('host',0); - jQuery('#jform_host').prop('required','required'); - jQuery('#jform_host').attr('aria-required',true); - jQuery('#jform_host').addClass('required'); - jform_vvvvwbpvxs_required = false; - } - jQuery('#jform_port').closest('.control-group').show(); - // add required attribute to port field - if (jform_vvvvwbpvxt_required) - { - updateFieldRequired('port',0); - jQuery('#jform_port').prop('required','required'); - jQuery('#jform_port').attr('aria-required',true); - jQuery('#jform_port').addClass('required'); - jform_vvvvwbpvxt_required = false; - } - jQuery('#jform_path').closest('.control-group').show(); - // add required attribute to path field - if (jform_vvvvwbpvxu_required) - { - updateFieldRequired('path',0); - jQuery('#jform_path').prop('required','required'); - jQuery('#jform_path').attr('aria-required',true); - jQuery('#jform_path').addClass('required'); - jform_vvvvwbpvxu_required = false; - } - jQuery('.note_ssh_security').closest('.control-group').show(); - jQuery('#jform_username').closest('.control-group').show(); - // add required attribute to username field - if (jform_vvvvwbpvxv_required) - { - updateFieldRequired('username',0); - jQuery('#jform_username').prop('required','required'); - jQuery('#jform_username').attr('aria-required',true); - jQuery('#jform_username').addClass('required'); - jform_vvvvwbpvxv_required = false; - } - } - else - { - jQuery('#jform_authentication').closest('.control-group').hide(); - // remove required attribute from authentication field - if (!jform_vvvvwbpvxr_required) - { - updateFieldRequired('authentication',1); - jQuery('#jform_authentication').removeAttr('required'); - jQuery('#jform_authentication').removeAttr('aria-required'); - jQuery('#jform_authentication').removeClass('required'); - jform_vvvvwbpvxr_required = true; - } - jQuery('#jform_host').closest('.control-group').hide(); - // remove required attribute from host field - if (!jform_vvvvwbpvxs_required) - { - updateFieldRequired('host',1); - jQuery('#jform_host').removeAttr('required'); - jQuery('#jform_host').removeAttr('aria-required'); - jQuery('#jform_host').removeClass('required'); - jform_vvvvwbpvxs_required = true; - } - jQuery('#jform_port').closest('.control-group').hide(); - // remove required attribute from port field - if (!jform_vvvvwbpvxt_required) - { - updateFieldRequired('port',1); - jQuery('#jform_port').removeAttr('required'); - jQuery('#jform_port').removeAttr('aria-required'); - jQuery('#jform_port').removeClass('required'); - jform_vvvvwbpvxt_required = true; - } - jQuery('#jform_path').closest('.control-group').hide(); - // remove required attribute from path field - if (!jform_vvvvwbpvxu_required) - { - updateFieldRequired('path',1); - jQuery('#jform_path').removeAttr('required'); - jQuery('#jform_path').removeAttr('aria-required'); - jQuery('#jform_path').removeClass('required'); - jform_vvvvwbpvxu_required = true; - } - jQuery('.note_ssh_security').closest('.control-group').hide(); - jQuery('#jform_username').closest('.control-group').hide(); - // remove required attribute from username field - if (!jform_vvvvwbpvxv_required) - { - updateFieldRequired('username',1); - jQuery('#jform_username').removeAttr('required'); - jQuery('#jform_username').removeAttr('aria-required'); - jQuery('#jform_username').removeClass('required'); - jform_vvvvwbpvxv_required = true; - } - } -} - -// the vvvvwbp Some function -function protocol_vvvvwbp_SomeFunc(protocol_vvvvwbp) -{ - // set the function logic - if (protocol_vvvvwbp == 2) - { - return true; - } - return false; -} - -// the vvvvwbq function -function vvvvwbq(protocol_vvvvwbq) -{ - if (isSet(protocol_vvvvwbq) && protocol_vvvvwbq.constructor !== Array) - { - var temp_vvvvwbq = protocol_vvvvwbq; - var protocol_vvvvwbq = []; - protocol_vvvvwbq.push(temp_vvvvwbq); - } - else if (!isSet(protocol_vvvvwbq)) - { - var protocol_vvvvwbq = []; - } - var protocol = protocol_vvvvwbq.some(protocol_vvvvwbq_SomeFunc); - - - // set this function logic - if (protocol) - { - jQuery('.note_ftp_signature').closest('.control-group').show(); - jQuery('#jform_signature').closest('.control-group').show(); - // add required attribute to signature field - if (jform_vvvvwbqvxw_required) - { - updateFieldRequired('signature',0); - jQuery('#jform_signature').prop('required','required'); - jQuery('#jform_signature').attr('aria-required',true); - jQuery('#jform_signature').addClass('required'); - jform_vvvvwbqvxw_required = false; - } - } - else - { - jQuery('.note_ftp_signature').closest('.control-group').hide(); - jQuery('#jform_signature').closest('.control-group').hide(); - // remove required attribute from signature field - if (!jform_vvvvwbqvxw_required) - { - updateFieldRequired('signature',1); - jQuery('#jform_signature').removeAttr('required'); - jQuery('#jform_signature').removeAttr('aria-required'); - jQuery('#jform_signature').removeClass('required'); - jform_vvvvwbqvxw_required = true; - } - } -} - -// the vvvvwbq Some function -function protocol_vvvvwbq_SomeFunc(protocol_vvvvwbq) -{ - // set the function logic - if (protocol_vvvvwbq == 1) - { - return true; - } - return false; -} - -// the vvvvwbr function -function vvvvwbr(protocol_vvvvwbr,authentication_vvvvwbr) -{ - if (isSet(protocol_vvvvwbr) && protocol_vvvvwbr.constructor !== Array) - { - var temp_vvvvwbr = protocol_vvvvwbr; - var protocol_vvvvwbr = []; - protocol_vvvvwbr.push(temp_vvvvwbr); - } - else if (!isSet(protocol_vvvvwbr)) - { - var protocol_vvvvwbr = []; - } - var protocol = protocol_vvvvwbr.some(protocol_vvvvwbr_SomeFunc); - - if (isSet(authentication_vvvvwbr) && authentication_vvvvwbr.constructor !== Array) - { - var temp_vvvvwbr = authentication_vvvvwbr; - var authentication_vvvvwbr = []; - authentication_vvvvwbr.push(temp_vvvvwbr); - } - else if (!isSet(authentication_vvvvwbr)) - { - var authentication_vvvvwbr = []; - } - var authentication = authentication_vvvvwbr.some(authentication_vvvvwbr_SomeFunc); - - - // set this function logic - if (protocol && authentication) - { - jQuery('#jform_password').closest('.control-group').show(); - // add required attribute to password field - if (jform_vvvvwbrvxx_required) - { - updateFieldRequired('password',0); - jQuery('#jform_password').prop('required','required'); - jQuery('#jform_password').attr('aria-required',true); - jQuery('#jform_password').addClass('required'); - jform_vvvvwbrvxx_required = false; - } - } - else - { - jQuery('#jform_password').closest('.control-group').hide(); - // remove required attribute from password field - if (!jform_vvvvwbrvxx_required) - { - updateFieldRequired('password',1); - jQuery('#jform_password').removeAttr('required'); - jQuery('#jform_password').removeAttr('aria-required'); - jQuery('#jform_password').removeClass('required'); - jform_vvvvwbrvxx_required = true; - } - } -} - -// the vvvvwbr Some function -function protocol_vvvvwbr_SomeFunc(protocol_vvvvwbr) -{ - // set the function logic - if (protocol_vvvvwbr == 2) - { - return true; - } - return false; -} - -// the vvvvwbr Some function -function authentication_vvvvwbr_SomeFunc(authentication_vvvvwbr) -{ - // set the function logic - if (authentication_vvvvwbr == 1 || authentication_vvvvwbr == 3 || authentication_vvvvwbr == 5) - { - return true; - } - return false; -} - // the vvvvwbt function -function vvvvwbt(protocol_vvvvwbt,authentication_vvvvwbt) +function vvvvwbt(protocol_vvvvwbt) { if (isSet(protocol_vvvvwbt) && protocol_vvvvwbt.constructor !== Array) { @@ -335,44 +60,114 @@ function vvvvwbt(protocol_vvvvwbt,authentication_vvvvwbt) } var protocol = protocol_vvvvwbt.some(protocol_vvvvwbt_SomeFunc); - if (isSet(authentication_vvvvwbt) && authentication_vvvvwbt.constructor !== Array) - { - var temp_vvvvwbt = authentication_vvvvwbt; - var authentication_vvvvwbt = []; - authentication_vvvvwbt.push(temp_vvvvwbt); - } - else if (!isSet(authentication_vvvvwbt)) - { - var authentication_vvvvwbt = []; - } - var authentication = authentication_vvvvwbt.some(authentication_vvvvwbt_SomeFunc); - // set this function logic - if (protocol && authentication) + if (protocol) { - jQuery('#jform_private').closest('.control-group').show(); - // add required attribute to private field - if (jform_vvvvwbtvxy_required) + jQuery('#jform_authentication').closest('.control-group').show(); + // add required attribute to authentication field + if (jform_vvvvwbtvxt_required) { - updateFieldRequired('private',0); - jQuery('#jform_private').prop('required','required'); - jQuery('#jform_private').attr('aria-required',true); - jQuery('#jform_private').addClass('required'); - jform_vvvvwbtvxy_required = false; + updateFieldRequired('authentication',0); + jQuery('#jform_authentication').prop('required','required'); + jQuery('#jform_authentication').attr('aria-required',true); + jQuery('#jform_authentication').addClass('required'); + jform_vvvvwbtvxt_required = false; + } + jQuery('#jform_host').closest('.control-group').show(); + // add required attribute to host field + if (jform_vvvvwbtvxu_required) + { + updateFieldRequired('host',0); + jQuery('#jform_host').prop('required','required'); + jQuery('#jform_host').attr('aria-required',true); + jQuery('#jform_host').addClass('required'); + jform_vvvvwbtvxu_required = false; + } + jQuery('#jform_port').closest('.control-group').show(); + // add required attribute to port field + if (jform_vvvvwbtvxv_required) + { + updateFieldRequired('port',0); + jQuery('#jform_port').prop('required','required'); + jQuery('#jform_port').attr('aria-required',true); + jQuery('#jform_port').addClass('required'); + jform_vvvvwbtvxv_required = false; + } + jQuery('#jform_path').closest('.control-group').show(); + // add required attribute to path field + if (jform_vvvvwbtvxw_required) + { + updateFieldRequired('path',0); + jQuery('#jform_path').prop('required','required'); + jQuery('#jform_path').attr('aria-required',true); + jQuery('#jform_path').addClass('required'); + jform_vvvvwbtvxw_required = false; + } + jQuery('.note_ssh_security').closest('.control-group').show(); + jQuery('#jform_username').closest('.control-group').show(); + // add required attribute to username field + if (jform_vvvvwbtvxx_required) + { + updateFieldRequired('username',0); + jQuery('#jform_username').prop('required','required'); + jQuery('#jform_username').attr('aria-required',true); + jQuery('#jform_username').addClass('required'); + jform_vvvvwbtvxx_required = false; } } else { - jQuery('#jform_private').closest('.control-group').hide(); - // remove required attribute from private field - if (!jform_vvvvwbtvxy_required) + jQuery('#jform_authentication').closest('.control-group').hide(); + // remove required attribute from authentication field + if (!jform_vvvvwbtvxt_required) { - updateFieldRequired('private',1); - jQuery('#jform_private').removeAttr('required'); - jQuery('#jform_private').removeAttr('aria-required'); - jQuery('#jform_private').removeClass('required'); - jform_vvvvwbtvxy_required = true; + updateFieldRequired('authentication',1); + jQuery('#jform_authentication').removeAttr('required'); + jQuery('#jform_authentication').removeAttr('aria-required'); + jQuery('#jform_authentication').removeClass('required'); + jform_vvvvwbtvxt_required = true; + } + jQuery('#jform_host').closest('.control-group').hide(); + // remove required attribute from host field + if (!jform_vvvvwbtvxu_required) + { + updateFieldRequired('host',1); + jQuery('#jform_host').removeAttr('required'); + jQuery('#jform_host').removeAttr('aria-required'); + jQuery('#jform_host').removeClass('required'); + jform_vvvvwbtvxu_required = true; + } + jQuery('#jform_port').closest('.control-group').hide(); + // remove required attribute from port field + if (!jform_vvvvwbtvxv_required) + { + updateFieldRequired('port',1); + jQuery('#jform_port').removeAttr('required'); + jQuery('#jform_port').removeAttr('aria-required'); + jQuery('#jform_port').removeClass('required'); + jform_vvvvwbtvxv_required = true; + } + jQuery('#jform_path').closest('.control-group').hide(); + // remove required attribute from path field + if (!jform_vvvvwbtvxw_required) + { + updateFieldRequired('path',1); + jQuery('#jform_path').removeAttr('required'); + jQuery('#jform_path').removeAttr('aria-required'); + jQuery('#jform_path').removeClass('required'); + jform_vvvvwbtvxw_required = true; + } + jQuery('.note_ssh_security').closest('.control-group').hide(); + jQuery('#jform_username').closest('.control-group').hide(); + // remove required attribute from username field + if (!jform_vvvvwbtvxx_required) + { + updateFieldRequired('username',1); + jQuery('#jform_username').removeAttr('required'); + jQuery('#jform_username').removeAttr('aria-required'); + jQuery('#jform_username').removeClass('required'); + jform_vvvvwbtvxx_required = true; } } } @@ -388,11 +183,58 @@ function protocol_vvvvwbt_SomeFunc(protocol_vvvvwbt) return false; } -// the vvvvwbt Some function -function authentication_vvvvwbt_SomeFunc(authentication_vvvvwbt) +// the vvvvwbu function +function vvvvwbu(protocol_vvvvwbu) +{ + if (isSet(protocol_vvvvwbu) && protocol_vvvvwbu.constructor !== Array) + { + var temp_vvvvwbu = protocol_vvvvwbu; + var protocol_vvvvwbu = []; + protocol_vvvvwbu.push(temp_vvvvwbu); + } + else if (!isSet(protocol_vvvvwbu)) + { + var protocol_vvvvwbu = []; + } + var protocol = protocol_vvvvwbu.some(protocol_vvvvwbu_SomeFunc); + + + // set this function logic + if (protocol) + { + jQuery('.note_ftp_signature').closest('.control-group').show(); + jQuery('#jform_signature').closest('.control-group').show(); + // add required attribute to signature field + if (jform_vvvvwbuvxy_required) + { + updateFieldRequired('signature',0); + jQuery('#jform_signature').prop('required','required'); + jQuery('#jform_signature').attr('aria-required',true); + jQuery('#jform_signature').addClass('required'); + jform_vvvvwbuvxy_required = false; + } + } + else + { + jQuery('.note_ftp_signature').closest('.control-group').hide(); + jQuery('#jform_signature').closest('.control-group').hide(); + // remove required attribute from signature field + if (!jform_vvvvwbuvxy_required) + { + updateFieldRequired('signature',1); + jQuery('#jform_signature').removeAttr('required'); + jQuery('#jform_signature').removeAttr('aria-required'); + jQuery('#jform_signature').removeClass('required'); + jform_vvvvwbuvxy_required = true; + } + } +} + +// the vvvvwbu Some function +function protocol_vvvvwbu_SomeFunc(protocol_vvvvwbu) { // set the function logic - if (authentication_vvvvwbt == 2 || authentication_vvvvwbt == 3) + if (protocol_vvvvwbu == 1) { return true; } @@ -430,27 +272,27 @@ function vvvvwbv(protocol_vvvvwbv,authentication_vvvvwbv) // set this function logic if (protocol && authentication) { - jQuery('#jform_private_key').closest('.control-group').show(); - // add required attribute to private_key field + jQuery('#jform_password').closest('.control-group').show(); + // add required attribute to password field if (jform_vvvvwbvvxz_required) { - updateFieldRequired('private_key',0); - jQuery('#jform_private_key').prop('required','required'); - jQuery('#jform_private_key').attr('aria-required',true); - jQuery('#jform_private_key').addClass('required'); + updateFieldRequired('password',0); + jQuery('#jform_password').prop('required','required'); + jQuery('#jform_password').attr('aria-required',true); + jQuery('#jform_password').addClass('required'); jform_vvvvwbvvxz_required = false; } } else { - jQuery('#jform_private_key').closest('.control-group').hide(); - // remove required attribute from private_key field + jQuery('#jform_password').closest('.control-group').hide(); + // remove required attribute from password field if (!jform_vvvvwbvvxz_required) { - updateFieldRequired('private_key',1); - jQuery('#jform_private_key').removeAttr('required'); - jQuery('#jform_private_key').removeAttr('aria-required'); - jQuery('#jform_private_key').removeClass('required'); + updateFieldRequired('password',1); + jQuery('#jform_password').removeAttr('required'); + jQuery('#jform_password').removeAttr('aria-required'); + jQuery('#jform_password').removeClass('required'); jform_vvvvwbvvxz_required = true; } } @@ -471,7 +313,7 @@ function protocol_vvvvwbv_SomeFunc(protocol_vvvvwbv) function authentication_vvvvwbv_SomeFunc(authentication_vvvvwbv) { // set the function logic - if (authentication_vvvvwbv == 4 || authentication_vvvvwbv == 5) + if (authentication_vvvvwbv == 1 || authentication_vvvvwbv == 3 || authentication_vvvvwbv == 5) { return true; } @@ -509,11 +351,29 @@ function vvvvwbx(protocol_vvvvwbx,authentication_vvvvwbx) // set this function logic if (protocol && authentication) { - jQuery('#jform_secret').closest('.control-group').show(); + jQuery('#jform_private').closest('.control-group').show(); + // add required attribute to private field + if (jform_vvvvwbxvya_required) + { + updateFieldRequired('private',0); + jQuery('#jform_private').prop('required','required'); + jQuery('#jform_private').attr('aria-required',true); + jQuery('#jform_private').addClass('required'); + jform_vvvvwbxvya_required = false; + } } else { - jQuery('#jform_secret').closest('.control-group').hide(); + jQuery('#jform_private').closest('.control-group').hide(); + // remove required attribute from private field + if (!jform_vvvvwbxvya_required) + { + updateFieldRequired('private',1); + jQuery('#jform_private').removeAttr('required'); + jQuery('#jform_private').removeAttr('aria-required'); + jQuery('#jform_private').removeClass('required'); + jform_vvvvwbxvya_required = true; + } } } @@ -532,7 +392,147 @@ function protocol_vvvvwbx_SomeFunc(protocol_vvvvwbx) function authentication_vvvvwbx_SomeFunc(authentication_vvvvwbx) { // set the function logic - if (authentication_vvvvwbx == 2 || authentication_vvvvwbx == 3 || authentication_vvvvwbx == 4 || authentication_vvvvwbx == 5) + if (authentication_vvvvwbx == 2 || authentication_vvvvwbx == 3) + { + return true; + } + return false; +} + +// the vvvvwbz function +function vvvvwbz(protocol_vvvvwbz,authentication_vvvvwbz) +{ + if (isSet(protocol_vvvvwbz) && protocol_vvvvwbz.constructor !== Array) + { + var temp_vvvvwbz = protocol_vvvvwbz; + var protocol_vvvvwbz = []; + protocol_vvvvwbz.push(temp_vvvvwbz); + } + else if (!isSet(protocol_vvvvwbz)) + { + var protocol_vvvvwbz = []; + } + var protocol = protocol_vvvvwbz.some(protocol_vvvvwbz_SomeFunc); + + if (isSet(authentication_vvvvwbz) && authentication_vvvvwbz.constructor !== Array) + { + var temp_vvvvwbz = authentication_vvvvwbz; + var authentication_vvvvwbz = []; + authentication_vvvvwbz.push(temp_vvvvwbz); + } + else if (!isSet(authentication_vvvvwbz)) + { + var authentication_vvvvwbz = []; + } + var authentication = authentication_vvvvwbz.some(authentication_vvvvwbz_SomeFunc); + + + // set this function logic + if (protocol && authentication) + { + jQuery('#jform_private_key').closest('.control-group').show(); + // add required attribute to private_key field + if (jform_vvvvwbzvyb_required) + { + updateFieldRequired('private_key',0); + jQuery('#jform_private_key').prop('required','required'); + jQuery('#jform_private_key').attr('aria-required',true); + jQuery('#jform_private_key').addClass('required'); + jform_vvvvwbzvyb_required = false; + } + } + else + { + jQuery('#jform_private_key').closest('.control-group').hide(); + // remove required attribute from private_key field + if (!jform_vvvvwbzvyb_required) + { + updateFieldRequired('private_key',1); + jQuery('#jform_private_key').removeAttr('required'); + jQuery('#jform_private_key').removeAttr('aria-required'); + jQuery('#jform_private_key').removeClass('required'); + jform_vvvvwbzvyb_required = true; + } + } +} + +// the vvvvwbz Some function +function protocol_vvvvwbz_SomeFunc(protocol_vvvvwbz) +{ + // set the function logic + if (protocol_vvvvwbz == 2) + { + return true; + } + return false; +} + +// the vvvvwbz Some function +function authentication_vvvvwbz_SomeFunc(authentication_vvvvwbz) +{ + // set the function logic + if (authentication_vvvvwbz == 4 || authentication_vvvvwbz == 5) + { + return true; + } + return false; +} + +// the vvvvwcb function +function vvvvwcb(protocol_vvvvwcb,authentication_vvvvwcb) +{ + if (isSet(protocol_vvvvwcb) && protocol_vvvvwcb.constructor !== Array) + { + var temp_vvvvwcb = protocol_vvvvwcb; + var protocol_vvvvwcb = []; + protocol_vvvvwcb.push(temp_vvvvwcb); + } + else if (!isSet(protocol_vvvvwcb)) + { + var protocol_vvvvwcb = []; + } + var protocol = protocol_vvvvwcb.some(protocol_vvvvwcb_SomeFunc); + + if (isSet(authentication_vvvvwcb) && authentication_vvvvwcb.constructor !== Array) + { + var temp_vvvvwcb = authentication_vvvvwcb; + var authentication_vvvvwcb = []; + authentication_vvvvwcb.push(temp_vvvvwcb); + } + else if (!isSet(authentication_vvvvwcb)) + { + var authentication_vvvvwcb = []; + } + var authentication = authentication_vvvvwcb.some(authentication_vvvvwcb_SomeFunc); + + + // set this function logic + if (protocol && authentication) + { + jQuery('#jform_secret').closest('.control-group').show(); + } + else + { + jQuery('#jform_secret').closest('.control-group').hide(); + } +} + +// the vvvvwcb Some function +function protocol_vvvvwcb_SomeFunc(protocol_vvvvwcb) +{ + // set the function logic + if (protocol_vvvvwcb == 2) + { + return true; + } + return false; +} + +// the vvvvwcb Some function +function authentication_vvvvwcb_SomeFunc(authentication_vvvvwcb) +{ + // set the function logic + if (authentication_vvvvwcb == 2 || authentication_vvvvwcb == 3 || authentication_vvvvwcb == 4 || authentication_vvvvwcb == 5) { return true; } diff --git a/admin/models/forms/site_view.js b/admin/models/forms/site_view.js index 4cacc0c55..b80ccbaf8 100644 --- a/admin/models/forms/site_view.js +++ b/admin/models/forms/site_view.js @@ -11,45 +11,45 @@ // Initial Script jQuery(document).ready(function() { - var add_php_view_vvvvvyt = jQuery("#jform_add_php_view input[type='radio']:checked").val(); - vvvvvyt(add_php_view_vvvvvyt); + var add_php_view_vvvvvyv = jQuery("#jform_add_php_view input[type='radio']:checked").val(); + vvvvvyv(add_php_view_vvvvvyv); - var add_php_jview_display_vvvvvyu = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val(); - vvvvvyu(add_php_jview_display_vvvvvyu); + var add_php_jview_display_vvvvvyw = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val(); + vvvvvyw(add_php_jview_display_vvvvvyw); - var add_php_jview_vvvvvyv = jQuery("#jform_add_php_jview input[type='radio']:checked").val(); - vvvvvyv(add_php_jview_vvvvvyv); + var add_php_jview_vvvvvyx = jQuery("#jform_add_php_jview input[type='radio']:checked").val(); + vvvvvyx(add_php_jview_vvvvvyx); - var add_php_document_vvvvvyw = jQuery("#jform_add_php_document input[type='radio']:checked").val(); - vvvvvyw(add_php_document_vvvvvyw); + var add_php_document_vvvvvyy = jQuery("#jform_add_php_document input[type='radio']:checked").val(); + vvvvvyy(add_php_document_vvvvvyy); - var add_css_document_vvvvvyx = jQuery("#jform_add_css_document input[type='radio']:checked").val(); - vvvvvyx(add_css_document_vvvvvyx); + var add_css_document_vvvvvyz = jQuery("#jform_add_css_document input[type='radio']:checked").val(); + vvvvvyz(add_css_document_vvvvvyz); - var add_javascript_file_vvvvvyy = jQuery("#jform_add_javascript_file input[type='radio']:checked").val(); - vvvvvyy(add_javascript_file_vvvvvyy); + var add_javascript_file_vvvvvza = jQuery("#jform_add_javascript_file input[type='radio']:checked").val(); + vvvvvza(add_javascript_file_vvvvvza); - var add_js_document_vvvvvyz = jQuery("#jform_add_js_document input[type='radio']:checked").val(); - vvvvvyz(add_js_document_vvvvvyz); + var add_js_document_vvvvvzb = jQuery("#jform_add_js_document input[type='radio']:checked").val(); + vvvvvzb(add_js_document_vvvvvzb); - var add_css_vvvvvza = jQuery("#jform_add_css input[type='radio']:checked").val(); - vvvvvza(add_css_vvvvvza); + var add_css_vvvvvzc = jQuery("#jform_add_css input[type='radio']:checked").val(); + vvvvvzc(add_css_vvvvvzc); - var add_php_ajax_vvvvvzb = jQuery("#jform_add_php_ajax input[type='radio']:checked").val(); - vvvvvzb(add_php_ajax_vvvvvzb); + var add_php_ajax_vvvvvzd = jQuery("#jform_add_php_ajax input[type='radio']:checked").val(); + vvvvvzd(add_php_ajax_vvvvvzd); - var add_custom_button_vvvvvzc = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); - vvvvvzc(add_custom_button_vvvvvzc); + var add_custom_button_vvvvvze = jQuery("#jform_add_custom_button input[type='radio']:checked").val(); + vvvvvze(add_custom_button_vvvvvze); - var button_position_vvvvvzd = jQuery("#jform_button_position").val(); - vvvvvzd(button_position_vvvvvzd); + var button_position_vvvvvzf = jQuery("#jform_button_position").val(); + vvvvvzf(button_position_vvvvvzf); }); -// the vvvvvyt function -function vvvvvyt(add_php_view_vvvvvyt) +// the vvvvvyv function +function vvvvvyv(add_php_view_vvvvvyv) { // set the function logic - if (add_php_view_vvvvvyt == 1) + if (add_php_view_vvvvvyv == 1) { jQuery('#jform_php_view-lbl').closest('.control-group').show(); } @@ -59,11 +59,11 @@ function vvvvvyt(add_php_view_vvvvvyt) } } -// the vvvvvyu function -function vvvvvyu(add_php_jview_display_vvvvvyu) +// the vvvvvyw function +function vvvvvyw(add_php_jview_display_vvvvvyw) { // set the function logic - if (add_php_jview_display_vvvvvyu == 1) + if (add_php_jview_display_vvvvvyw == 1) { jQuery('#jform_php_jview_display-lbl').closest('.control-group').show(); } @@ -73,11 +73,11 @@ function vvvvvyu(add_php_jview_display_vvvvvyu) } } -// the vvvvvyv function -function vvvvvyv(add_php_jview_vvvvvyv) +// the vvvvvyx function +function vvvvvyx(add_php_jview_vvvvvyx) { // set the function logic - if (add_php_jview_vvvvvyv == 1) + if (add_php_jview_vvvvvyx == 1) { jQuery('#jform_php_jview-lbl').closest('.control-group').show(); } @@ -87,11 +87,11 @@ function vvvvvyv(add_php_jview_vvvvvyv) } } -// the vvvvvyw function -function vvvvvyw(add_php_document_vvvvvyw) +// the vvvvvyy function +function vvvvvyy(add_php_document_vvvvvyy) { // set the function logic - if (add_php_document_vvvvvyw == 1) + if (add_php_document_vvvvvyy == 1) { jQuery('#jform_php_document-lbl').closest('.control-group').show(); } @@ -101,11 +101,11 @@ function vvvvvyw(add_php_document_vvvvvyw) } } -// the vvvvvyx function -function vvvvvyx(add_css_document_vvvvvyx) +// the vvvvvyz function +function vvvvvyz(add_css_document_vvvvvyz) { // set the function logic - if (add_css_document_vvvvvyx == 1) + if (add_css_document_vvvvvyz == 1) { jQuery('#jform_css_document-lbl').closest('.control-group').show(); } @@ -115,11 +115,11 @@ function vvvvvyx(add_css_document_vvvvvyx) } } -// the vvvvvyy function -function vvvvvyy(add_javascript_file_vvvvvyy) +// the vvvvvza function +function vvvvvza(add_javascript_file_vvvvvza) { // set the function logic - if (add_javascript_file_vvvvvyy == 1) + if (add_javascript_file_vvvvvza == 1) { jQuery('#jform_javascript_file-lbl').closest('.control-group').show(); } @@ -129,11 +129,11 @@ function vvvvvyy(add_javascript_file_vvvvvyy) } } -// the vvvvvyz function -function vvvvvyz(add_js_document_vvvvvyz) +// the vvvvvzb function +function vvvvvzb(add_js_document_vvvvvzb) { // set the function logic - if (add_js_document_vvvvvyz == 1) + if (add_js_document_vvvvvzb == 1) { jQuery('#jform_js_document-lbl').closest('.control-group').show(); } @@ -143,11 +143,11 @@ function vvvvvyz(add_js_document_vvvvvyz) } } -// the vvvvvza function -function vvvvvza(add_css_vvvvvza) +// the vvvvvzc function +function vvvvvzc(add_css_vvvvvzc) { // set the function logic - if (add_css_vvvvvza == 1) + if (add_css_vvvvvzc == 1) { jQuery('#jform_css-lbl').closest('.control-group').show(); } @@ -157,11 +157,11 @@ function vvvvvza(add_css_vvvvvza) } } -// the vvvvvzb function -function vvvvvzb(add_php_ajax_vvvvvzb) +// the vvvvvzd function +function vvvvvzd(add_php_ajax_vvvvvzd) { // set the function logic - if (add_php_ajax_vvvvvzb == 1) + if (add_php_ajax_vvvvvzd == 1) { jQuery('#jform_ajax_input-lbl').closest('.control-group').show(); jQuery('#jform_php_ajaxmethod-lbl').closest('.control-group').show(); @@ -173,11 +173,11 @@ function vvvvvzb(add_php_ajax_vvvvvzb) } } -// the vvvvvzc function -function vvvvvzc(add_custom_button_vvvvvzc) +// the vvvvvze function +function vvvvvze(add_custom_button_vvvvvze) { // set the function logic - if (add_custom_button_vvvvvzc == 1) + if (add_custom_button_vvvvvze == 1) { jQuery('#jform_custom_button-lbl').closest('.control-group').show(); jQuery('#jform_php_controller-lbl').closest('.control-group').show(); @@ -191,20 +191,20 @@ function vvvvvzc(add_custom_button_vvvvvzc) } } -// the vvvvvzd function -function vvvvvzd(button_position_vvvvvzd) +// the vvvvvzf function +function vvvvvzf(button_position_vvvvvzf) { - if (isSet(button_position_vvvvvzd) && button_position_vvvvvzd.constructor !== Array) + if (isSet(button_position_vvvvvzf) && button_position_vvvvvzf.constructor !== Array) { - var temp_vvvvvzd = button_position_vvvvvzd; - var button_position_vvvvvzd = []; - button_position_vvvvvzd.push(temp_vvvvvzd); + var temp_vvvvvzf = button_position_vvvvvzf; + var button_position_vvvvvzf = []; + button_position_vvvvvzf.push(temp_vvvvvzf); } - else if (!isSet(button_position_vvvvvzd)) + else if (!isSet(button_position_vvvvvzf)) { - var button_position_vvvvvzd = []; + var button_position_vvvvvzf = []; } - var button_position = button_position_vvvvvzd.some(button_position_vvvvvzd_SomeFunc); + var button_position = button_position_vvvvvzf.some(button_position_vvvvvzf_SomeFunc); // set this function logic @@ -218,11 +218,11 @@ function vvvvvzd(button_position_vvvvvzd) } } -// the vvvvvzd Some function -function button_position_vvvvvzd_SomeFunc(button_position_vvvvvzd) +// the vvvvvzf Some function +function button_position_vvvvvzf_SomeFunc(button_position_vvvvvzf) { // set the function logic - if (button_position_vvvvvzd == 5) + if (button_position_vvvvvzf == 5) { return true; } diff --git a/admin/models/forms/template.js b/admin/models/forms/template.js index 34290a7bb..863bc2eb5 100644 --- a/admin/models/forms/template.js +++ b/admin/models/forms/template.js @@ -11,15 +11,15 @@ // Initial Script jQuery(document).ready(function() { - var add_php_view_vvvvvze = jQuery("#jform_add_php_view input[type='radio']:checked").val(); - vvvvvze(add_php_view_vvvvvze); + var add_php_view_vvvvvzg = jQuery("#jform_add_php_view input[type='radio']:checked").val(); + vvvvvzg(add_php_view_vvvvvzg); }); -// the vvvvvze function -function vvvvvze(add_php_view_vvvvvze) +// the vvvvvzg function +function vvvvvzg(add_php_view_vvvvvzg) { // set the function logic - if (add_php_view_vvvvvze == 1) + if (add_php_view_vvvvvzg == 1) { jQuery('#jform_php_view-lbl').closest('.control-group').show(); } diff --git a/admin/models/forms/validation_rule.js b/admin/models/forms/validation_rule.js index 56bf6de28..fbd901818 100644 --- a/admin/models/forms/validation_rule.js +++ b/admin/models/forms/validation_rule.js @@ -32,16 +32,16 @@ jQuery(document).ready(function() }); function getExistingValidationRuleCode_server(rulefilename){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getExistingValidationRuleCode&format=json"); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getExistingValidationRuleCode&format=json&raw=true"); if(token.length > 0 && rulefilename.length > 0){ var request = token+'=1&name='+rulefilename; } return jQuery.ajax({ type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } @@ -84,16 +84,16 @@ function checkRuleName(ruleName) { } // check Function Name function checkRuleName_server(ruleName, ide){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.checkRuleName&format=json"); + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.checkRuleName&format=json&raw=true"); if(token.length > 0){ var request = token+'=1&name='+ruleName+'&id='+ide; } return jQuery.ajax({ - type: 'POST', + type: 'GET', url: getUrl, - dataType: 'jsonp', + dataType: 'json', data: request, - jsonp: 'callback' + jsonp: false }); } diff --git a/admin/models/joomla_plugin.php b/admin/models/joomla_plugin.php new file mode 100644 index 000000000..c9df4330b --- /dev/null +++ b/admin/models/joomla_plugin.php @@ -0,0 +1,1007 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Componentbuilder Joomla_plugin Model + */ +class ComponentbuilderModelJoomla_plugin extends JModelAdmin +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'note_beta_stage', + 'note_plugin' + ), + 'right' => array( + 'property_selection', + 'method_selection' + ), + 'fullwidth' => array( + 'main_class_code' + ), + 'above' => array( + 'name', + 'class_extends', + 'joomla_plugin_group' + ) + ), + 'configparams' => array( + 'fullwidth' => array( + 'fields' + ) + ) + ); + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_componentbuilder.joomla_plugin'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JTable A database object + * + * @since 1.6 + */ + public function getTable($type = 'joomla_plugin', $prefix = 'ComponentbuilderTable', $config = array()) + { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables'); + // get instance of the table + return JTable::getInstance($type, $prefix, $config); + } + + /** + * get VDM session key + * + * @return string the session key + * + */ + public function getVDM() + { + return $this->vastDevMod; + } + + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + { + if ($item = parent::getItem($pk)) + { + if (!empty($item->params) && !is_array($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + } + + if (!empty($item->main_class_code)) + { + // base64 Decode main_class_code. + $item->main_class_code = base64_decode($item->main_class_code); + } + + if (!empty($item->fields)) + { + // Convert the fields field to an array. + $fields = new Registry; + $fields->loadString($item->fields); + $item->fields = $fields->toArray(); + } + + if (!empty($item->method_selection)) + { + // Convert the method_selection field to an array. + $method_selection = new Registry; + $method_selection->loadString($item->method_selection); + $item->method_selection = $method_selection->toArray(); + } + + if (!empty($item->property_selection)) + { + // Convert the property_selection field to an array. + $property_selection = new Registry; + $property_selection->loadString($item->property_selection); + $item->property_selection = $property_selection->toArray(); + } + + + if (empty($item->id)) + { + $id = 0; + } + else + { + $id = $item->id; + } + // set the id and view name to session + if ($vdm = ComponentbuilderHelper::get('joomla_plugin__'.$id)) + { + $this->vastDevMod = $vdm; + } + else + { + // set the vast development method key + $this->vastDevMod = ComponentbuilderHelper::randomkey(50); + ComponentbuilderHelper::set($this->vastDevMod, 'joomla_plugin__'.$id); + ComponentbuilderHelper::set('joomla_plugin__'.$id, $this->vastDevMod); + // set a return value if found + $jinput = JFactory::getApplication()->input; + $return = $jinput->get('return', null, 'base64'); + ComponentbuilderHelper::set($this->vastDevMod . '__return', $return); + } + + if (!empty($item->id)) + { + $item->tags = new JHelperTags; + $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin'); + } + } + + return $item; + } + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; + // Get the form. + $form = $this->loadForm('com_componentbuilder.joomla_plugin', 'joomla_plugin', $options); + + if (empty($form)) + { + return false; + } + + $jinput = JFactory::getApplication()->input; + + // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + if ($jinput->get('a_id')) + { + $id = $jinput->get('a_id', 0, 'INT'); + } + // The back end uses id so we use that the rest of the time and set it to 0 by default. + else + { + $id = $jinput->get('id', 0, 'INT'); + } + + $user = JFactory::getUser(); + + // Check for existing item. + // Modify the form based on Edit State access controls. + if ($id != 0 && (!$user->authorise('joomla_plugin.edit.state', 'com_componentbuilder.joomla_plugin.' . (int) $id)) + || ($id == 0 && !$user->authorise('joomla_plugin.edit.state', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('published', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('published', 'filter', 'unset'); + } + // If this is a new item insure the greated by is set. + if (0 == $id) + { + // Set the created_by to this user + $form->setValue('created_by', null, $user->id); + } + // Modify the form based on Edit Creaded By access controls. + if ($id != 0 && (!$user->authorise('joomla_plugin.edit.created_by', 'com_componentbuilder.joomla_plugin.' . (int) $id)) + || ($id == 0 && !$user->authorise('joomla_plugin.edit.created_by', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created_by', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('created_by', 'readonly', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created_by', 'filter', 'unset'); + } + // Modify the form based on Edit Creaded Date access controls. + if ($id != 0 && (!$user->authorise('joomla_plugin.edit.created', 'com_componentbuilder.joomla_plugin.' . (int) $id)) + || ($id == 0 && !$user->authorise('joomla_plugin.edit.created', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('created', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created', 'filter', 'unset'); + } + // Only load these values if no id is found + if (0 == $id) + { + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); + if (0 != $redirectedValue && $redirectedField) + { + // Now set the local-redirected field default value + $form->setValue($redirectedField, null, $redirectedValue); + } + } + + // update all editors to use this components global editor + $global_editor = JComponentHelper::getParams('com_componentbuilder')->get('editor', 'none'); + // now get all the editor fields + $editors = $form->getXml()->xpath("//field[@type='editor']"); + // check if we found any + if (ComponentbuilderHelper::checkArray($editors)) + { + foreach ($editors as $editor) + { + // get the field names + $name = (string) $editor['name']; + // set the field editor value (with none as fallback) + $form->setFieldAttribute($name, 'editor', $global_editor . '|none'); + } + } + + return $form; + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'administrator/components/com_componentbuilder/models/forms/joomla_plugin.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->published != -2) + { + return; + } + + $user = JFactory::getUser(); + // The record has been set. Check the record permissions. + return $user->authorise('joomla_plugin.delete', 'com_componentbuilder.joomla_plugin.' . (int) $record->id); + } + return false; + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + $recordId = (!empty($record->id)) ? $record->id : 0; + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('joomla_plugin.edit.state', 'com_componentbuilder.joomla_plugin.' . (int) $recordId); + if (!$permission && !is_null($permission)) + { + return false; + } + } + // In the absense of better information, revert to the component permissions. + return $user->authorise('joomla_plugin.edit.state', 'com_componentbuilder'); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // Check specific edit permission then general edit permission. + $user = JFactory::getUser(); + + return $user->authorise('joomla_plugin.edit', 'com_componentbuilder.joomla_plugin.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('joomla_plugin.edit', 'com_componentbuilder'); + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param JTable $table A JTable object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__componentbuilder_joomla_plugin')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.joomla_plugin.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + } + + return $data; + } + + /** + * Method to get the unique fields of this table. + * + * @return mixed An array of field names, boolean false if none is set. + * + * @since 3.0 + */ + protected function getUniqeFields() + { + return false; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + { + if (!parent::delete($pks)) + { + return false; + } + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + { + if (!parent::publish($pks, $value)) + { + return false; + } + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + JArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new JUcmType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + } + + /** + * Batch copy items to a new category or current. + * + * @param integer $values The new values. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return mixed An array of new IDs on success, boolean false on failure. + * + * @since 12.2 + */ + protected function batchCopy($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin'); + } + + if (!$this->canDo->get('joomla_plugin.create') && !$this->canDo->get('joomla_plugin.batch')) + { + return false; + } + + // get list of uniqe fields + $uniqeFields = $this->getUniqeFields(); + // remove move_copy from array + unset($values['move_copy']); + + // make sure published is set + if (!isset($values['published'])) + { + $values['published'] = 0; + } + elseif (isset($values['published']) && !$this->canDo->get('joomla_plugin.edit.state')) + { + $values['published'] = 0; + } + + $newIds = array(); + // Parent exists so let's proceed + while (!empty($pks)) + { + // Pop the first ID off the stack + $pk = array_shift($pks); + + $this->table->reset(); + + // only allow copy if user may edit this item. + if (!$this->user->authorise('joomla_plugin.edit', $contexts[$pk])) + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // Only for strings + if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name)) + { + $this->table->name = $this->generateUniqe('name',$this->table->name); + } + + // insert all set values + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + if (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + // update all uniqe fields + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField); + } + } + + // Reset the ID because we are making a copy + $this->table->id = 0; + + // TODO: Deal with ordering? + // $this->table->ordering = 1; + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + + // Get the new item ID + $newId = $this->table->get('id'); + + // Add the new ID to the array + $newIds[$pk] = $newId; + } + + // Clean the cache + $this->cleanCache(); + + return $newIds; + } + + /** + * Batch move items to a new category + * + * @param integer $value The new category ID. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 12.2 + */ + protected function batchMove($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin'); + } + + if (!$this->canDo->get('joomla_plugin.edit') && !$this->canDo->get('joomla_plugin.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // make sure published only updates if user has the permission. + if (isset($values['published']) && !$this->canDo->get('joomla_plugin.edit.state')) + { + unset($values['published']); + } + // remove move_copy from array + unset($values['move_copy']); + + // Parent exists so we proceed + foreach ($pks as $pk) + { + if (!$this->user->authorise('joomla_plugin.edit', $contexts[$pk])) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // insert all set values. + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + // Do special action for access. + if ('access' === $key && strlen($value) > 0) + { + $this->table->$key = $value; + } + elseif (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + } + + // Clean the cache + $this->cleanCache(); + + return true; + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = JFactory::getApplication()->input; + $filter = JFilterInput::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new JRegistry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + } + + // make sure the name is safe to be used as a function name + $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + + // Set the fields items to data. + if (isset($data['fields']) && is_array($data['fields'])) + { + $fields = new JRegistry; + $fields->loadArray($data['fields']); + $data['fields'] = (string) $fields; + } + elseif (!isset($data['fields'])) + { + // Set the empty fields to data + $data['fields'] = ''; + } + + // Set the method_selection items to data. + if (isset($data['method_selection']) && is_array($data['method_selection'])) + { + $method_selection = new JRegistry; + $method_selection->loadArray($data['method_selection']); + $data['method_selection'] = (string) $method_selection; + } + elseif (!isset($data['method_selection'])) + { + // Set the empty method_selection to data + $data['method_selection'] = ''; + } + + // Set the property_selection items to data. + if (isset($data['property_selection']) && is_array($data['property_selection'])) + { + $property_selection = new JRegistry; + $property_selection->loadArray($data['property_selection']); + $data['property_selection'] = (string) $property_selection; + } + elseif (!isset($data['property_selection'])) + { + // Set the empty property_selection to data + $data['property_selection'] = ''; + } + + // Set the main_class_code string to base64 string. + if (isset($data['main_class_code'])) + { + $data['main_class_code'] = base64_encode($data['main_class_code']); + } + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new JRegistry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + } + + // Alter the uniqe field for save as copy + if ($input->get('task') === 'save2copy') + { + // Automatic handling of other uniqe fields + $uniqeFields = $this->getUniqeFields(); + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]); + } + } + } + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUniqe($field,$value) + { + + // set field value uniqe + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = JString::increment($value); + } + + return $value; + } + + /** + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ + protected function _generateNewTitle($title) + { + + // Alter the title + $table = $this->getTable(); + + while ($table->load(array('title' => $title))) + { + $title = JString::increment($title); + } + + return $title; + } +} diff --git a/admin/models/joomla_plugin_group.php b/admin/models/joomla_plugin_group.php new file mode 100644 index 000000000..a7b8a40f7 --- /dev/null +++ b/admin/models/joomla_plugin_group.php @@ -0,0 +1,859 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Componentbuilder Joomla_plugin_group Model + */ +class ComponentbuilderModelJoomla_plugin_group extends JModelAdmin +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'name' + ), + 'right' => array( + 'class_extends' + ) + ) + ); + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_componentbuilder.joomla_plugin_group'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JTable A database object + * + * @since 1.6 + */ + public function getTable($type = 'joomla_plugin_group', $prefix = 'ComponentbuilderTable', $config = array()) + { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables'); + // get instance of the table + return JTable::getInstance($type, $prefix, $config); + } + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + { + if ($item = parent::getItem($pk)) + { + if (!empty($item->params) && !is_array($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + } + + if (!empty($item->id)) + { + $item->tags = new JHelperTags; + $item->tags->getTagIds($item->id, 'com_componentbuilder.joomla_plugin_group'); + } + } + + return $item; + } + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; + // Get the form. + $form = $this->loadForm('com_componentbuilder.joomla_plugin_group', 'joomla_plugin_group', $options); + + if (empty($form)) + { + return false; + } + + $jinput = JFactory::getApplication()->input; + + // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + if ($jinput->get('a_id')) + { + $id = $jinput->get('a_id', 0, 'INT'); + } + // The back end uses id so we use that the rest of the time and set it to 0 by default. + else + { + $id = $jinput->get('id', 0, 'INT'); + } + + $user = JFactory::getUser(); + + // Check for existing item. + // Modify the form based on Edit State access controls. + if ($id != 0 && (!$user->authorise('core.edit.state', 'com_componentbuilder.joomla_plugin_group.' . (int) $id)) + || ($id == 0 && !$user->authorise('core.edit.state', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('published', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('published', 'filter', 'unset'); + } + // If this is a new item insure the greated by is set. + if (0 == $id) + { + // Set the created_by to this user + $form->setValue('created_by', null, $user->id); + } + // Modify the form based on Edit Creaded By access controls. + if (!$user->authorise('core.edit.created_by', 'com_componentbuilder')) + { + // Disable fields for display. + $form->setFieldAttribute('created_by', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('created_by', 'readonly', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created_by', 'filter', 'unset'); + } + // Modify the form based on Edit Creaded Date access controls. + if (!$user->authorise('core.edit.created', 'com_componentbuilder')) + { + // Disable fields for display. + $form->setFieldAttribute('created', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created', 'filter', 'unset'); + } + // Only load these values if no id is found + if (0 == $id) + { + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); + if (0 != $redirectedValue && $redirectedField) + { + // Now set the local-redirected field default value + $form->setValue($redirectedField, null, $redirectedValue); + } + } + return $form; + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->published != -2) + { + return; + } + + $user = JFactory::getUser(); + // The record has been set. Check the record permissions. + return $user->authorise('core.delete', 'com_componentbuilder.joomla_plugin_group.' . (int) $record->id); + } + return false; + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + $recordId = (!empty($record->id)) ? $record->id : 0; + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('core.edit.state', 'com_componentbuilder.joomla_plugin_group.' . (int) $recordId); + if (!$permission && !is_null($permission)) + { + return false; + } + } + // In the absense of better information, revert to the component permissions. + return parent::canEditState($record); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // Check specific edit permission then general edit permission. + + return JFactory::getUser()->authorise('core.edit', 'com_componentbuilder.joomla_plugin_group.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key); + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param JTable $table A JTable object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__componentbuilder_joomla_plugin_group')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.joomla_plugin_group.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + } + + return $data; + } + + /** + * Method to get the unique fields of this table. + * + * @return mixed An array of field names, boolean false if none is set. + * + * @since 3.0 + */ + protected function getUniqeFields() + { + return false; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + { + if (!parent::delete($pks)) + { + return false; + } + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + { + if (!parent::publish($pks, $value)) + { + return false; + } + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + JArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin_group'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new JUcmType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + } + + /** + * Batch copy items to a new category or current. + * + * @param integer $values The new values. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return mixed An array of new IDs on success, boolean false on failure. + * + * @since 12.2 + */ + protected function batchCopy($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin_group'); + } + + if (!$this->canDo->get('core.create') || !$this->canDo->get('core.batch')) + { + return false; + } + + // get list of uniqe fields + $uniqeFields = $this->getUniqeFields(); + // remove move_copy from array + unset($values['move_copy']); + + // make sure published is set + if (!isset($values['published'])) + { + $values['published'] = 0; + } + elseif (isset($values['published']) && !$this->canDo->get('core.edit.state')) + { + $values['published'] = 0; + } + + $newIds = array(); + // Parent exists so let's proceed + while (!empty($pks)) + { + // Pop the first ID off the stack + $pk = array_shift($pks); + + $this->table->reset(); + + // only allow copy if user may edit this item. + if (!$this->user->authorise('core.edit', $contexts[$pk])) + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // Only for strings + if (ComponentbuilderHelper::checkString($this->table->name) && !is_numeric($this->table->name)) + { + $this->table->name = $this->generateUniqe('name',$this->table->name); + } + + // insert all set values + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + if (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + // update all uniqe fields + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField); + } + } + + // Reset the ID because we are making a copy + $this->table->id = 0; + + // TODO: Deal with ordering? + // $this->table->ordering = 1; + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + + // Get the new item ID + $newId = $this->table->get('id'); + + // Add the new ID to the array + $newIds[$pk] = $newId; + } + + // Clean the cache + $this->cleanCache(); + + return $newIds; + } + + /** + * Batch move items to a new category + * + * @param integer $value The new category ID. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 12.2 + */ + protected function batchMove($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin_group'); + } + + if (!$this->canDo->get('core.edit') && !$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // make sure published only updates if user has the permission. + if (isset($values['published']) && !$this->canDo->get('core.edit.state')) + { + unset($values['published']); + } + // remove move_copy from array + unset($values['move_copy']); + + // Parent exists so we proceed + foreach ($pks as $pk) + { + if (!$this->user->authorise('core.edit', $contexts[$pk])) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // insert all set values. + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + // Do special action for access. + if ('access' === $key && strlen($value) > 0) + { + $this->table->$key = $value; + } + elseif (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + } + + // Clean the cache + $this->cleanCache(); + + return true; + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = JFactory::getApplication()->input; + $filter = JFilterInput::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new JRegistry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + } + + // make sure the name is safe to be used as a function name + $data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']); + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new JRegistry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + } + + // Alter the uniqe field for save as copy + if ($input->get('task') === 'save2copy') + { + // Automatic handling of other uniqe fields + $uniqeFields = $this->getUniqeFields(); + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]); + } + } + } + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUniqe($field,$value) + { + + // set field value uniqe + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = JString::increment($value); + } + + return $value; + } + + /** + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ + protected function _generateNewTitle($title) + { + + // Alter the title + $table = $this->getTable(); + + while ($table->load(array('title' => $title))) + { + $title = JString::increment($title); + } + + return $title; + } +} diff --git a/admin/models/joomla_plugin_groups.php b/admin/models/joomla_plugin_groups.php new file mode 100644 index 000000000..8ca72875d --- /dev/null +++ b/admin/models/joomla_plugin_groups.php @@ -0,0 +1,250 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Joomla_plugin_groups Model + */ +class ComponentbuilderModelJoomla_plugin_groups extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'a.id','id', + 'a.published','published', + 'a.ordering','ordering', + 'a.created_by','created_by', + 'a.modified_by','modified_by', + 'a.name','name', + 'a.class_extends','class_extends' + ); + } + + parent::__construct($config); + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); + $this->setState('filter.name', $name); + + $class_extends = $this->getUserStateFromRequest($this->context . '.filter.class_extends', 'filter_class_extends'); + $this->setState('filter.class_extends', $class_extends); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() + { + // check in items + $this->checkInNow(); + + // load parent items + $items = parent::getItems(); + + // return items + return $items; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_item table + $query->from($db->quoteName('#__componentbuilder_joomla_plugin_group', 'a')); + + // From the componentbuilder_class_extends table. + $query->select($db->quoteName('g.name','class_extends_name')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_class_extends', 'g') . ' ON (' . $db->quoteName('a.class_extends') . ' = ' . $db->quoteName('g.id') . ')'); + + // Filter by published state + $published = $this->getState('filter.published'); + if (is_numeric($published)) + { + $query->where('a.published = ' . (int) $published); + } + elseif ($published === '') + { + $query->where('(a.published = 0 OR a.published = 1)'); + } + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + // Filter by search. + $search = $this->getState('filter.search'); + if (!empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where('a.id = ' . (int) substr($search, 3)); + } + else + { + $search = $db->quote('%' . $db->escape($search) . '%'); + $query->where('(a.name LIKE '.$search.' OR a.class_extends LIKE '.$search.' OR g.name LIKE '.$search.')'); + } + } + + // Filter by class_extends. + if ($class_extends = $this->getState('filter.class_extends')) + { + $query->where('a.class_extends = ' . $db->quote($db->escape($class_extends))); + } + + // Add the list ordering clause. + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'asc'); + if ($orderCol != '') + { + $query->order($db->escape($orderCol . ' ' . $orderDirn)); + } + + return $query; + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.id'); + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.ordering'); + $id .= ':' . $this->getState('filter.created_by'); + $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.class_extends'); + + return parent::getStoreId($id); + } + + /** + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ + protected function checkInNow() + { + // Get set check in time + $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); + + if ($time) + { + + // Get a db connection. + $db = JFactory::getDbo(); + // reset query + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->quoteName('#__componentbuilder_joomla_plugin_group')); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // Get Yesterdays date + $date = JFactory::getDate()->modify($time)->toSql(); + // reset query + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', + $db->quoteName('checked_out') . '=0' + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('checked_out') . '!=0', + $db->quoteName('checked_out_time') . '<\''.$date.'\'' + ); + + // Check table + $query->update($db->quoteName('#__componentbuilder_joomla_plugin_group'))->set($fields)->where($conditions); + + $db->setQuery($query); + + $db->execute(); + } + } + + return false; + } +} diff --git a/admin/models/joomla_plugins.php b/admin/models/joomla_plugins.php new file mode 100644 index 000000000..01f4819a7 --- /dev/null +++ b/admin/models/joomla_plugins.php @@ -0,0 +1,571 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Joomla_plugins Model + */ +class ComponentbuilderModelJoomla_plugins extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'a.id','id', + 'a.published','published', + 'a.ordering','ordering', + 'a.created_by','created_by', + 'a.modified_by','modified_by', + 'a.name','name', + 'a.class_extends','class_extends', + 'a.joomla_plugin_group','joomla_plugin_group' + ); + } + + parent::__construct($config); + } + + + /** + * get Boilerplate + * + * @return boolean + */ + public function getBoilerplate() + { + // get boilerplate repo root details + if (($result = ComponentbuilderHelper::getFileContents(ComponentbuilderHelper::$bolerplateAPI)) !== false && ComponentbuilderHelper::checkJson($result)) + { + $result = json_decode($result); + // check if we have a three + if (isset($result->tree) && ComponentbuilderHelper::checkArray($result->tree)) + { + $found = array_values(array_filter( + $result->tree, + function($tree) { + if (isset($tree->path) && $tree->path === 'plugins') + { + return true; + } + return false; + } + )); + // make sure we have the correct boilerplate + if (ComponentbuilderHelper::checkArray($found) && count($found) == 1 && method_exists(__CLASS__, 'getPluginsBoilerplate')) + { + // get the plugins boilerplate + return $this->getPluginsBoilerplate($found[0]->url); + } + } + } + return false; + } + + /** + * get Plugin Boilerplate + * + * @return boolean true on success + * + */ + protected function getPluginsBoilerplate($url) + { + // get boilerplate root for plugins + if (($result = ComponentbuilderHelper::getFileContents($url)) !== false && ComponentbuilderHelper::checkJson($result)) + { + $result = json_decode($result); + // check if we have a tree + if (isset($result->tree) && ComponentbuilderHelper::checkArray($result->tree)) + { + // get the app object + $app = JFactory::getApplication(); + // set the table names + $tables = array(); + $tables['e'] = 'class_extends'; + $tables['g'] = 'joomla_plugin_group'; + $tables['m'] = 'class_method'; + $tables['p'] = 'class_property'; + // load the needed models + $models = array(); + $models['e'] = ComponentbuilderHelper::getModel($tables['e']); + $models['g'] = ComponentbuilderHelper::getModel($tables['g']); + $models['p'] = ComponentbuilderHelper::getModel($tables['p']); + $models['m'] = ComponentbuilderHelper::getModel($tables['m']); + // get the needed data of each plugin group + $groups = array_map( + function($tree) use(&$app, &$models, &$tables){ + if (($fooClass = ComponentbuilderHelper::getFileContents(ComponentbuilderHelper::$bolerplatePath . '/plugins/' . $tree->path . '/foo.php')) !== false && ComponentbuilderHelper::checkString($fooClass)) + { + // extract the boilerplate class extends and check if already set + if (($classExtends = ComponentbuilderHelper::extractBoilerplateClassExtends($fooClass, 'plugins')) !== false && + ($classExtendsID = ComponentbuilderHelper::getVar('class_extends', $classExtends, 'name', 'id')) === false) + { + // load the extends class name + $class = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $classExtends); + // extract the boilerplate class header + $class['head'] = ComponentbuilderHelper::extractBoilerplateClassHeader($fooClass, $classExtends, 'plugins'); + // extract the boilerplate class comment + $class['comment'] = ComponentbuilderHelper::extractBoilerplateClassComment($fooClass, $classExtends, 'plugins'); + // set the extension type + $class['extension_type'] = 'plugins'; + // store the class + $this->storePluginBoilerplate($tables['e'], $models['e'], $class, $app); + // work around + $classExtendsID = ComponentbuilderHelper::getVar('class_extends', $classExtends, 'name', 'id'); + } + // set plugin group if not already set + if (($pluginGroupID = ComponentbuilderHelper::getVar('joomla_plugin_group', $tree->path, 'name', 'id')) === false) + { + // load the plugin group name + $pluginGroup = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $tree->path, 'class_extends' => $classExtendsID); + // store the group + $this->storePluginBoilerplate($tables['g'], $models['g'], $pluginGroup, $app); + // work around + $pluginGroupID = ComponentbuilderHelper::getVar('joomla_plugin_group', $tree->path, 'name', 'id'); + } + // extract the boilerplate class property and methods + if (($classProperiesMethods = ComponentbuilderHelper::extractBoilerplateClassPropertiesMethods($fooClass, $classExtends, 'plugins', $pluginGroupID)) !== false) + { + // create the properties found (TODO just create for now but we could later add a force update) + if (isset($classProperiesMethods['property']) && ComponentbuilderHelper::checkArray($classProperiesMethods['property'])) + { + foreach ($classProperiesMethods['property'] as $_property) + { + // does not exist, so create + if ($_property['id'] == 0) + { + // store the property + $this->storePluginBoilerplate($tables['p'], $models['p'], $_property, $app); + } + } + } + // create the method found (TODO just create for now but we could later add a force update) + if (isset($classProperiesMethods['method']) && ComponentbuilderHelper::checkArray($classProperiesMethods['method'])) + { + foreach ($classProperiesMethods['method'] as $_method) + { + // does not exist, so create + if ($_method['id'] == 0) + { + // store the method + $this->storePluginBoilerplate($tables['m'], $models['m'], $_method, $app); + } + } + } + } + } + }, + $result->tree + ); + } + } + } + + /** + * store Plugin Boilerplate + * + * @return boolean true on success + * + */ + protected function storePluginBoilerplate(&$table, &$method, &$boilerplate, &$app) + { + // Sometimes the form needs some posted data, such as for plugins and modules. + $form = $method->getForm($boilerplate, false); + if (!$form) + { + $app->enqueueMessage($method->getError(), 'error'); + return false; + } + // Send an object which can be modified through the plugin event + $objData = (object) $boilerplate; + $app->triggerEvent( + 'onContentNormaliseRequestData', + array('com_componentbuilder.' . $table, $objData, $form) + ); + $boilerplate = (array) $objData; + // Test whether the data is valid. + $validData = $method->validate($form, $boilerplate); + // Check for validation errors. + if ($validData === false) + { + // Get the validation messages. + $errors = $method->getErrors(); + // Push up to three validation messages out to the user. + for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) + { + if ($errors[$i] instanceof \Exception) + { + $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); + } + else + { + $app->enqueueMessage($errors[$i], 'warning'); + } + } + return false; + } + // Attempt to save the data. + if (!$method->save($validData)) + { + $app->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_BOILERPLATE_PLUGIN_S_DATA_COULD_NOT_BE_SAVED', $table), 'error'); + return false; + } + return true; + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); + $this->setState('filter.name', $name); + + $class_extends = $this->getUserStateFromRequest($this->context . '.filter.class_extends', 'filter_class_extends'); + $this->setState('filter.class_extends', $class_extends); + + $joomla_plugin_group = $this->getUserStateFromRequest($this->context . '.filter.joomla_plugin_group', 'filter_joomla_plugin_group'); + $this->setState('filter.joomla_plugin_group', $joomla_plugin_group); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() + { + // check in items + $this->checkInNow(); + + // load parent items + $items = parent::getItems(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + $access = (JFactory::getUser()->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_plugin.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + } + } + + // return items + return $items; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_item table + $query->from($db->quoteName('#__componentbuilder_joomla_plugin', 'a')); + + // From the componentbuilder_class_extends table. + $query->select($db->quoteName('g.name','class_extends_name')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_class_extends', 'g') . ' ON (' . $db->quoteName('a.class_extends') . ' = ' . $db->quoteName('g.id') . ')'); + + // From the componentbuilder_joomla_plugin_group table. + $query->select($db->quoteName('h.name','joomla_plugin_group_name')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_plugin_group', 'h') . ' ON (' . $db->quoteName('a.joomla_plugin_group') . ' = ' . $db->quoteName('h.id') . ')'); + + // Filter by published state + $published = $this->getState('filter.published'); + if (is_numeric($published)) + { + $query->where('a.published = ' . (int) $published); + } + elseif ($published === '') + { + $query->where('(a.published = 0 OR a.published = 1)'); + } + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + // Filter by search. + $search = $this->getState('filter.search'); + if (!empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where('a.id = ' . (int) substr($search, 3)); + } + else + { + $search = $db->quote('%' . $db->escape($search) . '%'); + $query->where('(a.name LIKE '.$search.' OR a.class_extends LIKE '.$search.' OR g.name LIKE '.$search.' OR a.joomla_plugin_group LIKE '.$search.' OR h.name LIKE '.$search.')'); + } + } + + // Filter by Name. + if ($name = $this->getState('filter.name')) + { + $query->where('a.name = ' . $db->quote($db->escape($name))); + } + // Filter by class_extends. + if ($class_extends = $this->getState('filter.class_extends')) + { + $query->where('a.class_extends = ' . $db->quote($db->escape($class_extends))); + } + // Filter by joomla_plugin_group. + if ($joomla_plugin_group = $this->getState('filter.joomla_plugin_group')) + { + $query->where('a.joomla_plugin_group = ' . $db->quote($db->escape($joomla_plugin_group))); + } + + // Add the list ordering clause. + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'asc'); + if ($orderCol != '') + { + $query->order($db->escape($orderCol . ' ' . $orderDirn)); + } + + return $query; + } + + /** + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExportData($pks) + { + // setup the query + if (ComponentbuilderHelper::checkArray($pks)) + { + // Set a value to know this is exporting method. + $_export = true; + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_joomla_plugin table + $query->from($db->quoteName('#__componentbuilder_joomla_plugin', 'a')); + $query->where('a.id IN (' . implode(',',$pks) . ')'); + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Order the results by ordering + $query->order('a.ordering ASC'); + + // Load the items + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $items = $db->loadObjectList(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + foreach ($items as $nr => &$item) + { + $access = (JFactory::getUser()->authorise('joomla_plugin.access', 'com_componentbuilder.joomla_plugin.' . (int) $item->id) && JFactory::getUser()->authorise('joomla_plugin.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + // decode main_class_code + $item->main_class_code = base64_decode($item->main_class_code); + // unset the values we don't want exported. + unset($item->asset_id); + unset($item->checked_out); + unset($item->checked_out_time); + } + } + // Add headers to items array. + $headers = $this->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + array_unshift($items,$headers); + } + return $items; + } + } + return false; + } + + /** + * Method to get header. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExImPortHeaders() + { + // Get a db connection. + $db = JFactory::getDbo(); + // get the columns + $columns = $db->getTableColumns("#__componentbuilder_joomla_plugin"); + if (ComponentbuilderHelper::checkArray($columns)) + { + // remove the headers you don't import/export. + unset($columns['asset_id']); + unset($columns['checked_out']); + unset($columns['checked_out_time']); + $headers = new stdClass(); + foreach ($columns as $column => $type) + { + $headers->{$column} = $column; + } + return $headers; + } + return false; + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.id'); + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.ordering'); + $id .= ':' . $this->getState('filter.created_by'); + $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.class_extends'); + $id .= ':' . $this->getState('filter.joomla_plugin_group'); + + return parent::getStoreId($id); + } + + /** + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ + protected function checkInNow() + { + // Get set check in time + $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); + + if ($time) + { + + // Get a db connection. + $db = JFactory::getDbo(); + // reset query + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->quoteName('#__componentbuilder_joomla_plugin')); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // Get Yesterdays date + $date = JFactory::getDate()->modify($time)->toSql(); + // reset query + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', + $db->quoteName('checked_out') . '=0' + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('checked_out') . '!=0', + $db->quoteName('checked_out_time') . '<\''.$date.'\'' + ); + + // Check table + $query->update($db->quoteName('#__componentbuilder_joomla_plugin'))->set($fields)->where($conditions); + + $db->setQuery($query); + + $db->execute(); + } + } + + return false; + } +} diff --git a/admin/models/server.php b/admin/models/server.php index c526099f1..fe78c987f 100644 --- a/admin/models/server.php +++ b/admin/models/server.php @@ -189,7 +189,7 @@ class ComponentbuilderModelServer extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVyalinked_components() + public function getVyclinked_components() { // Get the user object. $user = JFactory::getUser(); diff --git a/admin/models/validation_rule.php b/admin/models/validation_rule.php index 5ac0ca8b3..0f39411b2 100644 --- a/admin/models/validation_rule.php +++ b/admin/models/validation_rule.php @@ -74,10 +74,17 @@ class ComponentbuilderModelValidation_rule extends JModelAdmin return JTable::getInstance($type, $prefix, $config); } + /** + * get VDM session key + * + * @return string the session key + * + */ public function getVDM() { return $this->vastDevMod; } + /** * Method to get a single record. diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 6ad006031..af0592031 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -141,6 +141,39 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` ( KEY `idx_adduikit` (`adduikit`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `class_extends` INT(11) NOT NULL DEFAULT 0, + `fields` TEXT NOT NULL, + `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, + `main_class_code` MEDIUMTEXT NOT NULL, + `method_selection` TEXT NOT NULL, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `property_selection` TEXT NOT NULL, + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_class_extends` (`class_extends`), + KEY `idx_joomla_plugin_group` (`joomla_plugin_group`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_view` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', @@ -624,6 +657,71 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_custom_code` ( KEY `idx_from_line` (`from_line`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_property` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `comment` TEXT NOT NULL, + `default` VARCHAR(255) NOT NULL DEFAULT '', + `extension_type` VARCHAR(64) NOT NULL DEFAULT '', + `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `visibility` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_visibility` (`visibility`), + KEY `idx_joomla_plugin_group` (`joomla_plugin_group`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_method` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `arguments` TEXT NOT NULL, + `code` MEDIUMTEXT NOT NULL, + `comment` TEXT NOT NULL, + `extension_type` VARCHAR(64) NOT NULL DEFAULT '', + `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `visibility` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_visibility` (`visibility`), + KEY `idx_joomla_plugin_group` (`joomla_plugin_group`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + CREATE TABLE IF NOT EXISTS `#__componentbuilder_placeholder` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', @@ -1432,6 +1530,61 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_library_files_folders_urls` ( KEY `idx_library` (`library`) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_extends` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `comment` TEXT NOT NULL, + `extension_type` VARCHAR(64) NOT NULL DEFAULT '', + `head` TEXT NOT NULL, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin_group` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `class_extends` INT(11) NOT NULL DEFAULT 0, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_class_extends` (`class_extends`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + -- -- Dumping data for table `#__componentbuilder_joomla_component` -- diff --git a/admin/sql/uninstall.mysql.utf8.sql b/admin/sql/uninstall.mysql.utf8.sql index 6dbe36b9e..294a05896 100644 --- a/admin/sql/uninstall.mysql.utf8.sql +++ b/admin/sql/uninstall.mysql.utf8.sql @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS `#__componentbuilder_joomla_component`; +DROP TABLE IF EXISTS `#__componentbuilder_joomla_plugin`; DROP TABLE IF EXISTS `#__componentbuilder_admin_view`; DROP TABLE IF EXISTS `#__componentbuilder_custom_admin_view`; DROP TABLE IF EXISTS `#__componentbuilder_site_view`; @@ -6,6 +7,8 @@ DROP TABLE IF EXISTS `#__componentbuilder_template`; DROP TABLE IF EXISTS `#__componentbuilder_layout`; DROP TABLE IF EXISTS `#__componentbuilder_dynamic_get`; DROP TABLE IF EXISTS `#__componentbuilder_custom_code`; +DROP TABLE IF EXISTS `#__componentbuilder_class_property`; +DROP TABLE IF EXISTS `#__componentbuilder_class_method`; DROP TABLE IF EXISTS `#__componentbuilder_placeholder`; DROP TABLE IF EXISTS `#__componentbuilder_library`; DROP TABLE IF EXISTS `#__componentbuilder_snippet`; @@ -33,4 +36,6 @@ DROP TABLE IF EXISTS `#__componentbuilder_component_placeholders`; DROP TABLE IF EXISTS `#__componentbuilder_snippet_type`; DROP TABLE IF EXISTS `#__componentbuilder_library_config`; DROP TABLE IF EXISTS `#__componentbuilder_library_files_folders_urls`; +DROP TABLE IF EXISTS `#__componentbuilder_class_extends`; +DROP TABLE IF EXISTS `#__componentbuilder_joomla_plugin_group`; DROP TABLE IF EXISTS `#__componentbuilder_external_code`; diff --git a/admin/sql/updates/mysql/2.9.21.sql b/admin/sql/updates/mysql/2.9.21.sql new file mode 100644 index 000000000..bbb847f84 --- /dev/null +++ b/admin/sql/updates/mysql/2.9.21.sql @@ -0,0 +1,59 @@ +CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `class_extends` INT(11) NOT NULL DEFAULT 0, + `fields` TEXT NOT NULL, + `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, + `main_class_code` MEDIUMTEXT NOT NULL, + `method_selection` TEXT NOT NULL, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `property_selection` TEXT NOT NULL, + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_class_extends` (`class_extends`), + KEY `idx_joomla_plugin_group` (`joomla_plugin_group`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin_group` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `class_extends` INT(11) NOT NULL DEFAULT 0, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_class_extends` (`class_extends`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/admin/sql/updates/mysql/2.9.31.sql b/admin/sql/updates/mysql/2.9.31.sql new file mode 100644 index 000000000..c4c444e5c --- /dev/null +++ b/admin/sql/updates/mysql/2.9.31.sql @@ -0,0 +1,92 @@ +CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_property` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `comment` TEXT NOT NULL, + `default` VARCHAR(255) NOT NULL DEFAULT '', + `extension_type` VARCHAR(64) NOT NULL DEFAULT '', + `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `visibility` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_visibility` (`visibility`), + KEY `idx_joomla_plugin_group` (`joomla_plugin_group`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_method` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `arguments` TEXT NOT NULL, + `code` MEDIUMTEXT NOT NULL, + `comment` TEXT NOT NULL, + `extension_type` VARCHAR(64) NOT NULL DEFAULT '', + `joomla_plugin_group` INT(11) NOT NULL DEFAULT 0, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `visibility` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`), + KEY `idx_visibility` (`visibility`), + KEY `idx_joomla_plugin_group` (`joomla_plugin_group`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; + +CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_extends` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `comment` TEXT NOT NULL, + `extension_type` VARCHAR(64) NOT NULL DEFAULT '', + `head` TEXT NOT NULL, + `name` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL, + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; diff --git a/admin/tables/class_extends.php b/admin/tables/class_extends.php new file mode 100644 index 000000000..90b312ccc --- /dev/null +++ b/admin/tables/class_extends.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Class_extendings Table class + */ +class ComponentbuilderTableClass_extends extends JTable +{ + /** + * Ensure the params and metadata in json encoded in the bind method + * + * @var array + * @since 3.3 + */ + protected $_jsonEncode = array('params', 'metadata'); + + /** + * Constructor + * + * @param object Database connector object + */ + function __construct(&$db) + { + parent::__construct('#__componentbuilder_class_extends', 'id', $db); + + // Adding History Options + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.class_extends')); + } + + public function bind($array, $ignore = '') + { + + if (isset($array['params']) && is_array($array['params'])) + { + $registry = new JRegistry; + $registry->loadArray($array['params']); + $array['params'] = (string) $registry; + } + + if (isset($array['metadata']) && is_array($array['metadata'])) + { + $registry = new JRegistry; + $registry->loadArray($array['metadata']); + $array['metadata'] = (string) $registry; + } + + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new JAccessRules($array['rules']); + $this->setRules($rules); + } + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the Class_extends table. + * + * @param boolean Toggle whether null values should be updated. + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + // New class_extends. A class_extends created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date->toSql(); + } + if (empty($this->created_by)) + { + $this->created_by = $user->get('id'); + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = JTable::getInstance('class_extends', 'ComponentbuilderTable'); + + if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_ERROR_UNIQUE_ALIAS')); + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = JStringPunycode::urlToPunycode($this->url); + } + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = JStringPunycode::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + */ + public function check() + { + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = JTable::getInstance('class_extends', 'componentbuilderTable'); + + while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = JString::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = array(); + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty JAccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_componentbuilder.class_extends.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + } + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return JAccessRules The JAccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset alread set so use saved rules + $assetId = (int) $db->loadResult(); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof JAccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count( (array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return JAccess::getAssetRules(0); + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form 'table_name.id' + * where id is the value of the primary key of the table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + return 'com_componentbuilder.class_extends.'.(int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetTitle() + { + if (isset($this->title)) + { + return $this->title; + } + return ''; + } + + /** + * Get the parent asset id for the record + * + * @return int + * @since 2.5 + */ + protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + { + $asset = JTable::getInstance('Asset'); + $asset->loadByName('com_componentbuilder'); + + return $asset->id; + } + + /** + * This view does not actually have an alias + * + * @return bool + */ + public function generateAlias() + { + return false; + } + +} diff --git a/admin/tables/class_method.php b/admin/tables/class_method.php new file mode 100644 index 000000000..72e836850 --- /dev/null +++ b/admin/tables/class_method.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Class_methods Table class + */ +class ComponentbuilderTableClass_method extends JTable +{ + /** + * Ensure the params and metadata in json encoded in the bind method + * + * @var array + * @since 3.3 + */ + protected $_jsonEncode = array('params', 'metadata'); + + /** + * Constructor + * + * @param object Database connector object + */ + function __construct(&$db) + { + parent::__construct('#__componentbuilder_class_method', 'id', $db); + + // Adding History Options + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.class_method')); + } + + public function bind($array, $ignore = '') + { + + if (isset($array['params']) && is_array($array['params'])) + { + $registry = new JRegistry; + $registry->loadArray($array['params']); + $array['params'] = (string) $registry; + } + + if (isset($array['metadata']) && is_array($array['metadata'])) + { + $registry = new JRegistry; + $registry->loadArray($array['metadata']); + $array['metadata'] = (string) $registry; + } + + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new JAccessRules($array['rules']); + $this->setRules($rules); + } + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the Class_method table. + * + * @param boolean Toggle whether null values should be updated. + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + // New class_method. A class_method created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date->toSql(); + } + if (empty($this->created_by)) + { + $this->created_by = $user->get('id'); + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = JTable::getInstance('class_method', 'ComponentbuilderTable'); + + if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_ERROR_UNIQUE_ALIAS')); + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = JStringPunycode::urlToPunycode($this->url); + } + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = JStringPunycode::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + */ + public function check() + { + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = JTable::getInstance('class_method', 'componentbuilderTable'); + + while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = JString::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = array(); + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty JAccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_componentbuilder.class_method.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + } + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return JAccessRules The JAccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset alread set so use saved rules + $assetId = (int) $db->loadResult(); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof JAccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count( (array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return JAccess::getAssetRules(0); + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form 'table_name.id' + * where id is the value of the primary key of the table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + return 'com_componentbuilder.class_method.'.(int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetTitle() + { + if (isset($this->title)) + { + return $this->title; + } + return ''; + } + + /** + * Get the parent asset id for the record + * + * @return int + * @since 2.5 + */ + protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + { + $asset = JTable::getInstance('Asset'); + $asset->loadByName('com_componentbuilder'); + + return $asset->id; + } + + /** + * This view does not actually have an alias + * + * @return bool + */ + public function generateAlias() + { + return false; + } + +} diff --git a/admin/tables/class_property.php b/admin/tables/class_property.php new file mode 100644 index 000000000..6aaf9b3e6 --- /dev/null +++ b/admin/tables/class_property.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Class_properties Table class + */ +class ComponentbuilderTableClass_property extends JTable +{ + /** + * Ensure the params and metadata in json encoded in the bind method + * + * @var array + * @since 3.3 + */ + protected $_jsonEncode = array('params', 'metadata'); + + /** + * Constructor + * + * @param object Database connector object + */ + function __construct(&$db) + { + parent::__construct('#__componentbuilder_class_property', 'id', $db); + + // Adding History Options + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.class_property')); + } + + public function bind($array, $ignore = '') + { + + if (isset($array['params']) && is_array($array['params'])) + { + $registry = new JRegistry; + $registry->loadArray($array['params']); + $array['params'] = (string) $registry; + } + + if (isset($array['metadata']) && is_array($array['metadata'])) + { + $registry = new JRegistry; + $registry->loadArray($array['metadata']); + $array['metadata'] = (string) $registry; + } + + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new JAccessRules($array['rules']); + $this->setRules($rules); + } + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the Class_property table. + * + * @param boolean Toggle whether null values should be updated. + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + // New class_property. A class_property created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date->toSql(); + } + if (empty($this->created_by)) + { + $this->created_by = $user->get('id'); + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = JTable::getInstance('class_property', 'ComponentbuilderTable'); + + if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_ERROR_UNIQUE_ALIAS')); + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = JStringPunycode::urlToPunycode($this->url); + } + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = JStringPunycode::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + */ + public function check() + { + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = JTable::getInstance('class_property', 'componentbuilderTable'); + + while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = JString::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = array(); + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty JAccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_componentbuilder.class_property.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + } + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return JAccessRules The JAccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset alread set so use saved rules + $assetId = (int) $db->loadResult(); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof JAccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count( (array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return JAccess::getAssetRules(0); + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form 'table_name.id' + * where id is the value of the primary key of the table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + return 'com_componentbuilder.class_property.'.(int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetTitle() + { + if (isset($this->title)) + { + return $this->title; + } + return ''; + } + + /** + * Get the parent asset id for the record + * + * @return int + * @since 2.5 + */ + protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + { + $asset = JTable::getInstance('Asset'); + $asset->loadByName('com_componentbuilder'); + + return $asset->id; + } + + /** + * This view does not actually have an alias + * + * @return bool + */ + public function generateAlias() + { + return false; + } + +} diff --git a/admin/tables/joomla_plugin.php b/admin/tables/joomla_plugin.php new file mode 100644 index 000000000..9003ccf6a --- /dev/null +++ b/admin/tables/joomla_plugin.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Joomla_plugins Table class + */ +class ComponentbuilderTableJoomla_plugin extends JTable +{ + /** + * Ensure the params and metadata in json encoded in the bind method + * + * @var array + * @since 3.3 + */ + protected $_jsonEncode = array('params', 'metadata'); + + /** + * Constructor + * + * @param object Database connector object + */ + function __construct(&$db) + { + parent::__construct('#__componentbuilder_joomla_plugin', 'id', $db); + + // Adding History Options + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.joomla_plugin')); + } + + public function bind($array, $ignore = '') + { + + if (isset($array['params']) && is_array($array['params'])) + { + $registry = new JRegistry; + $registry->loadArray($array['params']); + $array['params'] = (string) $registry; + } + + if (isset($array['metadata']) && is_array($array['metadata'])) + { + $registry = new JRegistry; + $registry->loadArray($array['metadata']); + $array['metadata'] = (string) $registry; + } + + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new JAccessRules($array['rules']); + $this->setRules($rules); + } + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the Joomla_plugin table. + * + * @param boolean Toggle whether null values should be updated. + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + // New joomla_plugin. A joomla_plugin created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date->toSql(); + } + if (empty($this->created_by)) + { + $this->created_by = $user->get('id'); + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = JTable::getInstance('joomla_plugin', 'ComponentbuilderTable'); + + if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ERROR_UNIQUE_ALIAS')); + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = JStringPunycode::urlToPunycode($this->url); + } + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = JStringPunycode::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + */ + public function check() + { + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = JTable::getInstance('joomla_plugin', 'componentbuilderTable'); + + while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = JString::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = array(); + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty JAccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_componentbuilder.joomla_plugin.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + } + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return JAccessRules The JAccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset alread set so use saved rules + $assetId = (int) $db->loadResult(); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof JAccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count( (array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return JAccess::getAssetRules(0); + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form 'table_name.id' + * where id is the value of the primary key of the table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + return 'com_componentbuilder.joomla_plugin.'.(int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetTitle() + { + if (isset($this->title)) + { + return $this->title; + } + return ''; + } + + /** + * Get the parent asset id for the record + * + * @return int + * @since 2.5 + */ + protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + { + $asset = JTable::getInstance('Asset'); + $asset->loadByName('com_componentbuilder'); + + return $asset->id; + } + + /** + * This view does not actually have an alias + * + * @return bool + */ + public function generateAlias() + { + return false; + } + +} diff --git a/admin/tables/joomla_plugin_group.php b/admin/tables/joomla_plugin_group.php new file mode 100644 index 000000000..e9995623f --- /dev/null +++ b/admin/tables/joomla_plugin_group.php @@ -0,0 +1,321 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +/** + * Joomla_plugin_groups Table class + */ +class ComponentbuilderTableJoomla_plugin_group extends JTable +{ + /** + * Ensure the params and metadata in json encoded in the bind method + * + * @var array + * @since 3.3 + */ + protected $_jsonEncode = array('params', 'metadata'); + + /** + * Constructor + * + * @param object Database connector object + */ + function __construct(&$db) + { + parent::__construct('#__componentbuilder_joomla_plugin_group', 'id', $db); + + // Adding History Options + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.joomla_plugin_group')); + } + + public function bind($array, $ignore = '') + { + + if (isset($array['params']) && is_array($array['params'])) + { + $registry = new JRegistry; + $registry->loadArray($array['params']); + $array['params'] = (string) $registry; + } + + if (isset($array['metadata']) && is_array($array['metadata'])) + { + $registry = new JRegistry; + $registry->loadArray($array['metadata']); + $array['metadata'] = (string) $registry; + } + + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new JAccessRules($array['rules']); + $this->setRules($rules); + } + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the Joomla_plugin_group table. + * + * @param boolean Toggle whether null values should be updated. + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + // New joomla_plugin_group. A joomla_plugin_group created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date->toSql(); + } + if (empty($this->created_by)) + { + $this->created_by = $user->get('id'); + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = JTable::getInstance('joomla_plugin_group', 'ComponentbuilderTable'); + + if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ERROR_UNIQUE_ALIAS')); + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = JStringPunycode::urlToPunycode($this->url); + } + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = JStringPunycode::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + */ + public function check() + { + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = JTable::getInstance('joomla_plugin_group', 'componentbuilderTable'); + + while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = JString::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = array(); + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty JAccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_componentbuilder.joomla_plugin_group.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + } + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return JAccessRules The JAccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset alread set so use saved rules + $assetId = (int) $db->loadResult(); + return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof JAccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count( (array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return JAccess::getAssetRules(0); + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form 'table_name.id' + * where id is the value of the primary key of the table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + return 'com_componentbuilder.joomla_plugin_group.'.(int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetTitle() + { + if (isset($this->title)) + { + return $this->title; + } + return ''; + } + + /** + * Get the parent asset id for the record + * + * @return int + * @since 2.5 + */ + protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + { + $asset = JTable::getInstance('Asset'); + $asset->loadByName('com_componentbuilder'); + + return $asset->id; + } + + /** + * This view does not actually have an alias + * + * @return bool + */ + public function generateAlias() + { + return false; + } + +} diff --git a/admin/views/admin_view/tmpl/edit.php b/admin/views/admin_view/tmpl/edit.php index 16f4ebaea..9d8c1b4d6 100644 --- a/admin/views/admin_view/tmpl/edit.php +++ b/admin/views/admin_view/tmpl/edit.php @@ -208,442 +208,408 @@ $componentParams = $this->params; // will be removed just use $this->params inst +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_batch_body.php b/admin/views/class_extendings/tmpl/default_batch_body.php new file mode 100644 index 000000000..ac5af986b --- /dev/null +++ b/admin/views/class_extendings/tmpl/default_batch_body.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_batch_footer.php b/admin/views/class_extendings/tmpl/default_batch_footer.php new file mode 100644 index 000000000..05d4c2fd3 --- /dev/null +++ b/admin/views/class_extendings/tmpl/default_batch_footer.php @@ -0,0 +1,23 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + + + \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_body.php b/admin/views/class_extendings/tmpl/default_body.php new file mode 100644 index 000000000..1f0a5343e --- /dev/null +++ b/admin/views/class_extendings/tmpl/default_body.php @@ -0,0 +1,97 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +$edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_extends.edit"; + +?> +items as $i => $item): ?> + user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('class_extends',$item,'class_extendings'); + ?> + + + get('class_extends.edit.state')): ?> + saveOrder) + { + $iconClass = ' inactive'; + } + else + { + $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + } + ?> + + + + saveOrder) : ?> + + + + ⋮ + + + + get('class_extends.edit')): ?> + checked_out) : ?> + + id); ?> + + □ + + + id); ?> + + + □ + + + +
+ get('class_extends.edit')): ?> + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'class_extendings.', $canCheckin); ?> + + + escape($item->name); ?> + +
+ + + extension_type); ?> + + + get('class_extends.edit.state')) : ?> + checked_out) : ?> + + published, $i, 'class_extendings.', true, 'cb'); ?> + + published, $i, 'class_extendings.', false, 'cb'); ?> + + + published, $i, 'class_extendings.', true, 'cb'); ?> + + + published, $i, 'class_extendings.', false, 'cb'); ?> + + + + id; ?> + + + \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_foot.php b/admin/views/class_extendings/tmpl/default_foot.php new file mode 100644 index 000000000..5d5ceb4bf --- /dev/null +++ b/admin/views/class_extendings/tmpl/default_foot.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_head.php b/admin/views/class_extendings/tmpl/default_head.php new file mode 100644 index 000000000..6dd2ebea1 --- /dev/null +++ b/admin/views/class_extendings/tmpl/default_head.php @@ -0,0 +1,50 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + canEdit&& $this->canState): ?> + + ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + + + + + + + ▾ + + + ■ + + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + canState): ?> + + listDirn, $this->listOrder); ?> + + + + + + + + listDirn, $this->listOrder); ?> + + \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_toolbar.php b/admin/views/class_extendings/tmpl/default_toolbar.php new file mode 100644 index 000000000..d1859740b --- /dev/null +++ b/admin/views/class_extendings/tmpl/default_toolbar.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/index.html b/admin/views/class_extendings/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/class_extendings/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/class_extendings/view.html.php b/admin/views/class_extendings/view.html.php new file mode 100644 index 000000000..8b29a0412 --- /dev/null +++ b/admin/views/class_extendings/view.html.php @@ -0,0 +1,294 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Componentbuilder View class for the Class_extendings + */ +class ComponentbuilderViewClass_extendings extends JViewLegacy +{ + /** + * Class_extendings view display method + * @return void + */ + function display($tpl = null) + { + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('class_extendings'); + } + + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->user = JFactory::getUser(); + $this->listOrder = $this->escape($this->state->get('list.ordering')); + $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('class_extends'); + $this->canEdit = $this->canDo->get('class_extends.edit'); + $this->canState = $this->canDo->get('class_extends.edit.state'); + $this->canCreate = $this->canDo->get('class_extends.create'); + $this->canDelete = $this->canDo->get('class_extends.delete'); + $this->canBatch = $this->canDo->get('core.batch'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'), 'joomla'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_extendings'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + + if ($this->canCreate) + { + JToolBarHelper::addNew('class_extends.add'); + } + + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) + { + if ($this->canEdit) + { + JToolBarHelper::editList('class_extends.edit'); + } + + if ($this->canState) + { + JToolBarHelper::publishList('class_extendings.publish'); + JToolBarHelper::unpublishList('class_extendings.unpublish'); + JToolBarHelper::archiveList('class_extendings.archive'); + + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('class_extendings.checkin'); + } + } + + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'class_extendings.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('class_extendings.trash'); + } + } + + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('class_extendings'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Set Extension Type Selection + $this->extension_typeOptions = $this->getTheExtension_typeSelections(); + // We do some sanitation for Extension Type filter + if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + isset($this->extension_typeOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + { + unset($this->extension_typeOptions[0]); + } + // Only load Extension Type filter if it has values + if (ComponentbuilderHelper::checkArray($this->extension_typeOptions)) + { + // Extension Type Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -', + 'filter_extension_type', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text', $this->state->get('filter.extension_type')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Extension Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -', + 'batch[extension_type]', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + ); + } + } + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_extendings.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 50) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array Array containing the field name to sort by as the key and display text as value + */ + protected function getSortFields() + { + return array( + 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL'), + 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } + + protected function getTheExtension_typeSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('extension_type')); + $query->from($db->quoteName('#__componentbuilder_class_extends')); + $query->order($db->quoteName('extension_type') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $extension_type) + { + // Translate the extension_type selection + $text = $model->selectionTranslation($extension_type,'extension_type'); + // Now add the extension_type and its text to the options array + $_filter[] = JHtml::_('select.option', $extension_type, JText::_($text)); + } + return $_filter; + } + return false; + } +} diff --git a/admin/views/class_extends/submitbutton.js b/admin/views/class_extends/submitbutton.js new file mode 100644 index 000000000..4072e12b8 --- /dev/null +++ b/admin/views/class_extends/submitbutton.js @@ -0,0 +1,25 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var action = task.split('.'); + if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ + Joomla.submitform(task, document.getElementById("adminForm")); + return true; + } else { + alert(Joomla.JText._('class_extends, some values are not acceptable.','Some values are unacceptable')); + return false; + } + } +} \ No newline at end of file diff --git a/admin/views/class_extends/tmpl/edit.php b/admin/views/class_extends/tmpl/edit.php new file mode 100644 index 000000000..014a9f912 --- /dev/null +++ b/admin/views/class_extends/tmpl/edit.php @@ -0,0 +1,111 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +$componentParams = $this->params; // will be removed just use $this->params instead +?> + + diff --git a/admin/views/class_extends/tmpl/index.html b/admin/views/class_extends/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/class_extends/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/class_extends/view.html.php b/admin/views/class_extends/view.html.php new file mode 100644 index 000000000..99b47c24e --- /dev/null +++ b/admin/views/class_extends/view.html.php @@ -0,0 +1,195 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_extends View class + */ +class ComponentbuilderViewClass_extends extends JViewLegacy +{ + /** + * display method of View + * @return void + */ + public function display($tpl = null) + { + // set params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ComponentbuilderHelper::getActions('class_extends', $this->item); + // get input + $jinput = JFactory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string)$this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string)$return; + } + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JFactory::getApplication()->input->set('hidemainmenu', true); + $user = JFactory::getUser(); + $userId = $user->id; + $isNew = $this->item->id == 0; + + JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT'), 'pencil-2 article-add'); + // Built the actions for new and existing records. + if (ComponentbuilderHelper::checkString($this->referral)) + { + if ($this->canDo->get('class_extends.create') && $isNew) + { + // We can create the record. + JToolBarHelper::save('class_extends.save', 'JTOOLBAR_SAVE'); + } + elseif ($this->canDo->get('class_extends.edit')) + { + // We can save the record. + JToolBarHelper::save('class_extends.save', 'JTOOLBAR_SAVE'); + } + if ($isNew) + { + // Do not creat but cancel. + JToolBarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + // We can close it. + JToolBarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE'); + } + } + else + { + if ($isNew) + { + // For new records, check the create permission. + if ($this->canDo->get('class_extends.create')) + { + JToolBarHelper::apply('class_extends.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('class_extends.save', 'JTOOLBAR_SAVE'); + JToolBarHelper::custom('class_extends.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + }; + JToolBarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + if ($this->canDo->get('class_extends.edit')) + { + // We can save the new record + JToolBarHelper::apply('class_extends.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('class_extends.save', 'JTOOLBAR_SAVE'); + // We can save this record, but check the create permission to see + // if we can return to make a new one. + if ($this->canDo->get('class_extends.create')) + { + JToolBarHelper::custom('class_extends.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + } + } + $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('class_extends.version')); + if ($this->state->params->get('save_history', 1) && $this->canDo->get('class_extends.edit') && $canVersion) + { + JToolbarHelper::versions('com_componentbuilder.class_extends', $this->item->id); + } + if ($this->canDo->get('class_extends.create')) + { + JToolBarHelper::custom('class_extends.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + } + JToolBarHelper::cancel('class_extends.cancel', 'JTOOLBAR_CLOSE'); + } + } + JToolbarHelper::divider(); + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('class_extends'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 30) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $isNew = ($this->item->id < 1); + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_extends.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $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/class_extends/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + JText::script('view not acceptable. Error'); + } +} diff --git a/admin/views/class_method/submitbutton.js b/admin/views/class_method/submitbutton.js new file mode 100644 index 000000000..bd292201b --- /dev/null +++ b/admin/views/class_method/submitbutton.js @@ -0,0 +1,25 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var action = task.split('.'); + if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ + Joomla.submitform(task, document.getElementById("adminForm")); + return true; + } else { + alert(Joomla.JText._('class_method, some values are not acceptable.','Some values are unacceptable')); + return false; + } + } +} \ No newline at end of file diff --git a/admin/views/class_method/tmpl/edit.php b/admin/views/class_method/tmpl/edit.php new file mode 100644 index 000000000..051258709 --- /dev/null +++ b/admin/views/class_method/tmpl/edit.php @@ -0,0 +1,130 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +$componentParams = $this->params; // will be removed just use $this->params instead +?> + + + + diff --git a/admin/views/class_method/tmpl/index.html b/admin/views/class_method/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/class_method/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/class_method/view.html.php b/admin/views/class_method/view.html.php new file mode 100644 index 000000000..b453d9379 --- /dev/null +++ b/admin/views/class_method/view.html.php @@ -0,0 +1,195 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_method View class + */ +class ComponentbuilderViewClass_method extends JViewLegacy +{ + /** + * display method of View + * @return void + */ + public function display($tpl = null) + { + // set params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ComponentbuilderHelper::getActions('class_method', $this->item); + // get input + $jinput = JFactory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string)$this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string)$return; + } + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JFactory::getApplication()->input->set('hidemainmenu', true); + $user = JFactory::getUser(); + $userId = $user->id; + $isNew = $this->item->id == 0; + + JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT'), 'pencil-2 article-add'); + // Built the actions for new and existing records. + if (ComponentbuilderHelper::checkString($this->referral)) + { + if ($this->canDo->get('class_method.create') && $isNew) + { + // We can create the record. + JToolBarHelper::save('class_method.save', 'JTOOLBAR_SAVE'); + } + elseif ($this->canDo->get('class_method.edit')) + { + // We can save the record. + JToolBarHelper::save('class_method.save', 'JTOOLBAR_SAVE'); + } + if ($isNew) + { + // Do not creat but cancel. + JToolBarHelper::cancel('class_method.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + // We can close it. + JToolBarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE'); + } + } + else + { + if ($isNew) + { + // For new records, check the create permission. + if ($this->canDo->get('class_method.create')) + { + JToolBarHelper::apply('class_method.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('class_method.save', 'JTOOLBAR_SAVE'); + JToolBarHelper::custom('class_method.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + }; + JToolBarHelper::cancel('class_method.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + if ($this->canDo->get('class_method.edit')) + { + // We can save the new record + JToolBarHelper::apply('class_method.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('class_method.save', 'JTOOLBAR_SAVE'); + // We can save this record, but check the create permission to see + // if we can return to make a new one. + if ($this->canDo->get('class_method.create')) + { + JToolBarHelper::custom('class_method.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + } + } + $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('class_method.version')); + if ($this->state->params->get('save_history', 1) && $this->canDo->get('class_method.edit') && $canVersion) + { + JToolbarHelper::versions('com_componentbuilder.class_method', $this->item->id); + } + if ($this->canDo->get('class_method.create')) + { + JToolBarHelper::custom('class_method.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + } + JToolBarHelper::cancel('class_method.cancel', 'JTOOLBAR_CLOSE'); + } + } + JToolbarHelper::divider(); + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('class_method'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 30) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $isNew = ($this->item->id < 1); + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_method.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $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/class_method/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + JText::script('view not acceptable. Error'); + } +} diff --git a/admin/views/class_methods/index.html b/admin/views/class_methods/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/class_methods/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/class_methods/tmpl/default.php b/admin/views/class_methods/tmpl/default.php new file mode 100644 index 000000000..e5feb483a --- /dev/null +++ b/admin/views/class_methods/tmpl/default.php @@ -0,0 +1,85 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// load tooltip behavior +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); +JHtml::_('formbehavior.chosen', 'select'); + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_methods.saveOrderAjax&tmpl=component'; + JHtml::_('sortablelist.sortable', 'class_methodList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} + +?> + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COMPONENTBUILDER_CLASS_METHODS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + \ No newline at end of file diff --git a/admin/views/class_methods/tmpl/default_batch_body.php b/admin/views/class_methods/tmpl/default_batch_body.php new file mode 100644 index 000000000..859550295 --- /dev/null +++ b/admin/views/class_methods/tmpl/default_batch_body.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/class_methods/tmpl/default_batch_footer.php b/admin/views/class_methods/tmpl/default_batch_footer.php new file mode 100644 index 000000000..aa7259bc5 --- /dev/null +++ b/admin/views/class_methods/tmpl/default_batch_footer.php @@ -0,0 +1,23 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + + + \ No newline at end of file diff --git a/admin/views/class_methods/tmpl/default_body.php b/admin/views/class_methods/tmpl/default_body.php new file mode 100644 index 000000000..b3b54501f --- /dev/null +++ b/admin/views/class_methods/tmpl/default_body.php @@ -0,0 +1,108 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +$edit = "index.php?option=com_componentbuilder&view=class_methods&task=class_method.edit"; + +?> +items as $i => $item): ?> + user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('class_method',$item,'class_methods'); + ?> + + + get('class_method.edit.state')): ?> + saveOrder) + { + $iconClass = ' inactive'; + } + else + { + $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + } + ?> + + + + saveOrder) : ?> + + + + ⋮ + + + + get('class_method.edit')): ?> + checked_out) : ?> + + id); ?> + + □ + + + id); ?> + + + □ + + + +
+ get('class_method.edit')): ?> + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'class_methods.', $canCheckin); ?> + + + escape($item->name); ?> + +
+ + + visibility); ?> + + +
joomla_plugin_group) && ComponentbuilderHelper::checkString($item->joomla_plugin_group)): ?> + + extension_type); ?> : + escape($item->joomla_plugin_group_name); ?> + + + extension_type); ?> + +
+ + + get('class_method.edit.state')) : ?> + checked_out) : ?> + + published, $i, 'class_methods.', true, 'cb'); ?> + + published, $i, 'class_methods.', false, 'cb'); ?> + + + published, $i, 'class_methods.', true, 'cb'); ?> + + + published, $i, 'class_methods.', false, 'cb'); ?> + + + + id; ?> + + + \ No newline at end of file diff --git a/admin/views/class_methods/tmpl/default_foot.php b/admin/views/class_methods/tmpl/default_foot.php new file mode 100644 index 000000000..ac9d333a7 --- /dev/null +++ b/admin/views/class_methods/tmpl/default_foot.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/views/class_methods/tmpl/default_head.php b/admin/views/class_methods/tmpl/default_head.php new file mode 100644 index 000000000..79573ae7c --- /dev/null +++ b/admin/views/class_methods/tmpl/default_head.php @@ -0,0 +1,53 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + canEdit&& $this->canState): ?> + + ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + + + + + + + ▾ + + + ■ + + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + canState): ?> + + listDirn, $this->listOrder); ?> + + + + + + + + listDirn, $this->listOrder); ?> + + \ No newline at end of file diff --git a/admin/views/class_methods/tmpl/default_toolbar.php b/admin/views/class_methods/tmpl/default_toolbar.php new file mode 100644 index 000000000..b615a0921 --- /dev/null +++ b/admin/views/class_methods/tmpl/default_toolbar.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/views/class_methods/tmpl/index.html b/admin/views/class_methods/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/class_methods/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/class_methods/view.html.php b/admin/views/class_methods/view.html.php new file mode 100644 index 000000000..cb52d7e35 --- /dev/null +++ b/admin/views/class_methods/view.html.php @@ -0,0 +1,371 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Componentbuilder View class for the Class_methods + */ +class ComponentbuilderViewClass_methods extends JViewLegacy +{ + /** + * Class_methods view display method + * @return void + */ + function display($tpl = null) + { + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('class_methods'); + } + + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->user = JFactory::getUser(); + $this->listOrder = $this->escape($this->state->get('list.ordering')); + $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('class_method'); + $this->canEdit = $this->canDo->get('class_method.edit'); + $this->canState = $this->canDo->get('class_method.edit.state'); + $this->canCreate = $this->canDo->get('class_method.create'); + $this->canDelete = $this->canDo->get('class_method.delete'); + $this->canBatch = $this->canDo->get('core.batch'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_METHODS'), 'cube'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_methods'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + + if ($this->canCreate) + { + JToolBarHelper::addNew('class_method.add'); + } + + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) + { + if ($this->canEdit) + { + JToolBarHelper::editList('class_method.edit'); + } + + if ($this->canState) + { + JToolBarHelper::publishList('class_methods.publish'); + JToolBarHelper::unpublishList('class_methods.unpublish'); + JToolBarHelper::archiveList('class_methods.archive'); + + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('class_methods.checkin'); + } + } + + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'class_methods.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('class_methods.trash'); + } + + if ($this->canDo->get('core.export') && $this->canDo->get('class_method.export')) + { + JToolBarHelper::custom('class_methods.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + } + } + + if ($this->canDo->get('core.import') && $this->canDo->get('class_method.import')) + { + JToolBarHelper::custom('class_methods.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + } + + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('class_methods'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Set Visibility Selection + $this->visibilityOptions = $this->getTheVisibilitySelections(); + // We do some sanitation for Visibility filter + if (ComponentbuilderHelper::checkArray($this->visibilityOptions) && + isset($this->visibilityOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->visibilityOptions[0]->value)) + { + unset($this->visibilityOptions[0]); + } + // Only load Visibility filter if it has values + if (ComponentbuilderHelper::checkArray($this->visibilityOptions)) + { + // Visibility Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -', + 'filter_visibility', + JHtml::_('select.options', $this->visibilityOptions, 'value', 'text', $this->state->get('filter.visibility')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Visibility Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -', + 'batch[visibility]', + JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') + ); + } + } + + // Set Extension Type Selection + $this->extension_typeOptions = $this->getTheExtension_typeSelections(); + // We do some sanitation for Extension Type filter + if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + isset($this->extension_typeOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + { + unset($this->extension_typeOptions[0]); + } + // Only load Extension Type filter if it has values + if (ComponentbuilderHelper::checkArray($this->extension_typeOptions)) + { + // Extension Type Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -', + 'filter_extension_type', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text', $this->state->get('filter.extension_type')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Extension Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -', + 'batch[extension_type]', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + ); + } + } + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_METHODS')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_methods.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 50) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array Array containing the field name to sort by as the key and display text as value + */ + protected function getSortFields() + { + return array( + 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL'), + 'a.visibility' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL'), + 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } + + protected function getTheVisibilitySelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('visibility')); + $query->from($db->quoteName('#__componentbuilder_class_method')); + $query->order($db->quoteName('visibility') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $visibility) + { + // Translate the visibility selection + $text = $model->selectionTranslation($visibility,'visibility'); + // Now add the visibility and its text to the options array + $_filter[] = JHtml::_('select.option', $visibility, JText::_($text)); + } + return $_filter; + } + return false; + } + + protected function getTheExtension_typeSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('extension_type')); + $query->from($db->quoteName('#__componentbuilder_class_method')); + $query->order($db->quoteName('extension_type') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $extension_type) + { + // Translate the extension_type selection + $text = $model->selectionTranslation($extension_type,'extension_type'); + // Now add the extension_type and its text to the options array + $_filter[] = JHtml::_('select.option', $extension_type, JText::_($text)); + } + return $_filter; + } + return false; + } +} diff --git a/admin/views/class_properties/index.html b/admin/views/class_properties/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/class_properties/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default.php b/admin/views/class_properties/tmpl/default.php new file mode 100644 index 000000000..292fd7243 --- /dev/null +++ b/admin/views/class_properties/tmpl/default.php @@ -0,0 +1,85 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// load tooltip behavior +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); +JHtml::_('formbehavior.chosen', 'select'); + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_properties.saveOrderAjax&tmpl=component'; + JHtml::_('sortablelist.sortable', 'class_propertyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} + +?> + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_batch_body.php b/admin/views/class_properties/tmpl/default_batch_body.php new file mode 100644 index 000000000..79e5c3af1 --- /dev/null +++ b/admin/views/class_properties/tmpl/default_batch_body.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_batch_footer.php b/admin/views/class_properties/tmpl/default_batch_footer.php new file mode 100644 index 000000000..da14e979f --- /dev/null +++ b/admin/views/class_properties/tmpl/default_batch_footer.php @@ -0,0 +1,23 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + + + \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_body.php b/admin/views/class_properties/tmpl/default_body.php new file mode 100644 index 000000000..4e892684d --- /dev/null +++ b/admin/views/class_properties/tmpl/default_body.php @@ -0,0 +1,108 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +$edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_property.edit"; + +?> +items as $i => $item): ?> + user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('class_property',$item,'class_properties'); + ?> + + + get('class_property.edit.state')): ?> + saveOrder) + { + $iconClass = ' inactive'; + } + else + { + $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + } + ?> + + + + saveOrder) : ?> + + + + ⋮ + + + + get('class_property.edit')): ?> + checked_out) : ?> + + id); ?> + + □ + + + id); ?> + + + □ + + + +
+ get('class_property.edit')): ?> + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'class_properties.', $canCheckin); ?> + + + escape($item->name); ?> + +
+ + + visibility); ?> + + +
joomla_plugin_group) && ComponentbuilderHelper::checkString($item->joomla_plugin_group)): ?> + + extension_type); ?> : + escape($item->joomla_plugin_group_name); ?> + + + extension_type); ?> + +
+ + + get('class_property.edit.state')) : ?> + checked_out) : ?> + + published, $i, 'class_properties.', true, 'cb'); ?> + + published, $i, 'class_properties.', false, 'cb'); ?> + + + published, $i, 'class_properties.', true, 'cb'); ?> + + + published, $i, 'class_properties.', false, 'cb'); ?> + + + + id; ?> + + + \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_foot.php b/admin/views/class_properties/tmpl/default_foot.php new file mode 100644 index 000000000..ac9d333a7 --- /dev/null +++ b/admin/views/class_properties/tmpl/default_foot.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_head.php b/admin/views/class_properties/tmpl/default_head.php new file mode 100644 index 000000000..4d064445a --- /dev/null +++ b/admin/views/class_properties/tmpl/default_head.php @@ -0,0 +1,53 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + canEdit&& $this->canState): ?> + + ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + + + + + + + ▾ + + + ■ + + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + canState): ?> + + listDirn, $this->listOrder); ?> + + + + + + + + listDirn, $this->listOrder); ?> + + \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_toolbar.php b/admin/views/class_properties/tmpl/default_toolbar.php new file mode 100644 index 000000000..ad3652bcb --- /dev/null +++ b/admin/views/class_properties/tmpl/default_toolbar.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/views/class_properties/tmpl/index.html b/admin/views/class_properties/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/class_properties/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/class_properties/view.html.php b/admin/views/class_properties/view.html.php new file mode 100644 index 000000000..e7c55ac70 --- /dev/null +++ b/admin/views/class_properties/view.html.php @@ -0,0 +1,371 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Componentbuilder View class for the Class_properties + */ +class ComponentbuilderViewClass_properties extends JViewLegacy +{ + /** + * Class_properties view display method + * @return void + */ + function display($tpl = null) + { + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('class_properties'); + } + + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->user = JFactory::getUser(); + $this->listOrder = $this->escape($this->state->get('list.ordering')); + $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('class_property'); + $this->canEdit = $this->canDo->get('class_property.edit'); + $this->canState = $this->canDo->get('class_property.edit.state'); + $this->canCreate = $this->canDo->get('class_property.create'); + $this->canDelete = $this->canDo->get('class_property.delete'); + $this->canBatch = $this->canDo->get('core.batch'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'), 'cube'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_properties'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + + if ($this->canCreate) + { + JToolBarHelper::addNew('class_property.add'); + } + + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) + { + if ($this->canEdit) + { + JToolBarHelper::editList('class_property.edit'); + } + + if ($this->canState) + { + JToolBarHelper::publishList('class_properties.publish'); + JToolBarHelper::unpublishList('class_properties.unpublish'); + JToolBarHelper::archiveList('class_properties.archive'); + + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('class_properties.checkin'); + } + } + + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'class_properties.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('class_properties.trash'); + } + + if ($this->canDo->get('core.export') && $this->canDo->get('class_property.export')) + { + JToolBarHelper::custom('class_properties.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + } + } + + if ($this->canDo->get('core.import') && $this->canDo->get('class_property.import')) + { + JToolBarHelper::custom('class_properties.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + } + + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('class_properties'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Set Visibility Selection + $this->visibilityOptions = $this->getTheVisibilitySelections(); + // We do some sanitation for Visibility filter + if (ComponentbuilderHelper::checkArray($this->visibilityOptions) && + isset($this->visibilityOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->visibilityOptions[0]->value)) + { + unset($this->visibilityOptions[0]); + } + // Only load Visibility filter if it has values + if (ComponentbuilderHelper::checkArray($this->visibilityOptions)) + { + // Visibility Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -', + 'filter_visibility', + JHtml::_('select.options', $this->visibilityOptions, 'value', 'text', $this->state->get('filter.visibility')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Visibility Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -', + 'batch[visibility]', + JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') + ); + } + } + + // Set Extension Type Selection + $this->extension_typeOptions = $this->getTheExtension_typeSelections(); + // We do some sanitation for Extension Type filter + if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + isset($this->extension_typeOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + { + unset($this->extension_typeOptions[0]); + } + // Only load Extension Type filter if it has values + if (ComponentbuilderHelper::checkArray($this->extension_typeOptions)) + { + // Extension Type Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -', + 'filter_extension_type', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text', $this->state->get('filter.extension_type')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Extension Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -', + 'batch[extension_type]', + JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + ); + } + } + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_properties.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 50) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array Array containing the field name to sort by as the key and display text as value + */ + protected function getSortFields() + { + return array( + 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL'), + 'a.visibility' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL'), + 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } + + protected function getTheVisibilitySelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('visibility')); + $query->from($db->quoteName('#__componentbuilder_class_property')); + $query->order($db->quoteName('visibility') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $visibility) + { + // Translate the visibility selection + $text = $model->selectionTranslation($visibility,'visibility'); + // Now add the visibility and its text to the options array + $_filter[] = JHtml::_('select.option', $visibility, JText::_($text)); + } + return $_filter; + } + return false; + } + + protected function getTheExtension_typeSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('extension_type')); + $query->from($db->quoteName('#__componentbuilder_class_property')); + $query->order($db->quoteName('extension_type') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + // get model + $model = $this->getModel(); + $results = array_unique($results); + $_filter = array(); + foreach ($results as $extension_type) + { + // Translate the extension_type selection + $text = $model->selectionTranslation($extension_type,'extension_type'); + // Now add the extension_type and its text to the options array + $_filter[] = JHtml::_('select.option', $extension_type, JText::_($text)); + } + return $_filter; + } + return false; + } +} diff --git a/admin/views/class_property/submitbutton.js b/admin/views/class_property/submitbutton.js new file mode 100644 index 000000000..29ce1c823 --- /dev/null +++ b/admin/views/class_property/submitbutton.js @@ -0,0 +1,25 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var action = task.split('.'); + if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ + Joomla.submitform(task, document.getElementById("adminForm")); + return true; + } else { + alert(Joomla.JText._('class_property, some values are not acceptable.','Some values are unacceptable')); + return false; + } + } +} \ No newline at end of file diff --git a/admin/views/class_property/tmpl/edit.php b/admin/views/class_property/tmpl/edit.php new file mode 100644 index 000000000..ed0619465 --- /dev/null +++ b/admin/views/class_property/tmpl/edit.php @@ -0,0 +1,125 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +$componentParams = $this->params; // will be removed just use $this->params instead +?> + + + + diff --git a/admin/views/class_property/tmpl/index.html b/admin/views/class_property/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/class_property/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/class_property/view.html.php b/admin/views/class_property/view.html.php new file mode 100644 index 000000000..7e6685019 --- /dev/null +++ b/admin/views/class_property/view.html.php @@ -0,0 +1,195 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Class_property View class + */ +class ComponentbuilderViewClass_property extends JViewLegacy +{ + /** + * display method of View + * @return void + */ + public function display($tpl = null) + { + // set params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ComponentbuilderHelper::getActions('class_property', $this->item); + // get input + $jinput = JFactory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string)$this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string)$return; + } + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JFactory::getApplication()->input->set('hidemainmenu', true); + $user = JFactory::getUser(); + $userId = $user->id; + $isNew = $this->item->id == 0; + + JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT'), 'pencil-2 article-add'); + // Built the actions for new and existing records. + if (ComponentbuilderHelper::checkString($this->referral)) + { + if ($this->canDo->get('class_property.create') && $isNew) + { + // We can create the record. + JToolBarHelper::save('class_property.save', 'JTOOLBAR_SAVE'); + } + elseif ($this->canDo->get('class_property.edit')) + { + // We can save the record. + JToolBarHelper::save('class_property.save', 'JTOOLBAR_SAVE'); + } + if ($isNew) + { + // Do not creat but cancel. + JToolBarHelper::cancel('class_property.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + // We can close it. + JToolBarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE'); + } + } + else + { + if ($isNew) + { + // For new records, check the create permission. + if ($this->canDo->get('class_property.create')) + { + JToolBarHelper::apply('class_property.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('class_property.save', 'JTOOLBAR_SAVE'); + JToolBarHelper::custom('class_property.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + }; + JToolBarHelper::cancel('class_property.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + if ($this->canDo->get('class_property.edit')) + { + // We can save the new record + JToolBarHelper::apply('class_property.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('class_property.save', 'JTOOLBAR_SAVE'); + // We can save this record, but check the create permission to see + // if we can return to make a new one. + if ($this->canDo->get('class_property.create')) + { + JToolBarHelper::custom('class_property.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + } + } + $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('class_property.version')); + if ($this->state->params->get('save_history', 1) && $this->canDo->get('class_property.edit') && $canVersion) + { + JToolbarHelper::versions('com_componentbuilder.class_property', $this->item->id); + } + if ($this->canDo->get('class_property.create')) + { + JToolBarHelper::custom('class_property.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + } + JToolBarHelper::cancel('class_property.cancel', 'JTOOLBAR_CLOSE'); + } + } + JToolbarHelper::divider(); + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('class_property'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 30) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $isNew = ($this->item->id < 1); + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_property.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $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/class_property/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + JText::script('view not acceptable. Error'); + } +} diff --git a/admin/views/custom_admin_view/tmpl/edit.php b/admin/views/custom_admin_view/tmpl/edit.php index 7c857a543..63530be3a 100644 --- a/admin/views/custom_admin_view/tmpl/edit.php +++ b/admin/views/custom_admin_view/tmpl/edit.php @@ -163,153 +163,153 @@ $componentParams = $this->params; // will be removed just use $this->params inst + + + diff --git a/admin/views/joomla_plugin/tmpl/index.html b/admin/views/joomla_plugin/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/joomla_plugin/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/joomla_plugin/view.html.php b/admin/views/joomla_plugin/view.html.php new file mode 100644 index 000000000..60187bdf2 --- /dev/null +++ b/admin/views/joomla_plugin/view.html.php @@ -0,0 +1,216 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Joomla_plugin View class + */ +class ComponentbuilderViewJoomla_plugin extends JViewLegacy +{ + /** + * display method of View + * @return void + */ + public function display($tpl = null) + { + // set params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin', $this->item); + // get input + $jinput = JFactory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string)$this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string)$return; + } + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JFactory::getApplication()->input->set('hidemainmenu', true); + $user = JFactory::getUser(); + $userId = $user->id; + $isNew = $this->item->id == 0; + + JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_EDIT'), 'pencil-2 article-add'); + // Built the actions for new and existing records. + if (ComponentbuilderHelper::checkString($this->referral)) + { + if ($this->canDo->get('joomla_plugin.create') && $isNew) + { + // We can create the record. + JToolBarHelper::save('joomla_plugin.save', 'JTOOLBAR_SAVE'); + } + elseif ($this->canDo->get('joomla_plugin.edit')) + { + // We can save the record. + JToolBarHelper::save('joomla_plugin.save', 'JTOOLBAR_SAVE'); + } + if ($isNew) + { + // Do not creat but cancel. + JToolBarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + // We can close it. + JToolBarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CLOSE'); + } + } + else + { + if ($isNew) + { + // For new records, check the create permission. + if ($this->canDo->get('joomla_plugin.create')) + { + JToolBarHelper::apply('joomla_plugin.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('joomla_plugin.save', 'JTOOLBAR_SAVE'); + JToolBarHelper::custom('joomla_plugin.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + }; + JToolBarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + if ($this->canDo->get('joomla_plugin.edit')) + { + // We can save the new record + JToolBarHelper::apply('joomla_plugin.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('joomla_plugin.save', 'JTOOLBAR_SAVE'); + // We can save this record, but check the create permission to see + // if we can return to make a new one. + if ($this->canDo->get('joomla_plugin.create')) + { + JToolBarHelper::custom('joomla_plugin.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + } + } + $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('joomla_plugin.version')); + if ($this->state->params->get('save_history', 1) && $this->canDo->get('joomla_plugin.edit') && $canVersion) + { + JToolbarHelper::versions('com_componentbuilder.joomla_plugin', $this->item->id); + } + if ($this->canDo->get('joomla_plugin.create')) + { + JToolBarHelper::custom('joomla_plugin.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + } + JToolBarHelper::cancel('joomla_plugin.cancel', 'JTOOLBAR_CLOSE'); + } + } + JToolbarHelper::divider(); + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 30) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $isNew = ($this->item->id < 1); + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_EDIT')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_plugin.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + // Add Ajax Token + $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/joomla_plugin/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'); + + // 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); + // add var key + $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); + // add return_here + $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); + // set some lang + JText::script('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER'); + JText::script('COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS'); + JText::script('COM_COMPONENTBUILDER_NO_RESULTS_MATCH'); + JText::script('COM_COMPONENTBUILDER_SELECT_A_PROPERTY'); + JText::script('COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND'); + JText::script('view not acceptable. Error'); + } +} diff --git a/admin/views/joomla_plugin_group/submitbutton.js b/admin/views/joomla_plugin_group/submitbutton.js new file mode 100644 index 000000000..416ac7411 --- /dev/null +++ b/admin/views/joomla_plugin_group/submitbutton.js @@ -0,0 +1,25 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var action = task.split('.'); + if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ + Joomla.submitform(task, document.getElementById("adminForm")); + return true; + } else { + alert(Joomla.JText._('joomla_plugin_group, some values are not acceptable.','Some values are unacceptable')); + return false; + } + } +} \ No newline at end of file diff --git a/admin/views/joomla_plugin_group/tmpl/edit.php b/admin/views/joomla_plugin_group/tmpl/edit.php new file mode 100644 index 000000000..dfc96bcc4 --- /dev/null +++ b/admin/views/joomla_plugin_group/tmpl/edit.php @@ -0,0 +1,106 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +$componentParams = $this->params; // will be removed just use $this->params instead +?> + + diff --git a/admin/views/joomla_plugin_group/tmpl/index.html b/admin/views/joomla_plugin_group/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/joomla_plugin_group/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/joomla_plugin_group/view.html.php b/admin/views/joomla_plugin_group/view.html.php new file mode 100644 index 000000000..31900844b --- /dev/null +++ b/admin/views/joomla_plugin_group/view.html.php @@ -0,0 +1,195 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Joomla_plugin_group View class + */ +class ComponentbuilderViewJoomla_plugin_group extends JViewLegacy +{ + /** + * display method of View + * @return void + */ + public function display($tpl = null) + { + // set params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin_group', $this->item); + // get input + $jinput = JFactory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string)$this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string)$return; + } + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JFactory::getApplication()->input->set('hidemainmenu', true); + $user = JFactory::getUser(); + $userId = $user->id; + $isNew = $this->item->id == 0; + + JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_EDIT'), 'pencil-2 article-add'); + // Built the actions for new and existing records. + if (ComponentbuilderHelper::checkString($this->referral)) + { + if ($this->canDo->get('core.create') && $isNew) + { + // We can create the record. + JToolBarHelper::save('joomla_plugin_group.save', 'JTOOLBAR_SAVE'); + } + elseif ($this->canDo->get('core.edit')) + { + // We can save the record. + JToolBarHelper::save('joomla_plugin_group.save', 'JTOOLBAR_SAVE'); + } + if ($isNew) + { + // Do not creat but cancel. + JToolBarHelper::cancel('joomla_plugin_group.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + // We can close it. + JToolBarHelper::cancel('joomla_plugin_group.cancel', 'JTOOLBAR_CLOSE'); + } + } + else + { + if ($isNew) + { + // For new records, check the create permission. + if ($this->canDo->get('core.create')) + { + JToolBarHelper::apply('joomla_plugin_group.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('joomla_plugin_group.save', 'JTOOLBAR_SAVE'); + JToolBarHelper::custom('joomla_plugin_group.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + }; + JToolBarHelper::cancel('joomla_plugin_group.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + if ($this->canDo->get('core.edit')) + { + // We can save the new record + JToolBarHelper::apply('joomla_plugin_group.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('joomla_plugin_group.save', 'JTOOLBAR_SAVE'); + // We can save this record, but check the create permission to see + // if we can return to make a new one. + if ($this->canDo->get('core.create')) + { + JToolBarHelper::custom('joomla_plugin_group.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + } + } + $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('joomla_plugin_group.version')); + if ($this->state->params->get('save_history', 1) && $this->canDo->get('core.edit') && $canVersion) + { + JToolbarHelper::versions('com_componentbuilder.joomla_plugin_group', $this->item->id); + } + if ($this->canDo->get('core.create')) + { + JToolBarHelper::custom('joomla_plugin_group.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + } + JToolBarHelper::cancel('joomla_plugin_group.cancel', 'JTOOLBAR_CLOSE'); + } + } + JToolbarHelper::divider(); + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_group'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 30) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $isNew = ($this->item->id < 1); + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_EDIT')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_plugin_group.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $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_plugin_group/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + JText::script('view not acceptable. Error'); + } +} diff --git a/admin/views/joomla_plugin_groups/index.html b/admin/views/joomla_plugin_groups/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/joomla_plugin_groups/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/tmpl/default.php b/admin/views/joomla_plugin_groups/tmpl/default.php new file mode 100644 index 000000000..740225e17 --- /dev/null +++ b/admin/views/joomla_plugin_groups/tmpl/default.php @@ -0,0 +1,85 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// load tooltip behavior +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); +JHtml::_('formbehavior.chosen', 'select'); + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_plugin_groups.saveOrderAjax&tmpl=component'; + JHtml::_('sortablelist.sortable', 'joomla_plugin_groupList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} + +?> + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + \ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/tmpl/default_batch_body.php b/admin/views/joomla_plugin_groups/tmpl/default_batch_body.php new file mode 100644 index 000000000..04c57dde2 --- /dev/null +++ b/admin/views/joomla_plugin_groups/tmpl/default_batch_body.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/tmpl/default_batch_footer.php b/admin/views/joomla_plugin_groups/tmpl/default_batch_footer.php new file mode 100644 index 000000000..600af95e2 --- /dev/null +++ b/admin/views/joomla_plugin_groups/tmpl/default_batch_footer.php @@ -0,0 +1,23 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + + + \ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/tmpl/default_body.php b/admin/views/joomla_plugin_groups/tmpl/default_body.php new file mode 100644 index 000000000..e0d516589 --- /dev/null +++ b/admin/views/joomla_plugin_groups/tmpl/default_body.php @@ -0,0 +1,103 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +$edit = "index.php?option=com_componentbuilder&view=joomla_plugin_groups&task=joomla_plugin_group.edit"; + +?> +items as $i => $item): ?> + user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('joomla_plugin_group',$item,'joomla_plugin_groups'); + ?> + + + get('core.edit.state')): ?> + saveOrder) + { + $iconClass = ' inactive'; + } + else + { + $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + } + ?> + + + + saveOrder) : ?> + + + + ⋮ + + + + get('core.edit')): ?> + checked_out) : ?> + + id); ?> + + □ + + + id); ?> + + + □ + + + +
+ get('core.edit')): ?> + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'joomla_plugin_groups.', $canCheckin); ?> + + + escape($item->name); ?> + +
+ + +
+ user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.' . (int)$item->class_extends)): ?> + escape($item->class_extends_name); ?> + + escape($item->class_extends_name); ?> + +
+ + + get('core.edit.state')) : ?> + checked_out) : ?> + + published, $i, 'joomla_plugin_groups.', true, 'cb'); ?> + + published, $i, 'joomla_plugin_groups.', false, 'cb'); ?> + + + published, $i, 'joomla_plugin_groups.', true, 'cb'); ?> + + + published, $i, 'joomla_plugin_groups.', false, 'cb'); ?> + + + + id; ?> + + + \ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/tmpl/default_foot.php b/admin/views/joomla_plugin_groups/tmpl/default_foot.php new file mode 100644 index 000000000..5d5ceb4bf --- /dev/null +++ b/admin/views/joomla_plugin_groups/tmpl/default_foot.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/tmpl/default_head.php b/admin/views/joomla_plugin_groups/tmpl/default_head.php new file mode 100644 index 000000000..c1ed60a09 --- /dev/null +++ b/admin/views/joomla_plugin_groups/tmpl/default_head.php @@ -0,0 +1,50 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + canEdit&& $this->canState): ?> + + ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + + + + + + + ▾ + + + ■ + + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + canState): ?> + + listDirn, $this->listOrder); ?> + + + + + + + + listDirn, $this->listOrder); ?> + + \ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/tmpl/default_toolbar.php b/admin/views/joomla_plugin_groups/tmpl/default_toolbar.php new file mode 100644 index 000000000..bcb6a01a6 --- /dev/null +++ b/admin/views/joomla_plugin_groups/tmpl/default_toolbar.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/tmpl/index.html b/admin/views/joomla_plugin_groups/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/joomla_plugin_groups/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/joomla_plugin_groups/view.html.php b/admin/views/joomla_plugin_groups/view.html.php new file mode 100644 index 000000000..bccfce0ba --- /dev/null +++ b/admin/views/joomla_plugin_groups/view.html.php @@ -0,0 +1,258 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Componentbuilder View class for the Joomla_plugin_groups + */ +class ComponentbuilderViewJoomla_plugin_groups extends JViewLegacy +{ + /** + * Joomla_plugin_groups view display method + * @return void + */ + function display($tpl = null) + { + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('joomla_plugin_groups'); + } + + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->user = JFactory::getUser(); + $this->listOrder = $this->escape($this->state->get('list.ordering')); + $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin_group'); + $this->canEdit = $this->canDo->get('core.edit'); + $this->canState = $this->canDo->get('core.edit.state'); + $this->canCreate = $this->canDo->get('core.create'); + $this->canDelete = $this->canDo->get('core.delete'); + $this->canBatch = $this->canDo->get('core.batch'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS'), 'joomla'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=joomla_plugin_groups'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + + if ($this->canCreate) + { + JToolBarHelper::addNew('joomla_plugin_group.add'); + } + + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) + { + if ($this->canEdit) + { + JToolBarHelper::editList('joomla_plugin_group.edit'); + } + + if ($this->canState) + { + JToolBarHelper::publishList('joomla_plugin_groups.publish'); + JToolBarHelper::unpublishList('joomla_plugin_groups.unpublish'); + JToolBarHelper::archiveList('joomla_plugin_groups.archive'); + + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('joomla_plugin_groups.checkin'); + } + } + + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'joomla_plugin_groups.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('joomla_plugin_groups.trash'); + } + } + + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_groups'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Set Class Extends Name Selection + $this->class_extendsNameOptions = JFormHelper::loadFieldType('Classextends')->options; + // We do some sanitation for Class Extends Name filter + if (ComponentbuilderHelper::checkArray($this->class_extendsNameOptions) && + isset($this->class_extendsNameOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->class_extendsNameOptions[0]->value)) + { + unset($this->class_extendsNameOptions[0]); + } + // Only load Class Extends Name filter if it has values + if (ComponentbuilderHelper::checkArray($this->class_extendsNameOptions)) + { + // Class Extends Name Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_LABEL').' -', + 'filter_class_extends', + JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text', $this->state->get('filter.class_extends')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Class Extends Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_LABEL').' -', + 'batch[class_extends]', + JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text') + ); + } + } + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_plugin_groups.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 50) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array Array containing the field name to sort by as the key and display text as value + */ + protected function getSortFields() + { + return array( + 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_NAME_LABEL'), + 'g.name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_LABEL'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } +} diff --git a/admin/views/joomla_plugins/index.html b/admin/views/joomla_plugins/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/joomla_plugins/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/joomla_plugins/tmpl/default.php b/admin/views/joomla_plugins/tmpl/default.php new file mode 100644 index 000000000..02db0d9c7 --- /dev/null +++ b/admin/views/joomla_plugins/tmpl/default.php @@ -0,0 +1,108 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// load tooltip behavior +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); +JHtml::_('formbehavior.chosen', 'select'); + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_plugins.saveOrderAjax&tmpl=component'; + JHtml::_('sortablelist.sortable', 'joomla_pluginList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} + +?> + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + + \ No newline at end of file diff --git a/admin/views/joomla_plugins/tmpl/default_batch_body.php b/admin/views/joomla_plugins/tmpl/default_batch_body.php new file mode 100644 index 000000000..9943660cc --- /dev/null +++ b/admin/views/joomla_plugins/tmpl/default_batch_body.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/joomla_plugins/tmpl/default_batch_footer.php b/admin/views/joomla_plugins/tmpl/default_batch_footer.php new file mode 100644 index 000000000..b7dd697fb --- /dev/null +++ b/admin/views/joomla_plugins/tmpl/default_batch_footer.php @@ -0,0 +1,23 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + + + \ No newline at end of file diff --git a/admin/views/joomla_plugins/tmpl/default_body.php b/admin/views/joomla_plugins/tmpl/default_body.php new file mode 100644 index 000000000..965b19fa2 --- /dev/null +++ b/admin/views/joomla_plugins/tmpl/default_body.php @@ -0,0 +1,112 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +$edit = "index.php?option=com_componentbuilder&view=joomla_plugins&task=joomla_plugin.edit"; + +?> +items as $i => $item): ?> + user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('joomla_plugin',$item,'joomla_plugins'); + ?> + + + get('joomla_plugin.edit.state')): ?> + saveOrder) + { + $iconClass = ' inactive'; + } + else + { + $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + } + ?> + + + + saveOrder) : ?> + + + + ⋮ + + + + get('joomla_plugin.edit')): ?> + checked_out) : ?> + + id); ?> + + □ + + + id); ?> + + + □ + + + +
+ get('joomla_plugin.edit')): ?> + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'joomla_plugins.', $canCheckin); ?> + + + escape($item->name); ?> + +
+ + +
+ user->authorise('class_extends.edit', 'com_componentbuilder.class_extends.' . (int)$item->class_extends)): ?> + escape($item->class_extends_name); ?> + + escape($item->class_extends_name); ?> + +
+ + +
+ user->authorise('core.edit', 'com_componentbuilder.joomla_plugin_group.' . (int)$item->joomla_plugin_group)): ?> + escape($item->joomla_plugin_group_name); ?> + + escape($item->joomla_plugin_group_name); ?> + +
+ + + get('joomla_plugin.edit.state')) : ?> + checked_out) : ?> + + published, $i, 'joomla_plugins.', true, 'cb'); ?> + + published, $i, 'joomla_plugins.', false, 'cb'); ?> + + + published, $i, 'joomla_plugins.', true, 'cb'); ?> + + + published, $i, 'joomla_plugins.', false, 'cb'); ?> + + + + id; ?> + + + \ No newline at end of file diff --git a/admin/views/joomla_plugins/tmpl/default_foot.php b/admin/views/joomla_plugins/tmpl/default_foot.php new file mode 100644 index 000000000..ac9d333a7 --- /dev/null +++ b/admin/views/joomla_plugins/tmpl/default_foot.php @@ -0,0 +1,18 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/views/joomla_plugins/tmpl/default_head.php b/admin/views/joomla_plugins/tmpl/default_head.php new file mode 100644 index 000000000..ede0e26b7 --- /dev/null +++ b/admin/views/joomla_plugins/tmpl/default_head.php @@ -0,0 +1,53 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + canEdit&& $this->canState): ?> + + ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + + + + + + + ▾ + + + ■ + + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + canState): ?> + + listDirn, $this->listOrder); ?> + + + + + + + + listDirn, $this->listOrder); ?> + + \ No newline at end of file diff --git a/admin/views/joomla_plugins/tmpl/default_toolbar.php b/admin/views/joomla_plugins/tmpl/default_toolbar.php new file mode 100644 index 000000000..89614dc35 --- /dev/null +++ b/admin/views/joomla_plugins/tmpl/default_toolbar.php @@ -0,0 +1,45 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/views/joomla_plugins/tmpl/index.html b/admin/views/joomla_plugins/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/joomla_plugins/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/joomla_plugins/view.html.php b/admin/views/joomla_plugins/view.html.php new file mode 100644 index 000000000..ddf8a599f --- /dev/null +++ b/admin/views/joomla_plugins/view.html.php @@ -0,0 +1,371 @@ + + * @github Joomla Component Builder + * @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +/** + * Componentbuilder View class for the Joomla_plugins + */ +class ComponentbuilderViewJoomla_plugins extends JViewLegacy +{ + /** + * Joomla_plugins view display method + * @return void + */ + function display($tpl = null) + { + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('joomla_plugins'); + } + + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->user = JFactory::getUser(); + $this->listOrder = $this->escape($this->state->get('list.ordering')); + $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->saveOrder = $this->listOrder == 'ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('joomla_plugin'); + $this->canEdit = $this->canDo->get('joomla_plugin.edit'); + $this->canState = $this->canDo->get('joomla_plugin.edit.state'); + $this->canCreate = $this->canDo->get('joomla_plugin.create'); + $this->canDelete = $this->canDo->get('joomla_plugin.delete'); + $this->canBatch = $this->canDo->get('core.batch'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGINS'), 'power-cord'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=joomla_plugins'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + + if ($this->canCreate) + { + JToolBarHelper::addNew('joomla_plugin.add'); + } + + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) + { + if ($this->canEdit) + { + JToolBarHelper::editList('joomla_plugin.edit'); + } + + if ($this->canState) + { + JToolBarHelper::publishList('joomla_plugins.publish'); + JToolBarHelper::unpublishList('joomla_plugins.unpublish'); + JToolBarHelper::archiveList('joomla_plugins.archive'); + + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('joomla_plugins.checkin'); + } + } + + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'joomla_plugins.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('joomla_plugins.trash'); + } + + if ($this->canDo->get('core.export') && $this->canDo->get('joomla_plugin.export')) + { + JToolBarHelper::custom('joomla_plugins.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + } + } + if ($this->user->authorise('joomla_plugin.run_expansion', 'com_componentbuilder')) + { + // add Run Expansion button. + JToolBarHelper::custom('joomla_plugins.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + } + if ($this->user->authorise('joomla_plugin.get_boilerplate', 'com_componentbuilder')) + { + // add Get Boilerplate button. + JToolBarHelper::custom('joomla_plugins.getBoilerplate', 'joomla', '', 'COM_COMPONENTBUILDER_GET_BOILERPLATE', false); + } + + if ($this->canDo->get('core.import') && $this->canDo->get('joomla_plugin.import')) + { + JToolBarHelper::custom('joomla_plugins.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + } + + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Set Name Selection + $this->nameOptions = $this->getTheNameSelections(); + // We do some sanitation for Name filter + if (ComponentbuilderHelper::checkArray($this->nameOptions) && + isset($this->nameOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->nameOptions[0]->value)) + { + unset($this->nameOptions[0]); + } + // Only load Name filter if it has values + if (ComponentbuilderHelper::checkArray($this->nameOptions)) + { + // Name Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL').' -', + 'filter_name', + JHtml::_('select.options', $this->nameOptions, 'value', 'text', $this->state->get('filter.name')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL').' -', + 'batch[name]', + JHtml::_('select.options', $this->nameOptions, 'value', 'text') + ); + } + } + + // Set Class Extends Name Selection + $this->class_extendsNameOptions = JFormHelper::loadFieldType('Classextends')->options; + // We do some sanitation for Class Extends Name filter + if (ComponentbuilderHelper::checkArray($this->class_extendsNameOptions) && + isset($this->class_extendsNameOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->class_extendsNameOptions[0]->value)) + { + unset($this->class_extendsNameOptions[0]); + } + // Only load Class Extends Name filter if it has values + if (ComponentbuilderHelper::checkArray($this->class_extendsNameOptions)) + { + // Class Extends Name Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL').' -', + 'filter_class_extends', + JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text', $this->state->get('filter.class_extends')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Class Extends Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL').' -', + 'batch[class_extends]', + JHtml::_('select.options', $this->class_extendsNameOptions, 'value', 'text') + ); + } + } + + // Set Joomla Plugin Group Name Selection + $this->joomla_plugin_groupNameOptions = JFormHelper::loadFieldType('Joomlaplugingroups')->options; + // We do some sanitation for Joomla Plugin Group Name filter + if (ComponentbuilderHelper::checkArray($this->joomla_plugin_groupNameOptions) && + isset($this->joomla_plugin_groupNameOptions[0]->value) && + !ComponentbuilderHelper::checkString($this->joomla_plugin_groupNameOptions[0]->value)) + { + unset($this->joomla_plugin_groupNameOptions[0]); + } + // Only load Joomla Plugin Group Name filter if it has values + if (ComponentbuilderHelper::checkArray($this->joomla_plugin_groupNameOptions)) + { + // Joomla Plugin Group Name Filter + JHtmlSidebar::addFilter( + '- Select '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL').' -', + 'filter_joomla_plugin_group', + JHtml::_('select.options', $this->joomla_plugin_groupNameOptions, 'value', 'text', $this->state->get('filter.joomla_plugin_group')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Joomla Plugin Group Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL').' -', + 'batch[joomla_plugin_group]', + JHtml::_('select.options', $this->joomla_plugin_groupNameOptions, 'value', 'text') + ); + } + } + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + if (!isset($this->document)) + { + $this->document = JFactory::getDocument(); + } + $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGINS')); + $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_plugins.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 50) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array Array containing the field name to sort by as the key and display text as value + */ + protected function getSortFields() + { + return array( + 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_LABEL'), + 'g.name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_CLASS_EXTENDS_LABEL'), + 'h.name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } + + protected function getTheNameSelections() + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + + // Select the text. + $query->select($db->quoteName('name')); + $query->from($db->quoteName('#__componentbuilder_joomla_plugin')); + $query->order($db->quoteName('name') . ' ASC'); + + // Reset the query using our newly populated query object. + $db->setQuery($query); + + $results = $db->loadColumn(); + + if ($results) + { + $results = array_unique($results); + $_filter = array(); + foreach ($results as $name) + { + // Now add the name and its text to the options array + $_filter[] = JHtml::_('select.option', $name, $name); + } + return $_filter; + } + return false; + } +} diff --git a/admin/views/layout/tmpl/edit.php b/admin/views/layout/tmpl/edit.php index f064a2642..4c78af24b 100644 --- a/admin/views/layout/tmpl/edit.php +++ b/admin/views/layout/tmpl/edit.php @@ -129,18 +129,18 @@ $componentParams = $this->params; // will be removed just use $this->params inst diff --git a/admin/views/server/view.html.php b/admin/views/server/view.html.php index a6e4ef3a8..df0b969bf 100644 --- a/admin/views/server/view.html.php +++ b/admin/views/server/view.html.php @@ -57,7 +57,7 @@ class ComponentbuilderViewServer extends JViewLegacy } // Get Linked view data - $this->vyalinked_components = $this->get('Vyalinked_components'); + $this->vyclinked_components = $this->get('Vyclinked_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 df756a40c..6db7f903e 100644 --- a/admin/views/site_view/tmpl/edit.php +++ b/admin/views/site_view/tmpl/edit.php @@ -166,168 +166,168 @@ $componentParams = $this->params; // will be removed just use $this->params inst