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


PHP Page\PageRepository类代码示例

本文整理汇总了PHP中TYPO3\CMS\Frontend\Page\PageRepository的典型用法代码示例。如果您正苦于以下问题:PHP PageRepository类的具体用法?PHP PageRepository怎么用?PHP PageRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: __construct

 /**
  * Initializes the class.
  */
 public function __construct()
 {
     $this->databaseConnection = $GLOBALS['TYPO3_DB'];
     $this->tsfe = $GLOBALS['TSFE'];
     // Warning! It is important to init the new object and not reuse any existing object
     // $this->pageRepository->sys_language_uid must stay 0 because we will do overlays manually
     $this->pageRepository = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
     $this->pageRepository->init(FALSE);
 }
开发者ID:rvock,项目名称:typo3-realurl,代码行数:12,代码来源:EncodeDecoderBase.php

示例2: evaluateCondition

 /**
  * This method decides if the condition is TRUE or FALSE. It can be overriden in extending viewhelpers to adjust functionality.
  *
  * @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for flexiblity in overriding this method.
  * @return bool
  */
 protected static function evaluateCondition($arguments = NULL)
 {
     $pageUid = $arguments['pageUid'];
     $respectSiteRoot = $arguments['respectSiteRoot'];
     if (NULL === $pageUid || TRUE === empty($pageUid) || 0 === intval($pageUid)) {
         $pageUid = $GLOBALS['TSFE']->id;
     }
     $pageSelect = new PageRepository();
     $page = $pageSelect->getPage($pageUid);
     if (TRUE === (bool) $respectSiteRoot && TRUE === isset($page['is_siteroot']) && TRUE === (bool) $page['is_siteroot']) {
         return FALSE;
     }
     return TRUE === isset($page['pid']) && 0 < $page['pid'];
 }
开发者ID:smichaelsen,项目名称:vhs,代码行数:20,代码来源:IsChildPageViewHelper.php

示例3: evaluateCondition

 /**
  * @param array $arguments
  * @return bool
  */
 protected static function evaluateCondition($arguments = null)
 {
     $pageUid = $arguments['pageUid'];
     $respectSiteRoot = $arguments['respectSiteRoot'];
     if (null === $pageUid || true === empty($pageUid) || 0 === intval($pageUid)) {
         $pageUid = $GLOBALS['TSFE']->id;
     }
     $pageSelect = new PageRepository();
     $page = $pageSelect->getPage($pageUid);
     if ($respectSiteRoot && isset($page['is_siteroot']) && $page['is_siteroot']) {
         return false;
     }
     return true === isset($page['pid']) && 0 < $page['pid'];
 }
开发者ID:fluidtypo3,项目名称:vhs,代码行数:18,代码来源:IsChildPageViewHelper.php

示例4: createSysPageIfNecessary

 /**
  * Creates $this->sysPage if it does not exist yet
  *
  * @return void
  */
 protected function createSysPageIfNecessary()
 {
     if (!is_object($this->sysPage)) {
         $this->sysPage = $this->apiWrapper->getPageRepository();
         $this->sysPage->init($GLOBALS['TSFE']->showHiddenPage || $this->pObj->isBEUserLoggedIn());
     }
 }
开发者ID:blumenbach,项目名称:bb-online.neu,代码行数:12,代码来源:class.tx_realurl_advanced.php

示例5: createSysPageIfNecessary

 /**
  * Creates $this->sysPage if it does not exist yet
  *
  * @return void
  */
 protected function createSysPageIfNecessary()
 {
     if (!is_object($this->sysPage)) {
         $this->sysPage = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
         $this->sysPage->init($GLOBALS['TSFE']->showHiddenPage || $this->pObj->isBEUserLoggedIn());
     }
 }
开发者ID:smichaelsen,项目名称:realurl,代码行数:12,代码来源:UriGeneratorAndResolver.php

