<?php
class Tournaments extends Page {
function setMenu()
{
$this->menu_text = 'Turniere';
$this->menu_image = 'far fa-medal';
$this->menu_priority = 1;
}
function setSubmenu()
$this->addSubmenuItem('Übersicht','/tournaments','far fa-list-alt');
$this->addSubmenuItem('Turnier anlegen','/tournaments/add','fas fa-calendar-plus');
if($_SESSION['user']->data['dogs'] && count($_SESSION['user']->data['tournaments']) > 0)
$this->addSubmenuItem('divider');
foreach($_SESSION['user']->data['tournaments'] as $tid)
$t = new Tournament();
$t->load($tid);
$this->addSubmenuItem($t->data['name'],'/dogs/overview/'.$tid,'fas fa-dog');
function add()
$this->set('template','edit_tournament.html');
function index() {
function maySeeThisPage() {
if($_SESSION['user']) //wenn eingeloggt, kein problem
return true;
else return false;