Updated with JCB v2.10.0
This commit is contained in:
parent
e5d578dfbe
commit
7b89d65cf8
10
README.md
10
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;)
|
||||
|
||||
|
@ -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;)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -45,21 +45,21 @@ COM_HELLO_WORLD_DASHBOARD_GREETINGS="Greetings<br /><br />"
|
||||
COM_HELLO_WORLD_DASHBOARD_GREETING_ADD="Add Greeting<br /><br />"
|
||||
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="<h2>Curl Not Found!</h2><p>Please setup curl on your system, or <b>hello_world</b> will not function correctly!</p>"
|
||||
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"
|
@ -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."
|
||||
COM_HELLO_WORLD_USE_BATCH_DESC="Allows users in this group to use batch copy/update method."
|
@ -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
|
||||
|
@ -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();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
@ -28,6 +28,19 @@ use Joomla\Registry\Registry;
|
||||
*/
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="component" version="3.2" method="upgrade">
|
||||
<name>COM_HELLO_WORLD</name>
|
||||
<creationDate>12th June, 2019</creationDate>
|
||||
<creationDate>14th August, 2019</creationDate>
|
||||
<author>Llewellyn</author>
|
||||
<authorEmail>joomla@vdm.io</authorEmail>
|
||||
<authorUrl>https://www.vdm.io</authorUrl>
|
||||
@ -55,7 +55,6 @@
|
||||
<filename>hello_world.php</filename>
|
||||
<filename>hello_world.php</filename>
|
||||
<filename>router.php</filename>
|
||||
<filename>controller.php</filename>
|
||||
<folder>assets</folder>
|
||||
<folder>helpers</folder>
|
||||
<folder>controllers</folder>
|
||||
@ -81,12 +80,8 @@
|
||||
<filename>controller.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<filename>hello_world.php</filename>
|
||||
<filename>access.xml</filename>
|
||||
<filename>config.xml</filename>
|
||||
<filename>controller.php</filename>
|
||||
<filename>hello_world.php</filename>
|
||||
<filename>README.txt</filename>
|
||||
<filename>README.txt</filename>
|
||||
<folder>assets</folder>
|
||||
<folder>controllers</folder>
|
||||
<folder>helpers</folder>
|
||||
|
73
script.php
73
script.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 script.php
|
||||
@ -29,21 +29,27 @@ JHTML::_('behavior.modal');
|
||||
class com_hello_worldInstallerScript
|
||||
{
|
||||
/**
|
||||
* method to install the component
|
||||
* Constructor
|
||||
*
|
||||
* @return void
|
||||
* @param JAdapterInstance $parent The object responsible for running this script
|
||||
*/
|
||||
function install($parent)
|
||||
{
|
||||
|
||||
}
|
||||
public function __construct(JAdapterInstance $parent) {}
|
||||
|
||||
/**
|
||||
* method to uninstall the component
|
||||
* Called on installation
|
||||
*
|
||||
* @return void
|
||||
* @param JAdapterInstance $parent The object responsible for running this script
|
||||
*
|
||||
* @return boolean True on success
|
||||
*/
|
||||
function uninstall($parent)
|
||||
public function install(JAdapterInstance $parent) {}
|
||||
|
||||
/**
|
||||
* Called on uninstallation
|
||||
*
|
||||
* @param JAdapterInstance $parent The object responsible for running this script
|
||||
*/
|
||||
public function uninstall(JAdapterInstance $parent)
|
||||
{
|
||||
// Get Application object
|
||||
$app = JFactory::getApplication();
|
||||
@ -327,57 +333,63 @@ class com_hello_worldInstallerScript
|
||||
}
|
||||
|
||||
/**
|
||||
* method to update the component
|
||||
* Called on update
|
||||
*
|
||||
* @return void
|
||||
* @param JAdapterInstance $parent The object responsible for running this script
|
||||
*
|
||||
* @return boolean True on success
|
||||
*/
|
||||
function update($parent)
|
||||
{
|
||||
|
||||
}
|
||||
public function update(JAdapterInstance $parent){}
|
||||
|
||||
/**
|
||||
* method to run before an install/update/uninstall method
|
||||
* Called before any type of action
|
||||
*
|
||||
* @return void
|
||||
* @param string $type Which action is happening (install|uninstall|discover_install|update)
|
||||
* @param JAdapterInstance $parent The object responsible for running this script
|
||||
*
|
||||
* @return boolean True on success
|
||||
*/
|
||||
function preflight($type, $parent)
|
||||
public function preflight($type, JAdapterInstance $parent)
|
||||
{
|
||||
// get application
|
||||
$app = JFactory::getApplication();
|
||||
// is redundant ...hmmm
|
||||
if ($type == 'uninstall')
|
||||
// is redundant or so it seems ...hmmm let me know if it works again
|
||||
if ($type === 'uninstall')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// the default for both install and update
|
||||
$jversion = new JVersion();
|
||||
if (!$jversion->isCompatible('3.6.0'))
|
||||
if (!$jversion->isCompatible('3.8.0'))
|
||||
{
|
||||
$app->enqueueMessage('Please upgrade to at least Joomla! 3.6.0 before continuing!', 'error');
|
||||
$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');
|
||||
return false;
|
||||
}
|
||||
// do any updates needed
|
||||
if ($type == 'update')
|
||||
if ($type === 'update')
|
||||
{
|
||||
}
|
||||
// do any install needed
|
||||
if ($type == 'install')
|
||||
if ($type === 'install')
|
||||
{
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* method to run after an install/update/uninstall method
|
||||
* Called after any type of action
|
||||
*
|
||||
* @return void
|
||||
* @param string $type Which action is happening (install|uninstall|discover_install|update)
|
||||
* @param JAdapterInstance $parent The object responsible for running this script
|
||||
*
|
||||
* @return boolean True on success
|
||||
*/
|
||||
function postflight($type, $parent)
|
||||
public function postflight($type, JAdapterInstance $parent)
|
||||
{
|
||||
// get application
|
||||
$app = JFactory::getApplication();
|
||||
// set the default component settings
|
||||
if ($type == 'install')
|
||||
if ($type === 'install')
|
||||
{
|
||||
|
||||
// Get The Database object
|
||||
@ -429,7 +441,7 @@ class com_hello_worldInstallerScript
|
||||
</a>';
|
||||
}
|
||||
// do any updates needed
|
||||
if ($type == 'update')
|
||||
if ($type === 'update')
|
||||
{
|
||||
|
||||
// Get The Database object
|
||||
@ -470,5 +482,6 @@ class com_hello_worldInstallerScript
|
||||
</a>
|
||||
<h3>Upgrade to Version 1.0.0 Was Successful! Let us know if anything is not working as expected.</h3>';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 12th June, 2019
|
||||
@build 14th August, 2019
|
||||
@created 20th September, 2017
|
||||
@package Hello World
|
||||
@subpackage greet.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
|
||||
|
@ -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
|
||||
|
@ -3,7 +3,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 12th June, 2019
|
||||
@build 14th August, 2019
|
||||
@created 20th September, 2017
|
||||
@package Hello World
|
||||
@subpackage site.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 site.js
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -4,7 +4,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 12th June, 2019
|
||||
@build 14th August, 2019
|
||||
@created 20th September, 2017
|
||||
@package Hello World
|
||||
@subpackage category.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
|
||||
|
@ -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
|
||||
@ -312,38 +312,42 @@ abstract class Hello_worldHelper
|
||||
/**
|
||||
* Get any component's model
|
||||
**/
|
||||
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = 'Hello_world', $config = array())
|
||||
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $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
|
||||
|
@ -4,7 +4,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 12th June, 2019
|
||||
@build 14th August, 2019
|
||||
@created 20th September, 2017
|
||||
@package Hello World
|
||||
@subpackage route.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();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
@ -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
|
||||
|
@ -4,7 +4,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 12th June, 2019
|
||||
@build 14th August, 2019
|
||||
@created 20th September, 2017
|
||||
@package Hello World
|
||||
@subpackage greet.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
|
||||
@ -28,6 +28,19 @@ use Joomla\Registry\Registry;
|
||||
*/
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -4,7 +4,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 1.0.0
|
||||
@build 12th June, 2019
|
||||
@build 14th August, 2019
|
||||
@created 20th September, 2017
|
||||
@package Hello World
|
||||
@subpackage router.php
|
||||
@ -184,6 +184,8 @@ class Hello_worldRouter extends JComponentRouterBase
|
||||
{
|
||||
$getTable = '#__categories';
|
||||
$query->from($db->quoteName($getTable));
|
||||
// we need this to target the components categories (TODO will keep an eye on this)
|
||||
$query->where($db->quoteName('extension') . ' LIKE '. $db->quote((string)'com_' . $main . '%'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -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
|
||||
@ -23,4 +23,7 @@ defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
?>
|
||||
<?php echo $this->toolbar->render(); ?>
|
||||
<h2><?php echo $this->item->greeting; ?></h2>
|
||||
|
||||
<!--[JCBGUI.site_view.default.51.$$$$]-->
|
||||
<h2><?php echo $this->item->greeting; ?></h2><!--[/JCBGUI$$$$]-->
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
@ -21,12 +21,18 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
$edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit";
|
||||
|
||||
/***[JCBGUI.site_view.php_view.50.$$$$]***/
|
||||
$edit = "index.php?option=com_hello_world&view=greetings&task=greeting.edit";/***[/JCBGUI$$$$]***/
|
||||
|
||||
|
||||
?>
|
||||
<?php echo $this->toolbar->render(); ?>
|
||||
|
||||
<!--[JCBGUI.site_view.default.50.$$$$]-->
|
||||
<ul class="uk-list uk-list-striped">
|
||||
<?php foreach ($this->items as $item): ?>
|
||||
<li><?php echo JText::_('COM_HELLO_WORLD_GREETING'); ?>: <a href="<?php echo JRoute::_(Hello_worldHelperRoute::getGreetRoute($item->slug)); ?>"><?php echo $item->greeting; ?></a> <a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo JText::_('COM_HELLO_WORLD_EDIT'); ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</ul><!--[/JCBGUI$$$$]-->
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user