/**
  * Befüllt den Record Pfaden
  *
  * @param string $sPath
  * @return tx_mklib_model_Dam
  */
 public function fillPath($sPath = false)
 {
     // Pathname immer setzen!
     if (!$this->hasFilePath()) {
         if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
             $this->setFilePathName($this->getUrl());
         } else {
             $this->setFilePathName($this->getFilePath() . $this->getFileName());
         }
     }
     tx_rnbase::load('tx_mklib_util_File');
     // webpath setzen
     if ((!$sPath || $sPath == 'webpath') && !$this->hasFileWebpath()) {
         $this->setFileWebpath(tx_mklib_util_File::getWebPath($this->getFilePathName()));
     }
     // serverpath setzen
     if ((!$sPath || $sPath == 'serverpath') && !$this->hasFileServerpath()) {
         $this->setFileServerpath(tx_mklib_util_File::getServerPath($this->getFilePathName()));
     }
     // relpath setzen
     if ((!$sPath || $sPath == 'relpath') && !$this->hasFileRelpath()) {
         $this->setFileRelpath(tx_mklib_util_File::getRelPath($this->getFilePathName()));
     }
     return $this;
 }
 public function setUp()
 {
     $this->oSelector = tx_rnbase::makeInstance('tx_mklib_mod1_util_Selector');
     $this->oMod = tx_rnbase::makeInstance('tx_mklib_tests_fixtures_classes_DummyMod');
     $this->oSelector->init($this->oMod);
     $this->sModuleKey = 'testSearch';
     //Modul daten zurücksetzen
     $GLOBALS['BE_USER']->uc['moduleData'][$this->oMod->getName()] = null;
     $_GET['SET'] = null;
     //für cli
     $GLOBALS['TBE_TEMPLATE'] = t3lib_div::makeInstance('template');
     $GLOBALS['CLIENT']['FORMSTYLE'] = 'something';
     //sprache auf default setzen damit wir die richtigen labels haben
     $GLOBALS['LANG']->lang = 'default';
     //damit labels geladen sind
     global $LOCAL_LANG;
     //ab typo 4.6 ist das mit den lang labels anders
     $mHideEntry = 'Hide hidden entries';
     $mShowEntry = 'Show hidden entries';
     if (tx_rnbase_util_TYPO3::isTYPO46OrHigher()) {
         $LOCAL_LANG['default']['label_select_hide_hidden'][0]['target'] = $mHideEntry;
         $LOCAL_LANG['default']['label_select_show_hidden'][0]['target'] = $mShowEntry;
     } else {
         $LOCAL_LANG['default']['label_select_hide_hidden'] = $mHideEntry;
         $LOCAL_LANG['default']['label_select_show_hidden'] = $mShowEntry;
     }
     // sonst fehler die icon klassen
     if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         \TYPO3\CMS\Backend\Sprite\SpriteManager::initialize();
     }
 }
 /**
  * setUp() = init DB etc.
  */
 public function setUp()
 {
     $this->createDatabase();
     // assuming that test-database can be created otherwise PHPUnit will skip the test
     $this->db = $this->useTestDatabase();
     $this->importStdDB();
     $ttContentExtension = tx_rnbase_util_TYPO3::isTYPO62OrHigher() ? 'frontend' : 'cms';
     $this->importExtensions(array($ttContentExtension, 'devlog'));
     // devlog wieder aktivieren
     tx_mklib_tests_Util::disableDevlog('devlog', false);
     // logging aktivieren
     tx_mklib_tests_Util::storeExtConf();
     tx_mklib_tests_Util::setExtConfVar('logDbHandler', 1);
     //logging zurücksetzen
     tx_mklib_util_testDB::clearLogCache();
     //wir setzen noch das min Log Level auf -1 damit
     //systemeinstellungen nicht hereinspielen und alles geloggt wird
     tx_mklib_tests_Util::storeExtConf('devlog');
     tx_mklib_tests_Util::setExtConfVar('minLogLevel', -1, 'devlog');
     // Hooks leer machen da die aus anderen extensions stören könnten
     self::$hooks['rn_base']['util_db_do_insert_post'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rn_base']['util_db_do_insert_post'];
     self::$hooks['rn_base']['util_db_do_update_post'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rn_base']['util_db_do_update_post'];
     self::$hooks['rn_base']['util_db_do_delete_pre'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rn_base']['util_db_do_delete_pre'];
     $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rn_base']['util_db_do_insert_post'] = array();
     $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rn_base']['util_db_do_update_post'] = array();
     $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rn_base']['util_db_do_delete_pre'] = array();
 }
Beispiel #4
0
 /**
  * Forces the integer $theInt into the boundaries of $min and $max. If the $theInt is 'FALSE' then the $zeroValue is applied.
  *
  * @param integer $theInt Input value
  * @param integer $min Lower limit
  * @param integer $max Higher limit
  * @param integer $zeroValue Default value if input is FALSE.
  * @return integer The input value forced into the boundaries of $min and $max
  * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8 - Use t3lib_utility_Math::forceIntegerInRange() instead
  */
 public static function intInRange($theInt, $min, $max = 2000000000, $zeroValue = 0)
 {
     if (tx_rnbase_util_TYPO3::isTYPO46OrHigher()) {
         return t3lib_utility_Math::forceIntegerInRange($theInt, $min, $max, $zeroValue);
     } else {
         return t3lib_div::intInRange($theInt, $min, $max, $zeroValue);
     }
 }
 /**
  * @return string
  */
 public static function getDebugTrail()
 {
     tx_rnbase::load('tx_rnbase_util_TYPO3');
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         return \TYPO3\CMS\Core\Utility\DebugUtility::debugTrail();
     } else {
         return t3lib_utility_Debug::debugTrail();
     }
 }
 /**
  * @return \TYPO3\CMS\Core\Utility\ExtensionManagementUtility or t3lib_extMgm
  */
 protected static function getExtensionManagementUtilityClass()
 {
     if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         $class = '\\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility';
     } else {
         $class = 't3lib_extMgm';
     }
     return $class;
 }
Beispiel #7
0
 /**
  * @return \TYPO3\CMS\Backend\Utility\BackendUtility or t3lib_BEfunc
  */
 protected static function getBackendUtilityClass()
 {
     if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         $backendUtilityClass = '\\TYPO3\\CMS\\Backend\\Utility\\BackendUtility';
     } else {
         $backendUtilityClass = 't3lib_BEfunc';
     }
     return $backendUtilityClass;
 }
 /**
  * Merges two arrays recursively and "binary safe".
  *
  * @see \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule();
  *
  * @param array $original
  * @param array $overrule
  * @param boolean $addKeys
  * @param boolean $includeEmptyValues
  * @param boolean $enableUnsetFeature
  * @return void
  */
 public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = TRUE, $includeEmptyValues = TRUE, $enableUnsetFeature = TRUE)
 {
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($original, $overrule, $addKeys, $includeEmptyValues, $enableUnsetFeature);
         return $original;
     } else {
         return t3lib_div::array_merge_recursive_overrule($original, $overrule, !$addKeys, $includeEmptyValues, $enableUnsetFeature);
     }
 }
