Skip to content

Commit

Permalink
Update user function and see if that fixes the error. Also clean up s…
Browse files Browse the repository at this point in the history
…ome functions.
  • Loading branch information
bcordis committed Sep 26, 2024
1 parent d5570ae commit 5312cfa
Showing 1 changed file with 35 additions and 38 deletions.
73 changes: 35 additions & 38 deletions site/src/Helper/Cwmlanding.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function getLocationsLandingPage(Registry $params, int $id = 0): string
$location = '<div class="landingtable" style="display:inline-block;">';

foreach ($tresult as $b) {
if ($b->landing_show == 1) {
if ((int) $b->landing_show === 1) {
$location .= '<div class="landingrow">';
$location .= '<div class="landingcell">
<a class="landinglink" href="index.php?option=com_proclaim&amp;sendingview=Cwmlanding&amp;view=Cwmsermons&amp;filter_location='
Expand All @@ -172,7 +172,7 @@ public function getLocationsLandingPage(Registry $params, int $id = 0): string
$location .= '<div id="showhidelocations" style="display:none;">';

foreach ($tresult as $b) {
if ($b->landing_show == 2) {
if ((int) $b->landing_show === 2) {
$location .= '<div class="landingrow">';
$location .= '<div class="landingcell">
<a class="landinglink" href="index.php?option=com_proclaim&amp;sendingview=cwmlanding&amp;view=Cwmsermons&amp;filter_location='
Expand Down Expand Up @@ -291,16 +291,16 @@ public function getTeacherLandingPage(Registry $params, int $id = 0): string
}

$teacher .= '<div class="col-4" style="display: inline-block; margin-right:7px">';
if ($params->get('linkto') == 0) {
if ((int) $params->get('linkto') === 0) {
$teacher .= '<a href="' . Route::_(
'index.php?option=com_proclaim&amp;view=Cwmsermons&amp;t=' . $template
)
'index.php?option=com_proclaim&amp;view=Cwmsermons&amp;t=' . $template
)
. '&amp;sendingview=landing&amp;filter_teacher=' . $b->id
. $langlink . '&amp;filter_book=0&amp;filter_series=0&amp;filter_topic=0&amp;filter_location=0&amp;filter_year=0&amp;filter_messagetype=0">';
} else {
$teacher .= '<a href="' . Route::_(
'index.php?option=com_proclaim&amp;view=cwmteacher&id=' . $b->id . $langlink . '&t=' . $template
) . '">';
'index.php?option=com_proclaim&amp;view=cwmteacher&id=' . $b->id . $langlink . '&t=' . $template
) . '">';
}

$teacher .= $b->teachername;
Expand All @@ -326,8 +326,8 @@ public function getTeacherLandingPage(Registry $params, int $id = 0): string

case 1:
foreach ($tresult as $b) {
if ($b->landing_show == 1) {
if ($params->get('linkto') == 0) {
if ($b->landing_show === 1) {
if ((int) $params->get('linkto') === 0) {
$teacher .= '<div class="col-4" style="display: inline-block; margin-right:7px"> <a '
. Route::_('index.php?option=com_proclaim&amp;view=Cwmsermons&amp;t=' . $template)
. '&amp;sendingview=landing&amp;filter_teacher=' . $b->id
Expand All @@ -347,8 +347,8 @@ public function getTeacherLandingPage(Registry $params, int $id = 0): string
$teacher .= '<div id="showhideteachers" style="display:none;">';

foreach ($tresult as $b) {
if ($b->landing_show == 2) {
if ($params->get('linkto') == 0) {
if ($b->landing_show === 2) {
if ((int) $params->get('linkto') === 0) {
$teacher .= '<div class="col-4"><a href="'
. Route::_('index.php?option=com_proclaim&amp;view=Cwmsermons&amp;t=' . $template)
. '&amp;sendingview=landing&amp;filter_teacher=' . $b->id
Expand Down Expand Up @@ -471,7 +471,7 @@ public function getSeriesLandingPage(Registry $params, int $id = 0): string
}
}

if ($params->get('series_linkto') === '0') {
if ((int) $params->get('series_linkto') === 0) {
$series .= '<div class="col-4" style="display: inline-block; margin-right:7px">';
$series .= '<a href="index.php?option=com_proclaim&amp;view=Cwmsermons&amp;filter_series=' . $b->id
. '&amp;sendingview=landing&amp;filter_book=0&amp;filter_teacher=0'
Expand All @@ -498,7 +498,7 @@ public function getSeriesLandingPage(Registry $params, int $id = 0): string
}
}

if ($showdiv == 1) {
if ($showdiv === 1) {
$series .= "\n\t" . '</div> <!-- close show/hide series div-->';
}

Expand All @@ -511,10 +511,10 @@ public function getSeriesLandingPage(Registry $params, int $id = 0): string
$series = '<div class="landingtable" style="display:inline;">';

foreach ($items as $b) {
if ($b->landing_show == 1) {
if ((int) $b->landing_show === 1) {
$series .= '<div class="landingrow">';

if ($params->get('series_linkto') == '0') {
if ((int) $params->get('series_linkto') === '0') {
$series .= '<div class="landingcell">
<a href="index.php?option=com_proclaim&amp;view=Cwmsermons&amp;filter_series='
. $b->id . '&amp;sendingview=cwmlanding&amp;filter_book=0&amp;filter_teacher=0'
Expand All @@ -535,10 +535,10 @@ public function getSeriesLandingPage(Registry $params, int $id = 0): string
$series .= '<div id="showhideseries" style="display:none;">';

foreach ($items as $b) {
if ($b->landing_show == 2) {
if ((int) $b->landing_show === 2) {
$series .= '<div class="landingrow">';

if ($params->get('series_linkto') == '0') {
if ((int) $params->get('series_linkto') === 0) {
$series .= '<div class="landingcell">
<a href="index.php?option=com_proclaim&amp;view=Cwmsermons&amp;filter_series='
. $b->id . '&amp;sendingview=cwmlanding&amp;filter_book=0&amp;filter_teacher=0'
Expand Down Expand Up @@ -642,13 +642,12 @@ public function getYearsLandingPage(Registry $params, int $id = 0): string
$showdiv = 0;

foreach ($tresult as $b) {
if ($t >= $limit) {
if ($showdiv < 1) {
$year .= "\n\t" . '<div id="showhideyears" style="display:none;"> <!-- start show/hide years div-->';
if (($t >= $limit) && $showdiv < 1)
{
$year .= "\n\t" . '<div id="showhideyears" style="display:none;"> <!-- start show/hide years div-->';

$i = 0;
$showdiv = 1;
}
$i = 0;
$showdiv = 1;
}

$year .= '<div class="col-2" style="display: inline-block; margin-right:7px">';
Expand Down Expand Up @@ -890,13 +889,12 @@ public function getMessageTypesLandingPage(Registry $params, int $id = 0): strin
$showdiv = 0;

foreach ($tresult as $b) {
if ($t >= $limit) {
if ($showdiv < 1) {
$messagetype .= "\n\t" . '<div id="showhidemessagetypes" style="display:none;"> <!-- start show/hide messagetype div-->';
if (($t >= $limit) && $showdiv < 1)
{
$messagetype .= "\n\t" . '<div id="showhidemessagetypes" style="display:none;"> <!-- start show/hide messagetype div-->';

$i = 0;
$showdiv = 1;
}
$i = 0;
$showdiv = 1;
}

$messagetype .= '<div class="col-2 style="display: inline-block; margin-right:7px">';
Expand All @@ -919,7 +917,7 @@ public function getMessageTypesLandingPage(Registry $params, int $id = 0): strin
}
}

if ($showdiv == 1) {
if ($showdiv === 1) {
$messagetype .= "\n\t" . '</div> <!-- close show/hide messagetype div-->';
$showdiv = 2;
}
Expand All @@ -931,7 +929,7 @@ public function getMessageTypesLandingPage(Registry $params, int $id = 0): strin
$messagetype = '<div class="landingtable" style="display:inline;">';

foreach ($tresult as $b) {
if ($b->landing_show == 1) {
if ((int) $b->landing_show === 1) {
$messagetype .= '<div class="landingrow">';
$messagetype .= '<div class="landingcell">
<a class="landinglink" href="index.php?option=com_proclaim&amp;view=Cwmsermons&amp;filter_messagetype='
Expand All @@ -947,7 +945,7 @@ public function getMessageTypesLandingPage(Registry $params, int $id = 0): strin
$messagetype .= '<div id="showhidemessagetypes" style="display:none;">';

foreach ($tresult as $b) {
if ($b->landing_show == 2) {
if ((int) $b->landing_show === 2) {
$messagetype .= '<div class="landingrow">';
$messagetype .= '<div class="landingcell">
<a class="landinglink" href="index.php?option=com_proclaim&amp;view=Cwmsermons&amp;filter_messagetype=' . $b->id
Expand Down Expand Up @@ -1054,13 +1052,12 @@ public function getBooksLandingPage(Registry $params, int $id = 0): string
$showdiv = 0;

foreach ($tresult as $b) {
if ($t >= $limit) {
if ($showdiv < 1) {
$book .= "\n\t" . '<div id="showhidebooks" style="display:none;"> <!-- start show/hide book div-->';
if (($t >= $limit) && $showdiv < 1)
{
$book .= "\n\t" . '<div id="showhidebooks" style="display:none;"> <!-- start show/hide book div-->';

$i = 0;
$showdiv = 1;
}
$i = 0;
$showdiv = 1;
}

$book .= '<div class="col-2" style="display: inline-block; margin-right:7px">';
Expand Down

0 comments on commit 5312cfa

Please sign in to comment.