/**
  * Test flexform value with pointed keys.
  *
  */
 function test_flexformSetup()
 {
     $GLOBALS['TSFE'] = new tx_rnbase_tsfeDummy();
     $GLOBALS['TSFE']->tmpl->setup['lib.']['feuser.']['link'] = array('pid' => '10');
     $flexXml = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <T3FlexForms>  <data>  <sheet index="sDEF">  <language index="lDEF">  <field index="action">  <value index="vDEF">tx_rnuserregister_actions_Login</value>  </field>  <field index="feuserPages">  <value index="vDEF"></value>  </field>  <field index="feuserPagesRecursive">  <value index="vDEF"></value>  </field>  </language>  </sheet>  <sheet index="s_loginbox">  <language index="lDEF">  <field index="view.loginbox.header">  <value index="vDEF">Welcome</value>  </field>  <field index="view.loginbox.message">  <value index="vDEF"></value>   </field>  <field index="listview.fegroup.link.pid">  <value index="vDEF">25</value>   </field> <field index="detailview.feuser.link.pid">  <value index="vDEF">35</value>   </field>  </language>  </sheet>  </data> </T3FlexForms>';
     $configurationArray['template'] = 'test.html';
     $configurationArray['view.']['dummy'] = '1';
     $configurationArray['view.']['dummy.']['test'] = '1';
     $configurationArray['view.']['loginbox.']['header.']['enable'] = '1';
     $configurationArray['view.']['loginbox.']['header'] = 'Wrong Header';
     $configurationArray['view.']['loginbox.']['message'] = 'Hello';
     $configurationArray['listview.']['feuser'] = '******';
     $cObj = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getContentObjectRendererClass());
     $cObj->data['pi_flexform'] = $flexXml;
     $configurations = tx_rnbase::makeInstance('tx_rnbase_configurations');
     $configurations->init($configurationArray, $cObj, 'extkey_text', 'rntest');
     $this->assertEquals('Welcome', $configurations->get('view.loginbox.header'), 'Header should be Welcome');
     $this->assertEquals('Hello', $configurations->get('view.loginbox.message'), 'Message should be Hello');
     $this->assertEquals('test.html', $configurations->get('template'), 'Template should be test.html');
     $this->assertEquals('1', $configurations->get('view.dummy'), 'Dummy should be 1');
     $pid = $configurations->get('listview.fegroup.link.pid');
     $this->assertEquals('25', $pid, 'PID from flexform should be 25 but was: ' . $pid);
     $pid = $configurations->get('detailview.feuser.link.pid');
     $this->assertEquals('35', $pid, 'PID from flexform should be 35 but was: ' . $pid);
 }
コード例 #2
0
 protected function send45()
 {
     /* @var $mail TYPO3\CMS\Core\Mail\MailMessage */
     $mail = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getMailMessageClass());
     $mail->setFrom(array($this->from => $this->fromName));
     $mail->setTo(tx_rnbase_util_Strings::trimExplode(',', $this->toAsString));
     $mail->setSubject($this->subject);
     if ($this->replyTo) {
         $mail->addReplyTo($this->replyTo, $this->replyToName);
     }
     // Or set it after like this
     if ($this->htmlPart) {
         $mail->setBody($this->htmlPart, 'text/html');
     }
     // Add alternative parts with addPart()
     if ($this->textPart) {
         $mail->addPart($this->textPart, 'text/plain');
     }
     if (!empty($this->attachments)) {
         foreach ($this->attachments as $attachment) {
             if (!$mail->attach(Swift_Attachment::fromPath($attachment['src']))) {
                 tx_rnbase_util_Logger::warn('Adding attachment failed!', 'rn_base', array('subject' => $mail->subject, 'to' => $this->toAsString, 'attachment' => $attachment));
             }
         }
     }
     $mail->send();
 }
