Skip to content

Commit

Permalink
Fix filename & parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaz Parkyn committed Aug 23, 2019
1 parent daa0887 commit b941c78
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kernelbooking.php → mod_kernel_booking.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));

require JModuleHelper::getLayoutPath('mod_kernelbooking', $params->get('layout', 'default'));
require JModuleHelper::getLayoutPath('mod_kernel_booking', $params->get('layout', 'default'));
7 changes: 5 additions & 2 deletions kernelbooking.xml → mod_kernel_booking.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
</description>
<scriptfile>installer.php</scriptfile>
<files>
<filename module="kernelbooking">kernelbooking.php</filename>
<folder>tmpl</folder>
<filename module="mod_kernel_booking">mod_kernel_booking.php</filename>
<filename>index.html</filename>
</files>
<config>
Expand Down Expand Up @@ -41,14 +42,16 @@
</field>

<field
name="category_id"
name="category"
type="integer"
first="0" last="1000" step="1"
label="Category ID (optional)"
description="Enter the category ID to filter the embedded results by."/>

<field
name="detail_id"
type="integer"
first="0" last="1000" step="1"
label="Room ID (optional)"
description="Enter the category ID to filter the embedded results by."/>

Expand Down
14 changes: 12 additions & 2 deletions tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@

defined('_JEXEC') or die;

$detailID = $params->get('detail_id');
if ($detailID == 0 || !in_array($params->get('page'), ['detail', 'calendar'])) {
$detailID = 'null';
}

$category = $params->get('category');
if ($category == 0 || $params->get('page') != 'search') {
$category = 'null';
}

?>

<div id="kernel-booking" style="width: 100%; max-width: 100%"></div>
Expand All @@ -23,8 +33,8 @@
client: '<?php echo $params->get('client'); ?>',
el: '#kernel-booking',
page: '<?php echo $params->get('page'); ?>',
detailid: '<?php echo $params->get('category_id'); ?>',
category: '<?php echo $params->get('detail_id'); ?>'
detailid: <?php echo $detailID; ?>,
category: <?php echo $category; ?>
})
</script>

Expand Down

0 comments on commit b941c78

Please sign in to comment.