/** * renders the data for all tabs in the user setup and returns * everything that is needed with tabs and dyntab menu * * @return ready to use for the dyntabmenu itemarray */ protected function renderUserSetup() { $result = array(); $firstTabLabel = ''; $code = array(); $i = 0; $fieldArray = $this->getFieldsFromShowItem(); $this->dividers2tabs = isset($GLOBALS['TYPO3_USER_SETTINGS']['ctrl']['dividers2tabs']) ? intval($GLOBALS['TYPO3_USER_SETTINGS']['ctrl']['dividers2tabs']) : 0; $tabLabel = ''; foreach ($fieldArray as $fieldName) { $more = ''; if (substr($fieldName, 0, 8) == '--div--;') { if ($firstTabLabel == '') { // first tab $tabLabel = $this->getLabel(substr($fieldName, 8), '', false); $firstTabLabel = $tabLabel; } else { if ($this->dividers2tabs) { $result[] = array('label' => $tabLabel, 'content' => count($code) ? $this->doc->spacer(20) . $this->doc->table($code) : ''); $tabLabel = $this->getLabel(substr($fieldName, 8), '', false); $i = 0; $code = array(); } } continue; } $config = $GLOBALS['TYPO3_USER_SETTINGS']['columns'][$fieldName]; // field my be disabled in setup.fields if (isset($this->tsFieldConf[$fieldName . '.']['disabled']) && $this->tsFieldConf[$fieldName . '.']['disabled'] == 1) { continue; } if (isset($config['access']) && !$this->checkAccess($config)) { continue; } $label = $this->getLabel($config['label'], $fieldName); $label = $this->getCSH($config['csh'] ? $config['csh'] : $fieldName, $label); $type = $config['type']; $eval = $config['eval']; $class = $config['class']; $style = $config['style']; if ($class) { $more .= ' class="' . $class . '"'; } if ($style) { $more .= ' style="' . $style . '"'; } if ($this->overrideConf[$fieldName]) { $more .= ' disabled="disabled"'; } $value = $config['table'] == 'be_users' ? $GLOBALS['BE_USER']->user[$fieldName] : $GLOBALS['BE_USER']->uc[$fieldName]; if (!$value && isset($config['default'])) { $value = $config['default']; } switch ($type) { case 'text': case 'password': $dataAdd = ''; if ($config['table'] == 'be_users') { $dataAdd = '[be_users]'; } if ($eval == 'md5') { $more .= ' onchange="this.value=this.value?MD5(this.value):\'\';"'; } if ($type == 'password') { $value = ''; } $noAutocomplete = $type == 'password' ? 'autocomplete="off" ' : ''; $html = '<input id="field_' . $fieldName . '" type="' . $type . '" name="data' . $dataAdd . '[' . $fieldName . ']" ' . $noAutocomplete . 'value="' . htmlspecialchars($value) . '" ' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . $more . ' />'; break; case 'check': if (!$class) { $more .= ' class="check"'; } $html = '<input id="field_' . $fieldName . '" type="checkbox" name="data[' . $fieldName . ']"' . ($value ? ' checked="checked"' : '') . $more . ' />'; break; case 'select': if (!$class) { $more .= ' class="select"'; } if ($config['itemsProcFunc']) { $html = t3lib_div::callUserFunction($config['itemsProcFunc'], $config, $this, ''); } else { $html = '<select id="field_' . $fieldName . '" name="data[' . $fieldName . ']"' . $more . '>' . LF; foreach ($config['items'] as $key => $optionLabel) { $html .= '<option value="' . $key . '"' . ($value == $key ? ' selected="selected"' : '') . '>' . $this->getLabel($optionLabel, '', false) . '</option>' . LF; } $html .= '</select>'; } break; case 'user': $html = t3lib_div::callUserFunction($config['userFunc'], $config, $this, ''); break; default: $html = ''; } $code[$i][1] = $label; $code[$i++][2] = $html; } if ($this->dividers2tabs == 0) { $tabLabel = $firstTabLabel; } $result[] = array('label' => $tabLabel, 'content' => count($code) ? $this->doc->spacer(20) . $this->doc->table($code) : ''); return $result; }
/** * Records overview * * @return void */ function func_records() { global $LANG, $TCA, $BACK_PATH, $PAGES_TYPES; $admin = t3lib_div::makeInstance('t3lib_admin'); $admin->genTree_makeHTML = 0; $admin->backPath = $BACK_PATH; $admin->genTree(0, ''); $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('records')); $this->content .= $this->doc->spacer(5); // Pages stat $codeArr = array(); $codeArr['tableheader'] = array('', $GLOBALS['LANG']->getLL('count')); $i++; $codeArr[$i][] = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/i/pages.gif', 'width="18" height="16"') . ' hspace="4" align="top" alt="" />'; $codeArr[$i][] = $GLOBALS['LANG']->getLL('total_pages'); $codeArr[$i][] = count($admin->page_idArray); $i++; if (t3lib_extMgm::isLoaded('cms')) { $codeArr[$i][] = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/hidden_page.gif', 'width="18" height="16"') . ' hspace="4" align="top">'; $codeArr[$i][] = $GLOBALS['LANG']->getLL('hidden_pages'); $codeArr[$i][] = $admin->recStat['hidden']; $i++; } $codeArr[$i][] = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/deleted_page.gif', 'width="18" height="16"') . ' hspace="4" align="top">'; $codeArr[$i][] = $GLOBALS['LANG']->getLL('deleted_pages'); $codeArr[$i][] = $admin->recStat['deleted']; $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('pages'), $this->doc->table($codeArr), false, true); // Doktype $codeArr = array(); $codeArr['tableheader'] = array($GLOBALS['LANG']->getLL('doktype_value'), $GLOBALS['LANG']->getLL('count')); $doktype = $TCA['pages']['columns']['doktype']['config']['items']; if (is_array($doktype)) { foreach ($doktype as $n => $setup) { if ($setup[1] != '--div--') { $codeArr[$n][] = '<img' . t3lib_iconWorks::skinImg($BACK_PATH, 'gfx/i/' . ($PAGES_TYPES[$setup[1]]['icon'] ? $PAGES_TYPES[$setup[1]]['icon'] : $PAGES_TYPES['default']['icon']), 'width="18" height="16"') . ' hspace="4" align="top">'; $codeArr[$n][] = $GLOBALS['LANG']->sL($setup[0]) . ' (' . $setup[1] . ')'; $codeArr[$n][] = intval($admin->recStat[doktype][$setup[1]]); } } $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('doktype'), $this->doc->table($codeArr), false, true); } // Tables and lost records $id_list = '-1,0,' . implode(array_keys($admin->page_idArray), ','); $id_list = t3lib_div::rm_endcomma($id_list); $admin->lostRecords($id_list); if ($admin->fixLostRecord(t3lib_div::_GET('fixLostRecords_table'), t3lib_div::_GET('fixLostRecords_uid'))) { $admin = t3lib_div::makeInstance('t3lib_admin'); $admin->backPath = $BACK_PATH; $admin->genTree(0, ''); $id_list = '-1,0,' . implode(array_keys($admin->page_idArray), ','); $id_list = t3lib_div::rm_endcomma($id_list); $admin->lostRecords($id_list); } $this->doc->table_TABLE = '<table border="0" cellspacing="0" cellpadding="0" class="typo3-dblist" style="width:700px!important;">'; $codeArr = array(); $codeArr['tableheader'] = array($GLOBALS['LANG']->getLL('label'), $GLOBALS['LANG']->getLL('tablename'), $GLOBALS['LANG']->getLL('total_lost'), ''); $countArr = $admin->countRecords($id_list); if (is_array($TCA)) { foreach ($TCA as $t => $value) { if ($TCA[$t]['ctrl']['hideTable']) { continue; } $codeArr[$t][] = t3lib_iconWorks::getSpriteIconForRecord($t, array()); $codeArr[$t][] = $LANG->sL($TCA[$t]['ctrl']['title']); $codeArr[$t][] = $t; if ($countArr['all'][$t]) { $theNumberOfRe = intval($countArr['non_deleted'][$t]) . '/' . (intval($countArr['all'][$t]) - intval($countArr['non_deleted'][$t])); } else { $theNumberOfRe = ''; } $codeArr[$t][] = $theNumberOfRe; $lr = ''; if (is_array($admin->lRecords[$t])) { foreach ($admin->lRecords[$t] as $data) { if (!t3lib_div::inList($admin->lostPagesList, $data[pid])) { $lr .= '<nobr><strong><a href="index.php?SET[function]=records&fixLostRecords_table=' . $t . '&fixLostRecords_uid=' . $data[uid] . '"><img src="' . $BACK_PATH . 'gfx/required_h.gif" width="10" hspace="3" height="10" border="0" align="top" title="' . $GLOBALS['LANG']->getLL('fixLostRecord') . '"></a>uid:' . $data[uid] . ', pid:' . $data[pid] . ', ' . t3lib_div::fixed_lgd_cs(strip_tags($data[title]), 20) . '</strong></nobr><br>'; } else { $lr .= '<nobr><img src="' . $BACK_PATH . 'clear.gif" width="16" height="1" border="0"><font color="Gray">uid:' . $data[uid] . ', pid:' . $data[pid] . ', ' . t3lib_div::fixed_lgd_cs(strip_tags($data[title]), 20) . '</font></nobr><br>'; } } } $codeArr[$t][] = $lr; } $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('tables'), $this->doc->table($codeArr), false, true); } }