コード例 #3
0
 /**
  * Returns an instanceof tslib_cObj or \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer.
  * Since this object has functions for database access and frontend your ControllerAction
  * should always provide cObj for model and view. This ensures only one instance per request.
  *
  * @return an instance of \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer or tslib_cObj
  */
 function getCObj()
 {
     if (!$this->cObject) {
         $this->cObject = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getContentObjectRendererClass());
     }
     return $this->cObject;
 }
 private function getConfig($confArr)
 {
     $cObj = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getContentObjectRendererClass());
     $configurations = tx_rnbase::makeInstance('tx_rnbase_configurations');
     $configurations->init($confArr, $cObj, 'tx_rnbase', 'rnbase');
     return $configurations;
 }
コード例 #5
0
ファイル: ToolBox.php プロジェクト: RocKordier/rn_base
 /**
  *
  * @param template $doc
  * @param tx_rnbase_mod_IModule $module
  */
 public function init($doc, $module)
 {
     global $BACK_PATH;
     $this->doc = $doc;
     $this->module = $module;
     // TCEform für das Formular erstellen
     $this->form = tx_rnbase_util_TYPO3::isTYPO76OrHigher() ? tx_rnbase::makeInstance('Tx_Rnbase_Backend_Form_FormBuilder') : tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getBackendFormEngineClass());
     $this->form->initDefaultBEmode();
     $this->form->backPath = $BACK_PATH;
     if (tx_rnbase_util_TYPO3::isTYPO76OrHigher()) {
         $this->iconFactory = tx_rnbase::makeInstance('TYPO3\\CMS\\Core\\Imaging\\IconFactory');
     }
 }
コード例 #6
0
 /**
  * Load a local lang from a file.
  * merging with the existing local lang
  *
  * @param string $filename
  *
  * @return void
  */
 public function loadLLFile($filename)
 {
     if (!$filename) {
         return;
     }
     // Find language file
     $basePath = tx_rnbase_util_Files::getFileAbsFileName($filename);
     // php or xml as source: In any case the charset will be that of the system language.
     // However, this function guarantees only return output for default language plus the specified language (which is different from how 3.7.0 dealt with it)
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     self::addLang($utility::readLLfile($basePath, self::getLLKey(), $GLOBALS['TSFE']->renderCharset));
     if ($llKey = self::getLLKey(TRUE)) {
         self::addLang($utility::readLLfile($basePath, $llKey, $GLOBALS['TSFE']->renderCharset));
     }
 }
コード例 #7
0
 /**
  * Erzeugt anhand von einer URL hidden Felder, welche mit übergeben werden.
  * Dabei werden die Get-Parameter aus der Action URL entfernt.
  * Das ist wichtig, wenn das Formular mit GET abgeschickt wird
  * und die Action URL bereits GET Parameter enthält.
  * Die in der URL enthaltenen Parameter gehen verloren!
  *
  * @author Michael Wagner
  * @param string $url
  * @return string
  */
 public static function getHiddenFieldsForUrlParams($url)
 {
     $sysHidden = '';
     $params = array();
     if (strpos($url, '?') !== FALSE) {
         $params = substr($url, strpos($url, '?') + 1);
         $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
         $params = $utility::explodeUrl2Array($params);
         $url = substr($url, 0, strpos($url, '?'));
     }
     foreach ($params as $name => $value) {
         $name = tx_rnbase_util_Strings::removeXSS($name);
         $value = tx_rnbase_util_Strings::removeXSS($value);
         $sysHidden .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
     }
     return $sysHidden;
 }
コード例 #8
0
ファイル: TcaTool.php プロジェクト: RocKordier/rn_base
 /**
  * constructor to log deprecation!
  *
  * @return void
  */
 function __construct()
 {
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     $utility::deprecationLog('Usage of "Tx_Rnbase_Util_TCATool" is deprecated' . 'Please use "Tx_Rnbase_Utility_TcaTool" instead!');
 }
