public function __construct(ProjectList $list = null) { $this->updateClass(); if ($list !== null) { foreach ($list->getProjects() as $project) { $this->addComponent(new ProjectLink($project)); } } }
} else { $allProjects = array_filter($allProjects, function (Project $project) { return !$project->isHentai(); }); } foreach ($allProjects as $project) { if (!$project->isLicensed()) { if ($project->isDoujin()) { $notLicensedDoujin[] = $project; } else { $notLicensedAnimes[] = $project; } } } $listProcessor = function ($title, $projects, $filter, $useImage) { $list = new ProjectList(); foreach ($projects as $project) { if ($filter === null || call_user_func($filter, $project)) { $list->addProject($project); } } if (!$list->isEmpty()) { $list->sortByNames(); $list = new ProjectListComponent($list); $list->useImage($useImage); $page = PageContent::getInstance(); if (is_string($title)) { $title = new Title($title, 3); } $page->addComponent($title); $page->addComponent($list);
public function __construct(Project $project, $forceDisplay = false) { $image = new Image('images/series/' . $project->getID() . '.jpg'); $image->setClass('projectPicture'); $this->addComponent($image); $this->addComponent(new Title("Informations générales", 2)); if ($project->hasExternalSource()) { $subtitle = new Title("Source : ", 4); $subtitle->addComponent($project->getExternalSource()); $this->addComponent($subtitle); } $array = array(array("Titre Original", $project->getOriginalName()), array("Site officiel", $project->getOfficialWebsite()), array("Année de production", $project->getAiringYear()), array("Studio", $project->getStudio()), array("Auteur", $project->getAuthor()), array("Genre", $project->getGenre()), array("Synopsis", $project->getSynopsis()), array("Coproduction", $project->getCoproduction()), array("Vosta", $project->getVosta())); $infos = new SimpleTextComponent(); $infos->setClass('projectInfos'); foreach ($array as $data) { if ($data[1] !== null) { $text = new SimpleTextComponent("<b>" . $data[0] . "</b> "); $text->addComponent($data[1]); $infos->addLine($text); } } $this->addComponent($infos); if ($project->getComment() !== null) { $this->addComponent("<p></p>"); $this->addComponent(new Title("Commentaire", 2)); $this->addComponent(Format::convertTextToHtml($project->getComment())); } $this->addComponent("<p></p>"); $link = Link::newWindowLink("http://zero.xooit.fr/t471-Liens-morts.htm", "Signaler un lien mort"); $link->setClass('deadLinks'); $this->addComponent($link); $this->addComponent("<p></p>"); $this->addComponent(new Title($project->isDoujin() ? "Chapitres" : "Épisodes", 2)); $releases = Release::getAllReleasesForProject($project->getID()); usort($releases, array('Release', 'idSorter')); $list = new SimpleListComponent(); $list->setClass("releaseList"); foreach ($releases as $release) { $list->addComponent(new ReleaseComponent($release, $forceDisplay)); } $this->addComponent($list); $linkedProjects = Project::getProjectsLinkedTo($project); if (!empty($linkedProjects)) { $this->addComponent("<p></p>"); $this->addComponent(new Title("Voir aussi", 2)); $list = new ProjectList(); foreach ($linkedProjects as $link) { $list->addProject($link); } $list->sortByNames(); $list = new ProjectListComponent($list); $list->useImage(true); $this->addComponent($list); } foreach ($project->getBonuses() as $bonus) { $this->addComponent("<p></p>"); $this->addComponent(new Title("Bonus : " . $bonus->getTitle(), 2)); $this->addComponent($bonus->getContent()); } $groups = ProjectGroup::getGroupsForProject($project); foreach ($groups as $group) { foreach ($group->getBonuses() as $bonus) { $this->addComponent("<p></p>"); $this->addComponent(new Title("Bonus : " . $bonus->getTitle(), 2)); $this->addComponent($bonus->getContent()); } } $this->addComponent("<p></p>"); $url = $project->getDiscussionUrl(); if ($url == null) { $url = new Url("http://zero.xooit.fr/posting.php?mode=reply&t=120"); } $link = Link::newWindowLink($url, new Image("images/interface/avis.png", "Donne ton avis sur le forum !")); $link->setClass('discussionLink'); $this->addComponent($link); }
<?php // Copyright 2014 Peter Beverloo. All rights reserved. // Use of this source code is governed by the MIT license, a copy of which can // be found in the LICENSE file. require_once __DIR__ . '/../services/framework/Database.php'; require_once __DIR__ . '/framework/AuthorList.php'; require_once __DIR__ . '/framework/CommitSelection.php'; require_once __DIR__ . '/framework/FlaggedCommitController.php'; require_once __DIR__ . '/framework/ProjectList.php'; require_once __DIR__ . '/framework/SelectionConstraints.php'; $database = new Database(); $constraints = new SelectionConstraints($database); $flagged = new FlaggedCommitController($database); $projects = ProjectList::LoadFromDatabase($database); // The following options are available for selecting a range of commits. Some // may be used in combination with other options, others may not. Options to // this script will be accepted as either POST or GET variables. // // "from_date" Earliest date to select commits from (YYYY-MM-DD). // "to_date" Latest date to select commits from (YYYY-MM-DD). // "author" E-mail address of the commit's author. // "reverse" Display commits in reversed (ascending) order. // "tracker" Id of the tracker from which commits can be selected. // "since" Display commits since the given date or text. // "projects" List of project Ids from which to select commits. // if (isset($_REQUEST['from_date'])) { $constraints->setEarliestCommitDate($_REQUEST['from_date'] . ' 00:00:00'); } if (isset($_REQUEST['to_date'])) {