From 8d2af8365bfeea52ea79477f8e42f3af2dc731e4 Mon Sep 17 00:00:00 2001
From: Llewellyn van der Merwe <llewellyn@vdm.io>
Date: Wed, 17 Jul 2019 01:15:42 +0200
Subject: [PATCH] Added more dynamic behavior to the new plugin area. Added a
 funding yml file.

---
 .github/FUNDING.yml                           |  4 ++
 README.md                                     |  6 +-
 admin/README.txt                              |  6 +-
 admin/access.xml                              |  2 +
 admin/controllers/joomla_plugins.php          | 17 ++++++
 .../en-GB/en-GB.com_componentbuilder.ini      | 16 ++++++
 .../en-GB/en-GB.com_componentbuilder.sys.ini  |  4 ++
 .../joomla_plugin/details_fullwidth.php       |  3 +-
 admin/models/ajax.php                         | 28 +++++++++
 admin/models/class_extends.php                | 38 +++++++++++++
 admin/models/class_method.php                 | 38 +++++++++++++
 admin/models/class_property.php               | 38 +++++++++++++
 admin/models/forms/class_extends.js           | 50 +++++++++++++++-
 admin/models/forms/class_method.js            | 48 ++++++++++++++++
 admin/models/forms/class_property.js          | 48 ++++++++++++++++
 admin/models/forms/custom_code.js             |  4 +-
 admin/models/forms/joomla_plugin.js           | 57 +++++++++++++++++--
 admin/models/forms/joomla_plugin.xml          |  6 +-
 admin/models/forms/placeholder.js             |  4 +-
 admin/models/joomla_components.php            | 28 +++++++++
 admin/models/joomla_plugin.php                | 11 +++-
 admin/views/admin_view/tmpl/edit.php          |  2 +-
 admin/views/class_extends/tmpl/edit.php       | 25 +++++++-
 admin/views/class_extends/view.html.php       | 19 ++++++-
 admin/views/class_method/tmpl/edit.php        | 19 +++++++
 admin/views/class_method/view.html.php        | 19 ++++++-
 admin/views/class_property/tmpl/edit.php      | 19 +++++++
 admin/views/class_property/view.html.php      | 19 ++++++-
 admin/views/joomla_plugin/tmpl/edit.php       | 15 ++++-
 admin/views/joomla_plugins/view.html.php      | 10 ++++
 componentbuilder.xml                          |  2 +-
 31 files changed, 573 insertions(+), 32 deletions(-)
 create mode 100644 .github/FUNDING.yml

diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 000000000..1b2d180e0
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,4 @@
+# These are supported funding model platforms
+
+# soon :) github: [Llewellynvdm]
+open_collective: Joomla-Component-Builder
diff --git a/README.md b/README.md
index 1c130f6d8..ef5584734 100644
--- a/README.md
+++ b/README.md
@@ -146,12 +146,12 @@ TODO
 + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
 + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
 + *First Build*: 30th April, 2015
-+ *Last Build*: 15th July, 2019
++ *Last Build*: 16th July, 2019
 + *Version*: 2.9.32
 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
 + *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **232323**
-+ *Field count*: **1221**
++ *Line count*: **232852**
++ *Field count*: **1222**
 + *File count*: **1497**
 + *Folder count*: **229**
 
diff --git a/admin/README.txt b/admin/README.txt
index 1c130f6d8..ef5584734 100644
--- a/admin/README.txt
+++ b/admin/README.txt
@@ -146,12 +146,12 @@ TODO
 + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
 + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
 + *First Build*: 30th April, 2015
-+ *Last Build*: 15th July, 2019
++ *Last Build*: 16th July, 2019
 + *Version*: 2.9.32
 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
 + *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **232323**
-+ *Field count*: **1221**
++ *Line count*: **232852**
++ *Field count*: **1222**
 + *File count*: **1497**
 + *Folder count*: **229**
 
diff --git a/admin/access.xml b/admin/access.xml
index 7e62111cc..b5333cb38 100644
--- a/admin/access.xml
+++ b/admin/access.xml
@@ -318,6 +318,8 @@
 		<action name="joomla_plugin_group.access" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_ACCESS_DESC" />
 		<action name="joomla_plugin_group.batch" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE_DESC" />
 		<action name="joomla_plugin_group.version" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_EDIT_VERSION_DESC" />
+		<action name="joomla_plugin.methods" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHODS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHODS_BUTTON_ACCESS_DESC" />
+		<action name="joomla_plugin.properties" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTIES_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTIES_BUTTON_ACCESS_DESC" />
 		<action name="joomla_plugin.run_expansion" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_RUN_EXPANSION_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_RUN_EXPANSION_BUTTON_ACCESS_DESC" />
 		<action name="joomla_plugin.access" title="COM_COMPONENTBUILDER_JOOMLA_PLUGINS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_PLUGINS_ACCESS_DESC" />
 		<action name="joomla_plugin.batch" title="COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_USE" description="COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_USE_DESC" />
