コード例 #1
0
 /**
  * Check if current TYPO3 version is suitable for the extension
  *
  * @param string $lowestVersion
  * @param string $highestVersion
  * @return bool
  */
 protected static function isVersionSuitable($lowestVersion, $highestVersion)
 {
     $numericTypo3Version = VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version());
     $numericLowestVersion = VersionNumberUtility::convertVersionNumberToInteger($lowestVersion);
     $numericHighestVersion = VersionNumberUtility::convertVersionNumberToInteger($highestVersion);
     return MathUtility::isIntegerInRange($numericTypo3Version, $numericLowestVersion, $numericHighestVersion);
 }
コード例 #2
0
 /**
  * Creates instance of an Update object
  *
  * @param string $className The class name
  * @param string $identifier The identifier of Update object - needed to fetch user input
  * @return AbstractUpdate Newly instantiated Update object
  */
 protected function getUpdateObjectInstance($className, $identifier)
 {
     //$userInput = $this->postValues['values'][$identifier];
     $userInput = NULL;
     $versionAsInt = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($className, $identifier, $versionAsInt, $userInput, $this);
 }
コード例 #3
0
    /**
     * Processes the actual transformation from CSV to sys_file_references
     *
     * @param array $record
     * @return void
     */
    protected function migrateRecord(array $record)
    {
        $collections = array();
        $files = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $record['image'], TRUE);
        $descriptions = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('
', $record['imagecaption']);
        $titleText = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('
', $record['imagetitletext']);
        $i = 0;
        foreach ($files as $file) {
            if (file_exists(PATH_site . 'uploads/tx_cal/pics/' . $file)) {
                \TYPO3\CMS\Core\Utility\GeneralUtility::upload_copy_move(PATH_site . 'uploads/tx_cal/pics/' . $file, $this->targetDirectory . $file);
                $fileObject = $this->storage->getFile(self::FOLDER_ContentUploads . '/' . $file);
                //TYPO3 >= 6.2.0
                if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 6002000) {
                    $this->fileIndexRepository->add($fileObject);
                } else {
                    //TYPO3 6.1.0
                    $this->fileRepository->addToIndex($fileObject);
                }
                $dataArray = array('uid_local' => $fileObject->getUid(), 'tablenames' => $this->getRecordTableName(), 'uid_foreign' => $record['uid'], 'pid' => $record['pid'], 'fieldname' => 'image', 'sorting_foreign' => $i);
                if (isset($descriptions[$i])) {
                    $dataArray['description'] = $descriptions[$i];
                }
                if (isset($titleText[$i])) {
                    $dataArray['alternative'] = $titleText[$i];
                }
                $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_file_reference', $dataArray);
                unlink(PATH_site . 'uploads/tx_cal/pics/' . $file);
            }
            $i++;
        }
        $this->cleanRecord($record, $i, $collections);
    }
コード例 #4
0
 /**
  * Initialize all required repository and factory objects.
  *
  * @throws \RuntimeException
  */
 protected function init()
 {
     $fileadminDirectory = rtrim($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '/') . '/';
     /** @var $storageRepository \TYPO3\CMS\Core\Resource\StorageRepository */
     $storageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\StorageRepository');
     $storages = $storageRepository->findAll();
     foreach ($storages as $storage) {
         $storageRecord = $storage->getStorageRecord();
         $configuration = $storage->getConfiguration();
         $isLocalDriver = $storageRecord['driver'] === 'Local';
         $isOnFileadmin = !empty($configuration['basePath']) && \TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($configuration['basePath'], $fileadminDirectory);
         if ($isLocalDriver && $isOnFileadmin) {
             $this->storage = $storage;
             break;
         }
     }
     if (!isset($this->storage)) {
         throw new \RuntimeException('Local default storage could not be initialized - might be due to missing sys_file* tables.');
     }
     $this->fileFactory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
     //TYPO3 >= 6.2.0
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 6002000) {
         $this->fileIndexRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Index\\FileIndexRepository');
     } else {
         //TYPO3 = 6.1
         $this->fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
     }
     $this->targetDirectory = PATH_site . $fileadminDirectory . self::FOLDER_ContentUploads . '/';
 }
