- admin\factory\Releases: logika biznesowa (wersje, licencje, toggle beta) - admin\controls\Releases: handlery HTTP (promote, demote, save/delete/toggle licencji) - admin\view\Releases: renderowanie przez \Tpl - admin/templates/releases/main-view.php: dwa taby (Wersje + Licencje), tabela wersji z przyciskami promocji, CRUD licencji z formularzem inline - templates/additional-menu.php: link "Releases & Licencje" w menu dewelopera - updates/versions.php: przebudowa — czyta z DB (pp_update_licenses, pp_update_versions), auto-discovery nowych ZIPow jako beta - config.php: dodano host_remote dla polaczen zdalnych Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
55 lines
1.2 KiB
PHP
55 lines
1.2 KiB
PHP
<?php
|
|
namespace admin\controls;
|
|
|
|
class Releases
|
|
{
|
|
public static function main_view(): string
|
|
{
|
|
return \admin\view\Releases::main_view();
|
|
}
|
|
|
|
public static function promote(): void
|
|
{
|
|
$version = trim(\S::get('version'));
|
|
if ($version)
|
|
\admin\factory\Releases::promote($version);
|
|
header('Location: /admin/releases/main_view/');
|
|
exit;
|
|
}
|
|
|
|
public static function demote(): void
|
|
{
|
|
$version = trim(\S::get('version'));
|
|
if ($version)
|
|
\admin\factory\Releases::demote($version);
|
|
header('Location: /admin/releases/main_view/');
|
|
exit;
|
|
}
|
|
|
|
public static function save_license(): void
|
|
{
|
|
\admin\factory\Releases::save_license($_POST);
|
|
\S::set_message('Licencja została zapisana.');
|
|
header('Location: /admin/releases/main_view/');
|
|
exit;
|
|
}
|
|
|
|
public static function delete_license(): void
|
|
{
|
|
$id = (int)\S::get('id');
|
|
if ($id)
|
|
\admin\factory\Releases::delete_license($id);
|
|
header('Location: /admin/releases/main_view/');
|
|
exit;
|
|
}
|
|
|
|
public static function toggle_beta(): void
|
|
{
|
|
$id = (int)\S::get('id');
|
|
if ($id)
|
|
\admin\factory\Releases::toggle_beta($id);
|
|
header('Location: /admin/releases/main_view/');
|
|
exit;
|
|
}
|
|
}
|