diff --git a/index.php b/index.php
index 432c10e22b..c18343bbbb 100644
--- a/index.php
+++ b/index.php
@@ -536,6 +536,7 @@
$page->addData([
'isLoggedIn' => $isLoggedIn,
+ 'isHomePage' => empty($page->getAddress()),
'organisationLogo' => $session->get('organisationLogo'),
'organisationName' => $session->get('organisationName'),
'cacheString' => $session->get('cacheString'),
diff --git a/modules/Activities/activities_attendance.php b/modules/Activities/activities_attendance.php
index 17d575b728..529a32a467 100644
--- a/modules/Activities/activities_attendance.php
+++ b/modules/Activities/activities_attendance.php
@@ -306,7 +306,7 @@
$row = $form->addRow()->addClass('flex w-full')->addTable()->setClass('smallIntBorder w-full doublescroll-wrapper')->addRow();
$row->addContent(__('All highlighted columns will be updated when you press submit.'))
->wrap('', '');
- $row->addSubmit()->addClass('text-right');
+ $row->addSubmit();
echo $form->getOutput();
diff --git a/modules/Activities/choices_manage_generate.php b/modules/Activities/choices_manage_generate.php
index 8ff8f57e74..8cb0a249e5 100755
--- a/modules/Activities/choices_manage_generate.php
+++ b/modules/Activities/choices_manage_generate.php
@@ -189,7 +189,7 @@
]));
$table = $form->addRow()->addTable()->setClass('smallIntBorder w-full');
- $row = $table->addRow()->addSubmit(__('Submit'))->addClass('text-right');
+ $row = $table->addRow()->addSubmit(__('Submit'));
} elseif ($form->getCurrentPage() >= 3) {
// STEP 4
$enrolmentList = $_POST['person'] ?? [];
diff --git a/modules/Activities/enrolment_manage.php b/modules/Activities/enrolment_manage.php
index b316ec9622..fb087081ba 100755
--- a/modules/Activities/enrolment_manage.php
+++ b/modules/Activities/enrolment_manage.php
@@ -119,7 +119,7 @@
]));
$table = $form->addRow()->addTable()->setClass('smallIntBorder w-full');
- $row = $table->addRow()->addSubmit(__('Submit'))->addClass('text-right');
+ $row = $table->addRow()->addSubmit(__('Submit'));
echo $form->getOutput();
}
diff --git a/modules/Activities/enrolment_manage_staffing.php b/modules/Activities/enrolment_manage_staffing.php
index 4247696bb0..2f1986b655 100644
--- a/modules/Activities/enrolment_manage_staffing.php
+++ b/modules/Activities/enrolment_manage_staffing.php
@@ -107,7 +107,7 @@
]));
$table = $form->addRow()->addTable()->setClass('smallIntBorder w-full');
- $row = $table->addRow()->addSubmit(__('Submit'))->addClass('text-right');
+ $row = $table->addRow()->addSubmit(__('Submit'));
echo $form->getOutput();
}
diff --git a/modules/Admissions/src/Forms/ApplicationMilestonesForm.php b/modules/Admissions/src/Forms/ApplicationMilestonesForm.php
index 8ec12ac73e..89002f84a2 100644
--- a/modules/Admissions/src/Forms/ApplicationMilestonesForm.php
+++ b/modules/Admissions/src/Forms/ApplicationMilestonesForm.php
@@ -92,7 +92,7 @@ public function createForm($urlParams, $milestones)
->setClass('w-24');
}
- $form->addRow()->addSubmit()->addClass('text-right');
+ $form->addRow()->addSubmit();
return $form;
}
diff --git a/modules/Messenger/messageWall_view.php b/modules/Messenger/messageWall_view.php
index a195513539..be6c3cd1df 100644
--- a/modules/Messenger/messageWall_view.php
+++ b/modules/Messenger/messageWall_view.php
@@ -58,7 +58,7 @@
$form->addHiddenValue('address', $session->get('address'));
- $row = $form->addRow()->addClass('flex flex-wrap');
+ $row = $form->addRow()->addClass('flex flex-wrap mb-4');
$link = $session->get('absoluteURL').'/index.php?q=/modules/'.$session->get('module').'/messageWall_view.php';
$prevDay = DateTime::createFromFormat('Y-m-d', $date)->modify('-1 day')->format('Y-m-d');
diff --git a/modules/Planner/planner_view_full.php b/modules/Planner/planner_view_full.php
index c57088987e..7824818619 100644
--- a/modules/Planner/planner_view_full.php
+++ b/modules/Planner/planner_view_full.php
@@ -685,7 +685,6 @@
$row = $form->addRow();
- $row->addFooter();
$row->addSubmit();
echo $form->getOutput();
@@ -1108,7 +1107,6 @@
$col->addEditor('homeworkDetails', $guid)->setRows(15)->showMedia()->required()->setValue($rowMyHomework['homeworkDetails'] ?? '');
$row = $form->addRow();
- $row->addFooter();
$row->addSubmit();
echo '
';
@@ -1298,7 +1296,7 @@
$form->addHiddenValue('count', $count);
$form->addHiddenValues($params);
- $form->addRow()->addSubmit();
+ $form->addRow()->addSubmit()->addClass('mt-2');
}
$page->addSidebarExtra($form->getOutput());
diff --git a/modules/Staff/coverage_planner.php b/modules/Staff/coverage_planner.php
index ab141bf4da..888c9d50c9 100644
--- a/modules/Staff/coverage_planner.php
+++ b/modules/Staff/coverage_planner.php
@@ -49,7 +49,7 @@
$form = Form::createBlank('dateNav', $link);
$form->addHiddenValue('address', $session->get('address'));
- $row = $form->addRow()->addClass('flex flex-wrap');
+ $row = $form->addRow()->addClass('flex flex-wrap mb-4');
$lastDay = $date->modify('-1 day')->format('Y-m-d');
$thisDay = (new DateTime('Today'))->format('Y-m-d');
@@ -93,7 +93,7 @@
->setIcon('duplicate')
->modalWindow(true)
->displayLabel()
- ->setClass('float-right mt-4')
+ ->setClass('float-right')
->getOutput();
echo ''.__(Format::dayOfWeekName($date->format('Y-m-d'))).'';
diff --git a/modules/Staff/coverage_planner_assign.php b/modules/Staff/coverage_planner_assign.php
index dd8b65887c..f60354c30b 100644
--- a/modules/Staff/coverage_planner_assign.php
+++ b/modules/Staff/coverage_planner_assign.php
@@ -321,7 +321,7 @@
$form->toggleVisibilityByClass('unavailableSub')->onCheckbox('showUnavailable')->when('Y');
$row = $form->addRow();
- $row->addSubmit()->addClass('text-right');
+ $row->addSubmit();
echo $form->getOutput();
}
diff --git a/modules/Staff/report_absences_weekly.php b/modules/Staff/report_absences_weekly.php
index fd25c95236..dc9724a501 100644
--- a/modules/Staff/report_absences_weekly.php
+++ b/modules/Staff/report_absences_weekly.php
@@ -47,7 +47,7 @@
$form = Form::createBlank('action', $session->get('absoluteURL').'/index.php?q=/modules/Staff/report_absences_weekly.php');
$form->addHiddenValue('address', $session->get('address'));
- $row = $form->addRow()->addClass('flex flex-wrap');
+ $row = $form->addRow()->addClass('flex flex-wrap mb-4');
$link = $session->get('absoluteURL').'/index.php?q=/modules/Staff/report_absences_weekly.php';
$lastWeek = $date->modify('-1 week')->format('Y-m-d');
diff --git a/modules/Staff/report_subs_availabilityWeekly.php b/modules/Staff/report_subs_availabilityWeekly.php
index c309691869..8635c99d13 100644
--- a/modules/Staff/report_subs_availabilityWeekly.php
+++ b/modules/Staff/report_subs_availabilityWeekly.php
@@ -49,7 +49,7 @@
$form = Form::createBlank('action', $session->get('absoluteURL').'/index.php?q=/modules/Staff/report_subs_availabilityWeekly.php&sidebar=false');
$form->addHiddenValue('address', $session->get('address'));
- $row = $form->addRow()->addClass('flex flex-wrap');
+ $row = $form->addRow()->addClass('flex flex-wrap mb-4');
$link = $session->get('absoluteURL').'/index.php?q=/modules/Staff/report_subs_availabilityWeekly.php&sidebar=false';
@@ -90,7 +90,7 @@
// Attach availability info to each sub
$availability = $subGateway->selectUnavailableDatesByDateRange($dateStart->format('Y-m-d'), $dateEnd->format('Y-m-d'))->fetchAll();
$subsAvailability = array_reduce($availability, function ($group, $item) {
- $gibbonPersonID = str_pad($item['gibbonPersonID'], 10, '0', STR_PAD_LEFT);
+ $gibbonPersonID = str_pad($item['gibbonPersonID'] ?? '', 10, '0', STR_PAD_LEFT);
if (!isset($group[$gibbonPersonID])) return $group;
$group[$gibbonPersonID]['dates'][$item['date']][] = $item;
diff --git a/modules/Timetable/moduleFunctions.php b/modules/Timetable/moduleFunctions.php
index 1c05ac88d1..e45c0f5a0a 100644
--- a/modules/Timetable/moduleFunctions.php
+++ b/modules/Timetable/moduleFunctions.php
@@ -203,7 +203,7 @@ function getCalendarEvents($connection2, $guid, $xml, $startDayStamp, $endDaySta
}
if (!empty($ssoMicrosoft) && $ssoMicrosoft['enabled'] == 'Y' && $session->has('microsoftAPIAccessToken')) {
- $eventsSchool = array();
+ $eventsSchool = [];
// Create a Graph client
$oauthProvider = $container->get('Microsoft_Auth');
@@ -261,7 +261,7 @@ function getCalendarEvents($connection2, $guid, $xml, $startDayStamp, $endDaySta
if (!empty($ssoGoogle) && $ssoGoogle['enabled'] == 'Y' && $session->has('googleAPIAccessToken') && $session->has('googleAPICalendarEnabled')) {
- $eventsSchool = array();
+ $eventsSchool = [];
$start = date("Y-m-d\TH:i:s", strtotime(date('Y-m-d', $startDayStamp)));
$end = date("Y-m-d\TH:i:s", (strtotime(date('Y-m-d', $endDayStamp)) + 86399));
@@ -278,7 +278,7 @@ function getCalendarEvents($connection2, $guid, $xml, $startDayStamp, $endDaySta
}
if ($getFail) {
- $eventsSchool = false;
+ $eventsSchool = [];
} else {
$count = 0;
foreach ($calendarListEntry as $entry) {
@@ -341,7 +341,7 @@ function getCalendarEvents($connection2, $guid, $xml, $startDayStamp, $endDaySta
}
}
} else {
- $eventsSchool = false;
+ $eventsSchool = [];
}
$session->set($calendarEventsCache, $eventsSchool);
@@ -626,17 +626,15 @@ function renderTT($guid, $connection2, $gibbonPersonID, $gibbonTTID, $title = ''
//Get school calendar array
$allDay = false;
- $eventsSchool = false;
+ $eventsSchool = [];
if ($self == true and $session->get('viewCalendarSchool') == 'Y' && $session->has('googleAPIAccessToken')) {
if ($session->get('calendarFeed') != '') {
$eventsSchool = getCalendarEvents($connection2, $guid, $session->get('calendarFeed'), $startDayStamp, $endDayStamp);
}
//Any all days?
- if ($eventsSchool != false) {
- foreach ($eventsSchool as $event) {
- if ($event[1] == 'All Day') {
- $allDay = true;
- }
+ foreach ($eventsSchool as $event) {
+ if ($event[1] == 'All Day') {
+ $allDay = true;
}
}
}
@@ -686,16 +684,14 @@ function renderTT($guid, $connection2, $gibbonPersonID, $gibbonTTID, $title = ''
}
//Get personal calendar array
- $eventsPersonal = false;
+ $eventsPersonal = [];
if ($self == true and $session->get('viewCalendarPersonal') == 'Y') {
$eventsPersonal = getCalendarEvents($connection2, $guid, $session->get('calendarFeedPersonal'), $startDayStamp, $endDayStamp);
//Any all days?
- if ($eventsPersonal != false) {
- foreach ($eventsPersonal as $event) {
- if ($event[1] == 'All Day') {
- $allDay = true;
- }
+ foreach ($eventsPersonal as $event) {
+ if ($event[1] == 'All Day') {
+ $allDay = true;
}
}
}
@@ -801,13 +797,7 @@ function renderTT($guid, $connection2, $gibbonPersonID, $gibbonTTID, $title = ''
$eventsCombined = false;
$maxAllDays = 0;
if ($allDay == true) {
- if ($eventsPersonal != false and $eventsSchool != false) {
- $eventsCombined = array_merge($eventsSchool, $eventsPersonal);
- } elseif ($eventsSchool != false) {
- $eventsCombined = $eventsSchool;
- } elseif ($eventsPersonal != false) {
- $eventsCombined = $eventsPersonal;
- }
+ $eventsCombined = array_merge($eventsSchool, $eventsPersonal);
// Sort $eventsCombined by the value of their start timestamp (key = 2) ascendingly.
// See getCalendarEvents() for field details of each events.
diff --git a/modules/User Admin/permission_manage.php b/modules/User Admin/permission_manage.php
index 88afff46b6..d3b6daa7b1 100644
--- a/modules/User Admin/permission_manage.php
+++ b/modules/User Admin/permission_manage.php
@@ -176,7 +176,7 @@
->append(sprintf(__('This form is very large and data will be truncated unless you edit php.ini. Add the line max_input_vars=%1$s to your php.ini file on your server.'), $total_vars_rounded));
} else {
$row = $form->addRow();
- $row->addSubmit()->addClass('text-right');
+ $row->addSubmit()->addClass('mt-2');
}
echo $form->getOutput();
diff --git a/resources/templates/index.twig.html b/resources/templates/index.twig.html
index 0718813b80..11b3cc17cc 100644
--- a/resources/templates/index.twig.html
+++ b/resources/templates/index.twig.html
@@ -92,7 +92,7 @@
{% block beforePage %}
{% endblock beforePage %}
-
+
{% for type, alerts in page.alerts %}
@@ -113,7 +113,7 @@
{{ include('navigation.twig.html') }}
{% endif %}
-
+
diff --git a/src/Forms/FormFactory.php b/src/Forms/FormFactory.php
index 99d246578f..4b16cc652f 100644
--- a/src/Forms/FormFactory.php
+++ b/src/Forms/FormFactory.php
@@ -312,7 +312,7 @@ public function createAlert($content, $level = 'warning')
public function createSubmit($label = 'Submit', $id = null)
{
- return (new Input\Button($label, 'submit', null, $id));
+ return $this->createButton($label, null, $id)->setType('submit')->addClass('text-right');
}
public function createSearchSubmit($session, $clearLabel = 'Clear Filters', $passParams = array())
diff --git a/src/Forms/Layout/Column.php b/src/Forms/Layout/Column.php
index 60dfbe025e..a182344187 100644
--- a/src/Forms/Layout/Column.php
+++ b/src/Forms/Layout/Column.php
@@ -23,6 +23,7 @@
use Gibbon\Forms\OutputableInterface;
use Gibbon\Forms\FormFactoryInterface;
+use Gibbon\Forms\Input\Button;
/**
* Holds a collection of form elements to be output vertically.
@@ -70,7 +71,8 @@ public function getOutput()
$output = '';
foreach ($this->getElements() as $element) {
- if ($class = $this->getContainerClass($element)) {
+ $class = $this->getContainerClass($element);
+ if (!empty($class) && !$element instanceof Button) {
$output .= ' ';
$output .= $element->getOutput();
$output .= ' ';
diff --git a/src/Forms/Prefab/DeleteForm.php b/src/Forms/Prefab/DeleteForm.php
index 5a206899c5..bb2bb89ab8 100644
--- a/src/Forms/Prefab/DeleteForm.php
+++ b/src/Forms/Prefab/DeleteForm.php
@@ -60,7 +60,7 @@ public static function createForm($action, $confirmation = false, $submit = true
}
if ($submit) {
- $form->addRow()->addClass('text-right mt-6')->addConfirmSubmit(__('Delete'))->setColor('red');
+ $form->addRow()->addClass('mt-6')->addConfirmSubmit(__('Delete'))->setColor('red');
}
return $form;
|