本文整理汇总了PHP中Release::isReleased方法的典型用法代码示例。如果您正苦于以下问题:PHP Release::isReleased方法的具体用法?PHP Release::isReleased怎么用?PHP Release::isReleased使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Release
的用法示例。
在下文中一共展示了Release::isReleased方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Release $release, $forceDisplay = false)
{
$this->addComponent(new Anchor($release->getID()));
$link = new Link(null, $release->getCompleteName());
$title = new Title($link);
$title->setClass("title");
$this->addComponent($title);
if ($release->isReleased() || $forceDisplay) {
$this->setClass("released");
$link->setUrl(new Url());
$link->setOnClick("show('" . $release->getID() . "');return(false)");
$releaseContent = new SimpleBlockComponent();
$releaseContent->setID($release->getID());
$releaseContent->setClass("content");
$this->addComponent($releaseContent);
$previewImage = null;
if ($release->getPreviewUrl() !== null) {
try {
$pUrl = $release->getPreviewUrl()->toString();
$previewImage = new AutoFloatImage($pUrl);
$previewImage->setClass("previewImage");
$description = getimagesize($pUrl);
$width = $description[0];
if ($width < 150) {
$previewImage->makeRightFloating();
}
} catch (ErrorException $ex) {
$previewImage = Debug::createWarningTag("Preview introuvable");
}
}
$releaseContent->addComponent($previewImage);
$localizedName = new SimpleBlockComponent();
$localizedName->setClass("localizedName");
if ($release->getLocalizedTitle() !== null) {
$localizedName->addComponent(new Title("Nom de l'épisode FR"));
$localizedName->addComponent($release->getLocalizedTitle());
}
$releaseContent->addComponent($localizedName);
$originalName = new SimpleBlockComponent();
$originalName->setClass("originalName");
if ($release->getOriginalTitle() !== null) {
$originalName->addComponent(new Title("Nom original"));
$originalName->addComponent($release->getOriginalTitle());
}
$releaseContent->addComponent($originalName);
$synopsis = new SimpleBlockComponent();
$synopsis->setClass("synopsis");
if ($release->getSynopsis() !== null) {
$synopsis->addComponent(new Title("Synopsis"));
$synopsis->addComponent(Format::convertTextToHtml($release->getSynopsis()));
}
$releaseContent->addComponent($synopsis);
$comment = new SimpleBlockComponent();
$comment->setClass("comment");
if ($release->getComment() !== null) {
$comment->addComponent($release->getComment());
}
$releaseContent->addComponent($comment);
$staff = new SimpleBlockComponent();
$staff->setClass("staff");
$members = $release->getStaffMembers();
if (!empty($members)) {
$staff->addComponent(new Title("Staff"));
$strings = array();
foreach ($members as $member) {
$string = $member->getPseudo();
$roles = $release->getAssignmentFor($member->getID())->getRoles();
if (!empty($roles)) {
$strings2 = array();
foreach ($roles as $role) {
$strings2[] = $role->getName();
}
$string .= " : " . Format::arrayToString($strings2);
}
$strings[] = $string;
}
$staff->addComponent(format::arrayToString($strings, " | "));
}
$releaseContent->addComponent($staff);
if ($release->isLicensed()) {
$this->fillWithLicenseData($releaseContent, $release);
} else {
$this->fillWithDownloadData($releaseContent, $release);
}
$releaseContent->addComponent(new Pin());
$url = new Url();
$vars = $url->getQueryVars();
if (!isset($vars['show']) || !(strcmp($vars['show'], "*") == 0 || preg_match("#(,|^)" . preg_quote($release->getID()) . "(,|\$)#", $vars['show']) > 0)) {
$releaseContent->addComponent("<script type='text/javascript'>show('" . $release->getID() . "');</script>");
}
} else {
$this->setClass("notReleased");
$link->setUrl(new Url());
$link->addComponent(" - Non disponible");
}
}