diff --git a/admin/controllers/joomla_plugins.php b/admin/controllers/joomla_plugins.php
index b78efc394..2b76de3aa 100644
--- a/admin/controllers/joomla_plugins.php
+++ b/admin/controllers/joomla_plugins.php
@@ -179,4 +179,21 @@ class ComponentbuilderControllerJoomla_plugins extends JControllerAdmin
 		return false;
 	}
 
+	public function openClassMethods()
+	{
+		// Check for request forgeries
+		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
+		// redirect to the libraries
+		$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false));
+		return;
+	}
+
+	public function openClassProperties()
+	{
+		// Check for request forgeries
+		JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
+		// redirect to the libraries
+		$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false));
+		return;
+	}
 }
diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini
index 9f437be66..764bb5a38 100644
--- a/admin/language/en-GB/en-GB.com_componentbuilder.ini
+++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini
@@ -4118,6 +4118,10 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_PLACEHOLDERS_EXPLAINED_DESCRIPTION="<div c
 <div id='usedin-n' style='display:none;'><h2>Libraries</h2><div id='area-n'></div></div>
 <div id='usedin-o' style='display:none;'><h2>Custom Code</h2><div id='area-o'></div></div>
 <div id='usedin-p' style='display:none;'><h2>Validation Rule</h2><div id='area-p'></div></div>
+<div id='usedin-q' style='display:none;'><h2>Joomla Plugin</h2><div id='area-q'></div></div>
+<div id='usedin-r' style='display:none;'><h2>Class Extends</h2><div id='area-r'></div></div>
+<div id='usedin-s' style='display:none;'><h2>Class Property</h2><div id='area-s'></div></div>
+<div id='usedin-t' style='display:none;'><h2>Class Method</h2><div id='area-t'></div></div>
 <div id='loading-usedin' style='display: none;'><h2>Scanning Database<span class='loading-dots'>..</span></h2></div>
 <div id='note-usedin-found' style='display: none;'><small>You can edit the above areas where this code is used.</small></div>
 <div id='note-usedin-not' style='display: none;'><small>This code is not used in any area of the JCB custom code blocks at this time.</small></div>
@@ -5912,6 +5916,8 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE="Main Class Code"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE_DESCRIPTION="Add the class properties & methods here."
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE_LABEL="Class Properties & Methods"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD="Method"
+COM_COMPONENTBUILDER_JOOMLA_PLUGIN_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_METHOD_LABEL="Methods"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION="Method Selection"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION_DESCRIPTION="Select methods you want to use in your plugin class."
@@ -5928,10 +5934,14 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NAME_MESSAGE="Error! Please add name here."
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NEW="A New Joomla Plugin"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_BETA_STAGE_DESCRIPTION="This area is still in beta, and is not ready for use. Things may work, but they are not wired up to the back-end/compiler. You are already seeing it since JCB is being developed in a reverse motion of front-end/GUI to back-end/Compiler approach. We first build the GUI... and then the Back-end, which is not normally how it is done, or so I was told.... But anyway that is how JCB is being build, we get the idea, look at all the relationships and build the tables, and columns, which then map to views and fields (GUI), we then build the functions in the compiler to act upon these new data-sets, and whammm the full functionality/idea becomes stable and ready. So in due time this area will become available for your use, and then this message will go away! (or the whole area will just disappear if it does not work out :)"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_BETA_STAGE_LABEL="Beta Stage"
+COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_LINKED_TO_NOTICE_DESCRIPTION="<div id='display_linked_to'>Searching the database.<span class='loading-dots'></span></div>"
+COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_LINKED_TO_NOTICE_LABEL="Linked To"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_PLUGIN_DESCRIPTION="<p>So over here you are able to manually code your plugin methods which usually will be the event name you are targeting.</p><p>We have also added some methods via the <a href='https://github.com/vdm-io/boilerplate' title='look at the boilerplate repo' target='_blank'>boilerplate repo</a> that can serve as a starting point, simple select them and it will be added to your code.</p><p><p>If you have added any fields in the Config/Params tab, these fields will be available to you in the <code>$this->params</code> object, and can be accessed via the field name <code>$this->params->get('fieldname');</code> with the get method.</p>"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_PLUGIN_LABEL="Easy Plugin Build Options"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ORDERING_LABEL="Ordering"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PERMISSION="Permissions"
+COM_COMPONENTBUILDER_JOOMLA_PLUGIN_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_PROPERTY="Property"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_LABEL="Properties"
 COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION="Property Selection"
@@ -6624,6 +6634,7 @@ COM_COMPONENTBUILDER_MATCH_FIELD="Match Field"
 COM_COMPONENTBUILDER_MATCH_OPTIONS="Match Options"
 COM_COMPONENTBUILDER_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD="Max Length (only 4 text_field)"
 COM_COMPONENTBUILDER_MERGE="Merge"