コード例 #9
0
 protected function _validateAdditionalFields(array &$submittedData, $schedulerModule)
 {
     // @codingStandardsIgnoreEnd
     $credentials =& $submittedData['mklog_watchdog_credentials'];
     $credentials = trim($credentials);
     if (empty($credentials)) {
         $flashMessageClass = \tx_rnbase_util_Typo3Classes::getFlashMessageClass();
         $schedulerModule->addMessage('The credentials for the transport are required!', $flashMessageClass::ERROR);
         return false;
     }
     return true;
 }
コード例 #10
0
 /**
  * Returns the global $_POST array (or value from) normalized.
  *
  * @param string $var
  *
  * @see t3lib_div::_POST
  * @see \TYPO3\CMS\Core\Utility\GeneralUtility::_POST
  *
  * @return mixed
  */
 public static function getPostParameters($var = NULL)
 {
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     return $utility::_POST($var);
 }
コード例 #11
0
 /**
  * (non-PHPdoc)
  * @see t3lib_div::isAllowedAbsPath()
  * @see TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedAbsPath()
  *
  * @param string $path File path to evaluate
  * @return bool
  */
 public static function isAllowedAbsPath($path)
 {
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     return $utility::isAllowedAbsPath($path);
 }
コード例 #12
0
 /**
  * @group unit
  */
 public function testRemoveLogTablesFromTablesThatCanBeCopied()
 {
     $mklogTable = 'tx_mklog_devlog_entry';
     $devLogTable = Tx_Mklog_Utility_Devlog::getTableName();
     $dataHandler = tx_rnbase::makeInstance('Tx_Mklog_Hooks_DataHandler');
     $dataHandlerParent = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getDataHandlerClass());
     $dataHandlerParent = $this->getMock(tx_rnbase_util_Typo3Classes::getDataHandlerClass(), array('compileAdminTables'));
     $dataHandlerParent->expects(self::once())->method('compileAdminTables')->will(self::returnValue(array('pages', 'tt_content', 'sys_template', $devLogTable, $mklogTable)));
     $this->callInaccessibleMethod($dataHandler, 'removeLogTablesFromTablesThatCanBeCopied', $dataHandlerParent);
     self::assertNotSame('*', $dataHandlerParent->copyWhichTables, 'es sollte nicht per default auf * stehen');
     $copyWhichTables = array_flip(explode(',', $dataHandlerParent->copyWhichTables));
     self::assertTrue(is_array($copyWhichTables), 'das sollte ein array sein');
     self::assertGreaterThan(2, count($copyWhichTables), 'es sollte mehr als eine Tabelle enthalten sein');
     self::assertArrayNotHasKey($devLogTable, $copyWhichTables, 'devlog Tabelle noch enthalten');
     self::assertArrayNotHasKey($mklogTable, $copyWhichTables, 'mklog Tabelle noch enthalten');
 }
コード例 #13
0
 /**
  *
  * @return \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
  */
 private static function getTsParser()
 {
     return tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getTypoScriptParserClass());
 }
