Added option to include or exclude Joomla Plugins from being compiled or exported. Added the Joomla\Utilities\ArrayHelper to helper class header. Added option to only export words if required global option fields are set. Added option to use strict field access on all exports if required global option fields are set. Fixed gh-475 by adding the option to add a github token if needed under the global options global tab, also updated the error message.
This commit is contained in:
@ -114,7 +114,7 @@ class ComponentbuilderModelAdmin_views extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -376,7 +376,7 @@ class ComponentbuilderModelAdmin_views extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelAdmins_fields extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -3212,13 +3212,14 @@ class ComponentbuilderModelAjax extends JModelList
|
||||
{
|
||||
// secure path
|
||||
$path = ComponentbuilderHelper::safeString(str_replace('.json','',$path), 'filename', '', false).'.json';
|
||||
// base path
|
||||
$base_path = basename($path);
|
||||
// set url
|
||||
$url = ComponentbuilderHelper::$snippetPath.rawurlencode(basename($path));
|
||||
$url = ComponentbuilderHelper::$snippetPath.rawurlencode($base_path);
|
||||
// get the snippets
|
||||
$snippet = ComponentbuilderHelper::getFileContents($url);
|
||||
if (ComponentbuilderHelper::checkJson($snippet))
|
||||
if (($snippet = ComponentbuilderHelper::getGithubRepoData('lib_snippet_' . $base_path, $url)) !== false)
|
||||
{
|
||||
return $this->saveSnippet(json_decode($snippet, true), $status, $user);
|
||||
return $this->saveSnippet($snippet, $status, $user);
|
||||
}
|
||||
return array('message' => JText::_('COM_COMPONENTBUILDER_ERROR_THE_PATH_HAS_A_MISMATCH_AND_COULD_THEREFORE_NOT_RETRIEVE_THE_SNIPPET_FROM_GITHUB'), 'status' => 'danger');
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ class ComponentbuilderModelClass_extendings extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -94,7 +94,7 @@ class ComponentbuilderModelClass_methods extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -303,7 +303,7 @@ class ComponentbuilderModelClass_methods extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -94,7 +94,7 @@ class ComponentbuilderModelClass_properties extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -303,7 +303,7 @@ class ComponentbuilderModelClass_properties extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_admin_views extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_config extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_dashboard extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_files_folders extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_placeholders extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_plugins extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_site_views extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelComponents_updates extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -106,7 +106,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -317,7 +317,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -102,7 +102,7 @@ class ComponentbuilderModelCustom_codes extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -350,7 +350,7 @@ class ComponentbuilderModelCustom_codes extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -94,7 +94,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -300,7 +300,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -118,7 +118,7 @@ class ComponentbuilderModelFields extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -415,7 +415,7 @@ class ComponentbuilderModelFields extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -264,7 +264,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -102,7 +102,7 @@ class ComponentbuilderModelFieldtypes extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -269,7 +269,7 @@ class ComponentbuilderModelFieldtypes extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -120,6 +120,23 @@
|
||||
default="0"
|
||||
button="false"
|
||||
/>
|
||||
<!-- Target Field. Type: List. (joomla) -->
|
||||
<field
|
||||
type="list"
|
||||
name="target"
|
||||
label="COM_COMPONENTBUILDER_COMPONENT_PLUGINS_TARGET_LABEL"
|
||||
description="COM_COMPONENTBUILDER_COMPONENT_PLUGINS_TARGET_DESCRIPTION"
|
||||
class="list_class"
|
||||
multiple="false"
|
||||
default="0">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_COMPONENT_PLUGINS_COMPILE_ONLY</option>
|
||||
<option value="2">
|
||||
COM_COMPONENTBUILDER_COMPONENT_PLUGINS_EXPORT_ONLY</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_COMPONENT_PLUGINS_COMPILE_AMP_EXPORT</option>
|
||||
</field>
|
||||
</form>
|
||||
</field>
|
||||
<!-- Note_on_joomla_plugins Field. Type: Note. A None Database Field. (joomla) -->
|
||||
|
@ -102,7 +102,7 @@ class ComponentbuilderModelHelp_documents extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -306,7 +306,7 @@ class ComponentbuilderModelHelp_documents extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -2032,7 +2032,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -2190,7 +2190,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
||||
// Get the encryption object.
|
||||
$basic = new FOFEncryptAes($basickey);
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -45,28 +45,23 @@ class ComponentbuilderModelJoomla_plugins extends JModelList
|
||||
public function getBoilerplate()
|
||||
{
|
||||
// get boilerplate repo root details
|
||||
if (($result = ComponentbuilderHelper::getFileContents(ComponentbuilderHelper::$bolerplateAPI)) !== false && ComponentbuilderHelper::checkJson($result))
|
||||
if (($repo_tree = ComponentbuilderHelper::getGithubRepoFileList('boilerplate', ComponentbuilderHelper::$bolerplateAPI)) !== false)
|
||||
{
|
||||
$result = json_decode($result);
|
||||
// check if we have a three
|
||||
if (isset($result->tree) && ComponentbuilderHelper::checkArray($result->tree))
|
||||
{
|
||||
$found = array_values(array_filter(
|
||||
$result->tree,
|
||||
function($tree) {
|
||||
if (isset($tree->path) && $tree->path === 'plugins')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
$found = array_values(array_filter(
|
||||
$repo_tree,
|
||||
function($tree) {
|
||||
if (isset($tree->path) && $tree->path === 'plugins')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
));
|
||||
// make sure we have the correct boilerplate
|
||||
if (ComponentbuilderHelper::checkArray($found) && count($found) == 1 && method_exists(__CLASS__, 'getPluginsBoilerplate'))
|
||||
{
|
||||
// get the plugins boilerplate
|
||||
return $this->getPluginsBoilerplate($found[0]->url);
|
||||
return false;
|
||||
}
|
||||
));
|
||||
// make sure we have the correct boilerplate
|
||||
if (ComponentbuilderHelper::checkArray($found) && count($found) == 1 && method_exists(__CLASS__, 'getPluginsBoilerplate'))
|
||||
{
|
||||
// get the plugins boilerplate
|
||||
return $this->getPluginsBoilerplate($found[0]->url);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -81,85 +76,80 @@ class ComponentbuilderModelJoomla_plugins extends JModelList
|
||||
protected function getPluginsBoilerplate($url)
|
||||
{
|
||||
// get boilerplate root for plugins
|
||||
if (($result = ComponentbuilderHelper::getFileContents($url)) !== false && ComponentbuilderHelper::checkJson($result))
|
||||
if (($plugin_tree = ComponentbuilderHelper::getGithubRepoFileList('boilerplate_plugins', $url)) !== false)
|
||||
{
|
||||
$result = json_decode($result);
|
||||
// check if we have a tree
|
||||
if (isset($result->tree) && ComponentbuilderHelper::checkArray($result->tree))
|
||||
{
|
||||
// get the app object
|
||||
$app = JFactory::getApplication();
|
||||
// set the table names
|
||||
$tables = array();
|
||||
$tables['e'] = 'class_extends';
|
||||
$tables['g'] = 'joomla_plugin_group';
|
||||
$tables['m'] = 'class_method';
|
||||
$tables['p'] = 'class_property';
|
||||
// load the needed models
|
||||
$models = array();
|
||||
$models['e'] = ComponentbuilderHelper::getModel($tables['e']);
|
||||
$models['g'] = ComponentbuilderHelper::getModel($tables['g']);
|
||||
$models['p'] = ComponentbuilderHelper::getModel($tables['p']);
|
||||
$models['m'] = ComponentbuilderHelper::getModel($tables['m']);
|
||||
// get the needed data of each plugin group
|
||||
$groups = array_map(
|
||||
function($tree) use(&$app, &$models, &$tables){
|
||||
if (($fooClass = ComponentbuilderHelper::getFileContents(ComponentbuilderHelper::$bolerplatePath . '/plugins/' . $tree->path . '/foo.php')) !== false && ComponentbuilderHelper::checkString($fooClass))
|
||||
// get the app object
|
||||
$app = JFactory::getApplication();
|
||||
// set the table names
|
||||
$tables = array();
|
||||
$tables['e'] = 'class_extends';
|
||||
$tables['g'] = 'joomla_plugin_group';
|
||||
$tables['m'] = 'class_method';
|
||||
$tables['p'] = 'class_property';
|
||||
// load the needed models
|
||||
$models = array();
|
||||
$models['e'] = ComponentbuilderHelper::getModel($tables['e']);
|
||||
$models['g'] = ComponentbuilderHelper::getModel($tables['g']);
|
||||
$models['p'] = ComponentbuilderHelper::getModel($tables['p']);
|
||||
$models['m'] = ComponentbuilderHelper::getModel($tables['m']);
|
||||
// get the needed data of each plugin group
|
||||
$groups = array_map(
|
||||
function($tree) use(&$app, &$models, &$tables){
|
||||
if (($fooClass = ComponentbuilderHelper::getFileContents(ComponentbuilderHelper::$bolerplatePath . '/plugins/' . $tree->path . '/foo.php')) !== false && ComponentbuilderHelper::checkString($fooClass))
|
||||
{
|
||||
// extract the boilerplate class extends and check if already set
|
||||
if (($classExtends = ComponentbuilderHelper::extractBoilerplateClassExtends($fooClass, 'plugins')) !== false &&
|
||||
($classExtendsID = ComponentbuilderHelper::getVar('class_extends', $classExtends, 'name', 'id')) === false)
|
||||
{
|
||||
// extract the boilerplate class extends and check if already set
|
||||
if (($classExtends = ComponentbuilderHelper::extractBoilerplateClassExtends($fooClass, 'plugins')) !== false &&
|
||||
($classExtendsID = ComponentbuilderHelper::getVar('class_extends', $classExtends, 'name', 'id')) === false)
|
||||
// load the extends class name
|
||||
$class = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $classExtends);
|
||||
// extract the boilerplate class header
|
||||
$class['head'] = ComponentbuilderHelper::extractBoilerplateClassHeader($fooClass, $classExtends, 'plugins');
|
||||
// extract the boilerplate class comment
|
||||
$class['comment'] = ComponentbuilderHelper::extractBoilerplateClassComment($fooClass, $classExtends, 'plugins');
|
||||
// set the extension type
|
||||
$class['extension_type'] = 'plugins';
|
||||
// store the class
|
||||
$this->storePluginBoilerplate($tables['e'], $models['e'], $class, $app);
|
||||
// work around
|
||||
$classExtendsID = ComponentbuilderHelper::getVar('class_extends', $classExtends, 'name', 'id');
|
||||
}
|
||||
// set plugin group if not already set
|
||||
if (($pluginGroupID = ComponentbuilderHelper::getVar('joomla_plugin_group', $tree->path, 'name', 'id')) === false)
|
||||
{
|
||||
// load the plugin group name
|
||||
$pluginGroup = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $tree->path, 'class_extends' => $classExtendsID);
|
||||
// store the group
|
||||
$this->storePluginBoilerplate($tables['g'], $models['g'], $pluginGroup, $app);
|
||||
// work around
|
||||
$pluginGroupID = ComponentbuilderHelper::getVar('joomla_plugin_group', $tree->path, 'name', 'id');
|
||||
}
|
||||
// extract the boilerplate class property and methods
|
||||
if (($classProperiesMethods = ComponentbuilderHelper::extractBoilerplateClassPropertiesMethods($fooClass, $classExtends, 'plugins', $pluginGroupID)) !== false)
|
||||
{
|
||||
// create the properties found
|
||||
if (isset($classProperiesMethods['property']) && ComponentbuilderHelper::checkArray($classProperiesMethods['property']))
|
||||
{
|
||||
// load the extends class name
|
||||
$class = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $classExtends);
|
||||
// extract the boilerplate class header
|
||||
$class['head'] = ComponentbuilderHelper::extractBoilerplateClassHeader($fooClass, $classExtends, 'plugins');
|
||||
// extract the boilerplate class comment
|
||||
$class['comment'] = ComponentbuilderHelper::extractBoilerplateClassComment($fooClass, $classExtends, 'plugins');
|
||||
// set the extension type
|
||||
$class['extension_type'] = 'plugins';
|
||||
// store the class
|
||||
$this->storePluginBoilerplate($tables['e'], $models['e'], $class, $app);
|
||||
// work around
|
||||
$classExtendsID = ComponentbuilderHelper::getVar('class_extends', $classExtends, 'name', 'id');
|
||||
}
|
||||
// set plugin group if not already set
|
||||
if (($pluginGroupID = ComponentbuilderHelper::getVar('joomla_plugin_group', $tree->path, 'name', 'id')) === false)
|
||||
{
|
||||
// load the plugin group name
|
||||
$pluginGroup = array('id' => 0, 'published' => 1, 'version' => 1, 'name' => $tree->path, 'class_extends' => $classExtendsID);
|
||||
// store the group
|
||||
$this->storePluginBoilerplate($tables['g'], $models['g'], $pluginGroup, $app);
|
||||
// work around
|
||||
$pluginGroupID = ComponentbuilderHelper::getVar('joomla_plugin_group', $tree->path, 'name', 'id');
|
||||
}
|
||||
// extract the boilerplate class property and methods
|
||||
if (($classProperiesMethods = ComponentbuilderHelper::extractBoilerplateClassPropertiesMethods($fooClass, $classExtends, 'plugins', $pluginGroupID)) !== false)
|
||||
{
|
||||
// create the properties found
|
||||
if (isset($classProperiesMethods['property']) && ComponentbuilderHelper::checkArray($classProperiesMethods['property']))
|
||||
foreach ($classProperiesMethods['property'] as $_property)
|
||||
{
|
||||
foreach ($classProperiesMethods['property'] as $_property)
|
||||
{
|
||||
// force update by default
|
||||
$this->storePluginBoilerplate($tables['p'], $models['p'], $_property, $app);
|
||||
}
|
||||
// force update by default
|
||||
$this->storePluginBoilerplate($tables['p'], $models['p'], $_property, $app);
|
||||
}
|
||||
// create the method found (TODO just create for now but we could later add a force update)
|
||||
if (isset($classProperiesMethods['method']) && ComponentbuilderHelper::checkArray($classProperiesMethods['method']))
|
||||
}
|
||||
// create the method found (TODO just create for now but we could later add a force update)
|
||||
if (isset($classProperiesMethods['method']) && ComponentbuilderHelper::checkArray($classProperiesMethods['method']))
|
||||
{
|
||||
foreach ($classProperiesMethods['method'] as $_method)
|
||||
{
|
||||
foreach ($classProperiesMethods['method'] as $_method)
|
||||
{
|
||||
// force update by default
|
||||
$this->storePluginBoilerplate($tables['m'], $models['m'], $_method, $app);
|
||||
}
|
||||
// force update by default
|
||||
$this->storePluginBoilerplate($tables['m'], $models['m'], $_method, $app);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
$result->tree
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
$plugin_tree
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -214,6 +204,7 @@ class ComponentbuilderModelJoomla_plugins extends JModelList
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to auto-populate the model state.
|
||||
@ -273,7 +264,7 @@ class ComponentbuilderModelJoomla_plugins extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelJoomla_plugins_updates extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -86,7 +86,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -318,7 +318,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -213,7 +213,7 @@ class ComponentbuilderModelLanguages extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -356,7 +356,7 @@ class ComponentbuilderModelLanguages extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -98,7 +98,7 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -289,7 +289,7 @@ class ComponentbuilderModelLayouts extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -98,7 +98,7 @@ class ComponentbuilderModelLibraries extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelLibraries_config extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -84,7 +84,7 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -90,7 +90,7 @@ class ComponentbuilderModelPlaceholders extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -235,7 +235,7 @@ class ComponentbuilderModelPlaceholders extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -244,7 +244,7 @@ class ComponentbuilderModelServer extends JModelAdmin
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -90,7 +90,7 @@ class ComponentbuilderModelServers extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -283,7 +283,7 @@ class ComponentbuilderModelServers extends JModelList
|
||||
// Get the encryption object.
|
||||
$basic = new FOFEncryptAes($basickey);
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -110,7 +110,7 @@ class ComponentbuilderModelSite_views extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -321,7 +321,7 @@ class ComponentbuilderModelSite_views extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -90,7 +90,7 @@ class ComponentbuilderModelSnippet_types extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
|
@ -216,7 +216,7 @@ class ComponentbuilderModelSnippets extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -377,7 +377,7 @@ class ComponentbuilderModelSnippets extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -98,7 +98,7 @@ class ComponentbuilderModelTemplates extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -289,7 +289,7 @@ class ComponentbuilderModelTemplates extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
@ -90,7 +90,7 @@ class ComponentbuilderModelValidation_rules extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
@ -233,7 +233,7 @@ class ComponentbuilderModelValidation_rules extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
|
Reference in New Issue
Block a user