Tweaked the category naming. Improved the autoloader for composer.

This commit is contained in:
Llewellyn van der Merwe 2019-10-14 17:30:35 +02:00
parent 548af56265
commit d78e3bb215
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
13 changed files with 70 additions and 34 deletions

View File

@ -146,11 +146,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 11th October, 2019 + *Last Build*: 14th October, 2019
+ *Version*: 2.10.1 + *Version*: 2.10.1
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **253755** + *Line count*: **253791**
+ *Field count*: **1347** + *Field count*: **1347**
+ *File count*: **1618** + *File count*: **1618**
+ *Folder count*: **261** + *Folder count*: **261**

View File

@ -146,11 +146,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 11th October, 2019 + *Last Build*: 14th October, 2019
+ *Version*: 2.10.1 + *Version*: 2.10.1
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **253755** + *Line count*: **253791**
+ *Field count*: **1347** + *Field count*: **1347**
+ *File count*: **1618** + *File count*: **1618**
+ *Folder count*: **261** + *Folder count*: **261**

View File

@ -2800,7 +2800,7 @@ class Fields extends Structure
} }
else else
{ {
$tempName = $view_name_single . ' category'; $tempName = $view_name_list . ' categories';
} }
// set lang // set lang
$listLangName = $langView . '_' . ComponentbuilderHelper::safeFieldName($tempName, true); $listLangName = $langView . '_' . ComponentbuilderHelper::safeFieldName($tempName, true);

View File