Beispiel #9
0
 /**
  * @return \TYPO3\CMS\Backend\Utility\IconUtility or t3lib_iconWorks
  */
 protected static function getIconUtilityClass()
 {
     if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         $class = '\\TYPO3\\CMS\\Backend\\Utility\\IconUtility';
     } else {
         $class = 't3lib_iconWorks';
     }
     return $class;
 }
 /**
  * Returns the cache instance
  *
  * @param string $name
  * @return tx_rnbase_cache_ICache
  */
 private static function getCacheImpl($name)
 {
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         return tx_rnbase::makeInstance('tx_rnbase_cache_TYPO3Cache62', $name);
     } elseif (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         return tx_rnbase::makeInstance('tx_rnbase_cache_TYPO3Cache60', $name);
     } elseif (tx_rnbase_util_TYPO3::isTYPO46OrHigher()) {
         return tx_rnbase::makeInstance('tx_rnbase_cache_TYPO3Cache46', $name);
     }
     return tx_rnbase::makeInstance('tx_rnbase_cache_TYPO3Cache', $name);
 }
 /**
  * Laden der Lokalisierung.
  *
  * @return 	array
  */
 public function includeLocalLang()
 {
     $llFile = $this->getLocalLangFilePath();
     if (tx_rnbase_util_TYPO3::isTYPO47OrHigher()) {
         $localizationParser = t3lib_div::makeInstance('t3lib_l10n_parser_Llxml');
         $LOCAL_LANG = $localizationParser->getParsedData($llFile, $GLOBALS['LANG']->lang);
     } else {
         $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang);
     }
     return $LOCAL_LANG;
 }
 /**
  * Deaktiviert den Cache und den formtoken
  */
 public static function removeVcAndFormToken(&$sString)
 {
     //cache und formtoken weg - diese sind ständig unterschiedlich
     //und deren Funktionalität sollte nicht hier getestet werden
     //auf der cli über cc ist der formtoken um 2 zeichen länger
     //den formToken gibt es erst ab TYPO3 4.5
     $sVcAndFormTokenRegex = tx_rnbase_util_TYPO3::isTYPO45OrHigher() ? '/&vC=(.*?)&formToken=(.*?)\'\\)/' : '/&vC=(.*?)\'\\)/';
     $sString = preg_replace($sVcAndFormTokenRegex, '\')', $sString);
     $moduleTokenRegex = tx_rnbase_util_TYPO3::isTYPO62OrHigher() ? '/%26moduleToken%3D(.*?)&amp/' : '//';
     $sString = preg_replace($moduleTokenRegex, '&amp', $sString);
     $sString = str_replace('=1&', '=1\'', $sString);
 }
 /**
  * Returns the cache
  *
  * @param string $name
  * @return tx_rnbase_cache_ICache
  */
 private static function createTYPO3Cache($name)
 {
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         $className = 'tx_rnbase_cache_TYPO3Cache62';
     } elseif (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         $className = 'tx_rnbase_cache_TYPO3Cache60';
     } elseif (tx_rnbase_util_TYPO3::isTYPO46OrHigher()) {
         $className = 'tx_rnbase_cache_TYPO3Cache46';
     } else {
         $className = 'tx_rnbase_cache_TYPO3Cache';
     }
     return tx_rnbase::makeInstance($className, $name);
 }
 /**
  * @group unit
  */
 public function testInitMediaForFalMediaSetsFalPropertiesToRecord()
 {
     if (!tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         $this->markTestSkipped('Runs only in TYPO3 6.0 and higher');
     }
     $falModel = $this->getMock('stdClass', array('getProperties', 'getUid', 'getPublicUrl'));
     $falModel->expects($this->once())->method('getProperties')->will($this->returnValue(array('title' => 'sample picture reference', 'description' => 'this is a sample picture', 'otherField' => '/some/path', 'otherField2' => '/some/other/path')));
     $mediaModel = tx_rnbase::makeInstance('tx_rnbase_model_media', $falModel);
     $this->assertEquals('sample picture reference', $mediaModel->record['title'], 'not the title of the reference');
     $this->assertEquals('/some/path', $mediaModel->record['otherField'], 'not the otherField of the original');
     $this->assertEquals('/some/other/path', $mediaModel->record['otherField2'], 'not the otherField2 of the otherField2');
     $this->assertEquals('this is a sample picture', $mediaModel->record['description'], 'not the description of the original');
 }
 /**
  * Initialisiert allgemeine Testdaten
  */
 public function setUp()
 {
     $this->oFormTool = tx_rnbase::makeInstance('tx_rnbase_util_FormTool');
     // Die Local-Lang wurde in 4.6 verändert
     if (tx_rnbase_util_TYPO3::isTYPO46OrHigher()) {
         $GLOBALS['LOCAL_LANG']['default']['Header Uid'][0] = array('source' => 'Header Uid', 'target' => 'Header Uid');
         $GLOBALS['LOCAL_LANG']['default']['Header Col1'][0] = array('source' => 'Header Col1', 'target' => 'Header Col1');
     } else {
         $GLOBALS['LOCAL_LANG']['default']['Header Uid'] = 'Header Uid';
         $GLOBALS['LOCAL_LANG']['default']['Header Col1'] = 'Header Col1';
     }
     $this->backupAndSetCurrentRequestUri();
     $this->resetIndependentEnvironmentCache();
 }
 protected function prepareItem(Tx_Rnbase_Domain_Model_RecordInterface $item, tx_rnbase_configurations $configurations, $confId)
 {
     if (!tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         // Localize data (DAM 1.1.0)
         if (method_exists(self::getDamDB(), 'getRecordOverlay')) {
             $loc = self::getDamDB()->getRecordOverlay('tx_dam', $item->getRecord(), array('sys_language_uid' => $GLOBALS['TSFE']->sys_language_uid));
             if ($loc) {
                 $item->setProperty($loc);
             }
         }
     }
     // TODO: record overlay for FAL??
     parent::prepareItem($item, $configurations, $confId);
 }
