diff --git a/README.md b/README.md
index 969a9f6..779d3a0 100644
--- a/README.md
+++ b/README.md
@@ -8,28 +8,28 @@
+ *Author*: [Llewellyn](mailto:joomla@vdm.io)
+ *Name*: [Hello World](https://www.vdm.io)
+ *First Build*: 20th September, 2017
-+ *Last Build*: 12th June, 2019
++ *Last Build*: 14th August, 2019
+ *Version*: 1.0.0
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time
-**38 Hours** or **5 Eight Hour Days** (actual time the author saved -
+**39 Hours** or **5 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](http://joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
-+ *Line count*: **13706**
++ *Line count*: **13811**
+ *File count*: **137**
+ *Folder count*: **55**
-**26 Hours** or **3 Eight Hour Days** (the actual time the author spent)
+**25 Hours** or **3 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @10hours** = codingtime / 4;
-> **planning @5hours** = codingtime / 7;
+> **planning @6hours** = codingtime / 7;
> **mapping @4hours** = codingtime / 10;
> **office @6hours** = codingtime / 6;)
diff --git a/admin/README.txt b/admin/README.txt
index 969a9f6..779d3a0 100644
--- a/admin/README.txt
+++ b/admin/README.txt
@@ -8,28 +8,28 @@
+ *Author*: [Llewellyn](mailto:joomla@vdm.io)
+ *Name*: [Hello World](https://www.vdm.io)
+ *First Build*: 20th September, 2017
-+ *Last Build*: 12th June, 2019
++ *Last Build*: 14th August, 2019
+ *Version*: 1.0.0
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time
-**38 Hours** or **5 Eight Hour Days** (actual time the author saved -
+**39 Hours** or **5 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](http://joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
-+ *Line count*: **13706**
++ *Line count*: **13811**
+ *File count*: **137**
+ *Folder count*: **55**
-**26 Hours** or **3 Eight Hour Days** (the actual time the author spent)
+**25 Hours** or **3 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @10hours** = codingtime / 4;
-> **planning @5hours** = codingtime / 7;
+> **planning @6hours** = codingtime / 7;
> **mapping @4hours** = codingtime / 10;
> **office @6hours** = codingtime / 6;)
diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css
index 47272e6..a605073 100644
--- a/admin/assets/css/admin.css
+++ b/admin/assets/css/admin.css
@@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage admin.css
diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css
index d21b8b7..30dfeaa 100644
--- a/admin/assets/css/dashboard.css
+++ b/admin/assets/css/dashboard.css
@@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage dashboard.css
diff --git a/admin/assets/css/greeting.css b/admin/assets/css/greeting.css
index 4208610..512fc9f 100644
--- a/admin/assets/css/greeting.css
+++ b/admin/assets/css/greeting.css
@@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage greeting.css
diff --git a/admin/assets/css/greetings.css b/admin/assets/css/greetings.css
index b2c874d..2fe882a 100644
--- a/admin/assets/css/greetings.css
+++ b/admin/assets/css/greetings.css
@@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage greetings.css
diff --git a/admin/assets/js/admin.js b/admin/assets/js/admin.js
index 94b3533..bde1fa4 100644
--- a/admin/assets/js/admin.js
+++ b/admin/assets/js/admin.js
@@ -3,7 +3,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage admin.js
diff --git a/admin/controller.php b/admin/controller.php
index 1de1364..00c9717 100644
--- a/admin/controller.php
+++ b/admin/controller.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage controller.php
diff --git a/admin/controllers/greeting.php b/admin/controllers/greeting.php
index 46559fe..82d7ca7 100644
--- a/admin/controllers/greeting.php
+++ b/admin/controllers/greeting.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage greeting.php
diff --git a/admin/controllers/greetings.php b/admin/controllers/greetings.php
index 4468512..6ab209d 100644
--- a/admin/controllers/greetings.php
+++ b/admin/controllers/greetings.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage greetings.php
diff --git a/admin/controllers/hello_world.php b/admin/controllers/hello_world.php
index e119e97..114b1b5 100644
--- a/admin/controllers/hello_world.php
+++ b/admin/controllers/hello_world.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php
diff --git a/admin/controllers/import.php b/admin/controllers/import.php
index fddf9ca..7b567eb 100644
--- a/admin/controllers/import.php
+++ b/admin/controllers/import.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage import.php
diff --git a/admin/hello_world.php b/admin/hello_world.php
index 70f2b24..5065eaa 100644
--- a/admin/hello_world.php
+++ b/admin/hello_world.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php
diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php
index cd2bbcd..7a71435 100644
--- a/admin/helpers/headercheck.php
+++ b/admin/helpers/headercheck.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage headercheck.php
diff --git a/admin/helpers/hello_world.php b/admin/helpers/hello_world.php
index 9358fdb..7e306bf 100644
--- a/admin/helpers/hello_world.php
+++ b/admin/helpers/hello_world.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage hello_world.php
@@ -958,38 +958,42 @@ abstract class Hello_worldHelper
/**
* Get any component's model
**/
- public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'Hello_world', $config = array())
+ public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = 'Hello_world', $config = array())
{
// fix the name
$name = self::safeString($name);
- // full path
- $fullPath = $path . '/models';
- // set prefix
- $prefix = $component.'Model';
+ // full path to models
+ $fullPathModels = $path . '/models';
// load the model file
- JModelLegacy::addIncludePath($fullPath, $prefix);
+ JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
+ // make sure the table path is loaded
+ if (!isset($config['table_path']) || !self::checkString($config['table_path']))
+ {
+ // This is the JCB default path to tables in Joomla 3.x
+ $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
+ }
// get instance
- $model = JModelLegacy::getInstance($name, $prefix, $config);
+ $model = JModelLegacy::getInstance($name, $Component . 'Model', $config);
// if model not found (strange)
if ($model == false)
{
jimport('joomla.filesystem.file');
// get file path
- $filePath = $path.'/'.$name.'.php';
- $fullPath = $fullPath.'/'.$name.'.php';
+ $filePath = $path . '/' . $name . '.php';
+ $fullPathModel = $fullPathModels . '/' . $name . '.php';
// check if it exists
if (JFile::exists($filePath))
{
// get the file
require_once $filePath;
}
- elseif (JFile::exists($fullPath))
+ elseif (JFile::exists($fullPathModel))
{
// get the file
- require_once $fullPath;
+ require_once $fullPathModel;
}
// build class names
- $modelClass = $prefix.$name;
+ $modelClass = $Component . 'Model' . $name;
if (class_exists($modelClass))
{
// initialize the model
diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php
index d04fddd..aca02b5 100644
--- a/admin/helpers/html/batch_.php
+++ b/admin/helpers/html/batch_.php
@@ -4,7 +4,7 @@
/-------------------------------------------------------------------------------------------------------/
@version 1.0.0
- @build 12th June, 2019
+ @build 14th August, 2019
@created 20th September, 2017
@package Hello World
@subpackage batch_.php
diff --git a/admin/language/en-GB/en-GB.com_hello_world.ini b/admin/language/en-GB/en-GB.com_hello_world.ini
index cf73fe0..e8d6ff6 100644
--- a/admin/language/en-GB/en-GB.com_hello_world.ini
+++ b/admin/language/en-GB/en-GB.com_hello_world.ini
@@ -45,21 +45,21 @@ COM_HELLO_WORLD_DASHBOARD_GREETINGS="Greetings
"
COM_HELLO_WORLD_DASHBOARD_GREETING_ADD="Add Greeting
"
COM_HELLO_WORLD_DATE="Date"
COM_HELLO_WORLD_EDIT_CREATED_BY="Edit Created By"
-COM_HELLO_WORLD_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by."
+COM_HELLO_WORLD_EDIT_CREATED_BY_DESC="Allows users in this group to edit created by."
COM_HELLO_WORLD_EDIT_CREATED_DATE="Edit Created Date"
-COM_HELLO_WORLD_EDIT_CREATED_DATE_DESC=" Allows users in this group to edit created date."
+COM_HELLO_WORLD_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date."
COM_HELLO_WORLD_EDIT_S="Edit %s"
COM_HELLO_WORLD_EDIT_VERSIONS="Edit Version"
-COM_HELLO_WORLD_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions."
+COM_HELLO_WORLD_EDIT_VERSIONS_DESC="Allows users in this group to edit versions."
COM_HELLO_WORLD_EXPORT_DATA="Export Data"
-COM_HELLO_WORLD_EXPORT_DATA_DESC=" Allows users in this group to export data."
+COM_HELLO_WORLD_EXPORT_DATA_DESC="Allows users in this group to export data."
COM_HELLO_WORLD_EXPORT_FAILED="Export Failed"
COM_HELLO_WORLD_GREETING="Greeting"
COM_HELLO_WORLD_GREETINGS="Greetings"
COM_HELLO_WORLD_GREETINGS_ACCESS="Greetings Access"
COM_HELLO_WORLD_GREETINGS_ACCESS_DESC="Allows the users in this group to access access greetings"
COM_HELLO_WORLD_GREETINGS_ACCESS_SITE="Greetings (Site) Access"
-COM_HELLO_WORLD_GREETINGS_ACCESS_SITE_DESC=" Allows the users in this group to access site greetings."
+COM_HELLO_WORLD_GREETINGS_ACCESS_SITE_DESC="Allows the users in this group to access site greetings."
COM_HELLO_WORLD_GREETINGS_BATCH_OPTIONS="Batch process the selected Greetings"
COM_HELLO_WORLD_GREETINGS_BATCH_TIP="All changes will be applied to all selected Greetings"
COM_HELLO_WORLD_GREETINGS_BATCH_USE="Greetings Batch Use"
@@ -96,7 +96,7 @@ COM_HELLO_WORLD_GREETINGS_N_ITEMS_UNPUBLISHED_1="%s Greeting unpublished."
COM_HELLO_WORLD_GREETINGS_SUBMENU="Greetings Submenu"
COM_HELLO_WORLD_GREETINGS_SUBMENU_DESC="Allows the users in this group to submenu of greeting"
COM_HELLO_WORLD_GREETING_ACCESS_SITE="Greeting (Site) Access"
-COM_HELLO_WORLD_GREETING_ACCESS_SITE_DESC=" Allows the users in this group to access site greeting."
+COM_HELLO_WORLD_GREETING_ACCESS_SITE_DESC="Allows the users in this group to access site greeting."
COM_HELLO_WORLD_GREETING_CREATED_BY_DESC="The user that created this Greeting."
COM_HELLO_WORLD_GREETING_CREATED_BY_LABEL="Created By"
COM_HELLO_WORLD_GREETING_CREATED_DATE_DESC="The date this Greeting was created."
@@ -126,7 +126,7 @@ COM_HELLO_WORLD_HELP_MANAGER="Help"
COM_HELLO_WORLD_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BHELLO_WORLDB_WILL_NOT_FUNCTION_CORRECTLYP="
Please setup curl on your system, or hello_world will not function correctly!
" COM_HELLO_WORLD_IMPORT_CONTINUE="Continue" COM_HELLO_WORLD_IMPORT_DATA="Import Data" -COM_HELLO_WORLD_IMPORT_DATA_DESC=" Allows users in this group to import data." +COM_HELLO_WORLD_IMPORT_DATA_DESC="Allows users in this group to import data." COM_HELLO_WORLD_IMPORT_ERROR="Import error." COM_HELLO_WORLD_IMPORT_FAILED="Import Failed" COM_HELLO_WORLD_IMPORT_FILE_COLUMNS="File Columns" @@ -166,7 +166,7 @@ COM_HELLO_WORLD_KEEP_ORIGINAL_CATEGORY="- Keep Original Category -" COM_HELLO_WORLD_KEEP_ORIGINAL_STATE="- Keep Original State -" COM_HELLO_WORLD_LICENSE="License" COM_HELLO_WORLD_NEW="New" -COM_HELLO_WORLD_NOT_FOUND_OR_ACCESS_DENIED="Not found or access denied!" +COM_HELLO_WORLD_NOT_FOUND_OR_ACCESS_DENIED="Not found, or access denied." COM_HELLO_WORLD_NO_ACCESS_GRANTED="No Access Granted!" COM_HELLO_WORLD_PUBLISHED="Published" COM_HELLO_WORLD_SAVE_SUCCESS="Great! Item successfully saved." @@ -177,6 +177,6 @@ COM_HELLO_WORLD_SUBMENU_GREETINGS_FIELDS="Greetings Fields" COM_HELLO_WORLD_SUBMENU_GREETINGS_FIELDS_GROUPS="Greetings Field Groups" COM_HELLO_WORLD_TRASHED="Trashed" COM_HELLO_WORLD_USE_BATCH="Use Batch" -COM_HELLO_WORLD_USE_BATCH_DESC=" Allows users in this group to use batch copy/update method." +COM_HELLO_WORLD_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." COM_HELLO_WORLD_VERSION="Version" COM_HELLO_WORLD_WEBSITE="Website" \ No newline at end of file diff --git a/admin/language/en-GB/en-GB.com_hello_world.sys.ini b/admin/language/en-GB/en-GB.com_hello_world.sys.ini index dbee1d5..db514ba 100644 --- a/admin/language/en-GB/en-GB.com_hello_world.sys.ini +++ b/admin/language/en-GB/en-GB.com_hello_world.sys.ini @@ -1,17 +1,17 @@ COM_HELLO_WORLD="Hello World" COM_HELLO_WORLD_CONFIGURATION="Hello World Configuration" COM_HELLO_WORLD_EDIT_CREATED_BY="Edit Created By" -COM_HELLO_WORLD_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by." +COM_HELLO_WORLD_EDIT_CREATED_BY_DESC="Allows users in this group to edit created by." COM_HELLO_WORLD_EDIT_CREATED_DATE="Edit Created Date" -COM_HELLO_WORLD_EDIT_CREATED_DATE_DESC=" Allows users in this group to edit created date." +COM_HELLO_WORLD_EDIT_CREATED_DATE_DESC="Allows users in this group to edit created date." COM_HELLO_WORLD_EDIT_VERSIONS="Edit Version" -COM_HELLO_WORLD_EDIT_VERSIONS_DESC=" Allows users in this group to edit versions." +COM_HELLO_WORLD_EDIT_VERSIONS_DESC="Allows users in this group to edit versions." COM_HELLO_WORLD_EXPORT_DATA="Export Data" -COM_HELLO_WORLD_EXPORT_DATA_DESC=" Allows users in this group to export data." +COM_HELLO_WORLD_EXPORT_DATA_DESC="Allows users in this group to export data." COM_HELLO_WORLD_GREETINGS_ACCESS="Greetings Access" COM_HELLO_WORLD_GREETINGS_ACCESS_DESC="Allows the users in this group to access access greetings" COM_HELLO_WORLD_GREETINGS_ACCESS_SITE="Greetings (Site) Access" -COM_HELLO_WORLD_GREETINGS_ACCESS_SITE_DESC=" Allows the users in this group to access site greetings." +COM_HELLO_WORLD_GREETINGS_ACCESS_SITE_DESC="Allows the users in this group to access site greetings." COM_HELLO_WORLD_GREETINGS_BATCH_USE="Greetings Batch Use" COM_HELLO_WORLD_GREETINGS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch greetings" COM_HELLO_WORLD_GREETINGS_DASHBOARD_ADD="Greetings Dashboard Add" @@ -29,13 +29,13 @@ COM_HELLO_WORLD_GREETINGS_IMPORT_DESC="Allows the users in this group to import COM_HELLO_WORLD_GREETINGS_SUBMENU="Greetings Submenu" COM_HELLO_WORLD_GREETINGS_SUBMENU_DESC="Allows the users in this group to submenu of greeting" COM_HELLO_WORLD_GREETING_ACCESS_SITE="Greeting (Site) Access" -COM_HELLO_WORLD_GREETING_ACCESS_SITE_DESC=" Allows the users in this group to access site greeting." +COM_HELLO_WORLD_GREETING_ACCESS_SITE_DESC="Allows the users in this group to access site greeting." COM_HELLO_WORLD_IMPORT_DATA="Import Data" -COM_HELLO_WORLD_IMPORT_DATA_DESC=" Allows users in this group to import data." +COM_HELLO_WORLD_IMPORT_DATA_DESC="Allows users in this group to import data." COM_HELLO_WORLD_MENU="» Hello World" COM_HELLO_WORLD_MENU_GREETINGS="Greetings" COM_HELLO_WORLD_MENU_GREETINGS_DESC="Greetings" COM_HELLO_WORLD_MENU_GREETINGS_OPTION="Greetings" COM_HELLO_WORLD_MENU_GREETINGS_TITLE="Greetings" COM_HELLO_WORLD_USE_BATCH="Use Batch" -COM_HELLO_WORLD_USE_BATCH_DESC=" Allows users in this group to use batch copy/update method." \ No newline at end of file +COM_HELLO_WORLD_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." \ No newline at end of file diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 875d548..bca81c7 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage batchselection.php diff --git a/admin/layouts/greeting/details_left.php b/admin/layouts/greeting/details_left.php index f60e5e9..875b5d6 100644 --- a/admin/layouts/greeting/details_left.php +++ b/admin/layouts/greeting/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage details_left.php @@ -21,18 +21,31 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'greeting' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/greeting/metadata.php b/admin/layouts/greeting/metadata.php index c23d497..990ffd5 100644 --- a/admin/layouts/greeting/metadata.php +++ b/admin/layouts/greeting/metadata.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage metadata.php diff --git a/admin/layouts/greeting/publishing.php b/admin/layouts/greeting/publishing.php index 426f0de..d1f0cff 100644 --- a/admin/layouts/greeting/publishing.php +++ b/admin/layouts/greeting/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage publishing.php @@ -21,9 +21,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +// get the form $form = $displayData->getForm(); -$fields = $displayData->get('fields') ?: array( +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( 'created', 'created_by', 'modified', @@ -39,9 +50,11 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); ?> + setFieldAttribute($field, 'type', 'hidden'); ?> renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/models/forms/greeting.js b/admin/models/forms/greeting.js index 6eb0135..dca6112 100644 --- a/admin/models/forms/greeting.js +++ b/admin/models/forms/greeting.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage greeting.js diff --git a/admin/models/greeting.php b/admin/models/greeting.php index a83b33c..f013624 100644 --- a/admin/models/greeting.php +++ b/admin/models/greeting.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage greeting.php @@ -27,13 +27,26 @@ use Joomla\Registry\Registry; * Hello_world Greeting Model */ class Hello_worldModelGreeting extends JModelAdmin -{ +{ + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = array( + 'details' => array( + 'left' => array( + 'greeting' + ) + ) + ); + /** * @var string The prefix to use with controller messages. * @since 1.6 */ protected $text_prefix = 'COM_HELLO_WORLD'; - + /** * The type alias for this content type. * diff --git a/admin/models/greetings.php b/admin/models/greetings.php index caf0505..e8de9db 100644 --- a/admin/models/greetings.php +++ b/admin/models/greetings.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage greetings.php diff --git a/admin/models/hello_world.php b/admin/models/hello_world.php index 9e8e50b..49b3379 100644 --- a/admin/models/hello_world.php +++ b/admin/models/hello_world.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage hello_world.php diff --git a/admin/models/import.php b/admin/models/import.php index 7a033e4..e0a0e8d 100644 --- a/admin/models/import.php +++ b/admin/models/import.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage import.php diff --git a/admin/tables/greeting.php b/admin/tables/greeting.php index 2e3868d..f8ffe9d 100644 --- a/admin/tables/greeting.php +++ b/admin/tables/greeting.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage greeting.php diff --git a/admin/views/greeting/submitbutton.js b/admin/views/greeting/submitbutton.js index 90535f4..70a22e4 100644 --- a/admin/views/greeting/submitbutton.js +++ b/admin/views/greeting/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage submitbutton.js diff --git a/admin/views/greeting/tmpl/edit.php b/admin/views/greeting/tmpl/edit.php index 2ed1c76..d0b67f5 100644 --- a/admin/views/greeting/tmpl/edit.php +++ b/admin/views/greeting/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage edit.php diff --git a/admin/views/greeting/view.html.php b/admin/views/greeting/view.html.php index e25f908..ea74718 100644 --- a/admin/views/greeting/view.html.php +++ b/admin/views/greeting/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage view.html.php diff --git a/admin/views/greetings/tmpl/default.php b/admin/views/greetings/tmpl/default.php index c1993bc..09b1f82 100644 --- a/admin/views/greetings/tmpl/default.php +++ b/admin/views/greetings/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default.php diff --git a/admin/views/greetings/tmpl/default_batch_body.php b/admin/views/greetings/tmpl/default_batch_body.php index bd006ce..148b403 100644 --- a/admin/views/greetings/tmpl/default_batch_body.php +++ b/admin/views/greetings/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default_batch_body.php diff --git a/admin/views/greetings/tmpl/default_batch_footer.php b/admin/views/greetings/tmpl/default_batch_footer.php index 8865fbb..faf2729 100644 --- a/admin/views/greetings/tmpl/default_batch_footer.php +++ b/admin/views/greetings/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default_batch_footer.php diff --git a/admin/views/greetings/tmpl/default_body.php b/admin/views/greetings/tmpl/default_body.php index ac6abd8..2137082 100644 --- a/admin/views/greetings/tmpl/default_body.php +++ b/admin/views/greetings/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default_body.php diff --git a/admin/views/greetings/tmpl/default_foot.php b/admin/views/greetings/tmpl/default_foot.php index 42f1d1a..9a31702 100644 --- a/admin/views/greetings/tmpl/default_foot.php +++ b/admin/views/greetings/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default_foot.php diff --git a/admin/views/greetings/tmpl/default_head.php b/admin/views/greetings/tmpl/default_head.php index cf9ee13..cac9e30 100644 --- a/admin/views/greetings/tmpl/default_head.php +++ b/admin/views/greetings/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default_head.php diff --git a/admin/views/greetings/tmpl/default_toolbar.php b/admin/views/greetings/tmpl/default_toolbar.php index f95b41b..1cb2778 100644 --- a/admin/views/greetings/tmpl/default_toolbar.php +++ b/admin/views/greetings/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default_toolbar.php diff --git a/admin/views/greetings/view.html.php b/admin/views/greetings/view.html.php index a576968..5f23f4d 100644 --- a/admin/views/greetings/view.html.php +++ b/admin/views/greetings/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage view.html.php diff --git a/admin/views/hello_world/tmpl/default.php b/admin/views/hello_world/tmpl/default.php index 2180672..e898beb 100644 --- a/admin/views/hello_world/tmpl/default.php +++ b/admin/views/hello_world/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default.php diff --git a/admin/views/hello_world/tmpl/default_main.php b/admin/views/hello_world/tmpl/default_main.php index 913fc9d..9913310 100644 --- a/admin/views/hello_world/tmpl/default_main.php +++ b/admin/views/hello_world/tmpl/default_main.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default_main.php diff --git a/admin/views/hello_world/tmpl/default_vdm.php b/admin/views/hello_world/tmpl/default_vdm.php index 2b4edda..a0af6d6 100644 --- a/admin/views/hello_world/tmpl/default_vdm.php +++ b/admin/views/hello_world/tmpl/default_vdm.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default_vdm.php diff --git a/admin/views/hello_world/view.html.php b/admin/views/hello_world/view.html.php index ffcbf92..fcf27e6 100644 --- a/admin/views/hello_world/view.html.php +++ b/admin/views/hello_world/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage view.html.php diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index cc3905a..7180b92 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage default.php diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index 38d65c0..5c5dc2d 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 1.0.0 - @build 12th June, 2019 + @build 14th August, 2019 @created 20th September, 2017 @package Hello World @subpackage view.html.php diff --git a/hello_world.xml b/hello_world.xml index 5e6c525..0aeda02 100644 --- a/hello_world.xml +++ b/hello_world.xml @@ -1,7 +1,7 @@