本文整理汇总了PHP中t3lib_BEfunc::getSystemLanguages方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::getSystemLanguages方法的具体用法?PHP t3lib_BEfunc::getSystemLanguages怎么用?PHP t3lib_BEfunc::getSystemLanguages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::getSystemLanguages方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTranslationOverlaysForPage
/**
* Finds the alternative page language overlay records for a page based on
* the sys_language_mode.
*
* Possible Language Modes:
* 1) content_fallback --> all languages
* 2) strict --> available languages with page overlay
* 3) ignore --> available languages with page overlay
* 4) unknown mode or blank --> all languages
*
* @param integer $pageId Page ID.
* @return array An array of translation overlays (or fake overlays) found for the given page.
*/
protected function getTranslationOverlaysForPage($pageId)
{
$translationOverlays = array();
$pageId = intval($pageId);
$site = Tx_Solr_Site::getSiteByPageId($pageId);
$languageModes = array('content_fallback', 'strict', 'ignore');
$hasOverlayMode = in_array($site->getSysLanguageMode(), $languageModes, TRUE);
$isContentFallbackMode = $site->getSysLanguageMode() === 'content_fallback';
if ($hasOverlayMode && !$isContentFallbackMode) {
$translationOverlays = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('pid, sys_language_uid', 'pages_language_overlay', 'pid = ' . $pageId . t3lib_BEfunc::deleteClause('pages_language_overlay') . t3lib_BEfunc::BEenableFields('pages_language_overlay'));
} else {
// ! If no sys_language_mode is configured, all languages will be indexed !
$languages = t3lib_BEfunc::getSystemLanguages();
// remove default language (L = 0)
array_shift($languages);
foreach ($languages as $language) {
$translationOverlays[] = array('pid' => $pageId, 'sys_language_uid' => $language[1]);
}
}
return $translationOverlays;
}
示例2: selectAddSpecial
/**
* Adding "special" types to the $dataAcc array of selector items
*
* @param array Array with numeric keys, containing values for the selector box, prepared for interface. We are going to add elements to this array as needed.
* @param array The array of original elements - basically the field value exploded by ","
* @param string The "special" key from the TCA config of the field. Determines the type of processing in here.
* @return array Modified $dataAcc array
* @access private
* @see renderRecord_selectProc()
*/
function selectAddSpecial($dataAcc, $elements, $specialKey)
{
global $TCA;
// Special select types:
switch ((string) $specialKey) {
case 'tables':
// Listing all tables from $TCA:
$tNames = array_keys($TCA);
foreach ($tNames as $tableName) {
foreach ($elements as $eKey => $value) {
if (!strcmp($tableName, $value)) {
$dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($this->sL($TCA[$value]['ctrl']['title']));
}
}
}
break;
case 'pagetypes':
// Listing all page types (doktype)
$theTypes = $TCA['pages']['columns']['doktype']['config']['items'];
if (is_array($theTypes)) {
foreach ($theTypes as $theTypesArrays) {
foreach ($elements as $eKey => $value) {
if (!strcmp($theTypesArrays[1], $value)) {
$dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($this->sL($theTypesArrays[0]));
}
}
}
}
break;
case 'exclude':
// Listing exclude fields.
$theExcludeFields = t3lib_BEfunc::getExcludeFields();
if (is_array($theExcludeFields)) {
foreach ($theExcludeFields as $theExcludeFieldsArrays) {
foreach ($elements as $eKey => $value) {
if (!strcmp($theExcludeFieldsArrays[1], $value)) {
$dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode(rtrim($theExcludeFieldsArrays[0], ':'));
}
}
}
}
break;
case 'explicitValues':
$theTypes = t3lib_BEfunc::getExplicitAuthFieldValues();
foreach ($theTypes as $tableFieldKey => $theTypeArrays) {
if (is_array($theTypeArrays['items'])) {
foreach ($theTypeArrays['items'] as $itemValue => $itemContent) {
foreach ($elements as $eKey => $value) {
if (!strcmp($tableFieldKey . ':' . $itemValue . ':' . $itemContent[0], $value)) {
$dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode('[' . $itemContent[2] . '] ' . $itemContent[1]);
}
}
}
}
}
break;
case 'languages':
$theLangs = t3lib_BEfunc::getSystemLanguages();
foreach ($theLangs as $lCfg) {
foreach ($elements as $eKey => $value) {
if (!strcmp($lCfg[1], $value)) {
$dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($lCfg[0]);
}
}
}
break;
case 'custom':
$customOptions = $GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions'];
if (is_array($customOptions)) {
foreach ($customOptions as $coKey => $coValue) {
if (is_array($coValue['items'])) {
// Traverse items:
foreach ($coValue['items'] as $itemKey => $itemCfg) {
foreach ($elements as $eKey => $value) {
if (!strcmp($coKey . ':' . $itemKey, $value)) {
$dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($this->sL($itemCfg[0]));
}
}
}
}
}
}
break;
case 'modListGroup':
// Listing modules for GROUPS
// Listing modules for GROUPS
case 'modListUser':
// Listing modules for USERS:
if (!$this->loadModules) {
$this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
//.........这里部分代码省略.........
示例3: __construct
/**
* Constructor of this object
*/
public function __construct($pObj)
{
parent::__construct($pObj);
foreach ($this->indexCTypes as $value) {
$cTypes[] = 'CType="' . $value . '"';
}
$this->whereClauseForCType = implode(' OR ', $cTypes);
// get all available sys_language_uid records
if (TYPO3_VERSION_INTEGER >= 7000000) {
$this->sysLanguages = \TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages();
} else {
$this->sysLanguages = t3lib_BEfunc::getSystemLanguages();
}
// make file repository instance only if TYPO3 version is >= 6.0
if (TYPO3_VERSION_INTEGER >= 6000000) {
if (TYPO3_VERSION_INTEGER >= 6002000) {
/* @var $this->fileRepository \TYPO3\CMS\Core\Resource\FileRepository */
$this->fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
} else {
/* @var $this->fileRepository \TYPO3\CMS\Core\Resource\FileRepository */
$this->fileRepository = t3lib_div::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
}
}
}
示例4: ext_printOverview
//.........这里部分代码省略.........
$tsparser = t3lib_div::makeInstance('t3lib_TSparser');
$tsparser->lineNumberOffset = 0;
$out[$k] = $tsparser->doSyntaxHighlight($v, 0, 1);
break;
case 'explicit_allowdeny':
// Explode and flip values:
$nef = array_flip(explode(',', $v));
$pout = array();
$theTypes = t3lib_BEfunc::getExplicitAuthFieldValues();
// Icons:
$icons = array('ALLOW' => t3lib_iconWorks::getSpriteIcon('status-dialog-ok'), 'DENY' => t3lib_iconWorks::getSpriteIcon('status-dialog-error'));
// Traverse types:
foreach ($theTypes as $tableFieldKey => $theTypeArrays) {
if (is_array($theTypeArrays['items'])) {
$pout[] = '<strong>' . $theTypeArrays['tableFieldLabel'] . '</strong>';
// Traverse options for this field:
foreach ($theTypeArrays['items'] as $itemValue => $itemContent) {
$v = $tableFieldKey . ':' . $itemValue . ':' . $itemContent[0];
if (isset($nef[$v])) {
unset($nef[$v]);
$pout[] = $icons[$itemContent[0]] . '[' . $itemContent[2] . '] ' . $itemContent[1];
} else {
$pout[] = '<em style="color: #666666;">' . $icons[$itemContent[0] == 'ALLOW' ? 'DENY' : 'ALLOW'] . '[' . $itemContent[2] . '] ' . $itemContent[1] . '</em>';
}
}
$pout[] = '';
}
}
// Add remaining:
if (count($nef)) {
$pout = array_merge($pout, array_keys($nef));
}
// Implode for display:
$out[$k] = implode('<br />', $pout);
break;
case 'allowed_languages':
// Explode and flip values:
$nef = array_flip(explode(',', $v));
$pout = array();
// Get languages:
$items = t3lib_BEfunc::getSystemLanguages();
// Traverse values:
foreach ($items as $iCfg) {
if (isset($nef[$iCfg[1]])) {
unset($nef[$iCfg[1]]);
if (strpos($iCfg[2], '.gif') === FALSE) {
$icon = t3lib_iconWorks::getSpriteIcon($iCfg[2]) . ' ';
} elseif (strlen($iCfg[2])) {
$icon = '<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/' . $iCfg[2]) . ' class="absmiddle" style="margin-right: 5px;" alt="" />';
} else {
$icon = '';
}
$pout[] = $icon . $iCfg[0];
}
}
// Add remaining:
if (count($nef)) {
$pout = array_merge($pout, array_keys($nef));
}
// Implode for display:
$out[$k] = implode('<br />', $pout);
break;
case 'workspace_perms':
$out[$k] = implode('<br/>', explode(', ', t3lib_BEfunc::getProcessedValue('be_users', 'workspace_perms', $v)));
break;
case 'workspace_membership':
$out[$k] = implode('<br/>', $this->ext_workspaceMembership());
break;
case 'custom_options':
// Explode and flip values:
$nef = array_flip(explode(',', $v));
$pout = array();
// Initialize:
$customOptions = $GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions'];
if (is_array($customOptions)) {
foreach ($customOptions as $coKey => $coValue) {
if (is_array($coValue['items'])) {
// Traverse items:
foreach ($coValue['items'] as $itemKey => $itemCfg) {
$v = $coKey . ':' . $itemKey;
if (isset($nef[$v])) {
unset($nef[$v]);
$pout[] = $GLOBALS['LANG']->sl($coValue['header']) . ' / ' . $GLOBALS['LANG']->sl($itemCfg[0]);
}
}
}
}
}
// Add remaining:
if (count($nef)) {
$pout = array_merge($pout, array_keys($nef));
}
// Implode for display:
$out[$k] = implode('<br />', $pout);
break;
}
}
}
return $out;
}
示例5: addSelectOptionsToItemArray
//.........这里部分代码省略.........
}
break;
case 'pagetypes':
$theTypes = $TCA['pages']['columns']['doktype']['config']['items'];
foreach ($theTypes as $theTypeArrays) {
// Icon:
$icon = t3lib_iconWorks::mapRecordTypeToSpriteIconName('pages', array('doktype' => $theTypeArrays[1]));
// Item configuration:
$items[] = array($this->sL($theTypeArrays[0]), $theTypeArrays[1], $icon);
}
break;
case 'exclude':
$theTypes = t3lib_BEfunc::getExcludeFields();
$descr = '';
foreach ($theTypes as $theTypeArrays) {
list($theTable, $theField) = explode(':', $theTypeArrays[1]);
// Add help text
$helpText = array();
$GLOBALS['LANG']->loadSingleTableDescription($theTable);
$helpTextArray = $GLOBALS['TCA_DESCR'][$theTable]['columns'][$theField];
if (!empty($helpTextArray['description'])) {
$helpText['description'] = $helpTextArray['description'];
}
// Item configuration:
$items[] = array(rtrim($theTypeArrays[0], ':'), $theTypeArrays[1], 'empty-empty', $helpText);
}
break;
case 'explicitValues':
$theTypes = t3lib_BEfunc::getExplicitAuthFieldValues();
// Icons:
$icons = array('ALLOW' => 'status-status-permission-granted', 'DENY' => 'status-status-permission-denied');
// Traverse types:
foreach ($theTypes as $tableFieldKey => $theTypeArrays) {
if (is_array($theTypeArrays['items'])) {
// Add header:
$items[] = array($theTypeArrays['tableFieldLabel'], '--div--');
// Traverse options for this field:
foreach ($theTypeArrays['items'] as $itemValue => $itemContent) {
// Add item to be selected:
$items[] = array('[' . $itemContent[2] . '] ' . $itemContent[1], $tableFieldKey . ':' . preg_replace('/[:|,]/', '', $itemValue) . ':' . $itemContent[0], $icons[$itemContent[0]]);
}
}
}
break;
case 'languages':
$items = array_merge($items, t3lib_BEfunc::getSystemLanguages());
break;
case 'custom':
// Initialize:
$customOptions = $GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions'];
if (is_array($customOptions)) {
foreach ($customOptions as $coKey => $coValue) {
if (is_array($coValue['items'])) {
// Add header:
$items[] = array($GLOBALS['LANG']->sl($coValue['header']), '--div--');
// Traverse items:
foreach ($coValue['items'] as $itemKey => $itemCfg) {
// Icon:
if ($itemCfg[1]) {
list($icon) = $this->getIcon($itemCfg[1]);
} else {
$icon = 'empty-empty';
}
// Add help text
$helpText = array();
if (!empty($itemCfg[2])) {
$helpText['description'] = $GLOBALS['LANG']->sl($itemCfg[2]);
}
// Add item to be selected:
$items[] = array($GLOBALS['LANG']->sl($itemCfg[0]), $coKey . ':' . preg_replace('/[:|,]/', '', $itemKey), $icon, $helpText);
}
}
}
}
break;
case 'modListGroup':
case 'modListUser':
$loadModules = t3lib_div::makeInstance('t3lib_loadModules');
$loadModules->load($GLOBALS['TBE_MODULES']);
$modList = $fieldValue['config']['special'] == 'modListUser' ? $loadModules->modListUser : $loadModules->modListGroup;
if (is_array($modList)) {
$descr = '';
foreach ($modList as $theMod) {
// Icon:
$icon = $GLOBALS['LANG']->moduleLabels['tabs_images'][$theMod . '_tab'];
if ($icon) {
$icon = '../' . substr($icon, strlen(PATH_site));
}
// Add help text
$helpText = array('title' => $GLOBALS['LANG']->moduleLabels['labels'][$theMod . '_tablabel'], 'description' => $GLOBALS['LANG']->moduleLabels['labels'][$theMod . '_tabdescr']);
// Item configuration:
$items[] = array($this->addSelectOptionsToItemArray_makeModuleData($theMod), $theMod, $icon, $helpText);
}
}
break;
}
}
// Return the items:
return $items;
}
示例6: __construct
/**
* Construcor of this object
*/
public function __construct($pObj)
{
parent::__construct($pObj);
if (TYPO3_VERSION_INTEGER < 6002000) {
$this->templavoilaIsLoaded = t3lib_extMgm::isLoaded('templavoila');
} else {
$this->templavoilaIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('templavoila');
}
if ($this->templavoilaIsLoaded) {
if (TYPO3_VERSION_INTEGER >= 7000000) {
$enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('pages') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages');
} else {
$enableFields = t3lib_BEfunc::BEenableFields('pages') . t3lib_BEfunc::deleteClause('pages');
}
$row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid,title', 'pages', 'pid = 0' . $enableFields);
$GLOBALS['TT'] = new t3lib_timeTrackNull();
if (TYPO3_VERSION_INTEGER >= 6002000) {
$GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], $row['uid'], 0);
$GLOBALS['TSFE']->sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_pageSelect');
} else {
$GLOBALS['TSFE'] = t3lib_div::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], $row['uid'], 0);
$GLOBALS['TSFE']->sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
}
$GLOBALS['TSFE']->sys_page->init(TRUE);
$GLOBALS['TSFE']->initTemplate();
// Filling the config-array, first with the main "config." part
if (is_array($GLOBALS['TSFE']->tmpl->setup['config.'])) {
$GLOBALS['TSFE']->config['config'] = $GLOBALS['TSFE']->tmpl->setup['config.'];
}
// override it with the page/type-specific "config."
if (is_array($GLOBALS['TSFE']->pSetup['config.'])) {
if (TYPO3_VERSION_INTEGER >= 7000000) {
$GLOBALS['TSFE']->config['config'] = TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($GLOBALS['TSFE']->config['config'], $GLOBALS['TSFE']->pSetup['config.']);
} else {
$GLOBALS['TSFE']->config['config'] = t3lib_div::array_merge_recursive_overrule($GLOBALS['TSFE']->config['config'], $GLOBALS['TSFE']->pSetup['config.']);
}
}
// generate basic rootline
$GLOBALS['TSFE']->rootLine = array(0 => array('uid' => $row['uid'], 'title' => $row['title']));
if (TYPO3_VERSION_INTEGER >= 6002000) {
$this->tv = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_templavoila_pi1');
} else {
$this->tv = t3lib_div::makeInstance('tx_templavoila_pi1');
}
}
$this->counter = 0;
foreach ($this->indexCTypes as $value) {
$cTypes[] = 'CType="' . $value . '"';
}
$this->whereClauseForCType = implode(' OR ', $cTypes);
// get all available sys_language_uid records
if (TYPO3_VERSION_INTEGER >= 7000000) {
$this->sysLanguages = TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages();
} else {
$this->sysLanguages = t3lib_BEfunc::getSystemLanguages();
}
}