From ad03accaa58deb602454ccc233c8b09b06fd16d6 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 3 Dec 2021 04:45:38 +0200 Subject: [PATCH] update - v1.0.2 --- componentbuildercustomadminheaderstabs.php | 18 +- componentbuildercustomadminheaderstabs.xml | 10 +- fields/powers.php | 184 ++++++++++++++++++ forms/custom_admin_view.xml | 170 ++++++++++++++++ ...componentbuildercustomadminheaderstabs.ini | 60 +++++- ...onentbuildercustomadminheaderstabs.sys.ini | 60 +++++- rules/code.php | 46 ++--- script.php | 18 +- 8 files changed, 504 insertions(+), 62 deletions(-) create mode 100644 fields/powers.php diff --git a/componentbuildercustomadminheaderstabs.php b/componentbuildercustomadminheaderstabs.php index bca3781..eb133bb 100644 --- a/componentbuildercustomadminheaderstabs.php +++ b/componentbuildercustomadminheaderstabs.php @@ -1,12 +1,12 @@ - * @github Joomla Component Builder - * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ // No direct access to this file @@ -21,7 +21,7 @@ JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/c * Content - Componentbuilder Custom Admin Headers Tabs plugin. * * @package ComponentbuilderCustomAdminHeadersTabs - * @since 1.0.1 + * @since 1.0.2 */ class PlgContentComponentbuilderCustomAdminHeadersTabs extends CMSPlugin { diff --git a/componentbuildercustomadminheaderstabs.xml b/componentbuildercustomadminheaderstabs.xml index ee6f6ec..dfbf350 100644 --- a/componentbuildercustomadminheaderstabs.xml +++ b/componentbuildercustomadminheaderstabs.xml @@ -1,13 +1,13 @@ - + PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS - 20th February, 2021 + 3rd December, 2021 Llewellyn van der Merwe - llewellyn@joomlacomponentbuilder.com - http://www.joomlacomponentbuilder.com + joomla@vdm.io + https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 1.0.1 + 1.0.2 PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION diff --git a/fields/powers.php b/fields/powers.php new file mode 100644 index 0000000..ebcbcd3 --- /dev/null +++ b/fields/powers.php @@ -0,0 +1,184 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Powers Form Field class for the Componentbuilder component + */ +class JFormFieldPowers extends JFormFieldList +{ + /** + * The powers field type. + * + * @var string + */ + public $type = 'powers'; + + /** + * Override to add new button + * + * @return string The field input markup. + * + * @since 3.2 + */ + protected function getInput() + { + // see if we should add buttons + $set_button = $this->getAttribute('button'); + // get html + $html = parent::getInput(); + // if true set button + if ($set_button === 'true') + { + $button = array(); + $script = array(); + $button_code_name = $this->getAttribute('name'); + // get the input from url + $app = JFactory::getApplication(); + $jinput = $app->input; + // get the view name & id + $values = $jinput->getArray(array( + 'id' => 'int', + 'view' => 'word' + )); + // check if new item + $ref = ''; + $refJ = ''; + if (!is_null($values['id']) && strlen($values['view'])) + { + // only load referral if not new item. + $ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; + $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; + // get the return value. + $_uri = (string) JUri::getInstance(); + $_return = urlencode(base64_encode($_uri)); + // load return value. + $ref .= '&return=' . $_return; + $refJ .= '&return=' . $_return; + } + // get button label + $button_label = trim($button_code_name); + $button_label = preg_replace('/_+/', ' ', $button_label); + $button_label = preg_replace('/\s+/', ' ', $button_label); + $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label); + $button_label = ucfirst(strtolower($button_label)); + // get user object + $user = JFactory::getUser(); + // only add if user allowed to create power + if ($user->authorise('power.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build Create button + $button[] = ' + '; + } + // only add if user allowed to edit power + if ($user->authorise('power.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build edit button + $button[] = ''; + // build script + $script[] = " + jQuery(document).ready(function() { + jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) { + e.preventDefault(); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); + }); + var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val(); + ".$button_code_name."Button(".$button_code_name."Value); + }); + function ".$button_code_name."Button(value) { + if (value > 0) { + // hide the create button + jQuery('#".$button_code_name."Create').hide(); + // show edit button + jQuery('#".$button_code_name."Edit').show(); + var url = 'index.php?option=com_componentbuilder&view=powers&task=power.edit&id='+value+'".$refJ."'; + jQuery('#".$button_code_name."Edit').attr('href', url); + } else { + // show the create button + jQuery('#".$button_code_name."Create').show(); + // hide edit button + jQuery('#".$button_code_name."Edit').hide(); + } + }"; + } + // check if button was created for power field. + if (is_array($button) && count($button) > 0) + { + // Load the needed script. + $document = JFactory::getDocument(); + $document->addScriptDeclaration(implode(' ',$script)); + // return the button attached to input field. + return '
' .$html . implode('',$button).'
'; + } + } + return $html; + } + + /** + * Method to get a list of options for a list input. + * + * @return array An array of JHtml options. + */ + protected function getOptions() + { + // Get the user object. + $user = JFactory::getUser(); + // Get the databse object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.system_name','a.name','a.type','a.power_version'),array('id','power_admin_component_system_name','name','type','version'))); + $query->from($db->quoteName('#__componentbuilder_power', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->order('a.system_name ASC'); + $query->order('a.type ASC'); + // Implement View Level Access (if set in table) + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $columns = $db->getTableColumns('#__componentbuilder_power'); + if(isset($columns['access'])) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + } + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + // if none was found, we add this to set an alternative to set custom + if (!$items) + { + $options[] = JHtml::_('select.option', '', JText::_('PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_NONE_FOUND')); + } + if ($items) + { + if ($this->multiple === false) + { + $options[] = JHtml::_('select.option', '', JText::_('PLG_CONTENT_COMPONENTBUILDERCOMPONENTHEADERSTABS_SELECT_AN_OPTION')); + } + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->power_admin_component_system_name . ' [' . $item->type . ' ' . $item->name . '] (v' . $item->version . ')'); + } + } + return $options; + + } +} diff --git a/forms/custom_admin_view.xml b/forms/custom_admin_view.xml index 1d2c873..b0ce4da 100644 --- a/forms/custom_admin_view.xml +++ b/forms/custom_admin_view.xml @@ -41,6 +41,65 @@ validate="code" showon="add_custom_admin_view_model:1" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/language/en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.ini b/language/en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.ini index 3374f03..d48254e 100644 --- a/language/en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.ini +++ b/language/en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.ini @@ -1,6 +1,6 @@ PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS="Content - Componentbuilder Custom Admin Headers Tabs" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_DESCRIPTION="This plugin is used to set custom admin class custom headers." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Custom Admin Headers Tabs (v.1.0.1)

This plugin is used to set custom admin class custom headers.

Created by Llewellyn van der Merwe
Development started 8th December, 2020

" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Custom Admin Headers Tabs (v.1.0.2)

This plugin is used to set custom admin class custom headers.

Created by Llewellyn van der Merwe
Development started 8th December, 2020

" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CLASS_HEADERS="Class Headers" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_MODEL_LABEL="Target Custom Admin View
Model Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_MODEL_DESCRIPTION="Only use this option if you have a getItem as your Main Get." @@ -10,33 +10,77 @@ PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_MODEL_LABEL (custom.admin.view.model)
getItem" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_MODEL_DESCRIPTION="The class header for custom admin view model. Only use this option if you have a getItem as your Main Get." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_LABEL="Target Custom Admin View
Header" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_MODEL_LABEL="Power Header
+(custom.admin.view.model)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_MODEL_DESCRIPTION="The power header for custom admin view model. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_HTML_LABEL="Target Custom Admin View
Class Header" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_HTML_DESCRIPTION="Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_HTML_LABEL="Class Header
+(custom.admin.view.html)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_HTML_DESCRIPTION="The class header for custom admin view. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_HTML_LABEL="Power Header
+(custom.admin.view.html)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_HTML_DESCRIPTION="The power header for custom admin view. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_LABEL="Target Custom Admin View
Default Template Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_DESCRIPTION="Only use this option if you have a getItem as your Main Get." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_LABEL="Class Header
+PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_LABEL="Default Template Header
(custom.admin.view)
getItem" -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_DESCRIPTION="The class header for custom admin view. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_DESCRIPTION="The default template header for custom admin view. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_LABEL="Power Header
+(custom.admin.view)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_DESCRIPTION="The power header for custom admin view. Only use this option if you have a getItem as your Main Get." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_CONTROLLER_LABEL="Target Custom Admin View
Controller Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_CONTROLLER_DESCRIPTION="Only use this option if you have a getItem as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_CONTROLLER_LABEL="Class Header
(custom.admin.view.controller)
getItem" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_CONTROLLER_DESCRIPTION="The class header for custom admin view controller. Only use this option if you have a getItem as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_CONTROLLER_LABEL="Power Header
+(custom.admin.view.controller)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_CONTROLLER_DESCRIPTION="The power header for custom admin view controller. Only use this option if you have a getItem as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_MODEL_LABEL="Target Custom Admin Views
Model Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_MODEL_DESCRIPTION="Only use this option if you have a getListQuery as your Main Get." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_MODEL_LABEL="Class Header
(custom.admin.views.model)
getListQuery" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_MODEL_DESCRIPTION="The class header for custom admin views model. Only use this option if you have a getListQuery as your Main Get." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_LABEL="Target Custom Admin Views
Header" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_MODEL_LABEL="Power Header
+(custom.admin.views.model)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_MODEL_DESCRIPTION="The power header for custom admin views model. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_HTML_LABEL="Target Custom Admin Views
Class Header" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_HTML_DESCRIPTION="Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_HTML_LABEL="Class Header
+(custom.admin.views.html)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_HTML_DESCRIPTION="The class header for custom admin views. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_HTML_LABEL="Power Header
+(custom.admin.views.html)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_HTML_DESCRIPTION="The power header for custom admin views. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_LABEL="Target Custom Admin Views
Default Template Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_DESCRIPTION="Only use this option if you have a getListQuery as your Main Get." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_LABEL="Class Header
+PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_LABEL="Default Template Header
(custom.admin.views)
getListQuery" -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_DESCRIPTION="The class header for custom admin views. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_DESCRIPTION="The default template header for custom admin views. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_LABEL="Power Header
+(custom.admin.views)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_DESCRIPTION="The power header for custom admin views. Only use this option if you have a getListQuery as your Main Get." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_CONTROLLER_LABEL="Target Custom Admin Views
Controller Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_CONTROLLER_DESCRIPTION="Only use this option if you have a getListQuery as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_CONTROLLER_LABEL="Class Header
(custom.admin.views.controller)
getListQuery" -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_CONTROLLER_DESCRIPTION="The class header for custom admin views controller. Only use this option if you have a getListQuery as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." \ No newline at end of file +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_CONTROLLER_DESCRIPTION="The class header for custom admin views controller. Only use this option if you have a getListQuery as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_CONTROLLER_LABEL="Power Header
+(custom.admin.views.controller)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_CONTROLLER_DESCRIPTION="The power header for custom admin views controller. Only use this option if you have a getListQuery as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." \ No newline at end of file diff --git a/language/en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.sys.ini b/language/en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.sys.ini index 3374f03..d48254e 100644 --- a/language/en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.sys.ini +++ b/language/en-GB/en-GB.plg_content_componentbuildercustomadminheaderstabs.sys.ini @@ -1,6 +1,6 @@ PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS="Content - Componentbuilder Custom Admin Headers Tabs" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_DESCRIPTION="This plugin is used to set custom admin class custom headers." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Custom Admin Headers Tabs (v.1.0.1)

This plugin is used to set custom admin class custom headers.

Created by Llewellyn van der Merwe
Development started 8th December, 2020

" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_XML_DESCRIPTION="

Content - Componentbuilder Custom Admin Headers Tabs (v.1.0.2)

This plugin is used to set custom admin class custom headers.

Created by Llewellyn van der Merwe
Development started 8th December, 2020

" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CLASS_HEADERS="Class Headers" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_MODEL_LABEL="Target Custom Admin View
Model Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_MODEL_DESCRIPTION="Only use this option if you have a getItem as your Main Get." @@ -10,33 +10,77 @@ PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_MODEL_LABEL (custom.admin.view.model)
getItem" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_MODEL_DESCRIPTION="The class header for custom admin view model. Only use this option if you have a getItem as your Main Get." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_LABEL="Target Custom Admin View
Header" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_MODEL_LABEL="Power Header
+(custom.admin.view.model)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_MODEL_DESCRIPTION="The power header for custom admin view model. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_HTML_LABEL="Target Custom Admin View
Class Header" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_HTML_DESCRIPTION="Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_HTML_LABEL="Class Header
+(custom.admin.view.html)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_HTML_DESCRIPTION="The class header for custom admin view. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_HTML_LABEL="Power Header
+(custom.admin.view.html)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_HTML_DESCRIPTION="The power header for custom admin view. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_LABEL="Target Custom Admin View
Default Template Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_DESCRIPTION="Only use this option if you have a getItem as your Main Get." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_LABEL="Class Header
+PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_LABEL="Default Template Header
(custom.admin.view)
getItem" -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_DESCRIPTION="The class header for custom admin view. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_DESCRIPTION="The default template header for custom admin view. Only use this option if you have a getItem as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_LABEL="Power Header
+(custom.admin.view)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_DESCRIPTION="The power header for custom admin view. Only use this option if you have a getItem as your Main Get." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_CONTROLLER_LABEL="Target Custom Admin View
Controller Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEW_CONTROLLER_DESCRIPTION="Only use this option if you have a getItem as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_CONTROLLER_LABEL="Class Header
(custom.admin.view.controller)
getItem" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEW_CONTROLLER_DESCRIPTION="The class header for custom admin view controller. Only use this option if you have a getItem as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_CONTROLLER_LABEL="Power Header
+(custom.admin.view.controller)
+getItem" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEW_CONTROLLER_DESCRIPTION="The power header for custom admin view controller. Only use this option if you have a getItem as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_MODEL_LABEL="Target Custom Admin Views
Model Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_MODEL_DESCRIPTION="Only use this option if you have a getListQuery as your Main Get." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_MODEL_LABEL="Class Header
(custom.admin.views.model)
getListQuery" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_MODEL_DESCRIPTION="The class header for custom admin views model. Only use this option if you have a getListQuery as your Main Get." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_LABEL="Target Custom Admin Views
Header" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_MODEL_LABEL="Power Header
+(custom.admin.views.model)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_MODEL_DESCRIPTION="The power header for custom admin views model. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_HTML_LABEL="Target Custom Admin Views
Class Header" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_HTML_DESCRIPTION="Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_HTML_LABEL="Class Header
+(custom.admin.views.html)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_HTML_DESCRIPTION="The class header for custom admin views. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_HTML_LABEL="Power Header
+(custom.admin.views.html)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_HTML_DESCRIPTION="The power header for custom admin views. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_LABEL="Target Custom Admin Views
Default Template Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_DESCRIPTION="Only use this option if you have a getListQuery as your Main Get." -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_LABEL="Class Header
+PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_LABEL="Default Template Header
(custom.admin.views)
getListQuery" -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_DESCRIPTION="The class header for custom admin views. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_DESCRIPTION="The default template header for custom admin views. Only use this option if you have a getListQuery as your Main Get." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_LABEL="Power Header
+(custom.admin.views)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_DESCRIPTION="The power header for custom admin views. Only use this option if you have a getListQuery as your Main Get." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_CONTROLLER_LABEL="Target Custom Admin Views
Controller Header" PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_ADD_CUSTOM_ADMIN_VIEWS_CONTROLLER_DESCRIPTION="Only use this option if you have a getListQuery as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_CONTROLLER_LABEL="Class Header
(custom.admin.views.controller)
getListQuery" -PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_CONTROLLER_DESCRIPTION="The class header for custom admin views controller. Only use this option if you have a getListQuery as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." \ No newline at end of file +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_CUSTOM_ADMIN_VIEWS_CONTROLLER_DESCRIPTION="The class header for custom admin views controller. Only use this option if you have a getListQuery as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_CONTROLLER_LABEL="Power Header
+(custom.admin.views.controller)
+getListQuery" +PLG_CONTENT_COMPONENTBUILDERCUSTOMADMINHEADERSTABS_POWER_CUSTOM_ADMIN_VIEWS_CONTROLLER_DESCRIPTION="The power header for custom admin views controller. Only use this option if you have a getListQuery as your Main Get, and have custom code in the PHP (controller methods) under the Custom Buttons tab." \ No newline at end of file diff --git a/rules/code.php b/rules/code.php index 24935da..8101f79 100644 --- a/rules/code.php +++ b/rules/code.php @@ -1,25 +1,25 @@ - * @github Joomla Component Builder - * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -// No direct access to this file -defined('JPATH_PLATFORM') or die; - -use Joomla\CMS\Form\Form; -use Joomla\CMS\Form\FormRule; -use Joomla\Registry\Registry; - -/** - * Form Rule (Code) class for the Joomla Platform. - */ -class JFormRuleCode extends FormRule +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('JPATH_PLATFORM') or die; + +use Joomla\CMS\Form\Form; +use Joomla\CMS\Form\FormRule; +use Joomla\Registry\Registry; + +/** + * Form Rule (Code) class for the Joomla Platform. + */ +class JFormRuleCode extends FormRule { /** * Method to test the value. @@ -49,5 +49,5 @@ class JFormRuleCode extends FormRule * But since some of the placeholders form part of the class/function names and the more, it seems like we are pressed for a much more advance solution. * If you have any ideas to how we can go about to do this, then please open an issue on github and lets begin. (this is a nice to have, so don't break a leg...) */ - } -} + } +} diff --git a/script.php b/script.php index 960969a..dcd7d60 100644 --- a/script.php +++ b/script.php @@ -1,12 +1,12 @@ - * @github Joomla Component Builder - * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt */ // No direct access to this file @@ -61,7 +61,7 @@ class plgContentComponentbuilderCustomAdminHeadersTabsInstallerScript // get the version $jcbVersion = explode('.', $manifest->version); // check that we have JCB 2.12.6 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 2 && (($jcbVersion[1] == 12 && $jcbVersion[2] >= 6) || $jcbVersion[1] > 12)) + if (count($jcbVersion) == 3 && (($jcbVersion[0] == 2 && (($jcbVersion[1] == 12 && $jcbVersion[2] >= 6) || ($jcbVersion[1] > 12))) || $jcbVersion[0] >= 3)) { $blockInstall = false; }