Example #1
0
 /**
  * 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;
 }
 /**
  * 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');
                 $this->loadModules->load($GLOBALS['TBE_MODULES']);
             }
             $modList = $specialKey == 'modListUser' ? $this->loadModules->modListUser : $this->loadModules->modListGroup;
             foreach ($modList as $theModName) {
                 foreach ($elements as $eKey => $value) {
                     $label = '';
                     // Add label for main module:
                     $pp = explode('_', $value);
                     if (count($pp) > 1) {
                         $label .= $GLOBALS['LANG']->moduleLabels['tabs'][$pp[0] . '_tab'] . '>';
                     }
                     // Add modules own label now:
                     $label .= $GLOBALS['LANG']->moduleLabels['tabs'][$value . '_tab'];
                     if (!strcmp($theModName, $value)) {
                         $dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($label);
                     }
                 }
             }
             break;
     }
     return $dataAcc;
 }
 /**
  * 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');
         }
     }
 }
Example #4
0
 /**
  * Creates the overview information based on which analysis topics were selected.
  *
  * @param	array		Array of analysis topics
  * @param	array		Array of the selected analysis topics (from session variable somewhere)
  * @param	boolean		If set, the full trees of pages/folders are printed.
  * @return	array		Array with accumulated HTML content.
  */
 function ext_printOverview($uInfo, $compareFlags, $printTrees = 0)
 {
     // Prepare for filemount and db-mount
     if ($printTrees) {
         // ... this is if we see the detailed view for a user:
         // Page tree object:
         $pagetree = t3lib_div::makeInstance(!$this->isAdmin() ? 'printAllPageTree_perms' : 'printAllPageTree', $this, $this->returnWebmounts());
         // Here, only readable webmounts are returned (1=1)
         $pagetree->addField('perms_user', 1);
         $pagetree->addField('perms_group', 1);
         $pagetree->addField('perms_everybody', 1);
         $pagetree->addField('perms_userid', 1);
         $pagetree->addField('perms_groupid', 1);
         $pagetree->addField('editlock', 1);
         // Folder tree object:
         $foldertree = t3lib_div::makeInstance('printAllFolderTree', $this, $this->returnFilemounts());
     } else {
         // Page tree object:
         $pagetree = t3lib_div::makeInstance('localPageTree', $this, $this->returnWebmounts('1=1'));
         // Here, ALL webmounts are returned (1=1)
         // Folder tree object:
         $foldertree = t3lib_div::makeInstance('localFolderTree', $this, $this->returnFilemounts());
     }
     // Names for modules:
     $modNames = array('web' => 'Web', 'web_layout' => 'Page', 'web_modules' => 'Modules', 'web_info' => 'Info', 'web_perms' => 'Access', 'web_func' => 'Func', 'web_list' => 'List', 'web_ts' => 'Template', 'file' => 'File', 'file_list' => 'List', 'file_images' => 'Images', 'doc' => 'Doc.', 'help' => 'Help', 'help_about' => 'About', 'help_quick' => 'User manual', 'help_welcome' => 'Welcome', 'user' => 'User', 'user_setup' => 'Setup', 'user_task' => 'Task center');
     // Traverse the enabled analysis topics:
     $out = array();
     foreach ($uInfo as $k => $v) {
         if ($compareFlags[$k]) {
             switch ($k) {
                 case 'filemounts':
                     $out[$k] = $foldertree->getBrowsableTree();
                     break;
                 case 'webmounts':
                     // Print webmounts:
                     $pagetree->addSelfId = 1;
                     $out[$k] = $this->ext_non_readAccessPages();
                     // Add HTML for non-readable webmounts (only shown when viewing details of a user - in overview/comparison ALL mounts are shown)
                     $out[$k] .= $pagetree->getBrowsableTree();
                     // Add HTML for readable webmounts.
                     $this->ext_pageIdsFromMounts = implode(',', array_unique($pagetree->ids));
                     // List of mounted page ids
                     break;
                 case 'tempPath':
                     $out[$k] = $GLOBALS['SOBE']->localPath($v);
                     break;
                 case 'pagetypes_select':
                     $pageTypes = explode(',', $v);
                     foreach ($pageTypes as &$vv) {
                         $vv = $GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('pages', 'doktype', $vv));
                     }
                     $out[$k] = implode('<br />', $pageTypes);
                     break;
                 case 'tables_select':
                 case 'tables_modify':
                     $tables = explode(',', $v);
                     foreach ($tables as &$vv) {
                         if ($vv) {
                             $vv = '<span class="nobr">' . t3lib_iconWorks::getSpriteIconForRecord($vv, array()) . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$vv]['ctrl']['title']) . '</span>';
                         }
                     }
                     $out[$k] = implode('<br />', $tables);
                     break;
                 case 'non_exclude_fields':
                     $nef = explode(',', $v);
                     $table = '';
                     $pout = array();
                     foreach ($nef as $vv) {
                         if ($vv) {
                             list($thisTable, $field) = explode(':', $vv);
                             if ($thisTable != $table) {
                                 $table = $thisTable;
                                 t3lib_div::loadTCA($table);
                                 $pout[] = '<span class="nobr">' . t3lib_iconWorks::getSpriteIconForRecord($table, array()) . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['ctrl']['title']) . '</span>';
                             }
                             if ($GLOBALS['TCA'][$table]['columns'][$field]) {
                                 $pout[] = '<span class="nobr"> - ' . rtrim($GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['columns'][$field]['label']), ':') . '</span>';
                             }
                         }
                     }
                     $out[$k] = implode('<br />', $pout);
                     break;
                 case 'groupList':
                 case 'firstMainGroup':
                     $uGroups = explode(',', $v);
                     $table = '';
                     $pout = array();
                     foreach ($uGroups as $vv) {
                         if ($vv) {
                             $uGRow = t3lib_BEfunc::getRecord('be_groups', $vv);
                             $pout[] = '<tr><td nowrap="nowrap">' . t3lib_iconWorks::getSpriteIconForRecord('be_groups', $uGRow) . '&nbsp;' . htmlspecialchars($uGRow['title']) . '&nbsp;&nbsp;</td><td width=1% nowrap="nowrap">' . $GLOBALS['SOBE']->elementLinks('be_groups', $uGRow) . '</td></tr>';
                         }
                     }
                     $out[$k] = '<table border="0" cellpadding="0" cellspacing="0" width="100%">' . implode('', $pout) . '</table>';
                     break;
                 case 'modules':
                     $mods = explode(',', $v);
                     $mainMod = '';
                     $pout = array();
                     foreach ($mods as $vv) {
                         if ($vv) {
                             list($thisMod, $subMod) = explode('_', $vv);
                             if ($thisMod != $mainMod) {
                                 $mainMod = $thisMod;
                                 $pout[] = '<span class="nobr">' . ($modNames[$mainMod] ? $modNames[$mainMod] : $mainMod) . '</span>';
                             }
                             if ($subMod) {
                                 $pout[] = '<span class="nobr"> - ' . ($modNames[$mainMod . '_' . $subMod] ? $modNames[$mainMod . '_' . $subMod] : $mainMod . '_' . $subMod) . '</span>';
                             }
                         }
                     }
                     $out[$k] = implode('<br />', $pout);
                     break;
                 case 'userTS':
                     $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
                     // Defined global here!
                     $tmpl->tt_track = 0;
                     // Do not log time-performance information
                     $tmpl->fixedLgd = 0;
                     $tmpl->linkObjects = 0;
                     $tmpl->bType = '';
                     $tmpl->ext_expandAllNotes = 1;
                     $tmpl->ext_noPMicons = 1;
                     $out[$k] = $tmpl->ext_getObjTree($v, '', '', '', '', '1');
                     break;
                 case 'userTS_hl':
                     $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]) . '&nbsp;';
                             } 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;
 }
 /**
  * Add selector box items of more exotic kinds.
  *
  * @param	array		The array of items (label,value,icon)
  * @param	array		The "columns" array for the field (from TCA)
  * @param	array		TSconfig for the table/row
  * @param	string		The fieldname
  * @return	array		The $items array modified.
  */
 function addSelectOptionsToItemArray($items, $fieldValue, $TSconfig, $field)
 {
     global $TCA;
     // Values from foreign tables:
     if ($fieldValue['config']['foreign_table']) {
         $items = $this->foreignTable($items, $fieldValue, $TSconfig, $field);
         if ($fieldValue['config']['neg_foreign_table']) {
             $items = $this->foreignTable($items, $fieldValue, $TSconfig, $field, 1);
         }
     }
     // Values from a file folder:
     if ($fieldValue['config']['fileFolder']) {
         $fileFolder = t3lib_div::getFileAbsFileName($fieldValue['config']['fileFolder']);
         if (@is_dir($fileFolder)) {
             // Configurations:
             $extList = $fieldValue['config']['fileFolder_extList'];
             $recursivityLevels = isset($fieldValue['config']['fileFolder_recursions']) ? t3lib_div::intInRange($fieldValue['config']['fileFolder_recursions'], 0, 99) : 99;
             // Get files:
             $fileFolder = rtrim($fileFolder, '/') . '/';
             $fileArr = t3lib_div::getAllFilesAndFoldersInPath(array(), $fileFolder, $extList, 0, $recursivityLevels);
             $fileArr = t3lib_div::removePrefixPathFromList($fileArr, $fileFolder);
             foreach ($fileArr as $fileRef) {
                 $fI = pathinfo($fileRef);
                 $icon = t3lib_div::inList('gif,png,jpeg,jpg', strtolower($fI['extension'])) ? '../' . substr($fileFolder, strlen(PATH_site)) . $fileRef : '';
                 $items[] = array($fileRef, $fileRef, $icon);
             }
         }
     }
     // If 'special' is configured:
     if ($fieldValue['config']['special']) {
         switch ($fieldValue['config']['special']) {
             case 'tables':
                 $temp_tc = array_keys($TCA);
                 $descr = '';
                 foreach ($temp_tc as $theTableNames) {
                     if (!$TCA[$theTableNames]['ctrl']['adminOnly']) {
                         // Icon:
                         $icon = t3lib_iconWorks::mapRecordTypeToSpriteIconName($theTableNames, array());
                         // Add help text
                         $helpText = array();
                         $GLOBALS['LANG']->loadSingleTableDescription($theTableNames);
                         $helpTextArray = $GLOBALS['TCA_DESCR'][$theTableNames]['columns'][''];
                         if (!empty($helpTextArray['description'])) {
                             $helpText['description'] = $helpTextArray['description'];
                         }
                         // Item configuration:
                         $items[] = array($this->sL($TCA[$theTableNames]['ctrl']['title']), $theTableNames, $icon, $helpText);
                     }
                 }
                 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;
 }
 /**
  * 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();
     }
 }