# premmerce/1.3.12/src/Admin/Handlers/WizardHandler.php

Premmerce, version 1.3.12. 58 lines.

- Page: https://pluginprobe.com/plugins/premmerce/1.3.12/code/src/Admin/Handlers/WizardHandler.php
- Raw: https://pluginprobe.com/plugins/premmerce/1.3.12/raw/src/Admin/Handlers/WizardHandler.php
- Modified: 2018-11-14T16:28:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/premmerce/1.3.12/code/src/Admin/Handlers/WizardHandler.php#L10-L20`.

```php
<?php namespace Premmerce\Premmerce\Admin\Handlers;

use Premmerce\Premmerce\Api\WizardApi;
use Premmerce\SDK\V2\FileManager\FileManager;

class WizardHandler
{
    /**
     * @var WizardApi
     */
    private $helper;

    /**
     * @var FileManager
     */
    private $fileManager;

    /**
     * @param WizardApi $helper
     * @param FileManager $fileManager
     */
    public function __construct(WizardApi $helper, FileManager $fileManager)
    {
        $this->helper      = $helper;
        $this->fileManager = $fileManager;
    }

    /**
     * Handle action
     */
    public function runAction()
    {
        if (isset($_POST['update'])) {
            switch ($_POST['update']) {
                case 'position':
                    $this->helper->updatePositions($_POST['positions']);
                    break;
                case 'state':
                    $this->helper->updateState($_POST['task'], $_POST['state']);
                    break;
                case 'container-state':
                    $this->handleContainerState();
                    break;

            }
        }
    }

    public function handleContainerState()
    {
        $this->helper->updateContainerState($_POST['state']);

        wp_send_json($this->fileManager->renderTemplate('admin/tabs/wizard.php', array(
            'wizard' => $this->helper,
        )));
    }
}

```