+COM_COMPONENTBUILDER_METHODS="Methods"
 COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT="Minify JavaScript"
 COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)"
 COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)"
@@ -6770,6 +6781,10 @@ COM_COMPONENTBUILDER_PLACEHOLDER_NOTE_PLACEHOLDERS_PLACEDIN_DESCRIPTION="<div cl
 <div id='placedin-n' style='display:none;'><h2>Libraries</h2><div id='area-n'></div></div>
 <div id='placedin-o' style='display:none;'><h2>Custom Code</h2><div id='area-o'></div></div>
 <div id='placedin-p' style='display:none;'><h2>Validation Rule</h2><div id='area-p'></div></div>
+<div id='placedin-q' style='display:none;'><h2>Joomla Plugin</h2><div id='area-q'></div></div>
+<div id='placedin-r' style='display:none;'><h2>Class Extends</h2><div id='area-r'></div></div>
+<div id='placedin-s' style='display:none;'><h2>Class Property</h2><div id='area-s'></div></div>
+<div id='placedin-t' style='display:none;'><h2>Class Method</h2><div id='area-t'></div></div>
 <div id='loading-placedin' style='display: none;'><h2>Scanning Database<span class='loading-dots'>..</span></h2></div>
 <div id='note-placedin-found' style='display: none;'><small>You can edit the above areas where this placeholder is used.</small></div>
 <div id='note-placedin-not' style='display: none;'><small>This placeholder is not used in any area of the JCB custom code blocks at this time.</small></div>
@@ -6801,6 +6816,7 @@ COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE="P
 COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER="Please try again later"
 COM_COMPONENTBUILDER_PLEASE_WAIT_CLEARING_THE_TMP_FOLDER="Please wait! Clearing the tmp folder"
 COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING="Please wait, loading"
+COM_COMPONENTBUILDER_PROPERTIES="Properties"
 COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties<br /><small>Here you can set the properties for this field.</small>"
 COM_COMPONENTBUILDER_PROPERTY="Property"
 COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER="Property already selected, try another."
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 5a9e24166..c5b48bd18 100644
--- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini
+++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini
@@ -654,6 +654,10 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE="Joomla Plugin Groups Batch
 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"
diff --git a/admin/layouts/joomla_plugin/details_fullwidth.php b/admin/layouts/joomla_plugin/details_fullwidth.php
index 3405d91b5..39b8b415a 100644
--- a/admin/layouts/joomla_plugin/details_fullwidth.php
+++ b/admin/layouts/joomla_plugin/details_fullwidth.php
@@ -26,7 +26,8 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1];
 
 // get the fields
 $fields = $displayData->get($fields_tab_layout) ?: array(
-	'main_class_code'
+	'main_class_code',
+	'note_linked_to_notice'
 );
 
 $hiddenFields = $displayData->get('hidden_fields') ?: array();
diff --git a/admin/models/ajax.php b/admin/models/ajax.php
index 9990e6570..2ef1d3184 100644
--- a/admin/models/ajax.php
+++ b/admin/models/ajax.php
@@ -2402,6 +2402,34 @@ class ComponentbuilderModelAjax extends JModelList
 			'views' => 'validation_rules',
 			'not_base64' => array(),
 			'name' => 'name'
+		),
+		// #__componentbuilder_joomla_plugin (q)
+		'joomla_plugin' => array(
+			'search' => array('id', 'name', 'main_class_code'),
+			'views' => 'joomla_plugins',
+			'not_base64' => array(),
+			'name' => 'name'
+		),
+		// #__componentbuilder_class_extends (r)
+		'class_extends' => array(
+			'search' => array('id', 'name', 'head', 'comment'),
+			'views' => 'class_extendings',
+			'not_base64' => array(),
+			'name' => 'name'
+		),
+		// #__componentbuilder_class_property (s)
+		'class_property' => array(
+			'search' => array('id', 'name', 'default', 'comment'),
+			'views' => 'class_properties',
+			'not_base64' => array(),
+			'name' => 'name'
+		),
+		// #__componentbuilder_class_method (t)
+		'class_method' => array(
+			'search' => array('id', 'name', 'code', 'comment'),
+			'views' => 'class_methods',
+			'not_base64' => array(),
+			'name' => 'name'
 		)
 	);
 
diff --git a/admin/models/class_extends.php b/admin/models/class_extends.php
index 161971607..e76ee6c01 100644
--- a/admin/models/class_extends.php
+++ b/admin/models/class_extends.php
@@ -70,7 +70,19 @@ class ComponentbuilderModelClass_extends extends JModelAdmin
 		$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables');
 		// get instance of the table
 		return JTable::getInstance($type, $prefix, $config);
+	}
+
+	/**
+	 * get VDM session key
+	 *
+	 * @return  string  the session key
+	 *
+	 */
+	public function getVDM()
+	{
+		return $this->vastDevMod;
 	}
