Files
deckflow/controller/SettingsController.php
Patrick Niebeling 7f683fcec1 Fix
2025-03-12 11:11:19 +01:00

34 lines
933 B
PHP

<?php
namespace OCA\Deckflow\Controller;
use OCP\AppFramework\Controller;
use OCP\IRequest;
use OCP\IUserSession;
use OCA\Deckflow\Service\WorkflowService;
class SettingsController extends Controller {
private $workflowService;
public function __construct(IRequest $request, IUserSession $userSession, WorkflowService $workflowService) {
parent::__construct('deckflow', $request);
$this->workflowService = $workflowService;
}
public function showSettingsForm() {
$workflows = $this->workflowService->getWorkflows();
return $this->render('settings.php', [
'workflows' => $workflows
]);
}
public function saveWorkflows() {
$deckId = $_POST['deckId'];
$sourceStackId = $_POST['sourceStack'];
$targetStackId = $_POST['targetStack'];
$this->workflowService->saveWorkflows($deckId, $sourceStackId, $targetStackId);
}
}