freenet-router |
Subversion Repositories: |
Compare with Previous - Blame - Download
<?php
namespace FreenetRouter\Controllers;
use FreenetRouter\Models\UI\MenuEntry;
use Phem\Controllers\SimpleViewController;
use Phem\Core\Collection;
use Phem\Environment\EnvironmentManager;
/**
* @author Jakub PetrĹžĂlka <petrzilka@czweb.net>
*/
abstract class Controller extends SimpleViewController
{
public function __construct()
{
parent::__construct();
$this->getModel()->put("osVersion", "Freenet Router 3.1");
$this->getModel()->put("routerName", "TestAP");
$this->getModel()->put("projectLink",
"https://bbb.nfx.cz/projects/freenet-router");
$loggedUser = EnvironmentManager::getSession()->getVar("loggedUser");
if ($loggedUser !== null)
{
$this->getModel()->put("loggedUser", $loggedUser);
$this->getModel()->put("login", true);
}
$this->getModel()->put("mainMenu", $this->populateMainMenu());
$this->getModel()->put("lb", EnvironmentManager::getLinkBuilder());
}
private function populateMainMenu()
{
$menu = new Collection();
$menu->add(new MenuEntry("Others","showPage","ostatnĂ"));
$menu->add(new MenuEntry("Logs","showPage","logy"));
$menu->add(new MenuEntry("Graphs","showPage","grafy"));
$menu->add(new MenuEntry("Quagga","showPage","quagga"));
$menu->add(new MenuEntry("Macguard","showPage","macguard"));
$menu->add(new MenuEntry("Firewall","showPage","firewall"));
$menu->add(new MenuEntry("Monitoring","showPage","monitoring"));
$menu->add(new MenuEntry("Networking","showPage","nastavenĂ sĂtÄ"));
return $menu;
}
}