+
     
 	/**
 	 * Method to get a single record.
@@ -111,6 +123,32 @@ class ComponentbuilderModelClass_extends extends JModelAdmin
 			{
 				// base64 Decode comment.
 				$item->comment = base64_decode($item->comment);
+			}
+
+
+			if (empty($item->id))
+			{
+				$id = 0;
+			}
+			else
+			{
+				$id = $item->id;
+			}
+			// set the id and view name to session
+			if ($vdm = ComponentbuilderHelper::get('class_extends__'.$id))
+			{
+				$this->vastDevMod = $vdm;
+			}
+			else
+			{
+				// set the vast development method key
+				$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
+				ComponentbuilderHelper::set($this->vastDevMod, 'class_extends__'.$id);
+				ComponentbuilderHelper::set('class_extends__'.$id, $this->vastDevMod);
+				// set a return value if found
+				$jinput = JFactory::getApplication()->input;
+				$return = $jinput->get('return', null, 'base64');
+				ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
 			}
 			
 			if (!empty($item->id))
diff --git a/admin/models/class_method.php b/admin/models/class_method.php
index 987395b88..d6a4a8f97 100644
--- a/admin/models/class_method.php
+++ b/admin/models/class_method.php
@@ -73,7 +73,19 @@ class ComponentbuilderModelClass_method extends JModelAdmin
 		$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables');
 		// get instance of the table
 		return JTable::getInstance($type, $prefix, $config);
+	}
+
+	/**
+	 * get VDM session key
+	 *
+	 * @return  string  the session key
+	 *
+	 */
+	public function getVDM()
+	{
+		return $this->vastDevMod;
 	}
+
     
 	/**
 	 * Method to get a single record.
@@ -120,6 +132,32 @@ class ComponentbuilderModelClass_method extends JModelAdmin
 			{
 				// base64 Decode arguments.
 				$item->arguments = base64_decode($item->arguments);
+			}
+
+
+			if (empty($item->id))
+			{
+				$id = 0;
+			}
+			else
+			{
+				$id = $item->id;
+			}
+			// set the id and view name to session
+			if ($vdm = ComponentbuilderHelper::get('class_method__'.$id))
+			{
+				$this->vastDevMod = $vdm;
+			}
+			else
+			{
+				// set the vast development method key
+				$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
+				ComponentbuilderHelper::set($this->vastDevMod, 'class_method__'.$id);
+				ComponentbuilderHelper::set('class_method__'.$id, $this->vastDevMod);
+				// set a return value if found
+				$jinput = JFactory::getApplication()->input;
+				$return = $jinput->get('return', null, 'base64');
+				ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
 			}
 			
 			if (!empty($item->id))
diff --git a/admin/models/class_property.php b/admin/models/class_property.php
index 4557ceb53..aa9bb5f1c 100644
--- a/admin/models/class_property.php
+++ b/admin/models/class_property.php
@@ -70,7 +70,19 @@ class ComponentbuilderModelClass_property extends JModelAdmin
 		$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables');
 		// get instance of the table
 		return JTable::getInstance($type, $prefix, $config);
+	}
+
+	/**
+	 * get VDM session key
+	 *
+	 * @return  string  the session key
+	 *
+	 */
+	public function getVDM()
+	{
+		return $this->vastDevMod;
 	}
+
     
 	/**
 	 * Method to get a single record.
@@ -111,6 +123,32 @@ class ComponentbuilderModelClass_property extends JModelAdmin
 			{
 				// base64 Decode default.
 				$item->default = base64_decode($item->default);
+			}
+
+
+			if (empty($item->id))
+			{
+				$id = 0;
+			}
+			else
+			{
+				$id = $item->id;
+			}
+			// set the id and view name to session
+			if ($vdm = ComponentbuilderHelper::get('class_property__'.$id))
+			{
+				$this->vastDevMod = $vdm;
+			}
+			else
+			{
+				// set the vast development method key
+				$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
+				ComponentbuilderHelper::set($this->vastDevMod, 'class_property__'.$id);
+				ComponentbuilderHelper::set('class_property__'.$id, $this->vastDevMod);
+				// set a return value if found
+				$jinput = JFactory::getApplication()->input;
+				$return = $jinput->get('return', null, 'base64');
+				ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
 			}
 			
 			if (!empty($item->id))
diff --git a/admin/models/forms/class_extends.js b/admin/models/forms/class_extends.js
index 406de38ba..bb3404a02 100644
--- a/admin/models/forms/class_extends.js
+++ b/admin/models/forms/class_extends.js
@@ -8,4 +8,52 @@
  * @license    GNU General Public License version 2 or later; see LICENSE.txt
  */
 
