Cleans up components page code
parent
11d4118e71
commit
057cc6dca5
|
@ -8,12 +8,6 @@
|
||||||
* Supports pagination.
|
* Supports pagination.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Get any new messages
|
|
||||||
include '../app/includes/messages.php';
|
|
||||||
include '../app/includes/messages-show.php';
|
|
||||||
|
|
||||||
require '../app/classes/component.php';
|
|
||||||
|
|
||||||
// connect to database
|
// connect to database
|
||||||
$response = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id);
|
$response = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id);
|
||||||
|
|
||||||
|
@ -66,8 +60,7 @@ if ($response['db'] === null) {
|
||||||
// Component events listings
|
// Component events listings
|
||||||
//
|
//
|
||||||
|
|
||||||
|
require '../app/classes/component.php';
|
||||||
// list of all component events (default)
|
|
||||||
$componentObject = new Component($db);
|
$componentObject = new Component($db);
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,26 +92,17 @@ if ($response['db'] === null) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// // prepare the widget
|
// filter message
|
||||||
// $widget['full'] = false;
|
$filterMessage = array();
|
||||||
// $widget['name'] = 'AllComponents';
|
|
||||||
// $widget['filter'] = true;
|
|
||||||
// $widget['pagination'] = true;
|
|
||||||
|
|
||||||
// widget title
|
|
||||||
if (isset($_REQUEST['name']) && $_REQUEST['name'] != '') {
|
if (isset($_REQUEST['name']) && $_REQUEST['name'] != '') {
|
||||||
$widget['title'] = 'Jitsi events for component <strong>' . $_REQUEST['name'] . '</strong>';
|
array_push($filterMessage, 'Jitsi events for component "<strong>' . $_REQUEST['name'] . '</strong>"');
|
||||||
} elseif (isset($_REQUEST['id']) && $_REQUEST['id'] != '') {
|
} elseif (isset($_REQUEST['id']) && $_REQUEST['id'] != '') {
|
||||||
$widget['title'] = 'Jitsi events for component ID <strong>' . $_REQUEST['id'] . '</strong>';
|
array_push($filterMessage, 'Jitsi events for component ID "<strong>' . $_REQUEST['id'] . '</strong>"');
|
||||||
} else {
|
|
||||||
$widget['title'] = 'Jitsi events for <strong>all components</strong>';
|
|
||||||
}
|
}
|
||||||
// // widget records
|
|
||||||
// if (!empty($components['records'])) {
|
// Get any new messages
|
||||||
// $widget['full'] = true;
|
include '../app/includes/messages.php';
|
||||||
// $widget['table_headers'] = array_keys($components['records'][0]);
|
include '../app/includes/messages-show.php';
|
||||||
// $widget['table_records'] = $components['records'];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// display the widget
|
// display the widget
|
||||||
include '../app/templates/components.php';
|
include '../app/templates/components.php';
|
||||||
|
|
|
@ -43,11 +43,20 @@
|
||||||
<!-- /component events filter -->
|
<!-- /component events filter -->
|
||||||
|
|
||||||
<!-- component events -->
|
<!-- component events -->
|
||||||
<?php if ($time_range_specified) { ?>
|
<?php if ($time_range_specified || count($filterMessage)) { ?>
|
||||||
<div class="alert alert-info m-0 mb-3 small">
|
<div class="alert alert-info m-0 mb-3 small">
|
||||||
<i class="fas fa-calendar-alt me-2"></i>Time period: <strong><?= htmlspecialchars($from_time) ?> - <?= htmlspecialchars($until_time) ?></strong>
|
<?php if ($time_range_specified) { ?>
|
||||||
|
<p class="mb-0"><i class="fas fa-calendar-alt me-2"></i>Time period: <strong><?= htmlspecialchars($from_time) ?> - <?= htmlspecialchars($until_time) ?></strong></p>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if (count($filterMessage)) {
|
||||||
|
foreach ($filterMessage as $message) { ?>
|
||||||
|
<p class="mb-0"><i class="fas fa-users me-2"></i><?= $message ?></strong></p>
|
||||||
|
<?php } ?>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<?php if (!empty($components['records'])) { ?>
|
<?php if (!empty($components['records'])) { ?>
|
||||||
<div class="table-responsive border">
|
<div class="table-responsive border">
|
||||||
|
|
Loading…
Reference in New Issue