コード例 #5
0
 /**
  * constructPostProcess
  *
  * @param array $config
  * @param \TYPO3\CMS\Backend\Controller\BackendController $backendReference
  */
 public function constructPostProcess($config, &$backendReference)
 {
     $lastPwChange = $GLOBALS['BE_USER']->user['tx_besecurepw_lastpwchange'];
     $lastLogin = $GLOBALS['BE_USER']->user['lastlogin'];
     // get configuration of a secure password
     $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_secure_pw']);
     $validUntilConfiguration = trim($extConf['validUntil']);
     $validUntil = 0;
     if ($validUntilConfiguration != '') {
         $validUntil = strtotime('- ' . $validUntilConfiguration);
     }
     if ($validUntilConfiguration != '' && ($lastPwChange == 0 || $lastPwChange < $validUntil) || $lastLogin == 0) {
         // let the popup pop up :)
         $generatedLabels = array('passwordReminderWindow_title' => $GLOBALS['LANG']->sL('LLL:EXT:be_secure_pw/Resources/Private/Language/locallang_reminder.xml:passwordReminderWindow_title'), 'passwordReminderWindow_message' => $GLOBALS['LANG']->sL('LLL:EXT:be_secure_pw/Resources/Private/Language/locallang_reminder.xml:passwordReminderWindow_message'), 'passwordReminderWindow_button_changePassword' => $GLOBALS['LANG']->sL('LLL:EXT:be_secure_pw/Resources/Private/Language/locallang_reminder.xml:passwordReminderWindow_button_changePassword'), 'passwordReminderWindow_button_postpone' => $GLOBALS['LANG']->sL('LLL:EXT:be_secure_pw/Resources/Private/Language/locallang_reminder.xml:passwordReminderWindow_button_postpone'));
         // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8:
         if ($GLOBALS['LANG']->charSet !== 'utf-8') {
             $GLOBALS['LANG']->csConvObj->convArray($generatedLabels, $GLOBALS['LANG']->charSet, 'utf-8');
         }
         $labelsForJS = 'TYPO3.LLL.beSecurePw = ' . json_encode($generatedLabels) . ';';
         $backendReference->addJavascript($labelsForJS);
         $version7 = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger('7.0.0');
         $currentVersion = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
         if ($currentVersion < $version7) {
             $javaScriptFile = 'passwordreminder.js';
         } else {
             $javaScriptFile = 'passwordreminder7.js';
         }
         $backendReference->addJavascriptFile($GLOBALS['BACK_PATH'] . '../' . ExtensionManagementUtility::siteRelPath('be_secure_pw') . 'Resources/Public/JavaScript/' . $javaScriptFile);
     }
 }
コード例 #6
0
ファイル: InstallService.php プロジェクト: dcngmbh/moox_core
 /**
  * Initializes the install service
  */
 public function __construct()
 {
     if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7000000) {
         $this->messageQueueByIdentifier = 'extbase.flashmessages.tx_extensionmanager_tools_extensionmanagerextensionmanager';
     } else {
         $this->messageQueueByIdentifier = 'core.template.flashMessages';
     }
 }
コード例 #7
0
 /**
  * @param array $params
  * @return array
  */
 protected function addConfigToParams(array $params)
 {
     if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 7000000) {
         $params['config']['init']['emptyUrlReturnValue'] = GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
     }
     $params['config']['preVars'] = array('0' => array('GETvar' => 'no_cache', 'valueMap' => array('nc' => '1'), 'noMatch' => 'bypass'), '1' => array('GETvar' => 'L', 'valueMap' => array('de' => '1', 'da' => '2'), 'noMatch' => 'bypass'));
     $params['config']['postVarSets']['_DEFAULT']['page'] = array(0 => array('GETvar' => 'page'));
     return $params;
 }
コード例 #8
0
ファイル: CalWizIcon.php プロジェクト: ulrikkold/cal
 public function includeLocalLang()
 {
     $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('cal') . 'Resources/Private/Language/locallang_plugin.xml';
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 4006000) {
         $localizationParser = new \TYPO3\CMS\Core\Localization\Parser\LocallangXmlParser();
         $LOCAL_LANG = $localizationParser->getParsedData($llFile, $GLOBALS['LANG']->lang);
     } else {
         $LOCAL_LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::readLLfile($llFile, $GLOBALS['LANG']->lang);
     }
     return $LOCAL_LANG;
 }
コード例 #9
0
 /**
  * Returns TRUE if the current TYPO3 version is compatible to the input version
  * Notice that this function compares branches, not versions
  * (4.0.1 would be > 4.0.0 although they use the same compat_version)
  *
  * @param string $verNumberStr Minimum branch number: format "4.0" NOT "4.0.0"
  * @return boolean Returns TRUE if compatible with the provided version number
  */
 public static function convertVersionNumberToInteger($verNumberStr)
 {
     $result = '';
     if (self::isEqualOrHigherSixZero()) {
         $result = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($verNumberStr);
     } elseif (class_exists('t3lib_utility_VersionNumber')) {
         $result = t3lib_utility_VersionNumber::convertVersionNumberToInteger($verNumberStr);
     } else {
         $result = t3lib_div::int_from_ver($verNumberStr);
     }
     return $result;
 }
コード例 #10
0
ファイル: Functions.php プロジェクト: ulrikkold/cal
 public static function clearCache()
 {
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7005000) {
         $pageCache = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('cache_pages');
         $pageCache->flushByTag('cal');
     } else {
         // only use cachingFramework if initialized and configured in TYPO3
         if (\TYPO3\CMS\Core\Cache\Cache::isCachingFrameworkInitialized() && TYPO3_UseCachingFramework && is_object($GLOBALS['typo3CacheManager'])) {
             $pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
             $pageCache->flushByTag('cal');
         }
     }
 }
