/** * * @param string $street * @param string $zip * @param string $city * @param string $country * @param string $state * @throws Exception */ public function lookupGeoCodeCached($street, $zip, $city, $country, $state = '') { if (!tx_rnbase_util_Extensions::isLoaded('wec_map')) { throw new Exception('wec_map not loaded'); } return tx_wecmap_cache::lookup($street, $city, $state, $zip, $country); }
function test_logger() { if (tx_rnbase_util_Extensions::isLoaded('devlog')) { $minLog = tx_rnbase_configurations::getExtensionCfgValue('devlog', 'minLogLevel'); if ($minLog === FALSE) { $ret = tx_rnbase_util_Logger::isNoticeEnabled(); $this->assertTrue($ret, 'Notice funktioniert nicht.'); } if ($minLog == 1) { $ret = tx_rnbase_util_Logger::isNoticeEnabled(); $this->assertTrue($ret, 'Notice funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isWarningEnabled(); $this->assertTrue($ret, 'Warning funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isFatalEnabled(); $this->assertTrue($ret, 'Fatal funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isInfoEnabled(); $this->assertFalse($ret, 'Info funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isDebugEnabled(); $this->assertFalse($ret, 'Debug funktioniert nicht.'); } if ($minLog == 3) { $ret = tx_rnbase_util_Logger::isNoticeEnabled(); $this->assertFalse($ret, 'Notice funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isWarningEnabled(); $this->assertFalse($ret, 'Warning funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isFatalEnabled(); $this->assertTrue($ret, 'Fatal funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isInfoEnabled(); $this->assertFalse($ret, 'Info funktioniert nicht.'); $ret = tx_rnbase_util_Logger::isDebugEnabled(); $this->assertFalse($ret, 'Debug funktioniert nicht.'); } } }
function getPlayer($media, $conf) { $mediaName = $media['file_name']; $mediaPath = $media['file_path']; // Die genaue Konfig holen wir für den Dateityp $fileType = $media['file_type']; $playerConf = $conf[$fileType . '.']['player.']; $color = $playerConf['backgroundColor']; $autoStart = $playerConf['autoStart']; $autoReplay = $playerConf['autoReplay']; tx_rnbase::load('tx_rnbase_util_Extensions'); $fePath = tx_rnbase_util_Extensions::siteRelPath('rn_base') . 'sv1/'; $out = '<object type="application/x-shockwave-flash" data="/' . $fePath . 'dewplayer.swf?son=' . $mediaPath . $mediaName . '&autostart=' . $autoStart . '&autoreplay=' . $autoReplay . '&bgcolor=' . $color . '" width="200" height="20"><param name="movie" value="/' . $fePath . 'dewplayer.swf?son=' . $mediaPath . $mediaName . '&autostart=' . $autoStart . '&autoreplay=' . $autoReplay . '&bgcolor=' . $color . '" />' . $media['title'] . '</object>'; return $out; }
* * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ tx_rnbase::load('tx_rnbase_util_SimpleMarker'); tx_rnbase::load('tx_rnbase_util_TYPO3'); if (!tx_rnbase_util_TYPO3::isTYPO60OrHigher()) { if (tx_rnbase_util_Extensions::isLoaded('dam')) { require_once tx_rnbase_util_Extensions::extPath('dam') . 'lib/class.tx_dam_db.php'; } } /** * Diese Klasse ist für das Rendern von DAM/FAL-Media Dateien verantwortlich */ class tx_rnbase_util_MediaMarker extends tx_rnbase_util_SimpleMarker { private static $damDb = NULL; /** * @param array $wrappedSubpartArray das HTML-Template * @param array $subpartArray das HTML-Template * @param string $template das HTML-Template * @param Tx_Rnbase_Domain_Model_RecordInterface $item * @param tx_rnbase_util_FormatUtil $formatter der zu verwendente Formatter * @param string $confId Pfad der TS-Config
/** * @param int $level * @return boolean */ private static function isLogLevel($level) { if (self::$minLog === FALSE) { if (tx_rnbase_util_Extensions::isLoaded('devlog')) { $minLog = tx_rnbase_configurations::getExtensionCfgValue('devlog', 'minLogLevel'); self::$minLog = $minLog !== FALSE ? $minLog : -1; } } $isEnabled = $level >= self::$minLog; return $isEnabled; }
/** * Wrapper function for tx_rnbase_util_Extensions::isLoaded() * @param string $_EXTKEY */ public static function isExtLoaded($_EXTKEY) { return tx_rnbase_util_Extensions::isLoaded($_EXTKEY); }
/** * Bereitet das Backend für die Indizierung einer Datei vor * * @param int $iBeUserId */ private static function initBE4DAM($beUserId) { global $PAGES_TYPES, $BE_USER, $TCA; if (!is_array($PAGES_TYPES) || !array_key_exists(254, $PAGES_TYPES)) { // SysFolder als definieren $PAGES_TYPES[254] = array('type' => 'sys', 'icon' => 'sysf.gif', 'allowedTables' => '*'); } // Check BE User if (!is_object($BE_USER) || !is_array($BE_USER->user)) { if (!$beUserId) { throw new Exception('NO BE User id given!'); } unset($BE_USER); $BE_USER = tx_rnbase::makeInstance('t3lib_tsfeBeUserAuth'); $BE_USER->OS = TYPO3_OS; $BE_USER->setBeUserByUid($beUserId); $BE_USER->fetchGroupData(); $BE_USER->backendSetUC(); // Ohne Admin-Rechte gibt es leider Probleme bei der Verarbeitung mit der TCE. $BE_USER->user['admin'] = 1; $GLOBALS['BE_USER'] = $BE_USER; } if (!$GLOBALS['LANG']) { // Bei Ajax-Calls fehlt das Objekt require_once tx_rnbase_util_Extensions::extPath('lang', 'lang.php'); $GLOBALS['LANG'] = tx_rnbase::makeInstance('language'); $GLOBALS['LANG']->init($BE_USER->uc['lang']); } }
* http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ tx_rnbase::load('tx_rnbase_maps_BaseMap'); tx_rnbase::load('tx_rnbase_util_Extensions'); tx_rnbase::load('tx_rnbase_util_Strings'); if (!tx_rnbase_util_Extensions::isLoaded('wec_map')) { throw new Exception('Extension wec_map must be installed to use GoogleMaps!'); } require_once tx_rnbase_util_Extensions::extPath('wec_map') . 'map_service/google/class.tx_wecmap_map_google.php'; /** * Implementation for GoogleMaps based on extension wec_map. */ class tx_rnbase_maps_google_Map extends tx_rnbase_maps_BaseMap { static $PROVID = 'GOOGLEMAPS'; static $mapTypes = array(); /* @var $map tx_wecmap_map_google */ private $map, $conf, $confId; public function init(tx_rnbase_configurations $conf, $confId) { $this->conf = $conf; $this->confId = $confId; $apiKey = $conf->get($confId . 'google.apikey'); $apiKey = $apiKey ? $apiKey : NULL;
<?php defined('TYPO3_MODE') || die('Access denied.'); if (TYPO3_MODE == 'BE') { // add be module ts tx_rnbase_util_Extensions::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:mklog/Configuration/TypoScript/Backend/pageTSconfig.txt">'); // register web_MklogBackend tx_rnbase::load('DMK\\Mklog\\Backend\\ModuleBackend'); \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule('mklog', 'web', 'backend', 'bottom', array(), array('access' => 'user,group', 'routeTarget' => 'DMK\\Mklog\\Backend\\ModuleBackend', 'icon' => 'EXT:mklog/ext_icon.gif', 'labels' => 'LLL:EXT:mklog/Resources/Private/Language/Backend.xlf')); // register devlog be module tx_rnbase::load('DMK\\Mklog\\Backend\\Module\\DevlogModule'); tx_rnbase_util_Extensions::insertModuleFunction('web_MklogBackend', 'DMK\\Mklog\\Backend\\Module\\DevlogModule', null, 'LLL:EXT:mklog/Resources/Private/Language/Backend.xlf:label_func_devlog'); }
* * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ if (!\class_exists('tx_rnbase')) { require_once \tx_rnbase_util_Extensions::extPath('rn_base', 'class.tx_rnbase.php'); } if (!\class_exists('DMK\\Mklog\\Tests\\BaseTestCase')) { require_once \tx_rnbase_util_Extensions::extPath('mklog', 'Tests/Classes/BaseTestCase.php'); } /** * Scheduler WatchDog test * * @package TYPO3 * @subpackage DMK\Mklog * @author Michael Wagner * @license http://www.gnu.org/licenses/lgpl.html * GNU Lesser General Public License, version 3 or later */ class SchedulerWatchDogTest extends \DMK\Mklog\Tests\BaseTestCase { /** * Test the execute method *
public function test_includeSubTemplates() { $fixture = tx_rnbase_util_Network::getURL(tx_rnbase_util_Extensions::extPath('rn_base', 'tests/fixtures/html/includeSubTemplates.html')); $raw = tx_rnbase_util_Templates::getSubpart($fixture, '###TEMPLATE###'); $expected = tx_rnbase_util_Templates::getSubpart($fixture, '###EXPECTED###'); $included = tx_rnbase_util_Templates::includeSubTemplates($raw); // remove empty lines $included = preg_replace("/(^[\r\n]*|[\r\n]+)[\\s\t]*[\r\n]+/", "\n", $included); $expected = preg_replace("/(^[\r\n]*|[\r\n]+)[\\s\t]*[\r\n]+/", "\n", $expected); $this->assertEquals($expected, $included); }
* lokale Config laden. * @package tx_mklog * @subpackage tx_mklog */ /** * alle benötigten Klassen einbinden etc. */ if (!defined('TYPO3_MODE')) { die('Access denied.'); } tx_rnbase::load('DMK\\Mklog\\Factory'); $_EXTKEY = isset($_EXTKEY) ? $_EXTKEY : 'mklog'; $_EXTCONF = isset($_EXTCONF) ? $_EXTCONF : $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]; // Konfiguration umwandeln $_EXTCONF = is_array($_EXTCONF) ? $_EXTCONF : unserialize($_EXTCONF); tx_rnbase_util_Extensions::addService($_EXTKEY, $_EXTKEY, 'tx_mklog_srv_WatchDog', array('title' => 'WatchDog services', 'description' => 'Service functions WatchDog', 'subtype' => 'WatchDog', 'available' => TRUE, 'priority' => 50, 'quality' => 50, 'os' => '', 'exec' => '', 'classFile' => tx_rnbase_util_Extensions::extPath($_EXTKEY) . 'srv/class.tx_mklog_srv_WatchDog.php', 'className' => 'tx_mklog_srv_WatchDog')); // Register information for the test and sleep tasks $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['tx_mklog_scheduler_WatchDog'] = array('extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang_db.xml:scheduler_watchdog_name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang_db.xml:scheduler_watchdog_description', 'additionalFields' => 'tx_mklog_scheduler_WatchDogAddFieldProvider'); tx_rnbase::load('DMK\\Mklog\\WatchDog\\SchedulerWatchDog'); tx_rnbase::load('DMK\\Mklog\\WatchDog\\SchedulerFieldProviderWatchDog'); $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['DMK\\Mklog\\WatchDog\\SchedulerWatchDog'] = array('extension' => $_EXTKEY, 'title' => 'DevLog WatchDog', 'description' => '', 'additionalFields' => 'DMK\\Mklog\\WatchDog\\SchedulerFieldProviderWatchDog'); $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['mklog'] = 'EXT:mklog/Classes/Hooks/DataHandler.php:Tx_Mklog_Hooks_DataHandler'; // is the devlog enabled? if (!empty($_EXTCONF['enable_devlog'])) { // the old devlog hook to log into tx_mklog_devlog_entry $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_div.php']['devLog']['mklog'] = 'EXT:mklog/Classes/Logger/DevlogLogger.php:&DMK\\Mklog\\Logger\\DevlogLogger->devLogHook'; // register logger writer $GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'][$_EXTCONF['min_log_level'] ?: \DMK\Mklog\Utility\SeverityUtility::DEBUG]['DMK\\Mklog\\Logger\\DevlogLogger'] = array(); } // is the gelf enabled? if (!empty($_EXTCONF['gelf_enable'])) {
/** * @param int $pageId * * @return void */ protected function deleteDevlogEntriesByPageId($pageId) { if (tx_rnbase_util_Extensions::isLoaded('devlog')) { $this->getDatabaseConnection()->doDelete($this->getDevlogTableName(), 'pid = ' . intval($pageId)); } }
/** * @group unit */ public function testDeleteDevlogEntriesByPageId() { if (!tx_rnbase_util_Extensions::isLoaded('devlog')) { self::markTestSkipped('devlog muss installiert sein'); } $dataHandler = $this->getMock('Tx_Mklog_Hooks_DataHandler', array('getDatabaseConnection', 'getDevLogTableName')); $databaseConnection = $this->getMock('Tx_Rnbase_Database_Connection', array('doDelete')); $databaseConnection->expects(self::once())->method('doDelete')->with('devlog_table', 'pid = 123'); $dataHandler->expects(self::once())->method('getDatabaseConnection')->will(self::returnValue($databaseConnection)); $dataHandler->expects(self::once())->method('getDevLogTableName')->will(self::returnValue('devlog_table')); $this->callInaccessibleMethod($dataHandler, 'deleteDevlogEntriesByPageId', 123); }
* * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ define('IMAGE_CANVAS_SYSTEM_FONT_PATH', PATH_site); tx_rnbase::load('tx_rnbase_util_Extensions'); tx_rnbase::load('tx_rnbase_util_Network'); require_once PATH_site . tx_rnbase_util_Extensions::siteRelPath("pbimagegraph") . 'Image/class.tx_pbimagegraph.php'; require_once PATH_site . tx_rnbase_util_Extensions::siteRelPath("pbimagegraph") . 'Image/class.tx_pbimagegraph_canvas.php'; /** * Builder class for the 'pbimagegraph' extension. The class is modifed version of * tx_pbimagegraph_ts. It can be used to build graphs from PHP. * * @author Rene Nitzsche <*****@*****.**> * @author Patrick Broens <*****@*****.**> * @package TYPO3 * @subpackage rn_base */ class tx_rnbase_plot_Builder { private $ctx; private static $arrPlotClassAlias = array('AREA' => 'tx_pbimagegraph_Plot_Area', 'BAND' => 'tx_pbimagegraph_Plot_Band', 'BAR' => 'tx_pbimagegraph_Plot_Bar', 'BOXWHISKER' => 'tx_pbimagegraph_Plot_BoxWhisker', 'CANDLESTICK' => 'tx_pbimagegraph_Plot_CandleStick', 'DOT' => 'tx_pbimagegraph_Plot_Dot', 'IMPULSE' => 'tx_pbimagegraph_Plot_Impulse', 'LINE' => 'tx_pbimagegraph_Plot_Line', 'ODO' => 'tx_pbimagegraph_Plot_Odo', 'PIE' => 'tx_pbimagegraph_Plot_Pie', 'RADAR' => 'tx_pbimagegraph_Plot_Radar', 'SCATTER' => 'tx_pbimagegraph_Plot_Dot', 'STEP' => 'tx_pbimagegraph_Plot_Step', 'SMOOTH_AREA' => 'tx_pbimagegraph_Plot_Smoothed_Area', 'SMOOTH_LINE' => 'tx_pbimagegraph_Plot_Smoothed_Line', 'SMOOTH_RADAR' => 'tx_pbimagegraph_Plot_Smoothed_Radar', 'FIT_LINE' => 'tx_pbimagegraph_Plot_Fit_Line'); private function __construct() {
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } tx_rnbase_util_Extensions::addService($_EXTKEY, 'mediaplayer', 'tx_rnbase_sv1_MediaPlayer', array('title' => 'Media Player', 'description' => 'Playing DAM mediafiles based on DEW Flash-Player', 'subtype' => '', 'available' => TRUE, 'priority' => 51, 'quality' => 50, 'os' => '', 'exec' => '', 'classFile' => tx_rnbase_util_Extensions::extPath($_EXTKEY) . 'sv1/class.tx_rnbase_sv1_MediaPlayer.php', 'className' => 'tx_rnbase_sv1_MediaPlayer'));
/** * Returns the flexform data of this plugin as array * * @return array by reference */ function &getFlexFormArray() { static $flex; if (!is_array($flex)) { $flex = tx_rnbase_util_Network::getURL(tx_rnbase_util_Extensions::extPath($this->getExtensionKey()) . $this->get('flexform')); $flex = tx_rnbase_util_Arrays::xml2array($flex); } return $flex; }
/** * Load the class file, return the classname or the ux_classname * * This is an extension to t3lib_div::makeInstanceClassName. The advantage * is that it tries to autoload the file. In combination with the shorter * notation it simplyfies the finding of the classname. * * @param string classname * @return string classname or ux_classsname (maybe service classname) * @see tx_div::makeInstance * @see tx_lib_t3Loader * @see tx_lib_pearLoader * @deprecated use makeInstance() with optional parameters for constructor */ public static function makeInstanceClassName($inputName) { $outputName = FALSE; if (!$outputName) { $outputName = self::makeInstanceClassNameT3($inputName); } if (!$outputName && tx_rnbase_util_Extensions::isLoaded('lib')) { require_once tx_rnbase_util_Extensions::extPath('lib') . 'class.tx_lib_pearLoader.php'; $outputName = tx_lib_pearLoader::makeInstanceClassName($inputName); } return $outputName; }