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


PHP record_adapter::get_thumbnail方法代码示例

本文整理汇总了PHP中record_adapter::get_thumbnail方法的典型用法代码示例。如果您正苦于以下问题:PHP record_adapter::get_thumbnail方法的具体用法?PHP record_adapter::get_thumbnail怎么用?PHP record_adapter::get_thumbnail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在record_adapter的用法示例。


在下文中一共展示了record_adapter::get_thumbnail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildTabUserWhat

 /**
  * Return basic information about a record
  *
  * @param integer $bid base id
  * @param integer $rid record id
  * @param array   $tab config for the html table
  *
  * @return array
  */
 public function buildTabUserWhat($bid, $rid, $tab = false)
 {
     $this->initialize();
     $sbas_id = phrasea::sbasFromBas($this->app, $bid);
     try {
         $record = new record_adapter($this->app, $sbas_id, $rid);
     } catch (\Exception_Record_AdapterNotFound $e) {
         return $this->report;
     }
     $this->setDisplay($tab);
     $this->champ = ['photo', 'record_id', 'date', 'type', 'titre', 'taille'];
     $document = $record->get_subdef('document');
     $this->title = $this->app->trans('report:: Information sur l\'enregistrement numero %number%', ['%number%' => (int) $rid]);
     $x = $record->get_thumbnail();
     $this->result[] = ['photo' => "<img style='width:" . $x->get_width() . "px;height:" . $x->get_height() . "px;'\n                        src='" . $x->get_url() . "'>", 'record_id' => $record->get_record_id(), 'date' => $this->app['date-formatter']->getPrettyString($document->get_creation_date()), 'type' => $document->get_mime(), 'titre' => $record->get_title(), 'taille' => $document->get_size()];
     $this->setDisplayNav();
     $this->setReport();
     return $this->report;
 }
开发者ID:romainneutron,项目名称:Phraseanet,代码行数:28,代码来源:nav.php

示例2: testUploadWithoutB64Image

 /**
  * @covers Alchemy\Phrasea\Controller\Prod\Upload::upload
  * @covers Alchemy\Phrasea\Controller\Prod\Upload::getJsonResponse
  */
 public function testUploadWithoutB64Image()
 {
     self::$DI['app']['notification.deliverer'] = $this->getMockBuilder('Alchemy\\Phrasea\\Notification\\Deliverer')->disableOriginalConstructor()->getMock();
     $params = ['base_id' => self::$DI['collection']->get_base_id()];
     $files = ['files' => [new UploadedFile($this->tmpFile, 'KIKOO.JPG')]];
     /** @var Client $client */
     $client = self::$DI['client'];
     $client->request('POST', '/prod/upload/', $params, $files, ['HTTP_Accept' => 'application/json']);
     $response = $client->getResponse();
     $this->checkJsonResponse($response);
     $datas = json_decode($response->getContent(), true);
     $this->assertTrue($datas['success']);
     if ($datas['element'] == 'record') {
         $id = explode('_', $datas['id']);
         $record = new \record_adapter(self::$DI['app'], $id[0], $id[1]);
         $this->assertFalse($record->get_thumbnail()->is_physically_present());
     }
 }
开发者ID:luisbrito,项目名称:Phraseanet,代码行数:22,代码来源:UploadTest.php

示例3: list_story

 /**
  * Retrieve detailled informations about one story
  *
  * @param record_adapter $story
  *
  * @return array
  */
 public function list_story(record_adapter $story)
 {
     if (!$story->is_grouping()) {
         throw new \API_V1_exception_notfound('Story not found');
     }
     $that = $this;
     $records = array_map(function (\record_adapter $record) use($that) {
         return $that->list_record($record);
     }, array_values($story->get_children()->get_elements()));
     $caption = $story->get_caption();
     $format = function (caption_record $caption, $dcField) {
         $field = $caption->get_dc_field($dcField);
         if (!$field) {
             return null;
         }
         return $field->get_serialized_values();
     };
     return ['@entity@' => self::OBJECT_TYPE_STORY, 'databox_id' => $story->get_sbas_id(), 'story_id' => $story->get_record_id(), 'updated_on' => $story->get_modification_date()->format(DATE_ATOM), 'created_on' => $story->get_creation_date()->format(DATE_ATOM), 'collection_id' => phrasea::collFromBas($this->app, $story->get_base_id()), 'thumbnail' => $this->list_embedable_media($story->get_thumbnail()), 'uuid' => $story->get_uuid(), 'metadatas' => ['@entity@' => self::OBJECT_TYPE_STORY_METADATA_BAG, 'dc:contributor' => $format($caption, databox_Field_DCESAbstract::Contributor), 'dc:coverage' => $format($caption, databox_Field_DCESAbstract::Coverage), 'dc:creator' => $format($caption, databox_Field_DCESAbstract::Creator), 'dc:date' => $format($caption, databox_Field_DCESAbstract::Date), 'dc:description' => $format($caption, databox_Field_DCESAbstract::Description), 'dc:format' => $format($caption, databox_Field_DCESAbstract::Format), 'dc:identifier' => $format($caption, databox_Field_DCESAbstract::Identifier), 'dc:language' => $format($caption, databox_Field_DCESAbstract::Language), 'dc:publisher' => $format($caption, databox_Field_DCESAbstract::Publisher), 'dc:relation' => $format($caption, databox_Field_DCESAbstract::Relation), 'dc:rights' => $format($caption, databox_Field_DCESAbstract::Rights), 'dc:source' => $format($caption, databox_Field_DCESAbstract::Source), 'dc:subject' => $format($caption, databox_Field_DCESAbstract::Subject), 'dc:title' => $format($caption, databox_Field_DCESAbstract::Title), 'dc:type' => $format($caption, databox_Field_DCESAbstract::Type)], 'records' => $records];
 }
开发者ID:romainneutron,项目名称:Phraseanet,代码行数:26,代码来源:adapter.php


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