本文整理汇总了PHP中TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version方法的典型用法代码示例。如果您正苦于以下问题:PHP VersionNumberUtility::getNumericTypo3Version方法的具体用法?PHP VersionNumberUtility::getNumericTypo3Version怎么用?PHP VersionNumberUtility::getNumericTypo3Version使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\VersionNumberUtility
的用法示例。
在下文中一共展示了VersionNumberUtility::getNumericTypo3Version方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isVersionSuitable
/**
* 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: render
/**
* @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);
}
}
示例3: render
/**
* Prints icon html for $identifier key
*
* @param string $identifier
* @param string $size
* @param string $overlay
* @param string $altSrc
* @param string $altText
* @author Benjamin Butschell <bb@webprofil.at>
* @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';
}
}
}
}
示例4: getView
/**
* Creates the view object for the HTML client.
*
* @param \MW_Config_Interface $config Configuration object
* @param \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder URL builder object
* @param array $templatePaths List of base path names with relative template paths as key/value pairs
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface|null $request Request object
* @param string|null $locale Code of the current language or null for no translation
* @return MW_View_Interface View object
*/
public static function getView(\MW_Config_Interface $config, \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder $uriBuilder, array $templatePaths, \TYPO3\CMS\Extbase\Mvc\RequestInterface $request = null, $locale = null)
{
$params = $fixed = array();
if ($request !== null && $locale !== null) {
$fixed = self::getFixedParams($config, $request);
// required for reloading to the current page
$params = $request->getArguments();
$params['target'] = $GLOBALS["TSFE"]->id;
$i18n = Base::getI18n(array($locale), $config->get('i18n', array()));
$translation = $i18n[$locale];
} else {
$translation = new \MW_Translation_None('en');
}
$view = new \MW_View_Default();
// workaround for TYPO3 6.2 bug (UriBuilder is incomplete)
if ($request !== null || \TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version() >= '7.0.0') {
$helper = new \MW_View_Helper_Url_Typo3($view, $uriBuilder, $fixed);
} else {
$helper = new \MW_View_Helper_Url_None($view);
}
$view->addHelper('url', $helper);
$helper = new \MW_View_Helper_Translate_Default($view, $translation);
$view->addHelper('translate', $helper);
$helper = new \MW_View_Helper_Partial_Default($view, $config, $templatePaths);
$view->addHelper('partial', $helper);
$helper = new \MW_View_Helper_Parameter_Default($view, $params);
$view->addHelper('param', $helper);
$helper = new \MW_View_Helper_Config_Default($view, $config);
$view->addHelper('config', $helper);
$sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
$sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
$helper = new \MW_View_Helper_Number_Default($view, $sepDec, $sep1000);
$view->addHelper('number', $helper);
$helper = new \MW_View_Helper_FormParam_Default($view, array($uriBuilder->getArgumentPrefix()));
$view->addHelper('formparam', $helper);
$helper = new \MW_View_Helper_Encoder_Default($view);
$view->addHelper('encoder', $helper);
$helper = new \MW_View_Helper_Csrf_Default($view);
$view->addHelper('csrf', $helper);
$body = @file_get_contents('php://input');
$helper = new \MW_View_Helper_Request_Default($view, $body, $_SERVER['REMOTE_ADDR']);
$view->addHelper('request', $helper);
return $view;
}
示例5: setPageTca
/**
* Generates and sets the tca for all the extended pages
*
* @param array $tca
* @author Benjamin Butschell <bb@webprofil.at>
*/
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);
}
示例6: defined
<?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;
}
示例7: isTypo3LTS7
/**
* @return bool
*/
private function isTypo3LTS7()
{
return \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version()) >= 7006000;
}
示例8: isLegacyCoreVersion
/**
* @return boolean
*/
protected function isLegacyCoreVersion()
{
return FALSE === version_compare(VersionNumberUtility::getNumericTypo3Version(), '7.1.0', '>=');
}
示例9: isMinTypo3Version
/**
* Returns TRUE if the current TYPO3 version es equal or greater than the given version
*
* @param $minVersion
* @return bool
*/
public static function isMinTypo3Version($minVersion)
{
$currentVersionAsInt = VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version());
$minVersionAsInt = VersionNumberUtility::convertVersionNumberToInteger($minVersion);
return $currentVersionAsInt >= $minVersionAsInt;
}
示例10: die
<?php
// backwards compatibility for typo3 6.2
$version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version();
$versionNumber = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($version);
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin('MASK.' . $_EXTKEY, 'ContentRenderer', array('Frontend' => 'contentelement'), array('Frontend' => ''));
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:mask/Configuration/TypoScript/page.txt">');
// Load JSON file
$extConf = unserialize($_EXTCONF);
if (!empty($extConf["json"]) && file_exists(PATH_site . $extConf["json"])) {
$json = json_decode(file_get_contents(PATH_site . $extConf["json"]), true);
}
// Icon registry
// backwards compatibility for typo3 6.2
if ($versionNumber >= 7005000) {
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance("TYPO3\\CMS\\Core\\Imaging\\IconRegistry");
$maskIcons = array("Check", "Date", "Datetime", "File", "Float", "Inline", "Integer", "Link", "Radio", "Richtext", "Select", "String", "Text");
foreach ($maskIcons as $maskIcon) {
$iconRegistry->registerIcon('mask-fieldtype-' . $maskIcon, 'TYPO3\\CMS\\Core\\Imaging\\IconProvider\\SvgIconProvider', array('source' => 'EXT:mask/Resources/Public/Icons/fieldtypes/' . $maskIcon . '.svg'));
}
}
// generate page TSconfig
$content = "";
$temp = "";
// Load page.ts Template
$template = file_get_contents(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('mask') . "Resources/Private/Mask/page.ts", true);
// make content-Elements
if ($json["tt_content"]["elements"]) {
示例11: checkTypo3Dependency
/**
* Returns true if current TYPO3 version fulfills extension requirements
*
* @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
* @return boolean
* @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
*/
protected function checkTypo3Dependency(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency)
{
$lowerCaseIdentifier = strtolower($dependency->getIdentifier());
if ($lowerCaseIdentifier === 'typo3') {
if (!($dependency->getLowestVersion() === '') && version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version(), $dependency->getLowestVersion()) === -1) {
throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Your TYPO3 version is lower than necessary. You need at least TYPO3 version ' . $dependency->getLowestVersion());
}
if (!($dependency->getHighestVersion() === '') && version_compare($dependency->getHighestVersion(), \TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version()) === -1) {
throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Your TYPO3 version is higher than allowed. You can use TYPO3 versions ' . $dependency->getLowestVersion() . ' - ' . $dependency->getHighestVersion());
}
} else {
throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('checkTypo3Dependency can only check TYPO3 dependencies. Found dependency with identifier "' . $dependency->getIdentifier() . '"');
}
return TRUE;
}
示例12: addFlashMessage
/**
* Creates a Message object and adds it to the FlashMessageQueue.
*
* @param string $messageBody The message
* @param string $messageTitle Optional message title
* @param integer $severity Optional severity, must be one of \TYPO3\CMS\Core\Messaging\FlashMessage constants
* @param boolean $storeInSession Optional, defines whether the message should be stored in the session (default) or not
* @return void
* @throws \InvalidArgumentException if the message body is no string
* @see \TYPO3\CMS\Core\Messaging\FlashMessage
* @api
*/
public function addFlashMessage($messageBody, $messageTitle = '', $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::OK, $storeInSession = TRUE)
{
if (VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version()) >= 6002000) {
parent::addFlashMessage($messageBody, $messageTitle, $severity, $storeInSession);
} else {
$this->flashMessageContainer->add($messageTitle, $messageBody, $severity);
}
}
示例13: defined
<?php
defined('TYPO3_MODE') or die;
if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version()) > 7005000 && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('rtehtmlarea')) {
$additionalColumns = array('static_lang_isocode' => array('exclude' => 0, 'label' => 'LLL:EXT:rtehtmlarea/Resources/Private/Language/locallang_db.xlf:tx_rtehtmlarea_acronym.static_lang_isocode', 'config' => array('type' => 'select', 'renderType' => 'selectSingle', 'items' => array(array('', 0)), 'foreign_table' => 'static_languages', 'foreign_table_where' => 'ORDER BY static_languages.lg_name_en', 'itemsProcFunc' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\TcaSelectItemsProcessor->translateLanguagesSelector', 'size' => 1, 'minitems' => 0, 'maxitems' => 1, 'wizards' => array('suggest' => array('type' => 'suggest', 'default' => array('receiverClass' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\Wizard\\SuggestReceiver'))))));
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tx_rtehtmlarea_acronym', $additionalColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tx_rtehtmlarea_acronym', 'static_lang_isocode');
}