Beispiel #17
0
 /**
  * @group unit
  */
 public function testGetWizardsReturnsWizardsWithCorrectIcons()
 {
     $wizards = Tx_Rnbase_Utility_TcaTool::getWizards('', array('add' => 1, 'edit' => 1, 'list' => 1, 'RTE' => 1));
     if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         self::assertEquals('EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_add.gif', $wizards['add']['icon']);
         self::assertEquals('EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_edit.gif', $wizards['edit']['icon']);
         self::assertEquals('EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_list.gif', $wizards['list']['icon']);
         self::assertEquals('EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_rte.gif', $wizards['RTE']['icon']);
     } else {
         self::assertEquals('edit2.gif', $wizards['add']['icon']);
         self::assertEquals('add.gif', $wizards['edit']['icon']);
         self::assertEquals('list.gif', $wizards['list']['icon']);
         self::assertEquals('wizard_rte2.gif', $wizards['RTE']['icon']);
     }
 }
 private function initMedia($media)
 {
     // Ab TYPO3 6.x wird nur noch FAL unterstützt.
     if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         // Bei FAL steckt in Media eine Referenz
         if ($media instanceof TYPO3\CMS\Core\Resource\FileReference) {
             $this->initFalReference($media);
         } else {
             $this->initFalFile($media);
         }
     } else {
         // DAM
         $this->uid = $media->meta['uid'];
         $this->record = $media->meta;
     }
 }
 public function setUp()
 {
     //wir nutzen hier die pages tabelle und überschreiben die TCA
     //für ein paar felder. wir müssen das mit bestehenden feldern
     //in einer echten tabelle testen da es sonst zu warnungen kommt.
     global $TCA;
     $this->tcaBackup = $TCA[$this->testTable];
     $TCA[$this->testTable] = array('ctrl' => array('title' => $this->testTable, 'readOnly' => 1, 'is_static' => 1), 'columns' => array($this->fieldMappings['inputNotRequiredField'] => array('exclude' => 1, 'config' => array('type' => 'input')), $this->fieldMappings['selectNotRequired1Field'] => array('exclude' => 1, 'config' => array('type' => 'select')), $this->fieldMappings['selectNotRequired2Field'] => array('exclude' => 1, 'config' => array('type' => 'select', 'eval' => 'required')), $this->fieldMappings['selectNotRequired3Field'] => array('exclude' => 1, 'config' => array('type' => 'select', 'maxitems' => 1)), $this->fieldMappings['selectRequired1Field'] => array('exclude' => 1, 'config' => array('type' => 'select', 'eval' => 'required', 'maxitems' => 1, 'minitems' => 1)), $this->fieldMappings['selectRequired2Field'] => array('exclude' => 1, 'config' => array('type' => 'select', 'eval' => 'int,required', 'maxitems' => 1, 'minitems' => 1)), $this->fieldMappings['selectRequired3Field'] => array('exclude' => 1, 'config' => array('type' => 'select', 'eval' => 'required,int', 'maxitems' => 1, 'minitems' => 1)), $this->fieldMappings['selectRequired4Field'] => array('exclude' => 1, 'config' => array('type' => 'select', 'eval' => 'int,required,trim', 'maxitems' => 1, 'minitems' => 1)), $this->fieldMappings['selectRequired6Field'] => array('exclude' => 1, 'config' => array('type' => 'select', 'minitems' => 1)), $this->fieldMappings['selectNotRequired4Field'] => array('exclude' => 1, 'config' => array('type' => 'select', 'eval' => 'required', 'maxitems' => 1))));
     //damit alles auf der CLI funktioniert
     $GLOBALS['BE_USER']->user['admin'] = 1;
     //tceforms initialisieren
     $this->oTceForms = t3lib_div::makeInstance('t3lib_tceforms');
     // sonst Warning in typo3/sysext/backend/Classes/Utility/IconUtility.php line 594
     if (tx_rnbase_util_TYPO3::isTYPO60OrHigher()) {
         $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'] = (array) $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'];
     }
 }
 /**
  * @group unit
  * @dataProvider getExpectedParsedLinks
  */
 public function testParseTemplateParsesLinksCorrect($template, $expectedParsedTemplate, $sortBy, $sortOrder)
 {
     $parameters = $this->getParameters();
     $configurations = $this->getConfigurations(true);
     if ($sortBy) {
         $parameters->offsetSet('sortBy', $sortBy);
     }
     if ($sortOrder) {
         $parameters->offsetSet('sortOrder', $sortOrder);
     }
     $confId = 'myConfId.filter.';
     $filter = tx_rnbase::makeInstance('tx_mklib_filter_Sorter', $parameters, $configurations, $confId);
     $fields = array();
     $options = array();
     $filter->init($fields, $options);
     $formatter = $configurations->getFormatter();
     $parsedTemplate = $filter->parseTemplate($template, $formatter, $confId);
     // leerzeichen ab 6.2.3 nicht mehr vorhanden
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         $expectedParsedTemplate = str_replace('" >', '">', $expectedParsedTemplate);
     }
     $this->assertEquals($expectedParsedTemplate, $parsedTemplate, 'link falsch');
 }
 public function testConvertContainedEmailsToMailToLinks()
 {
     $this->initSpamProtectionConfig();
     $expectedLink = 'ein text mit einer mail <a href="javascript:linkTo_UnCryptMailto(\'ocknvq,ocknBjquv0fg\');" >mail&#8203;(at)&#8203host.de</a> und noch einer <a href="javascript:linkTo_UnCryptMailto(\'ocknvq,cpqvjgtocknBjquv0fg\');" >anothermail&#8203;(at)&#8203host.de</a>';
     // leerzeichen ab 6.2.3 nicht mehr vorhanden
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         $expectedLink = str_replace('" >', '">', $expectedLink);
     }
     $this->assertEquals($expectedLink, tx_mklib_util_String::convertContainedEmailsToMailToLinks('ein text mit einer mail mail@host.de und noch einer anothermail@host.de'), 'Mailto Links falsch');
 }
 /**
  * @see TYPO3\CMS\Backend\Utility\BackendUtility::getLinkToDataHandlerAction
  * @see TYPO3\CMS\Backend\Template\DocumentTemplate::issueCommand
  * @see template::issueCommand
  *
  * @param string $getParameters
  * @param string $redirectUrl
  * @return string
  */
 public function issueCommand($getParameters, $redirectUrl = '')
 {
     if (tx_rnbase_util_TYPO3::isTYPO76OrHigher()) {
         $link = TYPO3\CMS\Backend\Utility\BackendUtility::getLinkToDataHandlerAction($getParameters, $redirectUrl);
     } else {
         $link = $this->getDoc()->issueCommand($getParameters, $redirectUrl);
     }
     return $link;
 }
 /**
  * Setzt eventuelle Sprachparameter,
  * damit nur valide Daten für die aktuelle Sprache ausgelesen werden.
  *
  * @param array &$fields
  * @param array &$options
  * @return void
  */
 protected function handleLanguageOptions(&$fields, &$options)
 {
     if (!isset($options['i18n']) && !isset($options['ignorei18n']) && !isset($options['enablefieldsoff'])) {
         $tableName = $this->getEmptyModel()->getTableName();
         $languageField = tx_rnbase_util_TCA::getLanguageFieldForTable($tableName);
         // Die Sprache prüfen wir nur, wenn ein Sprachfeld gesetzt ist.
         if (!empty($languageField)) {
             $tsfe = tx_rnbase_util_TYPO3::getTSFE();
             $languages = array();
             if (isset($options['additionali18n'])) {
                 $languages = tx_rnbase_util_Strings::trimExplode(',', $options['additionali18n'], TRUE);
             }
             // for all languages
             $languages[] = '-1';
             // Wenn eine bestimmte Sprache gesetzt ist,
             // laden wir diese ebenfalls.
             if (is_object($tsfe) && $tsfe->sys_language_content) {
                 $languages[] = $tsfe->sys_language_content;
             } else {
                 // default language
                 $languages[] = '0';
             }
             $options['i18n'] = implode(',', array_unique($languages, SORT_NUMERIC));
         }
     }
 }
