| | |
| | | define('OVERLAY_DIR', dirname(__DIR__) . '/overlays/'); |
| | | } |
| | | |
| | | $last_json = OVERLAY_DIR.'last.json'; |
| | | $last_json = OVERLAY_DIR . 'last.json'; |
| | | |
| | | $twig = \EOG\Utils\TwigFactory::getEnvironment(SITE_ROOT); |
| | | |
| | |
| | | { |
| | | $s->loadFromArray($_POST['stripe']); |
| | | |
| | | if (!empty($s->stripe['class'])) { |
| | | file_put_contents($last_json, $s->getJson()); |
| | | } |
| | | |
| | | switch ($s->stripe['class']) |
| | | if (!empty($s->getState())) |
| | | { |
| | | case 'simple': |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'simple.html', $html_content); |
| | | break; |
| | | case 'team': |
| | | $s->setClass('simple'); |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'simple.html', $html_content); |
| | | |
| | | $s->setClass('team'); |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'team.html', $html_content); |
| | | |
| | | break; |
| | | case 'team-ban': |
| | | $s->setClass('simple'); |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'simple.html', $html_content); |
| | | |
| | | $s->setClass('team'); |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'team.html', $html_content); |
| | | |
| | | $s->setClass('team-ban'); |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'team-ban.html', $html_content); |
| | | break; |
| | | file_put_contents($last_json, $s->getJson()); |
| | | } |
| | | } else { |
| | | if (file_exists($last_json)) { |
| | | $raw_json = file_get_contents($last_json); |
| | | $stateArray = json_decode($raw_json, true); |
| | | if (is_array($stateArray)) { |
| | | $s->loadFromArray($stateArray); |
| | | } |
| | | } |
| | | |
| | | $s->setClass('simple'); |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'simple.html', $html_content); |
| | | |
| | | $s->setClass('team'); |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'team.html', $html_content); |
| | | |
| | | $s->setClass('team-ban'); |
| | | $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); |
| | | file_put_contents(OVERLAY_DIR . 'team-ban.html', $html_content); |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (file_exists($last_json)) |
| | | { |
| | | $raw_json = file_get_contents($last_json); |
| | | $stateArray = json_decode($raw_json, true); |
| | | if (is_array($stateArray)) |
| | | { |
| | | $s->loadFromArray($stateArray); |
| | | } |
| | | } |
| | | } |
| | | |
| | | $var = [ |