Updated with JCB v2.10.0

This commit is contained in:
Llewellyn van der Merwe 2019-08-14 03:58:42 +02:00
parent bee36c05c8
commit 0ea8a253df
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
63 changed files with 983 additions and 249 deletions

View File

@ -23,24 +23,24 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Sermon Distributor](https://www.vdm.io/) + *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015 + *First Build*: 22nd October, 2015
+ *Last Build*: 12th June, 2019 + *Last Build*: 14th August, 2019
+ *Version*: 2.0.x + *Version*: 2.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time :hourglass: ## Build Time :hourglass:
**187 Hours** or **23 Eight Hour Days** (actual time the author saved - **189 Hours** or **24 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder)) due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (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.) > never making one mistake or taking any coffee break.)
+ *Line count*: **66946** + *Line count*: **67680**
+ *File count*: **445** + *File count*: **445**
+ *Folder count*: **93** + *Folder count*: **93**
**123 Hours** or **16 Eight Hour Days** (the actual time the author spent) **124 Hours** or **15 Eight Hour Days** (the actual time the author spent)
> (with the following break down: > (with the following break down:
> **debugging @47hours** = codingtime / 4; > **debugging @47hours** = codingtime / 4;
@ -48,7 +48,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder
> **mapping @19hours** = codingtime / 10; > **mapping @19hours** = codingtime / 10;
> **office @31hours** = codingtime / 6;) > **office @31hours** = codingtime / 6;)
**310 Hours** or **39 Eight Hour Days** **313 Hours** or **39 Eight Hour Days**
(a total of the realistic time frame for this project) (a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,

View File

@ -23,24 +23,24 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Sermon Distributor](https://www.vdm.io/) + *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015 + *First Build*: 22nd October, 2015
+ *Last Build*: 12th June, 2019 + *Last Build*: 14th August, 2019
+ *Version*: 2.0.x + *Version*: 2.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time :hourglass: ## Build Time :hourglass:
**187 Hours** or **23 Eight Hour Days** (actual time the author saved - **189 Hours** or **24 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder)) due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (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.) > never making one mistake or taking any coffee break.)
+ *Line count*: **66946** + *Line count*: **67680**
+ *File count*: **445** + *File count*: **445**
+ *Folder count*: **93** + *Folder count*: **93**
**123 Hours** or **16 Eight Hour Days** (the actual time the author spent) **124 Hours** or **15 Eight Hour Days** (the actual time the author spent)
> (with the following break down: > (with the following break down:
> **debugging @47hours** = codingtime / 4; > **debugging @47hours** = codingtime / 4;
@ -48,7 +48,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder
> **mapping @19hours** = codingtime / 10; > **mapping @19hours** = codingtime / 10;
> **office @31hours** = codingtime / 6;) > **office @31hours** = codingtime / 6;)
**310 Hours** or **39 Eight Hour Days** **313 Hours** or **39 Eight Hour Days**
(a total of the realistic time frame for this project) (a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,

View File

@ -53,7 +53,7 @@ class SermondistributorControllerAjax extends JControllerLegacy
// Check Token! // Check Token!
$token = JSession::getFormToken(); $token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM'); $call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token) if($jinput->get($token, 0, 'ALNUM') || $token === $call_token)
{ {
$task = $this->getTask(); $task = $this->getTask();
switch($task) switch($task)

View File

@ -3541,38 +3541,42 @@ abstract class SermondistributorHelper
/** /**
* Get any component's model * Get any component's model
**/ **/
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'Sermondistributor', $config = array()) public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = 'Sermondistributor', $config = array())
{ {
// fix the name // fix the name
$name = self::safeString($name); $name = self::safeString($name);
// full path // full path to models
$fullPath = $path . '/models'; $fullPathModels = $path . '/models';
// set prefix
$prefix = $component.'Model';
// load the model file // 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 // get instance
$model = JModelLegacy::getInstance($name, $prefix, $config); $model = JModelLegacy::getInstance($name, $Component . 'Model', $config);
// if model not found (strange) // if model not found (strange)
if ($model == false) if ($model == false)
{ {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
// get file path // get file path
$filePath = $path . '/' . $name . '.php'; $filePath = $path . '/' . $name . '.php';
$fullPath = $fullPath.'/'.$name.'.php'; $fullPathModel = $fullPathModels . '/' . $name . '.php';
// check if it exists // check if it exists
if (JFile::exists($filePath)) if (JFile::exists($filePath))
{ {
// get the file // get the file
require_once $filePath; require_once $filePath;
} }
elseif (JFile::exists($fullPath)) elseif (JFile::exists($fullPathModel))
{ {
// get the file // get the file
require_once $fullPath; require_once $fullPathModel;
} }
// build class names // build class names
$modelClass = $prefix.$name; $modelClass = $Component . 'Model' . $name;
if (class_exists($modelClass)) if (class_exists($modelClass))
{ {
// initialize the model // initialize the model

View File

@ -758,7 +758,7 @@ COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TITLE_MESSAGE="Error! Please add title here.
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE="Type" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE="Type"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE_DESCRIPTION="Select the help type." COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE_DESCRIPTION="Select the help type."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE_LABEL="Type" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TYPE_LABEL="Type"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL="Url" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL="URL"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_DESCRIPTION="Enter url" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_DESCRIPTION="Enter url"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_HINT="http://www.example.com" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_HINT="http://www.example.com"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_LABEL="URL" COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_LABEL="URL"
@ -933,7 +933,7 @@ COM_SERMONDISTRIBUTOR_LOCAL_LISTING_WAS_CLEARED_SUCCESSFULLY="Local listing was
COM_SERMONDISTRIBUTOR_LOCAL_LISTING_WAS_NOT_CLEARED="Local listing was not cleared." COM_SERMONDISTRIBUTOR_LOCAL_LISTING_WAS_NOT_CLEARED="Local listing was not cleared."
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER="Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER="Manual Updater"
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS="Manual Updater Access" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS="Manual Updater Access"
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS_DESC="Allows the users in this group to access Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS_DESC="Allows the users in this group to access manual updater."
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST="Manual Updater Dashboard List" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST="Manual Updater Dashboard List"
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Manual Updater"
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DESC="Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DESC="Manual Updater"
@ -944,7 +944,7 @@ COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_SUBMENU_DESC="Allows the users in this grou
COM_SERMONDISTRIBUTOR_NEW="New" COM_SERMONDISTRIBUTOR_NEW="New"
COM_SERMONDISTRIBUTOR_NEW_ISSUE="New Issue" COM_SERMONDISTRIBUTOR_NEW_ISSUE="New Issue"
COM_SERMONDISTRIBUTOR_NOTICE="Notice!" COM_SERMONDISTRIBUTOR_NOTICE="Notice!"
COM_SERMONDISTRIBUTOR_NOT_FOUND_OR_ACCESS_DENIED="Not found or access denied!" COM_SERMONDISTRIBUTOR_NOT_FOUND_OR_ACCESS_DENIED="Not found, or access denied."
COM_SERMONDISTRIBUTOR_NO_ACCESS_GRANTED="No Access Granted!" COM_SERMONDISTRIBUTOR_NO_ACCESS_GRANTED="No Access Granted!"
COM_SERMONDISTRIBUTOR_NO_CRONJOB_PATH_FOUND_FOR_S="No cronjob path found for (%s)" COM_SERMONDISTRIBUTOR_NO_CRONJOB_PATH_FOUND_FOR_S="No cronjob path found for (%s)"
COM_SERMONDISTRIBUTOR_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cronjob path found since incorrect type requested." COM_SERMONDISTRIBUTOR_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cronjob path found since incorrect type requested."
@ -1380,7 +1380,7 @@ COM_SERMONDISTRIBUTOR_SERMON_STATUS="Status"
COM_SERMONDISTRIBUTOR_SERMON_TAGS="Tags" COM_SERMONDISTRIBUTOR_SERMON_TAGS="Tags"
COM_SERMONDISTRIBUTOR_SERMON_TAGS_DESCRIPTION="Assign tags to SERMON items. Tag names must be unique." COM_SERMONDISTRIBUTOR_SERMON_TAGS_DESCRIPTION="Assign tags to SERMON items. Tag names must be unique."
COM_SERMONDISTRIBUTOR_SERMON_TAGS_LABEL="Tags" COM_SERMONDISTRIBUTOR_SERMON_TAGS_LABEL="Tags"
COM_SERMONDISTRIBUTOR_SERMON_URL="Url" COM_SERMONDISTRIBUTOR_SERMON_URL="URL"
COM_SERMONDISTRIBUTOR_SERMON_URL_DESCRIPTION="The url to download the sermon." COM_SERMONDISTRIBUTOR_SERMON_URL_DESCRIPTION="The url to download the sermon."
COM_SERMONDISTRIBUTOR_SERMON_URL_HINT="http://www.domain.com/direct-link-to-download.mp3" COM_SERMONDISTRIBUTOR_SERMON_URL_HINT="http://www.domain.com/direct-link-to-download.mp3"
COM_SERMONDISTRIBUTOR_SERMON_URL_LABEL="File URL" COM_SERMONDISTRIBUTOR_SERMON_URL_LABEL="File URL"

View File

@ -113,7 +113,7 @@ COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_IMPORT_DESC="Allows the users in this group
COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_SUBMENU="Local Listings Submenu" COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_SUBMENU="Local Listings Submenu"
COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_SUBMENU_DESC="Allows the users in this group to submenu of local listing" COM_SERMONDISTRIBUTOR_LOCAL_LISTINGS_SUBMENU_DESC="Allows the users in this group to submenu of local listing"
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS="Manual Updater Access" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS="Manual Updater Access"
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS_DESC="Allows the users in this group to access Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_ACCESS_DESC="Allows the users in this group to access manual updater."
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST="Manual Updater Dashboard List" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST="Manual Updater Dashboard List"
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Manual Updater" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Manual Updater"
COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS="Manual Updater External Sources Button Access" COM_SERMONDISTRIBUTOR_MANUAL_UPDATER_EXTERNAL_SOURCES_BUTTON_ACCESS="Manual Updater External Sources Button Access"

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'build', 'build',
'note_manual_externalsource', 'note_manual_externalsource',
'note_auto_externalsource' 'note_auto_externalsource'
@ -36,6 +47,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical"> <div class="form-vertical">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -44,3 +56,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'description', 'description',
'externalsources' 'externalsources'
); );
@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'sharedurl', 'sharedurl',
'folder', 'folder',
'apicronjob_note' 'apicronjob_note'
@ -36,6 +47,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical"> <div class="form-vertical">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -44,3 +56,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'oauthtoken', 'oauthtoken',
'generated_access_token_note', 'generated_access_token_note',
'permissiontype', 'permissiontype',
@ -38,9 +49,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'update_method', 'update_method',
'update_timer', 'update_timer',
'filetypes' 'filetypes'
@ -36,9 +47,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,15 +25,27 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'not_required' 'not_required'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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',
'created_by', 'created_by',
'modified', 'modified',
@ -37,9 +48,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'published', 'published',
'ordering', 'ordering',
'version', 'version',
@ -38,9 +49,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'title', 'title',
'alias' 'alias'
); );
@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,15 +25,27 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'content' 'content'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical"> <div class="form-vertical">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'target', 'target',
'groups', 'groups',
'location', 'location',
@ -38,9 +49,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'type', 'type',
'url', 'url',
'article' 'article'
@ -36,9 +47,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,15 +25,27 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'not_required' 'not_required'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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',
'created_by', 'created_by',
'modified', 'modified',
@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'name', 'name',
'size' 'size'
); );
@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'key', 'key',
'url' 'url'
); );
@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical"> <div class="form-vertical">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,18 +25,31 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'external_source' 'external_source'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,18 +25,31 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'build' 'build'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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',
'created_by', 'created_by',
'modified', 'modified',
@ -37,9 +48,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'published', 'published',
'ordering', 'ordering',
'version', 'version',
@ -38,9 +49,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'name', 'name',
'alias' 'alias'
); );
@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,15 +25,27 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'description' 'description'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical"> <div class="form-vertical">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,18 +25,31 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'icon' 'icon'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'email', 'email',
'website' 'website'
); );
@ -35,9 +46,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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',
'created_by', 'created_by',
'modified', 'modified',
@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'name', 'name',
'alias' 'alias'
); );
@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,15 +25,27 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'description' 'description'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical"> <div class="form-vertical">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,18 +25,31 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'icon' 'icon'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,18 +25,31 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'scripture' 'scripture'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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',
'created_by', 'created_by',
'modified', 'modified',
@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'name', 'name',
'alias', 'alias',
'preacher' 'preacher'
@ -36,6 +47,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -44,3 +56,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,15 +25,27 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'description' 'description'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical"> <div class="form-vertical">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -42,3 +54,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'scripture', 'scripture',
'short_description', 'short_description',
'icon' 'icon'
@ -36,9 +47,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'series', 'series',
'catid', 'catid',
'tags' 'tags'
@ -36,9 +47,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'not_required', 'not_required',
'auto_sermons' 'auto_sermons'
); );
@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'link_type', 'link_type',
'note_link_directed', 'note_link_directed',
'note_link_encrypted', 'note_link_encrypted',
@ -43,6 +54,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-vertical"> <div class="form-vertical">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -51,3 +63,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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',
'created_by', 'created_by',
'modified', 'modified',
@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'filename', 'filename',
'sermon' 'sermon'
); );
@ -35,6 +46,7 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<div class="form-inline form-inline-header"> <div class="form-inline form-inline-header">
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
@ -43,3 +55,4 @@ $hiddenFields = $displayData->get('hidden_fields') ?: array();
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'preacher', 'preacher',
'series' 'series'
); );
@ -35,9 +46,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,18 +25,31 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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(
'counter' 'counter'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -25,9 +25,20 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// get the form
$form = $displayData->getForm(); $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',
'created_by', 'created_by',
'modified', 'modified',
@ -43,9 +54,11 @@ $fields = $displayData->get('fields') ?: array(
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();
?> ?>
<?php if ($fields && count((array) $fields)) :?>
<?php foreach($fields as $field): ?> <?php foreach($fields as $field): ?>
<?php if (in_array($field, $hiddenFields)) : ?> <?php if (in_array($field, $hiddenFields)) : ?>
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?> <?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
<?php endif; ?> <?php endif; ?>
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> <?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?>

View File

@ -32,6 +32,47 @@ use Joomla\Registry\Registry;
*/ */
class SermondistributorModelExternal_source extends JModelAdmin class SermondistributorModelExternal_source extends JModelAdmin
{ {
/**
* The tab layout fields array.
*
* @var array
*/
protected $tabLayoutFields = array(
'details' => array(
'left' => array(
'oauthtoken',
'generated_access_token_note',
'permissiontype',
'app_limitation_note',
'dropboxoptions'
),
'right' => array(
'update_method',
'update_timer',
'filetypes'
),
'fullwidth' => array(
'sharedurl',
'folder',
'apicronjob_note'
),
'above' => array(
'description',
'externalsources'
),
'under' => array(
'not_required'
)
),
'build_option' => array(
'fullwidth' => array(
'build',
'note_manual_externalsource',
'note_auto_externalsource'
)
)
);
/** /**
* @var string The prefix to use with controller messages. * @var string The prefix to use with controller messages.
* @since 1.6 * @since 1.6

View File

@ -51,15 +51,15 @@ class JFormFieldExternalsource extends JFormFieldList
protected function getInput() protected function getInput()
{ {
// see if we should add buttons // see if we should add buttons
$setButton = $this->getAttribute('button'); $set_button = $this->getAttribute('button');
// get html // get html
$html = parent::getInput(); $html = parent::getInput();
// if true set button // if true set button
if ($setButton === 'true') if ($set_button === 'true')
{ {
$button = array(); $button = array();
$script = array(); $script = array();
$buttonName = $this->getAttribute('name'); $button_code_name = $this->getAttribute('name');
// get the input from url // get the input from url
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$jinput = $app->input; $jinput = $app->input;
@ -83,55 +83,52 @@ class JFormFieldExternalsource extends JFormFieldList
$ref .= '&amp;return=' . $_return; $ref .= '&amp;return=' . $_return;
$refJ .= '&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(); $user = JFactory::getUser();
// only add if user allowed to create external_source // only add if user allowed to create external_source
if ($user->authorise('external_source.create', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. if ($user->authorise('external_source.create', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area.
{ {
// build Create button // build Create button
$buttonNamee = trim($buttonName); $button[] = '<a id="'.$button_code_name.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $button_label).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_sermondistributor&amp;view=external_source&amp;layout=edit'.$ref.'" > href="index.php?option=com_sermondistributor&amp;view=external_source&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>'; <span class="icon-new icon-white"></span></a>';
} }
// only add if user allowed to edit external_source // only add if user allowed to edit external_source
if (($buttonName === 'external_source' || $buttonName === 'external_sources') && $user->authorise('external_source.edit', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. if ($user->authorise('external_source.edit', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area.
{ {
// build edit button // build edit button
$buttonNamee = trim($buttonName); $button[] = '<a id="'.$button_code_name.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $button_label).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>'; <span class="icon-edit"></span></a>';
// build script // build script
$script[] = " $script[] = "
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) { jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault(); e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
".$buttonName."Button(".$buttonName."Value); ".$button_code_name."Button(".$button_code_name."Value);
}); });
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
".$buttonName."Button(".$buttonName."Value); ".$button_code_name."Button(".$button_code_name."Value);
}); });
function ".$buttonName."Button(value) { function ".$button_code_name."Button(value) {
if (value > 0) { if (value > 0) {
// hide the create button // hide the create button
jQuery('#".$buttonName."Create').hide(); jQuery('#".$button_code_name."Create').hide();
// show edit button // show edit button
jQuery('#".$buttonName."Edit').show(); jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_sermondistributor&view=external_sources&task=external_source.edit&id='+value+'".$refJ."'; var url = 'index.php?option=com_sermondistributor&view=external_sources&task=external_source.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url); jQuery('#".$button_code_name."Edit').attr('href', url);
} else { } else {
// show the create button // show the create button
jQuery('#".$buttonName."Create').show(); jQuery('#".$button_code_name."Create').show();
// hide edit button // hide edit button
jQuery('#".$buttonName."Edit').hide(); jQuery('#".$button_code_name."Edit').hide();
} }
}"; }";
} }

View File

@ -51,15 +51,15 @@ class JFormFieldSermon extends JFormFieldList
protected function getInput() protected function getInput()
{ {
// see if we should add buttons // see if we should add buttons
$setButton = $this->getAttribute('button'); $set_button = $this->getAttribute('button');
// get html // get html
$html = parent::getInput(); $html = parent::getInput();
// if true set button // if true set button
if ($setButton === 'true') if ($set_button === 'true')
{ {
$button = array(); $button = array();
$script = array(); $script = array();
$buttonName = $this->getAttribute('name'); $button_code_name = $this->getAttribute('name');
// get the input from url // get the input from url
$app = JFactory::getApplication(); $app = JFactory::getApplication();
$jinput = $app->input; $jinput = $app->input;
@ -83,55 +83,52 @@ class JFormFieldSermon extends JFormFieldList
$ref .= '&amp;return=' . $_return; $ref .= '&amp;return=' . $_return;
$refJ .= '&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(); $user = JFactory::getUser();
// only add if user allowed to create sermon // only add if user allowed to create sermon
if ($user->authorise('sermon.create', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. if ($user->authorise('sermon.create', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area.
{ {
// build Create button // build Create button
$buttonNamee = trim($buttonName); $button[] = '<a id="'.$button_code_name.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $button_label).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_CREATE_NEW_S', $buttonNamee).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_sermondistributor&amp;view=sermon&amp;layout=edit'.$ref.'" > href="index.php?option=com_sermondistributor&amp;view=sermon&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>'; <span class="icon-new icon-white"></span></a>';
} }
// only add if user allowed to edit sermon // only add if user allowed to edit sermon
if (($buttonName === 'sermon' || $buttonName === 'sermons') && $user->authorise('sermon.edit', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area. if ($user->authorise('sermon.edit', 'com_sermondistributor') && $app->isAdmin()) // TODO for now only in admin area.
{ {
// build edit button // build edit button
$buttonNamee = trim($buttonName); $button[] = '<a id="'.$button_code_name.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $button_label).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>'; <span class="icon-edit"></span></a>';
// build script // build script
$script[] = " $script[] = "
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) { jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
e.preventDefault(); e.preventDefault();
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
".$buttonName."Button(".$buttonName."Value); ".$button_code_name."Button(".$button_code_name."Value);
}); });
var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
".$buttonName."Button(".$buttonName."Value); ".$button_code_name."Button(".$button_code_name."Value);
}); });
function ".$buttonName."Button(value) { function ".$button_code_name."Button(value) {
if (value > 0) { if (value > 0) {
// hide the create button // hide the create button
jQuery('#".$buttonName."Create').hide(); jQuery('#".$button_code_name."Create').hide();
// show edit button // show edit button
jQuery('#".$buttonName."Edit').show(); jQuery('#".$button_code_name."Edit').show();
var url = 'index.php?option=com_sermondistributor&view=sermons&task=sermon.edit&id='+value+'".$refJ."'; var url = 'index.php?option=com_sermondistributor&view=sermons&task=sermon.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url); jQuery('#".$button_code_name."Edit').attr('href', url);
} else { } else {
// show the create button // show the create button
jQuery('#".$buttonName."Create').show(); jQuery('#".$button_code_name."Create').show();
// hide edit button // hide edit button
jQuery('#".$buttonName."Edit').hide(); jQuery('#".$button_code_name."Edit').hide();
} }
}"; }";
} }

View File

@ -26,8 +26,7 @@ jform_vvvvvwxvwf_required = false;
jform_vvvvvwyvwg_required = false; jform_vvvvvwyvwg_required = false;
jform_vvvvvwzvwh_required = false; jform_vvvvvwzvwh_required = false;
jform_vvvvvxavwi_required = false; jform_vvvvvxavwi_required = false;
jform_vvvvvxbvwj_required = false; jform_vvvvvxcvwj_required = false;
jform_vvvvvxcvwk_required = false;
// Initial Script // Initial Script
jQuery(document).ready(function() jQuery(document).ready(function()
@ -247,28 +246,10 @@ function vvvvvxb(type_vvvvvxb)
if (type) if (type)
{ {
jQuery('#jform_content-lbl').closest('.control-group').show(); jQuery('#jform_content-lbl').closest('.control-group').show();
// add required attribute to content field
if (jform_vvvvvxbvwj_required)
{
updateFieldRequired('content',0);
jQuery('#jform_content').prop('required','required');
jQuery('#jform_content').attr('aria-required',true);
jQuery('#jform_content').addClass('required');
jform_vvvvvxbvwj_required = false;
}
} }
else else
{ {
jQuery('#jform_content-lbl').closest('.control-group').hide(); jQuery('#jform_content-lbl').closest('.control-group').hide();
// remove required attribute from content field
if (!jform_vvvvvxbvwj_required)
{
updateFieldRequired('content',1);
jQuery('#jform_content').removeAttr('required');
jQuery('#jform_content').removeAttr('aria-required');
jQuery('#jform_content').removeClass('required');
jform_vvvvvxbvwj_required = true;
}
} }
} }
@ -291,26 +272,26 @@ function vvvvvxc(target_vvvvvxc)
{ {
jQuery('#jform_groups').closest('.control-group').show(); jQuery('#jform_groups').closest('.control-group').show();
// add required attribute to groups field // add required attribute to groups field
if (jform_vvvvvxcvwk_required) if (jform_vvvvvxcvwj_required)
{ {
updateFieldRequired('groups',0); updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required'); jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true); jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required'); jQuery('#jform_groups').addClass('required');
jform_vvvvvxcvwk_required = false; jform_vvvvvxcvwj_required = false;
} }
} }
else else
{ {
jQuery('#jform_groups').closest('.control-group').hide(); jQuery('#jform_groups').closest('.control-group').hide();
// remove required attribute from groups field // remove required attribute from groups field
if (!jform_vvvvvxcvwk_required) if (!jform_vvvvvxcvwj_required)
{ {
updateFieldRequired('groups',1); updateFieldRequired('groups',1);
jQuery('#jform_groups').removeAttr('required'); jQuery('#jform_groups').removeAttr('required');
jQuery('#jform_groups').removeAttr('aria-required'); jQuery('#jform_groups').removeAttr('aria-required');
jQuery('#jform_groups').removeClass('required'); jQuery('#jform_groups').removeClass('required');
jform_vvvvvxcvwk_required = true; jform_vvvvvxcvwj_required = true;
} }
} }
} }

View File

@ -202,7 +202,6 @@
height="300 px" height="300 px"
buttons="false" buttons="false"
filter="safehtml" filter="safehtml"
required="true"
/> />
<!-- Article Field. Type: Articles. (custom) --> <!-- Article Field. Type: Articles. (custom) -->
<field <field

View File

@ -32,6 +32,38 @@ use Joomla\Registry\Registry;
*/ */
class SermondistributorModelHelp_document extends JModelAdmin class SermondistributorModelHelp_document extends JModelAdmin
{ {
/**
* The tab layout fields array.
*
* @var array
*/
protected $tabLayoutFields = array(
'details' => array(
'left' => array(
'target',
'groups',
'location',
'admin_view',
'site_view'
),
'right' => array(
'type',
'url',
'article'
),
'fullwidth' => array(
'content'
),
'above' => array(
'title',
'alias'
),
'under' => array(
'not_required'
)
)
);
/** /**
* @var string The prefix to use with controller messages. * @var string The prefix to use with controller messages.
* @since 1.6 * @since 1.6

View File

@ -32,6 +32,30 @@ use Joomla\Registry\Registry;
*/ */
class SermondistributorModelLocal_listing extends JModelAdmin class SermondistributorModelLocal_listing extends JModelAdmin
{ {
/**
* The tab layout fields array.
*
* @var array
*/
protected $tabLayoutFields = array(
'details' => array(
'left' => array(
'external_source'
),
'right' => array(
'build'
),
'fullwidth' => array(
'key',
'url'
),
'above' => array(
'name',
'size'
)
)
);
/** /**
* @var string The prefix to use with controller messages. * @var string The prefix to use with controller messages.
* @since 1.6 * @since 1.6

View File

@ -32,6 +32,30 @@ use Joomla\Registry\Registry;
*/ */
class SermondistributorModelPreacher extends JModelAdmin class SermondistributorModelPreacher extends JModelAdmin
{ {
/**
* The tab layout fields array.
*
* @var array
*/
protected $tabLayoutFields = array(
'details' => array(
'left' => array(
'icon'
),
'right' => array(
'email',
'website'
),
'fullwidth' => array(
'description'
),
'above' => array(
'name',
'alias'
)
)
);
/** /**
* @var string The prefix to use with controller messages. * @var string The prefix to use with controller messages.
* @since 1.6 * @since 1.6

View File

@ -32,6 +32,29 @@ use Joomla\Registry\Registry;
*/ */
class SermondistributorModelSeries extends JModelAdmin class SermondistributorModelSeries extends JModelAdmin
{ {
/**
* The tab layout fields array.
*
* @var array
*/
protected $tabLayoutFields = array(
'details' => array(
'left' => array(
'icon'
),
'right' => array(
'scripture'
),
'fullwidth' => array(
'description'
),
'above' => array(
'name',
'alias'
)
)
);
/** /**
* @var string The prefix to use with controller messages. * @var string The prefix to use with controller messages.
* @since 1.6 * @since 1.6

View File

@ -32,6 +32,52 @@ use Joomla\Registry\Registry;
*/ */
class SermondistributorModelSermon extends JModelAdmin class SermondistributorModelSermon extends JModelAdmin
{ {
/**
* The tab layout fields array.
*
* @var array
*/
protected $tabLayoutFields = array(
'details' => array(
'left' => array(
'scripture',
'short_description',
'icon'
),
'right' => array(
'series',
'catid',
'tags'
),
'fullwidth' => array(
'description'
),
'above' => array(
'name',
'alias',
'preacher'
),
'under' => array(
'not_required',
'auto_sermons'
)
),
'files' => array(
'fullwidth' => array(
'link_type',
'note_link_directed',
'note_link_encrypted',
'source',
'build',
'note_manual_externalsource',
'note_auto_externalsource',
'manual_files',
'local_files',
'url'
)
)
);
/** /**
* @var string The prefix to use with controller messages. * @var string The prefix to use with controller messages.
* @since 1.6 * @since 1.6

View File

@ -32,6 +32,27 @@ use Joomla\Registry\Registry;
*/ */
class SermondistributorModelStatistic extends JModelAdmin class SermondistributorModelStatistic extends JModelAdmin
{ {
/**
* The tab layout fields array.
*
* @var array
*/
protected $tabLayoutFields = array(
'details' => array(
'left' => array(
'preacher',
'series'
),
'right' => array(
'counter'
),
'above' => array(
'filename',
'sermon'
)
)
);
/** /**
* @var string The prefix to use with controller messages. * @var string The prefix to use with controller messages.
* @since 1.6 * @since 1.6

View File

@ -33,21 +33,27 @@ JHTML::_('behavior.modal');
class com_sermondistributorInstallerScript class com_sermondistributorInstallerScript
{ {
/** /**
* 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 // Get Application object
$app = JFactory::getApplication(); $app = JFactory::getApplication();
@ -771,38 +777,40 @@ class com_sermondistributorInstallerScript
} }
/** /**
* 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 // get application
$app = JFactory::getApplication(); $app = JFactory::getApplication();
// is redundant ...hmmm // is redundant or so it seems ...hmmm let me know if it works again
if ($type == 'uninstall') if ($type === 'uninstall')
{ {
return true; return true;
} }
// the default for both install and update // the default for both install and update
$jversion = new JVersion(); $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; return false;
} }
// do any updates needed // do any updates needed
if ($type == 'update') if ($type === 'update')
{ {
// load the helper class // load the helper class
JLoader::register('SermondistributorHelper', JPATH_ADMINISTRATOR . '/components/com_sermondistributor/helpers/sermondistributor.php'); JLoader::register('SermondistributorHelper', JPATH_ADMINISTRATOR . '/components/com_sermondistributor/helpers/sermondistributor.php');
@ -899,22 +907,26 @@ class com_sermondistributorInstallerScript
} }
} }
// do any install needed // 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 // get application
$app = JFactory::getApplication(); $app = JFactory::getApplication();
// set the default component settings // set the default component settings
if ($type == 'install') if ($type === 'install')
{ {
// Get The Database object // Get The Database object
@ -1050,7 +1062,7 @@ class com_sermondistributorInstallerScript
</a>'; </a>';
} }
// do any updates needed // do any updates needed
if ($type == 'update') if ($type === 'update')
{ {
// Get The Database object // Get The Database object
@ -1381,5 +1393,6 @@ class com_sermondistributorInstallerScript
</a> </a>
<h3>Upgrade to Version 2.0.2 Was Successful! Let us know if anything is not working as expected.</h3>'; <h3>Upgrade to Version 2.0.2 Was Successful! Let us know if anything is not working as expected.</h3>';
} }
return true;
} }
} }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_SERMONDISTRIBUTOR</name> <name>COM_SERMONDISTRIBUTOR</name>
<creationDate>12th June, 2019</creationDate> <creationDate>14th August, 2019</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail> <authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl> <authorUrl>https://www.vdm.io/</authorUrl>
@ -56,9 +56,7 @@
<filename>index.html</filename> <filename>index.html</filename>
<filename>router.php</filename> <filename>router.php</filename>
<filename>sermondistributor.php</filename> <filename>sermondistributor.php</filename>
<filename>sermondistributor.php</filename>
<filename>router.php</filename> <filename>router.php</filename>
<filename>controller.php</filename>
<folder>assets</folder> <folder>assets</folder>
<folder>helpers</folder> <folder>helpers</folder>
<folder>controllers</folder> <folder>controllers</folder>
@ -86,11 +84,6 @@
<filename>controller.php</filename> <filename>controller.php</filename>
<filename>index.html</filename> <filename>index.html</filename>
<filename>sermondistributor.php</filename> <filename>sermondistributor.php</filename>
<filename>access.xml</filename>
<filename>config.xml</filename>
<filename>controller.php</filename>
<filename>sermondistributor.php</filename>
<filename>README.txt</filename>
<filename>README.txt</filename> <filename>README.txt</filename>
<folder>assets</folder> <folder>assets</folder>
<folder>controllers</folder> <folder>controllers</folder>

View File

@ -49,7 +49,7 @@ class SermondistributorControllerAjax extends JControllerLegacy
// Check Token! // Check Token!
$token = JSession::getFormToken(); $token = JSession::getFormToken();
$call_token = $jinput->get('token', 0, 'ALNUM'); $call_token = $jinput->get('token', 0, 'ALNUM');
if($token == $call_token) if($jinput->get($token, 0, 'ALNUM') || $token === $call_token)
{ {
$task = $this->getTask(); $task = $this->getTask();
switch($task) switch($task)

View File

@ -2870,38 +2870,42 @@ abstract class SermondistributorHelper
/** /**
* Get any component's model * Get any component's model
**/ **/
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $component = 'Sermondistributor', $config = array()) public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = 'Sermondistributor', $config = array())
{ {
// fix the name // fix the name
$name = self::safeString($name); $name = self::safeString($name);
// full path // full path to models
$fullPath = $path . '/models'; $fullPathModels = $path . '/models';
// set prefix
$prefix = $component.'Model';
// load the model file // 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 // get instance
$model = JModelLegacy::getInstance($name, $prefix, $config); $model = JModelLegacy::getInstance($name, $Component . 'Model', $config);
// if model not found (strange) // if model not found (strange)
if ($model == false) if ($model == false)
{ {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
// get file path // get file path
$filePath = $path . '/' . $name . '.php'; $filePath = $path . '/' . $name . '.php';
$fullPath = $fullPath.'/'.$name.'.php'; $fullPathModel = $fullPathModels . '/' . $name . '.php';
// check if it exists // check if it exists
if (JFile::exists($filePath)) if (JFile::exists($filePath))
{ {
// get the file // get the file
require_once $filePath; require_once $filePath;
} }
elseif (JFile::exists($fullPath)) elseif (JFile::exists($fullPathModel))
{ {
// get the file // get the file
require_once $fullPath; require_once $fullPathModel;
} }
// build class names // build class names
$modelClass = $prefix.$name; $modelClass = $Component . 'Model' . $name;
if (class_exists($modelClass)) if (class_exists($modelClass))
{ {
// initialize the model // initialize the model

View File

@ -271,6 +271,8 @@ class SermondistributorRouter extends JComponentRouterBase
{ {
$getTable = '#__categories'; $getTable = '#__categories';
$query->from($db->quoteName($getTable)); $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 else
{ {