From 3305a7d3f084065190f72c0335e84d959d45322d Mon Sep 17 00:00:00 2001 From: Fibinger Ádám <adam.fibinger@wup.hu> Date: Thu, 17 Oct 2019 15:56:19 +0200 Subject: [PATCH] Template útvonal módosítása --- common/base.php | 2 +- form.php | 10 +++++----- templates/admin/stripe-form.twig | 4 +++- team-history.php | 3 +++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/common/base.php b/common/base.php index 1038268..5f35160 100644 --- a/common/base.php +++ b/common/base.php @@ -11,4 +11,4 @@ $last_json = OVERLAY_DIR . 'last.json'; -$twig = \EOG\Utils\TwigFactory::getEnvironment(SITE_ROOT); \ No newline at end of file +$twig = \EOG\Utils\TwigFactory::getEnvironment(SITE_ROOT.'/templates/'); \ No newline at end of file diff --git a/form.php b/form.php index 5340e72..cfa9739 100644 --- a/form.php +++ b/form.php @@ -11,15 +11,15 @@ } $s->setClass('simple'); - $html_content = $twig->render('templates/overlay-base.twig', ['stripe' => $s]); + $html_content = $twig->render('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]); + $html_content = $twig->render('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]); + $html_content = $twig->render('overlay-base.twig', ['stripe' => $s]); file_put_contents(OVERLAY_DIR . 'team-ban.html', $html_content); } else { @@ -35,7 +35,7 @@ $teams = new \EOG\Models\TeamList(); if (file_exists(OVERLAY_DIR . 'teams.json')) { - var_dump($teams->fromJson(file_get_contents(OVERLAY_DIR . 'teams.json'))); + $teams->fromJson(file_get_contents(OVERLAY_DIR . 'teams.json')); } $var = [ @@ -45,5 +45,5 @@ 'post' => !empty($_POST['stripe']) ]; -echo $twig->render('templates/admin/stripe-form.twig', $var); +echo $twig->render('admin/stripe-form.twig', $var); diff --git a/team-history.php b/team-history.php new file mode 100644 index 0000000..a427b98 --- /dev/null +++ b/team-history.php @@ -0,0 +1,3 @@ +<?php + +include_once "common/base.php"; \ No newline at end of file diff --git a/templates/admin/stripe-form.twig b/templates/admin/stripe-form.twig index e315559..9300d9b 100644 --- a/templates/admin/stripe-form.twig +++ b/templates/admin/stripe-form.twig @@ -1,4 +1,4 @@ -{% extends "templates/admin/html-skeleton.twig" %} +{% extends "admin/html-skeleton.twig" %} {% block body %} <form action="/generator/form.php" method="post"> <input type="hidden" name="stripe[class]" value="team-ban"/> @@ -90,6 +90,8 @@ </div> </div> </form> + + <a href="/generator/team-history.php" class="btn btn-secondary">Meccstörténet</a> {% endblock %} {% block lazyload %} {{ parent() }} -- Gitblit v1.8.0