@ -13394,7 +13394,7 @@ class Interpretation extends Fields
{ {
$otherViews = $name_list; $otherViews = $name_list;
// build lang // build lang
$langName = 'Category &nbsp;For<br />' . ComponentbuilderHelper::safeString($otherViews, 'W'); $langName = 'Categories&nbsp;For<br />' . ComponentbuilderHelper::safeString($otherViews, 'W');
} }
if (!in_array($otherViews, $catArray)) if (!in_array($otherViews, $catArray))
{ {

View File

@ -3787,23 +3787,41 @@ abstract class ComponentbuilderHelper
/** /**
* Composer Switch * Composer Switch
**/ **/
protected static $composer = false; protected static $composer = array();
/** /**
* Load the Composer Vendors * Load the Composer Vendors
**/ **/
public static function composerAutoload() public static function composerAutoload($target = 'vdm_io')
{ {
// insure we load the composer vendors only once // insure we load the composer vendor only once
if (!self::$composer) if (!isset(self::$composer[$target]))
{ {
// load the autoloader // get the function name
require_once JPATH_SITE.'/libraries/vdm_io/vendor/autoload.php'; $functionName = self::safeString('compose' . $target);
// check if method exist
if (method_exists(__CLASS__, $functionName))
{
return self::{$functionName}();
}
return false;
}
return self::$composer[$target];
}
/**
* Load the Composer Vendor vdm_io
**/
protected static function composevdm_io()
{
// load the autoloader for vdm_io
require_once JPATH_SITE . '/libraries/vdm_io/vendor/autoload.php';
// do not load again // do not load again
self::$composer = true; self::$composer['vdm_io'] = true;
}
} }
/** /**
* bc math wrapper (very basic not for accounting) * bc math wrapper (very basic not for accounting)
* *
@ -5614,12 +5632,12 @@ abstract class ComponentbuilderHelper
if ($user->authorise('field.access', 'com_componentbuilder') && $user->authorise('field.submenu', 'com_componentbuilder')) if ($user->authorise('field.access', 'com_componentbuilder') && $user->authorise('field.submenu', 'com_componentbuilder'))
{ {
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDS'), 'index.php?option=com_componentbuilder&view=fields', $submenu === 'fields'); JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDS'), 'index.php?option=com_componentbuilder&view=fields', $submenu === 'fields');
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELD_FIELD_CATEGORY'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fields', $submenu === 'categories.fields'); JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fields', $submenu === 'categories.fields');
} }
if ($user->authorise('fieldtype.access', 'com_componentbuilder') && $user->authorise('fieldtype.submenu', 'com_componentbuilder')) if ($user->authorise('fieldtype.access', 'com_componentbuilder') && $user->authorise('fieldtype.submenu', 'com_componentbuilder'))
{ {
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDTYPES'), 'index.php?option=com_componentbuilder&view=fieldtypes', $submenu === 'fieldtypes'); JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDTYPES'), 'index.php?option=com_componentbuilder&view=fieldtypes', $submenu === 'fieldtypes');
JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPE_CATEGORY'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fieldtypes', $submenu === 'categories.fieldtypes'); JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fieldtypes', $submenu === 'categories.fieldtypes');
} }
if ($user->authorise('language_translation.access', 'com_componentbuilder') && $user->authorise('language_translation.submenu', 'com_componentbuilder')) if ($user->authorise('language_translation.access', 'com_componentbuilder') && $user->authorise('language_translation.submenu', 'com_componentbuilder'))
{ {

View File

@ -4258,9 +4258,9 @@ COM_COMPONENTBUILDER_DASHBOARD_CUSTOM_CODES="Custom Codes<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_DYNAMIC_GETS="Dynamic Gets<br /><br />" COM_COMPONENTBUILDER_DASHBOARD_DYNAMIC_GETS="Dynamic Gets<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_DYNAMIC_GET_ADD="Add&nbsp;Dynamic Get<br /><br />" COM_COMPONENTBUILDER_DASHBOARD_DYNAMIC_GET_ADD="Add&nbsp;Dynamic Get<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_FIELDS="Fields<br /><br />" COM_COMPONENTBUILDER_DASHBOARD_FIELDS="Fields<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_FIELDS_CATID="Category &nbsp;For<br />Fields" COM_COMPONENTBUILDER_DASHBOARD_FIELDS_CATID="Categories&nbsp;For<br />Fields"
COM_COMPONENTBUILDER_DASHBOARD_FIELDTYPES="Fieldtypes<br /><br />" COM_COMPONENTBUILDER_DASHBOARD_FIELDTYPES="Fieldtypes<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_FIELDTYPES_CATID="Category &nbsp;For<br />Fieldtypes" COM_COMPONENTBUILDER_DASHBOARD_FIELDTYPES_CATID="Categories&nbsp;For<br />Fieldtypes"
COM_COMPONENTBUILDER_DASHBOARD_FIELD_ADD="Add&nbsp;Field<br /><br />" COM_COMPONENTBUILDER_DASHBOARD_FIELD_ADD="Add&nbsp;Field<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_GET_SNIPPETS="Get Snippets<br /><br />" COM_COMPONENTBUILDER_DASHBOARD_GET_SNIPPETS="Get Snippets<br /><br />"
COM_COMPONENTBUILDER_DASHBOARD_HELP_DOCUMENTS="Help Documents<br /><br />" COM_COMPONENTBUILDER_DASHBOARD_HELP_DOCUMENTS="Help Documents<br /><br />"
@ -4801,7 +4801,7 @@ COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_HINT="Value/Example Here"
COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL="Value/Example" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL="Value/Example"
COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_MESSAGE="Error! Please add value/example here." COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_MESSAGE="Error! Please add value/example here."
COM_COMPONENTBUILDER_FIELDTYPE_FIELDS="Fields" COM_COMPONENTBUILDER_FIELDTYPE_FIELDS="Fields"
COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPE_CATEGORY="Fieldtype Category" COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES="Fieldtypes Categories"
COM_COMPONENTBUILDER_FIELDTYPE_FIFTY="50" COM_COMPONENTBUILDER_FIELDTYPE_FIFTY="50"
COM_COMPONENTBUILDER_FIELDTYPE_FLOAT="FLOAT" COM_COMPONENTBUILDER_FIELDTYPE_FLOAT="FLOAT"
COM_COMPONENTBUILDER_FIELDTYPE_HAS_DEFAULTS="Has Defaults" COM_COMPONENTBUILDER_FIELDTYPE_HAS_DEFAULTS="Has Defaults"
@ -4938,10 +4938,10 @@ COM_COMPONENTBUILDER_FIELD_DOUBLE="DOUBLE"
COM_COMPONENTBUILDER_FIELD_EDIT="Editing the Field" COM_COMPONENTBUILDER_FIELD_EDIT="Editing the Field"
COM_COMPONENTBUILDER_FIELD_ELEVEN="11" COM_COMPONENTBUILDER_FIELD_ELEVEN="11"
COM_COMPONENTBUILDER_FIELD_ERROR_UNIQUE_ALIAS="Another Field has the same alias." COM_COMPONENTBUILDER_FIELD_ERROR_UNIQUE_ALIAS="Another Field has the same alias."
COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES="Fields Categories"
COM_COMPONENTBUILDER_FIELD_FIELDTYPE="Fieldtype" COM_COMPONENTBUILDER_FIELD_FIELDTYPE="Fieldtype"
COM_COMPONENTBUILDER_FIELD_FIELDTYPE_DESCRIPTION="Set the field type" COM_COMPONENTBUILDER_FIELD_FIELDTYPE_DESCRIPTION="Set the field type"
COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL="Type" COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL="Type"
COM_COMPONENTBUILDER_FIELD_FIELD_CATEGORY="Field Category"
COM_COMPONENTBUILDER_FIELD_FIFTY="50" COM_COMPONENTBUILDER_FIELD_FIFTY="50"
COM_COMPONENTBUILDER_FIELD_FLOAT="FLOAT" COM_COMPONENTBUILDER_FIELD_FLOAT="FLOAT"
COM_COMPONENTBUILDER_FIELD_HELPNOTE_LABEL="Field Information" COM_COMPONENTBUILDER_FIELD_HELPNOTE_LABEL="Field Information"

View File

@ -74,7 +74,7 @@ $can = ComponentbuilderHelper::getActions('field');
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'); ?> <?php echo JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'); ?>
</th> </th>
<th data-breakpoints="all" data-type="html" data-sort-use="text"> <th data-breakpoints="all" data-type="html" data-sort-use="text">
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD_FIELD_CATEGORY'); ?> <?php echo JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'); ?>
</th> </th>
<th width="10" data-breakpoints="xs sm md"> <th width="10" data-breakpoints="xs sm md">
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD_STATUS'); ?> <?php echo JText::_('COM_COMPONENTBUILDER_FIELD_STATUS'); ?>

View File

@ -48,7 +48,7 @@ defined('_JEXEC') or die('Restricted access');
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FIELD_STORE_LABEL', 'store', $this->listDirn, $this->listOrder); ?> <?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FIELD_STORE_LABEL', 'store', $this->listDirn, $this->listOrder); ?>
</th> </th>
<th class="nowrap" > <th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FIELD_FIELD_CATEGORY', 'catid', $this->listDirn, $this->listOrder); ?> <?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES', 'catid', $this->listDirn, $this->listOrder); ?>
</th> </th>
<?php if ($this->canState): ?> <?php if ($this->canState): ?>
<th width="10" class="nowrap center" > <th width="10" class="nowrap center" >

View File

@ -408,7 +408,7 @@ class ComponentbuilderViewFields extends JViewLegacy
'a.indexes' => JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL'), 'a.indexes' => JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL'),
'a.null_switch' => JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL'), 'a.null_switch' => JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL'),
'a.store' => JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'), 'a.store' => JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'),
'c.category_title' => JText::_('COM_COMPONENTBUILDER_FIELD_FIELD_CATEGORY'), 'c.category_title' => JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'),
'a.id' => JText::_('JGRID_HEADING_ID') 'a.id' => JText::_('JGRID_HEADING_ID')
); );
} }

View File

@ -36,7 +36,7 @@ defined('_JEXEC') or die('Restricted access');
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL', 'short_description', $this->listDirn, $this->listOrder); ?> <?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL', 'short_description', $this->listDirn, $this->listOrder); ?>
</th> </th>
<th class="nowrap" > <th class="nowrap" >
<?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPE_CATEGORY', 'catid', $this->listDirn, $this->listOrder); ?> <?php echo JHtml::_('grid.sort', 'COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES', 'catid', $this->listDirn, $this->listOrder); ?>
</th> </th>
<?php if ($this->canState): ?> <?php if ($this->canState): ?>
<th width="10" class="nowrap center" > <th width="10" class="nowrap center" >

View File

@ -249,7 +249,7 @@ class ComponentbuilderViewFieldtypes extends JViewLegacy
'a.published' => JText::_('JSTATUS'), 'a.published' => JText::_('JSTATUS'),
'a.name' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL'), 'a.name' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL'),
'a.short_description' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL'), 'a.short_description' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL'),
'c.category_title' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPE_CATEGORY'), 'c.category_title' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'),
'a.id' => JText::_('JGRID_HEADING_ID') 'a.id' => JText::_('JGRID_HEADING_ID')
); );
} }

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>11th October, 2019</creationDate> <creationDate>14th October, 2019</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://www.joomlacomponentbuilder.com</authorUrl> <authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>

View File

@ -3787,23 +3787,41 @@ abstract class ComponentbuilderHelper
/** /**
* Composer Switch * Composer Switch
**/ **/
protected static $composer = false; protected static $composer = array();
/** /**
* Load the Composer Vendors * Load the Composer Vendors
**/ **/
public static function composerAutoload() public static function composerAutoload($target = 'vdm_io')
{ {
// insure we load the composer vendors only once // insure we load the composer vendor only once
if (!self::$composer) if (!isset(self::$composer[$target]))
{ {
// load the autoloader // get the function name
require_once JPATH_SITE.'/libraries/vdm_io/vendor/autoload.php'; $functionName = self::safeString('compose' . $target);
// check if method exist
if (method_exists(__CLASS__, $functionName))
{
return self::{$functionName}();
}
return false;
}
return self::$composer[$target];
}
/**
* Load the Composer Vendor vdm_io
**/
protected static function composevdm_io()
{
// load the autoloader for vdm_io
require_once JPATH_SITE . '/libraries/vdm_io/vendor/autoload.php';
// do not load again // do not load again
self::$composer = true; self::$composer['vdm_io'] = true;
}
} }
/** /**
* bc math wrapper (very basic not for accounting) * bc math wrapper (very basic not for accounting)
* *