コード例 #11
0
 /**
  * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file.
  *
  * @return	The array with language labels
  */
 public function includeLocalLang()
 {
     $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('jfmulticontent') . 'locallang.xml';
     $version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     if ($version < 4006000) {
         $LOCAL_LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::readLLXMLfile($llFile, $GLOBALS['LANG']->lang);
     } else {
         /** @var $llxmlParser t3lib_l10n_parser_Llxml */
         $llxmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser');
         $LOCAL_LANG = $llxmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang);
     }
     return $LOCAL_LANG;
 }
コード例 #12
0
 /**
  * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file.
  *
  * @return array The array with language labels
  */
 protected function includeLocalLang()
 {
     $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('listfeusers') . 'locallang.xml';
     $version = class_exists('\\TYPO3\\CMS\\Core\\Utility\\VersionNumberUtility') ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version);
     if ($version < 4006000) {
         $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang);
     } else {
         /** @var $llxmlParser t3lib_l10n_parser_Llxml */
         $llxmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser');
         $LOCAL_LANG = $llxmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang);
     }
     return $LOCAL_LANG;
 }
コード例 #13
0
 /**
  * Returns the current TYPO3 version number as an integer, eg. 4005000 for version 4.5
  *
  * @return int
  */
 public function getNumericTYPO3versionNumber()
 {
     if (class_exists(VersionNumberUtility)) {
         $numeric_typo3_version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     } else {
         if (class_exists('t3lib_utility_VersionNumber')) {
             $numeric_typo3_version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
         } else {
             $numeric_typo3_version = t3lib_div::int_from_ver(TYPO3_version);
         }
     }
     return $numeric_typo3_version;
 }
コード例 #14
0
 /**
  * @param string $identifier
  * @param string $size
  * @param null $overlay
  * @param string $state
  * @param string $alternativeMarkupIdentifier
  * @return string
  */
 public function render($identifier, $size = 'small', $overlay = null, $state = 'default', $alternativeMarkupIdentifier = null)
 {
     if (VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version()) < 7000000) {
         /** @var \TYPO3\CMS\Fluid\ViewHelpers\Be\Buttons\IconViewHelper $iconViewHelper */
         $iconViewHelper = $this->objectManager->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\Buttons\\IconViewHelper');
         $iconViewHelper->setRenderingContext($this->renderingContext);
         return $iconViewHelper->render('', $identifier);
     } else {
         /** @var \TYPO3\CMS\Core\ViewHelpers\IconViewHelper $iconViewHelper */
         $iconViewHelper = $this->objectManager->get('TYPO3\\CMS\\Core\\ViewHelpers\\IconViewHelper');
         $iconViewHelper->setRenderingContext($this->renderingContext);
         return $iconViewHelper->render($identifier, $size, $overlay, $state, $alternativeMarkupIdentifier);
     }
 }
コード例 #15
0
ファイル: T3VersionViewHelper.php プロジェクト: advOpk/pwm
 /**
  * Check if TYPO3 Version is correct
  *
  * @return bool
  */
 public function render()
 {
     // settings
     $_EXTKEY = 'powermail';
     require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('powermail') . 'ext_emconf.php';
     $versionString = $EM_CONF['powermail']['constraints']['depends']['typo3'];
     $versions = explode('-', $versionString);
     $powermailVersion = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     $isAboveMinVersion = $powermailVersion > VersionNumberUtility::convertVersionNumberToInteger($versions[0]);
     $isBelowMaxVersion = $powermailVersion < VersionNumberUtility::convertVersionNumberToInteger($versions[1]);
     if ($isAboveMinVersion && $isBelowMaxVersion) {
         return TRUE;
     }
     return FALSE;
 }
コード例 #16
0
 /**
  * Migrate date and datetime db field values to timestamp
  *
  * @param array $result
  * @return array
  */
 public function addData(array $result)
 {
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7006000) {
         $processedTcaColumns = $result['processedTca']['columns'];
     } else {
         $processedTcaColumns = $result['vanillaTableTca']['columns'];
     }
     foreach ($processedTcaColumns as $column => $columnConfig) {
         if (isset($columnConfig['config']['tx_cal_event'])) {
             $mainFields = new \TYPO3\CMS\Cal\Hooks\TceFormsGetmainfields();
             $mainFields->getMainFields_preProcess($result['tableName'], $result['databaseRow'], NULL);
             return $result;
         }
     }
     return $result;
 }
コード例 #17
0
 /**
  * @param string $operator
  * @param integer $value
  * @return bool
  */
 public function match($operator = null, $value = null)
 {
     $result = false;
     $value = intval($value);
     $version = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     if ($value) {
         if ($operator === "equals" && $version === $value) {
             $result = true;
         } elseif ($operator === "lessThan" && $version < $value) {
             $result = true;
         } elseif ($operator === "greaterThan" && $version > $value) {
             $result = true;
         }
     }
     return $result;
 }
