Beispiel #1
0
if (Url::getCurrentUrl()->hasQueryVar('showPrepared')) {
    $selector->setPreparedShown(true);
}
$newsList = News::getAllNews($selector);
usort($newsList, array('News', 'timestampSorter'));
/******************************\
	       BUILD VIEWS ACCESS
	\******************************/
$viewMap = array(NEWSSELECTOR_ALL => "Dernières news", NEWSSELECTOR_RELEASES => "Sorties", NEWSSELECTOR_TEAM => "Infos team", NEWSSELECTOR_PARTNERS => "Partenaires", NEWSSELECTOR_DB0COMPANY => "db0 company", NEWSSELECTOR_MISC => "Bonus");
$viewsLinks = new SimpleBlockComponent();
foreach ($viewMap as $id => $name) {
    $url->setQueryVar('select', empty($id) ? null : $id, true);
    $viewsLinks->addComponent(new Link(new Url($url), $name));
}
$views = new HeaderComponent();
$views->setClass("views");
$rssUrl = buildRssUrlIfAvailable();
$title = new Title(null, 2);
$title->addComponent(new RssLink($rssUrl));
$title->addComponent("Vues");
$views->addComponent($title);
$views->addComponent($viewsLinks);
/******************************\
	           FILL PAGE
	\******************************/
$page = PageContent::getInstance();
$page->addComponent(new Title("Zéro fansub", 1));
if (TEST_MODE_ACTIVATED) {
    $options = new SimpleBlockComponent();
    $options->setClass('testFeatures');
    $options->addComponent("Options : ");
<?php

$rightCol = new AsideComponent();
$rightCol->setId("colRight");
$logo = new HeaderComponent();
// content set by the style
$logo->setClass("logo");
$rightCol->addComponent($logo);
$partners = array_filter(Partner::getAllPartners(), function (Partner $partner) {
    return !$partner->isOver();
});
usort($partners, function ($a, $b) {
    return strnatcasecmp($a->getName(), $b->getName());
});
$partnerMenu = new Menu("Partenaires");
$crushMenu = new Menu("Coups de cœur");
foreach ($partners as $partner) {
    $link = new PartnerLink($partner);
    $link->setUseImage(true);
    if ($partner->isOfficial()) {
        $partnerMenu->addEntry($link);
    } else {
        $crushMenu->addEntry($link);
    }
}
$becomePartnerLink = new Link("?page=partenariat", "Devenir partenaires");
$becomePartnerLink->setClass('become-partner');
$partnerMenu->addEntry($becomePartnerLink);
$rightCol->addComponent(new MenuComponent($partnerMenu));
$rightCol->addComponent(new MenuComponent($crushMenu));
$rightCol->writeNow();