diff --git a/README.md b/README.md index c61f1f52b..0816c1a23 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.11) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.14) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -143,13 +143,13 @@ 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*: 31st August, 2021 -+ *Version*: 2.12.11 ++ *Last Build*: 18th October, 2021 ++ *Version*: 2.12.14 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **292284** -+ *Field count*: **1630** -+ *File count*: **1936** ++ *Line count*: **293253** ++ *Field count*: **1654** ++ *File count*: **1937** + *Folder count*: **322** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index c61f1f52b..0816c1a23 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.11) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.12.14) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -143,13 +143,13 @@ 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*: 31st August, 2021 -+ *Version*: 2.12.11 ++ *Last Build*: 18th October, 2021 ++ *Version*: 2.12.14 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **292284** -+ *Field count*: **1630** -+ *File count*: **1936** ++ *Line count*: **293253** ++ *Field count*: **1654** ++ *File count*: **1937** + *Folder count*: **322** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/compiler/joomla_3/Helper_email.php b/admin/compiler/joomla_3/Helper_email.php index 0cab1b295..309817cac 100644 --- a/admin/compiler/joomla_3/Helper_email.php +++ b/admin/compiler/joomla_3/Helper_email.php @@ -14,6 +14,9 @@ defined('_JEXEC') or die('Restricted access'); ?> ###BOM### +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + /** * ###Component### component email helper */ diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index c6fbccf9b..692f4c61b 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -423,9 +423,10 @@ class ComponentbuilderControllerAjax extends JControllerLegacy { $idValue = $jinput->get('id', NULL, 'INT'); $typeValue = $jinput->get('type', NULL, 'WORD'); + $keyValue = $jinput->get('key', 1, 'INT'); if($idValue && $user->id != 0 && $typeValue) { - $result = $this->getModel('ajax')->getClassCodeIds($idValue, $typeValue); + $result = $this->getModel('ajax')->getClassCodeIds($idValue, $typeValue, $keyValue); } else { diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 24821dd50..062ece59d 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -690,6 +690,39 @@ class Compiler extends Infusion File::delete($update_server_xml_path); } } + // move the modules update server to host + if (ComponentbuilderHelper::checkArray($this->joomlaModules)) + { + foreach ($this->joomlaModules as $module) + { + if (ComponentbuilderHelper::checkObject($module) + && isset($module->add_update_server) + && $module->add_update_server == 1 + && isset($module->update_server_target) + && $module->update_server_target == 1 + && isset($module->update_server) + && is_numeric($module->update_server) + && $module->update_server > 0 + && isset($module->update_server_xml_path) + && File::exists($module->update_server_xml_path) + && isset($module->update_server_xml_file_name) + && ComponentbuilderHelper::checkString( + $module->update_server_xml_file_name + )) + { + // move to server + ComponentbuilderHelper::moveToServer( + $module->update_server_xml_path, + $module->update_server_xml_file_name, + (int) $module->update_server, + $module->update_server_protocol + ); + // remove the local file + File::delete($module->update_server_xml_path); + } + // var_dump($module->update_server_xml_path);exit; + } + } // move the plugins update server to host if (ComponentbuilderHelper::checkArray($this->joomlaPlugins)) { @@ -724,7 +757,7 @@ class Compiler extends Infusion } } - // link canges made to views into the file license + // link changes made to views into the file license protected function fixLicenseValues($data) { // check if these files have its own config data) diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 0f08ac0ce..464d04a09 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -1,5 +1,5 @@ {$server} = 0; - // only change this for sales server (update server can be added loacaly to the zip file) + // only change this for sales server (update server can be added locally to the zip file) if ('sales_server' === $server) { $plugin->{'add_' . $server} = 0; diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 91e9f01dd..d18f167ff 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -78,6 +78,11 @@ abstract class ComponentbuilderHelper **/ protected static $localCompany = array(); + /** + * The excluded powers + **/ + protected static $exPowers= array(); + /** * The snippet paths **/ @@ -1968,6 +1973,39 @@ abstract class ComponentbuilderHelper } return false; } + + /** + * Powers to exclude + **/ + public static function excludePowers($id) + { + // first check if this power set is already found + if (!isset(self::$exPowers[$id])) + { + // Get a db connection. + $db = JFactory::getDbo(); + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id'))); + $query->from($db->quoteName('#__componentbuilder_power', 'a')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_power', 'b') . ' ON (' . $db->quoteName('a.name') . ' = ' . $db->quoteName('b.name') . ' AND ' . $db->quoteName('a.namespace') . ' = ' . $db->quoteName('b.namespace') . ')'); + $query->where($db->quoteName('b.id') . ' = ' . (int) $id); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + self::$exPowers[$id] = $db->loadColumn(); + } + // all ways add itself aswell + self::$exPowers[$id][] = $id; + } + // if found return + if (isset(self::$exPowers[$id])) + { + return self::$exPowers[$id]; + } + return false; + } /** * The array of dynamic content @@ -2606,7 +2644,7 @@ abstract class ComponentbuilderHelper $field['values'] .= PHP_EOL . "/>"; $field['values_description'] .= ''; // load the database defaults if set and wanted - if ($db_defaults && isset($result->has_defaults) && $result->has_defaults == 1) + if ($dbDefaults && isset($result->has_defaults) && $result->has_defaults == 1) { $field['database'] = array( 'datatype' => $result->datatype, @@ -6716,6 +6754,75 @@ abstract class ComponentbuilderHelper } return false; } + + + /** + * Check if a row already exist + * + * @param string $table The table from which to get the variable + * @param array $where The value where + * @param string $main The component in which the table is found + * + * @return int the id, or false + * + */ + public static function checkExist($table, $where, $what = 'id', $operator = '=', $main = 'componentbuilder') + { + // Get a db connection. + $db = JFactory::getDbo(); + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array($what))); + if (empty($table)) + { + $query->from($db->quoteName('#__'.$main)); + } + else + { + $query->from($db->quoteName('#__'.$main.'_'.$table)); + } + if (self::checkArray($where)) + { + foreach ($where as $key => $value) + { + if (is_numeric($value)) + { + if (is_float($value + 0)) + { + $query->where($db->quoteName($key) . ' ' . $operator . ' ' . (float) $value); + } + else + { + $query->where($db->quoteName($key) . ' ' . $operator . ' ' . (int) $value); + } + } + elseif (is_bool($value)) + { + $query->where($db->quoteName($key) . ' ' . $operator . ' ' . (bool) $value); + } + // we do not allow arrays at this point + elseif (!self::checkArray($value)) + { + $query->where($db->quoteName($key) . ' ' . $operator . ' ' . $db->quote( (string) $value)); + } + else + { + return false; + } + } + } + else + { + return false; + } + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + return $db->loadResult(); + } + return false; + } /** diff --git a/admin/helpers/componentbuilderemail.php b/admin/helpers/componentbuilderemail.php index 78d12e9bc..66889886e 100644 --- a/admin/helpers/componentbuilderemail.php +++ b/admin/helpers/componentbuilderemail.php @@ -9,6 +9,9 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + /** * Componentbuilder component email helper */ diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index a10d04495..0031efab6 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -4226,6 +4226,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_PLACEHOLDERS_EXPLAINED_DESCRIPTION="
+ @@ -6824,13 +6825,13 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_JOOMLA_PLUGIN_GROUP_LABEL="Joomla Plugin Grou COM_COMPONENTBUILDER_JOOMLA_PLUGIN_LABEL_DESCRIPTION="Not mandatory, used to Label the Fieldset" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_LABEL_HINT="Name" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_LABEL_LABEL="Label" -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_MAIN_CLASS_CODE_DESCRIPTION="Add the properties & methods here." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MAIN_CLASS_CODE_LABEL="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_DESCRIPTION="Select methods you want to use in your plugin class." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION_DESCRIPTION="Select methods you want to use in your joomla_plugin." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_METHOD_SELECTION_LABEL="Method Selection" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MODIFIED_BY_DESC="The last user that modified this Joomla Plugin." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_MODIFIED_BY_LABEL="Modified By" @@ -6882,7 +6883,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTIES_BUTTON_ACCESS="Joomla Plugin Prope 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_DESCRIPTION="Select properties you want to use in your plugin class." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION_DESCRIPTION="Select properties you want to use in your joomla_plugin." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PROPERTY_SELECTION_LABEL="Property Selection" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_PUBLISHING="Publishing" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_README="Readme" @@ -7791,6 +7792,7 @@ COM_COMPONENTBUILDER_PLACEHOLDER_NOTE_PLACEHOLDERS_PLACEDIN_DESCRIPTION=" + diff --git a/admin/models/ajax.php b/admin/models/ajax.php index c2d132383..f25dc6881 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -317,11 +317,19 @@ class ComponentbuilderModelAjax extends JModelList return ComponentbuilderHelper::getClassCode($id, $type); } - public function getClassCodeIds($id, $type) + public function getClassCodeIds($id, $type, $key) { if ('property' === $type || 'method' === $type) { - return ComponentbuilderHelper::getVars('class_' . $type, $id, 'joomla_plugin_group', 'id'); + // we get the plugin group, or the powers + if ($key == 1) + { + return ComponentbuilderHelper::getVars('class_' . $type, $id, 'joomla_plugin_group', 'id'); + } + elseif ($key == 2) + { + return ComponentbuilderHelper::getVars('class_' . $type, 'powers', 'extension_type', 'id'); + } } elseif ('joomla_plugin_group' === $type) { @@ -2659,6 +2667,13 @@ class ComponentbuilderModelAjax extends JModelList 'views' => 'class_methods', 'not_base64' => array(), 'name' => 'name' + ), + // #__componentbuilder_power (v) + 'class_method' => array( + 'search' => array('id', 'name', 'description', 'head', 'head', 'main_class_code'), + 'views' => 'powers', + 'not_base64' => array('description'), + 'name' => 'name' ) ); diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index 557bddd30..02e54887b 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -2073,6 +2073,13 @@ class ComponentbuilderModelJoomla_components extends JModelList 'views' => 'class_methods', 'not_base64' => array(), 'name' => 'name' + ), + // #__componentbuilder_power (v) + 'class_method' => array( + 'search' => array('id', 'name', 'description', 'head', 'head', 'main_class_code'), + 'views' => 'powers', + 'not_base64' => array('description'), + 'name' => 'name' ) ); diff --git a/admin/models/language_translations.php b/admin/models/language_translations.php index 6e22b378f..ee12e3f84 100644 --- a/admin/models/language_translations.php +++ b/admin/models/language_translations.php @@ -387,7 +387,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList else { $search = $db->quote('%' . $db->escape($search) . '%'); - $query->where('(a.source LIKE '.$search.')'); + $query->where('(a.source LIKE '.$search.' OR a.translation LIKE '.$search.')'); } } diff --git a/componentbuilder.xml b/componentbuilder.xml index 5c244e2e3..49e86422a 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index 4ffc5cb8d..e11cea060 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -1041,10 +1041,10 @@
Upgrade to Version 2.12.11 Was Successful! Let us know if anything is not working as expected.
';
+ Upgrade to Version 2.12.14 Was Successful! Let us know if anything is not working as expected.
';
// Set db if not set already.
if (!isset($db))
diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php
index cd1e9e2fd..521ca8485 100644
--- a/site/helpers/componentbuilder.php
+++ b/site/helpers/componentbuilder.php
@@ -75,6 +75,11 @@ abstract class ComponentbuilderHelper
**/
protected static $localCompany = array();
+ /**
+ * The excluded powers
+ **/
+ protected static $exPowers= array();
+
/**
* The snippet paths
**/
@@ -1965,6 +1970,39 @@ abstract class ComponentbuilderHelper
}
return false;
}
+
+ /**
+ * Powers to exclude
+ **/
+ public static function excludePowers($id)
+ {
+ // first check if this power set is already found
+ if (!isset(self::$exPowers[$id]))
+ {
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('a.id')));
+ $query->from($db->quoteName('#__componentbuilder_power', 'a'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_power', 'b') . ' ON (' . $db->quoteName('a.name') . ' = ' . $db->quoteName('b.name') . ' AND ' . $db->quoteName('a.namespace') . ' = ' . $db->quoteName('b.namespace') . ')');
+ $query->where($db->quoteName('b.id') . ' = ' . (int) $id);
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ self::$exPowers[$id] = $db->loadColumn();
+ }
+ // all ways add itself aswell
+ self::$exPowers[$id][] = $id;
+ }
+ // if found return
+ if (isset(self::$exPowers[$id]))
+ {
+ return self::$exPowers[$id];
+ }
+ return false;
+ }
/**
* The array of dynamic content
@@ -2603,7 +2641,7 @@ abstract class ComponentbuilderHelper
$field['values'] .= PHP_EOL . "/>";
$field['values_description'] .= '';
// load the database defaults if set and wanted
- if ($db_defaults && isset($result->has_defaults) && $result->has_defaults == 1)
+ if ($dbDefaults && isset($result->has_defaults) && $result->has_defaults == 1)
{
$field['database'] = array(
'datatype' => $result->datatype,
@@ -6713,6 +6751,75 @@ abstract class ComponentbuilderHelper
}
return false;
}
+
+
+ /**
+ * Check if a row already exist
+ *
+ * @param string $table The table from which to get the variable
+ * @param array $where The value where
+ * @param string $main The component in which the table is found
+ *
+ * @return int the id, or false
+ *
+ */
+ public static function checkExist($table, $where, $what = 'id', $operator = '=', $main = 'componentbuilder')
+ {
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array($what)));
+ if (empty($table))
+ {
+ $query->from($db->quoteName('#__'.$main));
+ }
+ else
+ {
+ $query->from($db->quoteName('#__'.$main.'_'.$table));
+ }
+ if (self::checkArray($where))
+ {
+ foreach ($where as $key => $value)
+ {
+ if (is_numeric($value))
+ {
+ if (is_float($value + 0))
+ {
+ $query->where($db->quoteName($key) . ' ' . $operator . ' ' . (float) $value);
+ }
+ else
+ {
+ $query->where($db->quoteName($key) . ' ' . $operator . ' ' . (int) $value);
+ }
+ }
+ elseif (is_bool($value))
+ {
+ $query->where($db->quoteName($key) . ' ' . $operator . ' ' . (bool) $value);
+ }
+ // we do not allow arrays at this point
+ elseif (!self::checkArray($value))
+ {
+ $query->where($db->quoteName($key) . ' ' . $operator . ' ' . $db->quote( (string) $value));
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ return false;
+ }
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ return $db->loadResult();
+ }
+ return false;
+ }
/**