コード例 #18
0
ファイル: InstallService.php プロジェクト: mrmoree/vkmh_typo3
 /**
  * @param string $extension
  */
 public function generateConfigFiles($extension = NULL)
 {
     if ($extension == $this->extKey) {
         // create object manager and msg queue
         $this->objManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
         /** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMsgService  */
         $flashMsgService = $this->objManager->get('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
         if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7000000) {
             $this->flashMsgQueue = $flashMsgService->getMessageQueueByIdentifier('extbase.flashmessages.tx_extensionmanager_tools_extensionmanagerextensionmanager');
         } else {
             $this->flashMsgQueue = $flashMsgService->getMessageQueueByIdentifier('core.template.flashMessages');
         }
         // create file(s)
         $this->createHtaccessFile();
     }
 }
コード例 #19
0
ファイル: PageRenderer.php プロジェクト: sonority/lib_jquery
 /**
  * Insert javascript-tags for jQuery
  *
  * @param array $params
  * @param \TYPO3\CMS\Core\Page\PageRenderer $pObj
  * @return void
  */
 public function renderPreProcess($params, $pObj)
 {
     // Get plugin-configuration
     $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_libjquery.']['settings.'];
     // Generate script-tag for jquery if CDN is set
     if (!empty($conf['cdn']) && array_key_exists($conf['cdn'], $this->jQueryCdnUrls)) {
         // Set version-number for CDN
         if (!(int) $conf['version'] || $conf['version'] === 'latest') {
             $versionCdn = end($this->availableLocalJqueryVersions);
         } else {
             $versionCdn = VersionNumberUtility::convertVersionNumberToInteger($conf['version']);
         }
         // Set correct version-number for local version
         if (!in_array($versionCdn, $this->availableLocalJqueryVersions)) {
             $versionLocal = $this->getNearestVersion($versionCdn);
         } else {
             $versionLocal = $versionCdn;
         }
         $fallbackTag = '';
         // Choose minified version if debug is disabled
         $minPart = (int) $conf['debug'] ? '' : '.min';
         // Deliver gzipped-version if compression is activated and client supports gzip (compression done with "gzip --best -k -S .gzip")
         $gzipPart = (int) $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['compressionLevel'] ? '.gzip' : '';
         // Set path and placeholders for local file
         $this->jQueryCdnUrls['local'] = $conf['localPath'] . 'jquery-%1$s%2$s.js';
         // Generate tags for local or CDN (and fallback)
         if ($conf['cdn'] === 'local') {
             // Get local version and replace placeholders
             $file = sprintf($this->jQueryCdnUrls['local'], VersionNumberUtility::convertIntegerToVersionNumber($versionLocal), $minPart) . $gzipPart;
             $file = str_replace(PATH_site, '', GeneralUtility::getFileAbsFileName($file));
         } else {
             // Get CDN and replace placeholders
             $file = sprintf($this->jQueryCdnUrls[$conf['cdn']], VersionNumberUtility::convertIntegerToVersionNumber($versionCdn), $minPart);
             // Generate fallback if required
             if ((int) $conf['localFallback']) {
                 // Get local fallback version and replace placeholders
                 $fileFallback = sprintf($this->jQueryCdnUrls['local'], VersionNumberUtility::convertIntegerToVersionNumber($versionLocal), $minPart) . $gzipPart;
                 // Get absolute path to the fallback-file
                 $fileFallback = str_replace(PATH_site, '', GeneralUtility::getFileAbsFileName($fileFallback));
                 // Wrap it in some javascript code which will enable the fallback
                 $fallbackTag = '<script>window.jQuery || document.write(\'<script src="' . htmlspecialchars($fileFallback) . '" type="text/javascript"><\\/script>\')</script>' . LF;
             }
         }
         $pObj->addJsLibrary('lib_jquery', $file, 'text/javascript', FALSE, TRUE, '|' . LF . $fallbackTag . '', TRUE);
     }
 }
コード例 #20
0
 /**
  * @param string $operator
  * @param integer $value
  * @return bool
  */
 public function match($operator = NULL, $value = NULL)
 {
     $result = FALSE;
     $value = intval($value);
     $version = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     if ($value) {
         if ($operator === "equals" && $version === $value) {
             $result = TRUE;
         } else {
             if ($operator === "lessThan" && $version < $value) {
                 $result = TRUE;
             } else {
                 if ($operator === "greaterThan" && $version > $value) {
                     $result = TRUE;
                 }
             }
         }
     }
     return $result;
 }
