当前位置: 首页>>代码示例>>PHP>>正文


PHP Release::isReleased方法代码示例

本文整理汇总了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");
     }
 }
开发者ID:KasaiDot,项目名称:Zero-Fansub-website,代码行数:96,代码来源:ReleaseComponent.php


注:本文中的Release::isReleased方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。