コード例 #14
0
 /**
  * Render an array of data entries with an html template. The html template should look like this:
  * ###DATAS###
  * ###DATA###
  * ###DATA_UID###
  * ###DATA###
  * ###DATAEMPTYLIST###
  * Shown if list is empty
  * ###DATAEMPTYLIST###
  * ###DATAS###
  * We have some conventions here:
  * The given parameter $marker should be named 'DATA' for this example. The the list subpart
  * is experted to be named '###'.$marker.'S###'. Please notice the trailing S!
  * If you want to render a pagebrowser add it to the $viewData with key 'pagebrowser'.
  * A filter will be detected and rendered too. It should be available in $viewData with key 'filter'.
  *
  * @param array|Traversable $dataArr entries
  * @param string $template
  * @param string $markerClassname item-marker class
  * @param string $confId ts-Config for data entries like team.
  * @param string $marker name of marker like TEAM
  * @param tx_rnbase_util_FormatUtil $formatter
  * @param array $markerParams array of settings for itemmarker
  * @return string
  */
 function render(&$dataArr, $viewData, $template, $markerClassname, $confId, $marker, $formatter, $markerParams = NULL)
 {
     $viewData = is_object($viewData) ? $viewData : new ArrayObject();
     $debugKey = $formatter->getConfigurations()->get($confId . '_debuglb');
     $debug = $debugKey && ($debugKey === '1' || $_GET['debug'] && array_key_exists($debugKey, array_flip(tx_rnbase_util_Strings::trimExplode(',', $_GET['debug']))) || $_POST['debug'] && array_key_exists($debugKey, array_flip(tx_rnbase_util_Strings::trimExplode(',', $_POST['debug']))));
     if ($debug) {
         $time = microtime(TRUE);
         $mem = memory_get_usage();
         $wrapTime = tx_rnbase_util_FormatUtil::$time;
         $wrapMem = tx_rnbase_util_FormatUtil::$mem;
     }
     $outerMarker = $this->getOuterMarker($marker, $template);
     $htmlParser = tx_rnbase_util_Typo3Classes::getHtmlParserClass();
     while ($templateList = $htmlParser::getSubpart($template, '###' . $outerMarker . 'S###')) {
         if ((is_array($dataArr) || $dataArr instanceof Traversable) && count($dataArr)) {
             /* @var $listMarker tx_rnbase_util_ListMarker */
             $listMarker = tx_rnbase::makeInstance('tx_rnbase_util_ListMarker', $this->info->getListMarkerInfo());
             $templateEntry = $htmlParser::getSubpart($templateList, '###' . $marker . '###');
             $offset = 0;
             $pageBrowser = $viewData->offsetGet('pagebrowser');
             if ($pageBrowser) {
                 $state = $pageBrowser->getState();
                 $offset = $state['offset'];
             }
             $markerArray = $subpartArray = array();
             $listMarker->addVisitors($this->visitors);
             $out = $listMarker->render($dataArr, $templateEntry, $markerClassname, $confId, $marker, $formatter, $markerParams, $offset);
             $subpartArray['###' . $marker . '###'] = $out;
             $subpartArray['###' . $marker . 'EMPTYLIST###'] = '';
             // Das Menu für den PageBrowser einsetzen
             if ($pageBrowser) {
                 $subpartArray['###PAGEBROWSER###'] = tx_rnbase_util_BaseMarker::fillPageBrowser($htmlParser::getSubpart($template, '###PAGEBROWSER###'), $pageBrowser, $formatter, $confId . 'pagebrowser.');
                 $listSize = $pageBrowser->getListSize();
             } else {
                 $listSize = count($dataArr);
             }
             $markerArray['###' . $marker . 'COUNT###'] = $formatter->wrap($listSize, $confId . 'count.');
             // charbrowser
             $pagerData = $viewData->offsetGet('pagerData');
             $charPointer = $viewData->offsetGet('charpointer');
             $subpartArray['###CHARBROWSER###'] = tx_rnbase_util_BaseMarker::fillCharBrowser(tx_rnbase_util_Templates::getSubpart($template, '###CHARBROWSER###'), $markerArray, $pagerData, $charPointer, $formatter->getConfigurations(), $confId . 'charbrowser.');
             $out = tx_rnbase_util_BaseMarker::substituteMarkerArrayCached($templateList, $markerArray, $subpartArray);
         } else {
             // Support für EMPTYLIST-Block
             if (tx_rnbase_util_BaseMarker::containsMarker($template, $marker . 'EMPTYLIST')) {
                 $out = $htmlParser::getSubpart($template, '###' . $marker . 'EMPTYLIST###');
             } else {
                 $out = $this->info->getEmptyListMessage($confId, $viewData, $formatter->getConfigurations());
             }
         }
         $template = tx_rnbase_util_Templates::substituteSubpart($template, '###' . $outerMarker . 'S###', $out, 0);
     }
     $markerArray = array();
     $subpartArray = array();
     // Muss ein Formular mit angezeigt werden
     // Zuerst auf einen Filter prüfen
     $filter = $viewData->offsetGet('filter');
     if ($filter) {
         $template = $filter->getMarker()->parseTemplate($template, $formatter, $confId . 'filter.', $marker);
     }
     // Jetzt noch die alte Variante
     $markerArray['###SEARCHFORM###'] = '';
     $seachform = $viewData->offsetGet('searchform');
     if ($seachform) {
         $markerArray['###SEARCHFORM###'] = $seachform;
     }
     $out = tx_rnbase_util_BaseMarker::substituteMarkerArrayCached($template, $markerArray, $subpartArray);
     if ($debug) {
         tx_rnbase::load('class.tx_rnbase_util_Misc.php');
         $wrapTime = tx_rnbase_util_FormatUtil::$time - $wrapTime;
         $wrapMem = tx_rnbase_util_FormatUtil::$mem - $wrapMem;
         tx_rnbase_util_Debug::debug(array('Rows' => count($dataArr), 'Execustion time' => microtime(TRUE) - $time, 'WrapTime' => $wrapTime, 'WrapMem' => $wrapMem, 'Memory start' => $mem, 'Memory consumed' => memory_get_usage() - $mem), 'ListBuilder Statistics for: ' . $confId . ' Key: ' . $debugKey);
     }
     return $out;
 }
