Added search by translated string to the translation area.

This commit is contained in:
Llewellyn van der Merwe 2021-10-18 22:12:19 +02:00
parent 5651d3dca8
commit ab471e3ccb
Signed by untrusted user: Llewellyn
GPG Key ID: EFC0C720A240551C
18 changed files with 313 additions and 35 deletions

View File

@ -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).

View File

@ -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).

View File

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

View File

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

View File

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

View File

@ -10104,7 +10104,7 @@ class Get
else
{
$plugin->{$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;

View File

@ -78,6 +78,11 @@ abstract class ComponentbuilderHelper
**/
protected static $localCompany = array();
/**
* The excluded powers
**/
protected static $exPowers= array();
/**
* The snippet paths
**/
@ -1969,6 +1974,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'] .= '</tbody></table>';
// 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,
@ -6718,6 +6756,75 @@ abstract class ComponentbuilderHelper
}
/**
* 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;
}
/**
* Load the Composer Vendors
*/

View File

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

View File

@ -4226,6 +4226,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_PLACEHOLDERS_EXPLAINED_DESCRIPTION="<div c
<div id='usedin-s' style='display:none;'><h2>Class Extends</h2><div id='area-s'></div></div>
<div id='usedin-t' style='display:none;'><h2>Class Property</h2><div id='area-t'></div></div>
<div id='usedin-u' style='display:none;'><h2>Class Method</h2><div id='area-u'></div></div>
<div id='usedin-v' style='display:none;'><h2>Power</h2><div id='area-v'></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>
@ -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="<div cl
<div id='placedin-s' style='display:none;'><h2>Class Extends</h2><div id='area-s'></div></div>
<div id='placedin-t' style='display:none;'><h2>Class Property</h2><div id='area-t'></div></div>
<div id='placedin-u' style='display:none;'><h2>Class Method</h2><div id='area-u'></div></div>
<div id='placedin-v' style='display:none;'><h2>Power</h2><div id='area-v'></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>

View File

@ -317,12 +317,20 @@ 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)
{
// 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)
{
return ComponentbuilderHelper::getVars($type, $id, 'class_extends', 'id');
@ -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'
)
);

View File

@ -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'
)
);

View File

@ -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.')');
}
}

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>31st August, 2021</creationDate>
<creationDate>18th October, 2021</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>2.12.11</version>
<version>2.12.14</version>
<description><![CDATA[
<h1>Component Builder (v.2.12.11)</h1>
<h1>Component Builder (v.2.12.14)</h1>
<div style="clear: both;"></div>
<p>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.

View File

@ -1041,10 +1041,10 @@
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.12.11</version>
<version>2.12.14</version>
<infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.12.14/JCB_v2.12.14.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>

View File

@ -328,8 +328,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','q','r','s','t','u']; // if you update this, also update (below 20) & [customcode-codeUsedInHtmlNote]!
var targetNumber = 20;
var targets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v']; // if you update this, also update (below 21) & [customcode-codeUsedInHtmlNote]!
var targetNumber = 21;
var run = 0;
var usedinChecker = setInterval(function(){
var target = targets[run];

View File

@ -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','q','r','s','t','u']; // if you update this, also update (below 20) & [customcode-codeUsedInHtmlNote]!
var targetNumber = 20;
var targets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v']; // if you update this, also update (below 21) & [customcode-codeUsedInHtmlNote]!
var targetNumber = 21;
var run = 0;
var placedinChecker = setInterval(function(){
var target = targets[run];

View File

@ -9252,7 +9252,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://www.joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.12.11 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.12.14 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))

View File

@ -75,6 +75,11 @@ abstract class ComponentbuilderHelper
**/
protected static $localCompany = array();
/**
* The excluded powers
**/
protected static $exPowers= array();
/**
* The snippet paths
**/
@ -1966,6 +1971,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'] .= '</tbody></table>';
// 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,
@ -6715,6 +6753,75 @@ abstract class ComponentbuilderHelper
}
/**
* 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;
}
/**
* Load the Composer Vendors
*/