예제 #1
0
}
usort($completeList, array('Release', 'releasingSorter'));
$size = 3;
$sorties = array();
$sortie = null;
foreach ($completeList as $release) {
    // no header image => no advertisement => ignored for the header
    if ($release->isReleased() && $release->getHeaderImage() != null) {
        $timestamp = $release->getReleasingTime();
        $image = $release->getHeaderImage();
        if ($sortie === null || $sortie->getTimestamp() != $timestamp || strcmp($sortie->getImage(), $image) !== 0) {
            if (count($sorties) == $size) {
                break;
            }
            $sortie = new Sortie($timestamp, $image);
            $sorties[count($sorties)] = $sortie;
        }
        $sortie->addRelease($release);
    } else {
        continue;
    }
}
$list = new SimpleListComponent();
$list->setClass("sortieList");
krsort($sorties);
foreach ($sorties as $sortie) {
    $list->addComponent(new SortieComponent($sortie));
}
$header = new HeaderComponent();
$header->addComponent($list);
$header->writeNow();
예제 #2
0
$selector = new NewsSelector($selected, $_SESSION[MODE_H]);
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');
예제 #3
0
<?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();