PluginProbe
Premmerce / 1.3.12
Premmerce v1.3.12
trunk 1.0 1.1 1.2 1.2.1 1.3 1.3.10 1.3.11 1.3.12 1.3.13 1.3.14 1.3.15 1.3.16 1.3.17 1.3.18 1.3.19 1.3.2 1.3.20 1.3.21 1.3.22 1.3.23 1.3.3 1.3.4 1.3.5 1.3.6 All 28 releases
premmerce / src / Admin / Handlers / WizardHandler.php

WizardHandler.php in Premmerce 1.3.12, at src/Admin/Handlers/WizardHandler.php

58 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace Premmerce\Premmerce\Admin\Handlers;
2
3 use Premmerce\Premmerce\Api\WizardApi;
4 use Premmerce\SDK\V2\FileManager\FileManager;
5
6 class WizardHandler
7 {
8 /**
9 * @var WizardApi
10 */
11 private $helper;
12
13 /**
14 * @var FileManager
15 */
16 private $fileManager;
17
18 /**
19 * @param WizardApi $helper
20 * @param FileManager $fileManager
21 */
22 public function __construct(WizardApi $helper, FileManager $fileManager)
23 {
24 $this->helper = $helper;
25 $this->fileManager = $fileManager;
26 }
27
28 /**
29 * Handle action
30 */
31 public function runAction()
32 {
33 if (isset($_POST['update'])) {
34 switch ($_POST['update']) {
35 case 'position':
36 $this->helper->updatePositions($_POST['positions']);
37 break;
38 case 'state':
39 $this->helper->updateState($_POST['task'], $_POST['state']);
40 break;
41 case 'container-state':
42 $this->handleContainerState();
43 break;
44
45 }
46 }
47 }
48
49 public function handleContainerState()
50 {
51 $this->helper->updateContainerState($_POST['state']);
52
53 wp_send_json($this->fileManager->renderTemplate('admin/tabs/wizard.php', array(
54 'wizard' => $this->helper,
55 )));
56 }
57 }
58