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


PHP collection::getLogo方法代码示例

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


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

示例1: testDeleteMiniLogo

 /**
  *  @covers Alchemy\Phrasea\Controller\Admin\Bas::deleteLogo
  */
 public function testDeleteMiniLogo()
 {
     if (count(\collection::getLogo(self::$DI['collection']->get_base_id(), self::$DI['app'])) === 0) {
         $this->markTestSkipped('No logo setted');
     }
     $this->setAdmin(true);
     $this->XMLHTTPRequest('POST', '/admin/collection/' . self::$DI['collection']->get_base_id() . '/picture/mini-logo/delete/');
     $json = $this->getJson(self::$DI['client']->getResponse());
     $this->assertTrue($json->success);
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:13,代码来源:AdminCollectionTest.php

示例2: get_title

 /**
  *
  * @return String
  */
 public function get_title($highlight = '', SearchEngineInterface $search_engine = null)
 {
     if ($this->title) {
         return $this->title;
     }
     $this->title = collection::getLogo($this->get_base_id(), $this->app) . ' ';
     switch ($this->env) {
         case "RESULT":
             $this->title .= $this->app->trans('preview:: resultat numero %number%', ['%number%' => '<span id="current_result_n">' . ($this->number + 1) . '</span> : ']);
             $this->title .= parent::get_title($highlight, $search_engine);
             break;
         case "BASK":
             $this->title .= $this->name . ' - ' . parent::get_title($highlight, $search_engine) . ' (' . $this->get_number() . '/' . $this->total . ') ';
             break;
         case "REG":
             $title = parent::get_title();
             if ($this->get_number() == 0) {
                 $this->title .= $title;
             } else {
                 $this->title .= sprintf('%s %s', $title, $this->get_number() . '/' . $this->total);
             }
             break;
         default:
             $this->title .= parent::get_title($highlight, $search_engine);
             break;
     }
     return $this->title;
 }
开发者ID:nlegoff,项目名称:Phraseanet,代码行数:32,代码来源:preview.php

示例3: get_collection_logo

 /**
  *
  * @return string
  */
 public function get_collection_logo()
 {
     return collection::getLogo($this->base_id, $this->app, true);
 }
开发者ID:romainneutron,项目名称:Phraseanet,代码行数:8,代码来源:adapter.php

示例4: query

 /**
  * Queries database to fetch documents
  *
  * @param  Application $app
  * @param  Request     $request
  * @return Response
  */
 public function query(Application $app, Request $request)
 {
     $query = $this->buildQueryFromRequest($request);
     $displayMode = explode('X', $request->request->get('mod', '3X6'));
     if (count($displayMode) === 1) {
         $modRow = (int) $displayMode[0];
         $modCol = 1;
     } else {
         $modRow = (int) $displayMode[0];
         $modCol = (int) $displayMode[1];
     }
     $perPage = $modCol * $modRow;
     $options = SearchEngineOptions::fromRequest($app, $request);
     $currentPage = (int) $request->request->get('pag', 0);
     if ($currentPage < 1) {
         $app['phraseanet.SE']->resetCache();
         $currentPage = 1;
     }
     $result = $app['phraseanet.SE']->query($query, ($currentPage - 1) * $perPage, $perPage, $options);
     $userQuery = new UserQuery();
     $userQuery->setUser($app['authentication']->getUser());
     $userQuery->setQuery($query);
     $app['EM']->persist($userQuery);
     $app['EM']->flush();
     if ($app['settings']->getUserSetting($app['authentication']->getUser(), 'start_page') === 'LAST_QUERY') {
         $app['manipulator.user']->setUserSetting($app['authentication']->getUser(), 'start_page_query', $query);
     }
     foreach ($options->getDataboxes() as $databox) {
         $colls = array_map(function (\collection $collection) {
             return $collection->get_coll_id();
         }, array_filter($options->getCollections(), function (\collection $collection) use($databox) {
             return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id();
         }));
         $app['phraseanet.SE.logger']->log($databox, $result->getQuery(), $result->getTotal(), $colls);
     }
     $searchData = $result->getResults();
     if (count($searchData) === 0) {
         return new Response($app['twig']->render("client/help.html.twig"));
     }
     $resultData = [];
     foreach ($searchData as $record) {
         try {
             $record->get_subdef('document');
             $lightInfo = $app['twig']->render('common/technical_datas.html.twig', ['record' => $record]);
         } catch (\Exception $e) {
             $lightInfo = '';
         }
         $caption = $app['twig']->render('common/caption.html.twig', ['view' => 'answer', 'record' => $record]);
         $docType = $record->get_type();
         $isVideo = $docType == 'video';
         $isAudio = $docType == 'audio';
         $isImage = $docType == 'image';
         $isDocument = $docType == 'document';
         if (!$isVideo && !$isAudio) {
             $isImage = true;
         }
         $canDownload = $app['acl']->get($app['authentication']->getUser())->has_right_on_base($record->get_base_id(), 'candwnldpreview') || $app['acl']->get($app['authentication']->getUser())->has_right_on_base($record->get_base_id(), 'candwnldhd') || $app['acl']->get($app['authentication']->getUser())->has_right_on_base($record->get_base_id(), 'cancmd');
         try {
             $previewExists = $record->get_preview()->is_physically_present();
         } catch (\Exception $e) {
             $previewExists = false;
         }
         $resultData[] = ['record' => $record, 'mini_logo' => \collection::getLogo($record->get_base_id(), $app), 'preview_exists' => $previewExists, 'light_info' => $lightInfo, 'caption' => $caption, 'is_video' => $isVideo, 'is_audio' => $isAudio, 'is_image' => $isImage, 'is_document' => $isDocument, 'can_download' => $canDownload, 'can_add_to_basket' => $app['acl']->get($app['authentication']->getUser())->has_right_on_base($record->get_base_id(), 'canputinalbum')];
     }
     return new Response($app['twig']->render("client/answers.html.twig", ['mod_col' => $modCol, 'mod_row' => $modRow, 'result_data' => $resultData, 'per_page' => $perPage, 'search_engine' => $app['phraseanet.SE'], 'search_engine_option' => $options->serialize(), 'history' => \queries::history($app, $app['authentication']->getUser()->getId()), 'result' => $result, 'proposals' => $currentPage === 1 ? $result->getProposals() : null, 'help' => count($resultData) === 0 ? $this->getHelpStartPage($app) : '']));
 }
开发者ID:romainneutron,项目名称:Phraseanet,代码行数:73,代码来源:Root.php


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