- 
+
+
+
+jQuery(document).ready(function()
+{
+	// load the used in div
+	// jQuery('#usedin').show();
+	// check and load all the customcode edit buttons
+	setTimeout(getEditCustomCodeButtons, 300);
+});
+
+function getEditCustomCodeButtons_server(id){
+	var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
+	if(token.length > 0 && id > 0){
+		var request = token+'=1&id='+id+'&return_here='+return_here;
+	}
+	return jQuery.ajax({
+		type: 'GET',
+		url: getUrl,
+		dataType: 'json',
+		data: request,
+		jsonp: false
+	});
+}
+
+function getEditCustomCodeButtons(){
+	// get the id
+	id = jQuery("#jform_id").val();
+	getEditCustomCodeButtons_server(id).done(function(result) {
+		if(isObject(result)){
+			jQuery.each(result, function( field, buttons ) {
+				jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
+				jQuery.each(buttons, function( name, button ) {
+					jQuery(".control-customcode-buttons-"+field).append(button);
+				});
+			});
+		}
+	})
+}
+
+// check object is not empty
+function isObject(obj) {
+	for(var prop in obj) {
+		if (Object.prototype.hasOwnProperty.call(obj, prop)) {
+			return true;
+		}
+	}
+	return false;
+} 
diff --git a/admin/models/forms/class_method.js b/admin/models/forms/class_method.js
index 2f850ef20..3c23c163e 100644
--- a/admin/models/forms/class_method.js
+++ b/admin/models/forms/class_method.js
@@ -108,4 +108,52 @@ function isSet(val)
 		return true;
 	}
 	return false;
+}
+
+
+jQuery(document).ready(function()
+{
+	// load the used in div
+	// jQuery('#usedin').show();
+	// check and load all the customcode edit buttons
+	setTimeout(getEditCustomCodeButtons, 300);
+});
+
+function getEditCustomCodeButtons_server(id){
+	var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
+	if(token.length > 0 && id > 0){
+		var request = token+'=1&id='+id+'&return_here='+return_here;
+	}
+	return jQuery.ajax({
+		type: 'GET',
+		url: getUrl,
+		dataType: 'json',
+		data: request,
+		jsonp: false
+	});
+}
+
+function getEditCustomCodeButtons(){
+	// get the id
+	id = jQuery("#jform_id").val();
+	getEditCustomCodeButtons_server(id).done(function(result) {
+		if(isObject(result)){
+			jQuery.each(result, function( field, buttons ) {
+				jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
+				jQuery.each(buttons, function( name, button ) {
+					jQuery(".control-customcode-buttons-"+field).append(button);
+				});
+			});
+		}
+	})
+}
+
+// check object is not empty
+function isObject(obj) {
+	for(var prop in obj) {
+		if (Object.prototype.hasOwnProperty.call(obj, prop)) {
+			return true;
+		}
+	}
+	return false;
 } 
diff --git a/admin/models/forms/class_property.js b/admin/models/forms/class_property.js
index c048e3d67..b3f18db20 100644
--- a/admin/models/forms/class_property.js
+++ b/admin/models/forms/class_property.js
@@ -108,4 +108,52 @@ function isSet(val)
 		return true;
 	}
 	return false;
+}
+
+
+jQuery(document).ready(function()
+{
+	// load the used in div
+	// jQuery('#usedin').show();
+	// check and load all the customcode edit buttons
+	setTimeout(getEditCustomCodeButtons, 300);
+});
+
+function getEditCustomCodeButtons_server(id){
+	var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
+	if(token.length > 0 && id > 0){
+		var request = token+'=1&id='+id+'&return_here='+return_here;
+	}
+	return jQuery.ajax({
+		type: 'GET',
+		url: getUrl,
+		dataType: 'json',
+		data: request,
+		jsonp: false
+	});
+}
+
+function getEditCustomCodeButtons(){
+	// get the id
+	id = jQuery("#jform_id").val();
+	getEditCustomCodeButtons_server(id).done(function(result) {
+		if(isObject(result)){
+			jQuery.each(result, function( field, buttons ) {
+				jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
+				jQuery.each(buttons, function( name, button ) {
+					jQuery(".control-customcode-buttons-"+field).append(button);
+				});
+			});
+		}
+	})
+}
+
+// check object is not empty
+function isObject(obj) {
+	for(var prop in obj) {
+		if (Object.prototype.hasOwnProperty.call(obj, prop)) {
+			return true;
+		}
+	}
+	return false;
 } 