コード例 #15
0
 /**
  * Wrapper method for t3lib_div::devLog() or \TYPO3\CMS\Core\Utility\GeneralUtility::devLog()
  *
  * @param string $msg Message (in english).
  * @param string $extKey Extension key (from which extension you are calling the log)
  * @param integer $severity Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
  * @param mixed $dataVar Additional data you want to pass to the logger.
  * @return void
  */
 public static function devLog($msg, $extKey, $severity = 0, $dataVar = FALSE)
 {
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     $utility::devLog($msg, $extKey, $severity, $dataVar);
 }
コード例 #16
0
 public function addMessage($message, $title = '', $severity = 0, $storeInSession = FALSE)
 {
     $flashMessage = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getFlashMessageClass(), $message, $title, $severity, $storeInSession);
     if (tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         /** @var $flashMessageService FlashMessageService */
         $flashMessageService = tx_rnbase::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
         $flashMessageService->getMessageQueueByIdentifier()->enqueue($flashMessage);
     } else {
         t3lib_FlashMessageQueue::addMessage($flashMessage);
     }
 }
 /**
  *
  * @param array $config
  * @return PHPUnit_Framework_MockObject_MockObject|tx_rnbase_action_CacheHandlerDefault
  */
 protected function getHandlerMock(array $config = array(), array $methods = array())
 {
     $handler = $this->getMock('tx_rnbase_action_CacheHandlerDefault', array_merge(array('getConfigurations', 'getConfId'), $methods));
     // create cobject with the plugin id.
     $cObj = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getContentObjectRendererClass());
     $cObj->data['uid'] = '75';
     $confId = 'myaction.';
     $configurations = $this->createConfigurations(array($confId => array('_caching.' => $config)), 'rn_base', 'rn_base', $cObj);
     $handler->expects($this->atLeastOnce())->method('getConfigurations')->will($this->returnValue($configurations));
     $handler->expects($this->any())->method('getConfId')->will($this->returnValue($confId . '_caching.'));
     return $handler;
 }