Beispiel #24
0
 /**
  * Get value by devlog extension version
  *
  * @param string $valueBeforeVersion3
  * @param string $valueSinceVersion3
  *
  * @return string
  */
 protected static function getValueByDevlogExtensionVersion($valueBeforeVersion3, $valueSinceVersion3)
 {
     if (tx_rnbase_util_TYPO3::isExtMinVersion('devlog', '3000000')) {
         $value = $valueSinceVersion3;
     } else {
         $value = $valueBeforeVersion3;
     }
     return $value;
 }
 /**
  * Find a configured cache handler.
  *
  * @param tx_rnbase_configurations $configurations
  * @param string $confId
  * @return tx_rnbase_action_ICacheHandler
  */
 protected function getCacheHandler($configurations, $confId)
 {
     // no caching if disabled!
     if (tx_rnbase_util_TYPO3::getTSFE()->no_cache) {
         return NULL;
     }
     $class = $configurations->get($confId . 'class');
     if (!$class) {
         return FALSE;
     }
     /* @var $handler tx_rnbase_action_ICacheHandler */
     $handler = tx_rnbase::makeInstance($class);
     if (!$handler instanceof tx_rnbase_action_ICacheHandler) {
         throw new Exception('"' . $class . '" has to implement "tx_rnbase_action_ICacheHandler".');
     }
     $handler->init($this, $confId);
     return $handler;
 }
 protected static function getErrorMailHtml($e, $actionName)
 {
     $htmlPart = '<strong>This is an automatic email from TYPO3. Don\'t answer!</strong>';
     $htmlPart .= '<div><strong>UNCAUGHT EXCEPTION FOR VIEW: ' . $actionName . '</strong></div>';
     $htmlPart .= '<p><strong>Message:</strong><br />' . $e->getMessage() . '</p>';
     $htmlPart .= '<p><strong>Stacktrace:</strong><pre>' . $e->__toString() . '</pre></p>';
     $htmlPart .= '<p><strong>SITE_URL</strong><br />' . tx_rnbase_util_Misc::getIndpEnv('TYPO3_SITE_URL') . '</p>';
     $get = self::removePasswordParams($_GET);
     if (count($get)) {
         $htmlPart .= '<p><strong>_GET</strong><br />' . var_export($get, TRUE) . '</p>';
     }
     $post = self::removePasswordParams($_POST);
     if (count($post)) {
         $htmlPart .= '<p><strong>_POST</strong><br />' . var_export($post, TRUE) . '</p>';
     }
     $cookie = self::removePasswordParams($_COOKIE);
     if (count($cookie)) {
         $htmlPart .= '<p><strong>_COOKIE</strong><br />' . var_export($cookie, TRUE) . '</p>';
     }
     $htmlPart .= '<p><strong>_SERVER</strong><br />' . var_export(self::removePasswordParams($_SERVER), TRUE) . '</p>';
     if ($e instanceof tx_rnbase_util_Exception) {
         $additional = $e->getAdditional();
         if ($additional) {
             $htmlPart .= '<p><strong>Additional Data:</strong><br />' . strval($additional) . '</p>';
         }
     }
     tx_rnbase::load('tx_rnbase_util_TYPO3');
     $htmlPart .= '<p><strong>BE_USER:</strong> ' . tx_rnbase_util_TYPO3::getBEUserUID() . '</p>';
     $htmlPart .= '<p><strong>FE_USER:</strong> ' . tx_rnbase_util_TYPO3::getFEUserUID() . '</p>';
     return $htmlPart;
 }
 /**
  * @return \TYPO3\CMS\Frontend\Page\PageRepository or t3lib_pageSelect
  */
 public static function getSysPage()
 {
     if (!is_object(self::$sysPage)) {
         if (is_object($GLOBALS['TSFE']->sys_page)) {
             self::$sysPage = $GLOBALS['TSFE']->sys_page;
         } else {
             self::$sysPage = tx_rnbase::makeInstance(tx_rnbase_util_TYPO3::isTYPO60OrHigher() ? 'TYPO3\\CMS\\Frontend\\Page\\PageRepository' : 't3lib_pageSelect');
             self::$sysPage->init(0);
             // $this->showHiddenPage
         }
     }
     return self::$sysPage;
 }
 /**
  * Test is DAM version 1.0 is installed.
  *
  * @return boolean
  */
 static function isVersion10()
 {
     tx_rnbase::load('tx_rnbase_util_TYPO3');
     $version = tx_rnbase_util_TYPO3::getExtVersion('dam');
     if (preg_match('(\\d*\\.\\d*\\.\\d)', $version, $versionArr)) {
         $version = $versionArr[0];
     }
     return version_compare($version, '1.1.0', '<');
 }