コード例 #21
0
    /**
     * Shows the update Message
     *
     * @return string
     */
    public function displayMessage(&$params, &$tsObj)
    {
        $out = '';
        if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 4003000) {
            // 4.3.0 comes with flashmessages styles. For older versions we include the needed styles here
            $cssPath = $GLOBALS['BACK_PATH'] . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('jfmulticontent');
            $out .= '<link rel="stylesheet" type="text/css" href="' . $cssPath . 'compat/flashmessages.css" media="screen" />';
        }
        $checkConfig = null;
        if ($this->checkConfig() === false) {
            $checkConfig = '
	<div class="typo3-message message-warning">
		<div class="message-header">' . $GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:extmng.classInnerHeader') . '</div>
		<div class="message-body">
			' . $GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:extmng.classInner') . '
		</div>
	</div>';
        }
        if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 4005000) {
            $url = 'index.php?&amp;id=0&amp;CMD[showExt]=jfmulticontent&amp;SET[singleDetails]=updateModule';
        } else {
            $url = 'mod.php?&id=0&M=tools_em&CMD[showExt]=jfmulticontent&SET[singleDetails]=updateModule';
        }
        $out .= '
<div style="position:absolute;top:10px;right:10px; width:300px;">
	<div class="typo3-message message-information">
		<div class="message-header">' . $GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:extmng.updatermsgHeader') . '</div>
		<div class="message-body">
			' . $GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:extmng.updatermsg') . '<br />
			<a style="text-decoration:underline;" href="' . $url . '">
			' . $GLOBALS['LANG']->sL('LLL:EXT:jfmulticontent/locallang.xml:extmng.updatermsgLink') . '</a>
		</div>
	</div>
	' . $checkConfig . '
</div>';
        return $out;
    }
コード例 #22
0
ファイル: IconViewHelper.php プロジェクト: jmverges/mask
 /**
  * Prints icon html for $identifier key
  *
  * @param string $identifier
  * @param string $size
  * @param string $overlay
  * @param string $altSrc
  * @param string $altText
  * @author Benjamin Butschell <*****@*****.**>
  * @return string
  */
 public function render($identifier, $size = NULL, $overlay = NULL, $altSrc = "", $altText = "")
 {
     // backwards compatibility for typo3 6.2
     $version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version();
     $versionNumber = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version);
     // Since TYPO3 7.5 use IconViewHelper from core
     if ($versionNumber >= 7005000) {
         $iconViewHelper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("TYPO3\\CMS\\Core\\ViewHelpers\\IconViewHelper");
         if ($size == NULL) {
             $size = \TYPO3\CMS\Core\Imaging\Icon::SIZE_SMALL;
         }
         $iconViewHelper->setRenderingContext($this->renderingContext);
         return $iconViewHelper->render($identifier, $size, $overlay);
     } else {
         // For everything else use altSrc and altText attributes
         if ($altSrc) {
             return '<img src="' . $altSrc . '" alt="' . $altText . '" />';
         } else {
             if ($altText) {
                 return '$altText';
             }
         }
     }
 }
コード例 #23
0
ファイル: ImportExport.php プロジェクト: franzholz/TYPO3.CMS
 /**
  * Setting up the object based on the recently loaded ->dat array
  *
  * @return void
  */
 public function loadInit()
 {
     $this->relStaticTables = (array) $this->dat['header']['relStaticTables'];
     $this->excludeMap = (array) $this->dat['header']['excludeMap'];
     $this->softrefCfg = (array) $this->dat['header']['softrefCfg'];
     $this->extensionDependencies = (array) $this->dat['header']['extensionDependencies'];
     $this->fixCharsets();
     if (isset($this->dat['header']['meta']['TYPO3_version']) && VersionNumberUtility::convertVersionNumberToInteger($this->dat['header']['meta']['TYPO3_version']) < 6000000) {
         $this->legacyImport = true;
         $this->initializeLegacyImportFolder();
     }
 }
コード例 #24
0
ファイル: MaskUtility.php プロジェクト: jmverges/mask
 /**
  * Generates and sets the tca for all the extended pages
  *
  * @param array $tca
  * @author Benjamin Butschell <*****@*****.**>
  */
 public function setPageTca($tca, &$confVarsFe)
 {
     // backwards compatibility for typo3 6.2
     $version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version();
     $versionNumber = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version);
     // Load all Page-Fields for new Tab in Backend
     $pageFields = array();
     if ($tca) {
         foreach ($tca as $fieldKey => $value) {
             if ($versionNumber >= 7000000) {
                 $fieldKeyTca = $fieldKey;
             } else {
                 $element = array_pop($this->getElementsWhichUseField($fieldKey, "pages"));
                 $type = $this->getFormType($fieldKey, $element["key"], "pages");
                 $fieldKeyTca = $fieldKey;
                 if ($type == "Richtext") {
                     $fieldKeyTca .= ";;;richtext[]:rte_transform[mode=ts]";
                 }
             }
             $pageFields[] = $fieldKeyTca;
             // Add addRootLineFields and pageOverlayFields for all pagefields
             $confVarsFe["addRootLineFields"] .= "," . $fieldKey;
             $confVarsFe["pageOverlayFields"] .= "," . $fieldKey;
         }
     }
     $pageFieldString = "--div--;Content-Fields," . implode(",", $pageFields);
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', $pageFieldString);
     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages_language_overlay', $pageFieldString);
 }
