added the option to remove or add a custom prefix to the Joomla admin menu name of your component @cpaschen

This commit is contained in:
Llewellyn van der Merwe 2018-05-03 02:26:52 +02:00
parent f200e635b8
commit 8b8b42ae8f
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
8 changed files with 67 additions and 19 deletions

View File

@ -126,12 +126,12 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 2nd May, 2018 + *Last Build*: 3rd May, 2018
+ *Version*: 2.7.7 + *Version*: 2.7.7
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **193602** + *Line count*: **193640**
+ *Field count*: **1027** + *Field count*: **1030**
+ *File count*: **1201** + *File count*: **1201**
+ *Folder count*: **193** + *Folder count*: **193**

View File

@ -126,12 +126,12 @@ Component Builder is mapped as a component in itself on my local development env
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](http://joomlacomponentbuilder.com) + *Name*: [Component Builder](http://joomlacomponentbuilder.com)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 2nd May, 2018 + *Last Build*: 3rd May, 2018
+ *Version*: 2.7.7 + *Version*: 2.7.7
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+ *Line count*: **193602** + *Line count*: **193640**
+ *Field count*: **1027** + *Field count*: **1030**
+ *File count*: **1201** + *File count*: **1201**
+ *Folder count*: **193** + *Folder count*: **193**

View File

@ -47,6 +47,38 @@
/> />
<field type="spacer" name="spacerHistory" hr="true" /> <field type="spacer" name="spacerHistory" hr="true" />
<!-- Add_menu_prefix Field. Type: Radio. (joomla) -->
<field
type="radio"
name="add_menu_prefix"
label="COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_LABEL"
description="COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_DESCRIPTION"
class="btn-group btn-group-yesno"
default="1">
<!-- Option Set. -->
<option value="1">
COM_COMPONENTBUILDER_CONFIG_YES</option>
<option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option>
</field>
<!-- Menu_prefix Field. Type: Text. (joomla) -->
<field
type="text"
name="menu_prefix"
label="COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_LABEL"
size="30"
maxlength="30"
default="&#187;"
description="COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_DESCRIPTION"
class="text_area"
filter="SAFEHTML"
message="COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_MESSAGE"
hint="COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_HINT"
autocomplete="on"
showon="add_menu_prefix:1"
/>
<!-- Spacer_hr_one Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_one" hr="true" class="spacer_hr_one" />
<!-- Minify Field. Type: Radio. (joomla) --> <!-- Minify Field. Type: Radio. (joomla) -->
<field <field
type="radio" type="radio"
@ -61,8 +93,8 @@
<option value="0"> <option value="0">
COM_COMPONENTBUILDER_CONFIG_NO</option> COM_COMPONENTBUILDER_CONFIG_NO</option>
</field> </field>
<!-- Spacer_hr_one Field. Type: Spacer. A None Database Field. (joomla) --> <!-- Spacer_hr_two Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_one" hr="true" class="spacer_hr_one" /> <field type="spacer" name="spacer_hr_two" hr="true" class="spacer_hr_two" />
<!-- Note_language_global Field. Type: Note. A None Database Field. (joomla) --> <!-- Note_language_global Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_language_global" label="COM_COMPONENTBUILDER_CONFIG_NOTE_LANGUAGE_GLOBAL_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_LANGUAGE_GLOBAL_DESCRIPTION" heading="h4" class="alert alert-info note_language_global" /> <field type="note" name="note_language_global" label="COM_COMPONENTBUILDER_CONFIG_NOTE_LANGUAGE_GLOBAL_LABEL" description="COM_COMPONENTBUILDER_CONFIG_NOTE_LANGUAGE_GLOBAL_DESCRIPTION" heading="h4" class="alert alert-info note_language_global" />
<!-- Language Field. Type: Lang. (custom) --> <!-- Language Field. Type: Lang. (custom) -->
@ -89,8 +121,8 @@
max="100" max="100"
step="10" step="10"
/> />
<!-- Spacer_hr_two Field. Type: Spacer. A None Database Field. (joomla) --> <!-- Spacer_hr_three Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_two" hr="true" class="spacer_hr_two" /> <field type="spacer" name="spacer_hr_three" hr="true" class="spacer_hr_three" />
<!-- Compiler_field_builder_type Field. Type: List. (joomla) --> <!-- Compiler_field_builder_type Field. Type: List. (joomla) -->
<field <field
type="list" type="list"
@ -107,8 +139,8 @@
<option value="2"> <option value="2">
COM_COMPONENTBUILDER_CONFIG_SIMPLEXMLELEMENT_CLASS</option> COM_COMPONENTBUILDER_CONFIG_SIMPLEXMLELEMENT_CLASS</option>
</field> </field>
<!-- Spacer_hr_three Field. Type: Spacer. A None Database Field. (joomla) --> <!-- Spacer_hr_four Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_three" hr="true" class="spacer_hr_three" /> <field type="spacer" name="spacer_hr_four" hr="true" class="spacer_hr_four" />
<!-- Api Field. Type: User. (joomla) --> <!-- Api Field. Type: User. (joomla) -->
<field <field
type="user" type="user"
@ -167,8 +199,8 @@
<option value="0"> <option value="0">
COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE</option> COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE</option>
</field> </field>
<!-- Spacer_hr_four Field. Type: Spacer. A None Database Field. (joomla) --> <!-- Spacer_hr_five Field. Type: Spacer. A None Database Field. (joomla) -->
<field type="spacer" name="spacer_hr_four" hr="true" class="spacer_hr_four" /> <field type="spacer" name="spacer_hr_five" hr="true" class="spacer_hr_five" />
<field name="autorTitle" <field name="autorTitle"
type="spacer" type="spacer"
label="COM_COMPONENTBUILDER_CONFIG_AUTHOR" label="COM_COMPONENTBUILDER_CONFIG_AUTHOR"

View File

@ -5780,7 +5780,7 @@ class Interpretation extends Fields
} }
else else
{ {
$titleData = array("''"); // just incase some mad man does not set a title/customAlias (we fall back on the date) $titleData = array("'-'"); // just incase some mad man does not set a title/customAlias (we fall back on the date)
} }
// rest the new function // rest the new function
$newFunction = array(); $newFunction = array();
@ -12786,7 +12786,16 @@ class Interpretation extends Fields
// set the code name // set the code name
$codeName = ComponentbuilderHelper::safeString($this->componentData->name_code); $codeName = ComponentbuilderHelper::safeString($this->componentData->name_code);
// set main menu name to lang // set main menu name to lang
$this->langContent['adminsys'][$lang] = '&#187; ' . $this->componentData->name; $addPrefix = $this->params->get('add_menu_prefix', 1);
if ($addPrefix == 1)
{
$prefix = trim($this->params->get('menu_prefix', '&#187;'));
$this->langContent['adminsys'][$lang] = $prefix . ' ' . $this->componentData->name;
}
else
{
$this->langContent['adminsys'][$lang] = $this->componentData->name;
}
foreach ($this->componentData->admin_views as $view) foreach ($this->componentData->admin_views as $view)
{ {
// set custom menu // set custom menu

View File

@ -2210,6 +2210,8 @@ COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_DESCRIPTION="Add Version U
COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_LABEL="Version Updates" COM_COMPONENTBUILDER_COMPONENT_UPDATES_VERSION_UPDATE_LABEL="Version Updates"
COM_COMPONENTBUILDER_CONDITIONS="Conditions" COM_COMPONENTBUILDER_CONDITIONS="Conditions"
COM_COMPONENTBUILDER_CONFIG_ACTIVE="Active" COM_COMPONENTBUILDER_CONFIG_ACTIVE="Active"
COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_DESCRIPTION="Would you like to add a prefix to the Joomla menu name of your components"
COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_LABEL="Add Menu Prefix"
COM_COMPONENTBUILDER_CONFIG_ALMOST_FLAT_LOAD="Almost Flat" COM_COMPONENTBUILDER_CONFIG_ALMOST_FLAT_LOAD="Almost Flat"
COM_COMPONENTBUILDER_CONFIG_API_DESCRIPTION="This User will be used to log the API call." COM_COMPONENTBUILDER_CONFIG_API_DESCRIPTION="This User will be used to log the API call."
COM_COMPONENTBUILDER_CONFIG_API_LABEL="API User" COM_COMPONENTBUILDER_CONFIG_API_LABEL="API User"
@ -2449,6 +2451,11 @@ COM_COMPONENTBUILDER_CONFIG_MAILER_LABEL="Mailer"
COM_COMPONENTBUILDER_CONFIG_MAILONLINE_DESCRIPTION="Warning this will stop all emails from going out." COM_COMPONENTBUILDER_CONFIG_MAILONLINE_DESCRIPTION="Warning this will stop all emails from going out."
COM_COMPONENTBUILDER_CONFIG_MAILONLINE_LABEL="Mailer Status" COM_COMPONENTBUILDER_CONFIG_MAILONLINE_LABEL="Mailer Status"
COM_COMPONENTBUILDER_CONFIG_MAIL_CONFIGURATION="Mail Configuration" COM_COMPONENTBUILDER_CONFIG_MAIL_CONFIGURATION="Mail Configuration"
COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_DESCRIPTION="Add the prefix you would like to use. Make sure that it is HTML Character Entities since it is being used in XML."
COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_HINT="&#187;"
COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_LABEL="Prefix<br />
<small><a href='https://dev.w3.org/html5/html-author/charref' target='_blank'>check this list out</a></small>"
COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_MESSAGE="Error! Please add some text here."
COM_COMPONENTBUILDER_CONFIG_MINIFY_DESCRIPTION="Should the JavaScript be minified when compiled." COM_COMPONENTBUILDER_CONFIG_MINIFY_DESCRIPTION="Should the JavaScript be minified when compiled."
COM_COMPONENTBUILDER_CONFIG_MINIFY_LABEL="Minify JS" COM_COMPONENTBUILDER_CONFIG_MINIFY_LABEL="Minify JS"
COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE="Never update" COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE="Never update"

View File

@ -1759,7 +1759,7 @@ INSERT INTO `#__componentbuilder_snippet_type` (`id`, `name`, `description`, `pa
-- --
INSERT INTO `#__componentbuilder_library_files_folders_urls` (`id`, `addfiles`, `addfolders`, `addurls`, `library`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES INSERT INTO `#__componentbuilder_library_files_folders_urls` (`id`, `addfiles`, `addfolders`, `addurls`, `library`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
(2, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/js\\/bootstrap.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/css\\/bootstrap.min.css\",\"type\":\"2\"}}', 2, '', 1, '2017-11-25 16:17:36', '2017-12-25 12:40:16', 10, '', 2), (2, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/js\\/bootstrap.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/css\\/bootstrap.min.css\",\"type\":\"2\"}}', 2, '', 1, '2017-11-25 16:17:36', '2018-05-02 23:29:05', 11, '', 2),
(3, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/js\\/uikit.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/js\\/uikit-icons.min.js\",\"type\":\"2\"},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/css\\/uikit.min.css\",\"type\":\"2\"}}', 3, '', 1, '2017-11-25 21:47:40', '2017-12-25 12:38:24', 8, '', 3); (3, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/js\\/uikit.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/js\\/uikit-icons.min.js\",\"type\":\"2\"},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-beta.35\\/css\\/uikit.min.css\",\"type\":\"2\"}}', 3, '', 1, '2017-11-25 21:47:40', '2017-12-25 12:38:24', 8, '', 3);
CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` ( CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` (

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>2nd May, 2018</creationDate> <creationDate>3rd May, 2018</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail> <authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://joomlacomponentbuilder.com</authorUrl> <authorUrl>http://joomlacomponentbuilder.com</authorUrl>

View File

@ -3692,7 +3692,7 @@ class com_componentbuilderInstallerScript
$query = $db->getQuery(true); $query = $db->getQuery(true);
// Field to update. // Field to update.
$fields = array( $fields = array(
$db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","minify":"0","language":"en-GB","percentagelanguageadd":"50","compiler_field_builder_type":"2","set_browser_storage":"1","storage_time_to_live":"global","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","add_menu_prefix":"1","menu_prefix":"&#187;","minify":"0","language":"en-GB","percentagelanguageadd":"50","compiler_field_builder_type":"2","set_browser_storage":"1","storage_time_to_live":"global","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'),
); );
// Condition. // Condition.
$conditions = array( $conditions = array(