Skip to content

Commit

Permalink
Hide cron section in saas (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
budziam authored Feb 2, 2022
1 parent a7b01f6 commit 324abcc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
12 changes: 9 additions & 3 deletions includes/View/Pages/Admin/PageAdminSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function getContent(Request $request)
: $this->template->render("admin/components/settings/shop_address");

return $this->template->render("admin/pages/settings", [
"cronSelect" => $cronSelect,
"cron" => $cronSelect,
"directBillingPlatforms" => implode("", $directBillingPlatforms),
"languagesList" => implode("", $languagesList),
"licenseSection" => $licenseSection,
Expand Down Expand Up @@ -145,8 +145,12 @@ private function createUserEditServiceSelect(): DOMElement
return $userEditServiceSelect;
}

private function createCronSelect(): DOMElement
private function createCronSelect(): ?string
{
if (is_saas()) {
return null;
}

$yesOption = new Option($this->lang->t("yes"));
$yesOption->setParam("value", "1");
if ($this->settings["cron_each_visit"]) {
Expand All @@ -159,11 +163,13 @@ private function createCronSelect(): DOMElement
$noOption->setParam("selected", "selected");
}

return (new Select())
$cronSelect = (new Select())
->setParam("id", "cron")
->setParam("name", "cron")
->addContent($yesOption)
->addContent($noOption);

return $this->template->render("admin/components/settings/cron", compact("cronSelect"));
}

private function createPaymentPlatformOption(
Expand Down
12 changes: 12 additions & 0 deletions themes/fusion/admin/components/settings/cron.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="field is-horizontal">
<div class="field-label is-small">
<label for="cron"> {{ __('cron_page_start') }} </label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<div class="select is-small">{!! $cronSelect !!}</div>
</div>
</div>
</div>
</div>
13 changes: 1 addition & 12 deletions themes/fusion/admin/pages/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,7 @@ <h4 class="section-title">{{ __('customization') }}</h4>
</div>
</div>

<div class="field is-horizontal">
<div class="field-label is-small">
<label for="cron"> {{ __('cron_page_start') }} </label>
</div>
<div class="field-body">
<div class="field">
<div class="control">
<div class="select is-small">{!! $cronSelect !!}</div>
</div>
</div>
</div>
</div>
{!! $cron !!}

<div class="field is-horizontal">
<div class="field-label is-small">
Expand Down

0 comments on commit 324abcc

Please sign in to comment.