diff --git a/admin/models/forms/custom_code.js b/admin/models/forms/custom_code.js
index 95e2b0589..ab700d592 100644
--- a/admin/models/forms/custom_code.js
+++ b/admin/models/forms/custom_code.js
@@ -313,8 +313,8 @@ function usedin(functioName, ide) {
 	jQuery('#note-usedin-not').hide();
 	jQuery('#note-usedin-found').hide();
 	jQuery('#loading-usedin').show();
-	var targets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p']; // if you update this, also update (below 15) & [customcode-codeUsedInHtmlNote]!
-	var targetNumber = 15;
+	var targets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t']; // if you update this, also update (below 19) & [customcode-codeUsedInHtmlNote]!
+	var targetNumber = 19;
 	var run = 0;
 	var usedinChecker = setInterval(function(){ 
 		var target = targets[run];
diff --git a/admin/models/forms/joomla_plugin.js b/admin/models/forms/joomla_plugin.js
index fe93ad56b..3ede6f498 100644
--- a/admin/models/forms/joomla_plugin.js
+++ b/admin/models/forms/joomla_plugin.js
@@ -162,6 +162,8 @@ function isSet(val)
 
 jQuery(document).ready(function()
 {
+	// get the linked details
+	getLinked();
 	// load the active array values
 	buildSelectionArray('property');
 	buildSelectionArray('method');
@@ -176,11 +178,9 @@ jQuery(document).ready(function()
 	getClassCodeIds('joomla_plugin_group', 'jform_class_extends', false);
 	getClassCodeIds('property', 'jform_joomla_plugin_group', false);
 	getClassCodeIds('method', 'jform_joomla_plugin_group', false);
-	// load the used in div
-	// jQuery('#usedin').show();
 	// check and load all the customcode edit buttons
-	// setTimeout(getEditCustomCodeButtons, 300);
-
+	setTimeout(getEditCustomCodeButtons, 300);
+	// trigger the row watcher
 	rowWatcher();
 });
 
@@ -291,7 +291,7 @@ function getClassCode(field, type){
 		jQuery.UIkit.notify({message: Joomla.JText._('COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER'), timeout: 5000, status: 'warning', pos: 'top-center'});
 	} else {
 		// set the active removed value
-		selectedIdRemoved[type] = value;
+		selectedIdRemoved[type] = id;
 		// do a dynamic update (to remove what was already used)
 		selectionDynamicUpdate(type);
 		// now get the code
@@ -414,6 +414,31 @@ function rowWatcher() {
 		if (isSet(valid_call)){
 			selectedIdRemoved[type_call] = valid_call;
 			selectionDynamicUpdate(type_call);
+			// also remove from code
+			var valid_value = jQuery(row.innerHTML).find('#' + valid_call + ' option:selected').val();
+			getClassStuff_server(valid_value, type_call, 'getClassCode').done(function(result) {
+				if(result){
+					if (Joomla.editors.instances.hasOwnProperty("jform_main_class_code")) {
+						var old_result = Joomla.editors.instances['jform_main_class_code'].getValue();
+						if (old_result.length > 0) {
+							// make sure not to load the same string twice
+							if (old_result.indexOf(result) !== -1) {
+								// remove the code
+								Joomla.editors.instances['jform_main_class_code'].setValue(old_result.replace(result+"\n\n",'').replace("\n\n"+result,'').replace(result,''));
+							}
+						}
+					} else {
+						var old_result = jQuery('textarea#jform_main_class_code').val();
+						if (old_result.length > 0) {
+							// make sure not to load the same string twice
+							if (old_result.indexOf(result) !== -1) {
+								// remove the code
+								jQuery('textarea#jform_main_class_code').val(old_result.replace(result+"\n\n",'').replace("\n\n"+result,'').replace(result,''));
+							}
+						}
+					}
+				}
+			});
 		}
 	});
 	jQuery(document).on('subform-row-add', function(event, row){
@@ -451,6 +476,28 @@ function propertyIsSet(prop, id, type) {
 	return false;
 }
 
+function getLinked_server(type){
+	var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod);
+	if(token.length > 0 && type > 0){
+		var request = token+'=1&type='+type;
+	}
+	return jQuery.ajax({
+		type: 'GET',
+		url: getUrl,
+		dataType: 'json',
+		data: request,
+		jsonp: false
+	});
+}
+
+function getLinked(){
+	getLinked_server(1).done(function(result) {
+		if(result){
+			jQuery('#display_linked_to').html(result);
+		}
+	});
+}
+
 function getEditCustomCodeButtons_server(id){
 	var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
 	if(token.length > 0 && id > 0){
diff --git a/admin/models/forms/joomla_plugin.xml b/admin/models/forms/joomla_plugin.xml
index a4734482b..faa14c014 100644
--- a/admin/models/forms/joomla_plugin.xml
+++ b/admin/models/forms/joomla_plugin.xml
@@ -162,6 +162,8 @@
 				/>
 			</form>
 		</field>
+		<!-- Note_linked_to_notice Field. Type: Note. A None Database Field. (joomla) -->
+		<field type="note" name="note_linked_to_notice" label="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_LINKED_TO_NOTICE_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_NOTE_LINKED_TO_NOTICE_DESCRIPTION" heading="h4" class="note_linked_to_notice" />
 		<!-- Main_class_code Field. Type: Editor. (joomla) -->
 		<field
 			type="editor"
@@ -189,7 +191,7 @@
 			description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION_DESCRIPTION"
 			icon="list"
 			max="150"
-			min="1">
+			min="0">
 			<form hidden="true" name="list_method_selection_modal" repeat="true">
 				<!-- Method Field. Type: Pluginsclassmethods. (custom) -->
 				<field
@@ -215,7 +217,7 @@
 			description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION_DESCRIPTION"
 			icon="list"
 			max="150"
-			min="1">
+			min="0">
 			<form hidden="true" name="list_property_selection_modal" repeat="true">
 				<!-- Property Field. Type: Pluginsclassproperties. (custom) -->
 				<field
diff --git a/admin/models/forms/placeholder.js b/admin/models/forms/placeholder.js
index 0968bf924..a36ec605d 100644
--- a/admin/models/forms/placeholder.js
+++ b/admin/models/forms/placeholder.js
@@ -78,8 +78,8 @@ function placedin(placeholder, ide) {
 	jQuery('#note-placedin-not').hide();
 	jQuery('#note-placedin-found').hide();
 	jQuery('#loading-placedin').show();
-	var targets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p']; // if you update this, also update (below 15) & [customcode-codeUsedInHtmlNote]!
-	var targetNumber = 15;
+	var targets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t']; // if you update this, also update (below 19) & [customcode-codeUsedInHtmlNote]!
+	var targetNumber = 19;
 	var run = 0;
 	var placedinChecker = setInterval(function(){ 
 		var target = targets[run];
diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php
index 1121e55b0..59fed7542 100644
--- a/admin/models/joomla_components.php
+++ b/admin/models/joomla_components.php
@@ -1821,6 +1821,34 @@ class ComponentbuilderModelJoomla_components extends JModelList
 			'views' => 'validation_rules',
 			'not_base64' => array(),
 			'name' => 'name'
+		),
+		// #__componentbuilder_joomla_plugin (q)
+		'joomla_plugin' => array(
+			'search' => array('id', 'name', 'main_class_code'),
+			'views' => 'joomla_plugins',
+			'not_base64' => array(),
+			'name' => 'name'
+		),
+		// #__componentbuilder_class_extends (r)
+		'class_extends' => array(
+			'search' => array('id', 'name', 'head', 'comment'),
+			'views' => 'class_extendings',
+			'not_base64' => array(),
+			'name' => 'name'
+		),
+		// #__componentbuilder_class_property (s)
+		'class_property' => array(
+			'search' => array('id', 'name', 'default', 'comment'),
+			'views' => 'class_properties',
+			'not_base64' => array(),
+			'name' => 'name'
+		),
+		// #__componentbuilder_class_method (t)
+		'class_method' => array(
+			'search' => array('id', 'name', 'code', 'comment'),
+			'views' => 'class_methods',
+			'not_base64' => array(),
+			'name' => 'name'
 		)
 	);
 
diff --git a/admin/models/joomla_plugin.php b/admin/models/joomla_plugin.php
index c9df4330b..4db61d5fd 100644
--- a/admin/models/joomla_plugin.php
+++ b/admin/models/joomla_plugin.php
@@ -35,7 +35,8 @@ class ComponentbuilderModelJoomla_plugin extends JModelAdmin
 				'method_selection'
 			),
 			'fullwidth' => array(
-				'main_class_code'
+				'main_class_code',
+				'note_linked_to_notice'
 			),
 			'above' => array(
 				'name',
@@ -882,8 +883,12 @@ class ComponentbuilderModelJoomla_plugin extends JModelAdmin
 			$data['metadata'] = (string) $metadata;
 		}
 
-		// make sure the name is safe to be used as a function name
-		$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
+		// check if the name has placeholder
+		if (strpos($data['name'], '[[[') === false && strpos($data['name'], '###') === false)
+		{
+			// make sure the name is safe to be used as a function name
+			$data['name'] = ComponentbuilderHelper::safeClassFunctionName($data['name']);
+		}
 
 		// Set the fields items to data.
 		if (isset($data['fields']) && is_array($data['fields']))
diff --git a/admin/views/admin_view/tmpl/edit.php b/admin/views/admin_view/tmpl/edit.php
index 9d8c1b4d6..4b255e138 100644
--- a/admin/views/admin_view/tmpl/edit.php
+++ b/admin/views/admin_view/tmpl/edit.php
@@ -785,7 +785,7 @@ jQuery(document).ready( function($) {
 	}
 	$(".loading-dots").text(dots);
   } , 500);
-}); 
+});
 jQuery(document).ready(function(){
 	jQuery(document).on('subform-row-add', function(event, row){
 		getIconImage(jQuery(row).find('.icomoon342'));
diff --git a/admin/views/class_extends/tmpl/edit.php b/admin/views/class_extends/tmpl/edit.php
index 014a9f912..e32f5a97b 100644
--- a/admin/views/class_extends/tmpl/edit.php
+++ b/admin/views/class_extends/tmpl/edit.php
@@ -108,4 +108,27 @@ $componentParams = $this->params; // will be removed just use $this->params inst
 	</div>
 </div>
 </form>
-</div>
+</div>
+
+<script type="text/javascript">
+
+
+
+
+<?php
+	$app = JFactory::getApplication();
+?>
+function JRouter(link) {
+<?php
+	if ($app->isSite())
+	{
+		echo 'var url = "'.JURI::root().'";';
+	}
+	else
+	{
+		echo 'var url = "";';
+	}
+?>
+	return url+link;
+}
+</script>
diff --git a/admin/views/class_extends/view.html.php b/admin/views/class_extends/view.html.php
index 99b47c24e..8d4ae267c 100644
--- a/admin/views/class_extends/view.html.php
+++ b/admin/views/class_extends/view.html.php
@@ -187,9 +187,24 @@ class ComponentbuilderViewClass_extends extends JViewLegacy
 			$this->document = JFactory::getDocument();
 		}
 		$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_EXTENDS_NEW' : 'COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT'));
-		$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_extends.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+		$this->document->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'); 
+		$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/tmpl/edit.php b/admin/views/class_method/tmpl/edit.php
index 051258709..2a52b768e 100644
--- a/admin/views/class_method/tmpl/edit.php
+++ b/admin/views/class_method/tmpl/edit.php
@@ -127,4 +127,23 @@ jQuery('#adminForm').on('change', '#jform_extension_type',function (e)
 
 });
 
+
+
+
+<?php
+	$app = JFactory::getApplication();
+?>
+function JRouter(link) {
+<?php
+	if ($app->isSite())
+	{
+		echo 'var url = "'.JURI::root().'";';
+	}
+	else
+	{
+		echo 'var url = "";';
+	}
+?>
+	return url+link;
+}
 </script>
diff --git a/admin/views/class_method/view.html.php b/admin/views/class_method/view.html.php
index b453d9379..9f5575570 100644
--- a/admin/views/class_method/view.html.php
+++ b/admin/views/class_method/view.html.php
@@ -187,9 +187,24 @@ class ComponentbuilderViewClass_method extends JViewLegacy
 			$this->document = JFactory::getDocument();
 		}
 		$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_METHOD_NEW' : 'COM_COMPONENTBUILDER_CLASS_METHOD_EDIT'));
-		$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_method.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+		$this->document->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'); 
+		$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_property/tmpl/edit.php b/admin/views/class_property/tmpl/edit.php
index ed0619465..0798138f5 100644
--- a/admin/views/class_property/tmpl/edit.php
+++ b/admin/views/class_property/tmpl/edit.php
@@ -122,4 +122,23 @@ jQuery('#adminForm').on('change', '#jform_extension_type',function (e)
 
 });
 
+
+
+
+<?php
+	$app = JFactory::getApplication();
+?>
+function JRouter(link) {
+<?php
+	if ($app->isSite())
+	{
+		echo 'var url = "'.JURI::root().'";';
+	}
+	else
+	{
+		echo 'var url = "";';
+	}
+?>
+	return url+link;
+}
 </script>
diff --git a/admin/views/class_property/view.html.php b/admin/views/class_property/view.html.php
index 7e6685019..028dd240d 100644
--- a/admin/views/class_property/view.html.php
+++ b/admin/views/class_property/view.html.php
@@ -187,9 +187,24 @@ class ComponentbuilderViewClass_property extends JViewLegacy
 			$this->document = JFactory::getDocument();
 		}
 		$this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_CLASS_PROPERTY_NEW' : 'COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT'));
-		$this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_property.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
+		$this->document->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'); 
+		$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/joomla_plugin/tmpl/edit.php b/admin/views/joomla_plugin/tmpl/edit.php
index efed6df68..17dd589a6 100644
--- a/admin/views/joomla_plugin/tmpl/edit.php
+++ b/admin/views/joomla_plugin/tmpl/edit.php
@@ -220,5 +220,18 @@ function JRouter(link) {
 	}
 ?>
 	return url+link;
-}
+}
+
+// nice little dot trick :)
+jQuery(document).ready( function($) {
+  var x=0;
+  setInterval(function() {
+	var dots = "";
+	x++;
+	for (var y=0; y < x%8; y++) {
+		dots+=".";
+	}
+	$(".loading-dots").text(dots);
+  } , 500);
+});
 </script>
diff --git a/admin/views/joomla_plugins/view.html.php b/admin/views/joomla_plugins/view.html.php
index ddf8a599f..03adcfa78 100644
--- a/admin/views/joomla_plugins/view.html.php
+++ b/admin/views/joomla_plugins/view.html.php
@@ -144,6 +144,16 @@ class ComponentbuilderViewJoomla_plugins extends JViewLegacy
 			// 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);
+		}
 
 		if ($this->canDo->get('core.import') && $this->canDo->get('joomla_plugin.import'))
 		{
diff --git a/componentbuilder.xml b/componentbuilder.xml
index c05ade941..8cbec8119 100644
--- a/componentbuilder.xml
+++ b/componentbuilder.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <extension type="component" version="3.2" method="upgrade">
 	<name>COM_COMPONENTBUILDER</name>
-	<creationDate>15th July, 2019</creationDate>
+	<creationDate>16th July, 2019</creationDate>
 	<author>Llewellyn van der Merwe</author>
 	<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
 	<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>