コード例 #1
0
ファイル: PageFinderTest.php プロジェクト: Konafets/oelib
 /**
  * @test
  */
 public function getInstanceAfterPurgeInstanceReturnsNewInstance()
 {
     $firstInstance = Tx_Oelib_PageFinder::getInstance();
     Tx_Oelib_PageFinder::purgeInstance();
     self::assertNotSame($firstInstance, Tx_Oelib_PageFinder::getInstance());
 }
コード例 #2
0
 /**
  * @test
  */
 public function getAfterSetReturnsManuallySetConfigurationEvenIfThereIsAPage()
 {
     $pageUid = $this->testingFramework->createFrontEndPage();
     $this->testingFramework->createTemplate($pageUid, array('config' => 'plugin.tx_oelib.bar = 42'));
     Tx_Oelib_PageFinder::getInstance()->setPageUid($pageUid);
     $configuration = new Tx_Oelib_Configuration();
     Tx_Oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_oelib', $configuration);
     self::assertSame($configuration, Tx_Oelib_ConfigurationRegistry::get('plugin.tx_oelib'));
 }
コード例 #3
0
ファイル: TemplateHelper.php プロジェクト: Konafets/oelib
 /**
  * Gets the ID of the currently selected back-end page.
  *
  * @return int the current back-end page ID (or 0 if there is an
  *                 error)
  */
 public function getCurrentBePageId()
 {
     return Tx_Oelib_PageFinder::getInstance()->getPageUid();
 }
コード例 #4
0
 /**
  * Retrieves the complete TypoScript setup for the current page as a nested
  * array.
  *
  * @return array the TypoScriptSetup for the current page, will be empty if
  *               no page is selected or if the TS setup of the page is empty
  */
 private function getCompleteTypoScriptSetup()
 {
     $pageUid = Tx_Oelib_PageFinder::getInstance()->getPageUid();
     if ($pageUid === 0) {
         return array();
     }
     if ($this->existsFrontEnd()) {
         return $this->getFrontEndController()->tmpl->setup;
     }
     /** @var t3lib_TStemplate $template */
     $template = t3lib_div::makeInstance('t3lib_TStemplate');
     $template->tt_track = 0;
     $template->init();
     /** @var t3lib_pageSelect $page */
     $page = t3lib_div::makeInstance('t3lib_pageSelect');
     $rootline = $page->getRootLine($pageUid);
     $template->runThroughTemplates($rootline, 0);
     $template->generateConfig();
     return $template->setup;
 }