コード例 #18
0
 /**
  * Set a single trivial dataset
  *
  * @param	object		The parent Dataset object
  * @param	array		The array with TypoScript properties for the object
  */
 private function datasetTrivial($arrConf)
 {
     $dataSet =& tx_pbimagegraph::factory('dataset');
     if (is_array($arrConf)) {
         $strName = $arrConf['name'];
         $dataSet->setName($strName);
         $templateServiceClass = tx_rnbase_util_Typo3Classes::getTemplateServiceClass();
         $arrKeys = $templateServiceClass::sortedKeyList($arrConf);
         foreach ($arrKeys as $strKey) {
             $strValue = $arrConf[$strKey];
             if (intval($strKey) && !strstr($strKey, '.')) {
                 if ($strValue == 'point') {
                     $mixX = $arrConf[$strKey . '.']['x'];
                     if ($arrConf[$strKey . '.']['y'] == 'null') {
                         $mixY = NULL;
                     } elseif (is_array($arrConf[$strKey . '.']['y.'])) {
                         $mixY = $arrConf[$strKey . '.']['y.'];
                     } else {
                         $mixY = $arrConf[$strKey . '.']['y'];
                     }
                     $strId = $arrConf[$strKey . '.']['id'];
                     $dataSet->addPoint($mixX, $mixY, $strId);
                 }
             }
         }
     }
     return $dataSet;
 }
コード例 #19
0
ファイル: Connection.php プロジェクト: RocKordier/rn_base
 /**
  * Make a query to database. You will receive an array with result rows. All
  * database resources are closed after each call.
  * A Hidden and Delete-Clause for FE-Requests is added for requested table.
  *
  * @param $what requested columns
  * @param $from either the name of on table or an array with index 0 the from clause
  *              and index 1 the requested tablename
  * @param $where
  * @param $groupby
  * @param $orderby
  * @param $wrapperClass Name einer WrapperKlasse für jeden Datensatz
  * @param $limit = '' Limits number of results
  * @param $debug = 0 Set to 1 to debug sql-String
  * @deprecated use tx_rnbase_util_DB::doSelect()
  */
 function queryDB($what, $from, $where, $groupBy = '', $orderBy = '', $wrapperClass = 0, $limit = '', $debug = 0)
 {
     $tableName = $from;
     $fromClause = $from;
     if (is_array($from)) {
         $tableName = $from[1];
         $fromClause = $from[0];
     }
     $limit = intval($limit) > 0 ? intval($limit) : '';
     // Zur Where-Clause noch die gültigen Felder hinzufügen
     $contentObjectRendererClass = tx_rnbase_util_Typo3Classes::getContentObjectRendererClass();
     $where .= $contentObjectRendererClass::enableFields($tableName);
     if ($debug) {
         $sql = $GLOBALS['TYPO3_DB']->SELECTquery($what, $fromClause, $where, $groupBy, $orderBy);
         tx_rnbase_util_Debug::debug($sql, 'SQL');
         tx_rnbase_util_Debug::debug(array($what, $from, $where));
     }
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($what, $fromClause, $where, $groupBy, $orderBy, $limit);
     $wrapper = is_string($wrapperClass) ? tx_rnbase::makeInstanceClassName($wrapperClass) : 0;
     $rows = array();
     while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
         $rows[] = $wrapper ? new $wrapper($row) : $row;
     }
     $GLOBALS['TYPO3_DB']->sql_free_result($res);
     if ($debug) {
         tx_rnbase_util_Debug::debug(count($rows), 'Rows retrieved');
     }
     return $rows;
 }
コード例 #20
0
 /**
  * @see t3lib_div::locationHeaderUrl()
  * @see TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl()
  *
  * @param string $path URL / path to prepend full URL addressing to.
  * @return string
  */
 public static function locationHeaderUrl($path)
 {
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     return $utility::locationHeaderUrl($path);
 }
コード例 #21
0
 /**
  * Wrapper method for t3lib_div::logDeprecatedFunction() or \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction()
  *
  * @return void
  */
 public static function logDeprecatedFunction()
 {
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     $utility::logDeprecatedFunction();
 }