コード例 #25
0
 /**
  * Returns TRUE if the current TYPO3 version (or compatibility version) is compatible to the input version
  * Notice that this function compares branches, not versions (4.0.1 would be > 4.0.0 although they use the same compat_version)
  *
  * @param string $verNumberStr Minimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!)
  * @return boolean Returns TRUE if this setup is compatible with the provided version number
  * @todo Still needs a function to convert versions to branches
  */
 public static function compat_version($verNumberStr)
 {
     $currVersionStr = $GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'] ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'] : TYPO3_branch;
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($currVersionStr) < \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($verNumberStr)) {
         return FALSE;
     } else {
         return TRUE;
     }
 }
コード例 #26
0
ファイル: Extension.php プロジェクト: noxludo/TYPO3v4-Core
 /**
  * Setter for the version from string
  *
  * @param string $version Needs to have a format like '1.3.7' and converts it into an integer like 1003007 before setting the version
  * @see \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger
  * @return void
  */
 public function setVersionFromString($version)
 {
     $this->version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version);
 }
コード例 #27
0
 /**
  * Returns TRUE if the current TYPO3 version (or compatibility version) is compatible to the input version
  * Notice that this function compares branches, not versions (4.0.1 would be > 4.0.0 although they use the same compat_version)
  *
  * @param string $verNumberStr Minimum branch number required (format x.y / e.g. "4.0" NOT "4.0.0"!)
  * @return bool Returns TRUE if this setup is compatible with the provided version number
  * @todo Still needs a function to convert versions to branches
  * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
  */
 public static function compat_version($verNumberStr)
 {
     static::logDeprecatedFunction();
     return VersionNumberUtility::convertVersionNumberToInteger(TYPO3_branch) >= VersionNumberUtility::convertVersionNumberToInteger($verNumberStr);
 }
コード例 #28
0
 /**
  * Checks if there are still updates to perform
  *
  * @return Status Represents whether the installation is completely updated yet
  */
 protected function getRemainingUpdatesStatus()
 {
     $languageService = $this->getLanguageService();
     $value = $languageService->getLL('status_updateComplete');
     $message = '';
     $severity = Status::OK;
     // check if there are update wizards left to perform
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'])) {
         $versionAsInt = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update'] as $identifier => $className) {
             $updateObject = GeneralUtility::makeInstance($className, $identifier, $versionAsInt, null, $this);
             if ($updateObject->shouldRenderWizard()) {
                 // at least one wizard was found
                 $value = $languageService->getLL('status_updateIncomplete');
                 $severity = Status::WARNING;
                 $url = BackendUtility::getModuleUrl('system_InstallInstall');
                 $message = sprintf($languageService->sL('LLL:EXT:lang/locallang_core.xlf:warning.install_update'), '<a href="' . htmlspecialchars($url) . '">', '</a>');
                 break;
             }
         }
     }
     return GeneralUtility::makeInstance(Status::class, $languageService->sL('LLL:EXT:install/Resources/Private/Language/Report/locallang.xlf:status_remainingUpdates'), $value, $message, $severity);
 }
コード例 #29
0
<?php