Beispiel #29
0
 /**
  * Load a fullfilled TCE data array for a database record.
  * @param string $table
  * @param int $theUid
  * @param boolean $isNew
  */
 public function getTCEFormArray($table, $theUid, $isNew = FALSE)
 {
     $transferDataClass = tx_rnbase_util_TYPO3::isTYPO62OrHigher() ? 'TYPO3\\CMS\\Backend\\Form\\DataPreprocessor' : 't3lib_transferData';
     $trData = tx_rnbase::makeInstance($transferDataClass);
     $trData->addRawData = TRUE;
     $trData->fetchRecord($table, $theUid, $isNew ? 'new' : '');
     // 'new'
     reset($trData->regTableItems_data);
     return $trData->regTableItems_data;
 }
 /**
  * @group unit
  */
 public function testHandleRequestSubstitutesPageTitleIfConfigured()
 {
     tx_rnbase_util_TYPO3::getTSFE()->getPageAndRootline();
     $repository = $this->getMockForAbstractClass('tx_mklib_repository_Abstract', array(), '', FALSE, FALSE, FALSE, array('findByUid'));
     $model = tx_rnbase::makeInstance('tx_mklib_model_Page', array('uid' => 987654321));
     $repository->expects($this->once())->method('findByUid')->will($this->returnValue($model));
     $action = $this->getMockForAbstractClass('tx_mklib_action_ShowSingeItem', array(), '', TRUE, TRUE, TRUE, array('getSingleItemRepository', 'getConfId'));
     $action->expects($this->once())->method('getSingleItemRepository')->will($this->returnValue($repository));
     $action->expects($this->any())->method('getConfId')->will($this->returnValue('myAction.'));
     $parameters = tx_rnbase::makeInstance('tx_rnbase_parameters', array('uid' => 987654321));
     $configurations = $this->createConfigurations(array('myAction.' => array('substitutePageTitle' => TRUE)), 'mklib', 'mklib', $parameters);
     $viewData = $configurations->getViewData();
     $action->setConfigurations($configurations);
     $this->callInaccessibleMethod($action, 'handleRequest', $parameters, $configurations, $viewData);
     $this->assertEquals($this->defaultSubstitutedPageTitle, tx_rnbase_util_TYPO3::getTSFE()->page['title'], 'tx_rnbase_util_TYPO3::getTSFE()->page[\'title\'] falsch ersetzt');
     $this->assertEquals($this->defaultSubstitutedPageTitle, tx_rnbase_util_TYPO3::getTSFE()->indexedDocTitle, 'tx_rnbase_util_TYPO3::getTSFE()->indexedDocTitle falsch ersetzt');
 }