'.$model->compiler->actualTotalHours.' Hours or '.$model->compiler->actualTotalDays.' Eight Hour Days (a total of the realistic time frame for this project)
';
$message .= '(if creating a folder and file took 5 seconds and writing one line of code took 10 seconds, with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)
Project duration: '.$model->compiler->projectWeekTime. ' weeks or '.$model->compiler->projectMonthTime.' months
'; - $message .= 'Path: '.$model->compiler->filepath.'
';
- $message .= 'URL: '.$url.'
';
- $message .= 'Hey! you can also download the file right now!
Download
Remember! This file is in your tmp folder and therefore publicly accessible untill you click [Clear tmp]!
'; + // check if we have plugins + if (ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins'])) + { + $plugin_url = array(); + $message .= 'Component Path: ' . $model->compiler->filepath['component'] . '
';
+ $message .= 'Component URL: ' . $url . '
';
+ // load the plugins path/url
+ foreach ($model->compiler->filepath['plugins'] as $plugin_id => $plugin_path)
+ {
+ // set plugin path
+ $message .= 'Plugin Path: ' . $plugin_path . '
';
+ if (($pos = strpos($plugin_path, "/tmp/")) !== FALSE)
+ {
+ $plugin_urls[$plugin_id] = JURI::root() . substr($plugin_path, $pos + 1);
+ $message .= 'Plugin URL: ' . $plugin_urls[$plugin_id] . '
';
+ }
+ }
+ $message .= '
Hey! you can also download these zip files right now!
';
+ $message .= 'Download Component ';
+ // load the plugin download URL's
+ foreach ($plugin_urls as $plugin_id => $plugin_url)
+ {
+ $message .= ' ';
+ $message .= 'Download ' . $model->compiler->filepath['plugins-folder'][$plugin_id] . ' ';
+ }
+ $message .= '
Remember! These zip files are in your tmp folder and therefore publicly accessible until you click [Clear tmp]!
'; + } + else + { + $message .= 'Path: ' . $model->compiler->filepath['component'] . '
';
+ $message .= 'URL: ' . $url . '
';
+ $message .= 'Hey! you can also download the zip file right now!
';
+ $message .= 'Download
Remember! This zip file is in your tmp folder and therefore publicly accessible until you click [Clear tmp]!
'; + } $message .= 'Compilation took '.$model->compiler->secondsCompiled.' seconds to complete.
'; // set redirect - $this->setRedirect($redirect_url,$message,'message'); - $app->setUserState('com_componentbuilder.extension_name', $model->compiler->componentFolderName); + $this->setRedirect($redirect_url, $message, 'message'); + $app->setUserState('com_componentbuilder.component_folder_name', $model->compiler->filepath['component-folder']); + // check if we have plugins + if (ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins'])) + { + $app->setUserState('com_componentbuilder.plugins_folder_name', $model->compiler->filepath['plugins-folder']); + } } else { @@ -116,9 +176,10 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin $app->setUserState('com_componentbuilder.redirect_url', ''); $app->setUserState('com_componentbuilder.message', ''); $app->setUserState('com_componentbuilder.extension_message', ''); - $app->setUserState('com_componentbuilder.extension_name', ''); + $app->setUserState('com_componentbuilder.component_folder_name', ''); + $app->setUserState('com_componentbuilder.plugins_folder_name', ''); // set redirect - $this->setRedirect($redirect_url,$message); + $this->setRedirect($redirect_url, $message); } return true; } @@ -126,11 +187,11 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin } /** - * Install Compiled Extension + * Install All Compiled Extensions * * @return true on success */ - public function installExtention() + public function installCompiledExtensions() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); @@ -138,27 +199,133 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin $user = JFactory::getUser(); // set page redirect $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); - $message = 'Could not install component!'; + $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THESE_EXTENSIONS'); if($user->authorise('core.admin')) { - // get the model - $model = $this->getModel('compiler'); + $message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_EXTENTIONS'); + $_message = array('success' => array(), 'error' => array()); $app = JFactory::getApplication(); - $fileName = $app->getUserState('com_componentbuilder.extension_name'); - if (ComponentbuilderHelper::checkString($fileName)) + $fileNames = $app->getUserState('com_componentbuilder.plugins_folder_name', array()); + $fileNames[] = $app->getUserState('com_componentbuilder.component_folder_name', null); + foreach ($fileNames as $fileName) { - $lang = JFactory::getLanguage(); - $extension = 'com_installer'; - $base_dir = JPATH_ADMINISTRATOR; - $language_tag = 'en-GB'; - $reload = true; - $lang->load($extension, $base_dir, $language_tag, $reload); - $message = '('.$fileName.'.zip) file was also removed from tmp!'; - $this->setRedirect($redirect_url,$message,'message'); - return $model->install($fileName.'.zip'); + if ($this->installExtension($fileName)) + { + $_message['success'][] = JText::sprintf('COM_COMPONENTBUILDER_SZIP_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileName); + } + else + { + $_message['error'][] = JText::sprintf('COM_COMPONENTBUILDER_SZIP_COULD_NOT_BE_INSTALLED', $fileName); + } + } + // catch errors + if (ComponentbuilderHelper::checkArray($_message['error'])) + { + $app->enqueueMessage(implode('' . $plugin->description . '
'; + } + $plugin->xml_description = "Created by " . trim(JFilterOutput::cleanText($component->author)) . "
Development started " . JFactory::getDate($plugin->created)->format("jS F, Y") . "
// The path to the administrator folder.
+JPATH_ADMINISTRATOR
+// The path to the installed Joomla! site, or JPATH_ROOT/administrator if executed from the backend.
+JPATH_BASE
+// The path to the cache folder.
+JPATH_CACHE
+// The path to the administration folder of JCB component.
+JPATH_COMPONENT_ADMINISTRATOR no ideal to use
+// The path to the site folder of JCB component.
+JPATH_COMPONENT_SITE no ideal to use
+// The path to the JCB component.
+JPATH_COMPONENT no ideal to use
+// The path to folder containing the configuration.php file.
+JPATH_CONFIGURATION
+// The path to the installation folder.
+JPATH_INSTALLATION
+// The path to the libraries folder.
+JPATH_LIBRARIES
+// The path to the plugins folder.
+JPATH_PLUGINS
+// The path to the installed Joomla! site.
+JPATH_ROOT
+// The path to the installed Joomla! site.
+JPATH_SITE
+// The path to the templates folder.
+JPATH_THEMES
JPATH_SITE is meant to represent the root path of the JSite application,
+just as JPATH_ADMINISTRATOR is mean to represent the root path of the JAdministrator application.
+JPATH_BASE is the root path for the current requested application.... so if you are in the administrator application:
+JPATH_BASE == JPATH_ADMINISTRATOR
+If you are in the site application:
+JPATH_BASE == JPATH_SITE
+If you are in the installation application:
+JPATH_BASE == JPATH_INSTALLATION.
+JPATH_ROOT is the root path for the Joomla install and does not depend upon any application.
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.
%s
"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
+COM_COMPONENTBUILDER_THE_PLUGIN_FILES_FOLDERS="The plugin files & folders"
+COM_COMPONENTBUILDER_THE_PLUGIN_UPDATES="The plugin updates"
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER="The private key field could not be loaded for %s server!"
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for %s server!"
COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading"
@@ -7511,6 +8404,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"
@@ -7550,7 +8445,11 @@ COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LI
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="You do not have permission to access the server details (%s - denied), please contact your system administrator for more info."
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_INSTALL_THESE_EXTENSIONS="You do not have permission to install these extensions!"
+COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_COMPONENT="You do not have permission to install the component!"
+COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_PLUGIN="You do not have permission to install the plugin!"
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..82b14321e 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"
@@ -283,6 +351,26 @@ COM_COMPONENTBUILDER_COMPONENTS_PLACEHOLDERS_EDIT_STATE="Components Placeholders
COM_COMPONENTBUILDER_COMPONENTS_PLACEHOLDERS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component placeholders"
COM_COMPONENTBUILDER_COMPONENTS_PLACEHOLDERS_EDIT_VERSION="Components Placeholders Edit Version"
COM_COMPONENTBUILDER_COMPONENTS_PLACEHOLDERS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components placeholders"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_ACCESS="Components Plugins Access"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_ACCESS_DESC="Allows the users in this group to access access components plugins"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_BATCH_USE="Components Plugins Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components plugins"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_CREATE="Components Plugins Create"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_CREATE_DESC="Allows the users in this group to create create components plugins"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_DELETE="Components Plugins Delete"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_DELETE_DESC="Allows the users in this group to delete delete components plugins"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT="Components Plugins Edit"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_CREATED_BY="Components Plugins Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components plugins"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_CREATED_DATE="Components Plugins Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components plugins"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_DESC="Allows the users in this group to edit the component plugins"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_OWN="Components Plugins Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components plugins created by them"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE="Components Plugins Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component plugins"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION="Components Plugins Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components plugins"
COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS="Components Site Views Access"
COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS_DESC="Allows the users in this group to access access components site views"
COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE="Components Site Views Batch Use"
@@ -520,8 +608,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 +638,84 @@ 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_FILES_FOLDERS_URLS_ACCESS="Joomla Plugins Files Folders Urls Access"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_ACCESS_DESC="Allows the users in this group to access access joomla plugins files folders urls"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_BATCH_USE="Joomla Plugins Files Folders Urls Batch Use"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla plugins files folders urls"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_CREATE="Joomla Plugins Files Folders Urls Create"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_CREATE_DESC="Allows the users in this group to create create joomla plugins files folders urls"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_DELETE="Joomla Plugins Files Folders Urls Delete"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_DELETE_DESC="Allows the users in this group to delete delete joomla plugins files folders urls"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT="Joomla Plugins Files Folders Urls Edit"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_CREATED_BY="Joomla Plugins Files Folders Urls Edit Created By"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by joomla plugins files folders urls"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_CREATED_DATE="Joomla Plugins Files Folders Urls Edit Created Date"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created joomla plugins files folders urls"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_DESC="Allows the users in this group to edit the joomla plugin files folders urls"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_OWN="Joomla Plugins Files Folders Urls Edit Own"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_OWN_DESC="Allows the users in this group to edit edit own joomla plugins files folders urls created by them"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_STATE="Joomla Plugins Files Folders Urls Edit State"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla plugin files folders urls"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_VERSION="Joomla Plugins Files Folders Urls Edit Version"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla plugins files folders urls"
+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_PLUGINS_UPDATES_ACCESS="Joomla Plugins Updates Access"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_ACCESS_DESC="Allows the users in this group to access access joomla plugins updates"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_BATCH_USE="Joomla Plugins Updates Batch Use"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla plugins updates"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_CREATE="Joomla Plugins Updates Create"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_CREATE_DESC="Allows the users in this group to create create joomla plugins updates"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_DELETE="Joomla Plugins Updates Delete"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_DELETE_DESC="Allows the users in this group to delete delete joomla plugins updates"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT="Joomla Plugins Updates Edit"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_CREATED_BY="Joomla Plugins Updates Edit Created By"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by joomla plugins updates"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_CREATED_DATE="Joomla Plugins Updates Edit Created Date"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created joomla plugins updates"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_DESC="Allows the users in this group to edit the joomla plugin updates"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_OWN="Joomla Plugins Updates Edit Own"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_OWN_DESC="Allows the users in this group to edit edit own joomla plugins updates created by them"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_STATE="Joomla Plugins Updates Edit State"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla plugin updates"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_VERSION="Joomla Plugins Updates Edit Version"
+COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla plugins updates"
+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_METHODS_BUTTON_ACCESS="Joomla Plugin Methods Button Access"
+COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHODS_BUTTON_ACCESS_DESC="Allows the users in this group to access the methods button."
+COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTIES_BUTTON_ACCESS="Joomla Plugin Properties Button Access"
+COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTIES_BUTTON_ACCESS_DESC="Allows the users in this group to access the properties button."
+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 +864,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 +1050,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 site<\\/code> or 0<\\/code>
Backend: admin<\\/code> or 1<\\/code>\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"true\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) The rows to be multiple.\"},\"properties7\":{\"name\":\"buttons\",\"example\":\"add,remove,move\",\"adjustable\":\"1\",\"description\":\"(optional) Which buttons to show if multiple mode is true.
Options: add,remove,move<\\/code>\"},\"properties8\":{\"name\":\"fields\",\"example\":\"1,2,3\",\"adjustable\":\"1\",\"description\":\"(mandatory) The fields to add to the modal. All fields must first be created in component builder as a field before you can add them here, since you must use the id of the field. Separate the field ids with commas. Do not add custom fields that are not also used in this component.\"},\"properties9\":{\"name\":\"formsource\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) you can add a path to a xml file containing the fields.\"},\"properties10\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) description text for the form field. Displays at the top of the modal with the name as well as in the usual position in the form\"},\"properties11\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The default value for the form field if the field is left empty. Note this has to be a json string compatible with the contents of the form field.\"},\"properties12\":{\"name\":\"icon\",\"example\":\"list\",\"adjustable\":\"1\",\"description\":\"(optional) The icon to show on the select button (is prefixed with \\\"icon-\\\").\"},\"properties13\":{\"name\":\"max\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) The maximum number of rows of fields allowed (by default 999 to be effectively infinite)\"},\"properties14\":{\"name\":\"min\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The minimum number of rows of fields required\"},\"properties15\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Use only if you would like to save raw data, since the default is best.\"},\"properties16\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Allows form fields which can have as many options as the user desires.', '', 1, 13, '', 6),
(36, '', 'Provides an input field for an email address.', 'Email', '{\"properties0\":{\"name\":\"type\",\"example\":\"email\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be email.\"},\"properties1\":{\"name\":\"name\",\"example\":\"email\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Email Address\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"size\",\"example\":\"10\",\"adjustable\":\"1\",\"description\":\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\"},\"properties4\":{\"name\":\"maxlength\",\"example\":\"50\",\"adjustable\":\"1\",\"description\":\"(optional) limits the number of characters that may be entered.\"},\"properties5\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties6\":{\"name\":\"description\",\"example\":\"Enter some description\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties7\":{\"name\":\"class\",\"example\":\"inputbox\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\"},\"properties8\":{\"name\":\"readonly\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value\"},\"properties9\":{\"name\":\"disabled\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\"},\"properties10\":{\"name\":\"required\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties11\":{\"name\":\"filter\",\"example\":\"STRING\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties12\":{\"name\":\"validate\",\"example\":\"email\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties13\":{\"name\":\"unique\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) Used in validation, to check if we should test for uniqueness, to insure that this email does not already belong to another user. Check line 99 in \\/libraries\\/src\\/Form\\/Rule\\/EmailRule.php\"},\"properties14\":{\"name\":\"field\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) used in validation of \\\"equals\\\" to link the field to match.\"},\"properties15\":{\"name\":\"message\",\"example\":\"Error! Please add some text here.\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The error message that will be displayed instead of the default message.\"},\"properties16\":{\"name\":\"hint\",\"example\":\"your@email.com\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) The placeholder to display inside the text box.\"},\"properties17\":{\"name\":\"autocomplete\",\"example\":\"on\",\"adjustable\":\"1\",\"description\":\"(optional) The autocomplete state for the form field. If \'off\' element will not be automatically completed by browser.\"},\"properties18\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties19\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'Email form field type', '', 1, 6, '', 7),
(37, '', 'Provides a dropdown list of plugin options from the folder.', 'Plugins', '{\"properties0\":{\"name\":\"type\",\"example\":\"plugins\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be editors.\"},\"properties1\":{\"name\":\"name\",\"example\":\"editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the parameter.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an editor\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"default\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) (not translatable) is the default value.\"},\"properties4\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the label.\"},\"properties8\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties5\":{\"name\":\"folder\",\"example\":\"editors\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) editors or captcha.\"},\"properties6\":{\"name\":\"filter\",\"example\":\"cmd\",\"adjustable\":\"1\",\"description\":\"(optional) allow the system to save certain html tags or raw data.\"},\"properties7\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) show this field on the bases of the value in another field.\"}}', 'Provides a dropdown list of plugin options from the folder.', '', 1, 7, '', 8),
-(38, '', 'Provides the use of a captcha plugin.', 'Captcha', '{\"properties0\":{\"name\":\"type\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties3\":{\"name\":\"name\",\"example\":\"captcha\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"validate\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties1\":{\"name\":\"label\",\"example\":\"Captcha\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"We do not like spam, please show us you are human\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"namespace\",\"example\":\"componentbuilder\",\"description\":\"(optional) the component name seems to work\"}}', 'Captcha robot check.', '', 1, 2, '', 9);
+(38, '', 'Provides the use of a captcha plugin.', 'Captcha', '{\"properties0\":{\"name\":\"type\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties3\":{\"name\":\"name\",\"example\":\"captcha\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"validate\",\"example\":\"captcha\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be captcha.\"},\"properties1\":{\"name\":\"label\",\"example\":\"Captcha\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties4\":{\"name\":\"description\",\"example\":\"We do not like spam, please show us you are human\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties5\":{\"name\":\"namespace\",\"example\":\"componentbuilder\",\"description\":\"(optional) the component name seems to work\"}}', 'Captcha robot check.', '', 1, 2, '', 9),
+(39, '', 'The list form field type provides a drop down list or a list box of custom-defined entries. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.', 'Groupedlist', '{\"properties0\":{\"name\":\"type\",\"example\":\"groupedlist\",\"mandatory\":\"1\",\"description\":\"(mandatory) must be groupedlist.\"},\"properties1\":{\"name\":\"name\",\"example\":\"mygrouplist\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"description\":\"(mandatory) is the unique name of the field.\"},\"properties2\":{\"name\":\"label\",\"example\":\"Select an option\",\"adjustable\":\"1\",\"mandatory\":\"1\",\"translatable\":\"1\",\"description\":\"(mandatory) (translatable) is the descriptive title of the field.\"},\"properties3\":{\"name\":\"description\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\"},\"properties4\":{\"name\":\"message\",\"example\":\"\",\"adjustable\":\"1\",\"translatable\":\"1\",\"description\":\"(optional) (translatable) is text that will be shown as error on validation.\"},\"properties5\":{\"name\":\"class\",\"example\":\"list_class\",\"adjustable\":\"1\",\"description\":\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'inputbox\'.\"},\"properties6\":{\"name\":\"multiple\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) is whether multiple items can be selected at the same time (true or false).\"},\"properties7\":{\"name\":\"filter\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) filter options\"},\"properties8\":{\"name\":\"required\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The field must be filled before submitting the form.\"},\"properties9\":{\"name\":\"validate\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) The validation method for the form field. This value will determine which method is used to validate the value for a field.\"},\"properties10\":{\"name\":\"option\",\"example\":\"Group Name@@1,1|Option 1|1,2|Option 2|1,Group Name 2@@2,3|Option 3|2\",\"adjustable\":\"1\",\"description\":\"(mandatory) set the options of this radio. Separate options with commas and use the pipe symbol to separate value from text.\"},\"properties11\":{\"name\":\"useglobal\",\"example\":\"false\",\"adjustable\":\"1\",\"description\":\"(optional) if set to true, it will show the value that is set in the global configuration if found in the database.\"},\"properties12\":{\"name\":\"default\",\"example\":\"0\",\"adjustable\":\"1\",\"description\":\"(optional) is the default list item value.\"},\"properties13\":{\"name\":\"showon\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\"},\"properties14\":{\"name\":\"onchange\",\"example\":\"\",\"adjustable\":\"1\",\"description\":\"(optional) HTML equivalent attribute (javascript use)\"}}', 'provides a drop down list of custom-defined entries.', '', 1, 1, '', 10);
--
-- Dumping data for table `#__componentbuilder_language`
diff --git a/admin/sql/uninstall.mysql.utf8.sql b/admin/sql/uninstall.mysql.utf8.sql
index 6dbe36b9e..7dc739594 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`;
@@ -30,7 +33,12 @@ DROP TABLE IF EXISTS `#__componentbuilder_component_config`;
DROP TABLE IF EXISTS `#__componentbuilder_component_dashboard`;
DROP TABLE IF EXISTS `#__componentbuilder_component_files_folders`;
DROP TABLE IF EXISTS `#__componentbuilder_component_placeholders`;
+DROP TABLE IF EXISTS `#__componentbuilder_component_plugins`;
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_joomla_plugin_updates`;
+DROP TABLE IF EXISTS `#__componentbuilder_joomla_plugin_files_folders_urls`;
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/sql/updates/mysql/2.9.32.sql b/admin/sql/updates/mysql/2.9.32.sql
new file mode 100644
index 000000000..284d641a7
--- /dev/null
+++ b/admin/sql/updates/mysql/2.9.32.sql
@@ -0,0 +1,25 @@
+CREATE TABLE IF NOT EXISTS `#__componentbuilder_component_plugins` (
+ `id` INT(11) NOT NULL AUTO_INCREMENT,
+ `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
+ `addjoomla_plugins` TEXT NOT NULL,
+ `joomla_component` INT(11) NOT NULL DEFAULT 0,
+ `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_joomla_component` (`joomla_component`)
+) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
diff --git a/admin/sql/updates/mysql/2.9.33.sql b/admin/sql/updates/mysql/2.9.33.sql
new file mode 100644
index 000000000..8d911f995
--- /dev/null
+++ b/admin/sql/updates/mysql/2.9.33.sql
@@ -0,0 +1,5 @@
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_head` TINYINT(1) NOT NULL DEFAULT 0 AFTER `asset_id`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `head` TEXT NOT NULL AFTER `fields`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `system_name` VARCHAR(255) NOT NULL DEFAULT '' AFTER `property_selection`;
diff --git a/admin/sql/updates/mysql/2.9.34.sql b/admin/sql/updates/mysql/2.9.34.sql
new file mode 100644
index 000000000..0f61c1fa2
--- /dev/null
+++ b/admin/sql/updates/mysql/2.9.34.sql
@@ -0,0 +1,77 @@
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_php_method_uninstall` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_head`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_php_postflight_install` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_method_uninstall`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_php_postflight_update` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_postflight_install`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_php_preflight_install` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_postflight_update`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_php_preflight_uninstall` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_preflight_install`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_php_preflight_update` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_preflight_uninstall`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_sales_server` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_preflight_update`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_sql` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_sales_server`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_sql_uninstall` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_sql`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_update_server` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_sql_uninstall`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `addreadme` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_update_server`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `php_method_uninstall` MEDIUMTEXT NOT NULL AFTER `name`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `php_postflight_install` MEDIUMTEXT NOT NULL AFTER `php_method_uninstall`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `php_postflight_update` MEDIUMTEXT NOT NULL AFTER `php_postflight_install`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `php_preflight_install` MEDIUMTEXT NOT NULL AFTER `php_postflight_update`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `php_preflight_uninstall` MEDIUMTEXT NOT NULL AFTER `php_preflight_install`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `php_preflight_update` MEDIUMTEXT NOT NULL AFTER `php_preflight_uninstall`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `readme` TEXT NOT NULL AFTER `property_selection`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `sales_server` INT(11) NOT NULL DEFAULT 0 AFTER `readme`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `sql` MEDIUMTEXT NOT NULL AFTER `sales_server`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `sql_uninstall` MEDIUMTEXT NOT NULL AFTER `sql`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `update_server` INT(11) NOT NULL DEFAULT 0 AFTER `system_name`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `update_server_target` TINYINT(1) NOT NULL DEFAULT 0 AFTER `update_server`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `update_server_url` VARCHAR(255) NOT NULL DEFAULT '' AFTER `update_server_target`;
+
+CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin_files_folders_urls` (
+ `id` INT(11) NOT NULL AUTO_INCREMENT,
+ `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
+ `addfiles` TEXT NOT NULL,
+ `addfilesfullpath` TEXT NOT NULL,
+ `addfolders` TEXT NOT NULL,
+ `addfoldersfullpath` TEXT NOT NULL,
+ `addurls` TEXT NOT NULL,
+ `joomla_plugin` INT(11) NOT NULL DEFAULT 0,
+ `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_joomla_plugin` (`joomla_plugin`)
+) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
diff --git a/admin/sql/updates/mysql/2.9.35.sql b/admin/sql/updates/mysql/2.9.35.sql
new file mode 100644
index 000000000..f8732ed31
--- /dev/null
+++ b/admin/sql/updates/mysql/2.9.35.sql
@@ -0,0 +1,33 @@
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `add_php_script_construct` TINYINT(1) NOT NULL DEFAULT 0 AFTER `add_php_preflight_update`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `description` TEXT NOT NULL AFTER `class_extends`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `php_script_construct` MEDIUMTEXT NOT NULL AFTER `php_preflight_update`;
+
+ALTER TABLE `#__componentbuilder_joomla_plugin` ADD `plugin_version` CHAR(64) NOT NULL DEFAULT '' AFTER `php_script_construct`;
+
+CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin_updates` (
+ `id` INT(11) NOT NULL AUTO_INCREMENT,
+ `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
+ `joomla_plugin` INT(11) NOT NULL DEFAULT 0,
+ `version_update` 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_joomla_plugin` (`joomla_plugin`)
+) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
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/component_plugins.php b/admin/tables/component_plugins.php
new file mode 100644
index 000000000..f3f183ecb
--- /dev/null
+++ b/admin/tables/component_plugins.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;
+
+/**
+ * Components_plugins Table class
+ */
+class ComponentbuilderTableComponent_plugins 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_component_plugins', 'id', $db);
+
+ // Adding History Options
+ JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.component_plugins'));
+ }
+
+ 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 Component_plugins 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 component_plugins. A component_plugins 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('component_plugins', 'ComponentbuilderTable');
+
+ if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
+ {
+ $this->setError(JText::_('COM_COMPONENTBUILDER_COMPONENT_PLUGINS_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('component_plugins', '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.component_plugins.'.$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.component_plugins.'.(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_files_folders_urls.php b/admin/tables/joomla_plugin_files_folders_urls.php
new file mode 100644
index 000000000..d2cfab6ad
--- /dev/null
+++ b/admin/tables/joomla_plugin_files_folders_urls.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_files_folders_urls Table class
+ */
+class ComponentbuilderTableJoomla_plugin_files_folders_urls 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_files_folders_urls', 'id', $db);
+
+ // Adding History Options
+ JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.joomla_plugin_files_folders_urls'));
+ }
+
+ 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_files_folders_urls 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_files_folders_urls. A joomla_plugin_files_folders_urls 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_files_folders_urls', 'ComponentbuilderTable');
+
+ if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
+ {
+ $this->setError(JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_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_files_folders_urls', '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_files_folders_urls.'.$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_files_folders_urls.'.(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/tables/joomla_plugin_updates.php b/admin/tables/joomla_plugin_updates.php
new file mode 100644
index 000000000..5cda704b0
--- /dev/null
+++ b/admin/tables/joomla_plugin_updates.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_updates Table class
+ */
+class ComponentbuilderTableJoomla_plugin_updates 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_updates', 'id', $db);
+
+ // Adding History Options
+ JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.joomla_plugin_updates'));
+ }
+
+ 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_updates 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_updates. A joomla_plugin_updates 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_updates', 'ComponentbuilderTable');
+
+ if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
+ {
+ $this->setError(JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_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_updates', '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_updates.'.$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_updates.'.(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_fields_conditions/tmpl/edit.php b/admin/views/admin_fields_conditions/tmpl/edit.php
index 35293dbf6..4fa567151 100644
--- a/admin/views/admin_fields_conditions/tmpl/edit.php
+++ b/admin/views/admin_fields_conditions/tmpl/edit.php
@@ -130,5 +130,22 @@ jQuery(document).ready(function(){
});
}
});
-});
+});
+
+
+function JRouter(link) {
+isSite())
+ {
+ echo 'var url = "'.JURI::root().'";';
+ }
+ else
+ {
+ echo 'var url = "";';
+ }
+?>
+ return url+link;
+}
diff --git a/admin/views/admin_fields_relations/tmpl/edit.php b/admin/views/admin_fields_relations/tmpl/edit.php
index 732d6d559..833e790e8 100644
--- a/admin/views/admin_fields_relations/tmpl/edit.php
+++ b/admin/views/admin_fields_relations/tmpl/edit.php
@@ -103,4 +103,27 @@ $componentParams = $this->params; // will be removed just use $this->params inst
-
+
+
+
diff --git a/admin/views/admin_view/tmpl/edit.php b/admin/views/admin_view/tmpl/edit.php
index 16f4ebaea..9a7d39db0 100644
--- a/admin/views/admin_view/tmpl/edit.php
+++ b/admin/views/admin_view/tmpl/edit.php
@@ -208,521 +208,521 @@ $componentParams = $this->params; // will be removed just use $this->params inst
+
+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')): ?>
+ 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'); ?>
+
+
+
+
+
\ 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): ?>
+
+
+
+
+
+
+ ■
+
+
+
+ listDirn, $this->listOrder); ?>
+
+
+ canState): ?>
+
+ 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');
+
+?>
+
\ 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..e32f5a97b
--- /dev/null
+++ b/admin/views/class_extends/tmpl/edit.php
@@ -0,0 +1,134 @@
+
+ * @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
+?>
+
+
+ * @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');
+ // 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/class_extends/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())) . "';");
+ 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..bd20efa59
--- /dev/null
+++ b/admin/views/class_method/tmpl/edit.php
@@ -0,0 +1,149 @@
+
+ * @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
+?>
+
+
+ * @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');
+ // 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/class_method/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())) . "';");
+ 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)): ?>
+
+
+
+
+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')): ?>
+ 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'); ?>
+
+
+
+
+
\ 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): ?>
+
+
+
+
+
+
+ ■
+
+
+
+ listDirn, $this->listOrder); ?>
+
+
+
+ canState): ?>
+
+ 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');
+
+?>
+
\ 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)): ?>
+
+
+
+
+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')): ?>
+ 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'); ?>
+
+
+
+
+
\ 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): ?>
+
+
+
+
+
+
+ ■
+
+
+
+ listDirn, $this->listOrder); ?>
+
+
+
+ canState): ?>
+
+ 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');
+
+?>
+
\ 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..a5de40087
--- /dev/null
+++ b/admin/views/class_property/tmpl/edit.php
@@ -0,0 +1,144 @@
+
+ * @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
+?>
+
+
+ * @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');
+ // 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/class_property/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())) . "';");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/compiler/tmpl/default.php b/admin/views/compiler/tmpl/default.php
index 4d1a32449..040f84dcb 100644
--- a/admin/views/compiler/tmpl/default.php
+++ b/admin/views/compiler/tmpl/default.php
@@ -22,13 +22,25 @@ JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
?>
-canDo->get('compiler.access')): ?>
+canDo->get('compiler.access')): ?>
+
sidebar)): ?>
@@ -111,6 +129,7 @@ jQuery(document).ready(function($) {
+
diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php
index a814874f9..25579ac97 100644
--- a/admin/views/compiler/view.html.php
+++ b/admin/views/compiler/view.html.php
@@ -231,16 +231,16 @@ class ComponentbuilderViewCompiler extends JViewLegacy
// Set the Custom JS script to view
$this->document->addScriptDeclaration("
function getComponentDetails_server(id){
- var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json\");
+ var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json&raw=true\");
if(token.length > 0 && id > 0){
- var request = 'token='+token+'&id='+id;
+ var request = token+'=1&id='+id;
}
return jQuery.ajax({
type: 'GET',
url: getUrl,
- dataType: 'jsonp',
+ dataType: 'json',
data: request,
- jsonp: 'callback'
+ jsonp: false
});
}
function getComponentDetails(id) {
@@ -273,19 +273,19 @@ class ComponentbuilderViewCompiler extends JViewLegacy
// to check is READ/NEW
function getIS(type,notice){
if (type == 1) {
- var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json\");
+ var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true\");
} else if (type == 2) {
- var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json\");
+ var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true\");
}
if(token.length > 0 && notice.length){
- var request = \"token=\"+token+\"¬ice=\"+notice;
+ var request = token+\"=1¬ice=\"+notice;
}
return jQuery.ajax({
type: \"POST\",
url: getUrl,
- dataType: \"jsonp\",
+ dataType: 'json',
data: request,
- jsonp: \"callback\"
+ jsonp: false
});
}
");
diff --git a/admin/views/component_dashboard/tmpl/edit.php b/admin/views/component_dashboard/tmpl/edit.php
index 6fbb3b9eb..be38a716d 100644
--- a/admin/views/component_dashboard/tmpl/edit.php
+++ b/admin/views/component_dashboard/tmpl/edit.php
@@ -103,4 +103,27 @@ $componentParams = $this->params; // will be removed just use $this->params inst
+
+
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..028dd240d
--- /dev/null
+++ b/admin/views/class_property/view.html.php
@@ -0,0 +1,210 @@
+
+ * @github Joomla Component Builder
+
+
+
-
+
+
+
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..9f5575570
--- /dev/null
+++ b/admin/views/class_method/view.html.php
@@ -0,0 +1,210 @@
+
+ * @github Joomla Component Builder
+
+
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..8d4ae267c
--- /dev/null
+++ b/admin/views/class_extends/view.html.php
@@ -0,0 +1,210 @@
+
+ * @github Joomla Component Builder
+
+
+
+
diff --git a/admin/views/component_plugins/submitbutton.js b/admin/views/component_plugins/submitbutton.js
new file mode 100644
index 000000000..2fa7c8d05
--- /dev/null
+++ b/admin/views/component_plugins/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._('component_plugins, some values are not acceptable.','Some values are unacceptable'));
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/admin/views/component_plugins/tmpl/edit.php b/admin/views/component_plugins/tmpl/edit.php
new file mode 100644
index 000000000..a216bc398
--- /dev/null
+++ b/admin/views/component_plugins/tmpl/edit.php
@@ -0,0 +1,122 @@
+
+ * @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
+?>
+
+
+ * @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');
+
+/**
+ * Component_plugins View class
+ */
+class ComponentbuilderViewComponent_plugins 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('component_plugins', $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_COMPONENT_PLUGINS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_PLUGINS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (ComponentbuilderHelper::checkString($this->referral))
+ {
+ if ($this->canDo->get('component_plugins.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_plugins.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_plugins.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_plugins.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_plugins.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_plugins.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_plugins.create'))
+ {
+ JToolBarHelper::apply('component_plugins.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_plugins.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_plugins.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_plugins.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_plugins.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_plugins.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_plugins.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('component_plugins.create'))
+ {
+ JToolBarHelper::custom('component_plugins.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_plugins.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_plugins.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_plugins', $this->item->id);
+ }
+ if ($this->canDo->get('component_plugins.create'))
+ {
+ JToolBarHelper::custom('component_plugins.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_plugins.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_plugins');
+ 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_COMPONENT_PLUGINS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_PLUGINS_EDIT'));
+ $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_plugins.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/component_plugins/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/components_plugins/index.html b/admin/views/components_plugins/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_plugins/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_plugins/tmpl/default.php b/admin/views/components_plugins/tmpl/default.php
new file mode 100644
index 000000000..fcda40cbe
--- /dev/null
+++ b/admin/views/components_plugins/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=components_plugins.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_pluginsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_plugins/tmpl/default_batch_body.php b/admin/views/components_plugins/tmpl/default_batch_body.php
new file mode 100644
index 000000000..51c9b586d
--- /dev/null
+++ b/admin/views/components_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/components_plugins/tmpl/default_batch_footer.php b/admin/views/components_plugins/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..d6ebacf1a
--- /dev/null
+++ b/admin/views/components_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/components_plugins/tmpl/default_body.php b/admin/views/components_plugins/tmpl/default_body.php
new file mode 100644
index 000000000..3ba32fc0b
--- /dev/null
+++ b/admin/views/components_plugins/tmpl/default_body.php
@@ -0,0 +1,94 @@
+
+ * @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=components_plugins&task=component_plugins.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('component_plugins',$item,'components_plugins');
+ ?>
+
+
+ get('component_plugins.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+
+ get('component_plugins.edit')): ?>
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_plugins.', $canCheckin); ?>
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+
+ get('component_plugins.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_plugins.', true, 'cb'); ?>
+
+ published, $i, 'components_plugins.', false, 'cb'); ?>
+
+
+ published, $i, 'components_plugins.', true, 'cb'); ?>
+
+
+ published, $i, 'components_plugins.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_plugins/tmpl/default_foot.php b/admin/views/components_plugins/tmpl/default_foot.php
new file mode 100644
index 000000000..d020003b6
--- /dev/null
+++ b/admin/views/components_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/components_plugins/tmpl/default_head.php b/admin/views/components_plugins/tmpl/default_head.php
new file mode 100644
index 000000000..6244238d4
--- /dev/null
+++ b/admin/views/components_plugins/tmpl/default_head.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');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_plugins/tmpl/default_toolbar.php b/admin/views/components_plugins/tmpl/default_toolbar.php
new file mode 100644
index 000000000..feaa464f6
--- /dev/null
+++ b/admin/views/components_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');
+
+?>
+
\ No newline at end of file
diff --git a/admin/views/components_plugins/tmpl/index.html b/admin/views/components_plugins/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_plugins/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_plugins/view.html.php b/admin/views/components_plugins/view.html.php
new file mode 100644
index 000000000..e0aa34fab
--- /dev/null
+++ b/admin/views/components_plugins/view.html.php
@@ -0,0 +1,226 @@
+
+ * @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 Components_plugins
+ */
+class ComponentbuilderViewComponents_plugins extends JViewLegacy
+{
+ /**
+ * Components_plugins view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_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('component_plugins');
+ $this->canEdit = $this->canDo->get('component_plugins.edit');
+ $this->canState = $this->canDo->get('component_plugins.edit.state');
+ $this->canCreate = $this->canDo->get('component_plugins.create');
+ $this->canDelete = $this->canDo->get('component_plugins.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_COMPONENTS_PLUGINS'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_plugins');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_plugins.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_plugins.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_plugins.publish');
+ JToolBarHelper::unpublishList('components_plugins.unpublish');
+ JToolBarHelper::archiveList('components_plugins.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_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('', 'components_plugins.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_plugins.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_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')
+ );
+ }
+ }
+
+ /**
+ * 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_COMPONENTS_PLUGINS'));
+ $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_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.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/custom_admin_view/tmpl/edit.php b/admin/views/custom_admin_view/tmpl/edit.php
index bfb648fda..43422a68f 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/dynamic_get/tmpl/edit.php b/admin/views/dynamic_get/tmpl/edit.php
index 8a35153e3..1b55da98a 100644
--- a/admin/views/dynamic_get/tmpl/edit.php
+++ b/admin/views/dynamic_get/tmpl/edit.php
@@ -159,485 +159,485 @@ $componentParams = $this->params; // will be removed just use $this->params inst
diff --git a/admin/views/fieldtype/view.html.php b/admin/views/fieldtype/view.html.php
index c5392c3f2..21c2c6749 100644
--- a/admin/views/fieldtype/view.html.php
+++ b/admin/views/fieldtype/view.html.php
@@ -57,7 +57,7 @@ class ComponentbuilderViewFieldtype extends JViewLegacy
}
// Get Linked view data
- $this->warfields = $this->get('Warfields');
+ $this->vxwfields = $this->get('Vxwfields');
// Set the toolbar
$this->addToolBar();
diff --git a/admin/views/get_snippets/tmpl/default.php b/admin/views/get_snippets/tmpl/default.php
index 9a032bcdf..7940efa28 100644
--- a/admin/views/get_snippets/tmpl/default.php
+++ b/admin/views/get_snippets/tmpl/default.php
@@ -226,7 +226,24 @@ jQuery(document).ready( function($) {
}
$(".loading-dots").text(dots);
} , 500);
-});
+});
+
+
+function JRouter(link) {
+isSite())
+ {
+ echo 'var url = "'.JURI::root().'";';
+ }
+ else
+ {
+ echo 'var url = "";';
+ }
+?>
+ return url+link;
+}
diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php
index 7871eb94b..0f93c9b50 100644
--- a/admin/views/help_document/tmpl/edit.php
+++ b/admin/views/help_document/tmpl/edit.php
@@ -116,93 +116,93 @@ $componentParams = $this->params; // will be removed just use $this->params inst
+
+ * @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 the JavaScript for JStore
+ $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jquery.json.min.js');
+ $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jstorage.min.js');
+ $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/strtotime.js');
+ // 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');
+ // check if we should use browser storage
+ $setBrowserStorage = $this->params->get('set_browser_storage', null);
+ if ($setBrowserStorage)
+ {
+ // check what (Time To Live) show we use
+ $storageTimeToLive = $this->params->get('storage_time_to_live', 'global');
+ if ('global' == $storageTimeToLive)
+ {
+ // use the global session time
+ $session = JFactory::getSession();
+ // must have itin milliseconds
+ $expire = ($session->getExpire()*60)* 1000;
+ }
+ else
+ {
+ // use the Componentbuilder Global setting
+ if (0 != $storageTimeToLive)
+ {
+ // this will convert the time into milliseconds
+ $storageTimeToLive = $storageTimeToLive * 1000;
+ }
+ $expire = $storageTimeToLive;
+ }
+ }
+ else
+ {
+ // set to use no storage
+ $expire = 30000; // only 30 seconds
+ }
+ // Set the Time To Live To JavaScript
+ $this->document->addScriptDeclaration("var expire = ". (int) $expire.";");
+ $this->document->addScriptDeclaration("selectionArray = {'property':{},'method':{}};");
+ // add a few field options via PHP
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+ $tmp_ = JFormHelper::loadFieldType('joomlaplugingroups')->options;
+ if (ComponentbuilderHelper::checkArray($tmp_))
+ {
+ $_tmp = array();
+ foreach ($tmp_ as $item)
+ {
+ $_tmp[$item->value] = $item->text;
+ }
+ // Set the values to JavaScript
+ $this->document->addScriptDeclaration("selectionArray['joomla_plugin_group'] = ". json_encode($_tmp) . ";");
+ }
+ $tmp_ = JFormHelper::loadFieldType('pluginsclassproperties')->options;
+ if (ComponentbuilderHelper::checkArray($tmp_))
+ {
+ $_tmp = array();
+ foreach ($tmp_ as $item)
+ {
+ $_tmp[$item->value] = $item->text;
+ }
+ // Set the values to JavaScript
+ $this->document->addScriptDeclaration("selectionArray['property'] = ". json_encode($_tmp) . ";");
+ }
+ $tmp_ = JFormHelper::loadFieldType('pluginsclassmethods')->options;
+ if (ComponentbuilderHelper::checkArray($tmp_))
+ {
+ $_tmp = array();
+ foreach ($tmp_ as $item)
+ {
+ $_tmp[$item->value] = $item->text;
+ }
+ // Set the values to JavaScript
+ $this->document->addScriptDeclaration("selectionArray['method'] = ". json_encode($_tmp) . ";");
+ }
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/joomla_plugin_files_folders_urls/submitbutton.js b/admin/views/joomla_plugin_files_folders_urls/submitbutton.js
new file mode 100644
index 000000000..ebc76f219
--- /dev/null
+++ b/admin/views/joomla_plugin_files_folders_urls/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_files_folders_urls, some values are not acceptable.','Some values are unacceptable'));
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/admin/views/joomla_plugin_files_folders_urls/tmpl/edit.php b/admin/views/joomla_plugin_files_folders_urls/tmpl/edit.php
new file mode 100644
index 000000000..72798c3f4
--- /dev/null
+++ b/admin/views/joomla_plugin_files_folders_urls/tmpl/edit.php
@@ -0,0 +1,116 @@
+
+ * @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
+?>
+
+
+ * @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_files_folders_urls View class
+ */
+class ComponentbuilderViewJoomla_plugin_files_folders_urls 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_files_folders_urls', $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_FILES_FOLDERS_URLS_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (ComponentbuilderHelper::checkString($this->referral))
+ {
+ if ($this->canDo->get('joomla_plugin_files_folders_urls.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('joomla_plugin_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_plugin_files_folders_urls.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('joomla_plugin_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('joomla_plugin_files_folders_urls.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('joomla_plugin_files_folders_urls.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_plugin_files_folders_urls.create'))
+ {
+ JToolBarHelper::apply('joomla_plugin_files_folders_urls.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('joomla_plugin_files_folders_urls.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('joomla_plugin_files_folders_urls.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('joomla_plugin_files_folders_urls.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_plugin_files_folders_urls.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('joomla_plugin_files_folders_urls.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('joomla_plugin_files_folders_urls.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_files_folders_urls.create'))
+ {
+ JToolBarHelper::custom('joomla_plugin_files_folders_urls.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('joomla_plugin_files_folders_urls.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('joomla_plugin_files_folders_urls.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.joomla_plugin_files_folders_urls', $this->item->id);
+ }
+ if ($this->canDo->get('joomla_plugin_files_folders_urls.create'))
+ {
+ JToolBarHelper::custom('joomla_plugin_files_folders_urls.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('joomla_plugin_files_folders_urls.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_files_folders_urls');
+ 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_FILES_FOLDERS_URLS_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_EDIT'));
+ $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_plugin_files_folders_urls.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_files_folders_urls/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_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
+?>
+
+
+ * @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)): ?>
+
+
+
+
+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')): ?>
+ 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'); ?>
+
+
+
+
+
\ 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): ?>
+
+
+
+
+
+
+ ■
+
+
+
+ listDirn, $this->listOrder); ?>
+
+
+ listDirn, $this->listOrder); ?>
+
+ canState): ?>
+
+ 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');
+
+?>
+
\ 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_plugin_updates/submitbutton.js b/admin/views/joomla_plugin_updates/submitbutton.js
new file mode 100644
index 000000000..ac3691215
--- /dev/null
+++ b/admin/views/joomla_plugin_updates/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_updates, some values are not acceptable.','Some values are unacceptable'));
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/admin/views/joomla_plugin_updates/tmpl/edit.php b/admin/views/joomla_plugin_updates/tmpl/edit.php
new file mode 100644
index 000000000..e911d995e
--- /dev/null
+++ b/admin/views/joomla_plugin_updates/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
+?>
+
+
+ * @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_updates View class
+ */
+class ComponentbuilderViewJoomla_plugin_updates 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_updates', $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_UPDATES_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if (ComponentbuilderHelper::checkString($this->referral))
+ {
+ if ($this->canDo->get('joomla_plugin_updates.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('joomla_plugin_updates.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('joomla_plugin_updates.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('joomla_plugin_updates.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('joomla_plugin_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('joomla_plugin_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('joomla_plugin_updates.create'))
+ {
+ JToolBarHelper::apply('joomla_plugin_updates.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('joomla_plugin_updates.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('joomla_plugin_updates.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('joomla_plugin_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('joomla_plugin_updates.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('joomla_plugin_updates.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('joomla_plugin_updates.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_updates.create'))
+ {
+ JToolBarHelper::custom('joomla_plugin_updates.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('joomla_plugin_updates.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('joomla_plugin_updates.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.joomla_plugin_updates', $this->item->id);
+ }
+ if ($this->canDo->get('joomla_plugin_updates.create'))
+ {
+ JToolBarHelper::custom('joomla_plugin_updates.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('joomla_plugin_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugin_updates');
+ 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_UPDATES_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_EDIT'));
+ $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_plugin_updates.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_updates/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_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)): ?>
+
+
+
+
+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..e25d157b6
--- /dev/null
+++ b/admin/views/joomla_plugins/tmpl/default_body.php
@@ -0,0 +1,141 @@
+
+ * @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')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+
+ get('joomla_plugin.edit')): ?>
+ escape($item->system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'joomla_plugins.', $canCheckin); ?>
+
+
+ escape($item->system_name); ?>
+ -
+ escape($item->plugin_version); ?>
+
+ 'joomla_plugin_updates',
+ 'views' => 'joomla_plugins_updates',
+ 'title' => JText::_('COM_COMPONENTBUILDER_THE_PLUGIN_UPDATES'),
+ 'icon' => 'database'),
+ array(
+ 'view' => 'joomla_plugin_files_folders_urls',
+ 'views' => 'joomla_plugins_files_folders_urls',
+ 'title' => JText::_('COM_COMPONENTBUILDER_THE_PLUGIN_FILES_FOLDERS'),
+ 'icon' => 'briefcase')
+ );
+ }
+ ?>
+
+
+
+
+ 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'); ?>
+
+
+
+
+
\ 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..b68ee102b
--- /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): ?>
+
+
+
+
+
+
+ ■
+
+
+
+ listDirn, $this->listOrder); ?>
+
+
+ listDirn, $this->listOrder); ?>
+
+
+ listDirn, $this->listOrder); ?>
+
+ canState): ?>
+
+ 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');
+
+?>
+
\ 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..56c9dc864
--- /dev/null
+++ b/admin/views/joomla_plugins/view.html.php
@@ -0,0 +1,309 @@
+
+ * @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->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->user->authorise('joomla_plugin.methods', 'com_componentbuilder'))
+ {
+ // add Methods button.
+ JToolBarHelper::custom('joomla_plugins.openClassMethods', 'joomla', '', 'COM_COMPONENTBUILDER_METHODS', false);
+ }
+ if ($this->user->authorise('joomla_plugin.properties', 'com_componentbuilder'))
+ {
+ // add Properties button.
+ JToolBarHelper::custom('joomla_plugins.openClassProperties', 'joomla', '', 'COM_COMPONENTBUILDER_PROPERTIES', 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 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.system_name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGIN_SYSTEM_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')
+ );
+ }
+}
diff --git a/admin/views/joomla_plugins_files_folders_urls/index.html b/admin/views/joomla_plugins_files_folders_urls/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default.php
new file mode 100644
index 000000000..b899a2008
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/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_plugins_files_folders_urls.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'joomla_plugin_files_folders_urlsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGINS_FILES_FOLDERS_URLS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_files_folders_urls/tmpl/default_batch_body.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default_batch_body.php
new file mode 100644
index 000000000..b19367ab3
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/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_files_folders_urls/tmpl/default_batch_footer.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..5d6ff2d47
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/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_files_folders_urls/tmpl/default_body.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default_body.php
new file mode 100644
index 000000000..e26c9e453
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/tmpl/default_body.php
@@ -0,0 +1,94 @@
+
+ * @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_files_folders_urls&task=joomla_plugin_files_folders_urls.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_files_folders_urls',$item,'joomla_plugins_files_folders_urls');
+ ?>
+
+
+ get('joomla_plugin_files_folders_urls.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+
+ get('joomla_plugin_files_folders_urls.edit')): ?>
+ escape($item->joomla_plugin_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'joomla_plugins_files_folders_urls.', $canCheckin); ?>
+
+
+ escape($item->joomla_plugin_system_name); ?>
+
+
+
+
+ get('joomla_plugin_files_folders_urls.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'joomla_plugins_files_folders_urls.', true, 'cb'); ?>
+
+ published, $i, 'joomla_plugins_files_folders_urls.', false, 'cb'); ?>
+
+
+ published, $i, 'joomla_plugins_files_folders_urls.', true, 'cb'); ?>
+
+
+ published, $i, 'joomla_plugins_files_folders_urls.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_files_folders_urls/tmpl/default_foot.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default_foot.php
new file mode 100644
index 000000000..d020003b6
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/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_files_folders_urls/tmpl/default_head.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default_head.php
new file mode 100644
index 000000000..e3f4a891b
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/tmpl/default_head.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');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_files_folders_urls/tmpl/default_toolbar.php b/admin/views/joomla_plugins_files_folders_urls/tmpl/default_toolbar.php
new file mode 100644
index 000000000..f40efa672
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/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');
+
+?>
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_files_folders_urls/tmpl/index.html b/admin/views/joomla_plugins_files_folders_urls/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_files_folders_urls/view.html.php b/admin/views/joomla_plugins_files_folders_urls/view.html.php
new file mode 100644
index 000000000..964af701f
--- /dev/null
+++ b/admin/views/joomla_plugins_files_folders_urls/view.html.php
@@ -0,0 +1,226 @@
+
+ * @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_files_folders_urls
+ */
+class ComponentbuilderViewJoomla_plugins_files_folders_urls extends JViewLegacy
+{
+ /**
+ * Joomla_plugins_files_folders_urls view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('joomla_plugins_files_folders_urls');
+ }
+
+ // 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_files_folders_urls');
+ $this->canEdit = $this->canDo->get('joomla_plugin_files_folders_urls.edit');
+ $this->canState = $this->canDo->get('joomla_plugin_files_folders_urls.edit.state');
+ $this->canCreate = $this->canDo->get('joomla_plugin_files_folders_urls.create');
+ $this->canDelete = $this->canDo->get('joomla_plugin_files_folders_urls.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_FILES_FOLDERS_URLS'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=joomla_plugins_files_folders_urls');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('joomla_plugin_files_folders_urls.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('joomla_plugin_files_folders_urls.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('joomla_plugins_files_folders_urls.publish');
+ JToolBarHelper::unpublishList('joomla_plugins_files_folders_urls.unpublish');
+ JToolBarHelper::archiveList('joomla_plugins_files_folders_urls.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('joomla_plugins_files_folders_urls.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_files_folders_urls.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('joomla_plugins_files_folders_urls.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins_files_folders_urls');
+ 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')
+ );
+ }
+ }
+
+ /**
+ * 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_FILES_FOLDERS_URLS'));
+ $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_plugins_files_folders_urls.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.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/joomla_plugins_updates/index.html b/admin/views/joomla_plugins_updates/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_updates/tmpl/default.php b/admin/views/joomla_plugins_updates/tmpl/default.php
new file mode 100644
index 000000000..50c657339
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/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_plugins_updates.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'joomla_plugin_updatesList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_JOOMLA_PLUGINS_UPDATES_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_updates/tmpl/default_batch_body.php b/admin/views/joomla_plugins_updates/tmpl/default_batch_body.php
new file mode 100644
index 000000000..5c54e9b4e
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/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_updates/tmpl/default_batch_footer.php b/admin/views/joomla_plugins_updates/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..f48dd8742
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/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_updates/tmpl/default_body.php b/admin/views/joomla_plugins_updates/tmpl/default_body.php
new file mode 100644
index 000000000..875bd1a81
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/tmpl/default_body.php
@@ -0,0 +1,94 @@
+
+ * @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_updates&task=joomla_plugin_updates.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_updates',$item,'joomla_plugins_updates');
+ ?>
+
+
+ get('joomla_plugin_updates.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+
+ get('joomla_plugin_updates.edit')): ?>
+ escape($item->joomla_plugin_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'joomla_plugins_updates.', $canCheckin); ?>
+
+
+ escape($item->joomla_plugin_system_name); ?>
+
+
+
+
+ get('joomla_plugin_updates.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'joomla_plugins_updates.', true, 'cb'); ?>
+
+ published, $i, 'joomla_plugins_updates.', false, 'cb'); ?>
+
+
+ published, $i, 'joomla_plugins_updates.', true, 'cb'); ?>
+
+
+ published, $i, 'joomla_plugins_updates.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_updates/tmpl/default_foot.php b/admin/views/joomla_plugins_updates/tmpl/default_foot.php
new file mode 100644
index 000000000..d020003b6
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/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_updates/tmpl/default_head.php b/admin/views/joomla_plugins_updates/tmpl/default_head.php
new file mode 100644
index 000000000..f406c2240
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/tmpl/default_head.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');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_updates/tmpl/default_toolbar.php b/admin/views/joomla_plugins_updates/tmpl/default_toolbar.php
new file mode 100644
index 000000000..7fdc8d775
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/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');
+
+?>
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_updates/tmpl/index.html b/admin/views/joomla_plugins_updates/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugins_updates/view.html.php b/admin/views/joomla_plugins_updates/view.html.php
new file mode 100644
index 000000000..e388fa109
--- /dev/null
+++ b/admin/views/joomla_plugins_updates/view.html.php
@@ -0,0 +1,226 @@
+
+ * @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_updates
+ */
+class ComponentbuilderViewJoomla_plugins_updates extends JViewLegacy
+{
+ /**
+ * Joomla_plugins_updates view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('joomla_plugins_updates');
+ }
+
+ // 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_updates');
+ $this->canEdit = $this->canDo->get('joomla_plugin_updates.edit');
+ $this->canState = $this->canDo->get('joomla_plugin_updates.edit.state');
+ $this->canCreate = $this->canDo->get('joomla_plugin_updates.create');
+ $this->canDelete = $this->canDo->get('joomla_plugin_updates.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_UPDATES'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=joomla_plugins_updates');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('joomla_plugin_updates.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('joomla_plugin_updates.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('joomla_plugins_updates.publish');
+ JToolBarHelper::unpublishList('joomla_plugins_updates.unpublish');
+ JToolBarHelper::archiveList('joomla_plugins_updates.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('joomla_plugins_updates.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_updates.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('joomla_plugins_updates.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('joomla_plugins_updates');
+ 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')
+ );
+ }
+ }
+
+ /**
+ * 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_UPDATES'));
+ $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_plugins_updates.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.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/languages/tmpl/default.php b/admin/views/languages/tmpl/default.php
index 8dea911ad..8203eaf96 100644
--- a/admin/views/languages/tmpl/default.php
+++ b/admin/views/languages/tmpl/default.php
@@ -85,6 +85,7 @@ if ($this->saveOrder)
diff --git a/admin/views/library/tmpl/edit.php b/admin/views/library/tmpl/edit.php
index 65d34ea39..2f3040c22 100644
--- a/admin/views/library/tmpl/edit.php
+++ b/admin/views/library/tmpl/edit.php
@@ -146,123 +146,123 @@ $componentParams = $this->params; // will be removed just use $this->params inst
diff --git a/admin/views/placeholder/tmpl/edit.php b/admin/views/placeholder/tmpl/edit.php
index 86a95b352..a4dfa13be 100644
--- a/admin/views/placeholder/tmpl/edit.php
+++ b/admin/views/placeholder/tmpl/edit.php
@@ -134,5 +134,22 @@ jQuery(document).ready( function($) {
}
$(".loading-dots").text(dots);
} , 500);
-});
+});
+
+
+function JRouter(link) {
+isSite())
+ {
+ echo 'var url = "'.JURI::root().'";';
+ }
+ else
+ {
+ echo 'var url = "";';
+ }
+?>
+ return url+link;
+}
diff --git a/admin/views/server/tmpl/edit.php b/admin/views/server/tmpl/edit.php
index e75fdb319..32d63a46e 100644
--- a/admin/views/server/tmpl/edit.php
+++ b/admin/views/server/tmpl/edit.php
@@ -125,169 +125,169 @@ $componentParams = $this->params; // will be removed just use $this->params inst
diff --git a/admin/views/validation_rule/tmpl/edit.php b/admin/views/validation_rule/tmpl/edit.php
index d12d3b46a..a5bcd9d69 100644
--- a/admin/views/validation_rule/tmpl/edit.php
+++ b/admin/views/validation_rule/tmpl/edit.php
@@ -121,14 +121,12 @@ jQuery('#componentbuilder_loader').on('change', '#jform_inherit',function (e) {
var rulefilename = jQuery("#jform_inherit option:selected").val();
getExistingValidationRuleCode(rulefilename);
});
-
jQuery('#componentbuilder_loader').on('change', '#jform_name',function (e)
{
var ruleName = jQuery('#jform_name').val();
// check if this rule name is taken
checkRuleName(ruleName);
});
-
// nice little dot trick :)
jQuery(document).ready( function($) {
@@ -141,5 +139,22 @@ jQuery(document).ready( function($) {
}
$(".loading-dots").text(dots);
} , 500);
-});
+});
+
+
+function JRouter(link) {
+isSite())
+ {
+ echo 'var url = "'.JURI::root().'";';
+ }
+ else
+ {
+ echo 'var url = "";';
+ }
+?>
+ return url+link;
+}
diff --git a/admin/views/validation_rules/view.html.php b/admin/views/validation_rules/view.html.php
index a5ac46314..a48eeb3cf 100644
--- a/admin/views/validation_rules/view.html.php
+++ b/admin/views/validation_rules/view.html.php
@@ -134,6 +134,11 @@ class ComponentbuilderViewValidation_rules extends JViewLegacy
JToolBarHelper::custom('validation_rules.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
}
}
+ if ($this->user->authorise('validation_rule.run_expansion', 'com_componentbuilder'))
+ {
+ // add Run Expansion button.
+ JToolBarHelper::custom('validation_rules.runExpansion', 'expand-2', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false);
+ }
if ($this->canDo->get('core.import') && $this->canDo->get('validation_rule.import'))
{
diff --git a/componentbuilder.xml b/componentbuilder.xml
index 91d56596e..afb03b075 100644
--- a/componentbuilder.xml
+++ b/componentbuilder.xml
@@ -1,15 +1,15 @@
COM_COMPONENTBUILDER
- 6th July, 2019
+ 14th August, 2019
Llewellyn van der Merwe
llewellyn@joomlacomponentbuilder.com
http://www.joomlacomponentbuilder.com
Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
GNU General Public License version 2 or later; see LICENSE.txt
- 2.9.21
+ 2.10.0
Component Builder (v.2.9.21)
+ Component Builder (v.2.10.0)
The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
@@ -55,9 +55,7 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
index.html
router.php
componentbuilder.php
- componentbuilder.php
- router.php
- controller.php
+ router.php
assets
helpers
controllers
@@ -77,6 +75,7 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
+
@@ -99,11 +98,6 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
controller.php
index.html
componentbuilder.php
- access.xml
- config.xml
- controller.php
- componentbuilder.php
- README.txt
README.txt
assets
controllers
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index 6b51e4d31..91f1ddcc8 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -713,4 +713,106 @@
http://www.joomlacomponentbuilder.com
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.9.31
+ http://www.joomlacomponentbuilder.com
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.10.0/JCB_v2.10.0.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://www.joomlacomponentbuilder.com
+
+
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.9.32
+ http://www.joomlacomponentbuilder.com
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.10.0/JCB_v2.10.0.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://www.joomlacomponentbuilder.com
+
+
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.9.33
+ http://www.joomlacomponentbuilder.com
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.10.0/JCB_v2.10.0.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://www.joomlacomponentbuilder.com
+
+
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.9.34
+ http://www.joomlacomponentbuilder.com
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.10.0/JCB_v2.10.0.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://www.joomlacomponentbuilder.com
+
+
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.9.35
+ http://www.joomlacomponentbuilder.com
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.10.0/JCB_v2.10.0.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://www.joomlacomponentbuilder.com
+
+
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.10.0
+ http://www.joomlacomponentbuilder.com
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.10.0/JCB_v2.10.0.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://www.joomlacomponentbuilder.com
+
+
\ No newline at end of file
diff --git a/libraries/vdm_io/vendor/composer/ClassLoader.php b/libraries/vdm_io/vendor/composer/ClassLoader.php
index dc02dfb11..fce8549f0 100644
--- a/libraries/vdm_io/vendor/composer/ClassLoader.php
+++ b/libraries/vdm_io/vendor/composer/ClassLoader.php
@@ -279,7 +279,7 @@ class ClassLoader
*/
public function setApcuPrefix($apcuPrefix)
{
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
@@ -377,7 +377,7 @@ class ClassLoader
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
- $search = $subPath.'\\';
+ $search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
diff --git a/libraries/vdm_io/vendor/composer/autoload_classmap.php b/libraries/vdm_io/vendor/composer/autoload_classmap.php
index 2f4700ebd..7a91153b0 100644
--- a/libraries/vdm_io/vendor/composer/autoload_classmap.php
+++ b/libraries/vdm_io/vendor/composer/autoload_classmap.php
@@ -6,28 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
- 'phpseclib\\Crypt\\AES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/AES.php',
- 'phpseclib\\Crypt\\Base' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Base.php',
- 'phpseclib\\Crypt\\Blowfish' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php',
- 'phpseclib\\Crypt\\DES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/DES.php',
- 'phpseclib\\Crypt\\Hash' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Hash.php',
- 'phpseclib\\Crypt\\RC2' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RC2.php',
- 'phpseclib\\Crypt\\RC4' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RC4.php',
- 'phpseclib\\Crypt\\RSA' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/RSA.php',
- 'phpseclib\\Crypt\\Random' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Random.php',
- 'phpseclib\\Crypt\\Rijndael' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php',
- 'phpseclib\\Crypt\\TripleDES' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php',
- 'phpseclib\\Crypt\\Twofish' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php',
- 'phpseclib\\File\\ANSI' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ANSI.php',
- 'phpseclib\\File\\ASN1' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ASN1.php',
- 'phpseclib\\File\\ASN1\\Element' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php',
- 'phpseclib\\File\\X509' => $vendorDir . '/phpseclib/phpseclib/phpseclib/File/X509.php',
- 'phpseclib\\Math\\BigInteger' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Math/BigInteger.php',
- 'phpseclib\\Net\\SCP' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SCP.php',
- 'phpseclib\\Net\\SFTP' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SFTP.php',
- 'phpseclib\\Net\\SFTP\\Stream' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php',
- 'phpseclib\\Net\\SSH1' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SSH1.php',
- 'phpseclib\\Net\\SSH2' => $vendorDir . '/phpseclib/phpseclib/phpseclib/Net/SSH2.php',
- 'phpseclib\\System\\SSH\\Agent' => $vendorDir . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php',
- 'phpseclib\\System\\SSH\\Agent\\Identity' => $vendorDir . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php',
);
diff --git a/libraries/vdm_io/vendor/composer/autoload_static.php b/libraries/vdm_io/vendor/composer/autoload_static.php
index ea6b0d7d3..09b862a0c 100644
--- a/libraries/vdm_io/vendor/composer/autoload_static.php
+++ b/libraries/vdm_io/vendor/composer/autoload_static.php
@@ -24,39 +24,11 @@ class ComposerStaticInit10d22a526bd476954b93748a871e7ad4
),
);
- public static $classMap = array (
- 'phpseclib\\Crypt\\AES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/AES.php',
- 'phpseclib\\Crypt\\Base' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Base.php',
- 'phpseclib\\Crypt\\Blowfish' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php',
- 'phpseclib\\Crypt\\DES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/DES.php',
- 'phpseclib\\Crypt\\Hash' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Hash.php',
- 'phpseclib\\Crypt\\RC2' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RC2.php',
- 'phpseclib\\Crypt\\RC4' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RC4.php',
- 'phpseclib\\Crypt\\RSA' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/RSA.php',
- 'phpseclib\\Crypt\\Random' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Random.php',
- 'phpseclib\\Crypt\\Rijndael' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php',
- 'phpseclib\\Crypt\\TripleDES' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php',
- 'phpseclib\\Crypt\\Twofish' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php',
- 'phpseclib\\File\\ANSI' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ANSI.php',
- 'phpseclib\\File\\ASN1' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ASN1.php',
- 'phpseclib\\File\\ASN1\\Element' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/ASN1/Element.php',
- 'phpseclib\\File\\X509' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/File/X509.php',
- 'phpseclib\\Math\\BigInteger' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Math/BigInteger.php',
- 'phpseclib\\Net\\SCP' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SCP.php',
- 'phpseclib\\Net\\SFTP' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SFTP.php',
- 'phpseclib\\Net\\SFTP\\Stream' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php',
- 'phpseclib\\Net\\SSH1' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SSH1.php',
- 'phpseclib\\Net\\SSH2' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/Net/SSH2.php',
- 'phpseclib\\System\\SSH\\Agent' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php',
- 'phpseclib\\System\\SSH\\Agent\\Identity' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php',
- );
-
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit10d22a526bd476954b93748a871e7ad4::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit10d22a526bd476954b93748a871e7ad4::$prefixDirsPsr4;
- $loader->classMap = ComposerStaticInit10d22a526bd476954b93748a871e7ad4::$classMap;
}, null, ClassLoader::class);
}
diff --git a/libraries/vdm_io/vendor/composer/installed.json b/libraries/vdm_io/vendor/composer/installed.json
index 4ce92974f..d7857e90e 100644
--- a/libraries/vdm_io/vendor/composer/installed.json
+++ b/libraries/vdm_io/vendor/composer/installed.json
@@ -1,17 +1,17 @@
[
{
"name": "phpseclib/phpseclib",
- "version": "2.0.10",
- "version_normalized": "2.0.10.0",
+ "version": "2.0.21",
+ "version_normalized": "2.0.21.0",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
- "reference": "d305b780829ea4252ed9400b3f5937c2c99b51d4"
+ "reference": "9f1287e68b3f283339a9f98f67515dd619e5bf9d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d305b780829ea4252ed9400b3f5937c2c99b51d4",
- "reference": "d305b780829ea4252ed9400b3f5937c2c99b51d4",
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/9f1287e68b3f283339a9f98f67515dd619e5bf9d",
+ "reference": "9f1287e68b3f283339a9f98f67515dd619e5bf9d",
"shasum": ""
},
"require": {
@@ -29,7 +29,7 @@
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
- "time": "2018-02-19T04:29:13+00:00",
+ "time": "2019-07-12T12:53:49+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/LICENSE b/libraries/vdm_io/vendor/phpseclib/phpseclib/LICENSE
index a8ec8ebd4..e7214ebbe 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/LICENSE
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/LICENSE
@@ -1,5 +1,4 @@
-Copyright 2007-2016 TerraFrost and other contributors
-http://phpseclib.sourceforge.net/
+Copyright (c) 2011-2019 TerraFrost and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -18,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/README.md b/libraries/vdm_io/vendor/phpseclib/phpseclib/README.md
index 94402bee0..a9e7ebdab 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/README.md
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/README.md
@@ -2,6 +2,14 @@
[![Build Status](https://travis-ci.org/phpseclib/phpseclib.svg?branch=2.0)](https://travis-ci.org/phpseclib/phpseclib)
+## Supporting phpseclib
+
+- [Become a backer or sponsor on Patreon](https://www.patreon.com/phpseclib)
+- [One-time donation via PayPal or crypto-currencies](http://sourceforge.net/donate/index.php?group_id=198487)
+- [Subscribe to Tidelift](https://tidelift.com/subscription/pkg/packagist-phpseclib-phpseclib?utm_source=packagist-phpseclib-phpseclib&utm_medium=referral&utm_campaign=readme)
+
+## Introduction
+
MIT-licensed pure-PHP implementations of an arbitrary-precision integer
arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael,
AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509
@@ -24,19 +32,24 @@ AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509
### 2.0
+* Long term support (LTS) release
* Modernized version of 1.0
* Minimum PHP version: 5.3.3
* PSR-4 autoloading with namespace rooted at `\phpseclib`
-* Install via Composer: `composer require phpseclib/phpseclib ~2.0`
+* Install via Composer: `composer require phpseclib/phpseclib:~2.0`
### 1.0
* Long term support (LTS) release
* PHP4 compatible
* Composer compatible (PSR-0 autoloading)
-* Install using Composer: `composer require phpseclib/phpseclib ~1.0`
+* Install using Composer: `composer require phpseclib/phpseclib:~1.0`
* Install using PEAR: See [phpseclib PEAR Channel Documentation](http://phpseclib.sourceforge.net/pear.htm)
-* [Download 1.0.10 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.10.zip/download)
+* [Download 1.0.16 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.16.zip/download)
+
+## Security contact information
+
+To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## Support
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/appveyor.yml b/libraries/vdm_io/vendor/phpseclib/phpseclib/appveyor.yml
new file mode 100644
index 000000000..210a90347
--- /dev/null
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/appveyor.yml
@@ -0,0 +1,27 @@
+build: false
+shallow_clone: false
+platform:
+ - x86
+ - x64
+clone_folder: C:\projects\phpseclib
+
+install:
+ - cinst -y OpenSSL.Light
+ - SET PATH=C:\Program Files\OpenSSL;%PATH%
+ - sc config wuauserv start= auto
+ - net start wuauserv
+ - cinst -y php --version 5.6.30
+ - cd c:\tools\php56
+ - copy php.ini-production php.ini
+ - echo date.timezone="UTC" >> php.ini
+ - echo extension_dir=ext >> php.ini
+ - echo extension=php_openssl.dll >> php.ini
+ - echo extension=php_gmp.dll >> php.ini
+ - cd C:\projects\phpseclib
+ - SET PATH=C:\tools\php56;%PATH%
+ - php.exe -r "readfile('http://getcomposer.org/installer');" | php.exe
+ - php.exe composer.phar install --prefer-source --no-interaction
+
+test_script:
+ - cd C:\projects\phpseclib
+ - vendor\bin\phpunit.bat tests/Windows32Test.php
\ No newline at end of file
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php
index 54a8997ed..03b176e7b 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php
@@ -76,6 +76,10 @@ abstract class Base
* @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29
*/
const MODE_CFB = 3;
+ /**
+ * Encrypt / decrypt using the Cipher Feedback mode (8bit)
+ */
+ const MODE_CFB8 = 38;
/**
* Encrypt / decrypt using the Output Feedback mode.
*
@@ -479,6 +483,7 @@ abstract class Base
break;
case self::MODE_CTR:
case self::MODE_CFB:
+ case self::MODE_CFB8:
case self::MODE_OFB:
case self::MODE_STREAM:
$this->mode = $mode;
@@ -644,10 +649,10 @@ abstract class Base
case !function_exists('hash_algos'):
case !in_array($hash, hash_algos()):
$i = 1;
+ $hmac = new Hash();
+ $hmac->setHash($hash);
+ $hmac->setKey($password);
while (strlen($key) < $dkLen) {
- $hmac = new Hash();
- $hmac->setHash($hash);
- $hmac->setKey($password);
$f = $u = $hmac->hash($salt . pack('N', $i++));
for ($j = 2; $j <= $count; ++$j) {
$u = $hmac->hash($u);
@@ -702,7 +707,7 @@ abstract class Base
case self::MODE_STREAM:
return openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options);
case self::MODE_ECB:
- $result = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options);
+ $result = @openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options);
return !defined('OPENSSL_RAW_DATA') ? substr($result, 0, -$this->block_size) : $result;
case self::MODE_CBC:
$result = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->encryptIV);
@@ -762,6 +767,16 @@ abstract class Base
$iv = substr($ciphertext, -$this->block_size);
}
+ return $ciphertext;
+ case self::MODE_CFB8:
+ $ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->encryptIV);
+ if ($this->continuousBuffer) {
+ if (($len = strlen($ciphertext)) >= $this->block_size) {
+ $this->encryptIV = substr($ciphertext, -$this->block_size);
+ } else {
+ $this->encryptIV = substr($this->encryptIV, $len - $this->block_size) . substr($ciphertext, -$len);
+ }
+ }
return $ciphertext;
case self::MODE_OFB:
return $this->_openssl_ofb_process($plaintext, $this->encryptIV, $this->enbuffer);
@@ -942,6 +957,24 @@ abstract class Base
$pos = $len;
}
break;
+ case self::MODE_CFB8:
+ $ciphertext = '';
+ $len = strlen($plaintext);
+ $iv = $this->encryptIV;
+
+ for ($i = 0; $i < $len; ++$i) {
+ $ciphertext .= ($c = $plaintext[$i] ^ $this->_encryptBlock($iv));
+ $iv = substr($iv, 1) . $c;
+ }
+
+ if ($this->continuousBuffer) {
+ if ($len >= $block_size) {
+ $this->encryptIV = substr($ciphertext, -$block_size);
+ } else {
+ $this->encryptIV = substr($this->encryptIV, $len - $block_size) . substr($ciphertext, -$len);
+ }
+ }
+ break;
case self::MODE_OFB:
$xor = $this->encryptIV;
if (strlen($buffer['xor'])) {
@@ -1007,14 +1040,14 @@ abstract class Base
break;
case self::MODE_ECB:
if (!defined('OPENSSL_RAW_DATA')) {
- $ciphertext.= openssl_encrypt('', $this->cipher_name_openssl_ecb, $this->key, true);
+ $ciphertext.= @openssl_encrypt('', $this->cipher_name_openssl_ecb, $this->key, true);
}
$plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options);
break;
case self::MODE_CBC:
if (!defined('OPENSSL_RAW_DATA')) {
$padding = str_repeat(chr($this->block_size), $this->block_size) ^ substr($ciphertext, -$this->block_size);
- $ciphertext.= substr(openssl_encrypt($padding, $this->cipher_name_openssl_ecb, $this->key, true), 0, $this->block_size);
+ $ciphertext.= substr(@openssl_encrypt($padding, $this->cipher_name_openssl_ecb, $this->key, true), 0, $this->block_size);
$offset = 2 * $this->block_size;
} else {
$offset = $this->block_size;
@@ -1072,6 +1105,16 @@ abstract class Base
$iv = substr($ciphertext, -$this->block_size);
}
break;
+ case self::MODE_CFB8:
+ $plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->decryptIV);
+ if ($this->continuousBuffer) {
+ if (($len = strlen($ciphertext)) >= $this->block_size) {
+ $this->decryptIV = substr($ciphertext, -$this->block_size);
+ } else {
+ $this->decryptIV = substr($this->decryptIV, $len - $this->block_size) . substr($ciphertext, -$len);
+ }
+ }
+ break;
case self::MODE_OFB:
$plaintext = $this->_openssl_ofb_process($ciphertext, $this->decryptIV, $this->debuffer);
}
@@ -1235,6 +1278,24 @@ abstract class Base
$pos = $len;
}
break;
+ case self::MODE_CFB8:
+ $plaintext = '';
+ $len = strlen($ciphertext);
+ $iv = $this->decryptIV;
+
+ for ($i = 0; $i < $len; ++$i) {
+ $plaintext .= $ciphertext[$i] ^ $this->_encryptBlock($iv);
+ $iv = substr($iv, 1) . $ciphertext[$i];
+ }
+
+ if ($this->continuousBuffer) {
+ if ($len >= $block_size) {
+ $this->decryptIV = substr($ciphertext, -$block_size);
+ } else {
+ $this->decryptIV = substr($this->decryptIV, $len - $block_size) . substr($ciphertext, -$len);
+ }
+ }
+ break;
case self::MODE_OFB:
$xor = $this->decryptIV;
if (strlen($buffer['xor'])) {
@@ -1297,7 +1358,7 @@ abstract class Base
for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
$block = substr($plaintext, $i, $block_size);
if (strlen($block) > strlen($buffer['ciphertext'])) {
- $result = openssl_encrypt($xor, $this->cipher_name_openssl_ecb, $key, $this->openssl_options);
+ $result = @openssl_encrypt($xor, $this->cipher_name_openssl_ecb, $key, $this->openssl_options);
$result = !defined('OPENSSL_RAW_DATA') ? substr($result, 0, -$this->block_size) : $result;
$buffer['ciphertext'].= $result;
}
@@ -1308,7 +1369,7 @@ abstract class Base
} else {
for ($i = 0; $i < strlen($plaintext); $i+=$block_size) {
$block = substr($plaintext, $i, $block_size);
- $otp = openssl_encrypt($xor, $this->cipher_name_openssl_ecb, $key, $this->openssl_options);
+ $otp = @openssl_encrypt($xor, $this->cipher_name_openssl_ecb, $key, $this->openssl_options);
$otp = !defined('OPENSSL_RAW_DATA') ? substr($otp, 0, -$this->block_size) : $otp;
$this->_increment_str($xor);
$ciphertext.= $block ^ $otp;
@@ -1352,7 +1413,7 @@ abstract class Base
}
if ($this->continuousBuffer) {
if (!defined('OPENSSL_RAW_DATA')) {
- $encryptIV.= openssl_encrypt('', $this->cipher_name_openssl_ecb, $key, $this->openssl_options);
+ $encryptIV.= @openssl_encrypt('', $this->cipher_name_openssl_ecb, $key, $this->openssl_options);
}
$encryptIV = openssl_decrypt($encryptIV, $this->cipher_name_openssl_ecb, $key, $this->openssl_options);
if ($overflow) {
@@ -1435,6 +1496,8 @@ abstract class Base
return 'ctr';
case self::MODE_CFB:
return 'cfb';
+ case self::MODE_CFB8:
+ return 'cfb8';
case self::MODE_OFB:
return 'ofb';
}
@@ -1788,6 +1851,7 @@ abstract class Base
self::MODE_ECB => MCRYPT_MODE_ECB,
self::MODE_CBC => MCRYPT_MODE_CBC,
self::MODE_CFB => 'ncfb',
+ self::MODE_CFB8 => MCRYPT_MODE_CFB,
self::MODE_OFB => MCRYPT_MODE_NOFB,
self::MODE_STREAM => MCRYPT_MODE_STREAM,
);
@@ -2359,6 +2423,52 @@ abstract class Base
$_pos = $_len;
}
+ return $_plaintext;
+ ';
+ break;
+ case self::MODE_CFB8:
+ $encrypt = $init_encrypt . '
+ $_ciphertext = "";
+ $_len = strlen($_text);
+ $_iv = $self->encryptIV;
+
+ for ($_i = 0; $_i < $_len; ++$_i) {
+ $in = $_iv;
+ '.$encrypt_block.'
+ $_ciphertext .= ($_c = $_text[$_i] ^ $in);
+ $_iv = substr($_iv, 1) . $_c;
+ }
+
+ if ($self->continuousBuffer) {
+ if ($_len >= '.$block_size.') {
+ $self->encryptIV = substr($_ciphertext, -'.$block_size.');
+ } else {
+ $self->encryptIV = substr($self->encryptIV, $_len - '.$block_size.') . substr($_ciphertext, -$_len);
+ }
+ }
+
+ return $_ciphertext;
+ ';
+ $decrypt = $init_encrypt . '
+ $_plaintext = "";
+ $_len = strlen($_text);
+ $_iv = $self->decryptIV;
+
+ for ($_i = 0; $_i < $_len; ++$_i) {
+ $in = $_iv;
+ '.$encrypt_block.'
+ $_plaintext .= $_text[$_i] ^ $in;
+ $_iv = substr($_iv, 1) . $_text[$_i];
+ }
+
+ if ($self->continuousBuffer) {
+ if ($_len >= '.$block_size.') {
+ $self->decryptIV = substr($_text, -'.$block_size.');
+ } else {
+ $self->decryptIV = substr($self->decryptIV, $_len - '.$block_size.') . substr($_text, -$_len);
+ }
+ }
+
return $_plaintext;
';
break;
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php
index 6ae01329e..a61668209 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/Hash.php
@@ -112,6 +112,15 @@ class Hash
*/
var $key = false;
+ /**
+ * Computed Key
+ *
+ * @see self::_computeKey()
+ * @var string
+ * @access private
+ */
+ var $computedKey = false;
+
/**
* Outer XOR (Internal HMAC)
*
@@ -130,6 +139,15 @@ class Hash
*/
var $ipad;
+ /**
+ * Engine
+ *
+ * @see self::setHash()
+ * @var string
+ * @access private
+ */
+ var $engine;
+
/**
* Default Constructor.
*
@@ -166,6 +184,43 @@ class Hash
function setKey($key = false)
{
$this->key = $key;
+ $this->_computeKey();
+ }
+
+ /**
+ * Pre-compute the key used by the HMAC
+ *
+ * Quoting http://tools.ietf.org/html/rfc2104#section-2, "Applications that use keys longer than B bytes
+ * will first hash the key using H and then use the resultant L byte string as the actual key to HMAC."
+ *
+ * As documented in https://www.reddit.com/r/PHP/comments/9nct2l/symfonypolyfill_hash_pbkdf2_correct_fix_for/
+ * when doing an HMAC multiple times it's faster to compute the hash once instead of computing it during
+ * every call
+ *
+ * @access private
+ */
+ function _computeKey()
+ {
+ if ($this->key === false) {
+ $this->computedKey = false;
+ return;
+ }
+
+ if (strlen($this->key) <= $this->b) {
+ $this->computedKey = $this->key;
+ return;
+ }
+
+ switch ($this->engine) {
+ case self::MODE_MHASH:
+ $this->computedKey = mhash($this->hash, $this->key);
+ break;
+ case self::MODE_HASH:
+ $this->computedKey = hash($this->hash, $this->key, true);
+ break;
+ case self::MODE_INTERNAL:
+ $this->computedKey = call_user_func($this->hash, $this->key);
+ }
}
/**
@@ -216,19 +271,38 @@ class Hash
}
switch ($hash) {
+ case 'md2-96':
case 'md2':
- $mode = CRYPT_HASH_MODE == self::MODE_HASH && in_array('md2', hash_algos()) ?
+ $this->b = 16;
+ case 'md5-96':
+ case 'sha1-96':
+ case 'sha224-96':
+ case 'sha256-96':
+ case 'md2':
+ case 'md5':
+ case 'sha1':
+ case 'sha224':
+ case 'sha256':
+ $this->b = 64;
+ break;
+ default:
+ $this->b = 128;
+ }
+
+ switch ($hash) {
+ case 'md2':
+ $this->engine = CRYPT_HASH_MODE == self::MODE_HASH && in_array('md2', hash_algos()) ?
self::MODE_HASH : self::MODE_INTERNAL;
break;
case 'sha384':
case 'sha512':
- $mode = CRYPT_HASH_MODE == self::MODE_MHASH ? self::MODE_INTERNAL : CRYPT_HASH_MODE;
+ $this->engine = CRYPT_HASH_MODE == self::MODE_MHASH ? self::MODE_INTERNAL : CRYPT_HASH_MODE;
break;
default:
- $mode = CRYPT_HASH_MODE;
+ $this->engine = CRYPT_HASH_MODE;
}
- switch ($mode) {
+ switch ($this->engine) {
case self::MODE_MHASH:
switch ($hash) {
case 'md5':
@@ -241,6 +315,7 @@ class Hash
default:
$this->hash = MHASH_SHA1;
}
+ $this->_computeKey(self::MODE_MHASH);
return;
case self::MODE_HASH:
switch ($hash) {
@@ -257,35 +332,33 @@ class Hash
default:
$this->hash = 'sha1';
}
+ $this->_computeKey(self::MODE_HASH);
return;
}
switch ($hash) {
case 'md2':
- $this->b = 16;
$this->hash = array($this, '_md2');
break;
case 'md5':
- $this->b = 64;
$this->hash = array($this, '_md5');
break;
case 'sha256':
- $this->b = 64;
$this->hash = array($this, '_sha256');
break;
case 'sha384':
case 'sha512':
- $this->b = 128;
$this->hash = array($this, '_sha512');
break;
case 'sha1':
default:
- $this->b = 64;
$this->hash = array($this, '_sha1');
}
$this->ipad = str_repeat(chr(0x36), $this->b);
$this->opad = str_repeat(chr(0x5C), $this->b);
+
+ $this->_computeKey(self::MODE_INTERNAL);
}
/**
@@ -297,33 +370,25 @@ class Hash
*/
function hash($text)
{
- $mode = is_array($this->hash) ? self::MODE_INTERNAL : CRYPT_HASH_MODE;
-
if (!empty($this->key) || is_string($this->key)) {
- switch ($mode) {
+ switch ($this->engine) {
case self::MODE_MHASH:
- $output = mhash($this->hash, $text, $this->key);
+ $output = mhash($this->hash, $text, $this->computedKey);
break;
case self::MODE_HASH:
- $output = hash_hmac($this->hash, $text, $this->key, true);
+ $output = hash_hmac($this->hash, $text, $this->computedKey, true);
break;
case self::MODE_INTERNAL:
- /* "Applications that use keys longer than B bytes will first hash the key using H and then use the
- resultant L byte string as the actual key to HMAC."
-
- -- http://tools.ietf.org/html/rfc2104#section-2 */
- $key = strlen($this->key) > $this->b ? call_user_func($this->hash, $this->key) : $this->key;
-
- $key = str_pad($key, $this->b, chr(0)); // step 1
- $temp = $this->ipad ^ $key; // step 2
- $temp .= $text; // step 3
- $temp = call_user_func($this->hash, $temp); // step 4
- $output = $this->opad ^ $key; // step 5
- $output.= $temp; // step 6
- $output = call_user_func($this->hash, $output); // step 7
+ $key = str_pad($this->computedKey, $this->b, chr(0)); // step 1
+ $temp = $this->ipad ^ $key; // step 2
+ $temp .= $text; // step 3
+ $temp = call_user_func($this->hash, $temp); // step 4
+ $output = $this->opad ^ $key; // step 5
+ $output.= $temp; // step 6
+ $output = call_user_func($this->hash, $output); // step 7
}
} else {
- switch ($mode) {
+ switch ($this->engine) {
case self::MODE_MHASH:
$output = mhash($this->hash, $text);
break;
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php
index cd116b56d..d2c6c7cbe 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php
@@ -182,6 +182,10 @@ class RSA
* PKCS#8 formatted private key
*/
const PRIVATE_FORMAT_PKCS8 = 8;
+ /**
+ * OpenSSH formatted private key
+ */
+ const PRIVATE_FORMAT_OPENSSH = 9;
/**#@-*/
/**#@+
@@ -468,23 +472,27 @@ class RSA
break;
case extension_loaded('openssl') && file_exists($this->configFile):
// some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work
- ob_start();
- @phpinfo();
- $content = ob_get_contents();
- ob_end_clean();
-
- preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);
-
$versions = array();
- if (!empty($matches[1])) {
- for ($i = 0; $i < count($matches[1]); $i++) {
- $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
- // Remove letter part in OpenSSL version
- if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
- $versions[$matches[1][$i]] = $fullVersion;
- } else {
- $versions[$matches[1][$i]] = $m[0];
+ // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems)
+ if (strpos(ini_get('disable_functions'), 'phpinfo') === false) {
+ ob_start();
+ @phpinfo();
+ $content = ob_get_contents();
+ ob_end_clean();
+
+ preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);
+
+ if (!empty($matches[1])) {
+ for ($i = 0; $i < count($matches[1]); $i++) {
+ $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
+
+ // Remove letter part in OpenSSL version
+ if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
+ $versions[$matches[1][$i]] = $fullVersion;
+ } else {
+ $versions[$matches[1][$i]] = $m[0];
+ }
}
}
}
@@ -816,6 +824,58 @@ class RSA
$key.= 'Private-MAC: ' . bin2hex($hash->hash($source)) . "\r\n";
return $key;
+ case self::PRIVATE_FORMAT_OPENSSH:
+ if ($num_primes != 2) {
+ return false;
+ }
+ $publicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($raw['publicExponent']), $raw['publicExponent'], strlen($raw['modulus']), $raw['modulus']);
+ $privateKey = pack(
+ 'Na*Na*Na*Na*Na*Na*Na*',
+ strlen('ssh-rsa'),
+ 'ssh-rsa',
+ strlen($raw['modulus']),
+ $raw['modulus'],
+ strlen($raw['publicExponent']),
+ $raw['publicExponent'],
+ strlen($raw['privateExponent']),
+ $raw['privateExponent'],
+ strlen($raw['coefficient']),
+ $raw['coefficient'],
+ strlen($raw['prime1']),
+ $raw['prime1'],
+ strlen($raw['prime2']),
+ $raw['prime2']
+ );
+ $checkint = Random::string(4);
+ $paddedKey = pack(
+ 'a*Na*',
+ $checkint . $checkint . $privateKey,
+ strlen($this->comment),
+ $this->comment
+ );
+ $paddingLength = (7 * strlen($paddedKey)) % 8;
+ for ($i = 1; $i <= $paddingLength; $i++) {
+ $paddedKey.= chr($i);
+ }
+ $key = pack(
+ 'Na*Na*Na*NNa*Na*',
+ strlen('none'),
+ 'none',
+ strlen('none'),
+ 'none',
+ 0,
+ '',
+ 1,
+ strlen($publicKey),
+ $publicKey,
+ strlen($paddedKey),
+ $paddedKey
+ );
+ $key = "openssh-key-v1\0$key";
+
+ return "-----BEGIN OPENSSH PRIVATE KEY-----\r\n" .
+ chunk_split(base64_encode($key), 70) .
+ "-----END OPENSSH PRIVATE KEY-----";
default: // eg. self::PRIVATE_FORMAT_PKCS1
$components = array();
foreach ($raw as $name => $value) {
@@ -1016,9 +1076,9 @@ class RSA
* @access private
* @see self::_convertPublicKey()
* @see self::_convertPrivateKey()
- * @param string $key
+ * @param string|array $key
* @param int $type
- * @return array
+ * @return array|bool
*/
function _parseKey($key, $type)
{
@@ -1329,9 +1389,14 @@ class RSA
xml_set_character_data_handler($xml, '_data_handler');
// add to account for "dangling" tags like ... that are sometimes added
if (!xml_parse($xml, '' . $key . ' ')) {
+ xml_parser_free($xml);
+ unset($xml);
return false;
}
+ xml_parser_free($xml);
+ unset($xml);
+
return isset($this->components['modulus']) && isset($this->components['publicExponent']) ? $this->components : false;
// from PuTTY's SSHPUBK.C
case self::PRIVATE_FORMAT_PUTTY:
@@ -1403,6 +1468,75 @@ class RSA
}
$components['coefficients'] = array(2 => new BigInteger($this->_string_shift($private, $length), -256));
+ return $components;
+ case self::PRIVATE_FORMAT_OPENSSH:
+ $components = array();
+ $decoded = $this->_extractBER($key);
+ $magic = $this->_string_shift($decoded, 15);
+ if ($magic !== "openssh-key-v1\0") {
+ return false;
+ }
+ $options = $this->_string_shift($decoded, 24);
+ // \0\0\0\4none = ciphername
+ // \0\0\0\4none = kdfname
+ // \0\0\0\0 = kdfoptions
+ // \0\0\0\1 = numkeys
+ if ($options != "\0\0\0\4none\0\0\0\4none\0\0\0\0\0\0\0\1") {
+ return false;
+ }
+ extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
+ if (strlen($decoded) < $length) {
+ return false;
+ }
+ $publicKey = $this->_string_shift($decoded, $length);
+ extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
+ if (strlen($decoded) < $length) {
+ return false;
+ }
+ $paddedKey = $this->_string_shift($decoded, $length);
+
+ if ($this->_string_shift($publicKey, 11) !== "\0\0\0\7ssh-rsa") {
+ return false;
+ }
+
+ $checkint1 = $this->_string_shift($paddedKey, 4);
+ $checkint2 = $this->_string_shift($paddedKey, 4);
+ if (strlen($checkint1) != 4 || $checkint1 !== $checkint2) {
+ return false;
+ }
+
+ if ($this->_string_shift($paddedKey, 11) !== "\0\0\0\7ssh-rsa") {
+ return false;
+ }
+
+ $values = array(
+ &$components['modulus'],
+ &$components['publicExponent'],
+ &$components['privateExponent'],
+ &$components['coefficients'][2],
+ &$components['primes'][1],
+ &$components['primes'][2]
+ );
+
+ foreach ($values as &$value) {
+ extract(unpack('Nlength', $this->_string_shift($paddedKey, 4)));
+ if (strlen($paddedKey) < $length) {
+ return false;
+ }
+ $value = new BigInteger($this->_string_shift($paddedKey, $length), -256);
+ }
+
+ extract(unpack('Nlength', $this->_string_shift($paddedKey, 4)));
+ if (strlen($paddedKey) < $length) {
+ return false;
+ }
+ $components['comment'] = $this->_string_shift($decoded, $length);
+
+ $temp = $components['primes'][1]->subtract($this->one);
+ $components['exponents'] = array(1 => $components['publicExponent']->modInverse($temp));
+ $temp = $components['primes'][2]->subtract($this->one);
+ $components['exponents'][] = $components['publicExponent']->modInverse($temp);
+
return $components;
}
}
@@ -1501,8 +1635,9 @@ class RSA
* Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed)
*
* @access public
- * @param string $key
- * @param int $type optional
+ * @param string|RSA|array $key
+ * @param bool|int $type optional
+ * @return bool
*/
function loadKey($key, $type = false)
{
@@ -1559,7 +1694,8 @@ class RSA
self::PRIVATE_FORMAT_PKCS1,
self::PRIVATE_FORMAT_XML,
self::PRIVATE_FORMAT_PUTTY,
- self::PUBLIC_FORMAT_OPENSSH
+ self::PUBLIC_FORMAT_OPENSSH,
+ self::PRIVATE_FORMAT_OPENSSH
);
foreach ($types as $type) {
$components = $this->_parseKey($key, $type);
@@ -2207,16 +2343,21 @@ class RSA
*/
function _equals($x, $y)
{
+ if (function_exists('hash_equals')) {
+ return hash_equals($x, $y);
+ }
+
if (strlen($x) != strlen($y)) {
return false;
}
- $result = 0;
+ $result = "\0";
+ $x^= $y;
for ($i = 0; $i < strlen($x); $i++) {
- $result |= ord($x[$i]) ^ ord($y[$i]);
+ $result|= $x[$i];
}
- return $result == 0;
+ return $result === "\0";
}
/**
@@ -2423,19 +2564,26 @@ class RSA
$db = $maskedDB ^ $dbMask;
$lHash2 = substr($db, 0, $this->hLen);
$m = substr($db, $this->hLen);
- if (!$this->_equals($lHash, $lHash2)) {
- user_error('Decryption error');
- return false;
+ $hashesMatch = $this->_equals($lHash, $lHash2);
+ $leadingZeros = 1;
+ $patternMatch = 0;
+ $offset = 0;
+ for ($i = 0; $i < strlen($m); $i++) {
+ $patternMatch|= $leadingZeros & ($m[$i] === "\1");
+ $leadingZeros&= $m[$i] === "\0";
+ $offset+= $patternMatch ? 0 : 1;
}
- $m = ltrim($m, chr(0));
- if (ord($m[0]) != 1) {
+
+ // we do & instead of && to avoid https://en.wikipedia.org/wiki/Short-circuit_evaluation
+ // to protect against timing attacks
+ if (!$hashesMatch & !$patternMatch) {
user_error('Decryption error');
return false;
}
// Output the message M
- return substr($m, 1);
+ return substr($m, $offset + 1);
}
/**
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php
index 1da046e82..3aaa30900 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php
@@ -244,9 +244,10 @@ class ASN1
$tag = 0;
// process septets (since the eighth bit is ignored, it's not an octet)
do {
- $loop = ord($encoded[0]) >> 7;
+ $temp = ord($encoded[$encoded_pos++]);
+ $loop = $temp >> 7;
$tag <<= 7;
- $tag |= ord($encoded[$encoded_pos++]) & 0x7F;
+ $tag |= $temp & 0x7F;
$start++;
} while ($loop);
}
@@ -308,6 +309,9 @@ class ASN1
$remainingLength = $length;
while ($remainingLength > 0) {
$temp = $this->_decode_ber($content, $start, $content_pos);
+ if ($temp === false) {
+ break;
+ }
$length = $temp['length'];
// end-of-content octets - see paragraph 8.1.5
if (substr($content, $content_pos + $length, 2) == "\0\0") {
@@ -359,6 +363,9 @@ class ASN1
$current['content'] = substr($content, $content_pos);
} else {
$temp = $this->_decode_ber($content, $start, $content_pos);
+ if ($temp === false) {
+ return false;
+ }
$length-= (strlen($content) - $content_pos);
$last = count($temp) - 1;
for ($i = 0; $i < $last; $i++) {
@@ -383,6 +390,9 @@ class ASN1
$length = 0;
while (substr($content, $content_pos, 2) != "\0\0") {
$temp = $this->_decode_ber($content, $length + $start, $content_pos);
+ if ($temp === false) {
+ return false;
+ }
$content_pos += $temp['length'];
// all subtags should be octet strings
//if ($temp['type'] != self::TYPE_OCTET_STRING) {
@@ -415,30 +425,16 @@ class ASN1
break 2;
}
$temp = $this->_decode_ber($content, $start + $offset, $content_pos);
+ if ($temp === false) {
+ return false;
+ }
$content_pos += $temp['length'];
$current['content'][] = $temp;
$offset+= $temp['length'];
}
break;
case self::TYPE_OBJECT_IDENTIFIER:
- $temp = ord($content[$content_pos++]);
- $current['content'] = sprintf('%d.%d', floor($temp / 40), $temp % 40);
- $valuen = 0;
- // process septets
- $content_len = strlen($content);
- while ($content_pos < $content_len) {
- $temp = ord($content[$content_pos++]);
- $valuen <<= 7;
- $valuen |= $temp & 0x7F;
- if (~$temp & 0x80) {
- $current['content'].= ".$valuen";
- $valuen = 0;
- }
- }
- // the eighth bit of the last byte should not be 1
- //if ($temp >> 7) {
- // return false;
- //}
+ $current['content'] = $this->_decodeOID(substr($content, $content_pos));
break;
/* Each character string type shall be encoded as if it had been declared:
[UNIVERSAL x] IMPLICIT OCTET STRING
@@ -582,7 +578,7 @@ class ASN1
$childClass = $tempClass = self::CLASS_UNIVERSAL;
$constant = null;
if (isset($temp['constant'])) {
- $tempClass = isset($temp['class']) ? $temp['class'] : self::CLASS_CONTEXT_SPECIFIC;
+ $tempClass = $temp['type'];
}
if (isset($child['class'])) {
$childClass = $child['class'];
@@ -645,7 +641,7 @@ class ASN1
$temp = $decoded['content'][$i];
$tempClass = self::CLASS_UNIVERSAL;
if (isset($temp['constant'])) {
- $tempClass = isset($temp['class']) ? $temp['class'] : self::CLASS_CONTEXT_SPECIFIC;
+ $tempClass = $temp['type'];
}
foreach ($mapping['children'] as $key => $child) {
@@ -1001,27 +997,7 @@ class ASN1
$value = base64_decode($source);
break;
case self::TYPE_OBJECT_IDENTIFIER:
- $oid = preg_match('#(?:\d+\.)+#', $source) ? $source : array_search($source, $this->oids);
- if ($oid === false) {
- user_error('Invalid OID');
- return false;
- }
- $value = '';
- $parts = explode('.', $oid);
- $value = chr(40 * $parts[0] + $parts[1]);
- for ($i = 2; $i < count($parts); $i++) {
- $temp = '';
- if (!$parts[$i]) {
- $temp = "\0";
- } else {
- while ($parts[$i]) {
- $temp = chr(0x80 | ($parts[$i] & 0x7F)) . $temp;
- $parts[$i] >>= 7;
- }
- $temp[strlen($temp) - 1] = $temp[strlen($temp) - 1] & chr(0x7F);
- }
- $value.= $temp;
- }
+ $value = $this->_encodeOID($source);
break;
case self::TYPE_ANY:
$loc = $this->location;
@@ -1120,6 +1096,108 @@ class ASN1
return pack('Ca*', 0x80 | strlen($temp), $temp);
}
+ /**
+ * BER-decode the OID
+ *
+ * Called by _decode_ber()
+ *
+ * @access private
+ * @param string $content
+ * @return string
+ */
+ function _decodeOID($content)
+ {
+ static $eighty;
+ if (!$eighty) {
+ $eighty = new BigInteger(80);
+ }
+
+ $oid = array();
+ $pos = 0;
+ $len = strlen($content);
+ $n = new BigInteger();
+ while ($pos < $len) {
+ $temp = ord($content[$pos++]);
+ $n = $n->bitwise_leftShift(7);
+ $n = $n->bitwise_or(new BigInteger($temp & 0x7F));
+ if (~$temp & 0x80) {
+ $oid[] = $n;
+ $n = new BigInteger();
+ }
+ }
+ $part1 = array_shift($oid);
+ $first = floor(ord($content[0]) / 40);
+ /*
+ "This packing of the first two object identifier components recognizes that only three values are allocated from the root
+ node, and at most 39 subsequent values from nodes reached by X = 0 and X = 1."
+
+ -- https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#page=22
+ */
+ if ($first <= 2) { // ie. 0 <= ord($content[0]) < 120 (0x78)
+ array_unshift($oid, ord($content[0]) % 40);
+ array_unshift($oid, $first);
+ } else {
+ array_unshift($oid, $part1->subtract($eighty));
+ array_unshift($oid, 2);
+ }
+
+ return implode('.', $oid);
+ }
+
+ /**
+ * DER-encode the OID
+ *
+ * Called by _encode_der()
+ *
+ * @access private
+ * @param string $content
+ * @return string
+ */
+ function _encodeOID($source)
+ {
+ static $mask, $zero, $forty;
+ if (!$mask) {
+ $mask = new BigInteger(0x7F);
+ $zero = new BigInteger();
+ $forty = new BigInteger(40);
+ }
+
+ $oid = preg_match('#(?:\d+\.)+#', $source) ? $source : array_search($source, $this->oids);
+ if ($oid === false) {
+ user_error('Invalid OID');
+ return false;
+ }
+ $parts = explode('.', $oid);
+ $part1 = array_shift($parts);
+ $part2 = array_shift($parts);
+
+ $first = new BigInteger($part1);
+ $first = $first->multiply($forty);
+ $first = $first->add(new BigInteger($part2));
+
+ array_unshift($parts, $first->toString());
+
+ $value = '';
+ foreach ($parts as $part) {
+ if (!$part) {
+ $temp = "\0";
+ } else {
+ $temp = '';
+ $part = new BigInteger($part);
+ while (!$part->equals($zero)) {
+ $submask = $part->bitwise_and($mask);
+ $submask->setPrecision(8);
+ $temp = (chr(0x80) | $submask->toBytes()) . $temp;
+ $part = $part->bitwise_rightShift(7);
+ }
+ $temp[strlen($temp) - 1] = $temp[strlen($temp) - 1] & chr(0x7F);
+ }
+ $value.= $temp;
+ }
+
+ return $value;
+ }
+
/**
* BER-decode the time
*
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/File/X509.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
index 67317db23..4ebafa171 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/File/X509.php
@@ -305,6 +305,22 @@ class X509
*/
var $challenge;
+ /**
+ * Recursion Limit
+ *
+ * @var int
+ * @access private
+ */
+ static $recur_limit = 5;
+
+ /**
+ * URL fetch flag
+ *
+ * @var bool
+ * @access private
+ */
+ static $disable_url_fetch = false;
+
/**
* Default Constructor.
*
@@ -1912,6 +1928,9 @@ class X509
// "Certificate Transparency"
// https://tools.ietf.org/html/rfc6962
case '1.3.6.1.4.1.11129.2.4.2':
+ // "Qualified Certificate statements"
+ // https://tools.ietf.org/html/rfc3739#section-3.2.6
+ case '1.3.6.1.5.5.7.1.3':
return true;
// CSR attributes
@@ -2076,7 +2095,7 @@ class X509
*
* If $date isn't defined it is assumed to be the current date.
*
- * @param int $date optional
+ * @param \DateTime|string $date optional
* @access public
*/
function validateDate($date = null)
@@ -2086,7 +2105,7 @@ class X509
}
if (!isset($date)) {
- $date = new DateTime($date, new DateTimeZone(@date_default_timezone_get()));
+ $date = new DateTime(null, new DateTimeZone(@date_default_timezone_get()));
}
$notBefore = $this->currentCert['tbsCertificate']['validity']['notBefore'];
@@ -2095,15 +2114,133 @@ class X509
$notAfter = $this->currentCert['tbsCertificate']['validity']['notAfter'];
$notAfter = isset($notAfter['generalTime']) ? $notAfter['generalTime'] : $notAfter['utcTime'];
+ if (is_string($date)) {
+ $date = new DateTime($date, new DateTimeZone(@date_default_timezone_get()));
+ }
+
+ $notBefore = new DateTime($notBefore, new DateTimeZone(@date_default_timezone_get()));
+ $notAfter = new DateTime($notAfter, new DateTimeZone(@date_default_timezone_get()));
+
switch (true) {
- case $date < new DateTime($notBefore, new DateTimeZone(@date_default_timezone_get())):
- case $date > new DateTime($notAfter, new DateTimeZone(@date_default_timezone_get())):
+ case $date < $notBefore:
+ case $date > $notAfter:
return false;
}
return true;
}
+ /**
+ * Fetches a URL
+ *
+ * @param string $url
+ * @access private
+ * @return bool|string
+ */
+ static function _fetchURL($url)
+ {
+ if (self::$disable_url_fetch) {
+ return false;
+ }
+
+ $parts = parse_url($url);
+ $data = '';
+ switch ($parts['scheme']) {
+ case 'http':
+ $fsock = @fsockopen($parts['host'], isset($parts['port']) ? $parts['port'] : 80);
+ if (!$fsock) {
+ return false;
+ }
+ fputs($fsock, "GET $parts[path] HTTP/1.0\r\n");
+ fputs($fsock, "Host: $parts[host]\r\n\r\n");
+ $line = fgets($fsock, 1024);
+ if (strlen($line) < 3) {
+ return false;
+ }
+ preg_match('#HTTP/1.\d (\d{3})#', $line, $temp);
+ if ($temp[1] != '200') {
+ return false;
+ }
+
+ // skip the rest of the headers in the http response
+ while (!feof($fsock) && fgets($fsock, 1024) != "\r\n") {
+ }
+
+ while (!feof($fsock)) {
+ $data.= fread($fsock, 1024);
+ }
+
+ break;
+ //case 'ftp':
+ //case 'ldap':
+ //default:
+ }
+
+ return $data;
+ }
+
+ /**
+ * Validates an intermediate cert as identified via authority info access extension
+ *
+ * See https://tools.ietf.org/html/rfc4325 for more info
+ *
+ * @param bool $caonly
+ * @param int $count
+ * @access private
+ * @return bool
+ */
+ function _testForIntermediate($caonly, $count)
+ {
+ $opts = $this->getExtension('id-pe-authorityInfoAccess');
+ if (!is_array($opts)) {
+ return false;
+ }
+ foreach ($opts as $opt) {
+ if ($opt['accessMethod'] == 'id-ad-caIssuers') {
+ // accessLocation is a GeneralName. GeneralName fields support stuff like email addresses, IP addresses, LDAP,
+ // etc, but we're only supporting URI's. URI's and LDAP are the only thing https://tools.ietf.org/html/rfc4325
+ // discusses
+ if (isset($opt['accessLocation']['uniformResourceIdentifier'])) {
+ $url = $opt['accessLocation']['uniformResourceIdentifier'];
+ break;
+ }
+ }
+ }
+
+ if (!isset($url)) {
+ return false;
+ }
+
+ $cert = static::_fetchURL($url);
+ if (!is_string($cert)) {
+ return false;
+ }
+
+ $parent = new static();
+ $parent->CAs = $this->CAs;
+ /*
+ "Conforming applications that support HTTP or FTP for accessing
+ certificates MUST be able to accept .cer files and SHOULD be able
+ to accept .p7c files." -- https://tools.ietf.org/html/rfc4325
+
+ A .p7c file is 'a "certs-only" CMS message as specified in RFC 2797"
+
+ These are currently unsupported
+ */
+ if (!is_array($parent->loadX509($cert))) {
+ return false;
+ }
+
+ if (!$parent->_validateSignatureCountable($caonly, ++$count)) {
+ return false;
+ }
+
+ $this->CAs[] = $parent->currentCert;
+ //$this->loadCA($cert);
+
+ return true;
+ }
+
/**
* Validate a signature
*
@@ -2120,11 +2257,30 @@ class X509
* @return mixed
*/
function validateSignature($caonly = true)
+ {
+ return $this->_validateSignatureCountable($caonly, 0);
+ }
+
+ /**
+ * Validate a signature
+ *
+ * Performs said validation whilst keeping track of how many times validation method is called
+ *
+ * @param bool $caonly
+ * @param int $count
+ * @access private
+ * @return mixed
+ */
+ function _validateSignatureCountable($caonly, $count)
{
if (!is_array($this->currentCert) || !isset($this->signatureSubject)) {
return null;
}
+ if ($count == self::$recur_limit) {
+ return false;
+ }
+
/* TODO:
"emailAddress attribute values are not case-sensitive (e.g., "subscriber@example.com" is the same as "SUBSCRIBER@EXAMPLE.COM")."
-- http://tools.ietf.org/html/rfc5280#section-4.1.2.6
@@ -2170,10 +2326,10 @@ class X509
}
}
if (count($this->CAs) == $i && $caonly) {
- return false;
+ return $this->_testForIntermediate($caonly, $count) && $this->validateSignature($caonly);
}
} elseif (!isset($signingCert) || $caonly) {
- return false;
+ return $this->_testForIntermediate($caonly, $count) && $this->validateSignature($caonly);
}
return $this->_validateSignature(
$signingCert['tbsCertificate']['subjectPublicKeyInfo']['algorithm']['algorithm'],
@@ -2280,6 +2436,41 @@ class X509
return true;
}
+ /**
+ * Sets the recursion limit
+ *
+ * When validating a signature it may be necessary to download intermediate certs from URI's.
+ * An intermediate cert that linked to itself would result in an infinite loop so to prevent
+ * that we set a recursion limit. A negative number means that there is no recursion limit.
+ *
+ * @param int $count
+ * @access public
+ */
+ static function setRecurLimit($count)
+ {
+ self::$recur_limit = $count;
+ }
+
+ /**
+ * Prevents URIs from being automatically retrieved
+ *
+ * @access public
+ */
+ static function disableURLFetch()
+ {
+ self::$disable_url_fetch = true;
+ }
+
+ /**
+ * Allows URIs to be automatically retrieved
+ *
+ * @access public
+ */
+ static function enableURLFetch()
+ {
+ self::$disable_url_fetch = false;
+ }
+
/**
* Reformat public keys
*
@@ -2739,7 +2930,7 @@ class X509
}
$output.= $desc . '=' . $value;
$result[$desc] = isset($result[$desc]) ?
- array_merge((array) $dn[$prop], array($value)) :
+ array_merge((array) $result[$desc], array($value)) :
$value;
$start = false;
}
@@ -3447,7 +3638,7 @@ class X509
'tbsCertificate' =>
array(
'version' => 'v3',
- 'serialNumber' => $serialNumber, // $this->setserialNumber()
+ 'serialNumber' => $serialNumber, // $this->setSerialNumber()
'signature' => array('algorithm' => $signatureAlgorithm),
'issuer' => false, // this is going to be overwritten later
'validity' => array(
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php
index 2aa39a50a..fe1f43c58 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php
@@ -45,7 +45,6 @@
* @author Jim Wigginton
* @copyright 2006 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
- * @link http://pear.php.net/package/Math_BigInteger
*/
namespace phpseclib\Math;
@@ -266,23 +265,27 @@ class BigInteger
if (extension_loaded('openssl') && !defined('MATH_BIGINTEGER_OPENSSL_DISABLE') && !defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
// some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work
- ob_start();
- @phpinfo();
- $content = ob_get_contents();
- ob_end_clean();
-
- preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);
-
$versions = array();
- if (!empty($matches[1])) {
- for ($i = 0; $i < count($matches[1]); $i++) {
- $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
- // Remove letter part in OpenSSL version
- if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
- $versions[$matches[1][$i]] = $fullVersion;
- } else {
- $versions[$matches[1][$i]] = $m[0];
+ // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems)
+ if (strpos(ini_get('disable_functions'), 'phpinfo') === false) {
+ ob_start();
+ @phpinfo();
+ $content = ob_get_contents();
+ ob_end_clean();
+
+ preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);
+
+ if (!empty($matches[1])) {
+ for ($i = 0; $i < count($matches[1]); $i++) {
+ $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
+
+ // Remove letter part in OpenSSL version
+ if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
+ $versions[$matches[1][$i]] = $fullVersion;
+ } else {
+ $versions[$matches[1][$i]] = $m[0];
+ }
}
}
}
@@ -442,6 +445,9 @@ class BigInteger
// (?<=^|-)0*: find any 0's that are preceded by the start of the string or by a - (ie. octals)
// [^-0-9].*: find any non-numeric characters and then any characters that follow that
$x = preg_replace('#(?add(new static(1)) : $this->copy();
$bytes = $temp->toBytes();
- if (empty($bytes)) { // eg. if the number we're trying to convert is -1
+ if (!strlen($bytes)) { // eg. if the number we're trying to convert is -1
$bytes = chr(0);
}
@@ -1555,7 +1561,9 @@ class BigInteger
$temp_value = array($quotient_value[$q_index]);
$temp = $temp->multiply($y);
$temp_value = &$temp->value;
- $temp_value = array_merge($adjust, $temp_value);
+ if (count($temp_value)) {
+ $temp_value = array_merge($adjust, $temp_value);
+ }
$x = $x->subtract($temp);
@@ -2688,7 +2696,14 @@ class BigInteger
{
switch (MATH_BIGINTEGER_MODE) {
case self::MODE_GMP:
- return gmp_cmp($this->value, $y->value);
+ $r = gmp_cmp($this->value, $y->value);
+ if ($r < -1) {
+ $r = -1;
+ }
+ if ($r > 1) {
+ $r = 1;
+ }
+ return $r;
case self::MODE_BCMATH:
return bccomp($this->value, $y->value, 0);
}
@@ -3569,6 +3584,7 @@ class BigInteger
$value = &$result->value;
if (!count($value)) {
+ $result->is_negative = false;
return $result;
}
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php
index f95bce6df..cf13496cd 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SCP.php
@@ -144,6 +144,11 @@ class SCP
return false;
}
+ if (empty($remote_file)) {
+ user_error('remote_file cannot be blank', E_USER_NOTICE);
+ return false;
+ }
+
if (!$this->ssh->exec('scp -t ' . escapeshellarg($remote_file), false)) { // -t = to
return false;
}
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php
index 8825f30cf..a248c2581 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php
@@ -109,11 +109,11 @@ class SFTP extends SSH2
* The request ID exists in the off chance that a packet is sent out-of-order. Of course, this library doesn't support
* concurrent actions, so it's somewhat academic, here.
*
- * @var int
+ * @var boolean
* @see self::_send_sftp_packet()
* @access private
*/
- var $request_id = false;
+ var $use_request_id = false;
/**
* The Packet Type
@@ -250,6 +250,15 @@ class SFTP extends SSH2
*/
var $canonicalize_paths = true;
+ /**
+ * Request Buffers
+ *
+ * @see self::_get_sftp_packet()
+ * @var array
+ * @access private
+ */
+ var $requestBuffer = array();
+
/**
* Default Constructor.
*
@@ -519,7 +528,7 @@ class SFTP extends SSH2
}
*/
- $this->request_id = 1;
+ $this->use_request_id = true;
/*
A Note on SFTPv4/5/6 support:
@@ -833,6 +842,7 @@ class SFTP extends SSH2
}
if (is_array($this->_query_stat_cache($this->_realpath($dir . '/' . $value)))) {
$temp = $this->_nlist_helper($dir . '/' . $value, true, $relativeDir . $value . '/');
+ $temp = is_array($temp) ? $temp : array();
$result = array_merge($result, $temp);
} else {
$result[] = $relativeDir . $value;
@@ -864,7 +874,17 @@ class SFTP extends SSH2
unset($files[$key]);
continue;
}
- if ($key != '.' && $key != '..' && is_array($this->_query_stat_cache($this->_realpath($dir . '/' . $key)))) {
+ $is_directory = false;
+ if ($key != '.' && $key != '..') {
+ if ($this->use_stat_cache) {
+ $is_directory = is_array($this->_query_stat_cache($this->_realpath($dir . '/' . $key)));
+ } else {
+ $stat = $this->lstat($dir . '/' . $key);
+ $is_directory = $stat && $stat['type'] === NET_SFTP_TYPE_DIRECTORY;
+ }
+ }
+
+ if ($is_directory) {
$depth++;
$files[$key] = $this->rawlist($dir . '/' . $key, true);
$depth--;
@@ -2128,10 +2148,11 @@ class SFTP extends SSH2
* @param string $local_file
* @param int $offset
* @param int $length
+ * @param callable|null $progressCallback
* @return mixed
* @access public
*/
- function get($remote_file, $local_file = false, $offset = 0, $length = -1)
+ function get($remote_file, $local_file = false, $offset = 0, $length = -1, $progressCallback = null)
{
if (!($this->bitmap & SSH2::MASK_LOGIN)) {
return false;
@@ -2189,7 +2210,7 @@ class SFTP extends SSH2
$packet_size = $length > 0 ? min($this->max_sftp_packet, $length - $read) : $this->max_sftp_packet;
$packet = pack('Na*N3', strlen($handle), $handle, $tempoffset / 4294967296, $tempoffset, $packet_size);
- if (!$this->_send_sftp_packet(NET_SFTP_READ, $packet)) {
+ if (!$this->_send_sftp_packet(NET_SFTP_READ, $packet, $i)) {
if ($fclose_check) {
fclose($fp);
}
@@ -2197,6 +2218,9 @@ class SFTP extends SSH2
}
$packet = null;
$read+= $packet_size;
+ if (is_callable($progressCallback)) {
+ call_user_func($progressCallback, $read);
+ }
$i++;
}
@@ -2204,15 +2228,17 @@ class SFTP extends SSH2
break;
}
+ $packets_sent = $i - 1;
+
$clear_responses = false;
while ($i > 0) {
$i--;
if ($clear_responses) {
- $this->_get_sftp_packet();
+ $this->_get_sftp_packet($packets_sent - $i);
continue;
} else {
- $response = $this->_get_sftp_packet();
+ $response = $this->_get_sftp_packet($packets_sent - $i);
}
switch ($this->packet_type) {
@@ -2921,10 +2947,10 @@ class SFTP extends SSH2
* @return bool
* @access private
*/
- function _send_sftp_packet($type, $data)
+ function _send_sftp_packet($type, $data, $request_id = 1)
{
- $packet = $this->request_id !== false ?
- pack('NCNa*', strlen($data) + 5, $type, $this->request_id, $data) :
+ $packet = $this->use_request_id ?
+ pack('NCNa*', strlen($data) + 5, $type, $request_id, $data) :
pack('NCa*', strlen($data) + 1, $type, $data);
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
@@ -2962,9 +2988,18 @@ class SFTP extends SSH2
* @return string
* @access private
*/
- function _get_sftp_packet()
+ function _get_sftp_packet($request_id = null)
{
- $this->curTimeout = false;
+ if (isset($request_id) && isset($this->requestBuffer[$request_id])) {
+ $this->packet_type = $this->requestBuffer[$request_id]['packet_type'];
+ $temp = $this->requestBuffer[$request_id]['packet'];
+ unset($this->requestBuffer[$request_id]);
+ return $temp;
+ }
+
+ // in SSH2.php the timeout is cumulative per function call. eg. exec() will
+ // timeout after 10s. but for SFTP.php it's cumulative per packet
+ $this->curTimeout = $this->timeout;
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
@@ -2985,6 +3020,13 @@ class SFTP extends SSH2
$tempLength = $length;
$tempLength-= strlen($this->packet_buffer);
+
+ // 256 * 1024 is what SFTP_MAX_MSG_LENGTH is set to in OpenSSH's sftp-common.h
+ if ($tempLength > 256 * 1024) {
+ user_error('Invalid SFTP packet size');
+ return false;
+ }
+
// SFTP packet type and data payload
while ($tempLength > 0) {
$temp = $this->_get_channel_packet(self::CHANNEL, true);
@@ -3001,8 +3043,8 @@ class SFTP extends SSH2
$this->packet_type = ord($this->_string_shift($this->packet_buffer));
- if ($this->request_id !== false) {
- $this->_string_shift($this->packet_buffer, 4); // remove the request id
+ if ($this->use_request_id) {
+ extract(unpack('Npacket_id', $this->_string_shift($this->packet_buffer, 4))); // remove the request id
$length-= 5; // account for the request id and the packet type
} else {
$length-= 1; // account for the packet type
@@ -3025,6 +3067,14 @@ class SFTP extends SSH2
}
}
+ if (isset($request_id) && $this->use_request_id && $packet_id != $request_id) {
+ $this->requestBuffer[$packet_id] = array(
+ 'packet_type' => $this->packet_type,
+ 'packet' => $packet
+ );
+ return $this->_get_sftp_packet($request_id);
+ }
+
return $packet;
}
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
index cdb7cb39e..817fa165e 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php
@@ -104,6 +104,7 @@ class SSH2
const CHANNEL_SHELL = 2;
const CHANNEL_SUBSYSTEM = 3;
const CHANNEL_AGENT_FORWARD = 4;
+ const CHANNEL_KEEP_ALIVE = 5;
/**#@-*/
/**#@+
@@ -145,7 +146,10 @@ class SSH2
*/
const READ_REGEX = 2;
/**
- * Returns when a string matching the regular expression $expect is found
+ * Returns whenever a data packet is received.
+ *
+ * Some data packets may only contain a single character so it may be necessary
+ * to call read() multiple times when using this option
*/
const READ_NEXT = 3;
/**#@-*/
@@ -918,6 +922,22 @@ class SSH2
*/
var $binary_packet_buffer = false;
+ /**
+ * Preferred Signature Format
+ *
+ * @var string|false
+ * @access private
+ */
+ var $preferred_signature_format = false;
+
+ /**
+ * Authentication Credentials
+ *
+ * @var array
+ * @access private
+ */
+ var $auth = array();
+
/**
* Default Constructor.
*
@@ -1124,11 +1144,12 @@ class SSH2
}
$elapsed = microtime(true) - $start;
- $this->curTimeout-= $elapsed;
-
- if ($this->curTimeout <= 0) {
- $this->is_timeout = true;
- return false;
+ if ($this->curTimeout) {
+ $this->curTimeout-= $elapsed;
+ if ($this->curTimeout < 0) {
+ $this->is_timeout = true;
+ return false;
+ }
}
}
@@ -1193,6 +1214,7 @@ class SSH2
}
if (feof($this->fsock)) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -1206,7 +1228,7 @@ class SSH2
$this->server_identifier = trim($temp, "\r\n");
if (strlen($extra)) {
- $this->errors[] = utf8_decode($data);
+ $this->errors[] = $data;
}
if (version_compare($matches[3], '1.99', '<')) {
@@ -1221,6 +1243,7 @@ class SSH2
if (!$this->send_kex_first) {
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -1309,6 +1332,8 @@ class SSH2
}
$server_host_key_algorithms = array(
+ 'rsa-sha2-256', // RFC 8332
+ 'rsa-sha2-512', // RFC 8332
'ssh-rsa', // RECOMMENDED sign Raw RSA Key
'ssh-dss' // REQUIRED sign Raw DSS Key
);
@@ -1459,6 +1484,7 @@ class SSH2
$kexinit_payload_server = $this->_get_binary_packet();
if ($kexinit_payload_server === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -1595,6 +1621,7 @@ class SSH2
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -1687,12 +1714,14 @@ class SSH2
$data = pack('CNa*', $clientKexInitMessage, strlen($eBytes), $eBytes);
if (!$this->_send_binary_packet($data)) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -1782,9 +1811,25 @@ class SSH2
return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
}
- if ($public_key_format != $server_host_key_algorithm || $this->signature_format != $server_host_key_algorithm) {
- user_error('Server Host Key Algorithm Mismatch');
- return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
+ switch ($server_host_key_algorithm) {
+ case 'ssh-dss':
+ $expected_key_format = 'ssh-dss';
+ break;
+ //case 'rsa-sha2-256':
+ //case 'rsa-sha2-512':
+ //case 'ssh-rsa':
+ default:
+ $expected_key_format = 'ssh-rsa';
+ }
+
+ if ($public_key_format != $expected_key_format || $this->signature_format != $server_host_key_algorithm) {
+ switch (true) {
+ case $this->signature_format == $server_host_key_algorithm:
+ case $server_host_key_algorithm != 'rsa-sha2-256' && $server_host_key_algorithm != 'rsa-sha2-512':
+ case $this->signature_format != 'ssh-rsa':
+ user_error('Server Host Key Algorithm Mismatch');
+ return $this->_disconnect(NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED);
+ }
}
$packet = pack(
@@ -1799,6 +1844,7 @@ class SSH2
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -1820,7 +1866,7 @@ class SSH2
$this->encrypt = $this->_encryption_algorithm_to_crypt_instance($encrypt);
if ($this->encrypt) {
if ($this->crypto_engine) {
- $this->encrypt->setEngine($this->crypto_engine);
+ $this->encrypt->setPreferredEngine($this->crypto_engine);
}
if ($this->encrypt->block_size) {
$this->encrypt_block_size = $this->encrypt->block_size;
@@ -1844,7 +1890,7 @@ class SSH2
$this->decrypt = $this->_encryption_algorithm_to_crypt_instance($decrypt);
if ($this->decrypt) {
if ($this->crypto_engine) {
- $this->decrypt->setEngine($this->crypto_engine);
+ $this->decrypt->setPreferredEngine($this->crypto_engine);
}
if ($this->decrypt->block_size) {
$this->decrypt_block_size = $this->decrypt->block_size;
@@ -2095,6 +2141,7 @@ class SSH2
function login($username)
{
$args = func_get_args();
+ $this->auth[] = $args;
return call_user_func_array(array(&$this, '_login'), $args);
}
@@ -2166,6 +2213,7 @@ class SSH2
}
return $this->_login_helper($username, $password);
}
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -2218,6 +2266,7 @@ class SSH2
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -2276,6 +2325,7 @@ class SSH2
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -2294,7 +2344,7 @@ class SSH2
return false;
}
extract(unpack('Nlength', $this->_string_shift($response, 4)));
- $this->errors[] = 'SSH_MSG_USERAUTH_PASSWD_CHANGEREQ: ' . utf8_decode($this->_string_shift($response, $length));
+ $this->errors[] = 'SSH_MSG_USERAUTH_PASSWD_CHANGEREQ: ' . $this->_string_shift($response, $length);
return $this->_disconnect(NET_SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER);
case NET_SSH2_MSG_USERAUTH_FAILURE:
// can we use keyboard-interactive authentication? if not then either the login is bad or the server employees
@@ -2376,6 +2426,7 @@ class SSH2
} else {
$orig = $response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -2545,6 +2596,21 @@ class SSH2
$publickey['n']
);
+ switch ($this->signature_format) {
+ case 'rsa-sha2-512':
+ $hash = 'sha512';
+ $signatureType = 'rsa-sha2-512';
+ break;
+ case 'rsa-sha2-256':
+ $hash = 'sha256';
+ $signatureType = 'rsa-sha2-256';
+ break;
+ //case 'ssh-rsa':
+ default:
+ $hash = 'sha1';
+ $signatureType = 'ssh-rsa';
+ }
+
$part1 = pack(
'CNa*Na*Na*',
NET_SSH2_MSG_USERAUTH_REQUEST,
@@ -2555,7 +2621,7 @@ class SSH2
strlen('publickey'),
'publickey'
);
- $part2 = pack('Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publickey), $publickey);
+ $part2 = pack('Na*Na*', strlen($signatureType), $signatureType, strlen($publickey), $publickey);
$packet = $part1 . chr(0) . $part2;
if (!$this->_send_binary_packet($packet)) {
@@ -2564,6 +2630,7 @@ class SSH2
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -2595,8 +2662,9 @@ class SSH2
$packet = $part1 . chr(1) . $part2;
$privatekey->setSignatureMode(RSA::SIGNATURE_PKCS1);
+ $privatekey->setHash($hash);
$signature = $privatekey->sign(pack('Na*a*', strlen($this->session_id), $this->session_id, $packet));
- $signature = pack('Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($signature), $signature);
+ $signature = pack('Na*Na*', strlen($signatureType), $signatureType, strlen($signature), $signature);
$packet.= pack('Na*', strlen($signature), $signature);
if (!$this->_send_binary_packet($packet)) {
@@ -2605,6 +2673,7 @@ class SSH2
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -2731,6 +2800,7 @@ class SSH2
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -2870,6 +2940,7 @@ class SSH2
$response = $this->_get_binary_packet();
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -3184,6 +3255,66 @@ class SSH2
return (bool) ($this->bitmap & self::MASK_LOGIN);
}
+ /**
+ * Pings a server connection, or tries to reconnect if the connection has gone down
+ *
+ * Inspired by http://php.net/manual/en/mysqli.ping.php
+ *
+ * @return bool
+ * @access public
+ */
+ function ping()
+ {
+ if (!$this->isAuthenticated()) {
+ return false;
+ }
+
+ $this->window_size_server_to_client[self::CHANNEL_KEEP_ALIVE] = $this->window_size;
+ $packet_size = 0x4000;
+ $packet = pack(
+ 'CNa*N3',
+ NET_SSH2_MSG_CHANNEL_OPEN,
+ strlen('session'),
+ 'session',
+ self::CHANNEL_KEEP_ALIVE,
+ $this->window_size_server_to_client[self::CHANNEL_KEEP_ALIVE],
+ $packet_size
+ );
+
+ if (!@$this->_send_binary_packet($packet)) {
+ return $this->_reconnect();
+ }
+
+ $this->channel_status[self::CHANNEL_KEEP_ALIVE] = NET_SSH2_MSG_CHANNEL_OPEN;
+
+ $response = @$this->_get_channel_packet(self::CHANNEL_KEEP_ALIVE);
+ if ($response !== false) {
+ $this->_close_channel(self::CHANNEL_KEEP_ALIVE);
+ return true;
+ }
+
+ return $this->_reconnect();
+ }
+
+ /**
+ * In situ reconnect method
+ *
+ * @return boolean
+ * @access private
+ */
+ function _reconnect()
+ {
+ $this->_reset_connection(NET_SSH2_DISCONNECT_CONNECTION_LOST);
+ $this->retry_connect = true;
+ if (!$this->_connect()) {
+ return false;
+ }
+ foreach ($this->auth as $auth) {
+ $result = call_user_func_array(array(&$this, 'login'), $auth);
+ }
+ return $result;
+ }
+
/**
* Resets a connection for re-use
*
@@ -3214,8 +3345,8 @@ class SSH2
function _get_binary_packet($skip_channel_filter = false)
{
if (!is_resource($this->fsock) || feof($this->fsock)) {
- user_error('Connection closed prematurely');
$this->bitmap = 0;
+ user_error('Connection closed prematurely');
return false;
}
@@ -3258,8 +3389,8 @@ class SSH2
while ($remaining_length > 0) {
$temp = stream_get_contents($this->fsock, $remaining_length);
if ($temp === false || feof($this->fsock)) {
- user_error('Error reading from socket');
$this->bitmap = 0;
+ user_error('Error reading from socket');
return false;
}
$buffer.= $temp;
@@ -3277,8 +3408,8 @@ class SSH2
if ($this->hmac_check !== false) {
$hmac = stream_get_contents($this->fsock, $this->hmac_size);
if ($hmac === false || strlen($hmac) != $this->hmac_size) {
- user_error('Error reading socket');
$this->bitmap = 0;
+ user_error('Error reading socket');
return false;
} elseif ($hmac != $this->hmac_check->hash(pack('NNCa*', $this->get_seq_no, $packet_length, $padding_length, $payload . $padding))) {
user_error('Invalid HMAC');
@@ -3322,7 +3453,7 @@ class SSH2
return false;
}
extract(unpack('Nreason_code/Nlength', $this->_string_shift($payload, 8)));
- $this->errors[] = 'SSH_MSG_DISCONNECT: ' . $this->disconnect_reasons[$reason_code] . "\r\n" . utf8_decode($this->_string_shift($payload, $length));
+ $this->errors[] = 'SSH_MSG_DISCONNECT: ' . $this->disconnect_reasons[$reason_code] . "\r\n" . $this->_string_shift($payload, $length);
$this->bitmap = 0;
return false;
case NET_SSH2_MSG_IGNORE:
@@ -3334,7 +3465,7 @@ class SSH2
return false;
}
extract(unpack('Nlength', $this->_string_shift($payload, 4)));
- $this->errors[] = 'SSH_MSG_DEBUG: ' . utf8_decode($this->_string_shift($payload, $length));
+ $this->errors[] = 'SSH_MSG_DEBUG: ' . $this->_string_shift($payload, $length);
$payload = $this->_get_binary_packet($skip_channel_filter);
break;
case NET_SSH2_MSG_UNIMPLEMENTED:
@@ -3357,7 +3488,7 @@ class SSH2
return false;
}
extract(unpack('Nlength', $this->_string_shift($payload, 4)));
- $this->banner_message = utf8_decode($this->_string_shift($payload, $length));
+ $this->banner_message = $this->_string_shift($payload, $length);
$payload = $this->_get_binary_packet();
}
@@ -3561,7 +3692,12 @@ class SSH2
$response = $this->binary_packet_buffer;
$this->binary_packet_buffer = false;
} else {
- if ($this->curTimeout) {
+ $read = array($this->fsock);
+ $write = $except = null;
+
+ if (!$this->curTimeout) {
+ @stream_select($read, $write, $except, null);
+ } else {
if ($this->curTimeout < 0) {
$this->is_timeout = true;
return true;
@@ -3576,6 +3712,9 @@ class SSH2
// on windows this returns a "Warning: Invalid CRT parameters detected" error
if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) {
$this->is_timeout = true;
+ if ($client_channel == self::CHANNEL_EXEC && !$this->request_pty) {
+ $this->_close_channel($client_channel);
+ }
return true;
}
$elapsed = microtime(true) - $start;
@@ -3584,6 +3723,7 @@ class SSH2
$response = $this->_get_binary_packet(true);
if ($response === false) {
+ $this->bitmap = 0;
user_error('Connection closed by server');
return false;
}
@@ -3592,10 +3732,6 @@ class SSH2
if ($client_channel == -1 && $response === true) {
return true;
}
- if (!strlen($response)) {
- return '';
- }
-
if (!strlen($response)) {
return false;
}
@@ -3626,7 +3762,7 @@ class SSH2
switch ($type) {
case NET_SSH2_MSG_CHANNEL_EXTENDED_DATA:
/*
- if ($client_channel == NET_SSH2_CHANNEL_EXEC) {
+ if ($client_channel == self::CHANNEL_EXEC) {
$this->_send_channel_packet($client_channel, chr(0));
}
*/
@@ -3818,8 +3954,8 @@ class SSH2
function _send_binary_packet($data, $logged = null)
{
if (!is_resource($this->fsock) || feof($this->fsock)) {
- user_error('Connection closed prematurely');
$this->bitmap = 0;
+ user_error('Connection closed prematurely');
return false;
}
@@ -4480,6 +4616,8 @@ class SSH2
break;
case 'ssh-rsa':
+ case 'rsa-sha2-256':
+ case 'rsa-sha2-512':
if (strlen($server_public_host_key) < 4) {
return false;
}
@@ -4502,8 +4640,21 @@ class SSH2
$signature = $this->_string_shift($signature, $temp['length']);
$rsa = new RSA();
+ switch ($this->signature_format) {
+ case 'rsa-sha2-512':
+ $hash = 'sha512';
+ break;
+ case 'rsa-sha2-256':
+ $hash = 'sha256';
+ break;
+ //case 'ssh-rsa':
+ default:
+ $hash = 'sha1';
+ }
+ $rsa->setHash($hash);
$rsa->setSignatureMode(RSA::SIGNATURE_PKCS1);
$rsa->loadKey(array('e' => $e, 'n' => $n), RSA::PUBLIC_FORMAT_RAW);
+
if (!$rsa->verify($this->exchange_hash, $signature)) {
user_error('Bad server signature');
return $this->_disconnect(NET_SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE);
@@ -4530,7 +4681,30 @@ class SSH2
$s = $s->modPow($e, $n);
$s = $s->toBytes();
- $h = pack('N4H*', 0x00302130, 0x0906052B, 0x0E03021A, 0x05000414, sha1($this->exchange_hash));
+ switch ($this->signature_format) {
+ case 'rsa-sha2-512':
+ $hash = 'sha512';
+ break;
+ case 'rsa-sha2-256':
+ $hash = 'sha256';
+ break;
+ //case 'ssh-rsa':
+ default:
+ $hash = 'sha1';
+ }
+ $hashObj = new Hash($hash);
+ switch ($this->signature_format) {
+ case 'rsa-sha2-512':
+ $h = pack('N5a*', 0x00305130, 0x0D060960, 0x86480165, 0x03040203, 0x05000440, $hashObj->hash($this->exchange_hash));
+ break;
+ case 'rsa-sha2-256':
+ $h = pack('N5a*', 0x00303130, 0x0D060960, 0x86480165, 0x03040201, 0x05000420, $hashObj->hash($this->exchange_hash));
+ break;
+ //case 'ssh-rsa':
+ default:
+ $hash = 'sha1';
+ $h = pack('N4a*', 0x00302130, 0x0906052B, 0x0E03021A, 0x05000414, $hashObj->hash($this->exchange_hash));
+ }
$h = chr(0x01) . str_repeat(chr(0xFF), $nLength - 2 - strlen($h)) . $h;
if ($s != $h) {
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
index a4ff0549d..99dcecfe6 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent.php
@@ -43,7 +43,7 @@ use phpseclib\System\SSH\Agent\Identity;
*
* @package SSH\Agent
* @author Jim Wigginton
- * @access internal
+ * @access public
*/
class Agent
{
@@ -117,18 +117,20 @@ class Agent
* @return \phpseclib\System\SSH\Agent
* @access public
*/
- function __construct()
+ function __construct($address = null)
{
- switch (true) {
- case isset($_SERVER['SSH_AUTH_SOCK']):
- $address = $_SERVER['SSH_AUTH_SOCK'];
- break;
- case isset($_ENV['SSH_AUTH_SOCK']):
- $address = $_ENV['SSH_AUTH_SOCK'];
- break;
- default:
- user_error('SSH_AUTH_SOCK not found');
- return false;
+ if (!$address) {
+ switch (true) {
+ case isset($_SERVER['SSH_AUTH_SOCK']):
+ $address = $_SERVER['SSH_AUTH_SOCK'];
+ break;
+ case isset($_ENV['SSH_AUTH_SOCK']):
+ $address = $_ENV['SSH_AUTH_SOCK'];
+ break;
+ default:
+ user_error('SSH_AUTH_SOCK not found');
+ return false;
+ }
}
$this->fsock = fsockopen('unix://' . $address, 0, $errno, $errstr);
@@ -155,12 +157,14 @@ class Agent
$packet = pack('NC', 1, self::SSH_AGENTC_REQUEST_IDENTITIES);
if (strlen($packet) != fputs($this->fsock, $packet)) {
user_error('Connection closed while requesting identities');
+ return array();
}
$length = current(unpack('N', fread($this->fsock, 4)));
$type = ord(fread($this->fsock, 1));
if ($type != self::SSH_AGENT_IDENTITIES_ANSWER) {
user_error('Unable to request identities');
+ return array();
}
$identities = array();
diff --git a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
index b8cc6cded..b4649046a 100644
--- a/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
+++ b/libraries/vdm_io/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/Identity.php
@@ -32,6 +32,17 @@ use phpseclib\System\SSH\Agent;
*/
class Identity
{
+ /**@+
+ * Signature Flags
+ *
+ * See https://tools.ietf.org/html/draft-miller-ssh-agent-00#section-5.3
+ *
+ * @access private
+ */
+ const SSH_AGENT_RSA2_256 = 2;
+ const SSH_AGENT_RSA2_512 = 4;
+ /**#@-*/
+
/**
* Key Object
*
@@ -59,6 +70,16 @@ class Identity
*/
var $fsock;
+ /**
+ * Signature flags
+ *
+ * @var int
+ * @access private
+ * @see self::sign()
+ * @see self::setHash()
+ */
+ var $flags = 0;
+
/**
* Default Constructor.
*
@@ -126,6 +147,31 @@ class Identity
{
}
+ /**
+ * Set Hash
+ *
+ * ssh-agent doesn't support using hashes for RSA other than SHA1
+ *
+ * @param string $hash
+ * @access public
+ */
+ function setHash($hash)
+ {
+ $this->flags = 0;
+ switch ($hash) {
+ case 'sha1':
+ break;
+ case 'sha256':
+ $this->flags = self::SSH_AGENT_RSA2_256;
+ break;
+ case 'sha512':
+ $this->flags = self::SSH_AGENT_RSA2_512;
+ break;
+ default:
+ user_error('The only supported hashes for RSA are sha1, sha256 and sha512');
+ }
+ }
+
/**
* Create a signature
*
@@ -138,7 +184,7 @@ class Identity
function sign($message)
{
// the last parameter (currently 0) is for flags and ssh-agent only defines one flag (for ssh-dss): SSH_AGENT_OLD_SIGNATURE
- $packet = pack('CNa*Na*N', Agent::SSH_AGENTC_SIGN_REQUEST, strlen($this->key_blob), $this->key_blob, strlen($message), $message, 0);
+ $packet = pack('CNa*Na*N', Agent::SSH_AGENTC_SIGN_REQUEST, strlen($this->key_blob), $this->key_blob, strlen($message), $message, $this->flags);
$packet = pack('Na*', strlen($packet), $packet);
if (strlen($packet) != fputs($this->fsock, $packet)) {
user_error('Connection closed during signing');
@@ -151,8 +197,34 @@ class Identity
}
$signature_blob = fread($this->fsock, $length - 1);
- // the only other signature format defined - ssh-dss - is the same length as ssh-rsa
- // the + 12 is for the other various SSH added length fields
- return substr($signature_blob, strlen('ssh-rsa') + 12);
+ $length = current(unpack('N', $this->_string_shift($signature_blob, 4)));
+ if ($length != strlen($signature_blob)) {
+ user_error('Malformed signature blob');
+ }
+ $length = current(unpack('N', $this->_string_shift($signature_blob, 4)));
+ if ($length > strlen($signature_blob) + 4) {
+ user_error('Malformed signature blob');
+ }
+ $type = $this->_string_shift($signature_blob, $length);
+ $this->_string_shift($signature_blob, 4);
+
+ return $signature_blob;
+ }
+
+ /**
+ * String Shift
+ *
+ * Inspired by array_shift
+ *
+ * @param string $string
+ * @param int $index
+ * @return string
+ * @access private
+ */
+ function _string_shift(&$string, $index = 1)
+ {
+ $substr = substr($string, 0, $index);
+ $string = substr($string, $index);
+ return $substr;
}
}
diff --git a/script.php b/script.php
index ddd8f71d3..7ad39a522 100644
--- a/script.php
+++ b/script.php
@@ -20,21 +20,27 @@ JHTML::_('behavior.modal');
class com_componentbuilderInstallerScript
{
/**
- * method to install the component
+ * Constructor
*
- * @return void
+ * @param JAdapterInstance $parent The object responsible for running this script
*/
- function install($parent)
- {
-
- }
+ public function __construct(JAdapterInstance $parent) {}
/**
- * method to uninstall the component
+ * Called on installation
*
- * @return void
+ * @param JAdapterInstance $parent The object responsible for running this script
+ *
+ * @return boolean True on success
*/
- function uninstall($parent)
+ public function install(JAdapterInstance $parent) {}
+
+ /**
+ * Called on uninstallation
+ *
+ * @param JAdapterInstance $parent The object responsible for running this script
+ */
+ public function uninstall(JAdapterInstance $parent)
{
// Get Application object
$app = JFactory::getApplication();
@@ -128,6 +134,92 @@ class com_componentbuilderInstallerScript
}
}
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Joomla_plugin alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $joomla_plugin_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($joomla_plugin_found)
+ {
+ // Since there are load the needed joomla_plugin type ids
+ $joomla_plugin_ids = $db->loadColumn();
+ // Remove Joomla_plugin from the content type table
+ $joomla_plugin_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($joomla_plugin_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin items
+ $joomla_plugin_done = $db->execute();
+ if ($joomla_plugin_done)
+ {
+ // If succesfully remove Joomla_plugin add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Joomla_plugin items from the contentitem tag map table
+ $joomla_plugin_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($joomla_plugin_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin items
+ $joomla_plugin_done = $db->execute();
+ if ($joomla_plugin_done)
+ {
+ // If succesfully remove Joomla_plugin add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Joomla_plugin items from the ucm content table
+ $joomla_plugin_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.joomla_plugin') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($joomla_plugin_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin items
+ $joomla_plugin_done = $db->execute();
+ if ($joomla_plugin_done)
+ {
+ // If succesfully remove Joomla_plugin add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Joomla_plugin items are cleared from DB
+ foreach ($joomla_plugin_ids as $joomla_plugin_id)
+ {
+ // Remove Joomla_plugin items from the ucm base table
+ $joomla_plugin_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $joomla_plugin_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($joomla_plugin_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin items
+ $db->execute();
+
+ // Remove Joomla_plugin items from the ucm history table
+ $joomla_plugin_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $joomla_plugin_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($joomla_plugin_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin items
+ $db->execute();
+ }
+ }
+
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
@@ -730,6 +822,178 @@ class com_componentbuilderInstallerScript
}
}
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Class_property alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_property') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $class_property_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($class_property_found)
+ {
+ // Since there are load the needed class_property type ids
+ $class_property_ids = $db->loadColumn();
+ // Remove Class_property from the content type table
+ $class_property_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_property') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($class_property_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_property items
+ $class_property_done = $db->execute();
+ if ($class_property_done)
+ {
+ // If succesfully remove Class_property add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Class_property items from the contentitem tag map table
+ $class_property_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_property') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($class_property_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_property items
+ $class_property_done = $db->execute();
+ if ($class_property_done)
+ {
+ // If succesfully remove Class_property add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Class_property items from the ucm content table
+ $class_property_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.class_property') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($class_property_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_property items
+ $class_property_done = $db->execute();
+ if ($class_property_done)
+ {
+ // If succesfully remove Class_property add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Class_property items are cleared from DB
+ foreach ($class_property_ids as $class_property_id)
+ {
+ // Remove Class_property items from the ucm base table
+ $class_property_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $class_property_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($class_property_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_property items
+ $db->execute();
+
+ // Remove Class_property items from the ucm history table
+ $class_property_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $class_property_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($class_property_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_property items
+ $db->execute();
+ }
+ }
+
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Class_method alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_method') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $class_method_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($class_method_found)
+ {
+ // Since there are load the needed class_method type ids
+ $class_method_ids = $db->loadColumn();
+ // Remove Class_method from the content type table
+ $class_method_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_method') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($class_method_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_method items
+ $class_method_done = $db->execute();
+ if ($class_method_done)
+ {
+ // If succesfully remove Class_method add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Class_method items from the contentitem tag map table
+ $class_method_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_method') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($class_method_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_method items
+ $class_method_done = $db->execute();
+ if ($class_method_done)
+ {
+ // If succesfully remove Class_method add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Class_method items from the ucm content table
+ $class_method_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.class_method') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($class_method_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_method items
+ $class_method_done = $db->execute();
+ if ($class_method_done)
+ {
+ // If succesfully remove Class_method add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Class_method items are cleared from DB
+ foreach ($class_method_ids as $class_method_id)
+ {
+ // Remove Class_method items from the ucm base table
+ $class_method_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $class_method_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($class_method_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_method items
+ $db->execute();
+
+ // Remove Class_method items from the ucm history table
+ $class_method_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $class_method_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($class_method_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_method items
+ $db->execute();
+ }
+ }
+
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
@@ -2966,6 +3230,92 @@ class com_componentbuilderInstallerScript
}
}
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Component_plugins alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_plugins') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $component_plugins_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($component_plugins_found)
+ {
+ // Since there are load the needed component_plugins type ids
+ $component_plugins_ids = $db->loadColumn();
+ // Remove Component_plugins from the content type table
+ $component_plugins_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_plugins') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($component_plugins_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Component_plugins items
+ $component_plugins_done = $db->execute();
+ if ($component_plugins_done)
+ {
+ // If succesfully remove Component_plugins add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Component_plugins items from the contentitem tag map table
+ $component_plugins_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_plugins') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($component_plugins_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Component_plugins items
+ $component_plugins_done = $db->execute();
+ if ($component_plugins_done)
+ {
+ // If succesfully remove Component_plugins add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Component_plugins items from the ucm content table
+ $component_plugins_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.component_plugins') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($component_plugins_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Component_plugins items
+ $component_plugins_done = $db->execute();
+ if ($component_plugins_done)
+ {
+ // If succesfully remove Component_plugins add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Component_plugins items are cleared from DB
+ foreach ($component_plugins_ids as $component_plugins_id)
+ {
+ // Remove Component_plugins items from the ucm base table
+ $component_plugins_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $component_plugins_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($component_plugins_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Component_plugins items
+ $db->execute();
+
+ // Remove Component_plugins items from the ucm history table
+ $component_plugins_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $component_plugins_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($component_plugins_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Component_plugins items
+ $db->execute();
+ }
+ }
+
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
@@ -3224,6 +3574,350 @@ class com_componentbuilderInstallerScript
}
}
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Class_extends alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_extends') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $class_extends_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($class_extends_found)
+ {
+ // Since there are load the needed class_extends type ids
+ $class_extends_ids = $db->loadColumn();
+ // Remove Class_extends from the content type table
+ $class_extends_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_extends') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($class_extends_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_extends items
+ $class_extends_done = $db->execute();
+ if ($class_extends_done)
+ {
+ // If succesfully remove Class_extends add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Class_extends items from the contentitem tag map table
+ $class_extends_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_extends') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($class_extends_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_extends items
+ $class_extends_done = $db->execute();
+ if ($class_extends_done)
+ {
+ // If succesfully remove Class_extends add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Class_extends items from the ucm content table
+ $class_extends_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.class_extends') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($class_extends_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_extends items
+ $class_extends_done = $db->execute();
+ if ($class_extends_done)
+ {
+ // If succesfully remove Class_extends add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Class_extends items are cleared from DB
+ foreach ($class_extends_ids as $class_extends_id)
+ {
+ // Remove Class_extends items from the ucm base table
+ $class_extends_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $class_extends_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($class_extends_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_extends items
+ $db->execute();
+
+ // Remove Class_extends items from the ucm history table
+ $class_extends_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $class_extends_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($class_extends_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Class_extends items
+ $db->execute();
+ }
+ }
+
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Joomla_plugin_group alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_group') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $joomla_plugin_group_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($joomla_plugin_group_found)
+ {
+ // Since there are load the needed joomla_plugin_group type ids
+ $joomla_plugin_group_ids = $db->loadColumn();
+ // Remove Joomla_plugin_group from the content type table
+ $joomla_plugin_group_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_group') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($joomla_plugin_group_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_group items
+ $joomla_plugin_group_done = $db->execute();
+ if ($joomla_plugin_group_done)
+ {
+ // If succesfully remove Joomla_plugin_group add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Joomla_plugin_group items from the contentitem tag map table
+ $joomla_plugin_group_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_group') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($joomla_plugin_group_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_group items
+ $joomla_plugin_group_done = $db->execute();
+ if ($joomla_plugin_group_done)
+ {
+ // If succesfully remove Joomla_plugin_group add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Joomla_plugin_group items from the ucm content table
+ $joomla_plugin_group_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.joomla_plugin_group') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($joomla_plugin_group_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_group items
+ $joomla_plugin_group_done = $db->execute();
+ if ($joomla_plugin_group_done)
+ {
+ // If succesfully remove Joomla_plugin_group add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Joomla_plugin_group items are cleared from DB
+ foreach ($joomla_plugin_group_ids as $joomla_plugin_group_id)
+ {
+ // Remove Joomla_plugin_group items from the ucm base table
+ $joomla_plugin_group_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $joomla_plugin_group_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($joomla_plugin_group_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_group items
+ $db->execute();
+
+ // Remove Joomla_plugin_group items from the ucm history table
+ $joomla_plugin_group_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $joomla_plugin_group_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($joomla_plugin_group_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_group items
+ $db->execute();
+ }
+ }
+
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Joomla_plugin_updates alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_updates') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $joomla_plugin_updates_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($joomla_plugin_updates_found)
+ {
+ // Since there are load the needed joomla_plugin_updates type ids
+ $joomla_plugin_updates_ids = $db->loadColumn();
+ // Remove Joomla_plugin_updates from the content type table
+ $joomla_plugin_updates_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_updates') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($joomla_plugin_updates_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_updates items
+ $joomla_plugin_updates_done = $db->execute();
+ if ($joomla_plugin_updates_done)
+ {
+ // If succesfully remove Joomla_plugin_updates add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Joomla_plugin_updates items from the contentitem tag map table
+ $joomla_plugin_updates_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_updates') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($joomla_plugin_updates_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_updates items
+ $joomla_plugin_updates_done = $db->execute();
+ if ($joomla_plugin_updates_done)
+ {
+ // If succesfully remove Joomla_plugin_updates add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Joomla_plugin_updates items from the ucm content table
+ $joomla_plugin_updates_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.joomla_plugin_updates') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($joomla_plugin_updates_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_updates items
+ $joomla_plugin_updates_done = $db->execute();
+ if ($joomla_plugin_updates_done)
+ {
+ // If succesfully remove Joomla_plugin_updates add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Joomla_plugin_updates items are cleared from DB
+ foreach ($joomla_plugin_updates_ids as $joomla_plugin_updates_id)
+ {
+ // Remove Joomla_plugin_updates items from the ucm base table
+ $joomla_plugin_updates_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $joomla_plugin_updates_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($joomla_plugin_updates_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_updates items
+ $db->execute();
+
+ // Remove Joomla_plugin_updates items from the ucm history table
+ $joomla_plugin_updates_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $joomla_plugin_updates_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($joomla_plugin_updates_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_updates items
+ $db->execute();
+ }
+ }
+
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Joomla_plugin_files_folders_urls alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_files_folders_urls') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $joomla_plugin_files_folders_urls_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($joomla_plugin_files_folders_urls_found)
+ {
+ // Since there are load the needed joomla_plugin_files_folders_urls type ids
+ $joomla_plugin_files_folders_urls_ids = $db->loadColumn();
+ // Remove Joomla_plugin_files_folders_urls from the content type table
+ $joomla_plugin_files_folders_urls_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_files_folders_urls') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($joomla_plugin_files_folders_urls_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_files_folders_urls items
+ $joomla_plugin_files_folders_urls_done = $db->execute();
+ if ($joomla_plugin_files_folders_urls_done)
+ {
+ // If succesfully remove Joomla_plugin_files_folders_urls add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Joomla_plugin_files_folders_urls items from the contentitem tag map table
+ $joomla_plugin_files_folders_urls_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_files_folders_urls') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($joomla_plugin_files_folders_urls_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_files_folders_urls items
+ $joomla_plugin_files_folders_urls_done = $db->execute();
+ if ($joomla_plugin_files_folders_urls_done)
+ {
+ // If succesfully remove Joomla_plugin_files_folders_urls add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Joomla_plugin_files_folders_urls items from the ucm content table
+ $joomla_plugin_files_folders_urls_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.joomla_plugin_files_folders_urls') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($joomla_plugin_files_folders_urls_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_files_folders_urls items
+ $joomla_plugin_files_folders_urls_done = $db->execute();
+ if ($joomla_plugin_files_folders_urls_done)
+ {
+ // If succesfully remove Joomla_plugin_files_folders_urls add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Joomla_plugin_files_folders_urls items are cleared from DB
+ foreach ($joomla_plugin_files_folders_urls_ids as $joomla_plugin_files_folders_urls_id)
+ {
+ // Remove Joomla_plugin_files_folders_urls items from the ucm base table
+ $joomla_plugin_files_folders_urls_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $joomla_plugin_files_folders_urls_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($joomla_plugin_files_folders_urls_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_files_folders_urls items
+ $db->execute();
+
+ // Remove Joomla_plugin_files_folders_urls items from the ucm history table
+ $joomla_plugin_files_folders_urls_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $joomla_plugin_files_folders_urls_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($joomla_plugin_files_folders_urls_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Joomla_plugin_files_folders_urls items
+ $db->execute();
+ }
+ }
+
// If All related items was removed queued success message.
$app->enqueueMessage(JText::_('All related items was removed from the #__ucm_base table'));
$app->enqueueMessage(JText::_('All related items was removed from the #__ucm_history table'));
@@ -3236,8 +3930,8 @@ class com_componentbuilderInstallerScript
$query->delete($db->quoteName('#__assets'));
$query->where($componentbuilder_condition);
$db->setQuery($query);
- $library_files_folders_urls_done = $db->execute();
- if ($library_files_folders_urls_done)
+ $joomla_plugin_files_folders_urls_done = $db->execute();
+ if ($joomla_plugin_files_folders_urls_done)
{
// If succesfully remove componentbuilder add queued success message.
$app->enqueueMessage(JText::_('All related items was removed from the #__assets table'));
@@ -3252,38 +3946,40 @@ class com_componentbuilderInstallerScript
}
/**
- * method to update the component
+ * Called on update
*
- * @return void
+ * @param JAdapterInstance $parent The object responsible for running this script
+ *
+ * @return boolean True on success
*/
- function update($parent)
- {
-
- }
+ public function update(JAdapterInstance $parent){}
/**
- * method to run before an install/update/uninstall method
+ * Called before any type of action
*
- * @return void
+ * @param string $type Which action is happening (install|uninstall|discover_install|update)
+ * @param JAdapterInstance $parent The object responsible for running this script
+ *
+ * @return boolean True on success
*/
- function preflight($type, $parent)
+ public function preflight($type, JAdapterInstance $parent)
{
// get application
$app = JFactory::getApplication();
- // is redundant ...hmmm
- if ($type == 'uninstall')
+ // is redundant or so it seems ...hmmm let me know if it works again
+ if ($type === 'uninstall')
{
return true;
}
// the default for both install and update
$jversion = new JVersion();
- if (!$jversion->isCompatible('3.6.0'))
+ if (!$jversion->isCompatible('3.8.0'))
{
- $app->enqueueMessage('Please upgrade to at least Joomla! 3.6.0 before continuing!', 'error');
+ $app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');
return false;
}
// do any updates needed
- if ($type == 'update')
+ if ($type === 'update')
{
// load the helper class
JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
@@ -3652,24 +4348,28 @@ class com_componentbuilderInstallerScript
}
}
// do any install needed
- if ($type == 'install')
+ if ($type === 'install')
{
}
+ return true;
}
/**
- * method to run after an install/update/uninstall method
+ * Called after any type of action
*
- * @return void
+ * @param string $type Which action is happening (install|uninstall|discover_install|update)
+ * @param JAdapterInstance $parent The object responsible for running this script
+ *
+ * @return boolean True on success
*/
- function postflight($type, $parent)
+ public function postflight($type, JAdapterInstance $parent)
{
// get application
$app = JFactory::getApplication();
// We check if we have dynamic folders to copy
$this->setDynamicF0ld3rs($app, $parent);
// set the default component settings
- if ($type == 'install')
+ if ($type === 'install')
{
// Get The Database object
@@ -3687,6 +4387,18 @@ class com_componentbuilderInstallerScript
// Set the object into the content types table.
$joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component);
+ // Create the joomla_plugin content type object.
+ $joomla_plugin = new stdClass();
+ $joomla_plugin->type_title = 'Componentbuilder Joomla_plugin';
+ $joomla_plugin->type_alias = 'com_componentbuilder.joomla_plugin';
+ $joomla_plugin->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin","key": "id","type": "Joomla_plugin","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $joomla_plugin->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_method_uninstall","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","class_extends":"class_extends","joomla_plugin_group":"joomla_plugin_group","sql":"sql","php_method_uninstall":"php_method_uninstall","php_postflight_update":"php_postflight_update","php_postflight_install":"php_postflight_install","description":"description","update_server_url":"update_server_url","head":"head","add_head":"add_head","sql_uninstall":"sql_uninstall","readme":"readme","main_class_code":"main_class_code","add_sales_server":"add_sales_server","not_required":"not_required","add_php_postflight_install":"add_php_postflight_install","plugin_version":"plugin_version","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","add_php_script_construct":"add_php_script_construct","add_sql":"add_sql","php_script_construct":"php_script_construct","add_sql_uninstall":"add_sql_uninstall","add_php_preflight_install":"add_php_preflight_install","addreadme":"addreadme","php_preflight_install":"php_preflight_install","add_update_server":"add_update_server","add_php_preflight_update":"add_php_preflight_update","update_server_target":"update_server_target","php_preflight_update":"php_preflight_update","add_php_preflight_uninstall":"add_php_preflight_uninstall","update_server":"update_server","php_preflight_uninstall":"php_preflight_uninstall","sales_server":"sales_server","name":"name"}}';
+ $joomla_plugin->router = 'ComponentbuilderHelperRoute::getJoomla_pluginRoute';
+ $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends","joomla_plugin_group","add_head","add_sales_server","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_php_script_construct","add_sql","add_sql_uninstall","add_php_preflight_install","addreadme","add_update_server","add_php_preflight_update","update_server_target","add_php_preflight_uninstall","update_server","sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Set the object into the content types table.
+ $joomla_plugin_Inserted = $db->insertObject('#__content_types', $joomla_plugin);
+
// Create the admin_view content type object.
$admin_view = new stdClass();
$admin_view->type_title = 'Componentbuilder Admin_view';
@@ -3771,6 +4483,30 @@ class com_componentbuilderInstallerScript
// Set the object into the content types table.
$custom_code_Inserted = $db->insertObject('#__content_types', $custom_code);
+ // Create the class_property content type object.
+ $class_property = new stdClass();
+ $class_property->type_title = 'Componentbuilder Class_property';
+ $class_property->type_alias = 'com_componentbuilder.class_property';
+ $class_property->table = '{"special": {"dbtable": "#__componentbuilder_class_property","key": "id","type": "Class_property","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $class_property->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","comment":"comment","joomla_plugin_group":"joomla_plugin_group","default":"default"}}';
+ $class_property->router = 'ComponentbuilderHelperRoute::getClass_propertyRoute';
+ $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Set the object into the content types table.
+ $class_property_Inserted = $db->insertObject('#__content_types', $class_property);
+
+ // Create the class_method content type object.
+ $class_method = new stdClass();
+ $class_method->type_title = 'Componentbuilder Class_method';
+ $class_method->type_alias = 'com_componentbuilder.class_method';
+ $class_method->table = '{"special": {"dbtable": "#__componentbuilder_class_method","key": "id","type": "Class_method","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $class_method->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","code":"code","comment":"comment","joomla_plugin_group":"joomla_plugin_group","arguments":"arguments"}}';
+ $class_method->router = 'ComponentbuilderHelperRoute::getClass_methodRoute';
+ $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Set the object into the content types table.
+ $class_method_Inserted = $db->insertObject('#__content_types', $class_method);
+
// Create the placeholder content type object.
$placeholder = new stdClass();
$placeholder->type_title = 'Componentbuilder Placeholder';
@@ -4083,6 +4819,18 @@ class com_componentbuilderInstallerScript
// Set the object into the content types table.
$component_placeholders_Inserted = $db->insertObject('#__content_types', $component_placeholders);
+ // Create the component_plugins content type object.
+ $component_plugins = new stdClass();
+ $component_plugins->type_title = 'Componentbuilder Component_plugins';
+ $component_plugins->type_alias = 'com_componentbuilder.component_plugins';
+ $component_plugins->table = '{"special": {"dbtable": "#__componentbuilder_component_plugins","key": "id","type": "Component_plugins","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $component_plugins->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}';
+ $component_plugins->router = 'ComponentbuilderHelperRoute::getComponent_pluginsRoute';
+ $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}';
+
+ // Set the object into the content types table.
+ $component_plugins_Inserted = $db->insertObject('#__content_types', $component_plugins);
+
// Create the snippet_type content type object.
$snippet_type = new stdClass();
$snippet_type->type_title = 'Componentbuilder Snippet_type';
@@ -4119,12 +4867,60 @@ class com_componentbuilderInstallerScript
// Set the object into the content types table.
$library_files_folders_urls_Inserted = $db->insertObject('#__content_types', $library_files_folders_urls);
+ // Create the class_extends content type object.
+ $class_extends = new stdClass();
+ $class_extends->type_title = 'Componentbuilder Class_extends';
+ $class_extends->type_alias = 'com_componentbuilder.class_extends';
+ $class_extends->table = '{"special": {"dbtable": "#__componentbuilder_class_extends","key": "id","type": "Class_extends","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $class_extends->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","extension_type":"extension_type","head":"head","comment":"comment"}}';
+ $class_extends->router = 'ComponentbuilderHelperRoute::getClass_extendsRoute';
+ $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Set the object into the content types table.
+ $class_extends_Inserted = $db->insertObject('#__content_types', $class_extends);
+
+ // Create the joomla_plugin_group content type object.
+ $joomla_plugin_group = new stdClass();
+ $joomla_plugin_group->type_title = 'Componentbuilder Joomla_plugin_group';
+ $joomla_plugin_group->type_alias = 'com_componentbuilder.joomla_plugin_group';
+ $joomla_plugin_group->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_group","key": "id","type": "Joomla_plugin_group","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $joomla_plugin_group->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","class_extends":"class_extends"}}';
+ $joomla_plugin_group->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_groupRoute';
+ $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Set the object into the content types table.
+ $joomla_plugin_group_Inserted = $db->insertObject('#__content_types', $joomla_plugin_group);
+
+ // Create the joomla_plugin_updates content type object.
+ $joomla_plugin_updates = new stdClass();
+ $joomla_plugin_updates->type_title = 'Componentbuilder Joomla_plugin_updates';
+ $joomla_plugin_updates->type_alias = 'com_componentbuilder.joomla_plugin_updates';
+ $joomla_plugin_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_updates","key": "id","type": "Joomla_plugin_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $joomla_plugin_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}';
+ $joomla_plugin_updates->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_updatesRoute';
+ $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}';
+
+ // Set the object into the content types table.
+ $joomla_plugin_updates_Inserted = $db->insertObject('#__content_types', $joomla_plugin_updates);
+
+ // Create the joomla_plugin_files_folders_urls content type object.
+ $joomla_plugin_files_folders_urls = new stdClass();
+ $joomla_plugin_files_folders_urls->type_title = 'Componentbuilder Joomla_plugin_files_folders_urls';
+ $joomla_plugin_files_folders_urls->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls';
+ $joomla_plugin_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_files_folders_urls","key": "id","type": "Joomla_plugin_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $joomla_plugin_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}';
+ $joomla_plugin_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_files_folders_urlsRoute';
+ $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}';
+
+ // Set the object into the content types table.
+ $joomla_plugin_files_folders_urls_Inserted = $db->insertObject('#__content_types', $joomla_plugin_files_folders_urls);
+
// Install the global extenstion params.
$query = $db->getQuery(true);
// Field to update.
$fields = array(
- $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","editor":"none","manage_jcb_package_directories":"2","add_menu_prefix":"1","menu_prefix":"»","minify":"0","set_browser_storage":"1","storage_time_to_live":"global","language":"en-GB","percentagelanguageadd":"50","compiler_field_builder_type":"2","field_name_builder":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'),
+ $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","editor":"none","manage_jcb_package_directories":"2","add_menu_prefix":"1","menu_prefix":"»","minify":"0","set_browser_storage":"1","storage_time_to_live":"global","language":"en-GB","percentagelanguageadd":"50","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'),
);
// Condition.
$conditions = array(
@@ -4139,7 +4935,7 @@ class com_componentbuilderInstallerScript
';
}
// do any updates needed
- if ($type == 'update')
+ if ($type === 'update')
{
// Get The Database object
@@ -4174,6 +4970,35 @@ class com_componentbuilderInstallerScript
$joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component);
}
+ // Create the joomla_plugin content type object.
+ $joomla_plugin = new stdClass();
+ $joomla_plugin->type_title = 'Componentbuilder Joomla_plugin';
+ $joomla_plugin->type_alias = 'com_componentbuilder.joomla_plugin';
+ $joomla_plugin->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin","key": "id","type": "Joomla_plugin","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $joomla_plugin->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_method_uninstall","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","class_extends":"class_extends","joomla_plugin_group":"joomla_plugin_group","sql":"sql","php_method_uninstall":"php_method_uninstall","php_postflight_update":"php_postflight_update","php_postflight_install":"php_postflight_install","description":"description","update_server_url":"update_server_url","head":"head","add_head":"add_head","sql_uninstall":"sql_uninstall","readme":"readme","main_class_code":"main_class_code","add_sales_server":"add_sales_server","not_required":"not_required","add_php_postflight_install":"add_php_postflight_install","plugin_version":"plugin_version","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","add_php_script_construct":"add_php_script_construct","add_sql":"add_sql","php_script_construct":"php_script_construct","add_sql_uninstall":"add_sql_uninstall","add_php_preflight_install":"add_php_preflight_install","addreadme":"addreadme","php_preflight_install":"php_preflight_install","add_update_server":"add_update_server","add_php_preflight_update":"add_php_preflight_update","update_server_target":"update_server_target","php_preflight_update":"php_preflight_update","add_php_preflight_uninstall":"add_php_preflight_uninstall","update_server":"update_server","php_preflight_uninstall":"php_preflight_uninstall","sales_server":"sales_server","name":"name"}}';
+ $joomla_plugin->router = 'ComponentbuilderHelperRoute::getJoomla_pluginRoute';
+ $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends","joomla_plugin_group","add_head","add_sales_server","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_php_script_construct","add_sql","add_sql_uninstall","add_php_preflight_install","addreadme","add_update_server","add_php_preflight_update","update_server_target","add_php_preflight_uninstall","update_server","sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Check if joomla_plugin type is already in content_type DB.
+ $joomla_plugin_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($joomla_plugin->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $joomla_plugin->type_id = $db->loadResult();
+ $joomla_plugin_Updated = $db->updateObject('#__content_types', $joomla_plugin, 'type_id');
+ }
+ else
+ {
+ $joomla_plugin_Inserted = $db->insertObject('#__content_types', $joomla_plugin);
+ }
+
// Create the admin_view content type object.
$admin_view = new stdClass();
$admin_view->type_title = 'Componentbuilder Admin_view';
@@ -4377,6 +5202,64 @@ class com_componentbuilderInstallerScript
$custom_code_Inserted = $db->insertObject('#__content_types', $custom_code);
}
+ // Create the class_property content type object.
+ $class_property = new stdClass();
+ $class_property->type_title = 'Componentbuilder Class_property';
+ $class_property->type_alias = 'com_componentbuilder.class_property';
+ $class_property->table = '{"special": {"dbtable": "#__componentbuilder_class_property","key": "id","type": "Class_property","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $class_property->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","comment":"comment","joomla_plugin_group":"joomla_plugin_group","default":"default"}}';
+ $class_property->router = 'ComponentbuilderHelperRoute::getClass_propertyRoute';
+ $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Check if class_property type is already in content_type DB.
+ $class_property_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($class_property->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $class_property->type_id = $db->loadResult();
+ $class_property_Updated = $db->updateObject('#__content_types', $class_property, 'type_id');
+ }
+ else
+ {
+ $class_property_Inserted = $db->insertObject('#__content_types', $class_property);
+ }
+
+ // Create the class_method content type object.
+ $class_method = new stdClass();
+ $class_method->type_title = 'Componentbuilder Class_method';
+ $class_method->type_alias = 'com_componentbuilder.class_method';
+ $class_method->table = '{"special": {"dbtable": "#__componentbuilder_class_method","key": "id","type": "Class_method","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $class_method->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","code":"code","comment":"comment","joomla_plugin_group":"joomla_plugin_group","arguments":"arguments"}}';
+ $class_method->router = 'ComponentbuilderHelperRoute::getClass_methodRoute';
+ $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Check if class_method type is already in content_type DB.
+ $class_method_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($class_method->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $class_method->type_id = $db->loadResult();
+ $class_method_Updated = $db->updateObject('#__content_types', $class_method, 'type_id');
+ }
+ else
+ {
+ $class_method_Inserted = $db->insertObject('#__content_types', $class_method);
+ }
+
// Create the placeholder content type object.
$placeholder = new stdClass();
$placeholder->type_title = 'Componentbuilder Placeholder';
@@ -5131,6 +6014,35 @@ class com_componentbuilderInstallerScript
$component_placeholders_Inserted = $db->insertObject('#__content_types', $component_placeholders);
}
+ // Create the component_plugins content type object.
+ $component_plugins = new stdClass();
+ $component_plugins->type_title = 'Componentbuilder Component_plugins';
+ $component_plugins->type_alias = 'com_componentbuilder.component_plugins';
+ $component_plugins->table = '{"special": {"dbtable": "#__componentbuilder_component_plugins","key": "id","type": "Component_plugins","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $component_plugins->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}';
+ $component_plugins->router = 'ComponentbuilderHelperRoute::getComponent_pluginsRoute';
+ $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}';
+
+ // Check if component_plugins type is already in content_type DB.
+ $component_plugins_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($component_plugins->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $component_plugins->type_id = $db->loadResult();
+ $component_plugins_Updated = $db->updateObject('#__content_types', $component_plugins, 'type_id');
+ }
+ else
+ {
+ $component_plugins_Inserted = $db->insertObject('#__content_types', $component_plugins);
+ }
+
// Create the snippet_type content type object.
$snippet_type = new stdClass();
$snippet_type->type_title = 'Componentbuilder Snippet_type';
@@ -5218,6 +6130,122 @@ class com_componentbuilderInstallerScript
$library_files_folders_urls_Inserted = $db->insertObject('#__content_types', $library_files_folders_urls);
}
+ // Create the class_extends content type object.
+ $class_extends = new stdClass();
+ $class_extends->type_title = 'Componentbuilder Class_extends';
+ $class_extends->type_alias = 'com_componentbuilder.class_extends';
+ $class_extends->table = '{"special": {"dbtable": "#__componentbuilder_class_extends","key": "id","type": "Class_extends","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $class_extends->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","extension_type":"extension_type","head":"head","comment":"comment"}}';
+ $class_extends->router = 'ComponentbuilderHelperRoute::getClass_extendsRoute';
+ $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Check if class_extends type is already in content_type DB.
+ $class_extends_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($class_extends->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $class_extends->type_id = $db->loadResult();
+ $class_extends_Updated = $db->updateObject('#__content_types', $class_extends, 'type_id');
+ }
+ else
+ {
+ $class_extends_Inserted = $db->insertObject('#__content_types', $class_extends);
+ }
+
+ // Create the joomla_plugin_group content type object.
+ $joomla_plugin_group = new stdClass();
+ $joomla_plugin_group->type_title = 'Componentbuilder Joomla_plugin_group';
+ $joomla_plugin_group->type_alias = 'com_componentbuilder.joomla_plugin_group';
+ $joomla_plugin_group->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_group","key": "id","type": "Joomla_plugin_group","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $joomla_plugin_group->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","class_extends":"class_extends"}}';
+ $joomla_plugin_group->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_groupRoute';
+ $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}';
+
+ // Check if joomla_plugin_group type is already in content_type DB.
+ $joomla_plugin_group_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($joomla_plugin_group->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $joomla_plugin_group->type_id = $db->loadResult();
+ $joomla_plugin_group_Updated = $db->updateObject('#__content_types', $joomla_plugin_group, 'type_id');
+ }
+ else
+ {
+ $joomla_plugin_group_Inserted = $db->insertObject('#__content_types', $joomla_plugin_group);
+ }
+
+ // Create the joomla_plugin_updates content type object.
+ $joomla_plugin_updates = new stdClass();
+ $joomla_plugin_updates->type_title = 'Componentbuilder Joomla_plugin_updates';
+ $joomla_plugin_updates->type_alias = 'com_componentbuilder.joomla_plugin_updates';
+ $joomla_plugin_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_updates","key": "id","type": "Joomla_plugin_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $joomla_plugin_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}';
+ $joomla_plugin_updates->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_updatesRoute';
+ $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}';
+
+ // Check if joomla_plugin_updates type is already in content_type DB.
+ $joomla_plugin_updates_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($joomla_plugin_updates->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $joomla_plugin_updates->type_id = $db->loadResult();
+ $joomla_plugin_updates_Updated = $db->updateObject('#__content_types', $joomla_plugin_updates, 'type_id');
+ }
+ else
+ {
+ $joomla_plugin_updates_Inserted = $db->insertObject('#__content_types', $joomla_plugin_updates);
+ }
+
+ // Create the joomla_plugin_files_folders_urls content type object.
+ $joomla_plugin_files_folders_urls = new stdClass();
+ $joomla_plugin_files_folders_urls->type_title = 'Componentbuilder Joomla_plugin_files_folders_urls';
+ $joomla_plugin_files_folders_urls->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls';
+ $joomla_plugin_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_files_folders_urls","key": "id","type": "Joomla_plugin_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $joomla_plugin_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}';
+ $joomla_plugin_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_files_folders_urlsRoute';
+ $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}';
+
+ // Check if joomla_plugin_files_folders_urls type is already in content_type DB.
+ $joomla_plugin_files_folders_urls_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($joomla_plugin_files_folders_urls->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $joomla_plugin_files_folders_urls->type_id = $db->loadResult();
+ $joomla_plugin_files_folders_urls_Updated = $db->updateObject('#__content_types', $joomla_plugin_files_folders_urls, 'type_id');
+ }
+ else
+ {
+ $joomla_plugin_files_folders_urls_Inserted = $db->insertObject('#__content_types', $joomla_plugin_files_folders_urls);
+ }
+
// target version less then 2.6.5
@@ -5426,8 +6454,9 @@ class com_componentbuilderInstallerScript
echo '
- Upgrade to Version 2.9.21 Was Successful! Let us know if anything is not working as expected.
';
+ Upgrade to Version 2.10.0 Was Successful! Let us know if anything is not working as expected.
';
}
+ return true;
}
/**
@@ -5444,7 +6473,7 @@ class com_componentbuilderInstallerScript
$folders = JFolder::folders($installPath);
// check if we have folders we may want to copy
$doNotCopy = array('media','admin','site'); // Joomla already deals with these
- if (count($folders) > 1)
+ if (count((array) $folders) > 1)
{
foreach ($folders as $folder)
{
diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php
index 2b4801c52..99f6666b1 100644
--- a/site/helpers/componentbuilder.php
+++ b/site/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 = "";
@@ -124,6 +130,510 @@ abstract class ComponentbuilderHelper
'JPATH_THEMES' => JPATH_THEMES
);
+ /**
+ * get the class method or property
+ *
+ * @input int The method/property ID
+ * @input string The target type
+ *
+ * @returns string on success
+ **/
+ public static function getClassCode($id, $type)
+ {
+ if ('property' === $type || 'method' === $type)
+ {
+ // 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)
+ {
+ $query->select($db->quoteName(array('a.comment','a.name','a.visibility','a.arguments','a.code')));
+ }
+ // get property
+ elseif ('property' === $type)
+ {
+ $query->select($db->quoteName(array('a.comment','a.name','a.visibility','a.default')));
+ }
+ $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'))
+ {
+ $columns = $db->getTableColumns('#__componentbuilder_class_' . $type);
+ if(isset($columns['access']))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+ }
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // 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);
+ }
+ }
+ 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
*
@@ -139,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));
}
/**
@@ -202,6 +712,48 @@ abstract class ComponentbuilderHelper
return self::safeString($string);
}
+ /**
+ * The type builder switch
+ **/
+ protected static $typeNameBuilder = false;
+
+ /**
+ * Making field type name safe
+ *
+ * @input string The you would like to make safe
+ *
+ * @returns string on success
+ **/
+ public static function safeTypeName($string)
+ {
+ // get global value
+ if (self::$typeNameBuilder === false)
+ {
+ self::$typeNameBuilder = JComponentHelper::getParams('com_componentbuilder')->get('type_name_builder', 1);
+ }
+ // use the new convention
+ if (2 == self::$typeNameBuilder)
+ {
+ // 0nly continue if we have a string
+ if (self::checkString($string))
+ {
+ // check that the first character is not a number
+ if (is_numeric(substr($string, 0, 1)))
+ {
+ $string = self::replaceNumbers($string);
+ }
+ // remove all and keep only characters and numbers and point (TODO just one point)
+ $string = trim(preg_replace("/[^A-Za-z0-9\.]/", '', $string));
+ // best is to return lower (for all string equality in compiler)
+ return strtolower($string);
+ }
+ // not a string
+ return '';
+ }
+ // use the default (original behaviour/convention)
+ return self::safeString($string);
+ }
+
/*
* Get the Array of Existing Validation Rule Names
*
@@ -529,7 +1081,7 @@ abstract class ComponentbuilderHelper
* @return void
*
*/
- public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'))
+ public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true)
{
if (JFolder::exists($folder))
{
@@ -537,11 +1089,25 @@ abstract class ComponentbuilderHelper
$joomla = getcwd();
// we are changing the working directory to the componet path
chdir($folder);
- // get the files
- foreach ($fileTypes as $type)
+ // make sure we have file type filter
+ if (self::checkArray($fileTypes))
+ {
+ // get the files
+ foreach ($fileTypes as $type)
+ {
+ // get a list of files in the current directory tree
+ $files[] = JFolder::files('.', $type, $recurse, $full);
+ }
+ }
+ elseif (self::checkString($fileTypes))
{
// get a list of files in the current directory tree
- $files[] = JFolder::files('.', $type, true, true);
+ $files[] = JFolder::files('.', $fileTypes, $recurse, $full);
+ }
+ else
+ {
+ // get a list of files in the current directory tree
+ $files[] = JFolder::files('.', '.', $recurse, $full);
}
// change back to Joomla working directory
chdir($joomla);
@@ -2698,13 +3264,13 @@ abstract class ComponentbuilderHelper
),
'option' => array(
'accesslevel', 'category', 'checkboxes', 'combo', 'contentlanguage', 'databaseconnection', // 'components', (TODO) must be added but still in use as a custom field in JCB
- 'filelist', 'folderlist', 'imagelist', 'list', 'plugins', 'predefinedlist', 'radio', 'sessionhandler', 'sql'
+ 'filelist', 'folderlist', 'imagelist', 'list', 'plugins', 'predefinedlist', 'radio', 'sessionhandler', 'sql', 'groupedlist'
),
'text' => array(
'calendar', 'color', 'editor', 'email', 'number', 'password', 'range', 'tel', 'text', 'textarea', 'url'
),
'list' => array(
- 'checkbox', 'checkboxes', 'list', 'radio'
+ 'checkbox', 'checkboxes', 'list', 'radio', 'groupedlist'
),
'dynamic' => array(
'category', 'file', 'filelist', 'folderlist', 'headertag', 'imagelist', 'integer', 'media', 'meter', 'rules', 'tag', 'timezone', 'user'
@@ -2713,7 +3279,7 @@ abstract class ComponentbuilderHelper
'note', 'spacer'
),
'special' => array(
- 'contentlanguage', 'groupedlist', 'moduleposition', 'plugin', 'repeatable', 'subform', 'templatestyle'
+ 'contentlanguage', 'moduleposition', 'plugin', 'repeatable', 'subform', 'templatestyle'
)
);
+
+
+
+
+
+
diff --git a/admin/views/joomla_plugin_updates/tmpl/index.html b/admin/views/joomla_plugin_updates/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/joomla_plugin_updates/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugin_updates/view.html.php b/admin/views/joomla_plugin_updates/view.html.php
new file mode 100644
index 000000000..4fd25bb53
--- /dev/null
+++ b/admin/views/joomla_plugin_updates/view.html.php
@@ -0,0 +1,195 @@
+
+ * @github Joomla Component Builder
+
+
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
diff --git a/admin/views/joomla_plugin_files_folders_urls/tmpl/index.html b/admin/views/joomla_plugin_files_folders_urls/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/joomla_plugin_files_folders_urls/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/joomla_plugin_files_folders_urls/view.html.php b/admin/views/joomla_plugin_files_folders_urls/view.html.php
new file mode 100644
index 000000000..eeae8920d
--- /dev/null
+++ b/admin/views/joomla_plugin_files_folders_urls/view.html.php
@@ -0,0 +1,195 @@
+
+ * @github Joomla Component Builder
+
+
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..26043dd9e
--- /dev/null
+++ b/admin/views/joomla_plugin/view.html.php
@@ -0,0 +1,287 @@
+
+ * @github Joomla Component Builder
+
+
+
+
diff --git a/admin/views/component_plugins/tmpl/index.html b/admin/views/component_plugins/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_plugins/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_plugins/view.html.php b/admin/views/component_plugins/view.html.php
new file mode 100644
index 000000000..22ab26463
--- /dev/null
+++ b/admin/views/component_plugins/view.html.php
@@ -0,0 +1,195 @@
+
+ * @github Joomla Component Builder
+