namespace Pterodactyl\Http\Controllers\Admin\Arix;
use Illuminate\View\View;
use Illuminate\Support\Facades\Http as AASupport;
use Prologue\Alerts\AlertsMessageBag;
use Illuminate\View\Factory as ViewFactory;
use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Http\Requests\Admin\Arix\ArixStylingRequest;
use Pterodactyl\Contracts\Repository\SettingsRepositoryInterface;
class ArixStylingController extends Controller {
public function __construct(private AlertsMessageBag $alert, private SettingsRepositoryInterface $settings, private ViewFactory $view) {
}
public function index() : View {
return $this->view->make("admin.arix.styling", ["pageTitle" => $this->settings->get("settings::arix:pageTitle", true), "background" => $this->settings->get("settings::arix:background", true), "backgroundImage" => $this->settings->get("settings::arix:backgroundImage", ''), "backgroundImageLight" => $this->settings->get("settings::arix:backgroundImageLight", ''), "loginBackground" => $this->settings->get("settings::arix:loginBackground", "/arix/background-login.png"), "backgroundFaded" => $this->settings->get("settings::arix:backgroundFaded", "default"), "backdrop" => $this->settings->get("settings::arix:backdrop", false), "backdropPercentage" => $this->settings->get("settings::arix:backdropPercentage", 100), "radiusInput" => $this->settings->get("settings::arix:radiusInput", 7), "radiusBox" => $this->settings->get("settings::arix:radiusBox", 10), "borderInput" => $this->settings->get("settings::arix:borderInput", true), "flashMessage" => $this->settings->get("settings::arix:flashMessage", 1), "font" => $this->settings->get("settings::arix:font", "default"), "icon" => $this->settings->get("settings::arix:icon", "heroicons")]);
}
public function store(ArixStylingRequest $request) {
goto nrxFj;
BpzWF: $responseData = $response->json();
goto VlQiR;
e1IrF: return redirect()->route("admin.arix.styling");
goto dFwce;
Ah0n3: $this->alert->warning("Something went wrong.")->flash();
goto aOBay;
GfxLr: $respond = "success";
goto pztf6;
VlQiR: if (!$responseData[$respond]) {
goto bgrNm;
}
goto dY1Cj;
aOBay: throw new \Exception("Something went wrong");
goto ixz4m;
nrxFj: $endpoint = "https://arix.gg/license/arix-theme";
goto GfxLr;
gfac2: Xpv9H: goto TkkAP;
pztf6: $response = AASupport::asForm()->post($endpoint, ["license" => config("arixTheme.license")]);
goto BpzWF;
ixz4m: E3I4B: goto e1IrF;
gkxyd: goto E3I4B;
goto RS2M5;
RS2M5: bgrNm: goto Ah0n3;
dY1Cj: foreach ($request->normalize() as $key => $value) {
$this->settings->set("settings::" . $key, $value);
c1cGm:
}
goto gfac2;
TkkAP: $this->alert->success("Theme settings have been updated successfully.")->flash();
goto gkxyd;
dFwce:
}
}
© 2023 Quttera Ltd. All rights reserved.