コード例 #22
0
 /**
  * @group unit
  */
 public function testDoActionCallsPageNotFoundHandlingIfPageNotFoundException()
 {
     if (!tx_rnbase_util_TYPO3::isTYPO62OrHigher()) {
         self::markTestSkipped('Dieses Feature wird erst ab TYPO3 6.2 unterstützt');
     }
     $controller = $this->getMock('tx_rnbase_controller', array('getTsfe'));
     $tsfe = $this->getMock(tx_rnbase_util_Typo3Classes::getTypoScriptFrontendControllerClass(), array('pageNotFoundAndExit'), array(), '', FALSE);
     $tsfe->expects(self::once())->method('pageNotFoundAndExit')->with('TYPO3\\CMS\\Core\\Error\\Http\\PageNotFoundException was thrown');
     $controller->expects(self::once())->method('getTsfe')->will(self::returnValue($tsfe));
     $parameters = $configurations = NULL;
     $controller->doAction('tx_rnbase_tests_action_throwPageNotFoundException', $parameters, $configurations);
 }
コード例 #23
0
 /**
  * wrapper Methode mit Abhängigkeit von TYPO3 Version
  *
  * @return string
  * @deprecated use tx_rnbase_util_Typo3Classes::getHttpUtilityClass
  */
 public static function getHttpUtilityClass()
 {
     return tx_rnbase_util_Typo3Classes::getHttpUtilityClass();
 }
コード例 #24
0
 private function mergeTSReference($value, $conf)
 {
     if (substr($value, 0, 1) != '<') {
         return $conf;
     }
     // das < abschneiden, um den pfad zum link zu erhalten
     $key = trim(substr($value, 1));
     $tsParser = tx_rnbase::makeInstance(tx_rnbase_util_Typo3Classes::getTypoScriptParserClass());
     // $name and $conf is loaded with the referenced values.
     list($linkValue, $linkConf) = $tsParser->getVal($key, $GLOBALS['TSFE']->tmpl->setup);
     // Konfigurationen mergen
     if (is_array($conf) && count($conf)) {
         $linkConf = self::joinTSarrays($linkConf, $conf);
     }
     // auf rekursion hin prüfen
     $linkConf = $this->mergeTSReference($linkValue, $linkConf);
     return $linkConf;
 }
 /**
  * This method checks any additional data that is relevant to the specific task
  * If the task class is not relevant, the method is expected to return true
  *
  * @param	array					$submittedData: reference to the array containing the data submitted by the user
  * @param	tx_scheduler_Module		$parentObject: reference to the calling object (Scheduler's BE module)
  * @return	boolean					True if validation was ok (or selected class is not relevant), false otherwise
  */
 protected function _validateAdditionalFields(array &$submittedData, $schedulerModule)
 {
     $submittedData[MKLOG_FIELD_EMAIL] = trim($submittedData[MKLOG_FIELD_EMAIL]);
     if (empty($submittedData[MKLOG_FIELD_EMAIL])) {
         $flashMessageClass = tx_rnbase_util_Typo3Classes::getFlashMessageClass();
         $schedulerModule->addMessage($GLOBALS['LANG']->sL('LLL:EXT:scheduler/mod1/locallang.xml:msg.noEmail'), $flashMessageClass::ERROR);
         return false;
     }
     return true;
 }
コード例 #26
0
 /**
  * Get Axis
  *
  * @param	object 		Reference object
  * @param	array		Configuration of the data selector
  */
 function getAxis(&$objRef, $arrConf)
 {
     $intAxis = 1;
     foreach ($arrConf as $strKey => $strValue) {
         $strKey = rtrim($strKey, '.');
         eval("\$intAxis = IMAGE_GRAPH_AXIS_" . strtoupper($strKey) . ";");
         $objAxis =& $objRef->getAxis($intAxis);
         $this->setAxisProperties($objAxis, $strValue);
         $this->setElementProperties($objAxis, $strValue);
         if (is_array($strValue)) {
             $templateServiceClass = tx_rnbase_util_Typo3Classes::getTemplateServiceClass();
             $arrKeys = $templateServiceClass::sortedKeyList($strValue);
             foreach ($arrKeys as $strKey) {
                 $strCobjName = $strValue[$strKey];
                 if (intval($strKey) && !strstr($strKey, '.')) {
                     $arrConfAxis = $strValue[$strKey . '.'];
                     switch ($strCobjName) {
                         case 'marker':
                             $this->setAxisMarker($objRef, $intAxis, $arrConfAxis);
                             break;
                     }
                 }
             }
         }
     }
 }
