Skip to content
Permalink
Browse files

Added more dynamic behavior to the new plugin area. Added a funding y…

…ml file.
  • Loading branch information...
Llewellynvdm committed Jul 16, 2019
1 parent eae0750 commit 8d2af8365bfeea52ea79477f8e42f3af2dc731e4
@@ -0,0 +1,4 @@
# These are supported funding model platforms

# soon :) github: [Llewellynvdm]
open_collective: Joomla-Component-Builder
@@ -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**

@@ -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**

@@ -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" />
@@ -179,4 +179,21 @@ public function getBoilerplate()
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;
}
}
@@ -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"
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)"
<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>
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."
@@ -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"
@@ -26,7 +26,8 @@
// 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();
@@ -2402,6 +2402,34 @@ protected function searchOpenBase64(&$value, &$target)
'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'
)
);
@@ -70,7 +70,19 @@ public function getTable($type = 'class_extends', $prefix = 'ComponentbuilderTab
$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 @@ public function getItem($pk = null)
{
// 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))
@@ -73,7 +73,19 @@ public function getTable($type = 'class_method', $prefix = 'ComponentbuilderTabl
$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 @@ public function getItem($pk = null)
{
// 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))
@@ -70,7 +70,19 @@ public function getTable($type = 'class_property', $prefix = 'ComponentbuilderTa
$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 @@ public function getItem($pk = null)
{
// 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))
@@ -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;
}

0 comments on commit 8d2af83

Please sign in to comment.
You can’t perform that action at this time.