defined('TYPO3_MODE') or die;
// Compatibility with 6.2
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version()) < 7000000) {
    $GLOBALS['TCA']['static_countries']['ctrl']['label_userFunc'] = 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\ElementRenderingHelper->addIsoCodeToLabel';
    $GLOBALS['TCA']['static_countries']['ctrl']['iconfile'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('static_info_tables') . 'Resources/Public/Images/Icons/static_countries.svg';
    $GLOBALS['TCA']['static_countries']['columns']['cn_parent_territory_uid']['config']['itemsProcFunc'] = 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\ElementRenderingHelper->translateTerritoriesSelector';
    $GLOBALS['TCA']['static_countries']['columns']['cn_parent_territory_uid']['config']['noIconsBelowSelect'] = 1;
    $GLOBALS['TCA']['static_countries']['columns']['cn_currency_uid']['config']['itemsProcFunc'] = 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\ElementRenderingHelper->translateCurrenciesSelector';
    $GLOBALS['TCA']['static_countries']['columns']['cn_currency_uid']['config']['wizards']['suggest']['default'] = array('receiverClass' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\SuggestReceiver');
    $GLOBALS['TCA']['static_countries']['columns']['cn_currency_uid']['config']['noIconsBelowSelect'] = 1;
}
コード例 #30
0
    /**
     * Draws the RTE as an iframe
     *
     * @param 	object		Reference to parent object, which is an instance of the TCEforms.
     * @param 	string		The table name
     * @param 	string		The field name
     * @param 	array		The current row from which field is being rendered
     * @param 	array		Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
     * @param 	array		"special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
     * @param 	array		Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
     * @param 	string		Record "type" field value.
     * @param 	string		Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
     * @param 	integer		PID value of record (true parent page id)
     * @return 	string		HTML code for RTE!
     * @todo Define visibility
     */
    public function drawRTE(&$parentObject, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue)
    {
        global $TSFE, $TYPO3_CONF_VARS, $TYPO3_DB;
        $this->TCEform = $parentObject;
        $this->client = $this->clientInfo();
        $this->typoVersion = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
        /* =======================================
         * INIT THE EDITOR-SETTINGS
         * =======================================
         */
        // Get the path to this extension:
        $this->extHttpPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->ID);
        // Get the site URL
        $this->siteURL = $GLOBALS['TSFE']->absRefPrefix ?: '';
        // Get the host URL
        $this->hostURL = '';
        // Element ID + pid
        $this->elementId = $PA['itemFormElName'];
        $this->elementParts[0] = $table;
        $this->elementParts[1] = $row['uid'];
        $this->tscPID = $thePidValue;
        $this->thePid = $thePidValue;
        // Record "type" field value:
        $this->typeVal = $RTEtypeVal;
        // TCA "type" value for record
        // RTE configuration
        $pageTSConfig = $TSFE->getPagesTSconfig();
        if (is_array($pageTSConfig) && is_array($pageTSConfig['RTE.'])) {
            $this->RTEsetup = $pageTSConfig['RTE.'];
        }
        if (is_array($thisConfig) && !empty($thisConfig)) {
            $this->thisConfig = $thisConfig;
        } elseif (is_array($this->RTEsetup['default.']) && is_array($this->RTEsetup['default.']['FE.'])) {
            $this->thisConfig = $this->RTEsetup['default.']['FE.'];
        }
        // Special configuration (line) and default extras:
        $this->specConf = $specConf;
        if ($this->thisConfig['forceHTTPS']) {
            $this->extHttpPath = preg_replace('/^(http|https)/', 'https', $this->extHttpPath);
            $this->siteURL = preg_replace('/^(http|https)/', 'https', $this->siteURL);
            $this->hostURL = preg_replace('/^(http|https)/', 'https', $this->hostURL);
        }
        // Register RTE windows:
        $this->TCEform->RTEwindows[] = $PA['itemFormElName'];
        $textAreaId = preg_replace('/[^a-zA-Z0-9_:.-]/', '_', $PA['itemFormElName']);
        $textAreaId = htmlspecialchars(preg_replace('/^[^a-zA-Z]/', 'x', $textAreaId)) . '_' . strval($this->TCEform->RTEcounter);
        /* =======================================
         * LANGUAGES & CHARACTER SETS
         * =======================================
         */
        // Language
        $TSFE->initLLvars();
        $this->language = $TSFE->lang;
        $this->LOCAL_LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::readLLfile('EXT:' . $this->ID . '/locallang.xml', $this->language);
        if ($this->language == 'default' || !$this->language) {
            $this->language = 'en';
        }
        $this->contentLanguageUid = max($row['sys_language_uid'], 0);
        if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) {
            if ($this->contentLanguageUid) {
                $tableA = 'sys_language';
                $tableB = 'static_languages';
                $languagesUidsList = $this->contentLanguageUid;
                $selectFields = $tableA . '.uid,' . $tableB . '.lg_iso_2,' . $tableB . '.lg_country_iso_2,' . $tableB . '.lg_typo3';
                $tableAB = $tableA . ' LEFT JOIN ' . $tableB . ' ON ' . $tableA . '.static_lang_isocode=' . $tableB . '.uid';
                $whereClause = $tableA . '.uid IN (' . $languagesUidsList . ') ';
                $whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($tableA);
                $whereClause .= \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($tableA);
                $res = $TYPO3_DB->exec_SELECTquery($selectFields, $tableAB, $whereClause);
                while ($languageRow = $TYPO3_DB->sql_fetch_assoc($res)) {
                    $this->contentISOLanguage = strtolower(trim($languageRow['lg_iso_2']) . (trim($languageRow['lg_country_iso_2']) ? '_' . trim($languageRow['lg_country_iso_2']) : ''));
                    $this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
                }
            } else {
                $this->contentISOLanguage = $GLOBALS['TSFE']->sys_language_isocode ?: 'en';
                $selectFields = 'lg_iso_2, lg_typo3';
                $tableAB = 'static_languages';
                $whereClause = 'lg_iso_2 = ' . $TYPO3_DB->fullQuoteStr(strtoupper($this->contentISOLanguage), $tableAB);
                $res = $TYPO3_DB->exec_SELECTquery($selectFields, $tableAB, $whereClause);
                while ($languageRow = $TYPO3_DB->sql_fetch_assoc($res)) {
                    $this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
                }
            }
        }
        $this->contentISOLanguage = $this->contentISOLanguage ?: ($GLOBALS['TSFE']->sys_language_isocode ?: 'en');
        $this->contentTypo3Language = $this->contentTypo3Language ?: $GLOBALS['TSFE']->lang;
        if ($this->contentTypo3Language == 'default') {
            $this->contentTypo3Language = 'en';
        }
        // Character set
        $this->charset = $TSFE->renderCharset;
        $this->OutputCharset = $TSFE->metaCharset ?: $TSFE->renderCharset;
        // Set the charset of the content
        $this->contentCharset = $TSFE->csConvObj->charSetArray[$this->contentTypo3Language];
        $this->contentCharset = $this->contentCharset ?: 'utf-8';
        $this->contentCharset = trim($TSFE->config['config']['metaCharset']) ?: $this->contentCharset;
        /* =======================================
         * TOOLBAR CONFIGURATION
         * =======================================
         */
        $this->initializeToolbarConfiguration();
        /* =======================================
         * SET STYLES
         * =======================================
         */
        $width = 610;
        if (isset($this->thisConfig['RTEWidthOverride'])) {
            if (strstr($this->thisConfig['RTEWidthOverride'], '%')) {
                if ($this->client['browser'] != 'msie') {
                    $width = (int) $this->thisConfig['RTEWidthOverride'] > 0 ? $this->thisConfig['RTEWidthOverride'] : '100%';
                }
            } else {
                $width = (int) $this->thisConfig['RTEWidthOverride'] > 0 ? (int) $this->thisConfig['RTEWidthOverride'] : $width;
            }
        }
        $RTEWidth = strstr($width, '%') ? $width : $width . 'px';
        $editorWrapWidth = strstr($width, '%') ? $width : $width + 2 . 'px';
        $height = 380;
        $RTEHeightOverride = (int) $this->thisConfig['RTEHeightOverride'];
        $height = $RTEHeightOverride > 0 ? $RTEHeightOverride : $height;
        $RTEHeight = $height . 'px';
        $editorWrapHeight = $height + 2 . 'px';
        $this->RTEWrapStyle = $this->RTEWrapStyle ?: ($this->RTEdivStyle ?: 'height:' . $editorWrapHeight . '; width:' . $editorWrapWidth . ';');
        $this->RTEdivStyle = $this->RTEdivStyle ?: 'position:relative; left:0px; top:0px; height:' . $RTEHeight . '; width:' . $RTEWidth . '; border: 1px solid black;';
        /* =======================================
         * LOAD JS, CSS and more
         * =======================================
         */
        $this->getPageRenderer();
        // Register RTE in JS
        $this->TCEform->additionalJS_post[] = $this->wrapCDATA($this->registerRTEinJS($this->TCEform->RTEcounter, '', '', '', $textAreaId));
        // Set the save option for the RTE:
        $this->TCEform->additionalJS_submit[] = $this->setSaveRTE($this->TCEform->RTEcounter, $this->TCEform->formName, $textAreaId);
        // Loading ExtJs JavaScript files and inline code, if not configured in TS setup
        if (!is_array($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.'])) {
            $this->pageRenderer->loadExtJs();
            $this->pageRenderer->enableExtJSQuickTips();
        }
        $this->pageRenderer->addJsFile($this->getFullFileName('typo3/js/extjs/ux/ext.resizable.js'));
        $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/notifications.js');
        // Preloading the pageStyle and including RTE skin stylesheets
        $this->addPageStyle();
        $this->pageRenderer->addCssFile($this->siteURL . 'typo3/contrib/extjs/resources/css/ext-all-notheme.css');
        $this->pageRenderer->addCssFile($this->siteURL . 'typo3/sysext/t3skin/extjs/xtheme-t3skin.css');
        $this->addSkin();
        $this->pageRenderer->addCssFile($this->siteURL . 'typo3/js/extjs/ux/resize.css');
        // Add RTE JavaScript
        $this->addRteJsFiles($this->TCEform->RTEcounter);
        $this->pageRenderer->addJsFile($this->buildJSMainLangFile($this->TCEform->RTEcounter));
        $this->pageRenderer->addJsInlineCode('HTMLArea-init', $this->getRteInitJsCode(), TRUE);
        /* =======================================
         * DRAW THE EDITOR
         * =======================================
         */
        // Transform value:
        $value = $this->transformContent('rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue);
        // Further content transformation by registered plugins
        foreach ($this->registeredPlugins as $pluginId => $plugin) {
            if ($this->isPluginEnabled($pluginId) && method_exists($plugin, 'transformContent')) {
                $value = $plugin->transformContent($value);
            }
        }
        // draw the textarea
        $item = $this->triggerField($PA['itemFormElName']) . '
			<div id="pleasewait' . $textAreaId . '" class="pleasewait" style="display: block;" >' . $TSFE->csConvObj->conv($TSFE->getLLL('Please wait', $this->LOCAL_LANG), $this->charset, $TSFE->renderCharset) . '</div>
			<div id="editorWrap' . $textAreaId . '" class="editorWrap" style="visibility: hidden; ' . htmlspecialchars($this->RTEWrapStyle) . '">
			<textarea id="RTEarea' . $textAreaId . '" name="' . htmlspecialchars($PA['itemFormElName']) . '" rows="0" cols="0" style="' . htmlspecialchars($this->RTEdivStyle) . '">' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea($value) . '</textarea>
			</div>' . LF;
        return $item;
    }