示例6: getRecordArray

 /**
  * Queries the database for the page record and returns it.
  *
  * @param integer $uid Page id
  * @throws RuntimeException
  * @return array
  */
 protected function getRecordArray($uid)
 {
     if (!isset(self::$pageRecordCache[$this->getCacheIdentifier($uid)])) {
         if (!is_array($GLOBALS['TCA']['pages']['columns'])) {
             if (isset($GLOBALS['TSFE'])) {
                 $GLOBALS['TSFE']->includeTCA($GLOBALS['TSFE']->TCAloaded);
             }
             \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('pages');
         }
         $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(implode(',', self::$rootlineFields), 'pages', 'uid = ' . intval($uid) . ' AND pages.deleted = 0 AND pages.doktype <> ' . \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER);
         if (empty($row)) {
             throw new \RuntimeException('Could not fetch page data for uid ' . $uid . '.', 1343589451);
         }
         $this->pageContext->versionOL('pages', $row, FALSE, TRUE);
         $this->pageContext->fixVersioningPid('pages', $row);
         if (is_array($row)) {
             $row = $this->enrichWithRelationFields($uid, $row);
             $this->pageContext->getPageOverlay($row, $this->languageUid);
             self::$pageRecordCache[$this->getCacheIdentifier($uid)] = $row;
         }
     }
     if (!is_array(self::$pageRecordCache[$this->getCacheIdentifier($uid)])) {
         throw new \RuntimeException('Broken rootline. Could not resolve page with uid ' . $uid . '.', 1343464101);
     }
     return self::$pageRecordCache[$this->getCacheIdentifier($uid)];
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:33,代码来源:RootlineUtility.php

示例7: render

 /**
  * Render method
  *
  * @param integer $pageUid
  * @param boolean $respectSiteRoot
  * @return string
  */
 public function render($pageUid = NULL, $respectSiteRoot = FALSE)
 {
     if (NULL === $pageUid || TRUE === empty($pageUid) || 0 === intval($pageUid)) {
         $pageUid = $GLOBALS['TSFE']->id;
     }
     $pageSelect = new PageRepository();
     $page = $pageSelect->getPage($pageUid);
     if (TRUE === (bool) $respectSiteRoot && TRUE === isset($page['is_siteroot']) && TRUE === (bool) $page['is_siteroot']) {
         return $this->renderElseChild();
     }
     if (TRUE === isset($page['pid']) && 0 < $page['pid']) {
         return $this->renderThenChild();
     } else {
         return $this->renderElseChild();
     }
 }
开发者ID:JostBaron,项目名称:vhs,代码行数:23,代码来源:IsChildPageViewHelper.php

示例8: setCache

 /**
  * @param null $data
  * @param null $hashVars
  * @return null
  */
 public function setCache($data = null, $hashVars = null)
 {
     $lifetime = mktime(23, 59, 59) + 1 - time();
     $cacheID = $this->getCacheID(array($hashVars));
     PageRepository::storeHash($cacheID, serialize($data), $this->_extKey . '_cache', $lifetime);
     return $data;
 }
开发者ID:bergwerk,项目名称:bwrk_onepage,代码行数:12,代码来源:CacheUtility.php

示例9: resolveShortcutParentPage

 /**
  * Resolves shortcuts for the shortcut of type PageRepository::SHORTCUT_MODE_PARENT_PAGE.
  *
  * @param array $page
  * @param array $processedPages
  * @return array
  */
 private function resolveShortcutParentPage(array $page, array &$processedPages)
 {
     $page = $this->pageRepository->getPage($page['pid'], FALSE);
     if ($page && $page['doktype'] == PageRepository::DOKTYPE_SHORTCUT) {
         $page = $this->resolveShortcutProcess($page, $processedPages);
     }
     return $page;
 }
开发者ID:MaxServ,项目名称:typo3-realurl,代码行数:15,代码来源:EncodeDecoderBase.php

示例10: setCache

 public function setCache($data, $funcName = null, $hashVars = null)
 {
     $tmp = $data;
     if (!is_array($data)) {
         $tmp = array('__string' => $data);
     }
     // Um Mitternacht endet der Cache
     $lifetime = mktime(23, 59, 59) + 1 - time();
     \TYPO3\CMS\Frontend\Page\PageRepository::storeHash($this->getCacheHash($hashVars, $funcName), serialize($tmp), $this->getCacheIdentifier($funcName), $lifetime);
     return $data;
 }
开发者ID:99grad,项目名称:TYPO3.Extbase.nnfesubmit,代码行数:11,代码来源:CacheUtility.php

示例11: render

 /**
  * Retrieve page details from given page id
  *
  * @param integer $pageId
  * @param string $as
  * @return string Rendered string
  */
 public function render($pageId, $as = 'page')
 {
     $this->templateVariableContainer->add($as, $this->pageRepository->getPage($pageId));
     $output = $this->renderChildren();
     $this->templateVariableContainer->remove($as);
     return $output;
 }
开发者ID:dp-michaelhuebe,项目名称:my_user_management,代码行数:14,代码来源:PageInfoViewHelper.php

示例12: collectPages

 /**
  * return void
  */
 protected function collectPages()
 {
     $rootline = $this->pageRepository->getRootLine($GLOBALS['TSFE']->id);
     foreach ($rootline as $page) {
         $this->collectPage($this->pageRepository->getPage($page['uid']));
     }
     $this->generateUrlCollection();
 }
开发者ID:xnet74,项目名称:bk2k_collection,代码行数:11,代码来源:SitemapService.php

示例13: migrationOfLegacyFieldsIsOnlyDoneWhenRelationFieldIsVisibleInType

 /**
  * @test
  * @dataProvider conteRowsOfDifferentTypesDataProvider
  */
 public function migrationOfLegacyFieldsIsOnlyDoneWhenRelationFieldIsVisibleInType($dbRow, $expectedCaption, $fileProperties)
 {
     $fileReference = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileReference', array(), array(), '', FALSE);
     $fileReference->expects($this->once())->method('getProperties')->will($this->returnValue($fileProperties));
     $fileReference->expects($this->any())->method('getOriginalFile')->will($this->returnValue($this->getMock('TYPO3\\CMS\\Core\\Resource\\File', array(), array(), '', FALSE)));
     $fileReference->expects($this->any())->method('getPublicUrl')->will($this->returnValue('path/to/file'));
     $this->pageRepositoryMock->expects($this->any())->method('getFileReferences')->will($this->returnValue(array($fileReference)));
     \TYPO3\CMS\Core\Resource\Service\FrontendContentAdapterService::modifyDBRow($dbRow, 'tt_content');
     $this->assertSame($expectedCaption, $dbRow['imagecaption']);
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:14,代码来源:FrontendContentAdapterServiceTest.php

示例14: indexAction

 /**
  * renders the given theme
  *
  * @return void
  */
 public function indexAction()
 {
     $this->templateName = $this->evaluateTypoScript('plugin.tx_themes.settings.templateName');
     $templateFile = $this->getTemplateFile();
     if ($templateFile !== NULL) {
         $this->view->setTemplatePathAndFilename($templateFile);
     }
     $this->view->assign('templateName', $this->templateName);
     $this->view->assign('theme', $this->themeRepository->findByPageOrRootline($GLOBALS['TSFE']->id));
     $this->view->assign('page', $this->pageRepository->getPage($GLOBALS['TSFE']->id));
     $this->view->assign('data', $this->pageRepository->getPage($GLOBALS['TSFE']->id));
     $this->view->assign('TSFE', $GLOBALS['TSFE']);
 }
开发者ID:dkd,项目名称:themes,代码行数:18,代码来源:ThemeController.php

示例15: getPageTree

 /**
  * recursive function for building a page array
  *
  * @param array $page the current page
  * @param int $depth the current depth
  * @param array $pages contains all pages so far
  * @param int $level the tree level required for the UI grid
  * @return array
  */
 protected function getPageTree($page, $depth, $pages = [], $level = 0)
 {
     // default query settings
     $fields = '*';
     $sortField = 'sorting';
     // decrease the depth
     $depth--;
     // add the current language value
     if ($this->modParams['lang'] > 0) {
         $page['sys_language_uid'] = $this->languages[$page['_PAGES_OVERLAY_LANGUAGE'] ?: 0];
     }
     if ($this->showResults) {
         $results = $this->getResults($page);
         $page['results'] = $results['Percentage']['count'];
     }
     $page['level'] = $level;
     // add the page to the pages array
     $pages[] =& $page;
     // fetch subpages and set the treelevel
     if ($depth > 0) {
         $subPages = $this->pageRepository->getMenu($page['uid'], $fields, $sortField);
         if (count($subPages) > 0) {
             $page['$$treeLevel'] = $level;
             $level++;
             foreach ($subPages as &$subPage) {
                 $pages = $this->getPageTree($subPage, $depth, $pages, $level);
             }
         }
     }
     return $pages;
 }
开发者ID:clickstorm,项目名称:cs_seo,代码行数:40,代码来源:ModuleController.php


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