コード例 #27
0
 /**
  * @see \TYPO3\CMS\Core\Utility\GeneralUtility::xml2array
  * @see t3lib_div::xml2array
  *
  * @param string $string XML content to convert into an array
  * @param string $NSprefix The tag-prefix resolve, eg. a namespace like "T3:"
  * @param boolean $reportDocTag If set, the document tag will be set in the key "_DOCUMENT_TAG" of the output array
  * @return mixed If the parsing had errors, a string with the error message is returned. Otherwise an array with the content.
  * @see array2xml(),xml2arrayProcess()
  */
 public static function xml2array($string, $NSprefix = '', $reportDocTag = FALSE)
 {
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     return $utility::xml2array($string, $NSprefix, $reportDocTag);
 }
コード例 #28
0
 /**
  *
  * @param Tx_Rnbase_Domain_Model_DataInterface $options
  * @param Tx_Rnbase_Domain_Model_Base $obj
  * @param tx_rnbase_util_FormTool $formTool
  * @return string
  */
 private static function addLinker($options, $obj, $formTool)
 {
     $out = '';
     $linkerArr = $options->getLinker();
     if ((is_array($linkerArr) || $linkerArr instanceof Traversable) && !empty($linkerArr)) {
         $linkerimplode = $options->getLinkerimplode() ? $options->getLinkerimplode() : '<br />';
         $currentPid = (int) $options->getPid();
         foreach ($linkerArr as $linker) {
             if (!$linker instanceof tx_rnbase_mod_LinkerInterface) {
                 // backward compatibility, the interface with the makeLink method is new!
                 if (!is_callable(array($linker, 'makeLink'))) {
                     throw new Exception('Linker "' . get_class($linker) . '" has to implement interface "tx_rnbase_mod_LinkerInterface".');
                 }
                 $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
                 $utility::deprecationLog('Linker "' . get_class($linker) . '" has to implement interface "tx_rnbase_mod_LinkerInterface".');
             }
             $out .= $linker->makeLink($obj, $formTool, $currentPid, $options);
             $out .= $linkerimplode;
         }
     }
     return $out;
 }
コード例 #29
0
 /**
  * constructor to log deprecation!
  *
  * @return void
  */
 function __construct()
 {
     $utility = tx_rnbase_util_Typo3Classes::getGeneralUtilityClass();
     $utility::deprecationLog('Usage of "Tx_Rnbase_Repository_AbstractRepository" is deprecated' . 'Please use "Tx_Rnbase_Domain_Repository_AbstractRepository" instead!');
 }
コード例 #30
0
 /**
  * Substitute subpart in input template stream.
  * This function substitutes a subpart in $content with the content of $subpartContent.
  * Wrapper for t3lib_parsehtml::substituteSubpart which behaves identical
  *
  * @param	string		The content stream, typically HTML template content.
  * @param	string		The marker string, typically on the form "###[the marker string]###"
  * @param	mixed		The content to insert instead of the subpart found. If a string, then just plain substitution happens (includes removing the
  * 								HTML comments of the subpart if found). If $subpartContent happens to be an array, it's [0] and [1] elements are wrapped around
  * 								the EXISTING content of the subpart (fetched by getSubpart()) thereby not removing the original content.
  * @param	boolean		If $recursive is set, the function calls itself with the content set to the remaining part of the content after the second
  * 								marker. This means that proceding subparts are ALSO substituted!
  * @return	string		The processed HTML content string.
  * @see getSubpart(), t3lib_parsehtml::substituteSubpart()
  */
 public static function substituteSubpart($content, $marker, $subpartContent, $recursive = 1)
 {
     $htmlParser = tx_rnbase_util_Typo3Classes::getHtmlParserClass();
     return $htmlParser::substituteSubpart($content, $marker, $subpartContent, $recursive);
 }